Crop Recommendation Based on Soil and Weather Conditions Using the K-Nearest Neighbors Algorithm
Abstract
The national food self-sufficiency program demands innovation in optimizing the selection of agricultural commodities based on environmental and weather conditions. This challenge is rooted in a fundamental problem faced by farmers—achieving harmony among soil characteristics, weather patterns, and suitable crops. In support of this initiative, it is necessary to develop a crop recommendation system based on machine learning that utilizes key soil and weather condition parameters. This study employs the K-Nearest Neighbors (KNN) algorithm, which functions by identifying the optimal value of ‘K’ to maximize classification accuracy. The KNN algorithm is implemented in a crop recommendation system to classify 1,100 datasets representing ideal growing conditions for 11 crop types. These datasets were generated using a normal distribution approach with a 5% variation from the mean values, and were validated using a clipping function to ensure the data remained within ideal ranges. The results of this study demonstrate that the KNN algorithm achieves high accuracy 96,67% in utilizing soil and weather parameters to generate crop recommendations. The average probability score for the recommended crops was 83.33%. Based on experimental testing, rice was recommended during the rainy and extreme rainy seasons, soybeans were recommended during the dry season, and mung beans were most suitable during extreme dry conditions.
References
Ali, R., Khan, M., & Zafar, N. (2023). Application of machine learning in precision agriculture. Computers and Electronics in Agriculture, 198, 107059.
Barman, A., Roy, D., & Paul, S. (2020). Effect of phosphorus on growth and development of crop plants. Agricultural Sciences, 11(2), 123–129.
Bhargava, M., Sharma, P., & Choudhary, R. (2021). Enhancing fertilizer use efficiency in crops: A review. Agronomy Research, 19(4), 1234–1246.
Deshmukh, S., Kale, R., & Patil, R. (2022). Impact of rainfall variability on crop production in India. Journal of Climatology Studies, 12(3), 78–85.
Dwivedi, R., Srivastava, A., & Pathak, H. (2019). Soil pH and nutrient availability in acidic soils. Indian Journal of Soil Science, 64(1), 45–50.
Gosai, S., & Raval, D. (2021). Crop Recommendation System Using Machine Learning. International Journal of Computer Applications, 183(17), 1–6.
Jat, R., Yadav, A., & Rathore, R. (2020). Sustainable agricultural practices to increase productivity. International Journal of Environmental Science, 8(2), 75–82.
Joshi, M., Sharma, A., & Negi, S. (2021). Effect of excessive rainfall on soil and plant health. Soil & Water Research, 16(2), 89–97.
Kaur, G., & Kaur, P. (2023). KNN algorithm and its application in agricultural recommendation. Journal of Intelligent Systems, 32(4), 212–218.
Kumar, A., & Singh, R. (2022). Comparative analysis of ML models in crop prediction. Journal of Agricultural Informatics, 13(1), 34–40.
Malik, S., Khan, F., & Qureshi, A. (2023). Impact of humidity on fungal disease incidence in crops. Plant Protection Journal, 35(2), 110–117.
Meena, R., Lal, M., & Dey, A. (2021). Nitrogen management for sustainable crop productivity. Advances in Agronomy, 170, 95–112.
Pandey, S., & Tripathi, R. (2022). Role of potassium in improving plant health. Indian Journal of Agronomy, 67(4), 336–344.
Patel, K., Raval, J., & Desai, V. (2022). Temperature stress in tropical crops: Physiology and adaptation. Journal of Plant Research, 38(1), 56–66.
Reddy, B., Rao, G., & Prasad, Y. (2020). Soil potassium and its impact on crop yields. Journal of Soil Fertility, 6(3), 89–96.
Sanchez, P. A. (1976). Properties and Management of Soils in the Tropics.
Wiley. Sharma, V., Mehta, N., & Chandel, A. (2022). Smart farming using AI and IoT: A review. Artificial Intelligence in Agriculture, 5, 34–45.
Singh, N., & Jha, S. (2021). Alkaline soils and micronutrient deficiency in crops. Journal of Environmental Agronomy, 10(3), 140–146.
Suresh, A., & Kumar, P. (2022). SVM-based crop recommendation using soil nutrients. Journal of Machine Learning in Agriculture, 4(2), 98–106.
Tiwari, V., Singh, K., & Yadav, L. (2019). Low nitrogen effects on crop productivity. International Journal of Plant & Soil Science, 27(4), 229–235.
Verma, S., Bharti, R., & Chauhan, N. (2021). Phosphorus toxicity and crop growth inhibition. Agronomy Updates, 9(1), 62–70.
Gosai, H., & Raval, P. (2021). Crop recommendation system using machine learning algorithms. International Journal of Advanced Research in Computer and Communication Engineering, 10(2), 54–58.
Suresh, K., & Kumar, M. (2022). Prediction and recommendation of crops using support vector machine. Journal of Artificial Intelligence and Data Mining, 10(1), 17–24.
Havlin, J. L., Tisdale, S. L., Nelson, W. L., & Beaton, J. D. (2013). Soil fertility and fertilizers: An introduction to nutrient management (8th ed.). Pearson Education.
Brady, N. C., & Weil, R. R. (2008). The nature and properties of soils (14th ed.).
Pearson Prentice Hall. Sanchez, P. A. (1976). Properties and management of soils in the tropics. Wiley-Interscience.
FAO. (2006). Plant nutrition for food security: A guide for integrated nutrient management. Food and Agriculture Organization of the United Nations.
Huang, B., & Fry, J. D. (1998). Soil temperature effects on plant growth and physiology. In M. Pessarakli (Ed.), Handbook of Plant and Crop Physiology (pp. 215–230). Marcel Dekker.
Nugroho, H. A., & Purwandari, B. (2020). Sistem rekomendasi tanaman berdasarkan klasifikasi tanah menggunakan metode Naïve Bayes. Jurnal RESTI (Rekayasa Sistem dan Teknologi Informasi), 4(3), 456–462.
Prasetyo, E., & Handayani, R. (2021). Implementasi algoritma KNN untuk sistem rekomendasi tanaman hortikultura berbasis kondisi tanah dan cuaca lokal. Jurnal Teknik Pertanian Lampung, 10(2), 73–82.
Wibowo, M., & Ramadhani, R. (2021). Perbandingan metode klasifikasi data mining untuk rekomendasi tanaman pangan. Jurnal Media Informatika Budidarma, 5(3), 913–921.