TCGAN: Convolutional Generative Adversarial Network for Time Series Classification and Clustering

Fanling Huang, Yangdong Deng

Introduction

Deep learning has significantly advanced the field of time series classification, yet its success is often tethered to the availability of massive, high-quality labeled datasets. In critical domains such as medicine and industrial IoT, obtaining these labels is frequently prohibitively expensive or physically impossible. While Generative Adversarial Networks (GANs) have successfully addressed similar data scarcity issues in computer vision through unsupervised representation learning, their application to time series has been hampered by a reliance on Recurrent Neural Networks (RNNs).

RNN-based GANs, while intuitive for sequential data, suffer from slow training speeds, poor parallelization, and difficulties in capturing long-term dependencies due to vanishing gradients. TCGAN (Time-series Convolutional GAN) addresses these limitations by utilizing a purely convolutional architecture designed for speed, stability, and high-quality feature extraction.

Methodology

The TCGAN Architecture

TCGAN departs from the traditional recurrent paradigm by employing one-dimensional Convolutional Neural Networks (1D-CNNs) for both the generator and the discriminator.

  • Generator: Uses "fractionally-strided" convolutions to up-sample latent noise into realistic, synthetic time series data.
  • Discriminator: Employs standard 1D convolutions to distinguish between real samples and synthetic ones.

By stacking convolutional layers, the model can observe the entire time series simultaneously, allowing it to capture both local patterns and global temporal dependencies more efficiently than sequential models.

Adaptive Training and Feature Extraction

To ensure stable training, TCGAN introduces an adaptive strategy. To prevent the discriminator from overpowering the generator—a common failure mode in GAN training—the discriminator is only updated if its classification accuracy in the previous batch falls below a specific threshold (0.75).

Once the unsupervised training phase is complete, the generator is discarded. The first four convolutional layers of the discriminator are frozen and repurposed as a fixed feature encoder. This encoder transforms raw, high-dimensional time series data into a compact 64-dimensional feature vector. These vectors are then utilized for downstream tasks using simple, linear models such as Support Vector Machines (SVM) for classification or k-means for clustering.

Experimental Evaluation

The researchers evaluated TCGAN using a rigorous benchmarking suite:

  1. The UCR Archive: A comprehensive collection of 85 datasets spanning ECG readings, sensor data, and image outlines.
  2. Synthetic "Sines" Data: Univariate and multivariate sinusoidal waves used to test the model's ability to capture complex temporal correlations.

Key Insights and Results

Efficiency and Speed

One of the most significant advantages of the convolutional approach is computational efficiency. TCGAN demonstrated training and inference speeds 10x to 70x faster than leading RNN-based alternatives like TimeGAN and CotGAN.

Classification and Clustering Performance

In head-to-head classification tests across 19 UCR datasets, TCGAN outperformed other GAN-based methods on 15 of them. Furthermore, the features learned by the TCGAN discriminator proved to be highly discriminative; simple linear models trained on these features often outperformed complex, end-to-end supervised deep learning models.

For unsupervised clustering, TCGAN features yielded significantly higher Normalized Mutual Information (NMI) scores compared to traditional time-series clustering methods like k-shape or Dynamic Time Warping (DTW) approaches.

Robustness to Data Scarcity

TCGAN excels in scenarios where labeled data is limited. When only 10% of the training data was labeled, TCGAN-based classifiers maintained high accuracy and stability. In contrast, standard supervised CNNs (such as the Fully Convolutional Network, or FCN) experienced a total collapse in performance under the same constraints. This suggests that the unsupervised pre-training phase provides a superior initialization point, effectively regularizing the model for small-data regimes.

Conclusion and Future Work

TCGAN demonstrates that convolutional architectures are not only faster but also more effective than recurrent models for learning unsupervised representations of time series. By transforming raw data into robust feature vectors, TCGAN enables high-performance classification and clustering even when labels are scarce.

While the current architecture performs well across a wide variety of datasets, future research may explore the integration of attention mechanisms or the application of TCGAN to anomaly detection in large-scale IoT environments. TCGAN represents a significant step toward making deep learning for time series more practical and accessible in data-constrained industries.

Summary updated

BibTeX
@article{huang2023tcgan,
  author = {Fanling Huang and Yangdong Deng},
  title = {{TCGAN: Convolutional Generative Adversarial Network for Time Series Classification and Clustering}},
  journal = {Neural Networks},
  year = {2023},
  doi = {10.1016/j.neunet.2023.06.033},
}
Figure