Biologically Grounded Embodied Cognition for Quadruped Locomotion Learning
A simulated quadruped learns to walk through a 15-step closed-loop cognitive architecture integrating spiking neural networks, cerebellar forward models, central pattern generators, embodied emotions, and reward-modulated spike-timing-dependent plasticity — no end-to-end RL required.
| Config | Distance (m) | Falls | Variance |
|---|---|---|---|
| B1 SNN+Cerebellum | 45.15 ± 0.67 | 0 | σ = 0.67 |
| A1 CPG only | 40.73 ± 6.14 | 0.2 | σ = 6.14 |
| PPO Baseline | 12.83 ± 7.78 | 0 | σ = 7.78 |
3.5x faster learning than PPO with 11.6x lower variance at identical sample budgets (50k steps). Zero falls across all 10 seeds.
# Clone
git clone https://github.com/MarcHesse/mhflocke.git
cd mhflocke
# Install dependencies
pip install -r requirements.txt
# Train Go2 on flat terrain (10k steps, ~20 min)
python scripts/train_v032.py \
--creature-name go2 \
--scene "walk on flat meadow" \
--steps 10000 \
--skip-morph-check \
--no-terrain \
--auto-reset 500 \
--seed 42
# Analyze training data
python flog_server.py
# Open http://localhost:5050 for the dashboard- Python 3.11+
- MuJoCo (included via
mujocopip package) - PyTorch
- NumPy, msgpack
MH-FLOCKE implements a 15-step closed-loop processing cycle that runs at every simulation timestep (200 Hz):
SENSE → BODY SCHEMA → WORLD MODEL → EMOTIONS → MEMORY →
DRIVES → GLOBAL WORKSPACE → METACOGNITION → CONSISTENCY →
COMBINED REWARD → R-STDP LEARNING → SYNAPTOGENESIS →
HEBBIAN → DREAM MODE → NEUROMODULATION
The architecture operates across nested timescales:
- Spinal reflexes (every step) — posture maintenance, stretch reflexes
- Central Pattern Generator — innate gait patterns, competence-gated blending with learned actor
- Cerebellar forward model — Marr-Albus-Ito framework, prediction error-driven motor corrections
- SNN with R-STDP — 5000+ Izhikevich neurons, reward-modulated spike-timing-dependent plasticity
- Cognitive layers — Global Workspace Theory, embodied emotions, episodic memory, motivational drives
The CPG provides a locomotion prior from step 1. As the SNN actor learns, a competence gate smoothly transitions from 90% CPG to 40% CPG / 60% actor. The creature walks immediately and improves through learning — no random exploration phase required.
Three configurations isolate component contributions:
- A (CPG only) — Spinal reflexes + vestibular. The anencephalic baseline.
- B (SNN + Cerebellum) — Adds R-STDP learning, cerebellar forward model, drives, behavior planner.
- C (Full system) — All 15 cognitive steps including GWT, metacognition, dream mode, synaptogenesis.
Each tested on flat and hilly terrain, 10 random seeds, yielding 80 total runs.
The training logger writes binary FLOG files (msgpack-encoded frames at 10-step intervals). The standalone dashboard provides real-time analysis:
python flog_server.pyFeatures: distance/velocity charts, fall detection, CPG/actor weight tracking, cerebellar prediction error, behavioral state timeline.
mhflocke/
├── scripts/train_v032.py # Main training loop
├── src/
│ ├── body/ # MuJoCo creature, terrain, genome
│ ├── brain/ # SNN, cerebellum, CPG, cognitive brain
│ └── behavior/ # Drive-based behavior planner
├── creatures/go2/ # Unitree Go2 configuration
├── flog_server.py # FLOG analysis + dashboard
└── docs/ # Format specs
Full documentation with architecture details, API references, mathematical formulations, and biological background:
25 pages covering: Architecture, SNN Controller, R-STDP, Cerebellum, CPG, Task Prediction Error, Reflexes, Emotions & Drives, Training Pipeline, FLOG Format, World Model, Global Workspace, Body Schema, Memory, Metacognition, and more.
MH-FLOCKE: Biologically Grounded Embodied Cognition Through a 15-Step Closed-Loop Architecture for Quadruped Locomotion Learning
Marc Hesse (2026). Independent Researcher, Potsdam, Germany.
Preprint: aixiv.science
The Unitree Go2 MJCF model is from the MuJoCo Menagerie project (Google DeepMind), derived from Unitree Robotics URDF descriptions. Licensed under BSD-3-Clause — see creatures/go2/LICENSE_unitree_go2.
MH-FLOCKE is named after the author's late dog Flocke. The current test pilot is Mogli.
This project is licensed under the Apache License 2.0.
The Unitree Go2 model files in creatures/go2/ are licensed under BSD-3-Clause — see creatures/go2/LICENSE_unitree_go2.
@article{hesse2026mhflocke,
title={MH-FLOCKE: Biologically Grounded Embodied Cognition Through a 15-Step Closed-Loop Architecture for Quadruped Locomotion Learning},
author={Hesse, Marc},
year={2026},
note={Independent Researcher, Potsdam, Germany}
}- Website: mhflocke.com
- Email: info@mhflocke.com
- Reddit: u/mhflocke