Diagnosis of Nutritional Deficiencies in Coffee Plants Through Automated Analysis of Digital Images Using Deep Learning in Uncontrolled Agricultural Environments
Abstract
1. Introduction
2. Materials and Methods
2.1. Study Area and Data Collection
2.2. Data Collection
2.2.1. Capture Protocol
2.2.2. Field Tour
2.3. Data Annotation
2.4. Data Augmentation
2.5. Coffee Detection
YOLO
2.6. Performance Evaluation
3. Results
3.1. Performance
3.2. Application
4. Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Mishra, M.K. Genetic Resources and Breeding of Coffee (Coffea spp.). In Advances in Plant Breeding Strategies: Nut and Beverage Crops; Springer International Publishing: Cham, Switzerland, 2019; pp. 475–515. [Google Scholar] [CrossRef]
- Grashuis, J.; Skevas, T. What is the benefit of membership in farm producer organizations? The case of coffee producers in Peru. Ann. Public Coop. Econ. 2023, 94, 423–443. [Google Scholar] [CrossRef]
- Moreira-Morrillo, A.A.; Vélez-Zambrano, J.P.; Intra Moreira, S.; Garcés-Fiallos, F.R. Diseases affecting the coffee crop: Elucidating the life cycle of Rust, Thread Blight and Cercospora Leaf Spot. Sci. Agropecu. 2023, 13, 395–412. [Google Scholar] [CrossRef]
- León-Burgos, A.F.; Rendón Sáenz, J.R.; Imbachi Quinchua, L.C.; Unigarro, C.A.; Osorio, V.; Khalajabadi, S.S.; Bala-guera-López, H.E. Varying fruit loads modified leaf nutritional status, photosynthetic performance, and bean biochemical composition of coffee trees. Sci. Hortic. 2024, 329, 113005. [Google Scholar] [CrossRef]
- Flores, R.A.; Borges, B.M.M.N.; Almeida, H.J.; De Mello Prado, R. Growth and nutritional disorders of coffee cultivated in nutrient solutions with suppressed macronutrients. J. Plant Nutr. 2016, 39, 1578–1588. [Google Scholar] [CrossRef]
- Perígolo, D.; Nogueira, N.O.; César, M.d.S.; Rocha, B.C.P.; Clemente, J.M. Widespread nutritional imbalances of coffee plantations. J. Plant Nutr. 2023, 46, 2407–2415. [Google Scholar] [CrossRef]
- Evizal, R.; Erry Prasmatiwi, F. Nutrient Deficiency Induces Branch and Shoot Dieback in Robusta Coffee. IOP Conf. Ser. Earth Environ. Sci. 2022, 1012, 012073. [Google Scholar] [CrossRef]
- Martinez, H.E.P.; Souza, R.B.; Abadía Bayona, J.; Hugo Alvarez Venegas, V.; Sanz, M. Coffee-Tree Floral Analysis as a Mean of Nutritional Diagnosis. J. Plant Nutr. 2003, 26, 1467–1482. [Google Scholar] [CrossRef]
- Prathik, K.; Madhuri, J.; Bhanushree, K.J. Deep Learning-Based Fertilizer Recommendation System Using Nutrient Deficiency Prediction. In Proceedings of the 2023 7th International Conference on Computation System and Information Technology for Sustainable Solutions (CSITSS), Bangalore, India, 2–4 November 2023; pp. 1–6. [Google Scholar] [CrossRef]
- Haris, S.; Sai, K.S.; Rani, N.S. Nutrient Deficiency Detection in Mobile Captured Guava Plants using Light Weight Deep Convolutional Neural Networks. In Proceedings of the 2023 2nd International Conference on Applied Artificial Intelligence and Computing (ICAAIC), Salem, India, 4–6 May 2023; pp. 1190–1193. [Google Scholar] [CrossRef]
- Priyaradhikadevi, T.; Santhosh Kumar, C.; Srivani, A.; Palanivel, N.; Madhan, K.; Kavitha, K. Deficiencies Identification and Detection in Grape Plant Leaves Using LSTM and CNN Model. In Proceedings of the 2024 International Conference on System, Computation, Automation and Networking (ICSCAN), Puducherry, India, 27–28 December 2024; pp. 1–5. [Google Scholar] [CrossRef]
- Supreetha, S.; Premalathamma, R.; Manjula, S.H. Deep Learning Techniques to Detect Nutrient Deficiency in Rice Plants. In Proceedings of the 2024 International Conference on Inventive Computation Technologies (ICICT), Lalitpur, Nepal, 24–26 April 2024; pp. 699–705. [Google Scholar] [CrossRef]
- Kalita, H.; Sharma, U. Machine Learning Applications for Precise Nutrient Deficiency Detection in Paddy Farming Using K-Means Clustering and SVM. In Innovative Computing and Communications; Springer: Berlin/Heidelberg, Germany, 2024; pp. 623–631. [Google Scholar] [CrossRef]
- Kolhar, S.; Jagtap, J.; Shastri, R. Deep Neural Networks for Classifying Nutrient Deficiencies in Rice Plants Using Leaf Images. Int. J. Comput. Digit. Syst. 2024, 15, 305–314. [Google Scholar] [CrossRef] [PubMed]
- Bhagirath, S.N.; Bhatnagar, V.; Raja, L. Prediction of Nitrogen Deficiency in Paddy Leaves Using Convolutional Neural Network Model. In Advances in Data-driven Computing and Intelligent Systems; Springer: Berlin/Heidelberg, Germany, 2023; pp. 711–718. [Google Scholar] [CrossRef]
- Begum, S.S.; Chowdary, M.C.C.; Devi, T.R.; Nallamothu, V.P.; Jahnavi, Y. Deep Learning-based Nutrient Deficiency symptoms in plant leaves using Digital Images. In Proceedings of the 2023 Second International Conference on Advances in Computational Intelligence and Communication (ICACIC), Puducherry, India, 7–8 December 2023; pp. 1–5. [Google Scholar] [CrossRef]
- Kamelia, L.; Nurmalasari, R.R. Analysis of Decision Tree and Random Forest Algorithms for Nutrient Deficiency Classification in Citrus Leaves through Image Processing. 2023 17th International Conference on Telecommunication Systems, Services, and Applications, TSSA 2023, Lombok, Indonesia, 12–13 October 2023; Institute of Electrical and Electronics Engineers Inc.: New York, NY, USA, 2023. [Google Scholar] [CrossRef]
- Patel, A.; Mishra, R.; Sharma, A. Classification Nutrient Deficiency of Maize Plant Leaf Using Machine Learning Algorithm. Fusion Pract. Appl. 2025, 17, 78–94. [Google Scholar] [CrossRef]
- Bąk, I. Sustainable Development Goals (SDGs): Concept and measurement. In The Role of Financial Markets in Achieving the Sustainable Development Goals; Edward Elgar Publishing: Cheltenham, UK, 2024; pp. 15–41. [Google Scholar] [CrossRef]
- Tuesta-Monteza, V.A.; Mejia-Cabrera, H.I.; Arcila-Diaz, J. CoLeaf-DB: Peruvian coffee leaf images dataset for coffee leaf nutritional deficiencies detection and classification. Data Brief 2023, 48, 109226. [Google Scholar] [CrossRef] [PubMed]
- Jepkoech, J.; Mugo, D.M.; Kenduiywo, B.K.; Too, E.C. Arabica coffee leaf images dataset for coffee leaf disease detection and classification. Data Brief 2021, 36, 107142. [Google Scholar] [CrossRef] [PubMed]
- Wikipedia. Distrito de Shipasbamba. Available online: https://es.wikipedia.org/wiki/Distrito_de_Shipasbamba (accessed on 14 July 2025).
- Tzutalin. LabelImg: Image Annotation Tool. Available online: https://github.com/HumanSignal/labelImg (accessed on 21 December 2024).
- Ali, M.L.; Zhang, Z. The YOLO Framework: A Comprehensive Review of Evolution, Applications, and Benchmarks in Object Detection. Computers 2024, 13, 336. [Google Scholar] [CrossRef]
- Chen, P.-Y.; Hsieh, C.-J. (Eds.) Chapter 21-Data augmentation for unsupervised machine learning. In Adversarial Robustness for Machine Learning; Academic Press: New York, NY, USA, 2023; pp. 241–250. [Google Scholar] [CrossRef]









| Crop | Technique Used | Dataset | Results |
|---|---|---|---|
| Fertilizers/Plant Deficiencies (various crops) [9] | CNN (ResNet-50) | Leaf images (from digital camera), 20,777 specimens, 11 deficit classes | 98.18% accuracy in diagnosis and fertilizer recommendations |
| Guava [10] | Light CNN (pre-models)-trained) | Smartphone images of guava leaves, quantity unspecified (various deficiencies) | 87% accuracy in detecting Mg and P deficiencies |
| Vine [11] | Hybrid CNN + LSTM | Images of vine leaves with deficiencies of N, Fe, P, Mn, K, Zn, Ca, B, Mg and S. | 98.6% accuracy in health classification vs. multiple impairments |
| Rice [12] | CNN pre-trained (InceptionV3, VGG16/19, ResNet50/152) + SVM | Kaggle NPK dataset: 1156 original images + 3807 augmented images = 4963 total | Accuracy between 91 and 99%; 97.40% without boosting, 99.05% with boosting (ResNet50 + SVM) |
| Rice [13] | K-Means clustering + SVM | Images from the International Rice Research Institute (IRRI) | Average accuracy of 85.3% in identifying deficiencies according to F1, precision and recall |
| Rice [14] | Deep learning framework that employs three models—Xception, Vision Transformer, and MLP Mixer | on rice plant leaves from RGB images | Over 92% accuracy, with the Xception model being the best performer. |
| Rice (nitrogen deficiency) [15] | CNN | RGB images of N-deficient rice leaves | 95% accuracy in identifying nitrogen deficiency |
| Plants (multiple deficiencies) [16] | Block-wise image segmentation, block-wise personalized CNNs, a “winner-take-all” strategy, and response integration with MLP | 3000 images of leaves segmented into blocks | It outperformed human detection in identifying deficiencies; clear differences in growth and chlorophyll content in N, P, and complete treatments |
| Citrus [17] | Machine learning using Decision Tree and Random Forest algorithms. | Images of citrus leaves with various nutritional deficiencies. | The Random Forest method achieved the highest accuracy of 91.25% using a data ratio of 80:20. |
| Maize [18] | Deep learning and conventional machine learning methods, including SVM, Decision Tree, and Gradient Boosting | 36,000 images in total Photographs of leaves with zinc (Zn), potassium (K), nitrogen (N) and phosphorus (P) deficiencies | Decision Tree accuracy of 90.13% |
| Criterion | Worth |
|---|---|
| Distance between rows | 1 m |
| Land area | 10,000 m2 |
| Average plant height | 2.5 m |
| Camera-plant distance | 1.5 m |
| Age of plants | 4 and 6 years old |
| Camera angle | 180° (front) |
| Climate | Sunny |
| Temperature | 21 °C |
| Wind speed | 2 km/h |
| Relative humidity | 81% |
| Capture time | 9:00 AM |
| Date | 15 June 2025 |
| Latitude | 5°54′29.9″ S |
| Longitude | 77°58′51″ W |
| Deficiency | Number of Leaves Observed |
|---|---|
| Iron (Fe) | 450 |
| Magnesium (Mg) | 300 |
| Nitrogen (N) | 482 |
| Phosphorus (P) | 357 |
| Potassium (K) | 411 |
| Calcium (Ca) | 643 |
| Total | 2643 leaves observed |
| Original Images | Data Augmentation | ||
|---|---|---|---|
| Images | Annotations | Images | Annotations |
| 100 | 2643 | 300 | 7929 |
| Parameter | YOLOv8n | YOLOv8x | YOLO11n | YOLO11x |
|---|---|---|---|---|
| Processing Time (s) | 2055.067602 | 4681.006548 | 2074.656137 | 4765.370791 |
| RAM Consumption (MB) | 3033.42 MB | 3200.09 MB | 2791.00 MB | 3071.71 MB |
| CPU Usage (%) | 69.7% | 64.75% | 63.4% | 54.65% |
| Parameter | YOLOv8n | YOLOv8x | YOLO11n | YOLO11x |
|---|---|---|---|---|
| Accuracy (%) | 84.42 | 89.24 | 86.69 | 88.98 |
| Recall (%) | 79.89 | 85.72 | 79.77 | 88.54 |
| F1 Score (%) | 82.14 | 87.44 | 83.09 | 88.76 |
| mAP50 (%) | 87.57 | 92.57 | 88.13 | 92.68 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Calderón-Mosilot, C.; Tapia-Gálvez, U.; Arcila-Diaz, J.; Mejia-Cabrera, H.I. Diagnosis of Nutritional Deficiencies in Coffee Plants Through Automated Analysis of Digital Images Using Deep Learning in Uncontrolled Agricultural Environments. AgriEngineering 2025, 7, 421. https://doi.org/10.3390/agriengineering7120421
Calderón-Mosilot C, Tapia-Gálvez U, Arcila-Diaz J, Mejia-Cabrera HI. Diagnosis of Nutritional Deficiencies in Coffee Plants Through Automated Analysis of Digital Images Using Deep Learning in Uncontrolled Agricultural Environments. AgriEngineering. 2025; 7(12):421. https://doi.org/10.3390/agriengineering7120421
Chicago/Turabian StyleCalderón-Mosilot, Carlos, Ulises Tapia-Gálvez, Juan Arcila-Diaz, and Heber I. Mejia-Cabrera. 2025. "Diagnosis of Nutritional Deficiencies in Coffee Plants Through Automated Analysis of Digital Images Using Deep Learning in Uncontrolled Agricultural Environments" AgriEngineering 7, no. 12: 421. https://doi.org/10.3390/agriengineering7120421
APA StyleCalderón-Mosilot, C., Tapia-Gálvez, U., Arcila-Diaz, J., & Mejia-Cabrera, H. I. (2025). Diagnosis of Nutritional Deficiencies in Coffee Plants Through Automated Analysis of Digital Images Using Deep Learning in Uncontrolled Agricultural Environments. AgriEngineering, 7(12), 421. https://doi.org/10.3390/agriengineering7120421

