Skip to main content
Back

TrajMamba Predicts Pedestrian Paths With 11x Fewer Parameters Than Rivals

A new Mamba-based network predicts where a pedestrian will be in the next 1.5 seconds from a moving dashcam, beating transformer baselines with a fraction of the parameters.

Pro

  • TrajMamba predicts pedestrian bounding boxes from a moving vehicle using two Mamba encoders and an ego-motion-guided decoder.
  • The paper beats prior SOTA by 40%+ on ADE/FDE for 1-second prediction on the PIE dataset.
  • Ego-motion is used as an explicit conditioning cue in the decoder rather than fused with pedestrian features upfront.
  • Network predicts residuals against a constant-velocity, constant-scale reference trajectory, injecting a physics prior.
  • Achieves accuracy gains with only 0.20M parameters and 6.35 GFlops, roughly 10x smaller than transformer baselines.
  • Limitations: no crowd interaction modeling, no scene context, no released code, weaker on JAAD at 1.5-second horizons.

Predicting where a pedestrian will step next is one of the hardest problems in autonomous driving perception. The camera is moving, the pedestrian is moving, and the pixels only ever show you the tangled sum of both. A new paper called TrajMamba takes a shot at this with a state space model architecture and reports state of the art numbers on the two standard benchmarks in the field, while using less than a fifth of the parameters of comparable baselines.

The dual motion trap

The core objective of first-person perspective pedestrian trajectory prediction is to accurately forecast the future bounding box sequence of the target pedestrian within the ego-camera coordinate system. The trouble is that what you see in the image is the projection of two independent motions onto the same 2D plane: the pedestrian actually walking, and the car actually driving. Consequently, the prediction accuracy heavily relies on the effective modeling of the relative motion between these two sources.

Most prior work fuses pedestrian and ego-vehicle features early and then hands the mixture to a decoder. In all these approaches, the two types of motion features are integrated into a unified representation during the encoding stage, leaving the decoder to generate future predictions. That makes it hard for the network to reason explicitly about how the vehicle's motion is modulating what the pedestrian appears to do.

Two encoders, one guided decoder

TrajMamba keeps the two motion sources separate all the way through the pipeline. It uses four modules built around Mamba, the selective state space model that has been eating into transformer territory for long-sequence tasks:

  • A Pedestrian Motion Encoder (PME) that ingests bounding boxes plus derived velocities and scale changes.
  • An Ego-Motion Encoder (EME) that consumes vehicle speed (on PIE) or discrete driving behavior labels like stopped, accelerating, or decelerating (on JAAD).
  • An Ego-Motion-Guided Decoder (EMGD) which is the actual novelty.
  • A future trajectory generator MLP that maps decoded features to bounding boxes.

The interesting bit is the decoder. In our design, pedestrian motion features serve as the historical context for the decoder, while the vehicle's motion features at the last observed timestamp (T) are used as explicit conditional guidance for the future prediction horizon. In other words, the pedestrian's past is what the model remembers, and the ego-motion is repeatedly injected as a control signal telling the decoder how the world is going to shift under the camera.

TrajMamba architecture diagram showing pedestrian motion and ego-motion encoders feeding into an ego-motion-guided Mamba decoder

A physics prior baked into the output

The authors also change what the network actually predicts. Instead of regressing raw future bounding boxes, TrajMamba predicts residuals against a constant-velocity, constant-scale reference trajectory extrapolated from the last five observed frames. The key innovation lies in predicting residuals relative to a physically motivated reference trajectory, which not only eases network optimization but also injects valuable prior knowledge into the learning process. The ablation shows this residual formulation is a big deal on its own, cutting Average Root Mean Square Error on PIE from 24.68 down to 11.60.

The numbers

Experiments run on the two dominant egocentric pedestrian datasets: JAAD is a dataset for studying joint attention in the context of autonomous driving, which is widely used in trajectory prediction from egocentric views and crossing intention prediction research. PIE is a dataset for studying pedestrian behavior in traffic, which contains over 6 hours of footage recorded in typical traffic scenes with on-board camera. Models observe 15 frames (0.5 seconds) and predict either 30 frames (1.0 s) or 45 frames (1.5 s) forward.

For 1-second prediction on PIE, TrajMamba lands at 7.72 ADE and 16.99 FDE, versus PedFormer at 13.08 / 30.35 and SGNet at 8.35 / 17.83. On JAAD 1-second it gets 13.90 ADE against SGNet's 14.90. For 1.5s prediction (lower part), TrajMamba achieves best performance on PIE but lags behind PEvT, MTN, and Zhang et al.'s method on JAAD. The authors attribute this to the coarser vehicle-behavior labels in JAAD compared to PIE's continuous speed signal.

The quiet win: parameter count

The ablation tables tell a story the headline metrics undersell. On PIE, the Mamba encoder plus ego-motion-guided Mamba decoder configuration uses 6.35 GFlops and 0.20 million parameters. The same architecture built on transformers with classic post-fusion decoding uses 87.48 GFlops and 2.31 M parameters. That is roughly a 14x compute reduction and an 11x parameter reduction for equal or better accuracy, which matters if this is going to run on an in-car SoC alongside detection, tracking, and planning.

The ablations also isolate the two contributions cleanly. Swapping in the ego-motion-guided decoder while keeping the transformer backbone still improves accuracy over post-fusion, so most of the gain comes from the decoding scheme rather than Mamba itself. Mamba mostly buys efficiency.

What it will not do

TrajMamba treats each pedestrian in isolation. Currently, we have not yet considered the mutual influence among pedestrians in crowds. Therefore, in future work, the prediction performance of the TrajMamba model will be improved by modeling pedestrian interaction. That is a real gap for crowded urban intersections, where social forces between pedestrians drive a lot of the interesting behavior. It also does not use visual scene context like crosswalks, curbs, or traffic lights, and it does not produce multi-modal predictions with uncertainty, which several of the models it competes against do. The paper does not mention a code release, so anyone wanting to reproduce or build on it will need to reimplement from the description.

Still, for teams building egocentric trajectory forecasters on constrained hardware, the combination of explicit ego-motion conditioning and a residual-from-physics output target is a template worth borrowing even independent of Mamba. It is a clean example of what happens when you stop trying to shove every signal into one big fused embedding.