Inspiration

Reinforcement learning (RL) is already transforming agricultural research. In controlled environments, RL agents optimize fertilizer schedules, crop rotations, and long-term soil health by maximizing cumulative reward:

$$ R = \sum_{t=0}^{T} \gamma^t r_t $$

Our team had prior experience working with the Cycles agroecosystem simulator, a research-grade system used to model long-term soil, nutrient, and crop dynamics. Through that experience, we realized two things:

  1. These simulators are incredibly powerful.
  2. They are extremely difficult for non-technical users to configure and run.

While tools like Cycles can simulate decades of soil and crop interactions in minutes, most farmers do not have the technical background to manage configuration files, parameter tuning, or preprocessing pipelines.

At the same time, real farming does not allow rapid iteration. A single management decision may take an entire growing season to evaluate, and every mistake carries financial and ecological consequences.

We asked a simple question: what if we could bring simulation-based feedback directly to farmers without requiring them to understand the simulator itself?

That idea became Farm Duel.


What it does

Farm Duel is a simulation-backed competitive platform for real farmers.

Farmers provide inputs such as location, soil type, crop rotation, and management practices. Behind the scenes, agroecosystem models simulate multi-season outcomes including:

  • Yield
  • Nitrogen efficiency
  • Water usage
  • Soil health trajectory

These outcomes are combined into a composite performance score:

$$ S = w_y Y + w_n N + w_w W + w_s H $$

where each term represents normalized metrics and the weights \( w_i \) control the importance of each objective.

Farmers receive immediate feedback and an evolving ELO-style rating, allowing them to benchmark performance relative to similar environmental conditions.

It applies reinforcement learning principles — but the learning agent is human.


How we built it

We designed Farm Duel as a clean, developer-focused API.

  1. Canonical Input Schema
    A structured FarmPlan model validates all farmer inputs, including timespan, soil characteristics, and crop rotation.

  2. Ecosystem Routing Engine
    A rule-based scoring system selects one of three agroecosystem simulators depending on crop type, soil profile, and regional compatibility.

  3. Climate Matching Module
    Given a location and time range, the system maps the farm to a predefined climate cluster using similarity scoring.

  4. Simulator Adapters
    Each ecosystem (including Cycles-based configurations) is wrapped in a standardized adapter interface so outputs are normalized into comparable metrics.

  5. Persistence & Reproducibility
    All simulations store:

    • Input hash
    • Simulator version
    • Climate match ID
    • Scoring breakdown

The API supports idempotent POST requests, consistent error responses, pagination for listing resources, and clear documentation to ensure predictable behavior.


Challenges we faced

Abstraction vs. Scientific Integrity
Agroecosystem models like Cycles are parameter-heavy and complex. Simplifying them for accessibility without misrepresenting their scientific basis was challenging.

Metric Normalization
Different simulators produce outputs at different scales. We built a normalization layer to compute fair cross-ecosystem composite scores.

Fair Ranking
An ELO system must account for environmental differences. We restricted comparisons to farms within similar climate and soil clusters to maintain fairness.

Reproducibility
To avoid non-deterministic outputs, we carefully versioned routing logic and simulator configurations.


What we learned

We learned that reinforcement learning is not just an algorithmic framework — it is a feedback philosophy.

When humans receive structured, fast feedback, they can iteratively improve just like RL agents. The cumulative reward equation becomes a model for human improvement over time.

We also learned that great APIs require predictable behavior, transparent decision logic, clear error messaging, and reproducibility.


What’s next for Farm Duel

Next steps include:

  • Expanding ecosystem models to more regions and crop types
  • Introducing multi-year stochastic climate scenarios
  • Building region-specific competitive cohorts
  • Integrating real farm data for longitudinal validation

Our long-term vision is to compress decades of agricultural trial-and-error into accelerated, simulation-backed learning cycles.

Farm Duel turns farming into a structured feedback system — where better decisions compound over time.

Built With

Share this project:

Updates