CTAB-GAN: Effective Table Data Synthesizing

Zilong Zhao, Aditya Kunar, Robert Birke, Lydia Y. Chen

Abstract

While data sharing is crucial for knowledge development, privacy concerns and strict regulation (e.g., European General Data Protection Regulation (GDPR)) unfortunately limit its full effectiveness. Synthetic tabular data emerges as an alternative to enable data sharing while fulfilling regulatory and privacy constraints. The state-of-the-art tabular data synthesizers draw methodologies from Generative Adversarial Networks (GAN) and address two main data types in industry, i.e., continuous and categorical. In this paper, we develop CTAB-GAN, a novel conditional table GAN architecture that can effectively model diverse data types, including a mix of continuous and categorical variables. Moreover, we address data imbalance and long tail issues, i.e., certain variables have drastic frequency differences across large values. To achieve those aims, we first introduce the information loss, classification loss and generator loss to the conditional GAN. Secondly, we design a novel conditional vector, which efficiently encodes the mixed data type and skewed distribution of data variable. We extensively evaluate CTAB-GAN with the state of the art GANs that generate synthetic tables, in terms of data similarity and analysis utility. The results on five datasets show that the synthetic data of CTAB-GAN remarkably resembles the real data for all three types of variables and results into higher accuracy for five machine learning algorithms, by up to 17%.

Introduction: The "Messy" Tabular Data Problem

While Generative Adversarial Networks (GANs) have revolutionized image synthesis, tabular data remains a significant challenge. Real-world tables are often "messy," featuring complex structures that standard GANs struggle to replicate. These include:

  1. Mixed-type variables: Columns like mortgage amounts might be exactly 0 (categorical: no mortgage) or any positive value (continuous). Standard models often generate nonsensical negative values or near-zero noise in these cases.
  2. Long-tail distributions: In financial data, most transactions are small, but rare massive outliers are critical to capture.
  3. Skewed multi-mode distributions: Data like "hours worked per week" often has massive spikes at specific values (e.g., 40 hours) with smaller clusters elsewhere.
  4. Imbalanced classes: Rare events, such as credit card fraud, are often the most important to synthesize but the hardest for a GAN to learn without suffering from mode collapse.

Methodology: Architecture and Encoding

CTAB-GAN (Conditional Table GAN) introduces several innovations to address these complexities. At its core is a Mixed-type Encoder that treats mixed variables as a concatenation of a continuous value and a categorical mode. By using a Variational Gaussian Mixture (VGM), the model can represent an "exact zero" as a distinct category while still modeling the distribution of positive values.

The CTAB-GAN architecture featuring the conditional vector, generator, discriminator, and auxiliary classifier.

The model utilizes a Triple Loss Strategy to ensure high-quality synthesis:

  • Information Loss: Matches the mean and standard deviation of synthetic data to real data.
  • Classification Loss: An auxiliary classifier ensures synthetic records make semantic sense (e.g., preventing gender-specific medical contradictions).
  • Generator Loss: Ensures the generator produces the specific class requested by the conditional vector.

To handle long tails and imbalance, CTAB-GAN applies log-transform pre-processing and uses a conditional vector with log-frequency sampling. This ensures that rare classes are seen frequently enough during training to be learned effectively without ignoring common classes.

Evaluation and Results

The model was evaluated on five diverse benchmarks: Adult, Covertype, Credit, Intrusion, and Loan. CTAB-GAN consistently outperformed competitors like CTGAN, TableGAN, and MedGAN in both statistical similarity and machine learning (ML) utility.

Comparison of real vs. synthetic data distributions across Mortgage, Amount, and Hours-per-week variables.

Key results include:

  • ML Utility: On the Intrusion dataset, CTAB-GAN improved classification accuracy by 17% over the next best model. It consistently showed the smallest gap between models trained on real vs. synthetic data.
  • Statistical Fidelity: Using Wasserstein Distance and Jensen-Shannon Divergence, the authors demonstrated that CTAB-GAN's distributions are significantly closer to ground truth, particularly for long-tail financial data.
  • Privacy: Despite its high accuracy, the model maintains robust distance-based privacy, suggesting it generalizes patterns rather than simply memorizing training records.

Conclusion

CTAB-GAN effectively addresses the "messy" nature of real-world tabular data. By combining specialized encoding for mixed types with a multi-component loss function and CNN-based architecture, it sets a new state-of-the-art for synthetic data generation. Future work may focus on optimizing training speed, as the current architecture is computationally more intensive than simpler predecessors.

Summary updated

BibTeX
@inproceedings{zhao2021ctab,
  author = {Zilong Zhao and Aditya Kunar and Robert Birke and Lydia Y. Chen},
  title = {{CTAB-GAN: Effective Table Data Synthesizing}},
  booktitle = {ACML},
  year = {2021},
  url = {https://openreview.net/forum?id=pU82Alr00t},
}
Figure