A Machine Learning Framework for Precision Soil Quality Characterization for Crop-Specific Fertilizer Recommendation in Heterogeneous Agro-Ecosystems

Authors

  • Blessing Olajide Olajide University of Ilesa, Ilesa
  • Ayodeji Bamidele Oladipo
  • Olatunji Coker Olabiyi
  • Dare Emmanuel Olayinka
  • Abegunde Omolayo

DOI:

https://doi.org/10.33003/fjs-2026-1022-6172

Keywords:

Precision Agriculture, Soil Quality Index, Principal Component Analysis, Machine Learning, Fertilizer Recommendation, Digital Soil Mapping, Predictor-Label Dependency

Abstract

Accurate fertilizer recommendation is fundamental to precision agriculture, yet many machine learning models rely on static soil nutrient measurements without adequately incorporating environmental factors that influence nutrient availability. This study proposes a hybrid machine learning framework that integrates soil chemical, physical, and climatic variables into a Principal Component Analysis (PCA)-derived Soil Quality Index (SQI) for crop-specific fertilizer recommendation. The framework combines PCA-based feature extraction with Random Forest, Gradient Boosting, and Multilayer Perceptron (MLP) classifiers. Experiments were conducted on an 8,000-record dataset comprising 11 crop types, five soil classes, and seven fertilizer categories. Model development included standardized preprocessing, stratified train-test partitioning, and exhaustive hyperparameter optimization. Despite this rigorous framework, all models achieved only 12.4–14.0% test accuracy, equivalent to the 14.29% random baseline for a seven-class classification problem. Statistical auditing revealed that fertilizer labels were not significantly associated with soil or crop types (Chi-square, p = 0.584 and p = 0.100, respectively), while mutual information between continuous predictors and fertilizer labels was negligible. Learning-curve analysis further showed that the models have excellent training performance but no improvement in validation accuracy, indicating poor predictor-label dependency rather than inadequate model capacity. These findings demonstrate that dataset quality, rather than algorithm selection, constrained predictive performance. The primary contribution of this work is a robust and reusable machine learning pipeline complemented by a systematic predictor-label dependency auditing protocol. This framework provides a practical methodology for validating agricultural datasets before model deployment, thereby improving the reliability, reproducibility, and trustworthiness of precision agriculture and digital soil mapping applications.

References

Adekunle, T. A., Ogunwande, J. M. O., Ogundoyin, I. K., Akanbi, C. O., Babalola, A., Ayoola, T. A., & Roselin, O. F. (2026). A novel hybrid model for species distribution prediction of soil-transmitted helminthiasis (STH) under soil temperature conditions using Random Forest and Particle Swarm Optimization Algorithm. Scientific Reports, 16 Article 31604. https://doi.org/10.1038/s41598-025-31604-y

Alaboz, P., Demir, S., Işıldar, A. A., Tümsavaş, Z., & Cebeci, İ. (2023). Soil quality assessment based on machine learning approach for cultivated lands in semi-humid environmental condition part of Black Sea region. Archives of Agronomy and Soil Science, 69, 2246–2259. https://doi.org/10.1080/03650340.2023.2246656

Blesslin Sheeba, T., Anand, L. D. V., Manohar, G., Selvan, S., Wilfred, C. B., Muthukumar, K., Padmavathy, S., Ramesh Kumar, P., & Asfaw, B. T. (2022). Machine learning algorithm for soil analysis and classification of micronutrients in IoT-enabled automated farms. Journal of Nanomaterials, 2022 Article 5343965. https://doi.org/10.1155/2022/5343965

Díaz-González, F. A., Vuelvas, J., Correa, C. A., Vallejo, V. E., & Patiño, D. (2022). Machine learning and remote sensing techniques applied to estimate soil indicators: A review. Ecological Indicators, 135 Article 108517. https://doi.org/10.1016/j.ecolind.2021.108517

Escorcia-Gutierrez, J., Gamarra, M., Soto-Diaz, R., Pérez, M., Madera, N., & Mansour, R. F. (2022). Intelligent agricultural modelling of soil nutrients and pH classification using ensemble deep learning techniques. Agriculture, 12, Article 977. https://doi.org/10.3390/agriculture12070977

Gyasi, E. K., & Purushotham, S. (2023). Soil-MobiNet: A convolutional neural network model base soil classification to determine soil morphology and its geospatial location. Sensors, 23, Article 6709. https://doi.org/10.3390/s23156709

Kim, D., Kim, T., Jeon, J., & Son, Y. (2023). Convolutional neural network-based soil water content and density prediction model for agricultural land using soil surface images. Applied Sciences, 13, Article 2936. https://doi.org/10.3390/app13052936

Lal, R. (2020). Soil organic matter and water retention. Agronomy Journal, 112, 3265–3277. https://doi.org/10.1002/agj2.20282

Liu, F., Ji, W., Zhang, F., Zhang, Q., & Song, X. (2020). Deep learning-based soil classification using hyperspectral imaging. Computers and Electronics in Agriculture, 175 Article 105580. https://doi.org/10.1016/j.compag.2020.105580

Muthulakshmi, S., Backiyavathy, M. R., Gopalakrishnan, M., Kalpana, R., Thangamani, C., & Indhu Pavithra, S. (2024). Insights of machine learning approach for soil fertility assessment and management strategy. Communications in Soil Science and Plant Analysis, 56, 436–457. https://doi.org/10.1080/00103624.2024.2416920

Olajide, B. O., Adeogun, A. E., Olayinka, T. O., Balogun, E., Areola, R. I., Falade, M. B., & Kemi, O. O. (2025). Analysis of computer network users activities using Support Vector Machine and Long Short-Term Memory Network. Vallis Aurea, 11, 56–65.

Olajide, B. O., Sobowale, S. O., Kemi, O., Elijah, A. A., Olayinka, T. O., Oluwabunmi, O. B., & Adeosun, T. H. (2024). Diagnosing malaria and jaundice using selected machine learning methods. International Journal of Research Publication and Reviews, 5, 3078–3087.

Sahour, H., Gholami, V., Vazifedan, M., & Saeedi, S. (2021). Machine learning applications for water-induced soil erosion modelling and mapping. Soil and Tillage Research, 211 Article 105032. https://doi.org/10.1016/j.still.2021.105032

Shahare, Y. R., Singh, M. P., Singh, S. P., Singh, P., & Diwakar, M. (2024). ASUR: Agriculture soil fertility assessment using a random forest classifier and regressor. Procedia Computer Science, 235 1732–1741. https://doi.org/10.1016/j.procs.2024.04.164

Sujatha, M., Jaidhar, C. D., & Lingappa, M. (2023). 1D convolutional neural networks-based soil fertility classification and fertilizer prescription. Ecological Informatics, 78 Article 102295. https://doi.org/10.1016/j.ecoinf.2023.102295

Vishal, R. (2026). A modified multilayer perceptron model for soil quality classification and nutrient prediction in precision agriculture systems. Biosystems Engineering, 243 118–131. https://doi.org/10.1016/j.biosystemseng.2026.01.009

Vullaganti, N., Mridha, N., & Garg, R. D. (2025). Site-specific soil quality classification for precision management using geospatial and machine learning approaches. Precision Agriculture, 26, 847–869. https://doi.org/10.1007/s11119-025-10108-4

Normalized confusion matrix — Random Forest (best-performing model, test set)

Downloads

Published

02-11-2026

How to Cite

Olajide, B. O., Oladipo, A. B., Olabiyi, O. C., Olayinka, D. E., & Omolayo, A. (2026). A Machine Learning Framework for Precision Soil Quality Characterization for Crop-Specific Fertilizer Recommendation in Heterogeneous Agro-Ecosystems. FUDMA Journal of Sciences, 10(22), 288-295. https://doi.org/10.33003/fjs-2026-1022-6172