Changes in soil fertility have led to a decline in crop production, making it challenging for farmers to select the best crops based on soil conditions. Accurate crop prediction can significantly enhance crop productivity, and machine learning plays a crucial role in this process. Crop forecasting is influenced by soil, geographic, and environmental characteristics, with feature selection being essential for identifying suitable crops. In this study, we developed a real-time soil fertility analyzer to obtain the real-time values of soil parameters such as potassium, phosphorus, nitrogen content, temperature, pH, moisture content, and electrical conductivity. The crops examined were coconut, ginger, plantain, and tapioca. The data collected from this analysis served as the dataset for different training and testing classification algorithms for crop prediction using 100 soil samples. Among the algorithms tested, the k-nearest neighbors (KNN) algorithm demonstrated the highest performance, with an accuracy of 84%, precision of 85%, recall of 88.8%, and specificity of 92.4%. These results indicate that machine learning, combined with real-time soil analysis, can effectively predict suitable crops, enhancing crop productivity and aiding farmers in making informed decisions. This approach can revolutionize traditional farming practices by providing precise, data-driven insights into crop selection, ultimately improving agricultural efficiency and sustainability.
Read full abstract