NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

TrajLoc: Trajectory-Attention Localization for Multi-Object Motion Control

Omer Sela, Inbar Huberman-Spiegelglas, Michael Rotman, Sagie Benaim, Avi Ben-Cohen

TL;DR

Trying to direct multiple objects along precise paths in AI-generated videos usually results in visual chaos—identities swap, paths drift, and crossing objects melt into one another. TrajLoc solves this by ditching bloated, video-sized control maps and instead hijacking the model’s existing cross-attention layers, forcing each object’s text token to look only at its target coordinates on every frame. The result is crisp, independent control of up to 20 simultaneous objects—even when their paths cross—using minimal extra compute.

What Problem Does This Paper Address?

Modern Image-to-Video (I2V) diffusion models are fantastic at dreaming up plausible motion from a starting frame and a text prompt. They are terrible, however, at choreography. If you want Pedestrian A to walk left while Pedestrian B walks right and crosses behind them, standard models struggle.

Existing trajectory-control methods take sparse user inputs (just a list of $x,y$ coordinates per frame) and inflate them into massive, video-sized conditioning tensors—like rendered motion videos or dense 3D feature volumes—bolted onto the model via heavy adapters like ControlNet. Because every object’s path gets baked into the same shared spatial canvas, the model loses track of who is who whenever objects crowd together or occlude each other. Consequently, prior work rarely tests beyond one to three objects.

Target trajectories overlaid on the initial conditioning frame for synthetic pedestrians and real-world sheep.

Methods

TrajLoc’s core philosophy is simple: don't build new dense conditioning modules when the diffusion model's native text-and-attention interface already has everything you need.

Given a starting image and paths for $N$ objects, the authors build a structured prompt: "Scene where o_0 moves [traj_0] and o_1 moves [traj_1]...". They then intervene at two levels:

  1. Attention Localization (Spatial Hard Constraint): In standard cross-attention, video patches attend to text tokens freely. TrajLoc overrides the attention weight column for each object token (o_i), replacing the learned weights across all transformer layers with a 2D Gaussian heatmap centered on that object's target $(x, y)$ coordinate for each frame (followed by row renormalization). This acts as a strict spatial spotlight: an object’s token can only influence the exact pixels along its prescribed path. For joint self-attention architectures (like CogVideoX) where materializing the full attention matrix would blow up GPU memory (~30 GB per layer), the authors derive an efficient mathematical approximation.
  2. Token-Level Conditioning (Identity & Depth): A 2D spotlight doesn't tell the model what the object looks like or which object is in front during an occlusion. To fix this, TrajLoc swaps out two embeddings in the prompt:
  3. Appearance Token: A lightweight CNN extracts visual features from the object's starting coordinates in the first frame, replacing the generic category word (o_i, like "girl" or "ball").
  4. Trajectory Token: A 1D convolutional encoder maps the object's $(x, y, \text{depth})$ path into a single embedding vector that replaces [traj_i]. Crucially, this encoder is pre-trained as an autoencoder through the frozen text encoder so the motion and depth signals survive text-encoder self-attention.

Finally, the diffusion backbone's attention layers are fine-tuned via LoRA alongside the appearance encoder, using a flow-matching loss weighted extra heavily inside bounding boxes along the trajectories.

Datasets

Because real-world datasets lack large-scale, static-camera, multi-object ground-truth tracks, TrajLoc is trained exclusively on ~25K synthetic static-camera clips (49 frames at $720\times480$):

  • Training & In-Distribution Eval: MOTSynth (GTA-V urban crowds with up to 20 pedestrians) and three subsets from the ViN suite: MoVi-Extended (2–12 bouncing geometric objects), Pool (billiards), and Football.
  • Out-of-Distribution (OOD) Eval: Real-world static-camera sequences from MOT17 (surveillance pedestrians) and DAVIS 2017 (diverse scenes like fish, sheep, and vehicles).
  • New Benchmark Split: The authors curate MOTSynth-Multi, binning test scenes into groups of 5, 10, 15, and 17–20 controlled pedestrians to systematically stress-test crowd scaling.

Key Insights and Ideas

  • Sparse beats dense for multi-object isolation: Because each object gets its own tokens and its own isolated column in the attention matrix, computation and representation scale with the number of objects $N$, not video resolution. Objects don't bleed into one another because their control signals never share a tensor.
  • Tokens are useless without spatial binding: In ablation studies, adding the learned trajectory and appearance tokens without attention localization barely improves over the bare backbone. Only when attention localization physically binds each token to specific video patches do the per-object embeddings snap into focus (dropping MoVi PSNR by 6.7 dB when removed).
  • Synthetic motion transfers to real-world physics: Even though TrajLoc only ever sees GTA-V sprites and rendered shapes during training, overriding attention preserves the pretrained video model's rich real-world priors—allowing it to outperform real-video-trained baselines on real footage (MOT17 and DAVIS).
Generated frames across time showing every pedestrian and sheep accurately locked onto its colored ground-truth target dot.

Key Results

Tested on two distinct backbones—WaN 2.1-14B (separate cross-attention) and CogVideoX-5B (joint self-attention)—against four strong baselines (Wan-Move, ATI, Tora, MagicMotion):

  • Across-the-board SOTA: TrajLoc wins on visual reconstruction (PSNR), perceptual similarity (LPIPS), and motion accuracy (End-Point Error, or EPE) across all six datasets on both backbones.
  • Concrete Gains: Averages +4.3 dB PSNR (up to +10 dB on Pool) and a 51% reduction in trajectory EPE compared to the strongest same-backbone baselines.
  • Intersections & Crowds: On MoVi clips where 2+ object paths cross, TrajLoc achieves better tracking and visual quality than baselines manage on zero-crossing clips. It cleanly scales up to 20 simultaneous pedestrians without duplicating entities or losing track.

Limitations and Future Work

  • Synthetic Prior Leakage: Because fine-tuning happens on synthetic data, out-of-distribution real-world scenes occasionally trigger synthetic hallucinations—such as morphing a blurry real-world object into a GTA-V pedestrian sprite.
  • Static Cameras & 2.5D Control: The main models assume a static camera at $720\times480$ resolution (handling camera motion in an appendix model only implicitly via background tracks). Adding explicit 3D-aware camera control, finer pose/articulation control, and higher resolutions are key next steps.

Summary updated

BibTeX
@inproceedings{sela2026trajloc,
  author = {Omer Sela and Inbar Huberman-Spiegelglas and Michael Rotman and Sagie Benaim and Avi Ben-Cohen},
  title = {{TrajLoc: Trajectory-Attention Localization for Multi-Object Motion Control}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=DyRKHZlevm},
}

Loading related content...

Figure