Skip to content

Eui-Jin/CGAN-DF

Repository files navigation

Imputing qualitative attributes for trip chains extracted from smart card data using a conditional generative adversarial network

This code implements the paper, Kim et al. (2022). Imputing Qualitative Attributes for Trip Chains Extracted from Smart Card Data Using a Conditional Generative Adversarial Network. Transportation Research Part C. https://doi.org/10.1016/j.trc.2022.103616.

Overview

This model aims to estimate the qualitative attributes of large-scale passively collected data (smart card data) using small-scale travel survey data, based on data fusion. The CGAN trains probability distribution of qualitative attributes given trip-chain attributes by mimicking the small-scale survey data..

Getting Started

Dependencies

  • Python 3.6.10
  • Tensorflow 2.4.1, Keras 2.4.3

Components

Dataset

  • 'Data' only contains pertubated and sampled smart card and travel survey data due to limited permission.
  • train/test_incomplete data indicate the smart card containing trip-chain attributes
  • train/test_complete data indicate the travel survey containing trip-chain and qualitative attributes
  • Other data is obtained from the DataPreprocessing.ipynb
DataPreprocessing.ipynb
  • DataPreprocessing transforms the trip-chain attributes into sequential ndarray to use for Tensorflow
  • Detailed descriptions are provided in the notebook files.
2D-Transformer.ipynb
  • Step-by-step implementation of CGAN for mobility data fusion is provided
  • Class for Transformer, 1D-Positional, and 2D-Locational encoding are defined
  • The code include all parts in the paper: Model structure (2D-Transformer), Model training (Conditional WGAN-GP), Evaluation (Fidelity and Diversity), and Visualization
  • Pretained model with full training data is provided in the 'Py_generator'
BERT_Embed.ipynb
  • BERT transforms categorical qualitative attributes into numeric one to use for calculating precision and recall
  • Pretained model is also provided ('MLM_Embed_indiv.h5')

Notice

  • Full paper will be provided after the peer-review process
  • Detail logic behind the code is described in the full paper

Authors

@Eui-Jin Kim

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

About

Kim et al. (2022)_TR-C

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published