Data Augmentation with Variational Autoencoder for Imbalanced Dataset

Samuel Stocksieker, Denys Pommeret, Arthur CharpentierarXiv 2024

This paper introduces DAVID (Data Augmentation with Variational Autoencoder for Imbalanced Dataset), a novel framework for tackling the "Imbalanced Regression" (IR) problem. By combining a rebalanced $\beta$-VAE loss function with a smoothed bootstrap approach in the latent space, the authors provide a robust way to generate synthetic data for rare, continuous target values, significantly improving predictive performance on tabular datasets.

TL;DR

Standard machine learning models often fail to predict rare or extreme values in continuous datasets because they are designed to minimize average error. This paper proposes DAVID, a method that uses a Variational Autoencoder (VAE) to map data into a smooth latent space and then applies a "smoothed bootstrap" to generate high-quality synthetic samples for these rare cases, outperforming existing state-of-the-art techniques.

What Problem Does This Paper Address?

Most research on imbalanced data focuses on classification (e.g., detecting a rare disease). However, many real-world problems in finance, economics, and engineering involve regression, where the target variable is continuous and its distribution is skewed.

Imbalanced Regression (IR) is significantly harder than classification for several reasons:

  1. No clear boundaries: There are no discrete "minority classes"; rare values exist on a continuum.
  2. Identification: It is difficult to define what constitutes a "rare" value when the distribution is continuous.
  3. Synthetic Generation: Generating new data requires creating both new feature sets and corresponding new target values that maintain complex, non-linear correlations.

Standard approaches like Mean Squared Error (MSE) naturally favor frequent values, leading models to "ignore" the rare but often highly relevant extreme values.

Methods

The authors propose a two-stage approach called DAVID:

  1. A Balanced $\beta$-VAE for Regression: The authors adapt the Variational Autoencoder (VAE) to handle regression by including the target variable $Y$ in the encoding process. Crucially, they introduce a balanced loss function. During training, observations are weighted by the inverse of their empirical density ($1/\hat{f}_Y(y)^\alpha$). This forces the VAE to pay more attention to reconstructing rare values accurately. They use a $\beta$-VAE framework, where $\beta < 1$ is used to ensure the latent space remains regular and continuous without over-penalizing reconstruction.

  2. Smoothed Bootstrap (SB) in Latent Space: Standard VAEs generate new data by sampling from a simple Gaussian distribution. However, for rare points, the VAE's estimated variance ($\sigma$) can be unreliable. Instead, DAVID uses a smoothed bootstrap on the latent means ($\mu$).

    As shown in the algorithm flow below, the process involves drawing a "seed" (a rare observation), finding its representation in the latent space, and then generating new points based on the neighborhood of that representation. This non-parametric approach is more robust than relying on the VAE’s internal variance estimates for rare data.

Figure 1: DAVID Algorithm: Data Generation

Datasets

The authors evaluated DAVID on both simulated and real-world benchmarks:

  • Simulated Dataset: A dataset of 3,000 samples with 6 numerical features and 1 target variable, specifically designed with non-linear relationships and 3 Gaussian latent variables.
  • Real-World Benchmarks: Four datasets commonly used in IR research:
  • bank8FM: 4,498 observations, 9 variables.
  • abalone: 4,177 observations, 9 variables.
  • boston: 506 observations, 14 variables.
  • NO2: 4,498 observations, 9 variables.

Key Insights and Ideas

  • Latent Space Regularity is Key: The authors found that a standard Autoencoder (AE) isn't enough. The probabilistic nature of the VAE ensures a "regular" latent space (continuous and complete), which is a prerequisite for the smoothed bootstrap to work effectively.
  • Neighborhoods Matter More than Points: For rare values, the model's individual uncertainty estimates are often noisy. By using a smoothed bootstrap—essentially looking at the "neighborhood" of a rare point in the latent space—the generator produces more realistic and useful synthetic samples.
  • Generalist Generators Fail at IR: The study compared DAVID against popular general-purpose synthetic data generators like CTGAN and TVAE. These models, while powerful for general data replication, performed poorly on IR tasks because they aren't designed to prioritize the "tails" of the distribution.

Key Results

In nearly every test, DAVID (labeled as kBVAEw in the tables) outperformed the baseline and existing IR methods like SMOGN or SMOTE for regression.

  • Simulation Results: On the simulated dataset, DAVID achieved a Mean Squared Error (MSE) of 202, compared to the baseline of 222 and other VAE variants which hovered around 214-218.
  • Real-World Performance: As seen in the table below, DAVID consistently achieved the lowest weighted MSE (wMSE) across all four benchmark datasets, proving its versatility.
Experimental results on real datasets

Limitations and Future Work

  • Tabular Data Efficiency: While VAEs are powerful, the authors acknowledge that neural networks are sometimes less efficient than tree-based models on structured tabular data. They favor a "preprocessing" approach (generating data first, then using any model) to mitigate this.
  • Qualitative Features: The current framework is primarily tested on numerical data. Handling mixed data (categorical and numerical) with complex correlations remains a challenging frontier.
  • Image-based IR: The authors suggest that applying this "neighborhood-based" latent generation to Deep Imbalanced Regression (e.g., estimating age from images) is a promising next step.

Summary updated

BibTeX
@misc{stocksieker2024data,
  author = {Samuel Stocksieker and Denys Pommeret and Arthur Charpentier},
  title = {{Data Augmentation with Variational Autoencoder for Imbalanced Dataset}},
  year = {2024},
  eprint = {2412.07039},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.07039},
}
Figure