Research Article | ![]()
Hybrid CNN–ML Framework for Soil Classification and Crop Recommendation
Author(s): Sarika Agarwal1, Himani Bansal2, Roop Singh3*
Published In : International Journal of Electrical and Electronics Research (IJEER) Volume 14, Issue 2
Publisher : FOREX Publication
Published : 25 June 2026
e-ISSN : 2347-470X
Page(s) : 389-402
Abstract
The analysis of soils and proper prediction of crops are very important to help grow more productive agriculture and sustainable food production. A Hybrid CNN–Machine Learning (CNN-ML) Framework for Soil Classification and Crop Prediction is proposed in this paper to combine deep learning and machine learning approaches for intelligent farming decision-making. The proposed framework uses Convolutional Neural Networks (CNNs) for automatic soil classification and machine learning algorithms for crop recommendation. There are five types of soil which are described by their image, such as: Black Soil, Cinder Soil, Laterite Soil, Peat Soil and Yellow Soil. CNN, MobileNetV2 and ResNet50 were implemented and compared to assess the effectiveness of different deep learning architectures. The CNN model was found to be the most effective soil classification model with 98.71% accuracy, which is better than MobileNetV2 and ResNet50, as it can automatically extract discriminative texture, color features from soil images for classification. After soil classification, soil-specific nutrient characteristics (Nitrogen (N), Phosphorus (P), Potassium (K), pH, temperature, humidity and ranges of rainfall) were gathered from literature. A dataset of crops was then downloaded from Kaggle and categorised into five soil types according to these nutrient profiles found in literature. For soil-specific crop prediction, several machine learning algorithms such as Logistic Regression, K-Nearest Neighbors (KNN), Random Forest and XGBoost were evaluated. Each soil category was analyzed independently with Logistic Regression, K-Nearest Neighbors (KNN), Random Forest and XGBoost algorithms for crop prediction. The final performance was calculated by taking mean of the results across the five soil datasets. Experimental results demonstrated that among the different machine learning models, XGBoost model outperforms others with the highest average accuracy of 88.0% in crop prediction. Experimental results showed that XGBoost model has the highest accuracy of 88.0% in crop prediction with the best predictive capability and generalization performance among the other machine learning models.
Keywords: Crop Prediction, CNN, Smart farming, Soil types, Soil texture, Soil Classification.
Sarika Agarwal, Associate Professor, Department of CSE-AI, Noida Institute of Engineering and Technology, Greater Noida, India; Email: sarikagarwal.it@gmail.com
Himani Bansal, Associate Professor, Department of CSE & IT, Jaypee Institute of Information Technology, Noida, India; Email: singal.himani@gmail.com
Roop Singh, Amity Institute of Defence Technology, Amity University, Uttar Pradesh, Noida, India; Email: roopsolanki@gmail.com
-
[1] “India GDP From Agriculture.” Accessed: May 15, 2026. [Online]. Available: https://tradingeconomics.com/india/gdp-from-agriculture.
-
[2] S. M. Shawon, F. B. Ema, A. K. Mahi, F. L. Niha, and H. T. Zubair, “Crop yield prediction using machine learning: An extensive and systematic literature review,” Smart Agric. Technol., vol. 10, p. 100718, 2025.
-
[3] B. Antony, “Prediction of the production of crops with respect to rainfall,” Environ. Res., vol. 202, p. 111624, 2021.
-
[4] Q. M. Ilyas, M. Ahmad, and A. Mehmood, “Automated estimation of crop yield using artificial intelligence and remote sensing technologies,” Bioengineering, vol. 10, no. 2, p. 125, 2023.
-
[5] D. Brown, “Toward crop variety recommender systems,” Agric. Environ. Lett., vol. 11, no. 1, p. e70057, 2026.
-
[6] S. Shastri, S. Kumar, V. Mansotra, and R. Salgotra, “Advancing crop recommendation system with supervised machine learning and explainable artificial intelligence,” Sci. Rep., vol. 15, no. 1, p. 25498, 2025.
-
[7] A. Bhola and P. Kumar, “Farm-level smart crop recommendation framework using machine learning,” Ann. Data Sci., vol. 12, no. 1, pp. 117–140, 2025.
-
[8] T. Dey, S. Bera, L. P. Latua, M. Parua, A. Mukherjee, and D. De, “ICrop: An intelligent crop recommendation system for agriculture 5.0,” IEEE Trans. AgriFood Electron., vol. 2, no. 2, pp. 587–595, 2024.
-
[9] A. Patel, S. Kharb, and R. Choudhari, “Management of crop recommendation system using predictive analytics,” in Emerging Trends in Industrial Engineering and Management, CRC Press, 2026, pp. 210–227.
-
[10] M. Y. Shams, S. A. Gamel, and F. M. Talaat, “Enhancing crop recommendation systems with explainable artificial intelligence: a study on agricultural decision-making,” Neural Comput. Appl., vol. 36, no. 11, pp. 5695–5714, 2024.
-
[11] S. B. Kamatchi and R. Parvathi, “Improvement of crop production using recommender system by weather forecasts,” Procedia Comput. Sci., vol. 165, pp. 724–732, 2019.
-
[12] R. M. Pujahari, S. P. Yadav, and R. Khan, “Intelligent farming system through weather forecast support and crop production,” in Application of Machine Learning in Agriculture, Elsevier, 2022, pp. 113–130.
-
[13] J. Babber, P. Malik, V. Mittal, and K. C. Purohit, “Analyzing supervised learning algorithms for crop prediction and soil quality,” in 2022 6th International Conference on Computing Methodologies and Communication (ICCMC), IEEE, 2022, pp. 969–973.
-
[14] M. Ishak, M. S. Rahaman, and T. Mahmud, “FarmEasy: An intelligent platform to empower crops prediction and crops marketing,” in 2021 13th international conference on information & communication technology and system (ICTS), IEEE, 2021, pp. 224–229.
-
[15] P. A. de Oliveira Morais, D. M. de Souza, M. T. de Melo Carvalho, B. E. Madari, and A. E. de Oliveira, “Predicting soil texture using image analysis,” Microchem. J., vol. 146, pp. 455–463, 2019.
-
[16] K. Abhang, S. Chaughule, P. Chavan, S. Ganjave, and E. VSB, “Soil analysis and crop fertility prediction,” Int. Res. J. Eng. Technol., vol. 5, no. 3, pp. 3106–3108, 2018.
-
[17] “Pandith, V., Kour, H., Singh, S., Manhas, J., & Sharma, V. (2020). Performance evaluation of machine learning techniques for mustard crop yield prediction from soil analysis. Journal of scientific research, 64(2), 394-398”.
-
[18] “Sharma, S., Jain, A., Sharma, S., & Whig, P. (2025). Enhancing crop yield prediction through machine learning regression analysis. International Journal of Sustainable Agricultural Management and Informatics, 11(1), 29-47”.
-
[19] “Patil, Y., Ramachandran, H., Sundararajan, S., & Srideviponmalar, P. (2025). Comparative analysis of machine learning models for crop yield prediction across multiple crop types. SN Computer Science, 6(1), 64”.
-
[20] “Muthulakshmi, S., Backiyavathy, M. R., Gopalakrishnan, M., Kalpana, R., Thangamani, C., & Pavithra, S. I. (2025). Insights of machine learning approach for soil fertility assessment and management strategy. Communications in Soil Science and Plant Analysis, 56(3), 436-457”.
-
[21] “Chauhan, N., Sharma, D., & Dhaneja, D. (2025). A comprehensive crop prediction model leveraging optimization algorithms and machine learning classifiers. In Emerging Trends in Computer Science and Its Application (pp. 150-156). CRC Press”.
-
[22] “Prasad, N. R., Patel, N. R., & Danodia, A. (2021). Crop yield prediction in cotton for regional level using random forest approach. spatial information research, 29(2), 195-206”.
-
[23] “A. M. Lad, K. M. Bharathi, B. A. Saravanan, and R. Karthik, ‘Factors affecting agriculture and estimation of crop yield using supervised learning algorithms,’ Materials Today: Proceedings, vol. 62, pp. 4629–4634, 2022”.
-
[24] “M. Kuradusenge et al., ‘Crop yield prediction using machine learning models: Case of Irish potato and maize,’ Agriculture, vol. 13, no. 1, p. 225, 2023”.
-
[25] “P. Bandara, T. Weerasooriya, T. Ruchirawya, W. Nanayakkara, M. Dimantha, and M. Pabasara, ‘Crop recommendation system,’ International Journal of Computer Applications, vol. 975, p. 8887, 2020”.
-
[26] “N. H. Kulkarni, G. N. Srinivasan, B. M. Sagar, and N. K. Cauvery, ‘Improving crop productivity through a crop recommendation system using ensembling technique,’ in 2018 3rd international conference on computational systems and information technology for sustainable solutions (CSITSS), IEEE, 2018, pp. 114–119”.
-
[27] “Soil Types.” Accessed: May 16, 2026. [Online]. Available: https://www.kaggle.com/datasets/prasanshasatpathy/soil-types
-
[28] “Sandy soil missing key nutrients but don’t want invasive (soil forum at permies).” Accessed: Mar. 25, 2025. [Online]. Available: https://permies.com/t/273935/Sandy-soil-missing-key-nutrients
-
[29] P. Hargreaves, “Soil texture and pH effects on potassium and phosphorus availability,” Potash Dev. Assoc. Lond. UK, 2015.
-
[30] M. V. Nathan, “Soils, plant nutrition and nutrient management,” Univ Mo Ext Available Online Httpsextension2 Mo. Edumg4 Accessed 25 Sept. 2020, 2017.
-
[31] S.-Y. Lee et al., “Effect on chemical and physical properties of soil each peat moss, elemental sulfur, and sulfur-oxidizing bacteria,” Plants, vol. 10, no. 9, p. 1901, 2021.
-
[32] S. P. Manalu, T. Sabrina, and Y. A. Sari, “Exploring the Triad: pH, Nitrogen, and Phosphorus Characteristics of Peat Soils in Humbang Hasundutan Regency,” in E3S Web of Conferences, EDP Sciences, 2024, p. 03009.
-
[33] S. Sundari, “Comparison of dissolved organic carbon and nutrients content in Papua peatland,” in IOP Conference Series: Earth and Environmental Science, IOP Publishing, 2022, p. 012016.
-
[34] G. S. Kumar, P. K. Saini, R. Deoliya, A. K. Mishra, and S. K. Negi, “Characterization of laterite soil and its use in construction applications: a review,” Resour. Conserv. Recycl. Adv., vol. 16, p. 200120, 2022.
-
[35] D. Darmawan, D. Perdana, A. Ismardi, and I. W. Fathona, “Investigating the electrical properties of soil as an indicator of the content of the NPK element in the soil,” Meas. Control, vol. 56, no. 1–2, pp. 351–357, 2023.
-
[36] A. R. Raut, M. R. Wahane, N. H. Khobragade, R. R. Banpatti, S. B. Thorat, and V. A. Rajemahadik, “Effect of NPK levels on the physico-chemical properties and available nutrient status under cluster bean in lateritic soils of Konkan (MS),” 2023.
-
[37] G. S. Vennela and A. Velumani, “Comparative analysis of characteristics of black soil using soil sensor against experimental analysis,” in AIP Conference Proceedings, AIP Publishing, 2024.
-
[38] X. Dou, P. He, P. Zhu, and W. Zhou, “Soil organic carbon dynamics under long-term fertilization in a black soil of China: Evidence from stable C isotopes,” Sci. Rep., vol. 6, no. 1, p. 21488, 2016.
-
[39] Y. He, F. Gu, C. Xu, and Y. Wang, “Assessing of the influence of organic and inorganic amendments on the physical-chemical properties of a red soil (Ultisol) quality,” Catena, vol. 183, p. 104231, 2019.
-
[40] T. Hamazaki and E. P. PANINGBATAN Jr, “Properties and distribution patterns of Red-Yellow and related soils in the Philippines,” JARQ, vol. 30, no. 2, pp. 69–78, 1996.

I. J. of Electrical & Electronics Research