Skip to content
← Blog

Class-Dependent Data Augmentation · Part 2 of 2

Can You Predict Which Classes Data Augmentation Will Hurt, Before Training? A Proposal

Solomon Owusu-Ansah · · 5 min read · Also on dev.to

The same augmentation can help one class and hurt another. The last post showed this on bridge-damage detection (dacl10k): contrast augmentation improved Crack and Hollowareas and degraded Rust, Efflorescence, Graffiti, Weathering, Restformwork and ExposedRebars, consistently across all three seeds.

The practical question is which classes an augmentation will hurt, and whether you can know that before spending the training budget to find out. The mechanism behind the harm is already published. The open question is whether the harmed classes can be predicted from the data alone, without training anything.

This post is a proposal. There are no results yet, and the pass and fail criteria below are fixed before anything runs.

Augmentation isn't class-neutral

Balestriero, Bottou and LeCun (2022) documented the effect early. Train a ResNet-50 on ImageNet with random-crop augmentation and one class, "barn spider", drops from 68% to 46% accuracy. Same augmentation, same model, same training run: one class loses more than twenty points while average accuracy goes up.

Kirichenko et al. (NeurIPS 2023) measured it systematically. The left panel of their Figure 1 plots accuracy against Random Resized Crop strength. The overall average rises while the average of the 50 most-affected classes falls, so the damage is concentrated in a few classes rather than spread evenly.

Figure 1 from Kirichenko et al., "Understanding the Detrimental Class-level Effects of Data Augmentation" (NeurIPS 2023). Left: ResNet-50 accuracy on ImageNet against Random Resized Crop strength — average of all classes, average of the 950 unaffected classes, and average of the 50 most-affected classes. Middle: categories of class confusions exacerbated by strong augmentation. Right: heavily cropped car samples resembling wheel images, and the share of wheel test images classified as car rising with augmentation strength.
Figure 1 from Kirichenko et al., "Understanding the Detrimental Class-level Effects of Data Augmentation" (NeurIPS 2023).

The mechanism: one class invades another

Kirichenko et al. also identified why it happens. Augmentation makes the distributions of different classes overlap. Their example: crop a "car" image hard enough and it looks like a typical "wheel" image. The model sees so many cropped cars in training that it learns to say "car" on wheel images, and wheel accuracy drops.

Infographic: a clean wheel cloud and a clean car cloud in feature space; heavily cropped car samples land inside wheel territory, so the model predicts car on wheel images and wheel accuracy falls

The direction matters. The harmed class is the one being invaded, the class whose territory the augmented samples wander into. The donor class, whose augmented samples do the invading, is fine. That's why the obvious fix fails: turning augmentation down on the harmed classes doesn't help. You have to turn it down on the donors.

Kirichenko et al. showed this with a donor-class policy: reduce augmentation strength on the classes whose false positives grew most as augmentation got stronger. Treating the top 50 donors improved affected-class accuracy by 2.5% at a cost of 0.1% average accuracy.

The fix is expensive

The donor-class policy needs an oracle. To find the donors, you train models at every augmentation strength (10 seeds per strength, 88 epochs each) and measure the confusions in the trained models. That's about 5,000 GPU hours just to decide which classes to treat, which rules it out for most people.

Other approaches have the same shape. CLAM (Jiang, Weng & Ban, 2025) reweights classes during training based on measured per-class performance. Every existing approach diagnoses the harm after or during training. None predicts it before training starts.

The idea: measure the overlap first

The mechanism is about the data: augmented samples from one class landing in another class's territory. If that overlap is a property of the data and the augmentation, and not something training creates, it should be measurable without training at all.

Here's the plan:

  1. Take a frozen ResNet-50 pre-trained on ImageNet. Nothing gets trained on the task.
  2. Pass clean samples and randomly cropped samples through it, and build a feature cloud for each class in both versions.
  3. For each class, measure how much other classes' augmented clouds overlap its clean cloud. Classes whose clean cloud gets invaded are the predicted victims. Reading the same score the other way gives the predicted donor ranking.
  4. Compare the predicted ranking against Kirichenko et al.'s published per-class accuracy drops: their 50 most-affected classes and their false-positive ranking.
Infographic: two routes to finding the hurt classes — the oracle route trains ResNet-50 at every augmentation strength for about 5,000 GPU hours, while the proposed route pushes samples through a frozen ResNet-50 and scores feature-cloud overlap with zero training

Pass and fail criteria, fixed in advance

  • It works if the predicted harm ranking reaches a Spearman correlation of 0.5 or more with the paper's measured per-class drops, with good precision@50 against their 50 most-affected classes.
  • It fails below 0.3. That would mean frozen features don't capture what the trained model learns, and the overlap can't be measured before training.
  • It has to beat three cheap baselines: overlap of the clean clouds alone (plain class similarity), a WordNet-distance proxy for ambiguous classes, and a random ranking. If augmented overlap adds nothing over clean overlap, the claim isn't about augmentation at all. It just says similar classes get confused, which the paper already establishes.

The baselines are the core of the design. The claim is that the augmentation-induced part of the overlap predicts the harm, not class similarity in general. If the score only picks up the ambiguous, multi-label classes and misses the fine-grained confusions, it adds nothing where the mechanism matters.

Limits

The main risk is built into the design: frozen features may not reflect what a trained model learns. Training reshapes the feature space, so the overlap a frozen extractor sees might correlate only weakly with the overlap the trained model acts on.

A weak correlation would still be worth reporting. It would show that this overlap is something training creates, not a property of the data you can measure in advance. Either way the question gets answered, and the test is cheap: feature extraction on a frozen checkpoint, a few GPU hours at most.

The same test should carry over to object detection, where the class-dependence pattern also shows up (that's the dacl10k contrast result above). On detection data you'd use per-object crops instead of whole images.


Has augmentation ever improved an average metric while quietly hurting one class for you? How did you find it, and did you keep the augmentation anyway?