My implementation of TimeGAN using PyTorch.
I applied it to generate synthetic ECGs, and evaluated the signals obtained with data utility and privacy preservation metrics.
TimeGAN is a model proposed by Jinsung Yoon et al. in a paper called Time-series Generative Adversarial Networks.
Time series data is challenging for classical GANs due to the potentially complex temporal correlations of variables: the model must capture the distributions of features within each time point, but also the stepwise conditional distributions across time. TimeGAN provides a framework that combines the conventional unsupervised GAN training method with a supervised learning approach, in order to generate time series with preserved temporal dynamics.
The original paper open-sources a TensorFlow implementation, which I used as reference.
I used TimeGAN for a practical application: generating synthetic ECG signals, and evaluating them.
ECG data was taken from the MIT-BIH Arrythmia Database.
Here are the evaluation metrics used:
- Data utility
- Inception score
- Distance between samples
- PCA and t-SNE visualization
- Discriminative score
- Cross-classification
- Privacy-preservation
- Identifiability
- Membership Inference Attack
Here are some real signals, and synthetic signals created by TimeGAN.
.png)
.png)