Introduction
Traditional industrial agriculture often relies on "blanket" management strategies, where the detection of a disease triggers field-wide pesticide application. This reactive approach is inefficient, environmentally taxing, and costly. While advanced crop models like DSSAT or APSIM exist, they typically operate at a coarse field-wide scale, ignoring the complex spatial dynamics of how diseases spread from plant to plant.
To bridge this gap, we introduce AgGym, an open-source, modular simulation framework designed to model "biotic stress" (pests and diseases) at a localized, sub-field level. Compatible with OpenAI Gym, AgGym enables the training of Reinforcement Learning (RL) agents to design "ultra-precision" management plans that maintain yields while drastically reducing pesticide use by over 90%.
The AgGym Framework
AgGym is a modular environment that integrates agronomic modeling with machine learning optimization. It consists of two primary components: an Infection Spread Module and a Yield Estimation Module.
The framework was validated using a combination of remote sensing and ground-truth data. Satellite imagery (NDVI) from Planet PBC tracked real-world fall armyworm infestations in Iowa, while three years of agronomic data from seven research farms provided detailed indices for diseases like Sudden Death Syndrome and Frogeye Leaf Spot.
Spatial Dynamics and Modeling
AgGym uses a grid-based approach inspired by epidemiological SIR (Susceptible-Infected-Recovered) models. It calculates infection probability based on the distance between sub-regions and environmental factors.
The environment is formulated as a Markov Decision Process (MDP). The "state" is represented by the health matrix of the field, and "actions" involve selecting chemical treatments of varying efficacy (High, Medium, Low, or No Spray). A key innovation is the use of an inverse sigmoid "damage curve" for yield estimation, which accounts for the duration of infection and the plant's specific growth stage (e.g., infection during flowering causes more damage than during grain filling).
Key Results and Sustainability
The simulation demonstrated high predictive accuracy, with yield loss predictions matching real-world data (R-squared values between 0.78 and 0.96). Among the RL algorithms tested—DDQN, PPO, and TRPO—Trust Region Policy Optimization (TRPO) proved most effective, achieving the highest rewards with the lowest standard deviation.
In a simulated 2018 scenario, the TRPO agent eliminated yield loss entirely while spending only $0.17 per acre—a massive reduction compared to the $2.14 per acre cost of traditional blanket spraying. This was achieved by targeting just 4.22% of the field, highlighting the potential for significant cost savings and reduced environmental chemical load.
Conclusion and Future Work
AgGym shifts agricultural management from reactive to prescriptive, enabling targeted strikes on infection hotspots. Future work will focus on integrating "sensing imperfections" (sensor noise) and "actuation uncertainties" (spray drift), as well as adding complex environmental variables like wind patterns and terrain elevation to further refine the spread models.
Source Code: https://github.com/SCSLabISU/AgGym
Summary updated