Learning to Compose Domain-Specific Transformations for Data Augmentation

Alexander J. Ratner, Henry R. Ehrenberg, Zeshan Hussain, Jared Dunnmon, Christopher Ré

TL;DR

This paper introduces a method to automate the "black art" of data augmentation by learning how to compose and parameterize transformation functions. By using a generative adversarial framework combined with reinforcement learning, the authors train a model to produce realistic, label-preserving data sequences from unlabeled data. This approach significantly outperforms manual heuristic tuning across image, text, and medical domains.

The Problem: The Fragility of Manual Augmentation

Data augmentation is a cornerstone of modern deep learning, essential for preventing overfitting when labeled data is scarce. However, designing an effective augmentation strategy is notoriously difficult. Practitioners usually rely on "heuristic" augmentation—randomly applying a few hand-tuned transformations like flips or crops.

The authors identify two major gaps in this manual approach:

  1. Complexity of Composition: Real-world transformations are often non-commutative and highly sensitive to their order and parameters. Finding the "sweet spot" for these compositions is a time-consuming manual task.
  2. The Fragility of Invariance: Most methods assume every transformation must preserve the class label. In reality, aggressive transformations often turn a recognizable image into out-of-distribution "garbage." Forcing a model to learn from these broken images can actually degrade performance.

TANDA: Transformation Adversarial Networks for Data Augmentation

To address these limitations, the authors propose treating data augmentation as a sequence modeling problem using a system called TANDA.

Sequential image transformations
  • Transformation Functions (TFs): Users provide a library of "primitive" operations (e.g., rotate 5 degrees, adjust hue). These are treated as black boxes—they do not need to be differentiable or deterministic.
  • The Generative Adversarial Setup: A Generator learns to output sequences of these TFs, while a Null-Class Discriminator is trained to distinguish between original "clean" data and transformed data. The Generator's goal is to "fool" the discriminator by creating transformed data that still looks like it belongs to the original distribution.
  • Weakened Invariance Assumption: Instead of assuming transformations always perfectly preserve labels, the authors assume they simply will not map one class to another (e.g., a transformation might turn a "plane" into "garbage," but rarely into a "car"). This crucial relaxation allows the system to be trained entirely on unlabeled data.
  • Reinforcement Learning: Because the TFs are non-differentiable, the authors use REINFORCE-style policy gradients to update the generator based on the rewards provided by the discriminator.

Key Insights

  • Sequential Intelligence: The authors found that an LSTM-based generator, which considers the history of applied transformations, outperformed a "mean field" model that picks TFs independently. This proves that the order of operations fundamentally matters.
  • Learning from the Unlabeled: Because TANDA trains on unlabeled data, practitioners can use a massive pool of raw data to learn the "physics" of valid transformations before ever touching their precious labeled training set.
  • Self-Correction: The model is remarkably robust to "bad" user input. If a user provides a misspecified TF that destroys the image, the generator quickly learns to assign it a near-zero probability, effectively filtering out harmful augmentations.

Datasets and Results

The authors evaluated their approach on a diverse set of tasks, consistently beating standard heuristic methods:

  • Standard Vision (CIFAR-10): Achieved a 4.0 point accuracy boost over standard heuristics when training on a 10% subsample of the data.
  • Text (ACE): Improved the F1 score by 1.4 points on a relation extraction task, demonstrating that the framework works for discrete structures like language (using word-swapping augmentations).
  • Medical Imaging (DDSM): The authors collaborated with radiologists to create domain-specific "segmentation-based transplantation" TFs for mammography screening.
Domain-specific transformation in medical imaging

Using these specialized transformations, TANDA saw a 3.4 point accuracy improvement. Notably, the heuristic approach actually failed here because it couldn't handle the complexity of the specialized transformations, whereas TANDA learned to compose them effectively.

Limitations and Future Work

While powerful, the current iteration of TANDA has a few limitations:

  • Fixed Sequence Length: The number of transformations applied is currently a fixed hyperparameter determined by calibration. Future versions could learn to dynamically decide when to stop transforming a data point.
  • Data-Agnostic Policy: The generator currently learns a global policy for the entire dataset. A more advanced version could be conditioned on the specific input, applying different transformations to a "dark" image than it would to a "bright" one.
  • Computation Cost: Training a GAN via RL is computationally heavier than simple random cropping, though this is an offline pre-processing step that pays dividends during final model training.

Summary updated

BibTeX
@inproceedings{ratner2017learning,
  author = {Alexander J. Ratner and Henry R. Ehrenberg and Zeshan Hussain and Jared Dunnmon and Christopher Ré},
  title = {{Learning to Compose Domain-Specific Transformations for Data Augmentation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2017},
  url = {https://openreview.net/forum?id=r1VPoU-_ZB},
}
Figure