Dealing with the Evil Twins: Improving Random Augmentation by Addressing Catastrophic Forgetting of Diverse Augmentations

Dongkyu Cho, Rumi ChunaraarXiv 2025 · DOI

Introduction

Data augmentation is a cornerstone of modern deep learning, essential for improving model robustness and out-of-distribution (OOD) generalization. In the context of single-source domain generalization (sDG), where a model is trained on one domain and tested on others, two primary strategies exist. Targeted Augmentation (TA) uses optimization techniques, such as adversarial training, to find "hard" examples that challenge the model. While effective, TA is computationally expensive. In contrast, Random Augmentation (RA) is computationally trivial but often yields suboptimal results despite providing high sample diversity. This paper investigates this performance gap and identifies a phenomenon called the "Evil Twin" effect, where highly diverse augmentations lead to conflicting gradients and catastrophic forgetting.

The "Evil Twin" Phenomenon

The authors argue that the high diversity of RA is a double-edged sword. Because RA is stochastic and spans a wide range of transformations, it frequently generates "colliding" augmentations of the same source image. These collisions result in gradients that point in opposite directions—a state the authors term "Gradient Collision."

Conceptual comparison of Targeted Augmentation (Gradient Alignment) versus Random Augmentation (Gradient Collision/Evil Twins).

In this scenario, the model learns a specific feature from one augmentation only to have that knowledge "erased" by its "Evil Twin" in a subsequent iteration. Using a first-order Taylor expansion, the authors demonstrate that as the entropy (diversity) of the augmentation distribution increases, the likelihood of negative cosine similarity between gradients also increases. This creates a form of catastrophic forgetting within a single training task, preventing the model from converging on robust, generalizable features.

Quantifying Conflict: Sign Discrepancy

To measure this effect empirically, the authors introduce Sign Discrepancy (SD). This metric quantifies how often the signs of weight updates differ between two different augmentations of the same data point. Their analysis shows a strong correlation between high SD and increased forgetting. By framing single-domain training as a continual learning (CL) problem, they demonstrate that the "noise" introduced by diverse RA acts similarly to task switching in traditional CL, leading to significant feature distortion and loss of previously acquired knowledge.

Selective Weight Merging

To mitigate the Evil Twin effect without the memory overhead of a traditional replay buffer, the authors propose a Selective Weight Merging strategy. This approach treats the training process as a sequence of snapshots and intervenes in the weight space to preserve knowledge.

Comparison between traditional memory-based methods and the proposed selective weight merging approach.

The method operates as follows:

  1. Snapshotting: Every $k$ iterations, a snapshot of the model weights ($\theta_s$) is saved.
  2. Parameter Selection: The top $p\%$ (experimentally determined to be approximately 80%) of parameters that have undergone the largest magnitude of change since the snapshot are identified.
  3. Merging: The current weights for these specific parameters are merged with the snapshot weights using simple averaging.

This selective merging acts as a "memory" mechanism, anchoring the model to previously learned features and preventing it from drifting too far due to the influence of conflicting "Evil Twin" gradients.

Experimental Results

The proposed method was evaluated on several standard sDG benchmarks, including PACS (Photo, Art, Cartoon, Sketch), Digits, Office-Home, VLCS, and Terra Incognita.

  • Performance Gains: On the PACS benchmark, average accuracy improved from 49.45% to 58.38%, outperforming several complex targeted augmentation methods like ADA and M-ADA. On the Digits dataset, accuracy rose from 71.84% to 78.03%.
  • Feature Consistency: Using Centered Kernel Alignment (CKA) visualizations, the authors confirmed that their method maintains much higher feature similarity across layers compared to vanilla training, indicating that it successfully mitigates feature distortion.
  • Efficiency: Unlike targeted methods that require multiple forward and backward passes to optimize each augmentation, the weight-merging step adds negligible computational overhead to the standard training pipeline.

Conclusion

By identifying the "Evil Twin" effect, this work provides a new perspective on why random augmentation often underperforms. The proposed selective weight-merging strategy offers a simple yet powerful solution that bridges the gap between random and targeted augmentation. It enables models to leverage the diversity of random samples while protecting against the catastrophic forgetting caused by conflicting gradients, ultimately leading to superior generalization with minimal computational cost.

Summary updated

Abstract

Data augmentation is a promising tool for enhancing out-of-distribution generalization, where the key is to produce diverse, challenging variations of the source domain via costly targeted augmentations that maximize its generalization effect. Conversely, random augmentation is inexpensive but is deemed suboptimal due to its limited effect. In this paper, we revisit random augmentation and explore methods to address its shortcomings. We show that the stochastic nature of random augmentation can produce a set of colliding augmentations that distorts the learned features, similar to catastrophic forgetting. We propose a simple solution that improves the generalization effect of random augmentation by addressing forgetting, which displays strong generalization performance across various single source domain generalization (sDG) benchmarks.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
PACSSelective model merging (Ours; top-80% setting)Average target-domain accuracy58.38+8.93 vs baselinedomain-generalization · merging=selective top-80% · source-domain=Photo · target-domains=Art, Cartoon, Sketch
Source quote
L264: Ours │ 56.95 │ 47.99 │ 70.20 │ 58.38 │ 63.93 │ 77.79 │ 80.54 │ 93.42 │ 78.92
DigitsSelective model merging (Ours; top-80% setting)Average target-domain accuracy78.92+7.08 vs baselinedomain-generalization · merging=selective top-80% · training-data=first 10,000 MNIST samples · target-domains=four other digit domains
Source quote
L264: Ours │ 56.95 │ 47.99 │ 70.20 │ 58.38 │ 63.93 │ 77.79 │ 80.54 │ 93.42 │ 78.92
Office-HomeSelective model merging (Ours*; top-80% setting)Average target-domain accuracy59.46domain-generalization · merging=selective top-80% · source-domain=Real-world · target-domains=Art, Clipart, Product
Source quote
L289: Ours^\ast │ 55.94 │ 53.10 │ 69.33 │ 59.46 │ 65.82 │ 98.01 │ 70.69 │ 78.17 │ 37.45 │ 15.29 │ 25.63 │ 26.12
VLCSSelective model merging (Ours*; top-80% setting)Average target-domain accuracy78.17domain-generalization · merging=selective top-80% · source-domain=PASCAL-VOC · target-domains=LabelMe, Caltech-101, SUN09
Source quote
L289: Ours^\ast │ 55.94 │ 53.10 │ 69.33 │ 59.46 │ 65.82 │ 98.01 │ 70.69 │ 78.17 │ 37.45 │ 15.29 │ 25.63 │ 26.12
Reported baseline / comparator measurements (2)
BenchmarkMethodMetricScoreProtocol / Evidence
PACSRandAug. [cubuk2020randaugment] baselineAverage target-domain accuracy49.45domain-generalization · source-domain=Photo · target-domains=Art, Cartoon, Sketch
Source quote
L262: RandAug. [\citenum{cubuk2020randaugment}] │ 49.05 │ 41.77 │ 57.52 │ 49.45 │ 57.78 │ 77.09 │ 65.42 │ 87.05 │ 71.84
DigitsRandAug. [cubuk2020randaugment] baselineAverage target-domain accuracy71.84domain-generalization · training-data=first 10,000 MNIST samples · target-domains=four other digit domains
Source quote
L262: RandAug. [\citenum{cubuk2020randaugment}] │ 49.05 │ 41.77 │ 57.52 │ 49.45 │ 57.78 │ 77.09 │ 65.42 │ 87.05 │ 71.84
BibTeX
@misc{cho2025dealing,
  author = {Dongkyu Cho and Rumi Chunara},
  title = {{Dealing with the Evil Twins: Improving Random Augmentation by Addressing Catastrophic Forgetting of Diverse Augmentations}},
  year = {2025},
  eprint = {2506.08240},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.08240},
}
Figure