Skip to main content
QUICK REVIEW

[Paper Review] gym-DSSAT: a crop model turned into a Reinforcement Learning environment

Romain Gautron, Emilio J. Padrón|arXiv (Cornell University)|Jul 7, 2022
Evolutionary Algorithms and ApplicationsComputer Science51 references11 citations
TL;DR

This paper introduces gym-DSSAT, an open-source reinforcement learning (RL) environment that integrates the high-fidelity DSSAT crop simulation model into the OpenAI Gym framework, enabling RL agents to optimize maize fertilization and irrigation strategies. The environment enables sustainable practice discovery, with preliminary results showing RL can outperform expert policies in reducing resource use while maintaining yield.

ABSTRACT

Addressing a real world sequential decision problem with Reinforcement Learning (RL) usually starts with the use of a simulated environment that mimics real conditions. We present a novel open source RL environment for realistic crop management tasks. gym-DSSAT is a gym interface to the Decision Support System for Agrotechnology Transfer (DSSAT), a high fidelity crop simulator. DSSAT has been developped over the last 30 years and is widely recognized by agronomists. gym-DSSAT comes with predefined simulations based on real world maize experiments. The environment is as easy to use as any gym environment. We provide performance baselines using basic RL algorithms. We also briefly outline how the monolithic DSSAT simulator written in Fortran has been turned into a Python RL environment. Our methodology is generic and may be applied to similar simulators. We report on very preliminary experimental results which suggest that RL can help researchers to improve sustainability of fertilization and irrigation practices.

Motivation & Objective

  • To bridge the gap between agricultural simulation and reinforcement learning by creating a usable, open-source RL environment for crop management.
  • To enable researchers to train RL agents on realistic, data-driven crop management tasks using the widely trusted DSSAT model.
  • To demonstrate the feasibility of using RL to discover more sustainable fertilization and irrigation practices than expert-defined policies.
  • To provide a generic methodology for converting monolithic, Fortran-based mechanistic simulators into modular, Python-based RL environments.
  • To ensure reproducibility through Docker containers and artifact sharing, supporting cross-team validation of results.

Proposed method

  • The DSSAT crop simulator, originally written in Fortran, was wrapped into a Python-based OpenAI Gym environment using the PDI (Pseudo-Data Interface) library to handle input/output and simulation control.
  • The environment exposes a continuous state space including soil moisture, nutrient levels, and weather data, with action spaces for irrigation and fertilization decisions.
  • Simulations are initialized using real-world maize field experiments, ensuring ecological and agronomic realism in the training environment.
  • The RL agent interacts with the environment through a Markov Decision Process (MDP), receiving dense rewards based on yield, protein content, and resource use efficiency.
  • Baseline performance was evaluated using Stable-Baselines3’s PPO algorithm on predefined fertilization and irrigation scenarios.
  • Reproducibility was enhanced via Docker containers and artifact sharing, though cross-platform reproducibility remains challenging due to floating-point differences in Fortran compilation.

Experimental results

Research questions

  • RQ1Can a high-fidelity crop simulator like DSSAT be effectively transformed into a usable, modular RL environment for agricultural decision-making?
  • RQ2Can RL agents trained in gym-DSSAT discover more sustainable fertilization and irrigation strategies than expert-defined policies?
  • RQ3How does the computational cost of running DSSAT simulations compare to standard RL environments, and is it feasible for iterative RL training?
  • RQ4To what extent can the PDI-based interface ensure reproducibility across different hardware and software platforms?
  • RQ5Can the methodology used to convert DSSAT be generalized to other mechanistic crop models written in Fortran, C, or C++?

Key findings

  • gym-DSSAT successfully transforms the monolithic DSSAT Fortran simulator into a functional, open-source Python-based RL environment compatible with standard Gym interfaces.
  • The environment supports realistic, data-driven simulations based on actual maize field experiments, enabling training on ecologically relevant scenarios.
  • Preliminary experiments show that a basic PPO RL agent can learn fertilization strategies that reduce nitrogen use while maintaining or improving yield and protein content compared to expert policies.
  • Irrigation policies learned via RL also demonstrated improved sustainability by reducing water use without compromising yield, indicating RL’s potential for resource optimization.
  • While simulation time is higher than typical Gym environments (averaging ~1.5 seconds per step), the environment remains responsive enough for typical RL experimentation.
  • Reproducibility was achieved on the same platform using the same software and hardware stack, though cross-platform reproducibility is limited by floating-point arithmetic differences in Fortran compilation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.