Prediktor NPK Berbasis AI untuk Budidaya Kopi dengan Whale Optimization Algorithm
DOI:
https://doi.org/10.36050/6t030w66Keywords:
Computer Vision in Agriculture, NPK Nutrient Deficiency Prediction , NPKin Aja, Support Vector Machine, Whale Optimization AlgorithmAbstract
Coffee is one of Indonesia’s major agricultural commodities, yet its productivity is often limited by inefficient fertilizer management, particularly in determining nitrogen (N), phosphorus (P), and potassium (K) requirements. Although conventional soil and leaf analyses are reliable, they are time-consuming and less practical for smallholder farmers. This underscores the need for an accurate, scalable, and cost-effective solution to optimize fertilizer usage. To address this issue, the study introduces an AI-based predictor for assessing NPK sufficiency in coffee plants. The research integrates computer vision and metaheuristic optimization to form a practical decision-support system. A dataset containing 12,000 images of coffee leaves was classified into three categories: Deficient, Sufficient, and Excessive. Image preprocessing involved resizing, grayscale conversion, HSV transformation, and normalization. Feature extraction utilized Histogram of Oriented Gradients (HOG) and HSV Color Histograms, followed by classification using a Support Vector Machine (SVM) optimized with the Whale Optimization Algorithm (WOA). The model achieved an accuracy exceeding 97%, effectively recognizing Deficient and Sufficient categories, with most misclassifications occurring in the Excessive class due to visual similarities. Model performance was validated using a confusion matrix, learning curve, and PCA visualization, confirming efficient convergence. The study highlights the promise of AI-driven solutions in enhancing precision agriculture and promoting sustainable coffee farming practices.
References
[1] M. J. M. Holle, V. Apriyani, and S. Mumbunan, “Systematic evidence map of coffee agroecosystem management and biodiversity linkages in producing countries,” Cleaner and Circular Bioeconomy, vol. 11, Jul. 2025, doi: 10.1016/j.clcb.2025.100147.
[2] C. Bilen, D. El Chami, V. Mereu, A. Trabucco, S. Marras, and D. Spano, “A Systematic Review on the Impacts of Climate Change on Coffee Agrosystems,” Jan. 01, 2023, MDPI. doi: 10.3390/plants12010102.
[3] USDA, “Production - Coffee,” 2024. Accessed: Apr. 06, 2025. [Online]. Available: https://www.fas.usda.gov/data/production/commodity/0711100
[4] D. Fauzi, U. Purnamasari, S. A. Wicaksono, and C. Maharani, “When local customs meet the market: an analysis of coffee value chain in Tebat Benawa customary community, Indonesia,” Int J Agric Sustain, vol. 21, no. 1, 2023, doi: 10.1080/14735903.2023.2231769.
[5] F. Fitriani, B. Arifin, and H. Ismono, “Indonesian coffee exports and its relation to global market integration,” Journal of Socioeconomics and Development, vol. 4, no. 1, p. 120, Apr. 2021, doi: 10.31328/jsed.v4i1.2115.
[6] D. K. Imron and A. R. A. Satrya, “Women and Coffee Farming: Collective Consciousness towards Social Entrepreneurship in Ulubelu, Lampung,” Jurnal Ilmu Sosial dan Ilmu Politik, vol. 22, no. 3, pp. 216–229, Mar. 2019, doi: 10.22146/JSP.35366.
[7] R. P. da Mota, R. Ferraz-Almeida, R. de Camargo, M. H. R. Franco, J. C. Delvaux, and R. M. Q. Lana, “Organomineral fertilizer in coffee plant (Coffea arabica L.): Fertilizer levels and application times,” Coffee Sci, vol. 18, Feb. 2023, doi: 10.25186/.v18i.2098.
[8] A. M. Hasibuan, Y. Ferry, and S. Wulandari, “Factors affecting farmers’ decision to use organic fertilizers on Robusta coffee plantation: A case study in Tanggamus, Lampung,” in IOP Conference Series: Earth and Environmental Science, IOP Publishing Ltd, Feb. 2022. doi: 10.1088/1755-1315/974/1/012105.
[9] P. Valérie, van A. Piet, M. Claude P, V. Philippe, and A. Clémentine, “Which diversification trajectories make coffee farming more sustainable?,” Jun. 01, 2024, Elsevier B.V. doi: 10.1016/j.cosust.2024.101432.
[10] B. Liu, B. Yang, C. Zhang, X. Wei, H. Cao, and X. Zheng, “Human waste substitute strategies enhanced crop yield, crop quality, and soil fertility in vegetable cultivation soils in North China,” Agronomy, vol. 11, no. 11, Nov. 2021, doi: 10.3390/agronomy11112232.
[11] M. N. Reza et al., “Trends of Soil and Solution Nutrient Sensing for Open Field and Hydroponic Cultivation in Facilitated Smart Agriculture,” Jan. 01, 2025, Multidisciplinary Digital Publishing Institute (MDPI). doi: 10.3390/s25020453.
[12] C. O. Asadu et al., “Enhanced efficiency fertilizers: Overview of production methods, materials used, nutrients release mechanisms, benefits and considerations,” Environmental Pollution and Management, vol. 1, pp. 32–48, Oct. 2024, doi: 10.1016/j.epm.2024.07.002.
[13] N. Aijaz, H. Lan, T. Raza, M. Yaqub, R. Iqbal, and M. S. Pathan, “Artificial intelligence in agriculture: Advancing crop productivity and sustainability,” Apr. 01, 2025, Elsevier B.V. doi: 10.1016/j.jafr.2025.101762.
[14] S. K. Manoharan, R. K. Megalingam, G. A, G. Jogesh, A. K, and A. R. Kunnambath, “AI based early identification and severity detection of nutrient deficiencies in coconut trees,” Smart Agricultural Technology, vol. 9, Dec. 2024, doi: 10.1016/j.atech.2024.100575.
[15] J. D. Thiagarajan et al., “Analysis of banana plant health using machine learning techniques,” Sci Rep, vol. 14, no. 1, Dec. 2024, doi: 10.1038/s41598-024-63930-y.
[16] R. Guido, S. Ferrisi, D. Lofaro, and D. Conforti, “An Overview on the Advancements of Support Vector Machine Models in Healthcare Applications: A Review,” Information (Switzerland), vol. 15, no. 4, Apr. 2024, doi: 10.3390/info15040235.
[17] T. V. Saradhi, “A Study on Hyperparameter Tuning in Support Vector Machines and its Impact on Model Accuracy,” 2025.
[18] F. Septian, “Exploring the Performance of Whale Optimization Algorithm on Rosenbrock’s Function,” Journal of Intelligent Systems and Information Technology, vol. 1, no. 2, p. 2024, 2024, [Online]. Available: https://jurnalapik.id/index.php/jisit
[19] J. Xie, S. Lv, X. Zhang, W. Song, X. Liu, and Y. Lu, “Exploring Nutrient Deficiencies in Lettuce Crops: Utilizing Advanced Multidimensional Image Analysis for Precision Diagnosis,” Sensors, vol. 25, no. 7, Apr. 2025, doi: 10.3390/s25071957.
[20] Z. Li and S. M. Javidan, “ML-based approach to potato diseases diagnosis using image processing and whale optimization algorithm for feature selection,” Smart Agricultural Technology, vol. 12, Dec. 2025, doi: 10.1016/j.atech.2025.101282.
[21] R. Maguire and S. Heckendorn, “Soil Test Note 1: Explanation of Soil Tests,” Virginia Tech, pp. 1–3, 2024, [Online]. Available: www.soiltest.vt.edu/report-notes,
[22] R. Adhikary, S. J. Choudhury, and T. Shankar, “Real-Time Soil Nutrient Monitoring Using NPK Sensors: Enhancing Precision Agriculture,” International Journal of Experimental Research and Review, vol. 45, pp. 197–202, 2024, doi: 10.52756/ijerr.2024.v45spl.015.
[23] T. P. da Costa, D. M. B. da Costa, and F. Murphy, “A systematic review of real-time data monitoring and its potential application to support dynamic life cycle inventories,” Mar. 01, 2024, Elsevier Inc. doi: 10.1016/j.eiar.2024.107416.
[24] Y. Huang, X. Wang, X. Liu, L. Cai, X. Feng, and X. Chen, “A Lightweight Citrus Ripeness Detection Algorithm Based on Visual Saliency Priors and Improved RT-DETR,” Agronomy, vol. 15, no. 5, May 2025, doi: 10.3390/agronomy15051173.
[25] T. Nie et al., “Enhancement and Noise Suppression of Single Low-Light Grayscale Images,” Remote Sens (Basel), vol. 14, no. 14, Jul. 2022, doi: 10.3390/rs14143398.
[26] M. Fahmi Wibawa, M. A. Rahman, and A. W. Widodo, “Penerapan Ruang Warna HSV dan Ekstraksi Fitur Tekstur Local Binary Pattern untuk Tingkat Kematangan Sangrai Biji Kopi,” 2021. [Online]. Available: http://j-ptiik.ub.ac.id
[27] A. Benatti and L. da F. Costa, “Normalization in Proportional Feature Spaces,” Sep. 2024, [Online]. Available: http://arxiv.org/abs/2409.11389
[28] M. A. Sembiring, H. Saputra, R. A. Yusda, S. Sutarman, and E. B. Nababan, “PERFORMANCE OF ROBUST SUPPORT VECTOR MACHINE CLASSIFICATION MODEL ON BALANCED, IMBALANCED AND OUTLIERS DATASETS,” JITK (Jurnal Ilmu Pengetahuan dan Teknologi Komputer), vol. 10, no. 1, pp. 208–215, Aug. 2024, doi: 10.33480/jitk.v10i1.5272.
[29] L. W. Rizkallah, “Optimizing SVM hyperparameters for satellite imagery classification using metaheuristic and statistical techniques,” Int J Data Sci Anal, 2025, doi: 10.1007/s41060-025-00762-7.
Downloads
Published
Issue
Section
License
Copyright (c) 2025 Firza Septian, Agustian Prakarsya (Author)

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.






