← All projects
PROJECT / 062026

Learning to Herd

A recurrent PPO herder tested under limited visibility, moving goals, and unseen maps.

PythonRecurrent PPOSimulationEvaluation
Observe

The herder sees only nearby sheep and noisy geometric signals.

SELECT A STAGE TO FOLLOW THE SYSTEM

Overview

I co-authored the work and built the herding system and experiments with my collaborators.

The problem

A herding policy can appear successful while memorizing one goal or one map. The engineering challenge was to make the environment, curriculum, and evaluation reveal whether the policy actually generalized.

What I built

  • A partially observable 2D environment with reactive sheep, obstacles, and varied goals.
  • Geometric heuristic, behavior-cloning, and recurrent PPO approaches in a shared test setting.
  • Procedural layouts, domain randomization, adaptive curricula, and held-out evaluations across seeds.

System design

One shared simulator supplies the heuristic, behavior-cloning, and recurrent PPO agents. It varies topology, goals, dynamics, and observation noise. Training, validation, and held-out procedural test scenarios stay separate; evaluation records per-seed outcomes and final flock position.

Key decisions

  • Move from fixed layouts to procedural training after early policies failed under shifted goals and unseen maps.
  • Use recurrent policy memory for limited visibility and report multiple seeds on held-out procedural layouts.
  • Compare where the flock ends, not only whether it briefly reaches the goal.

Outcome

In the current working manuscript, the final recurrent policies end with 30–32% of the flock in the goal on the held-out procedural suite, versus 47% for a heuristic with full obstacle-map access. Earlier, higher success figures came from narrower training settings and are not presented as final results.

What I learned

A strong training score can conceal overfitting. Procedural tests and per-seed reporting made the remaining failure mode visible: getting sheep into the goal is easier than holding them there.

Links

Explore source on GitHub ↗

NEXT PROJECT →Multimodal Emotion Engine ↗