Roo Spring-Hop Model

An exploratory project modeling kangaroo hop biomechanics from real motion-capture data, testing whether the motion pattern could help detect kangaroos on roads.
Status: Exploratory / proof-of-concept (hobby project)
Full source code: github.com/chai-ks/roo-spring-hop-model
Why this project
Kangaroo–vehicle collisions are a real road safety problem in Australia, and detection is hard: incidents are relatively rare (so labeled training data is scarce), and some vision-based systems reportedly misclassify kangaroos as other animals (e.g. dogs) because of their unusual silhouette. This project asks a narrower question: could the kangaroo's distinctive hopping motion — not just its shape — be used as an additional signal for detection?
This is an early-stage exploration, not a deployed system. The goal was to test whether real biomechanics data could be turned into a mathematically grounded motion model, and whether that model could plausibly separate "hopping" from "not hopping" in a simple classifier.
Data sources
Kangaroo hopping motion-capture data — a stance-phase trajectory (hip marker position, 200 Hz, 3D motion capture) excerpted from the dataset accompanying: "Postural adaptations may contribute to the unique locomotor energetics seen in hopping kangaroos." eLife, 2025. elifesciences.org/articles/96437 — data via figshare (DOI: 10.6084/m9.figshare.30282592). The study recorded 100 trials / 173 strides from red kangaroos hopping at Alma Park Zoo, Brisbane, at speeds of 1.99–4.48 m/s.
Musculoskeletal model animation ("Figure 1—Video 2" from the same paper) — an OpenSim animation of the skeleton driven by a real recorded hop, used as a second, independent way to extract hop motion by tracking the animation's markers frame-by-frame.
Road-collision context — Klöcker, U., Ford, F., & Everitt, R. (2006). "Frequency and causes of kangaroo–vehicle collisions on an Australian outback highway." Wildlife Research. This provided real-world context: collision probability rose exponentially with traffic volume, and erratic panic movement was documented in the field (e.g. kangaroos trapped between roadside stock-fences criss-crossing the road).
Method summary
1. Model the stance phase from real data. Hip height over time was fit with a damped spring/oscillator model:
def spring_model(t, h0, A, omega, phase):
return h0 + A * np.cos(omega * t + phase)
params, _ = curve_fit(spring_model, time, height_m, p0=[0.64, 0.08, 19, 0])
This fit the data far better than a simple parabola (RMSE 0.008 m vs 0.023 m), confirming the classic spring-mass model of hopping locomotion — the leg compresses and releases like a loaded tendon, rather than following pure ballistic flight during ground contact.
2. Cross-validate independently. The same hip marker was tracked separately from the OpenSim animation, using color-based marker detection and frame-to-frame nearest-neighbor tracking (to avoid mis-tracking between multiple visible markers):
cand = min(blobs, key=lambda b: (b[0]-prev[0])**2 + (b[1]-prev[1])**2)Bounce frequency from the two independent sources agreed closely:
Motion-capture fit: ≈2.87 Hz
Animation-tracked marker: ≈3.03 Hz (~5% difference — a meaningful cross-check between two separate data sources.)
3. Build a physically-grounded synthetic hop generator. Combining the fitted stance shape with real published regression equations (contact duration vs. speed) and standard projectile-motion physics for the flight phase:
def contact_duration(speed_ms):
return 0.342 * speed_ms ** -0.477 # from the eLife dataset's own regression
def generate_multi_hop_sequence(speed_ms, n_hops, duty_factor=0.4, crouch_depth=0.14):
# stance: spring-shaped dip
# flight: true projectile motion (v_takeoff derived from flight duration)4. Build and test a lightweight classifier. Rather than a large neural network, a simple feature-based classifier (frequency, spectral peakiness, amplitude, shape correlation against a hop template) was trained on the synthetic data.
Accuracy on held-out synthetic test data: 99%
Result on real data: correctly classified the mocap example as hopping; failed on the single-hop animation-tracked example.
Key finding
The high synthetic accuracy was misleading. Diagnosing the failure revealed the classifier had implicitly learned to detect repetition (multiple hops in a row), because all synthetic training examples contained 3–6 repeated cycles. A single hop — arguably the more realistic case for a car passing a kangaroo at speed — didn't trigger the same features.
This is treated as the core result of the project so far: a real, diagnosed limitation, not a hidden one. It directly informs the next design step — adding a shape-correlation feature that can recognize a single hop's crouch-then-flight profile without needing repetition.
Limitations
Validated against only two real data points so far — not enough for statistical confidence.
No real dashcam or road footage has been tested yet; all "realistic noise" (occlusion, sensor vibration) is currently synthetic.
The classifier is a simple proof-of-concept (logistic regression on hand-designed features), not a production-ready detector.
Frame-rate assumptions for the animation data (200 Hz) are a working hypothesis, not independently confirmed.
Next steps
Fix the single-hop detection blind spot (shape-correlation approach, in progress)
Seek out the full raw dataset (173 strides) from the source repository, rather than the single excerpted trial used so far
Validate against real (non-synthetic) video if a suitable clip can be found
Explore radar-based "micro-Doppler" gait signatures as a parallel, weather-robust detection channel
References
eLife (2025). Postural adaptations may contribute to the unique locomotor energetics seen in hopping kangaroos. eLife 96437. https://elifesciences.org/articles/96437
Klöcker, U., Ford, F., & Everitt, R. (2006). Frequency and causes of kangaroo–vehicle collisions on an Australian outback highway. Wildlife Research.
Dataset: figshare, DOI 10.6084/m9.figshare.30282592