MH-FLOCKE MH-FLOCKE
HomeDocsGitHubBlogPapersYouTubeReddit𝕏

Architecture Overview

The 15-Step Cognitive Cycle

MH-FLOCKE processes sensory input and produces motor output through a biologically grounded 15-step cognitive cycle, executed every simulation timestep (200 Hz). This replaces the typical observe-act loop of reinforcement learning with a layered system inspired by vertebrate neuroscience.

  1. SENSE — Raw sensor values (position, velocity, orientation, joint angles)
  2. BODY SCHEMA — Efference copy check: did the body move as predicted?
  3. WORLD MODEL — Spiking predictive model computes prediction error
  4. EMOTIONS — Valence-arousal from body signals (falls → fear, progress → satisfaction)
  5. MEMORY — Retrieve similar past episodes via sensomotor pattern matching
  6. DRIVES — Compute dominant drive (survival, exploration, comfort, social)
  7. GWT — Global Workspace competition: sensory vs motor vs predictive vs error
  8. METACOGNITION — Self-monitoring: confidence, consciousness level
  9. CONSISTENCY — Are predictions, emotions, and memory aligned?
  10. REWARD — Combined: curiosity + empowerment + drive modulation + emotion
  11. LEARNING — R-STDP weight updates modulated by reward and prediction error
  12. SYNAPTOGENESIS — SNN patterns consolidated into concept graph
  13. HEBBIAN — Co-activation strengthening
  14. DREAM — Periodic offline replay for memory consolidation
  15. NEUROMOD — Adjust DA/5-HT/NE/ACh from emotion + metacognition

Neural Architecture

The SNN uses Izhikevich neurons organized in cerebellar populations following the Marr-Albus-Ito model:

Population Freenove (560) Go2 (1,376) Role
Mossy Fibers (Input) 48 304 Sensory encoding
Granule Cells 269 567 Sparse expansion
Golgi Cells 47 99 Inhibitory feedback
Purkinje Cells 24 24 Learning substrate (LTD)
DCN 24 24 Motor correction output
Motor Hidden 136 286 R-STDP learning
Output 12 72 Actuator commands

The cerebellum additionally uses a 4,000-cell granule expansion layer (Marr-Albus-Ito forward model) for motor prediction and correction via climbing fiber error signals.

Motor Control Stack

The motor output is a blend of three components:

  • CPG (Central Pattern Generator) — Phase-coupled oscillators provide innate walking rhythm from step 1. No learning needed to walk.
  • SNN Actor — Learned corrections from R-STDP. A competence gate smoothly transitions from 90% CPG to 40% CPG / 60% actor as the SNN demonstrates stable locomotion.
  • Reflexes — Spinal stretch reflexes, terrain adaptation, vestibular righting reflex. Always active, never learned.

Steering (v0.5.1)

Navigation uses closed-loop PID steering with IMU feedback:

  • Camera detects light source → target heading
  • IMU provides actual heading (MPU6050 yaw)
  • PID controller computes heading error
  • Asymmetric stride: left legs longer stride → dog curves right (tank steering)
  • I-term eliminates steady-state drift from mechanical asymmetry

This replaces the earlier Z-offset steering which was proven ineffective through hardware isolation tests.

Meta-Learning Loop (v0.5.1)

Four autonomous modules form a closed self-improvement loop:

  • Phase A — EpisodeAnalyzer: Compares successful vs unsuccessful navigation events, identifies correlations
  • Phase B — StrategyAdapter: Converts insights into parameter adjustments (RT timing, PID gains)
  • Phase C — CuriosityExplorer: World model prediction error drives exploration vs exploitation balance
  • Phase D — HypothesisGenerator: Generates testable motor hypotheses from insights

Neuromodulation

Four neuromodulatory systems modulate SNN dynamics globally:

  • Dopamine (DA) — Reward prediction, R-STDP learning rate
  • Serotonin (5-HT) — Emotional valence, patience
  • Norepinephrine (NE) — Arousal, exploration vs exploitation
  • Acetylcholine (ACh) — Attention, learning rate boost

References

  • Izhikevich, E.M. (2003). Simple model of spiking neurons. IEEE Trans. Neural Networks
  • Marr, D. (1969). A theory of cerebellar cortex. Journal of Physiology
  • Friston, K. (2010). The free-energy principle. Nature Reviews Neuroscience
  • Grillner, S. (2003). The motor infrastructure. Nature Reviews Neuroscience
  • Rybak, I.A. et al. (2006). Modelling spinal circuitry involved in locomotor pattern generation
  • Frémaux, N. & Gerstner, W. (2016). Neuromodulated STDP. Frontiers in Comp. Neuroscience