Transportation, the environment, business, and agriculture are just a few areas where IoT and DL-based solutions are profoundly impacting. Soil nutrient insufficiency is a prevalent problem that can spread and harm plants if not addressed right away. An IoT-based system that monitors soil and weather conditions for nutrient deficiencies can help increase crop yields. One of the most crucial factors to include in existing deepfakes datasets is soil temperature when modelling terrestrial ecosystems. From January 1, 2010, through December 31, 2018, the Baker, Beach, Cando, Crary, and Fingal weather stations in North Dakota recorded daily weather and soil temperature readings. This study presents an enhanced convolutional neural network-based approach to soil and weather forecasting (CNN). In order to enhance the classification accuracy of the pre-trained CNN architecture, the slime mold algorithm is employed to optimise the model weight.