Integrating LLM for Cotton Soil Analysis in Smart Agriculture System

Abstract

Cotton is a critical crop for the agricultural economy, with its productivity closely tied to soil quality, particularly soil nutrient levels and pH. Monitoring and optimizing these properties is essential for sustainable cotton cultivation. This study proposes using finetuned Large Language Models (LLMs)—specifically GPT-2 and LLaMA-2—to automate soil analysis and produce detailed soil reports with actionable recommendations, addressing the limitations of traditional machine learning models in this context. A custom dataset was created by extracting key information from cotton-specific resources, focusing on soil nutrient interpretation and recommendations across different growth stages. Fine-tuning was applied to GPT-2 and LLaMA-2 models (specifically, the Nous Research version LLaMA2-7b-hf from Hugging Face), enabling them to generate data-driven reports on cotton soil health. The finetuned GPT-2 model achieved a training loss of 0.093 and an evaluation loss of 0.086, outperforming LLaMA-2, which had a training loss of 0.033 and an evaluation loss of 0.25. Evaluation with BERT Score showed that GPT-2 scored average Precision, Recall, and F1 scores of 0.9284, 0.9308, and 0.9296, respectively, highlighting its superior report accuracy and contextual relevance compared to LLaMA-2. The generated reports included soil properties and actionable nutrient management recommendations, effectively supporting optimized cotton growth. Implementing fine-tuned LLMs for soil report generation enhances nutrient management practices, contributing to higher yields and more sustainable cotton farming.

Authors and Affiliations

Syed Hassan Ali, Muhammad Farrukh Shahid, M. Hassan Tanveer, Abdul Rauf

Keywords

Related Articles

Comparative Evaluation of Machine Learning and Deep Learning Models for Real Estate Price Prediction

Accurate real estate price prediction is vital in informed decisionmaking for investors, policymakers, and stakeholders. This study evaluates various machine learning and deep learning models for predicting real estate...

Python Based Estimation ofGroundwater Quality Along Hudaira Drain

During periods of restricted access to fresh surface water, enterprises depend on underground water reserves to meet their growing demands. Groundwater is crucial for fulfilling the growing demands of families, agricul...

An Artificial Intelligence VisionTransformer Model for Classification of Bacterial Colony

The application of AI and machine learning, particularly the vision transformer method, in bacterial detection presents a promising solution to overcome limitations of traditional methods, offering faster and more accu...

Spatial Investigation of Soil Erosion Risk in the High Rainfall Zone of Pakistan by Using Rusle Model

The degradation of soil quality and agricultural sustainability is threatened by soil erosion, which poses a serious threat to livelihoods and food security. Maintaining soil fertility and reducing the danger of erosio...

Predicting Depression Among Type-2 Diabetic Patients Using Federated Learning

Depression being a common and dangerous mental health condition could have a significant impact on a person's quality of life. It may result in depressive and gloomy feelings along with a loss of interest in onceenjoy...

Download PDF file
  • EP ID EP761769
  • DOI -
  • Views 20
  • Downloads 0

How To Cite

Syed Hassan Ali, Muhammad Farrukh Shahid, M. Hassan Tanveer, Abdul Rauf (2024). Integrating LLM for Cotton Soil Analysis in Smart Agriculture System. International Journal of Innovations in Science and Technology, 6(7), -. https://europub.co.uk/articles/-A-761769