iSEE-Laboratory / PPT

(ECCV 2024) Official PyTorch implementation of paper "Progressive Pretext Task Learning for Human Trajectory Prediction"
MIT License
25 stars 4 forks source link

Progressive Pretext Task Learning for Human Trajectory Prediction

Xiaotong LinTianming LiangJianhuang LaiJian-Fang Hu*
Sun Yat-sen University
ECCV 2024

๐Ÿ  Abstract

Human trajectory prediction is a practical task of predicting the future positions of pedestrians on the road, which typically covers all temporal ranges from short-term to long-term within a trajectory. However, existing works attempt to address the entire trajectory prediction with a singular, uniform training paradigm, neglecting the distinction between short-term and long-term dynamics in human trajectories. To overcome this limitation, we introduce a novel Progressive Pretext Task learning (PPT) framework, which progressively enhances the model's capacity of capturing short-term dynamics and long-term dependencies for the final entire trajectory prediction. Specifically, we elaborately design three stages of training tasks in the PPT framework. In the first stage, the model learns to comprehend the short-term dynamics through a stepwise next-position prediction task. In the second stage, the model is further enhanced to understand long-term dependencies through a destination prediction task. In the final stage, the model aims to address the entire future trajectory task by taking full advantage of the knowledge from previous stages. To alleviate the knowledge forgetting, we further apply a cross-task knowledge distillation. Additionally, we design a Transformer-based trajectory predictor, which is able to achieve highly efficient two-step reasoning by integrating a destination-driven prediction strategy and a group of learnable prompt embeddings. Extensive experiments on popular benchmarks have demonstrated that our proposed approach achieves state-of-the-art performance with high efficiency.

๐Ÿ“– Implementation

I. Installation

Environment

Dependencies

Install the dependencies from the requirements.txt:

pip install -r requirements.txt

Pre-trained Models and Pre-processed Data

We provide a complete set of pre-trained models including:

You can download the pre-trained models and the pre-processed data from here.

File Structure

After the prepartion work, the whole project should has the following structure:

./MemoNet
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ data                            # datasets
โ”‚   โ”œโ”€โ”€ ETH_UCY
โ”‚   โ”‚   โ”œโ”€โ”€ social_eth_test_256_0_50.pickle
โ”‚   โ”‚   โ”œโ”€โ”€ social_eth_train_256_0_50.pickle
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚ย ย  โ”œโ”€โ”€ social_sdd_test_4096_0_100.pickle
โ”‚ย ย  โ””โ”€โ”€ social_sdd_train_512_0_100.pickle
โ”œโ”€โ”€ models                          # core models
โ”‚ย ย  โ”œโ”€โ”€ layer_utils.py
โ”‚ย ย  โ”œโ”€โ”€ model.py
โ”‚ย ย  โ””โ”€โ”€ ...
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ run.sh
โ”œโ”€โ”€ sddloader.py                    # sdd dataloader
โ”œโ”€โ”€ test_PPT.py                     # testing code
โ”œโ”€โ”€ train_PPT.py                    # training code
โ”œโ”€โ”€ trainer                         # core operations to train the model
โ”‚ย ย  โ”œโ”€โ”€ evaluations.py
โ”‚ย ย  โ”œโ”€โ”€ test_final_trajectory.py
โ”‚ย ย  โ””โ”€โ”€ trainer_AIO.py
โ””โ”€โ”€ training                        # saved models/memory banks
    โ””โ”€โ”€ Pretrained_Models
    ย ย  โ”œโ”€โ”€ SDD
    ย ย  โ”‚    โ”œโ”€โ”€ Model_ST
    ย ย  โ”‚    โ”œโ”€โ”€ Model_Des_warm
    ย ย  โ”‚    โ”œโ”€โ”€ Model_LT
    ย ย  โ”‚    โ””โ”€โ”€ Model_ALL
    ย ย  โ””โ”€โ”€ ETH_UCY
    ย ย      โ”œโ”€โ”€ model_eth_res
    ย ย      โ”œโ”€โ”€ model_hotel_res
    ย ย      โ””โ”€โ”€ ...

II. Training

Important configurations.

Training commands.

bash run.sh

III. Reproduce

To get the reported results, following

python test_PPT.py --reproduce True --info reproduce --gpu 0

And the code will output:

./training/Pretrained_Models/SDD/model_ALL
Loaded data!
Test FDE_48s: 10.650254249572754 ------ Test ADE: 7.032739639282227
----------------------------------------------------------------------------------------------------

๐Ÿ” Overview

As shown, we propose a Progressive Pretext Task learning (PPT) framework for trajectory prediction, aiming to incrementally enhance the model's capacity to understand the past trajectory and predict the future trajectory. Specifically, our framework consists of three stages of progressive training tasks, as illustrated in subfigure (b). In Stage I, we pretrain our predictor on pretext Task-I, aiming to fully understand the short-term dynamics of each trajectory, by predicting the next position of a trajectory of arbitrary length. In Stage II, we further train the predictor on pretext Task-II, intending to capture the long-term dependencies, by predicting the destination of a trajectory. Once Task-I and Task-II are completed, the model is capable of capturing both the short-term dynamics and long-term dependencies within the trajectory. Finally, in Stage III, we duplicate our model to obtain two predictors: one for destination prediction and another for intermediate prediction. In this stage, we perform Task-III that enables the model to achieve the complete pedestrian trajectory prediction. For the sake of stable training, we further employ a cross-task knowledge distillation to avoid knowledge forgetting.

๐Ÿ‘ Acknowledgements

We sincerely thank the authors of MemoNet for providing the source code from their CVPR 2022 publication. We also appreciate the pre-processed data from PECNet. These resources have been invaluable to our work, and we are immensely grateful for their support.

๐Ÿ”— Citation

If you find our work helpful, please cite:

@inproceedings{
   lin2024progressive,
   title={Progressive Pretext Task Learning for Human Trajectory Prediction},
   author={Lin, Xiaotong and Liang, Tianming and Lai, Jianhuang and Hu, Jian-Fang},
   booktitle={ECCV},
   year={2024},
}