With the growing need for sustainable agricultural practices, the integration of intelligent systems in farming has become increasingly essential. Crop selection, a critical decision for farmers, is often influenced by numerous environmental and soil-related factors. In this context, the present study focuses on the development of a machine learning-based crop recommendation system aimed at improving the decision-making process for crop cultivation. The system analyses various agronomic features including soil nutrients nitrogen (N), phosphorus (P), potassium (K) along with temperature, humidity, pH level, and rainfall to suggest the most appropriate crop for a given set of conditions. A dataset containing these parameters was pre-processed to remove inconsistencies and scaled using Min-Max normalization and standardization to enhance model performance. Several classification algorithms were implemented and evaluated, including Logistic Regression, Support Vector Machines (SVM), K-Nearest Neighbors (KNN), Decision Trees, Gaussian Naïve Bayes, Random Forest, Gradient Boosting, AdaBoost, Bagging Classifier, and Extra Trees. These models were trained and tested using an 80-20 split of the dataset, and their performance was assessed based on accuracy metrics. Among all tested models, the Random Forest classifier emerged as the most reliable, delivering the highest prediction accuracy due to its ability to handle high-dimensional data and reduce overfitting. The system also includes a functional interface allowing users to input real-time environmental values and receive instant crop recommendations. This project demonstrates how machine learning can be effectively leveraged to support agricultural decisions, reduce crop failure risks, and enhance yield potential. By offering a data-driven approach to crop planning, the system contributes to more efficient land use, resource optimization, and long-term sustainability in agriculture.
Introduction
Agriculture is vital for human survival and economic growth, especially in regions reliant on farming. A key challenge in agriculture is selecting the right crop, which affects yield, profit, and sustainability. Leveraging modern computing and large datasets, machine learning offers data-driven solutions to improve crop selection tailored to local conditions.
This project develops a machine learning-based crop recommendation system that analyzes essential soil nutrients (Nitrogen, Phosphorus, Potassium), environmental factors (temperature, humidity, rainfall), and soil pH to suggest the most suitable crops. Various machine learning models—such as Logistic Regression, SVM, Naïve Bayes, Decision Trees, KNN, and Random Forest—were evaluated, with the Random Forest classifier achieving the best accuracy.
Users input environmental and soil data, which the system normalizes and processes to predict optimal crops, making the tool practical for real-time use by farmers and advisors. This integration of AI into agriculture aims to boost yields, reduce resource waste, and promote sustainable farming, adaptable to diverse agricultural zones.
Literature Review:
Studies show data mining improves fertilizer recommendations by reducing misuse.
Machine learning outperforms traditional methods in precision farming, enhancing Indian agriculture.
SVM has been used successfully to classify weeds in maize crops, reducing manual labor.
Existing Work & Limitations:
Agricultural price forecasting relies on time series models but needs more robust hybrid or ensemble methods.
Many current crop recommendation systems are costly, hard to use, or lack innovation.
Proposed Work:
The system uses a larger, more diverse dataset (~2200 entries) than many existing models, covering crops like rice, maize, chickpea, mango, banana, mung bean, kidney bean, and apple.
Multiple machine learning algorithms were tested; Random Forest showed the best performance.
Objectives include accurate crop recommendation based on environmental and soil data, aiding farmers to make informed decisions, improving productivity, and reducing crop failures.
System Architecture Workflow:
Data collection
Preprocessing and noise removal
Feature extraction
Application of machine learning algorithms
Crop recommendation output
Conclusion
This paper introduces an advanced crop recommendation system designed to assist farmers throughout India in making well-informed decisions on which crops to grow. The system evaluates several environmental and soil factors such as Nitrogen, Phosphorus, Potassium, pH level, temperature, humidity, and rainfall. By utilizing this approach, farmers can select the most suitable crop, potentially increasing their yields and contributing to the country\'s agricultural productivity and economic growth.
The study evaluates the performance of six different machine learning algorithms—Decision Tree, Naïve Bayes, Support Vector Machine, Logistic Regression, Random Forest, and XGBoost—in providing crop recommendations. Among these models, XGBoost emerged as the most effective, delivering the highest accuracy in predictions.
A. Future Scope
The system can be enhanced further to add following functionality:
1) The main future work’s aim is to improved dataset with larger number of attributes.
2) We need to build a model, which can classify between healthy and diseased crop leaves and also if the crop has any disease, predict which disease is it.
3) To build website and mobile app for easy to use.
4) Integrating deep learning to allow users to upload images of soil or plants for diagnosing diseases or nutrient deficiencies.
5) To serve a wider audience, particularly in India, the application can be localized into regional languages such as Hindi, Telugu, Tamil, Kannada, etc.
6) Provide offline support using cached data for areas with limited internet connectivity, enabling the tool to be useful even without real-time access.
References
[1] Kumar, Y. Jeevan Nagendra, V. Spandana, V. S. Vaishnavi, K. Neha, and V. G. R. R. Devi. \"Supervised Machine learning Approach for Crop Yield Prediction in Agriculture Sector.\" In 2020 5th International Conference on Communication and Electronics Systems (ICCES), pp. 736-741. IEEE, 2020.
[2] Nigam, Aruvansh, Saksham Garg, Archit Agrawal, and Parul Agrawal. \"Crop yield prediction using machine learning algorithms.\" In 2019 Fifth International Conference on Image Information Processing (ICIIP), pp. 125-130. IEEE, 2019.
[3] Kulkarni, Nidhi, H, G.N. Srinivasan, B.M. Sagar, and N.K. Cauvery. “Improving Crop Productivity through a Crop Recommendation System using Ensemble technique” in 2018 3rd International Conference on Computational Systems and Information Technology for Sustainable Solution (CSITSS), pp. 114-119. IEEE, 2018.
[4] Rajak, Rohit Kumar, Ankit Pawar, Mitlee Pendke, Pooja Shinde, Suresh Rathod and Avinash Devare, “Crop recommendation system to maximise crop yield using machine learning technique”. International Research Journal of Engineering and Technology 4, no. 12 (2017): 950-953.
[5] Medar, Ramesh, Vijay S. Rajpurohit, and Shweta. \"Crop yield prediction using machine learning techniques.\" In 2019 IEEE 5th International Conference for Convergence in Technology (I2CT), pp. 1-5. IEEE, 2019.
[6] Kamatchi, S. Bangaru, and R. Parvathi. \"Improvement of Crop Production Using Recommender System by Weather Forecasts.\" Procedia Computer Science 165 (2019): 724-732.
[7] Kulkarni, Nidhi H., G. N. Srinivasan, B. M. Sagar, and N. K. Cauvery. \"Improving Crop Productivity Through Recommendation System A Crop Using Ensembling Technique.\" In 2018 3rd International Conference on Computational Systems and Information Technology for Sustainable Solutions (CSITSS), pp. 114-119. IEEE, 2018.