Abstract
Deep learning models fail on cross-domain challenges if the model is oversensitive to domain-specific attributes, e.g., lightning, background, camera angle, etc. To alleviate this problem, data augmentation coupled with consistency regularization are commonly adopted to make the model less sensitive to domain-specific attributes. Consistency regularization enforces the model to output the same representation or prediction for two views of one image. These constraints, however, are either too strict or not order-preserving for the classification probabilities. In this work, we propose the Order-preserving Consistency Regularization (OCR) for cross-domain tasks. The order-preserving property for the prediction makes the model robust to task-irrelevant transformations. As a result, the model becomes less sensitive to the domain-specific attributes. The comprehensive experiments show that our method achieves clear advantages on five different cross-domain tasks.
Introduction
When deep learning models are deployed in real-world environments, they often encounter "domain shift"—discrepancies between training and testing data caused by variations in lighting, background, or camera perspective. While standard consistency regularization techniques attempt to mitigate this by forcing models to produce identical outputs for different views of the same image, they often suffer from two primary limitations. First, representation-based methods are frequently too restrictive, attempting to force internal features to be identical despite legitimate variations introduced by augmentations. Second, prediction-based methods often focus solely on the top-ranked class, ignoring the relative ranking of other classes and thereby losing valuable discriminative information.
This paper introduces Order-preserving Consistency Regularization (OCR), a novel framework designed to make models robust to domain-specific noise while preserving the semantic hierarchy of class probabilities. By ensuring that data augmentations do not scramble the relative ranking of classes, OCR allows the model to focus on core label attributes rather than transient domain features.
Methodology
Residual Separation and Entropy Maximization
The core of OCR lies in a mathematical decomposition of image representations. The authors represent the features of an augmented image ($z_a$) as a linear combination of the original features ($z_o$) and a "residual component" ($z_n$):
$$z_a = \lambda z_o + (1 - \lambda)z_n$$
To ensure the model ignores domain-specific noise, OCR aims to minimize the task-related information contained within the residual component ($z_n$). This is achieved by maximizing the entropy of the classifier's output when it is fed only the residual. High entropy indicates that the residual is "uncertain" or "flat" across all classes, meaning it contains no useful information for identifying the object.
Order Preservation
Unlike traditional methods that enforce strict equality, OCR creates an "order-preserving mapping." If a model initially determines that Class A is more likely than Class B, OCR ensures that this relative ranking remains consistent after augmentation, even if the absolute probability values fluctuate. This property is crucial for maintaining the model's discriminative power across different domains.
Implementation Details
OCR utilizes an annealing strategy for the weight $\lambda$. By starting with a small $\lambda$ and increasing it throughout training, the model is allowed to explore variations early on before gradually becoming less sensitive to domain-specific attributes. Notably, OCR is a "plug-and-play" solution; it does not require complex asymmetric architectures or stop-gradient operations, making it compatible with various backbones like ResNet and Vision Transformers (ViT).
Experimental Evaluation
The authors evaluated OCR across five distinct cross-domain tasks, demonstrating its versatility and effectiveness:
- Domain Adaptation & Generalization: On the Office-Home and PACS datasets, OCR consistently outperformed state-of-the-art (SOTA) baselines. In Office-Home, OCR improved Top-5 accuracy from 89.4% to 92.2%, indicating that the order-preserving property keeps the correct label within the model's top candidates even when the top-1 prediction is difficult.
- Semantic Segmentation: In a challenging transition from synthetic (GTAV) to real-world (BDD100K/Cityscapes) environments, adding OCR to a DeepLabv3+ baseline improved the mean Intersection over Union (mIoU) by 6.5%.
- Adversarial Robustness: OCR significantly enhanced robustness against white-box attacks. On the PACS dataset under a PGD attack, OCR achieved 61.6% accuracy, a substantial leap from the 38.4% achieved by standard Empirical Risk Minimization (ERM).
- Test-Time Adaptation: The method also showed strong performance on CIFAR100-C, which involves 15 types of image corruptions.
Discussion and Key Insights
Information Bottleneck Principle
OCR is theoretically grounded in the Information Bottleneck principle. By minimizing the mutual information between the residual component and the labels, the model learns a "minimal sufficient" representation—keeping only what is necessary for the task and discarding domain-specific noise.
Generalization of Existing Methods
The authors demonstrate that traditional representation-based consistency is a specific, more rigid case of OCR where the residual is forced to zero. OCR provides a more flexible alternative that allows representations to change as long as the underlying semantic meaning (the class order) is preserved.
Conclusion
Order-preserving Consistency Regularization (OCR) offers a robust framework for addressing domain shift by focusing on the stability of class rankings rather than absolute feature values. Its success across classification, segmentation, and detection tasks, combined with its ease of integration into existing pipelines, makes it a powerful tool for developing models that generalize better to real-world conditions. Future research may explore automated methods for learning task-specific augmentations to further bridge the gap between training and deployment domains.
Summary updated