SMART CROP SELECTION MODEL USING SOIL PH VALUE, TEMPERATURE, HUMIDITY, AND RAINFALL PREDICTION | IJET Volume 12 – Issue 5 | IJET-V12I5P36

IJET
International Journal of Engineering and Techniques
ISSN 2395-1303 · Peer-Reviewed · Open Access
📚 Volume 12, Issue 5
📅 October 7, 2026
📄 Pages 335–342
🔖 ID: IJET-V12I5P36

SMART CROP SELECTION MODEL USING SOIL PH VALUE, TEMPERATURE, HUMIDITY, AND RAINFALL PREDICTION

Author(s)

C. SAI KUMAR, Prof. G SREENIVASULU

Abstract

Crop suitability with soil and climatic conditions plays a vital role in increasing productivity of agriculture. This study proposes a smart crop selection model which recommends the suitable crop based on the machine learning techniques with the input parameters of soil pH, soil temperature, soil humidity and rainfall. The data set consisted of 1000 observations and 8 different crop classes and missing values were handled, crop labels were encoded and numerical features were selected. Five-fold cross validation was used to compare the performance of the three classifiers: Random Forest, XGBoost and Support Vector Machine (SVM). Finally, a Gradient-Boosted classification model was trained and evaluated with test-set accuracy, classification metrics, Multiclass ROC analysis and feature importance. The results of the application were 93.60% of the final test accuracy and the model comparison was used to compare the three classification methods. The contribution of four environmental parameters to the crop classification was analyzed by feature-importance analysis. To facilitate practical accessibility, the entire process was carried out using an interactive dashboard developed with Streamlit, allowing for the upload of datasets, evaluation of models, selection of parameters and the generation of predictions in real time for the crops of interest. The developed system is an example of how machine learning can be integrated with an interactive decision support interface to develop a data-driven, crop selection system, relying on simple soil and weather parameters.

Keywords

Crop Recommendation, Precision Agriculture, Machine Learning, Random Forest, XGBoost, Support Vector Machine, Soil and Weather Parameters

Conclusion

In the present study, a smart crop selection machine learning model was developed for the selection of appropriate crop with the main input parameters being soil pH, soil temperature, soil humidity, and rainfall. Five-fold cross validation was used to evaluate the Random Forest, XGBoost and Support Vector Machine algorithms in the same classification workflow. Results were better for the tree-based models than for SVM for the data set used in this study and were highly significant in the comparison. The final XGBoost based workflow had an accuracy of 93.60% on a test set of 250 observations that were reserved. Further, multiclass ROC analysis and feature-importance analysis were added to analyze the classification behaviour and contribution of the environmental variables. The study’s key findings are: An effective workflow for crop classification was developed with the four basic environmental parameters. Random Forest and XGBoost achieved the best cross validation results as compared to SVM for the examined dataset. The resultant XGBoost model achieved the test accuracy of 93.60% with eight crop classes. The final classification model was further evaluated using 4. ROC and feature-importance analyses. Incorporated an interactive Streamlit dashboard for user-defined crop prediction, with the machine learning workflow. The system developed shows the feasibility of using simple soil and weather parameters to select crops based on data, but further data and validation in various agricultural regions should be used before generalisation.

References

[1]Abdullah, A., Iwan, M., & Dani, S. R. (2025). Applying Tree Based Model for Crop Recommendation System Based on Soil Parameters and Weather Conditions. JITK (Jurnal Ilmu Pengetahuan dan Teknologi Komputer), 11(1), 228–235. https://doi.org/10.33480/jitk.v11i1.6476.
[2]Breiman, L. (2001). Random forests. Machine Learning, 45(1), 5–32.
[3]Chen, T., & Guestrin, C. (2016). XGBoost: A scalable tree boosting system. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 785–794.
[4]Cortes, C., & Vapnik, V. (1995). Support-vector networks. Machine Learning, 20(3), 273–297.
[5]Prity, F. S., et al. (2024). Enhancing Agricultural Productivity: A Machine Learning Approach to Crop Recommendations. Human-Centric Intelligent Systems, 4(4), 497–510. https://doi.org/10.1007/s44230-024-00081-3.
[6]Pande, S. M., Ramesh, P. K., Anmol, A., Aishwarya, B. R., Rohilla, K., & Shaurya, K. (2021). Crop Recommender System Using Machine Learning Approach. 2021 5th International Conference on Computing Methodologies and Communication (ICCMC), 1066–1071. https://doi.org/10.1109/ICCMC51019.2021.9418351.
[7]Dash, R., Dash, D. K., & Biswal, G. C. (2021). Classification of crop based on macronutrients and weather data using machine learning techniques. Results in Engineering, 9, 100203. https://doi.org/10.1016/j.rineng.2021.100203.
[8]Rani, S., Mishra, A. K., Kataria, A., Mallik, S., & Qin, H. (2023). Machine learning-based optimal crop selection system in smart agriculture. Scientific Reports, 13(1), 15997. https://doi.org/10.1038/s41598-023-42356-y.
[9]Kiran, P. S., Abhinaya, G., Sruti, S., & Padhy, N. (2024). A Machine Learning-Enabled System for Crop Recommendation. The 3rd International Electronic Conference on Processes, 51. https://doi.org/10.3390/engproc2024067051.
[10]Shingade, S. D., & Mudhalwadkar, R. P. (2023). Sensor information-based crop recommendation system using machine learning for the fertile regions of Maharashtra. Concurrency and Computation: Practice and Experience, 35(23). https://doi.org/10.1002/cpe.7774.
[11]Afzal, H., Amjad, M., Raza, A., Munir, K., Villar, S. G., Lopez, L. A. D., & Ashraf, I. (2025). Incorporating soil information with machine learning for crop recommendation to improve agricultural output. Scientific Reports, 15, 8560. https://doi.org/10.1038/s41598-025-88676-z.
[12]Dey, B., Ferdous, J., & Ahmed, R. (2024). Machine learning based recommendation of agricultural and horticultural crop farming in India under the regime of NPK, soil pH and three climatic variables. Heliyon, 10.
[13]Raja, S. P., Sawicka, B., Stamenkovic, Z., & Mariammal, G. (2022). Crop prediction based on characteristics of the agricultural environment using various feature selection techniques and classifiers. IEEE Access, 10, 23625–23641. https://doi.org/10.1109/ACCESS.2022.3154350.
[14]Pedregosa, F., et al. (2011). Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12, 2825–2830.
[15]Elbasi, E., et al. (2023). Artificial intelligence technology in the agricultural sector: A systematic literature review. IEEE Access, 11, 171–202. https://doi.org/10.1109/ACCESS.2022.3232485.

📋 How to Cite This Paper

C. SAI KUMAR, Prof. G SREENIVASULU (2026). SMART CROP SELECTION MODEL USING SOIL PH VALUE, TEMPERATURE, HUMIDITY, AND RAINFALL PREDICTION. International Journal of Engineering and Techniques, 12(5), 335–342. ISSN: 2395-1303. DOI: https://doi.org/10.5281/zenodo.23211382
© 2026 International Journal of Engineering and Techniques (IJET). All rights reserved. · ijetjournal.org

Submit Your Paper