Agricultural Policy Recommendation System Overview
This project combines remote sensing, statistical, and news data with surrogate yield models and fine-tuned LLM chains to generate agricultural policy recommendations for wheat.
Agricultural policy has traditionally leaned on historical trends and manual analysis, which struggles to keep pace with real-time shifts in weather, soil conditions, and market sentiment. This project introduces a decision support tool built to modernize that process, combining forecasting models with large language models to give policymakers, farmers, and other stakeholders proactive, real-time insight into demand and supply trends in agriculture.
The data behind the system
The system draws on three categories of data. Remote sensing data includes hyperspectral surface reflectance, surface temperature, soil moisture, and NDVI, the vegetation index used to track plant health from satellite imagery. Statistical data covers pesticide usage and water quality. News data consists of sentiment reports capturing how production, supply, and demand news affects farmers and the broader market. All of this data spans roughly 20 years, from 2000 to 2020, narrowed down to wheat as the target crop, and extracted at both the county and state level across five states.
Stage one: seven surrogate models
The first stage of the pipeline builds seven surrogate models, each designed to predict crop yield using one of the seven data dependencies. For surface reflectance and surface temperature, features are extracted using ResNet and then reduced in dimension with PCA before predicting yield with XGBoost. Soil moisture and NDVI follow a similar pattern, but use Vision Transformers instead of ResNet to extract features, again followed by PCA for dimensionality reduction and XGBoost for the final yield prediction. The statistical data, pesticide and water quality figures, is handled differently, using LSTM models for time series forecasting. The news data is processed through sentiment analysis using BERT. Because the underlying data spans 20 years, the system doesn't stop at predicting yield: it also forecasts future values of surface reflectance, surface temperature, soil moisture, and NDVI themselves, so the first stage produces both predicted yield values and forecasted values for each of the seven dependencies.
Stage two: LLM chains explain the numbers
With seven forecasted parameters in hand, the second stage builds seven separate LLM chains using LangChain. An LLM chain combines a language model with a prompt to produce output directly, and here, each of the seven chains uses a different prompt tailored to its specific parameter. The goal of this stage is to generate a report explaining how a given parameter, such as surface reflectance, affects yield, and how a change in that single parameter value shifts the predicted yield. These chains use GPT-3.5 Turbo set to a temperature of 0.9, favoring more varied, exploratory language over strict determinism. A sequential chain then takes all seven of these individual reports and combines them into a single prompt.
Stage three: fine-tuned policy generation
That combined prompt is handed to a GPT-3.5 model that has been specifically fine-tuned for this task, using an instruction fine-tuning approach on OpenAI's clusters. The fine-tuning data includes U.S. agricultural policy documents, market analysis documents, definitions, and dependency reports connecting each parameter to supply, production, and the broader supply and demand picture for wheat over the 20-year period, drawing on roughly 15 to 20 source documents in total. The final engineered prompt merges all seven surrogate model reports and feeds them into this fine-tuned model, which generates the actual policy recommendations.
Putting it in front of users
All of the underlying data is stored in the cloud, and a Streamlit application provides the user interface. A user can select a single state, such as North Dakota, or drill down to a specific county, and generate a report for that selection. The resulting report starts with forecasted values, for example a soil moisture reading or an NDVI value, explains what that specific number signifies and how it affects yield, and then lays out policy recommendations grounded in those parameter relationships. The project's GitHub repository organizes the source code by surrogate model, with preprocessing and modeling scripts available for each of the seven parameter folders.
Key takeaways
- The system integrates remote sensing, statistical, and news sentiment data spanning 20 years of wheat production across five states.
- Seven surrogate models predict yield from individual dependencies, using ResNet or Vision Transformers with PCA for feature reduction, XGBoost for prediction, LSTM for time series, and BERT for sentiment analysis.
- LangChain-based LLM chains, built on GPT-3.5 Turbo, translate each surrogate model's output into a plain-language report on how that parameter affects yield.
- A GPT-3.5 model fine-tuned on real agricultural policy and market documents turns the combined reports into concrete policy recommendations.
- A Streamlit interface lets users select a state or county and generate a tailored report on demand.
Who this is for
This overview is useful for anyone interested in how remote sensing, time series forecasting, and fine-tuned language models can be combined into a single applied decision support system, particularly students and practitioners exploring agricultural data science or LLM-based reporting pipelines.
Full transcript(auto-generated, with timestamps)
[0:14]Uh hi everyone uh today I'm going to be talking about our project agricultural policy recommendation system uh this Pol uh this project introduces an Innovative addition support tool designed to modernize agricultural policies uh by using Advanced forecasting techniques this also aims to provide uh realtime insights into demand and Supply Trends in the agricultural sector uh the goal is to enable policy makers farmers and other stakeholders uh to make a proactive and in informed decisions uh here this is the GitHub repository for our project and here are some of the objectives and some of the potential use cases which can be uh uh used for uh government and
[0:58]Policy making for the chain management and many other use cases as well uh moving on uh this is the uh Noel architecture for the project here we are using uh three types of data mainly uh remote sensing uh statistical data and uh the news data the remote sensing data includes uh the hyperspectral data of the surface reflectance the surface temperature the soil moisture and the ndvi and uh the statistical data includes uh the pesticides data as well as the water quality data uh the new data is nothing but uh uh the sentiment reports uh of uh uh how the sentiment uh of how uh the
[1:47]Production uh the supply and demand affects uh the farmers and the market all these datas are uh taken uh for course of uh uh almost 20 years from uh 2000 to 2020 uh and this is uh mainly uh we have narrowed down to uh wheat crop and we we have made sure uh uh to extract the data County wise as well as state wise uh for over uh five states in uh total uh the main uh the at at the first stage uh we have developed uh uh seven surrogate models uh the goal of these seven surrogator models uh is to predict yield uh taking uh uh uh these seven
[2:39]Dependencies into consideration starting with in the first Surat models we have used the hyperspectral data of surface reflectant to predict the yeld similarly uh we have used surface temperature in order to predict the eeld S and this goes on uh uh for all the six arator model but uh in in the case of uh uh uh the new sta it's just the sentiment analysis using the bir organizer uh for the uh uh Sur for modeling the for the first surrogator model for the first couple uh of sory models that is for surface reflectance and surface temperature uh we have extracted the features from reset and reduce the
[3:24]Dimension using PCA and uh uh using H boost uh we are able to predict the yield values for a particular state or a particular County uh similarly uh uh in the case of soil moisture and ndvi Analysis instead of reset uh we have used Vision Transformers to extract the features and uh we have reduced the dimension with PCA and uh predicted and the yield Val use using XT boost in the case of uh uh statistical uh uh data uh this is just a Time series modeling uh so we have used the lstm uh for these two uh apart from uh predicting the yield uh from these uh six uh surrogator
[4:17]Models we have also since we have taken the data from 2000 uh to 2020 uh we also have uh the time values so we we have made sure that we have also for the dependency values as well so we have forecasted the future surface reflectance surface temperature the soil moisture and the ndv values as well so once uh at the end of the first stage uh we'll be able to we are able to get the predicted yield values as well as the forecasted surface reflectance values as uh similarly uh as well uh since we have a six uh uh uh forecasted uh uh values uh we
[5:01]Have since we have uh seven fored values we have uh in the second stage we have built uh uh seven llm chains uh using L chain uh uh llm chains are nothing but uh uh uh a framework which can uh which combines the llm and the promps and directly gives you the output for the first first stage we have just used a simple llm chain uh we also made sure that uh the prompts uh the second stage are different for each of uh these seven uh outputs uh at the end of the second stage the goal of the uh the main goal uh here is to generate the report uh
[5:43]Between the uh generate the report on how uh surface reflectant or any parameter affects the yield values uh in in in this manner uh we were able to generate the report about uh how uh a particular parameter uh uh varies with respect to yield values and how a change in a single value of a particular parameter affects uh the yield values as well once we uh for for for the first uh in the second stage while building the llm chain we have used uh GPT 3.5 Tabo with a temperature of 0.9 and once uh this has been done we have made sure uh use with the help of uh the
[6:38]Sequential chain uh which can uh take multiple inputs uh as well we we are a we were able to take uh all the seven reports which were generated from the first stage of uh the llm chain and use them in a uh single prompt and give it to our newly fine tuned uh GPT uh for this stage uh or for the third stage uh for fine tuning we used uh uh an instruction fine tuning method and uh we fine tuned GPT 3.5 uh on open AI clusters uh we Al we made sure that we fine tune on the uh us agricultural policy uh documents uh the market
[7:23]Analysis documents and uh the uh uh definitions and uh uh the uh dependency reports of uh each of the parameter with respect to supply uh production uh and uh the supply chain and the supply demand analysis uh for for wheat crop for over uh 20 years uh which included almost like combining uh almost around like 15 to 20 documents once uh this was fine tuned uh the main prompt uh we engineed the main prompt which combined all the s reports and was given to the this fine tune uh GPT to generate uh the policies or uh and the recommendations uh we have uh uh made
[8:18]Sure uh that all all the data is been stored in the cloud and uh we also created an application uh uh using streamlit uh for the user interface uh uh at this point we have made sure that uh we can you can just select a single State uh that is not Dakota and uh select a particular State value or a particular County value and uh generate the report for that and uh uh you can find all the scripts down here and this up repositories yes and uh just as an example uh um the main uh report you looks like this let's say uh uh at the end of the first
[9:19]Stage we have the forecasted soil Master values as this andway index values as this the parameter files are as follows and the average is uh from the S surrogator models are as follows with this uh we first we'll generate the reports of uh Report with respect to all these and that reports has been given to the main F uh fine tuned llm uh to generate uh the report as follows first it generates the factor prediction values telling that like how what what what does the soil moisture value 0.28 signifies similarly to other parameter values as and uh how how these affect the yield and what are the uh policies and
[10:07]Recommendations that can that that can be taken care of also uh in the repository uh we have uh uh uh since we have seven surrogator models uh we have uh put all the source Cod codes in the source F folders uh Within uh each of the parameter uh folders We have uh all the uh uh pre-processing uh python files the modeling python files as well you can uh take a closer look over here for each one of them
More videos
2:08Bridging the Pixel Gap in Browser Automation.
2:23How One Narrow Safety Rule Can Make an AI Less Safe Everywhere Else.
2:04Why splitting a chunk from its document makes it retrieve for the wrong question
4:20Three You Can Take Back. One You Can't.
2:21Why a 50-turn agent pays for the same screenshot 35 times unless it caches the pixels
1:53