Text2Traj2Text: Learning-by-Synthesis Framework for Contextual Captioning of Human Movement Trajectories

Hikaru Asano, Ryo Yonetani, Taiki Sekii, Hiroki Ouchi

TL;DR

Understanding the intent behind physical shopping paths—such as whether a customer is hunting for bargains or buying quick dinner ingredients—typically requires scarce, privacy-sensitive trajectory data. Text2Traj2Text solves this bottleneck by using large language models paired with robotic trajectory planners to generate diverse, synthetic shopping paths from scratch. A compact language model (T5-Base) trained solely on this synthetic data successfully generalizes to real human shopping behavior, matching or outperforming models orders of magnitude larger like GPT-4.

What Problem Does This Paper Address?

Retailers track in-store paths and point-of-sale data to optimize layouts and personal offers, but interpreting why a customer moves the way they do remains a manual, expert-driven task. Translating physical trajectories into human-readable shopper profiles (e.g., "budget-conscious and planning healthy meals") is difficult to automate because collecting real-world trajectories with fine-grained context annotations is invasive, labor-intensive, and constrained by privacy concerns.

This paper introduces the task of contextual captioning of human movement trajectories and addresses the severe lack of annotated training data through a synthetic data framework.

Methods

The authors introduce Text2Traj2Text, a two-phase framework:

  1. Text2Traj (Data Synthesis):
  2. Hierarchical LLM Planning: GPT-4 first drafts contextual persona profiles with varying goals, preferences, and a "purchase consideration" score (a proxy for exploratory browsing vs. sticking strictly to a list). It then breaks profiles down into category-level action plans and concrete grocery lists (items to buy vs. items browsed).
  3. Physical Grounding: A classical robotics motion planning pipeline—combining Probabilistic Roadmaps (PRM) for global waypoints and Dynamic Window Approach (DWA) for local collision avoidance—translates these item lists into realistic 2D walking paths on a store layout.
  4. Augmentation: Text captions are paraphrased using GPT-3.5 (generating up to 8 variations per sample) to enrich linguistic diversity.
  5. Traj2Text (Model Fine-Tuning):
  6. Raw 2D paths are preprocessed by filtering out transit movement, extracting only "stopping moments" where customers pause to inspect nearby shelves.
  7. The sequence of visited categories and final purchased items is formatted into a text prompt.
  8. A compact T5-Base model (223M parameters) is fine-tuned to predict the underlying contextual persona directly from this trajectory sequence.
Persona / Intent (LLM) 
  → Action & Item Plan (LLM) 
  → Trajectory Simulation (PRM + DWA)
  → Trajectory-to-Text Fine-tuning (T5-Base)

Datasets

  • Synthetic Training & Validation Set: 80 original pairs of contextual captions and simulated trajectories created on a supermarket layout, expanded up to $64 \times 9$ training samples via paraphrasing.
  • Human Benchmark Dataset: A newly collected evaluation set featuring 8 human subjects. Two participants wrote grounded shopper profiles, and six navigated a virtual grocery store interface (using keyboard controls to traverse aisles and add items to a cart) following 10 randomized personas across both seen and unseen store layouts (yielding 60 full trajectories).

Key Insights and Ideas

  • Synthetic Grounding Bridges the Domain Gap: Even though the model trains exclusively on synthetic trajectories generated by simulated planners, it transfers robustly to human movement without retraining.
  • Both Movement and Purchases Are Essential: Ablation experiments showed that removing either the physical trajectory or the list of purchased items significantly crippled model performance. Shuffling trajectories across different shopping carts also caused performance drops, verifying that the spatial sequence (where a customer lingered before buying) carries distinct contextual intent.
  • Paraphrasing Mitigates LLM Homogeneity: Simply increasing the number of synthetic paraphrases monotonically boosted fine-tuning performance, preventing the small model from overfitting to specific phrasing patterns from the synthesizer.

Key Results

  • Small Specialist Beats Few-Shot Giants: On synthetic test trajectories, the fine-tuned T5-Base (223M parameters, 8 paraphrases) achieved a 0.412 ROUGE-1 and 0.905 BERTScore-F1, outperforming 4-shot in-context learning with GPT-4 (0.378 R-1 / 0.902 BS-f1) and Llama-2-7B (0.391 R-1 / 0.897 BS-f1).
  • Zero-Shot Map Generalization: When tested on real human movements in a completely novel store map layout, the model maintained high semantic fidelity with almost zero performance degradation (0.893 BS-f1 on seen maps vs. 0.890 on unseen maps).
  • Real Human Data: Evaluating against actual human-written descriptions, the model achieved 0.876 BERTScore-F1, neck-and-neck with GPT-4 (0.879), proving the semantic intent was reliably captured despite lexical variations.

Limitations and Future Work

  • Input Length Constraints: Relying on standard transformer context windows limits the system from processing excessively long, hours-long trajectories without chunking or hierarchical aggregation.
  • Hallucination of Unobservable Details: Human-written captions sometimes infer demographics (e.g., "newly married couple") or conditional logic that cannot be deduced purely from indoor positioning and cart receipts.
  • Deployment Realities: Practical implementations require strict opt-in/opt-out mechanisms for customer tracking and post-processing safeguards to avoid outputting offensive or erroneous profile descriptions. Future research will explore real-time, streaming inference for live customer assistance.

Summary updated

BibTeX
@inproceedings{asano2024text,
  author = {Hikaru Asano and Ryo Yonetani and Taiki Sekii and Hiroki Ouchi},
  title = {{Text2Traj2Text: Learning-by-Synthesis Framework for Contextual Captioning of Human Movement Trajectories}},
  booktitle = {INLG},
  year = {2024},
  url = {https://openreview.net/forum?id=Ju3HItfJOJ},
}

Loading related content...

Figure