Gait-Aware Full Trajectory Estimation: Letting Foot Contact Switch Itself On

When a cheetah runs through tall grass, cameras lose its legs for dozens of frames. The best existing fix is to stop estimating pose one frame at a time and instead solve for the whole 3D trajectory at once. Each frame is then pinned down by the frames before and after it. On wild cheetahs this halves the error during occlusions, but the motion model it uses is a single smooth constant-acceleration prior that knows nothing about running. Running is not one smooth motion. It alternates between stance, when a planted foot does not move, and flight, when the body follows a falling arc. Each phase ends when the body reaches a physical condition, such as a foot touching the ground, not when a clock runs out.

We propose to put that structure inside the whole-sequence optimizer. The foot-contact mode at each frame is a hidden discrete variable. Its switching probability depends on the current continuous pose (foot height and vertical speed) and on how long the current phase has lasted. The optimizer alternates between two steps. It runs exact forward-backward inference over contact modes given the current trajectory, then it re-solves the trajectory with mode-specific physics penalties weighted by those mode beliefs. The bet is that during occlusion, the rhythm of the gait and the contact physics carry information across the gap that a generic smoothness prior cannot.

Core Claim

Whole-trajectory pose estimation under heavy occlusion improves when the motion prior switches between contact regimes, and the switches are tied to the continuous state rather than imposed as a schedule. The key ingredient is not modes alone. A two-stage "detect contacts by thresholding foot height, then re-optimize" pipeline already gives modes. What it lacks is a way to infer contact when the foot itself is unobserved. State-dependent switching with explicit phase durations supplies exactly this: the posterior over contact during a dive is driven by the visible torso, the gait rhythm before and after the gap, and the requirement that the reconstructed foot actually reach the ground when the model says it lands.

Relation to Prior Work

The method draws on two lines of work and differs from each.

Whole-trajectory estimation. AcinoSet's Full Trajectory Estimation optimizes all 24 skeletal coordinates over the full sequence against multi-view reprojections and a single kinematic prior. It reports 2.76 px root-mean-square error on standard runs and 38.44 px during grass "dives", against 28.24 and 76.35 px for triangulation. We keep its objective and solver and replace its single motion prior with a switched one.

Optimization over discrete modes. Seyde et al. handle discrete contact in legged trajectory optimization by having an outer Bayesian optimizer propose a fixed contact schedule for an inner collocation solver. That schedule is open-loop: the trajectory never triggers a switch. Our switches are a function of the trajectory. Kratzer et al. add sequence-wide perturbations to a recurrent model to satisfy goal constraints. Their model has no discrete regimes. It does, however, motivate the general recipe of learning a local prior and then enforcing global consistency by optimization.

State-dependent switching. The switching side supplies the method. Recurrent switching linear dynamical systems make the next mode's probability a logistic function of the previous continuous state, which in effect learns boundaries in state space. On the chaotic Lorenz system this predicts dwell times of 192 steps (true 215) versus 91 for open-loop switching. RED-SDS adds explicit duration counters and runs exact forward-backward over modes and durations. Ours uses the same hybrid inference, but RED-SDS gets its continuous path from a learned bidirectional encoder, and no physics or camera geometry constrains that path. REDSLDS shows why durations matter: it reaches roughly 0.85 accuracy on the honeybee dance versus roughly 0.37 for rSLDS without durations. It also warns that variational fits of these models tend to collapse onto one averaged regime. That warning constrains our design: we infer modes exactly rather than with a variational approximation.

Filtering under occlusion. Wei et al. use recurrent switching models to track occluded road agents, but only causally, with each step using past data alone. They also report that a simple mixture beats switching dynamics on slow pedestrians. We take that as a real caution: modes can hurt when the motion is near-static.

Research Program

State and modes. Let $q_{1:T}$ be the skeletal coordinates and $y_{1:T}$ the 2D keypoint detections in all views. Let $s_t = (z_t, c_t)$ be the discrete state, where $z_t$ is one of 16 four-foot contact patterns and $c_t$ counts frames spent in the current pattern.

Switching rule. The transition probability is $p(s_t \mid s_{t-1}, q_{t-1})$. It is a logistic function of guard features: each foot's height above a fitted ground plane, each foot's vertical velocity, and the duration counter.

Mode-specific physics. Each pattern $k$ defines a residual $r_k(q_{t-1:t+1})$. A stance foot pays for nonzero velocity and for being off the ground. A full-flight frame pays for any center-of-mass acceleration that departs from gravity.

Objective. We seek the trajectory that maximizes the marginal posterior. This means minimizing

$$ \mathcal{J}(q_{1:T}) = \sum_t \lVert \pi(q_t) - y_t \rVert^2_{W_t} \;-\; \log \sum_{s_{1:T}} p(s_{1:T} \mid q_{1:T}) \prod_t \exp\!\big(-\lambda \lVert r_{z_t}(q_{t-1:t+1}) \rVert^2\big), $$

where $\pi$ projects the 3D pose into every camera and $W_t$ holds the detection confidences, which are zero for occluded keypoints. The sum runs over all mode-and-duration sequences, and $\lambda$ weights the physics penalty against the reprojection error.

Optimization. The sum over sequences is computed by exact forward-backward in $O(TKD)$ time, where $K$ is the number of contact patterns and $D$ the maximum duration. We minimize $\mathcal{J}$ by expectation-maximization. Given $q$, forward-backward yields per-frame mode posteriors. Given those posteriors, the trajectory update is a weighted nonlinear least-squares problem with the same structure as FTE's. It can therefore reuse the same sparse solver and is initialized from the FTE solution, which reduces the local-minimum problem common to whole-trajectory optimizers. The dependence of the transition probabilities on $q$ is kept in the trajectory update, so the optimizer is rewarded for placing a foot on the ground exactly when the guard says contact begins. This term is what makes the loop closed.

Fitting the guards and durations. Guard weights and duration distributions are fit on AcinoSet's unoccluded straight runs, where FTE is already accurate. We then freeze them and apply them to held-out and occluded sequences, so occlusion test data never shapes the prior. Including a "no switching" option, a single permissive mode that reduces exactly to FTE, lets the method fall back when gait structure is absent. This option directly addresses the pedestrian caution from Wei et al..

Baselines

Naive reference. The do-nothing reference is per-frame triangulation as reported in AcinoSet: 28.24 px on standard runs and 76.35 px on dives. We will also run the extended Kalman filter shipped with AcinoSet as the causal reference. No reported number for it is found on Lacuna, so we will report our own.

Strongest existing method. The strongest competitor is FTE itself, at 2.76 px on standard runs and 38.44 px on dives in AcinoSet. It is the strongest because it already uses non-causal whole-sequence information, which is the main source of its occlusion gains. Any improvement we show must therefore come from the switched prior and not from batch inference itself. We will rerun FTE from its released configuration on identical 2D detections, cameras and sequences. Its smoothness weights get the same tuning budget we give our physics weight $\lambda$: an equal number of grid points, selected on the same validation runs. Beating it means reducing dive error clearly beyond seed and split variability while staying within noise of 2.76 px on standard runs.

Two-stage contact baseline. This is FTE, then thresholding foot height and velocity to label contact per frame, then re-running FTE with hard stance and flight penalties on those labels. It is the most plausible simple competitor, and it equals one hard-assignment iteration of our method without the dependence on duration or state.

Ablations. Three ablations isolate the key ingredients. The first is an open-loop variant: Markov transitions on the contact pattern alone, with the same physics residuals but no state dependence and geometric durations. The second is a state-dependent variant without duration counters. The third keeps the full model but drops the guard term from the trajectory update. Together they separate the value of modes, closed-loop guards, and duration rhythm.

Why not just…?

Why not just tune FTE's smoothness prior harder? A stronger constant-acceleration prior averages over stance and flight, so it must either blur the sharp foot-strike transitions or under-smooth the gaps. The reported dive error of 38.44 px versus 2.76 px suggests the generic prior is the bottleneck under occlusion. Our matched-budget tuning of FTE answers this directly. If tuned FTE closes the gap, the proposal fails.

Why not just detect contacts first and then re-optimize? This is the real threat. On visible frames it will likely match us, because foot height is measured well there. Our claim is specifically that it fails when the feet are hidden, since thresholding an unconstrained foot height yields arbitrary labels. The masked-foot experiment below is designed to settle this. If the two-stage pipeline matches us on masked frames, the closed-loop and duration machinery is unnecessary, and we will say so.

Why not just fit an rSLDS or a learned bidirectional smoother to the triangulated keypoints? rSLDS with Kalman smoothing, or a RED-SDS-style encoder, is already non-causal. However, it works on 3D points that are already corrupted by triangulation (76.35 px on dives) and drops the multi-view and skeletal constraints that make FTE strong. A learned smoother would also have to be trained on 7,588 annotated frames. We will run rSLDS smoothing on triangulated keypoints as a baseline to measure this.

Proposed Experiments

Primary benchmark. The primary test is AcinoSet. We report reprojection root-mean-square error on annotated frames, split into straight runs, turns and dives, alongside FTE's published numbers and our reruns.

Decisive masked-foot check. On unoccluded straight runs where FTE is accurate, we artificially delete all foot and lower-limb detections over windows of 10 to 60 frames, in all views, mimicking dives while keeping a reference: the FTE solution on the unmasked data. We then compare masked-frame limb error for FTE, the two-stage pipeline, the ablations and the full method, as a function of window length. The prediction is that the full method's advantage grows with window length, and that the duration ablation loses most of that advantage on gaps longer than one stride.

Physical plausibility. We will measure stance-foot sliding and ground penetration, and compute contact F1 against a small hand-labelled set of stance frames.

Domain with ground truth. To get exact contact and pose labels, we will simulate a planar hopper like that of Seyde et al., rendered to synthetic multi-view keypoints with injected occlusion.

Failure-mode check. On slow walking or standing segments, we test that the method does not underperform FTE, mirroring the pedestrian failure in Wei et al..

Cost. We will report runtime against FTE.