Giter VIP home page Giter VIP logo

causalhtp's Introduction

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}
}

causalhtp's People

Contributors

chengy12 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.