Abstract
Signal measurements appearing in the form of time series are one of the most common types of data used in medical machine learning applications. However, such datasets are often small, making the training of deep neural network architectures ineffective. For time-series, the suite of data augmentation tricks we can use to expand the size of the dataset is limited by the need to maintain the basic properties of the signal. Data generated by a Generative Adversarial Network (GAN) can be utilized as another data augmentation tool. RNN-based GANs suffer from the fact that they cannot effectively model long sequences of data points with irregular temporal relations. To tackle these problems, we introduce TTS-GAN, a transformer-based GAN which can successfully generate realistic synthetic time-series data sequences of arbitrary length, similar to the real ones. Both the generator and discriminator networks of the GAN model are built using a pure transformer encoder architecture. We use visualizations and dimensionality reduction techniques to demonstrate the similarity of real and generated time-series data. We also compare the quality of our generated data with the best existing alternative, which is an RNN-based time-series GAN.
TTS-GAN source code: github.com/imics-lab/tts-gan
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Goodfellow, I., et al.: Generative adversarial nets. In: Advances in Neural Information Processing Systems, vol. 27 (2014)
Ledig, C., et al.: Photo-realistic single image super-resolution using a generative adversarial network. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4681–4690 (2017)
Bousmalis, K., Silberman, N., Dohan, D., Erhan, D., Krishnan, D.: Unsupervised pixel-level domain adaptation with generative adversarial networks. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3722–3731 (2017)
Zhang, H., et al.: StackGAN: text to photo-realistic image synthesis with stacked generative adversarial networks. In: Proceedings of the IEEE International Conference on Computer Vision, pp. 5907–5915 (2017)
Brophy, E., Wang, Z., She, Q., Ward, T.: Generative adversarial networks in time series: a survey and taxonomy. arXiv preprint arXiv:2107.11098 (2021)
Vaswani, A., et al.: Attention is all you need. In: Advances in Neural Information Processing Systems, pp. 5998–6008 (2017)
Dosovitskiy, A., et al.: An image is worth \(16 \times 16\) words: transformers for image recognition at scale. arXiv preprint arXiv:2010.11929 (2020)
Devlin, J., Chang, M.-W., Lee, K., Toutanova, K.: BERT: pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805 (2018)
Lu, K., Grover, A., Abbeel, P., Mordatch, I.: Pretrained transformers as universal computation engines. arXiv preprint arXiv:2103.05247 (2021)
Jiang, Y., Chang, S., Wang, Z.: TransGAN: two pure transformers can make one strong GAN, and that can scale up. In: Thirty-Fifth Conference on Neural Information Processing Systems (2021)
Diao, S., Shen, X., Shum, K., Song, Y., Zhang, T.: TILGAN: transformer-based implicit latent GAN for diverse and coherent text generation. In: Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pp. 4844–4858 (2021)
Esteban, C., Hyland, S.L., Rätsch, G.: Real-valued (medical) time series generation with recurrent conditional GANs. arXiv preprint arXiv:1706.02633 (2017)
Yoon, J., Jarrett, D., Van der Schaar, M.: Time-series generative adversarial networks (2019)
Ni, H., Szpruch, L., Wiese, M., Liao, S., Xiao, B.: Conditional Sig-Wasserstein GANs for time series generation. arXiv preprint arXiv:2006.05421 (2020)
Wold, S., Esbensen, K., Geladi, P.: Principal component analysis. Chemom. Intell. Lab. Syst. 2(1–3), 37–52 (1987)
Van der Maaten, L., Hinton, G.: Visualizing data using t-SNE. J. Mach. Learn. Res. 9(11) (2008)
Ratliff, L.J., Burden, S.A., Sastry, S.S.: Characterization and computation of local NASH equilibria in continuous games. In: 2013 51st Annual Allerton Conference on Communication, Control, and Computing (Allerton), pp. 917–924. IEEE (2013)
Goodfellow, I., et al.: Generative adversarial networks. Commun. ACM 63(11), 139–144 (2020)
Huang, R., Zhang, S., Li, T., He, R.: Beyond face rotation: global and local perception GAN for photorealistic and identity preserving frontal view synthesis. In: Proceedings of the IEEE International Conference on Computer Vision, pp. 2439–2448 (2017)
Micucci, D., Mobilio, M., Napoletano, P.: UniMiB shar: a dataset for human activity recognition using acceleration data from smartphones. Appl. Sci. 7(10), 1101 (2017)
Bousseljot, R., Kreiseler, D., Schnabel, A.: Nutzung der EKG-Signaldatenbank CARDIODAT der PTB über das internet (1995)
Goldberger, A.L., et al.: PhysioBank, PhysioToolkit, and PhysioNet: components of a new research resource for complex physiologic signals. Circulation 101(23), e215–e220 (2000)
Mao, X., Li, Q., Xie, H., Lau, R.Y., Wang, Z., Paul Smolley, S.: Least squares generative adversarial networks. In: Proceedings of the IEEE International Conference on Computer Vision, pp. 2794–2802 (2017)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Appendices
A Appendix 1: Training Details
We conduct all experiments on an Intel server with a 3.40 GHz CPU, 377 GB RAM memory and 2 Nvidia 1080 GPUs. For all datasets, the synthetic data are generated by a generator that takes random vectors of size (100, 1) as inputs. The transformer blocks in the generator and discriminator are both repeated three times. We adopt a learning rate of \(1e-4\) for the generator and \(3e-4\) for the discriminator. We follow the setting of LSGAN [23] and use loss function described in Sect. 3.3 to update model parameters. An Adam optimizer with \(\beta _1 = 0.9\) and \(\beta _2 = 0.999\), and a batch size of 32 for both generator and discriminator, are used for all experiments.
B Appendix 2: Similarity Scores
Feature Extraction. We extract several meaningful features from each input data sequence. They are the median, mean, standard deviation, variance, root mean square, maximum, and minimum values of each input sequence. Suppose we compute m features from all channels of each sequence and get a feature vector with the format \(f = {<}feature_1, feature_2, ..., feature_m{>}\).
Average Cosine Similarity. For each pair of real signal feature vector \(f_a\) and synthetic signal feature vector \(f_b\), the vector has the size m, we can compute its cosine similarity as:
The average cosine similarity score is the average of each cosine similarity between pairs of feature vectors corresponding to real and synthetic signals of the same class. The average cosine similarity is computed as follows, where n the total number of signals:
Average Jensen-Shannon Distance. The average jensen-shannon distance is the average of jensen-shannon distance between each feature from real signals and synthetic signals. For each pair of real signal feature \(f_{i\_real}\) and synthetic signal feature \(f_{i\_syn}\), we can compute its jensen-shannon distance as:
where m is the pointwise mean of \(f_{i\_real}\) and \(f_{i\_syn}\) and D is the Kullback-Leibler divergence. The average jensens-shannon distance is computed as:
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Li, X., Metsis, V., Wang, H., Ngu, A.H.H. (2022). TTS-GAN: A Transformer-Based Time-Series Generative Adversarial Network. In: Michalowski, M., Abidi, S.S.R., Abidi, S. (eds) Artificial Intelligence in Medicine. AIME 2022. Lecture Notes in Computer Science(), vol 13263. Springer, Cham. https://doi.org/10.1007/978-3-031-09342-5_13
Download citation
DOI: https://doi.org/10.1007/978-3-031-09342-5_13
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-09341-8
Online ISBN: 978-3-031-09342-5
eBook Packages: Computer ScienceComputer Science (R0)