A Machine Learning-Enabled System for Crop Recommendation †
Abstract
:1. Introduction
Aim of This Study
2. Methodology for Crop Recommendation
- Start: This marks the beginning of the process;
- Input data: Gather and provide the data that will be used for the analysis;
- Pre-processing and data cleaning:
- Handling missing values: Check if there are any gaps or empty blanks in the data and fill them in with appropriate values or remove them;
- Removing duplicates: Find and remove repeated entries to confirm all data are unique;
- Feature selection and feature extraction: Identify the most important features of the data that will help in making predictions and create new features from the existing data;
- Split the data into training and testing datasets: Divide the data into two parts, one for training the model (training data) and the other for testing the model (testing data);
- Train the model: Use the training data to teach the model to make predictions;
- Dump the model into Joblib file for future work: Save the trained model into a file format called Joblib so that it can be used again without training it;
- Connect with front end using Streamlit: Integrate the model with a user-friendly interface created using Streamlit, allowing users to interact with the model easily;
- Cloud hosting: Move the application to a cloud service, making it easily accessible via the internet;
- End: This marks the completion of the process.
3. Proposed Model for Crop Recommendation
- PHASE 1: We collected various parameters like weather, humidity, pH value, temperature, NPK values, and rainfall in mm. Data were collected from different sources on the internet like Kaggle;
- PHASE 2: The following processes were performed: Collected Data: Gathered soil data and weather data, humidity, pH → value, → temperature, NPK values, and rainfall in mm. Cleaning: Removed any errors or noises in the data, and converted categorical data into numerical form. Normalization: Scaled the data to ensure all features contribute equally;
- PHASE 3: In our model, we used ML classification algorithms like RF (Random Forest), DT (Decision Tree), KNN (K-Nearest Neighbor), GNB (Gaussian Naïve Bayes), and LR. These are examples of an ensemble learning algorithm that generates different types of DT, Accuracy, and Precision. Gaussian Naive Bayes (GNB) uses statistics to make predictions based on the probability of different features (like weather conditions). Logistic Regression (LR) finds a way to draw a line that separates classes based on input features (like temperature and rainfall). SVM finds a boundary that separates classes with the largest margin between different groups. RF builds many decision trees and combines their results to make a more consistent prediction. DT uses a tree-type model of decisions to divide the data into branches based on yes/no questions until it decides simple terms. GNB uses probabilities based on feature averages. LR draws a line to separate classes. SVM finds the best boundary to separate classes. RF combines multiple decision trees for better accuracy. DT uses a flowchart of yes/no questions to decide. These algorithms help in making predictions and decisions based on data patterns, each using a different approach to find the best solution. We used GNB as it provided us with the best accuracy, i.e., 99% accuracy;
- PHASE 4: In a crop prediction system, a performance matrix is used to evaluate how well the system predicts outcomes like crop yield, health, or suitability based on various metrics. The accuracy and consistency of the prediction model are improved.
- PHASE 5: We have considered and worked on the accuracy part of the performance metrics and also performed a comparison of different types of algorithms. The formula for accuracy is:
- PHASE 6: The model was validated using performance inspection parameters on the testing dataset, guaranteeing that it did not overfit the data gathered through sensory methods.
4. Results and Discussions
- Research Question 1: Is it possible to compare the different machine learning algorithms along with their performance metrics for crop recommendation?
- Response to research question 1: Yes, it is possible to compare the different ML algorithms along with their performance metrics. First, we compared the accuracy metrics of different classifiers and it is observed that the classifiers GNB (Gaussian Naive Bayes), DT (Decision tree), and RF (Random Forest) obtained 0.99. The below-mentioned Figure 3 is the accuracy comparisons of the different classifiers
- Research Question 2: Can we show that the machine learning algorithms are stable and consistent in their performance metrics when recommending the crop?
- The solution to the research question: Yes, we can measure their stable and consistent performance using a boxplot representation.
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Van Klompenburg, T.; Kassahun, A.; Catal, C. Crop yield prediction using machine learning: A systematic literature review. Comput. Electron. Agric. 2020, 177, 105709. [Google Scholar] [CrossRef]
- Nischitha, K.; Vishwakarma, D.; Ashwini, M.N.; Manjuraju, M.R. Crop prediction using machine learning approaches. Int. J. Eng. Res. Technol. (IJERT) 2020, 9, 23–26. [Google Scholar]
- Kalimuthu, M.; Vaishnavi, P.; Kishore, M. Crop prediction using machine learning. In Proceedings of the 2020 Third International Conference on Smart Systems and Inventive Technology (ICSSIT), Tirunelveli, India, 20–22 August 2020; IEEE: Piscataway, NJ, USA, 2020; pp. 926–932. [Google Scholar]
- Joshua, S.V.; Priyadharson, A.S.M.; Kannadasan, R.; Khan, A.A.; Lawanont, W.; Khan, F.A.; Ali, M.J. Crop yield prediction using machine learning approaches on a wide spectrum. Comput. Mater. Contin. 2022, 72, 5663–5679. [Google Scholar]
- Palanivel, K.; Surianarayanan, C. An approach for prediction of crop yield using machine learning and big data techniques. Int. J. Comput. Eng. Technol. 2019, 10, 110–118. [Google Scholar] [CrossRef]
- Rao, M.S.; Singh, A.; Reddy, N.S.; Acharya, D.U. Crop prediction using machine learning. In Journal of Physics: Conference Series; IOP Publishing: Bristol, UK, 2022; Volume 2161, p. 012033. [Google Scholar]
- Singh, V.; Sarwar, A.; Sharma, V. Analysis of soil and prediction of crop yield (Rice) using Machine Learning approach. Int. J. Adv. Res. Comput. Sci. 2017, 8, 1254. [Google Scholar]
- Elbasi, E.; Zaki, C.; Topcu, A.E.; Abdelbaki, W.; Zreikat, A.I.; Cina, E.; Saker, L. Crop prediction model using machine learning algorithms. Appl. Sci. 2023, 13, 9288. [Google Scholar] [CrossRef]
- Champaneri, M.; Chachpara, D.; Chandvidkar, C.; Rathod, M. Crop yield prediction using machine learning. Int. J. Sci. Res. (IJSR) 2020, 9, 645–948. [Google Scholar]
- Sajja, G.S.; Jha, S.S.; Mhamdi, H.; Naved, M.; Ray, S.; Phasinam, K. An investigation on crop yield prediction using machine learning. In Proceedings of the 2021 Third International Conference on Inventive Research in Computing Applications (ICIRCA), Coimbatore, India, 2–4 September 2021; IEEE: Piscataway, NJ, USA, 2021; pp. 916–921. [Google Scholar]
- Senapaty, M.K.; Ray, A.; Padhy, N. A decision support system for crop recommendation using machine learning classification algorithms. Agriculture 2024, 14, 1256. [Google Scholar] [CrossRef]
- Senapaty, M.K.; Ray, A.; Padhy, N. State-of-the-art of soil mineral data extraction and crop recommendation using learning tools. AIP Conf. Proc. 2024, 2919, 050015. [Google Scholar]
- Senapaty, M.K.; Ray, A.; Padhy, N. IoT-enabled soil nutrient analysis and crop recommendation model for precision agriculture. Computers 2023, 12, 61. [Google Scholar] [CrossRef]
- Apat, S.K.; Mishra, J.; Raju, K.S.; Padhy, N. An artificial intelligence-based crop recommendation system using machine learning. J. Sci. Ind. Res. (JSIR) 2023, 82, 558–567. [Google Scholar]
- Hossain, S.; Prova, N.N.I.; Sadik, M.R.; Al Maruf, A. Enhancing Crop Management: Ensemble Machine Learning for Real-Time Crop Recommendation System from Sensor Data. In Proceedings of the 2024 International Conference on Smart Systems for Applications in Electrical Sciences (ICSSES), Tumakuru, India, 3–4 June 2024; IEEE: Piscataway, NJ, USA, 2024; pp. 1–6. [Google Scholar]
- Dahiphale, D.; Shinde, P.; Patil, K.; Dahiphale, V. Smart farming: Crop recommendation using machine learning with challenges and future ideas. TechRxiv 2023. [Google Scholar] [CrossRef]
Classifiers | Accuracy | Precision | Recall | F1-Score |
---|---|---|---|---|
GNB | 0.99 | 0.99 | 0.99 | 0.99 |
SVM | 0.97 | 0.97 | 0.97 | 0.97 |
LR | 0.96 | 0.96 | 0.96 | 0.96 |
DT | 0.99 | 0.99 | 0.99 | 0.99 |
RF | 0.99 | 0.99 | 0.99 | 0.99 |
Ref# | Objective | Algorithm Used | Proposed System |
---|---|---|---|
[14] | They used the Kaggle dataset and their objective was to create a recommendation system | Cat-boost, GNB, and SMOTE feature selection for optimizing the crops. | Our model is better in comparison to this research work as our proposed system’s accuracy, precision, and recall are 99%. |
[15] | The objective of this paper was crop management using an ensemble learning approach. | They used SVM, KNN, DT, and NB. They obtained precision, recall, and F1-score of 98% as the highest measurement. When they performed the ensemble approach then they achieved 99%. They used IoT sensors to collect the data. | Our approach is better than this approach. Our traditional approach as an ensemble approach obtained 99% accuracy, precision, and recall. |
[16] | Their objective was to recommend and optimize the crop using machine-learning classifiers. | They used LR, DT, KNN, NB, SVM, etc. Their performance is consistently 95% across all the models. | Our model is better than this work because our model consistently achieved over 99% across all the models. |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Kiran, P.S.; Abhinaya, G.; Sruti, S.; Padhy, N. A Machine Learning-Enabled System for Crop Recommendation. Eng. Proc. 2024, 67, 51. https://doi.org/10.3390/engproc2024067051
Kiran PS, Abhinaya G, Sruti S, Padhy N. A Machine Learning-Enabled System for Crop Recommendation. Engineering Proceedings. 2024; 67(1):51. https://doi.org/10.3390/engproc2024067051
Chicago/Turabian StyleKiran, Pedina Sasi, Gembali Abhinaya, Smaraneeka Sruti, and Neelamadhab Padhy. 2024. "A Machine Learning-Enabled System for Crop Recommendation" Engineering Proceedings 67, no. 1: 51. https://doi.org/10.3390/engproc2024067051
APA StyleKiran, P. S., Abhinaya, G., Sruti, S., & Padhy, N. (2024). A Machine Learning-Enabled System for Crop Recommendation. Engineering Proceedings, 67(1), 51. https://doi.org/10.3390/engproc2024067051