Evaluation of Learning-Based Models for Crop Recommendation in Smart Agriculture
Abstract
1. Introduction
- It investigates the novel application of LLMs for conversational crop recommendation, addressing a vital yet understudied area in interactive agricultural decision-making.
- It presents a comprehensive evaluation of traditional models with advanced LLM-based techniques, highlighting their strengths and limitations in crop recommendation tasks.
- It contributes to a mechanism for data transformation from tabular sensor data into textual descriptions, allowing for effective LLM fine-tuning and broadening their usefulness in structured-data domains.
2. Related Work
2.1. Machine Learning (ML)
2.2. Deep Learning (DL)
2.3. Large Language Models (LLMs)
3. Methodology
3.1. Large Language Models (LLMs)
Multi-Head Attention for Transformer
3.2. Conversion of Sensor Readings into Descriptive Crop Information
4. Experimental Setup
4.1. Dataset
4.2. Implementation Details
4.3. Evaluation Metrics
4.4. Comparison with Traditional Models
5. Results and Discussions
Comparison of Various Models
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Pawlak, K.; Kołodziejczak, M. The role of agriculture in ensuring food security in developing countries: Considerations in the context of the problem of sustainable food production. Sustainability 2020, 12, 5488. [Google Scholar] [CrossRef]
- Aslam, S.; Bakr, M.A.; Khan, S.D. Segmentation of Agricultural Fields in Aerial Imagery Using Enhanced Deep Learning Models. In Proceedings of the 2024 19th International Conference on Emerging Technologies (ICET), Topi, Pakistan, 19–20 November 2024; pp. 1–6. [Google Scholar]
- Tasfe, M.; Nivrito, A.; Al Machot, F.; Ullah, M.; Ullah, H. Deep Learning Based Models for Paddy Disease Identification and Classification: A Systematic Survey. IEEE Access 2024, 12, 100862–100891. [Google Scholar] [CrossRef]
- Khan, N.; Ray, R.L.; Sargani, G.R.; Ihtisham, M.; Khayyam, M.; Ismail, S. Current progress and future prospects of agriculture technology: Gateway to sustainable agriculture. Sustainability 2021, 13, 4883. [Google Scholar] [CrossRef]
- Chen, Y.; Kuang, J.; Cheng, D.; Zheng, J.; Gao, M.; Zhou, A. AgriKG: An agricultural knowledge graph and its applications. In Proceedings of the Database Systems for Advanced Applications: DASFAA 2019 International Workshops: BDMS, BDQM, and GDMA, Chiang Mai, Thailand, 22–25 April 2019; Proceedings 24. Springer: Berlin/Heidelberg, Germany, 2019; pp. 533–537. [Google Scholar]
- Khan, A.J.; Bakr, M.A.; Khan, S.D. Vegetation Detection Using UAV Imagery with Deep Learning Segmentation Models. In Proceedings of the 2024 19th International Conference on Emerging Technologies (ICET), Topi, Pakistan, 19–20 November 2024; pp. 1–6. [Google Scholar]
- Tantalaki, N.; Souravlas, S.; Roumeliotis, M. Data-driven decision making in precision agriculture: The rise of big data in agricultural systems. J. Agric. Food Inf. 2019, 20, 344–380. [Google Scholar] [CrossRef]
- Sharma, A.; Jain, A.; Gupta, P.; Chowdary, V. Machine learning applications for precision agriculture: A comprehensive review. IEEE Access 2020, 9, 4843–4873. [Google Scholar] [CrossRef]
- Heyden, W.; Ullah, H.; Siddiqui, M.S.; Al-Machot, F. An integral projection-based semantic autoencoder for zero-shot learning. IEEE Access 2023, 11, 85351–85360. [Google Scholar] [CrossRef]
- Bucci, G.; Bentivoglio, D.; Finco, A. Precision agriculture as a driver for sustainable farming systems: State of art in literature and research. Calitatea 2018, 19, 114–121. [Google Scholar]
- Musanase, C.; Vodacek, A.; Hanyurwimfura, D.; Uwitonze, A.; Kabandana, I. Data-driven analysis and machine learning-based crop and fertilizer recommendation system for revolutionizing farming practices. Agriculture 2023, 13, 2141. [Google Scholar] [CrossRef]
- Akhter, R.; Sofi, S.A. Precision agriculture using IoT data analytics and machine learning. J. King Saud-Univ.-Comput. Inf. Sci. 2022, 34, 5602–5618. [Google Scholar] [CrossRef]
- Hossain, M.; Siddique, M. Online Fertilizer Recommendation System (OFRS): A step towards precision agriculture and optimized fertilizer usage by smallholder farmers in Bangladesh: Online fertilizer recommendation. Eur. J. Environ. Earth Sci. 2020, 1, e47. [Google Scholar] [CrossRef]
- Bhat, S.A.; Huang, N.F. Big data and ai revolution in precision agriculture: Survey and challenges. IEEE Access 2021, 9, 110209–110222. [Google Scholar] [CrossRef]
- Khan, S.D.; Ullah, R.; Rahim, M.A.; Rashid, M.; Ali, Z.; Ullah, M.; Ullah, H. An efficient deep learning framework for face mask detection in complex scenes. In Proceedings of the IFIP International Conference on Artificial Intelligence Applications and Innovations, Corfu, Greece, 27–30 June 2022; Springer: Cham, Switzerland, 2022; pp. 159–169. [Google Scholar]
- Ullah, M.; Amin, S.U.; Munsif, M.; Yamin, M.M.; Safaev, U.; Khan, H.; Khan, S.; Ullah, H. Serious games in science education: A systematic literature. Virtual Real. Intell. Hardw. 2022, 4, 189–209. [Google Scholar] [CrossRef]
- Ullah, H.; Uzair, M.; Jan, Z.; Ullah, M. Integrating industry 4.0 technologies in defense manufacturing: Challenges, solutions, and potential opportunities. Array 2024, 23, 100358. [Google Scholar] [CrossRef]
- Li, J.; Xu, M.; Xiang, L.; Chen, D.; Zhuang, W.; Yin, X.; Li, Z. Large language models and foundation models in smart agriculture: Basics, opportunities, and challenges. arXiv 2023, arXiv:2308.06668. [Google Scholar]
- Singh, R.K.; Berkvens, R.; Weyn, M. AgriFusion: An architecture for IoT and emerging technologies based on a precision agriculture survey. IEEE Access 2021, 9, 136253–136283. [Google Scholar] [CrossRef]
- Sharma, P.; Dadheech, P.; Senthil, A.S.K. AI-Enabled Crop Recommendation System Based on Soil and Weather Patterns. In Artificial Intelligence Tools and Technologies for Smart Farming and Agriculture Practices; IGI Global: New York, NY, USA, 2023; pp. 184–199. [Google Scholar]
- Jhajharia, K.; Mathur, P.; Jain, S.; Nijhawan, S. Crop yield prediction using machine learning and deep learning techniques. Procedia Comput. Sci. 2023, 218, 406–417. [Google Scholar] [CrossRef]
- Mohapatra, B.N.; Kale, V. Crop recommendation system using Machine Learning. ITEGAM-JETIA 2024, 10, 63–68. [Google Scholar] [CrossRef]
- Dey, B.; Ferdous, J.; Ahmed, R. Machine learning based recommendation of agricultural and horticultural crop farming in India under the regime of NPK, soil pH and three climatic variables. Heliyon 2024, 10, e25112. [Google Scholar] [CrossRef] [PubMed]
- Sundaresan, S.; Johnson, S.D.; Bharathy, V.M.; Kumar, P.M.P.; Surendar, M. Machine learning and IoT-based smart farming for enhancing the crop yield. In Proceedings of the Journal of Physics: Conference Series; IOP Publishing: Bristol, UK, 2023; Volume 2466, p. 012028. [Google Scholar]
- Sandhya, K.G.; Vemuri, S.; Deeksha, K.S.; Anvitha, T. Crop recommendation system using ensembling technique. In Proceedings of the 2022 International Conference on Breakthrough in Heuristics And Reciprocation of Advanced Technologies (BHARAT), Visakhapatnam, India, 7–8 April 2022; pp. 55–58. [Google Scholar]
- Meshram, V.; Patil, K.; Meshram, V.; Hanchate, D.; Ramkteke, S. Machine learning in agriculture domain: A state-of-art survey. Artif. Intell. Life Sci. 2021, 1, 100010. [Google Scholar] [CrossRef]
- Gong, L.; Yu, M.; Jiang, S.; Cutsuridis, V.; Pearson, S. Deep learning based prediction on greenhouse crop yield combined TCN and RNN. Sensors 2021, 21, 4537. [Google Scholar] [CrossRef] [PubMed]
- Darwin, B.; Dharmaraj, P.; Prince, S.; Popescu, D.E.; Hemanth, D.J. Recognition of bloom/yield in crop images using deep learning models for smart agriculture: A review. Agronomy 2021, 11, 646. [Google Scholar] [CrossRef]
- Qureshi, M.F.; Amin, F.; Mushtaq, Z.; Ali, M.; Haris, A.A.; Rana, A.Y. Real-Time Weed Segmentation in Tobacco Crops Utilizing Deep Learning on a Jetson Nano. In Proceedings of the 2024 International Conference on Engineering & Computing Technologies (ICECT), Islamabad, Pakistan, 23 May 2024; pp. 1–6. [Google Scholar]
- Khan, A.A.; Raza, S.; Qureshi, M.F.; Mushtaq, Z.; Taha, M.; Amin, F. Deep learning-based classification of wheat leaf diseases for edge devices. In Proceedings of the 2023 2nd International Conference on Emerging Trends in Electrical, Control, and Telecommunication Engineering (ETECTE), Lahore, Pakistan, 27–29 November 2023; pp. 1–6. [Google Scholar]
- Bhatti, U.A.; Bazai, S.U.; Hussain, S.; Fakhar, S.; Ku, C.S.; Marjan, S.; Yee, P.L.; Jing, L. Deep Learning-Based Trees Disease Recognition and Classification Using Hyperspectral Data. Comput. Mater. Contin. 2023, 77, 681. [Google Scholar] [CrossRef]
- Islam, M.M.; Adil, M.A.A.; Talukder, M.A.; Ahamed, M.K.U.; Uddin, M.A.; Hasan, M.K.; Sharmin, S.; Rahman, M.M.; Debnath, S.K. DeepCrop: Deep learning-based crop disease prediction with web application. J. Agric. Food Res. 2023, 14, 100764. [Google Scholar] [CrossRef]
- Tzachor, A.; Devare, M.; Richards, C.; Pypers, P.; Ghosh, A.; Koo, J.; Johal, S.; King, B. Large language models and agricultural extension services. Nat. Food 2023, 4, 941–948. [Google Scholar] [CrossRef] [PubMed]
- Yang, S.; Yuan, Z.; Li, S.; Peng, R.; Liu, K.; Yang, P. GPT-4 as Evaluator: Evaluating Large Language Models on Pest Management in Agriculture. arXiv 2024, arXiv:2403.11858. [Google Scholar] [CrossRef]
- Kuska, M.T.; Wahabzada, M.; Paulus, S. AI for crop production–Where can large language models (LLMs) provide substantial value? Comput. Electron. Agric. 2024, 221, 108924. [Google Scholar] [CrossRef]
- Chia, H.; Oliveira, A.I.; Azevedo, P. Implementation of an intelligent virtual assistant based on LLM models for irrigation optimization. In Proceedings of the 2024 8th International Young Engineers Forum on Electrical and Computer Engineering (YEF-ECE), Lisbon, Portugal, 5 July 2024; pp. 94–100. [Google Scholar]
- Shaikh, T.A.; Rasool, T.; Veningston, K.; Yaseen, S.M. The role of large language models in agriculture: Harvesting the future with LLM intelligence. Prog. Artif. Intell. 2024, 14, 117–164. [Google Scholar] [CrossRef]
- Yang, S.D.; Ali, Z.A.; Wong, B.M. Fluid-gpt (fast learning to understand and investigate dynamics with a generative pre-trained transformer): Efficient predictions of particle trajectories and erosion. Ind. Eng. Chem. Res. 2023, 62, 15278–15289. [Google Scholar] [CrossRef] [PubMed]
- Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł.; Polosukhin, I. Attention is all you need. Adv. Neural Inf. Process. Syst. 2017, 30. Available online: https://papers.nips.cc/paper_files/paper/2017/hash/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html (accessed on 4 November 2024).
- Ingle, A. Crop Recommendation Dataset. 2020. Available online: https://www.kaggle.com/datasets/atharvaingle/crop-recommendation-dataset (accessed on 4 November 2024).
Author et al. | Year | Dataset | Method Used | Advantages | Limitations |
---|---|---|---|---|---|
Sharma et al. [20] | 2023 | Soil and weather pattern datasets (region-specific) | AI-enabled recommendation system | Integrates soil and weather data for precise recommendations; scalable for smart farming applications. | Dependency on accurate soil and weather datasets; computationally intensive for real-time applications. |
Jhajharia et al. [21] | 2023 | Crop yield data (FAO, ICAR) | ML and DL techniques | Combines temporal and spatial data for improved yield prediction. | Computationally expensive; complex training process. |
Mohapatra et al. [22] | 2024 | State-specific crop datasets | Decision tree, Random Forest | Easy implementation and high interpretability. | Not suitable for highly complex datasets; limited generalization. |
Dey et al. [23] | 2024 | Indian soil and climate data | ML-based multi-variable analysis | Tailored for specific Indian soil and climatic conditions. | Poor generalization for other regions. |
Sundaresan et al. [24] | 2023 | IoT crop datasets | ML + IoT integration | Real-time monitoring using IoT sensors. | High setup costs for IoT devices; maintenance complexity. |
Sandhya et al. [25] | 2022 | Open-source agricultural datasets | Ensemble techniques | Enhances accuracy through ensemble learning. | Computationally demanding; reduces model interpretability. |
Meshram et al. [26] | 2021 | Review paper (various ML datasets for agriculture) | Survey on ML techniques | Comprehensive overview of ML applications in agriculture; highlights best practices and challenges. | Does not propose or evaluate specific implementations; limited focus on datasets or case studies. |
Author et al. | Year | Dataset | Method Used | Advantages | Limitations |
---|---|---|---|---|---|
Gong et al. [27] | 2021 | Greenhouse yield datasets | TCN + RNN | High accuracy in time series prediction. | High model complexity; requires extensive computational resources. |
Darwin et al. [28] | 2021 | Stress crop image datasets | CNN-based bloom recognition | Detects stress affecting crop yields. | Limited by dataset diversity; prone to overfitting. |
Qureshi et al. [29] | 2024 | Tobacco crop image dataset | DL for real-time weed segmentation on Jetson Nano | Real-time processing; low power consumption; suitable for edge devices. | Limited to specific hardware (Jetson Nano); potential challenges with generalization to other crop types. |
Khan et al. [30] | 2023 | Wheat leaf disease datasets | DL-based disease classification | High precision for wheat leaf disease classification. | Requires high-quality labeled data; resource-intensive for edge devices. |
Bhatti et al. [31] | 2023 | Hyperspectral tree datasets | DL with hyperspectral data | Effective disease detection with hyperspectral imaging. | Requires specialized equipment for hyperspectral imaging. |
Islam et al. [32] | 2023 | Agricultural disease datasets | DeepCrop with web app | Integrates disease prediction with user-friendly web interface. | High dependency on the internet and cloud infrastructure. |
Author et al. | Year | Dataset | Method Used | Advantages | Limitations |
---|---|---|---|---|---|
Tzachor et al. [33] | 2023 | Agricultural extension datasets | LLMs for agricultural extension services | Supports diverse applications; adaptable to multiple tasks. | Limited domain-specific knowledge compared to focused models. |
Yang et al. [34] | 2024 | Pest datasets (simulated cases) | GPT-4 for evaluation | Evaluates effectiveness of pest management strategies; offers rich insights. | Costly to fine-tune and deploy for specific agricultural contexts. |
Kuska et al. [35] | 2024 | General crop data | LLM integration in precision farming | Broad utility in crop-related decision-making; facilitates intelligent insights. | Limited by current capabilities of LLMs in agricultural datasets. |
Chia et al. [36] | 2024 | Irrigation data (simulated) | Virtual assistant using LLM | Improves irrigation efficiency and reduces water usage. | Dependent on the quality of training data; costly to maintain and update. |
Numerical Data | Textual Data |
---|---|
N: 79, P: 51, K: 16 Temperature: 25.34 °C Humidity: 68.50% pH: 6.59 Rainfall: 96.46 mm | “The soil has a nitrogen level of 79, phosphorus level of 51, and potassium level of 16. The temperature is 25.34 °C, humidity is 68.50%, pH is 6.59, and rainfall is 96.46 mm.” |
N | P | K | Temperature | Humidity | pH | Rainfall | Label |
---|---|---|---|---|---|---|---|
79 | 51 | 16 | 25.34 | 68.50 | 6.59 | 96.46 | maize |
22 | 55 | 20 | 33.95 | 69.96 | 7.42 | 61.16 | blackgram |
21 | 39 | 20 | 27.06 | 52.30 | 7.39 | 60.75 | mothbeans |
9 | 8 | 40 | 22.49 | 89.92 | 6.55 | 111.66 | pomegranate |
12 | 66 | 20 | 27.41 | 63.42 | 7.34 | 44.43 | lentil |
20 | 72 | 15 | 36.00 | 56.01 | 7.31 | 134.86 | pigeonpeas |
39 | 24 | 14 | 30.55 | 90.90 | 7.19 | 106.07 | orange |
21 | 139 | 201 | 19.36 | 83.36 | 5.98 | 67.15 | grapes |
24 | 80 | 19 | 29.68 | 69.09 | 6.81 | 65.66 | blackgram |
95 | 30 | 52 | 29.48 | 90.34 | 6.64 | 26.04 | muskmelon |
32 | 13 | 42 | 23.50 | 92.98 | 5.79 | 106.62 | pomegranate |
32 | 41 | 16 | 28.64 | 61.39 | 7.70 | 68.55 | mothbeans |
Classifiers | Data Type | Accuracy | Precision | Recall | F1-Score | Approx. Training Time |
---|---|---|---|---|---|---|
KNN | Numerical | 95.68% | 96.29% | 95.68% | 95.67% | 0.01 s |
RF | Numerical | 99.31% | 99.37% | 99.31% | 99.31% | 0.51 s |
DT | Numerical | 98.64% | 98.68% | 98.64% | 98.63% | 0.02 s |
SVM | Numerical | 96.82% | 97.15% | 96.82% | 96.80% | 0.51 s |
NB | Numerical | 99.54% | 99.58% | 99.55% | 99.54% | 0.01 s |
MLP | Numerical | 97.50% | 97.95% | 97.50% | 97.54% | 10.45 s |
LSTM | Numerical | 97.27% | 97.66% | 97.27% | 97.32% | 51.97 s |
BI-LSTM | Numerical | 97.05% | 97.37% | 97.05% | 97.10% | 85.80 s |
CNN-LSTM | Numerical | 97.95% | 97.99% | 97.95% | 97.95% | 77.75 s |
BERT | Textual | 98.18% | 98.27% | 98.18% | 98.18% | 2937.45 s |
GPT-2 | Textual | 99.55% | 99.58% | 99.55% | 99.57% | 3255.01 s |
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. |
© 2025 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
Bakr, M.A.; Khan, A.J.; Khan, S.D.; Zafar, M.H.; Ullah, M.; Ullah, H. Evaluation of Learning-Based Models for Crop Recommendation in Smart Agriculture. Information 2025, 16, 632. https://doi.org/10.3390/info16080632
Bakr MA, Khan AJ, Khan SD, Zafar MH, Ullah M, Ullah H. Evaluation of Learning-Based Models for Crop Recommendation in Smart Agriculture. Information. 2025; 16(8):632. https://doi.org/10.3390/info16080632
Chicago/Turabian StyleBakr, Muhammad Abu, Ahmad Jaffar Khan, Sultan Daud Khan, Mohammad Haseeb Zafar, Mohib Ullah, and Habib Ullah. 2025. "Evaluation of Learning-Based Models for Crop Recommendation in Smart Agriculture" Information 16, no. 8: 632. https://doi.org/10.3390/info16080632
APA StyleBakr, M. A., Khan, A. J., Khan, S. D., Zafar, M. H., Ullah, M., & Ullah, H. (2025). Evaluation of Learning-Based Models for Crop Recommendation in Smart Agriculture. Information, 16(8), 632. https://doi.org/10.3390/info16080632