The official PyTorch code implementation of "Human Trajectory Prediction via Counterfactual Analysis" in ICCV 2021.

Overview

Human Trajectory Prediction via Counterfactual Analysis (CausalHTP)

The official PyTorch code implementation of "Human Trajectory Prediction via Counterfactual Analysis" in ICCV 2021.arxiv

News

We add the implementation of our project Causal-STGAT, where we apply our CausalHTP method to the baseline backbone network STGAT. The code of Causal-STGCNN is coming soon.

Introduction

Most trajectory prediction methods concentrate on modeling the environment interactions and aggregate these interaction clues with history behavior clues for trajectory prediction. However, there are heavy biases in the between training and deployment environment interactions. The motivation of this project is to mitigate the negative effects of the inherent biases. We propose a counterfactual analysis method to alleviate the overdependence of environment bias and highlight the trajectory clues itself. This counterfactual analysis method is a plug-and-play module which can be easily applied to any baseline predictor, and consistently improves the performance on many human trajectory prediction benchmarks.

image Figure 1. Training process of our counterfactual analysis method. We apply the counterfactual intervention by replacing the features of past trajectory with the counterfactual features such as uniform rectilinear motion, mean trajectory, or random trajectory. The counterfactual prediction denotes the biased affect from environment confounder. To alleviate the negative effect of environment bias, we subtract the counterfactual prediction from original prediction as the final causal prediction.

Requirements

  • Python 3.6+
  • PyTorch 1.3

To build all the dependency, you can follow the instruction below.

pip install -r requirements.txt

Dataset

The datasets can be found in datasets/, we provide 5 scenes including eth, hotel, univ, zara1, and zara2.

Training and Evaluation

You can train the model for eth dataset as

python train.py --dataset_name eth

To evaluate the trained model, you can use

python evaluate_model.py --dataset_name eth --resume your_checkpoint.pth.tar

The pre-trained models can be found in pretrain/

Result

Results (ADE/FDE) ETH HOTEL ZARA1 ZARA2 UNIV AVG
STGAT 0.73/1.39 0.38/0.72 0.35/0.69 0.32/0.64 0.57/1.22 0.47/0.93
Causal-STGAT 0.60/0.98 0.30/0.54 0.32/0.64 0.28/0.58 0.52/1.10 0.40/0.77

image Figure 2. Visualization examples of our Causal-STGAT method and baseline Social-STGAT method in the different scenes in the both ETH and UCY datasets. The comparisons quantitatively demonstrate the effectiveness of our counterfactual analysis on the RNN-based baselines.

Citation

Part of the code comes from STGAT. If you find this code useful then please also cite their paper.

Please use the citation provided below if this repo is useful to your research:

@inproceedings{CausalHTP,
  title={Human Trajectory Prediction via Counterfactual Analysis},
  author={Chen, Guangyi and Li, Junlong and Lu, Jiwen and Zhou, Jie},
  booktitle={ICCV},
  year={2021}
}
You might also like...
(ICCV 2021) Official code of
(ICCV 2021) Official code of "Dressing in Order: Recurrent Person Image Generation for Pose Transfer, Virtual Try-on and Outfit Editing."

Dressing in Order (DiOr) 👚 [Paper] 👖 [Webpage] 👗 [Running this code] The official implementation of "Dressing in Order: Recurrent Person Image Gene

Official code release for ICCV 2021 paper SNARF: Differentiable Forward Skinning for Animating Non-rigid Neural Implicit Shapes.
Official code release for ICCV 2021 paper SNARF: Differentiable Forward Skinning for Animating Non-rigid Neural Implicit Shapes.

Official code release for ICCV 2021 paper SNARF: Differentiable Forward Skinning for Animating Non-rigid Neural Implicit Shapes.

Official code release for
Official code release for "Learned Spatial Representations for Few-shot Talking-Head Synthesis" ICCV 2021

Official code release for "Learned Spatial Representations for Few-shot Talking-Head Synthesis" ICCV 2021

Official implementation of NPMs: Neural Parametric Models for 3D Deformable Shapes - ICCV 2021
Official implementation of NPMs: Neural Parametric Models for 3D Deformable Shapes - ICCV 2021

NPMs: Neural Parametric Models Project Page | Paper | ArXiv | Video NPMs: Neural Parametric Models for 3D Deformable Shapes Pablo Palafox, Aljaz Bozic

Official implementation of the paper Vision Transformer with Progressive Sampling, ICCV 2021.
Official implementation of the paper Vision Transformer with Progressive Sampling, ICCV 2021.

Vision Transformer with Progressive Sampling This is the official implementation of the paper Vision Transformer with Progressive Sampling, ICCV 2021.

 Official implementation of the ICCV 2021 paper
Official implementation of the ICCV 2021 paper "Conditional DETR for Fast Training Convergence".

The DETR approach applies the transformer encoder and decoder architecture to object detection and achieves promising performance. In this paper, we handle the critical issue, slow training convergence, and present a conditional cross-attention mechanism for fast DETR training. Our approach is motivated by that the cross-attention in DETR relies highly on the content embeddings and that the spatial embeddings make minor contributions, increasing the need for high-quality content embeddings and thus increasing the training difficulty.

The Official Implementation of the ICCV-2021 Paper: Semantically Coherent Out-of-Distribution Detection.
The Official Implementation of the ICCV-2021 Paper: Semantically Coherent Out-of-Distribution Detection.

SCOOD-UDG (ICCV 2021) This repository is the official implementation of the paper: Semantically Coherent Out-of-Distribution Detection Jingkang Yang,

Official implementation of the ICCV 2021 paper:
Official implementation of the ICCV 2021 paper: "The Power of Points for Modeling Humans in Clothing".

The Power of Points for Modeling Humans in Clothing (ICCV 2021) This repository contains the official PyTorch implementation of the ICCV 2021 paper: T

Official implementation of the ICCV 2021 paper
Official implementation of the ICCV 2021 paper "Joint Inductive and Transductive Learning for Video Object Segmentation"

JOINT This is the official implementation of Joint Inductive and Transductive learning for Video Object Segmentation, to appear in ICCV 2021. @inproce

Comments
  • Question about visualization

    Question about visualization

    Hi,

    Thank you very much for your work and I'm very interested in trajectory prediction.

    I have some problems about the visualization of predicted trajectory. How to plot the trajectories in the scene picture just like the Fig5(https://github.com/CHENGY12/CausalHTP/blob/main/images/examples_social-stgat.png) in your paper?

    Can you share with me the code for the visualization of the trajectories please? Thank you very much!

    opened by Xiejc97 4
  • Questions about the conterfactual feature (Only zero vector is used, the other two are not given)

    Questions about the conterfactual feature (Only zero vector is used, the other two are not given)

    Hi, this is an interesting work. Thanks for sharing the code. However, in your code "models.py" from line 255 " traj_lstm_hidden_states_c = torch.zeros_like(traj_lstm_hidden_states[-1]) " It seems that only zero vector is used. The mean vector of all history trajectories or the random trajectories are not shown here as the counterfactual intervention. Could you explain that? Thank you

    opened by kevinlemon 1
  • Details about the Reproduced STGAT

    Details about the Reproduced STGAT

    Hi, thanks for your excellent work! May I ask the difference between your reproduced STGAT(STGAT*) and the optimised STGAT(raw)? It seems like your results on UNIV dataset do not outperform the optimised STGAT.

    opened by HRHLALALA 1
Owner
null
An official implementation of "Exploiting a Joint Embedding Space for Generalized Zero-Shot Semantic Segmentation" (ICCV 2021) in PyTorch.

Exploiting a Joint Embedding Space for Generalized Zero-Shot Semantic Segmentation This is an official implementation of the paper "Exploiting a Joint

CV Lab @ Yonsei University 35 Oct 26, 2022
[ICCV 2021] Official Pytorch implementation for Discriminative Region-based Multi-Label Zero-Shot Learning SOTA results on NUS-WIDE and OpenImages

Discriminative Region-based Multi-Label Zero-Shot Learning (ICCV 2021) [arXiv][Project page >> coming soon] Sanath Narayan*, Akshita Gupta*, Salman Kh

Akshita Gupta 54 Nov 21, 2022
[ICCV 2021] Official Pytorch implementation for Discriminative Region-based Multi-Label Zero-Shot Learning SOTA results on NUS-WIDE and OpenImages

Discriminative Region-based Multi-Label Zero-Shot Learning (ICCV 2021) [arXiv][Project page >> coming soon] Sanath Narayan*, Akshita Gupta*, Salman Kh

Akshita Gupta 54 Nov 21, 2022
[ICCV 2021] Official PyTorch implementation for Deep Relational Metric Learning.

Deep Relational Metric Learning This repository is the official PyTorch implementation of Deep Relational Metric Learning. Framework Datasets CUB-200-

Borui Zhang 39 Dec 10, 2022
official Pytorch implementation of ICCV 2021 paper FuseFormer: Fusing Fine-Grained Information in Transformers for Video Inpainting.

FuseFormer: Fusing Fine-Grained Information in Transformers for Video Inpainting By Rui Liu, Hanming Deng, Yangyi Huang, Xiaoyu Shi, Lewei Lu, Wenxiu

null 77 Dec 27, 2022
Official pytorch implementation of "Scaling-up Disentanglement for Image Translation", ICCV 2021.

Official pytorch implementation of "Scaling-up Disentanglement for Image Translation", ICCV 2021.

Aviv Gabbay 41 Nov 29, 2022
Official PyTorch Implementation of paper "Deep 3D Mask Volume for View Synthesis of Dynamic Scenes", ICCV 2021.

Deep 3D Mask Volume for View Synthesis of Dynamic Scenes Official PyTorch Implementation of paper "Deep 3D Mask Volume for View Synthesis of Dynamic S

Ken Lin 17 Oct 12, 2022
This is the official pytorch implementation for our ICCV 2021 paper "TRAR: Routing the Attention Spans in Transformers for Visual Question Answering" on VQA Task

?? ERASOR (RA-L'21 with ICRA Option) Official page of "ERASOR: Egocentric Ratio of Pseudo Occupancy-based Dynamic Object Removal for Static 3D Point C

Hyungtae Lim 225 Dec 29, 2022
Official PyTorch implementation of N-ImageNet: Towards Robust, Fine-Grained Object Recognition with Event Cameras (ICCV 2021)

N-ImageNet: Towards Robust, Fine-Grained Object Recognition with Event Cameras Official PyTorch implementation of N-ImageNet: Towards Robust, Fine-Gra

null 32 Dec 26, 2022
Official Pytorch implementation of the paper "Action-Conditioned 3D Human Motion Synthesis with Transformer VAE", ICCV 2021

ACTOR Official Pytorch implementation of the paper "Action-Conditioned 3D Human Motion Synthesis with Transformer VAE", ICCV 2021. Please visit our we

Mathis Petrovich 248 Dec 23, 2022