Abstract
While deep learning through empirical risk minimization (ERM) has succeeded at achieving human-level performance at a variety of complex tasks, ERM is not robust to distribution shifts or adversarial attacks. Synthetic data augmentation followed by empirical risk minimization (DA-ERM) is a simple and widely used solution to improve robustness. In addition, consistency regularization can further improve robustness by forcing the representation of the original sample and the augmented one to be similar. However, existing consistency regularization methods are not applicable to covariant data augmentation, where the label in the augmented sample depends on the augmentation function. We propose Data Augmented Loss Invariant Regularization (DAIR), a simple form of consistency regularization applied directly at the loss level. This makes it widely applicable to both invariant and covariant data augmentation regardless of network architecture or task. Our experiments show that DAIR consistently outperforms ERM and DA-ERM, setting new state-of-the-art results in several benchmarks.
The Challenge of Covariant Augmentation
Deep learning models are notoriously brittle; minor distribution shifts or adversarial tweaks can lead to catastrophic failure. While Data Augmentation (DA) helps, standard consistency regularization techniques often assume invariance—the idea that the label remains identical after augmentation (e.g., a flipped image of a cat is still a cat).
In many real-world scenarios, however, labels are covariant. For instance, in a task-oriented dialog system, if a user's request is augmented by swapping "airport" for "bus station," the corresponding dialog state label must also change. Traditional feature-consistency methods fail here because they force the model to ignore the very details (the specific entities) required to distinguish between different labels.
Data Augmented Loss Invariant Regularization (DAIR)
To overcome the limitations of feature-level consistency, DAIR shifts the focus to loss consistency. Rather than forcing the model to have identical internal representations for two different inputs, DAIR encourages the model to be "equally correct" (or equally wrong) on both the original and augmented samples.
The DAIR objective function adds a regularization term to the standard training loss:
$$f_{DAIR}(\theta) = f_{DA-ERM}(\theta) + \lambda R(\ell(z; \theta), \ell(\tilde{z}; \theta))$$
where $\ell$ is the loss of the original sample $z$ and $\tilde{z}$ is the augmented sample. The authors recommend a specific variant, DAIR-SQ, which utilizes the squared difference of the square roots of the losses: $R_{sq} = (\sqrt{\ell} - \sqrt{\tilde{\ell}})^2$. This formulation is naturally "weaker" when losses are high at the start of training, allowing the model to learn the primary task before the consistency constraint becomes dominant.
Experimental Results
DAIR was evaluated across a diverse suite of challenges, encompassing both covariant and invariant tasks:
- Dialog Systems (MultiWOZ 2.2): DAIR set a new state-of-the-art, improving Joint Goal Accuracy (JGA) from 48.44% to 56.09% on unseen entities.
- Visual Question Answering (CV-VQA): In tests where relevant objects were removed from images (changing the answer), DAIR achieved 49.75% accuracy, significantly outperforming ERM (45.89%).
- Distribution Shifts: On tasks like rotated MNIST, DAIR-SQ demonstrated superior robustness compared to standard ERM and DA-ERM as the shift became more extreme.
- Adversarial Defense: On CIFAR-10, DAIR proved competitive with specialized defenses like TRADES, achieving a PGD20 accuracy of 53.37% while maintaining high clean accuracy.
Discussion and Limitations
DAIR is a "plug-and-play" regularizer that is architecture-agnostic and task-agnostic. It achieves competitive results against highly specialized algorithms without requiring complex, task-specific machinery.
However, some limitations remain. DAIR requires "pairing information"—knowing exactly which augmented sample corresponds to which original sample—which may not be available in all datasets. Additionally, because it processes both original and augmented samples in every step, it roughly doubles the computational cost per iteration compared to standard ERM. Future work includes exploring automated hyperparameter tuning for the regularization strength $\lambda$ and extending the framework to semi-supervised learning environments.
Summary updated