Adversarial Examples Can Be Effective Data Augmentation for Unsupervised Machine Learning

Chia-Yi Hsu, Pin-Yu Chen, Songtao Lu, Sijia Liu, Chia-Mu Yu

Abstract

This paper introduces a framework for generating Unsupervised Adversarial Examples (UAEs) by leveraging mutual information as a similarity metric. Unlike supervised adversarial examples that aim to flip labels, UAEs identify dissimilar inputs that yield low model loss. We demonstrate that these examples serve as a potent data augmentation tool, significantly enhancing performance in data reconstruction, representation learning, and contrastive learning tasks.

Introduction

Adversarial examples have traditionally been studied within the context of supervised learning, where the goal is to find a small perturbation that changes a model's classification. However, unsupervised models—such as autoencoders and contrastive learners—lack explicit labels, making the definition of "adversarial" less clear. This creates a significant gap in our ability to evaluate the robustness of these models or to use adversarial training to improve them.

Comparison of supervised and unsupervised adversarial tasks.

The authors redefine adversarial examples for the unsupervised domain. While a supervised adversarial example ($x_{adv}$) is similar to the original input $x$ but produces a different prediction, a UAE is defined as an input that is dissimilar to $x$ yet maintains a low loss ($\ell^{unsup}$). This approach targets "on-manifold" samples that the model is overconfident about but has not yet accurately represented, effectively exposing generalization errors.

Methodology

The core innovation lies in how the authors measure similarity without labels and how they optimize the attack process.

Per-Sample Mutual Information Neural Estimation (MINE)

To measure similarity without labels, the authors utilize Mutual Information (MI). Standard MINE requires batch processing, which is unsuitable for generating per-sample attacks. The authors propose "per-sample MINE," which creates an auxiliary distribution using either random Gaussian sampling or feature maps from the model's initial convolutional layers. This allows MI to serve as a robust, information-theoretic similarity constraint, producing adversarial examples with superior visual quality and diversity compared to traditional $L_p$ norm-based attacks.

The MinMax Optimization Algorithm

Instead of standard penalty-based approaches that require tedious binary searches for fixed coefficients, the authors developed a unified MinMax optimization algorithm. This algorithm dynamically adjusts the trade-off between making the sample dissimilar (minimizing MI) and keeping the model loss low. This method is more computationally efficient and continues to improve the MI value throughout the attack process, whereas penalty-based methods tend to saturate early.

Results and Discussion

The generated UAEs are used as a "plug-in" data augmentation strategy. By training on these challenging samples, models are forced to learn more robust and generalized features.

Visual comparison of PGD and MinMax attacks on MNIST digits at various intensities.

As shown in the visual comparison, the MinMax attack produces samples that are more diverse and visually distinct from the original data compared to standard Projected Gradient Descent (PGD) attacks. These UAEs effectively fill gaps in the model's understanding of the data manifold.

Key Performance Gains

  • Data Reconstruction: Autoencoders retrained with UAEs showed a 73.5% improvement in reconstruction error on the SVHN dataset and 56.7% on MNIST.
  • Contrastive Learning: Integrating UAEs into the SimCLR framework for CIFAR-10 resulted in a 7.8% reduction in loss and a 1.58% increase in top-1 accuracy, significantly outperforming existing adversarial contrastive learning methods like CLAE by a factor of 30x in terms of accuracy gain.
  • Feature Selection: Downstream classification accuracy improved in 5 out of 6 representation learning benchmarks, including speech (Isolet) and sensor data (Activity).

Conclusion

This work demonstrates that adversarial examples are not merely security threats but can be repurposed as high-quality data augmentations for unsupervised learning. By using Mutual Information to define similarity, the proposed framework generates "on-manifold" examples that expose and correct model generalization errors. While computational overhead remains a factor for large-scale deployments, the efficiency of the MinMax algorithm makes this a viable path for improving the robustness of unsupervised systems.

Summary updated

BibTeX
@inproceedings{hsu2022adversarial,
  author = {Chia-Yi Hsu and Pin-Yu Chen and Songtao Lu and Sijia Liu and Chia-Mu Yu},
  title = {{Adversarial Examples Can Be Effective Data Augmentation for Unsupervised Machine Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.1609/aaai.v36i6.20650},
}
Figure