A Comparative Analysis of Machine Learning Models for Crop Classification Using Soil Nutrients and Environmental Data

Authors

  • Muhammad Aamir COMSATS University Islamabad Sahiwal, Campus, Punjab, Pakistan , Superior University Lahore Author
  • Muhammad Waseem Iqbal Superior University Lahore Author
  • Muhammad Kashif University of Southern Punjab, Multan, Pakistan Author
  • Muhammad Yasir Bilal Muhammad Nawaz Sharif University of Engineering & Technology, Multan, Pakistan Author

Keywords:

light gradient boosting, decision tree, random forest, logistic regression, soil nutrients, agricultural product

Abstract

Purpose: Agriculture is essential to the growth of the world economy. Food availability today largely depends on whether crops have been harvested properly. The machine learning methods described in this research use soil nutrient and environmental data to classify crops.

Methodology: This study focuses on using only current soil and weather data to classify suitable crops. Several machine learning algorithms, such as light gradient boosting, decision trees, random forests, and logistic regression, are applied to evaluate crop classification models on soil and environmental data.

Findings: To calculate accuracy, precision, recall, and f1-score, this research used the available data from Kaggle. The decision tree and random forest algorithms achieve an approximately 99% accuracy by using the cross-validation method under the applied evaluation setting.

Originality: A comparison with other existing models reveals that the decision tree and random forest algorithms get higher results among the applied models. These models achieved the highest accuracy because they effectively capture complex, nonlinear relationships between soil nutrients and environmental factors, and reduce overfitting.

Practical implications: The findings of this work may support future research and decision-support tools for crop classification models.

References

Agrawal, N., Govil, H. and Kumar, T. (2025), "Agricultural land suitability classification and crop suggestion using machine learning and spatial multicriteria decision analysis in semi-arid ecosystem", Environment, Development and Sustainability, Vol. 27 No. 6, pp. 13689-13726.

Ahmad, I., Saeed, U., Fahad, M., Ullah, A., Habib ur Rahman, M., Ahmad, A. and Judge, J. (2018), "Yield forecasting of spring maize using remote sensing and crop modeling in Faisalabad-Punjab Pakistan", Journal of the Indian Society of Remote Sensing, Vol. 46, pp. 1701-1711.

Aliwi, H. R. and Al-Tuwaijari, J. M. (2025), "Crops Recommendation System Based on Rain Data Using Machine Learning Techniques", مجلة جامعة الكوت, Vol. 10 No. 2, pp. 243-256.

Azadnia, R., Rajabipour, A., Jamshidi, B. and Omid, M. (2023), "New approach for rapid estimation of leaf nitrogen, phosphorus, and potassium contents in apple-trees using Vis/NIR spectroscopy based on wavelength selection coupled with machine learning", Computers and Electronics in Agriculture, Vol. 207, pp. 107746.

Bali, N. and Singla, A. (2022), "Emerging trends in machine learning to predict crop yield and study its influential factors: A survey", Archives of computational methods in engineering, pp. 1-18.

Chen, J., Zhao, L., Wang, B., He, X., Duan, L. and Yu, G. (2024), "Uncovering global risk to human and ecosystem health from pesticides in agricultural surface water using a machine learning approach", Environment International, Vol. 194, pp. 109154.

Dai, J., Chen, X., Zhang, Y., Zhang, M., Dong, Y., Zheng, Q., Liao, J. and Zhao, Y. (2025), "Machine learning-enhanced color recognition of test strips for rapid pesticide residue detection in fruits and vegetables", Food Control, Vol. 174, pp. 111256.

Debicka, M., Jamroz, E., Bekier, J., Ćwieląg-Piasecka, I. and Kocowicz, A. (2023), "The influence of municipal solid waste compost on the tranformations of phosphorus forms in soil", Agronomy, Vol. 13 No. 5, pp. 1234.

Eddamiri, S., Bassine, F. Z., Ongoma, V., Epule Epule, T. and Chehbouni, A. (2024), "An automatic ensemble machine learning for wheat yield prediction in Africa", Multimedia Tools and Applications, pp. 1-27.

Elbasi, E., Chamseddine, Z., Topcu, A. E., Abdelbaki, W., Zreikat, A. I., Cina, E., Shdefat, A. Y. and Saker, L. (2023), "Crop prediction model using machine learning algorithms".

Filippi, P., Jones, E. J., Wimalathunge, N. S., Somarathna, P. D., Pozza, L. E., Ugbaje, S. U., Jephcott, T. G., Paterson, S. E., Whelan, B. M. and Bishop, T. F. (2019), "An approach to forecast grain crop yield using multi-layered, multi-farm data sets and machine learning", Precision Agriculture, Vol. 20, pp. 1015-1029.

Gawade, S. D., Bhansali, A., Chopade, S. and Kulkarni, U. (2026), "Optimizing crop yield prediction with R2U-Net-AgriFocus: A deep learning architecture with leveraging satellite imagery and agro-environmental data", Expert Systems with Applications, Vol. 296, pp. 128942.

Hageltoum, I. A., Abdallah, E. K., Alfeel, M. I. and Abbas, S. A. (2024), "Predictive modelling of crop rotation using data mining approaches", Journal of Artificial Intelligence and Computational Technology, Vol. 1 No. 1.

Hasan, M., Marjan, M. A., Uddin, M. P., Afjal, M. I., Kardy, S., Ma, S. and Nam, Y. (2023), "Ensemble machine learning-based recommendation system for effective prediction of suitable agricultural crop cultivation", Frontiers in Plant Science, Vol. 14, pp. 1234555.

Iatrou, M., Karydas, C., Iatrou, G., Pitsiorlas, I., Aschonitis, V., Raptis, I., Mpetas, S., Kravvas, K. and Mourelatos, S. (2021), "Topdressing nitrogen demand prediction in rice crop using machine learning systems", Agriculture, Vol. 11 No. 4, pp. 312.

Jorvekar, P. P., Wagh, S. K. and Prasad, J. R. (2024), "Crop yield predictive modeling using optimized deep convolutional neural network: An automated crop management system", Multimedia Tools and Applications, Vol. 83 No. 14, pp. 40295-40322.

kaggle. (2023), "Crop Recommendation Dataset", available at: https://www.kaggle.com/datasets/atharvaingle/crop-recommendation-dataset/data (accessed 30-10-2023).

Kavita, M. and Mathur, P. (2020), "Crop yield estimation in India using machine learning", in 2020 IEEE 5th International Conference on Computing Communication and Automation (ICCCA). IEEE, pp. 220-224.

Khosla, E., Dharavath, R. and Priya, R. (2020), "Crop yield prediction using aggregated rainfall-based modular artificial neural networks and support vector regression", Environment, Development and Sustainability, Vol. 22, pp. 5687-5708.

Leo, S., De Antoni Migliorati, M. and Grace, P. R. (2021), "Predicting within‐field cotton yields using publicly available datasets and machine learning", Agronomy Journal, Vol. 113 No. 2, pp. 1150-1163.

Li, Z., Nie, Z. and Li, G. (2024), "Integrating Crop Modeling and Machine Learning for the Improved Prediction of Dryland Wheat Yield", Agronomy, Vol. 14 No. 4, pp. 777.

Lischeid, G., Webber, H., Sommer, M., Nendel, C. and Ewert, F. (2022), "Machine learning in crop yield modelling: A powerful tool, but no surrogate for science", Agricultural and Forest Meteorology, Vol. 312, pp. 108698.

Mella, N. and Pentakoti, V. M. (2022), "Crop yield prediction and fertilizer recommendation using voting based ensemble classifier", J. Eng. Sci, Vol. 13 No. 8, pp. 262-270.

Pallathadka, H., Mustafa, M., Sanchez, D. T., Sajja, G. S., Gour, S. and Naved, M. (2023), "Impact of machine learning on management, healthcare and agriculture", Materials Today: Proceedings, Vol. 80, pp. 2803-2806.

Pande, S. M., Ramesh, P. K., ANMOL, A., Aishwarya, B., ROHILLA, K. and SHAURYA, K. (2021), "Crop recommender system using machine learning approach", in 2021 5th international conference on computing methodologies and communication (ICCMC). IEEE, pp. 1066-1071.

Pant, J., Pant, R., Singh, M. K., Singh, D. P. and Pant, H. (2021), "Analysis of agricultural crop yield prediction using statistical techniques of machine learning", Materials Today: Proceedings, Vol. 46, pp. 10922-10926.

Paudel, D., Boogaard, H., de Wit, A., Janssen, S., Osinga, S., Pylianidis, C. and Athanasiadis, I. N. (2021), "Machine learning for large-scale crop yield forecasting", Agricultural Systems, Vol. 187, pp. 103016.

Paudel, D., Boogaard, H., de Wit, A., van der Velde, M., Claverie, M., Nisini, L., Janssen, S., Osinga, S. and Athanasiadis, I. N. (2022), "Machine learning for regional crop yield forecasting in Europe", Field Crops Research, Vol. 276, pp. 108377.

Pooja, M., Attavar, A., Manohar, A. L. and Himoshra, D. (2025), "Pattern Prediction System for Smart Farming in the Agriculture Sector Using Machine Learning: Smart Agriculture", in Hybrid Soft Computing Techniques for Machine Learning and Optimization. IGI Global Scientific Publishing, pp. 159-174.

PS, M. G. (2019), "Performance evaluation of best feature subsets for crop yield prediction using machine learning algorithms", Applied Artificial Intelligence, Vol. 33 No. 7, pp. 621-642.

Raju, C., Ashoka, D. and BV, A. P. (2024), "CropCast: Harvesting the future with interfused machine learning and advanced stacking ensemble for precise crop prediction", Kuwait Journal of Science, Vol. 51 No. 1, pp. 100160.

Tripathi, D. and Biswas, S. K. (2026), "A precise artificial intelligence system for multi-class crop yield prediction with ensemble learning and swarm optimization", Environment, Development and Sustainability, pp. 1-28.

Vanarase, V., Mane, V., Bhute, H., Tate, A. and Dhar, S. (2021), "Crop Prediction Using Data Mining and Machine Learning Techniques", in 2021 Third International Conference on Inventive Research in Computing Applications (ICIRCA). IEEE, pp. 1764-1771.

Wang, Y., Shi, W. and Wen, T. (2023), "Prediction of winter wheat yield and dry matter in North China Plain using machine learning algorithms for optimal water and nitrogen application", Agricultural Water Management, Vol. 277, pp. 108140.

Yadav, A. K. and Swarnkar, S. K. (2024), "Exploring the effectiveness of decision trees for comprehensive detection of crop diseases in agricultural environments", in Smart Agriculture. CRC Press, pp. 111-127.

Yao, J., Wu, J., Xiao, C., Zhang, Z. and Li, J. (2022), "The classification method study of crops remote sensing with deep learning, machine learning, and Google Earth engine", Remote Sensing, Vol. 14 No. 12, pp. 2758.

Downloads

Published

2026-09-15

Issue

Section

Research Articles

Categories

How to Cite

Aamir, M. (2026) “A Comparative Analysis of Machine Learning Models for Crop Classification Using Soil Nutrients and Environmental Data”, Frontiers in Engineering, Science & Management, 1(1), pp. 1–9. Available at: https://journal.mnsuet.edu.pk/index.php/fesm/article/view/13 (Accessed: 26 September 2026).

Similar Articles

You may also start an advanced similarity search for this article.