IDEAS home Printed from https://ideas.repec.org/a/abq/ijist1/v6y2024i7p283-294.html

Integrating LLM for Cotton Soil Analysis in Smart Agriculture System

Author

Listed:
  • Syed Hassan Ali

    (Department of AI & Data Science (FAST-NUCES, Karachi, Pakistan))

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 fine-tuned 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 fine-tuned 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.

Suggested Citation

  • Syed Hassan Ali, 2024. "Integrating LLM for Cotton Soil Analysis in Smart Agriculture System," International Journal of Innovations in Science & Technology, 50sea, vol. 6(7), pages 283-294, October.
  • Handle: RePEc:abq:ijist1:v:6:y:2024:i:7:p:283-294
    as

    Download full text from publisher

    File URL: https://journal.50sea.com/index.php/IJIST/article/view/1111/1652
    Download Restriction: no

    File URL: https://journal.50sea.com/index.php/IJIST/article/view/1111
    Download Restriction: no
    ---><---

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:abq:ijist1:v:6:y:2024:i:7:p:283-294. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Iqra Nazeer (email available below). General contact details of provider: .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.