TL;DR
This paper introduces Class-Invariant Test-Time Augmentation (CI-TTA), a lightweight method to improve how deep learning models generalize to new, unseen data domains. By applying controlled deformations to test images that preserve their class identity and then filtering unreliable predictions, CI-TTA significantly boosts performance across various domain generalization algorithms.
What Problem Does This Paper Address?
Deep learning models excel in controlled environments but often falter when faced with "distribution shifts" – data that differs from their training distribution. This is a major hurdle for deploying AI in real-world scenarios where data naturally varies. Domain Generalization (DG) aims to train models that can handle these shifts without needing access to target domain data during training. Existing DG methods often rely on complex multi-domain training or computationally expensive test-time adaptation techniques. This paper addresses the need for a simpler, more efficient approach that can be applied after a model is trained and deployed, specifically at inference time.
Methods
The core of the proposed method is Class-Invariant Test-Time Augmentation (CI-TTA). It operates in four stages:
- Deformation-based Augmentation: For each incoming test image, CI-TTA generates multiple augmented versions using two types of deformations:
- Elastic Deformation: Warps the image based on a smooth, spatially coherent displacement field.
-
Grid Deformation: Perturbs a regular grid of control points and interpolates to create a warped image. Both deformation types are controlled by parameters sampled from a Gaussian distribution, ensuring unbiased perturbations that preserve the original shape and class identity. The key is that these deformations are designed to be "class-invariant," meaning they shouldn't change what the object is, only its appearance slightly.
-
Prediction: The original test image and all its augmented variants are passed through the pre-trained model to obtain class predictions (logits).
- Confidence-Guided Filtering: Not all augmented predictions are reliable. Some deformations might introduce artifacts that confuse the model. To address this, CI-TTA calculates a "confidence score" for each prediction (the maximum class probability). Predictions with confidence below a certain threshold ($\tau$) are filtered out.
- Aggregation: The remaining, high-confidence predictions are averaged to produce the final prediction. This aggregation strategy aims to leverage consistent, trustworthy cues from the augmented views. If no augmented predictions meet the confidence threshold, the prediction from the original image is used as a fallback.
Datasets
The paper evaluates CI-TTA on two standard domain generalization benchmarks:
- PACS: A dataset comprising four domains: Art, Cartoon, Photo, and Sketch.
- Office-Home: A dataset with four domains: Art, Clipart, Product, and Real-World images.
These datasets are commonly used in DG research to test a model's ability to generalize across visually distinct domains.
Key Insights and Ideas
- Shape over Texture: The authors hypothesize and provide evidence that shape is a more domain-invariant cue than texture. By using deformations that preserve global shape, CI-TTA encourages models to rely on these more robust features.
- Lightweight Inference-Time Adaptation: Unlike computationally intensive test-time adaptation methods that involve backpropagation, CI-TTA is a simple augmentation and aggregation strategy that adds minimal overhead during inference.
- Confidence is Key: Simply averaging predictions from augmented views can sometimes hurt performance. The confidence-guided filtering is crucial for filtering out unreliable predictions caused by potentially misleading augmentations, leading to more robust results.
- Generality: CI-TTA is designed as a plug-and-play module that can be applied on top of various existing DG algorithms and different backbone architectures, demonstrating its broad applicability.
Key Results
- CI-TTA consistently improved accuracy across all tested DG algorithms (ERM, DANN, RSC, VREx, Mixup, CORAL) and backbones (ResNet-18, ResNet-50) on both PACS and Office-Home datasets.
- On the PACS dataset with ResNet-18, CI-TTA improved the mean accuracy of ERM from 80.56% to 82.01%.
- Ablation studies showed that both the class-invariant deformations and the confidence-guided filtering contribute significantly to the performance gains.
- The optimal deformation strength ($\sigma$) was found to be around 0.01-0.015, and a moderate confidence threshold ($\tau \in [0.6, 0.7]$) provided the best trade-off between filtering noise and retaining useful predictions.
Limitations and Future Work
- Hyperparameter Tuning: CI-TTA currently requires manual tuning of hyperparameters like deformation strength ($\sigma$) and the confidence threshold ($\tau$).
- Inference Cost: While lightweight compared to TTAda, CI-TTA does add some computational cost due to generating and processing multiple augmented views.
The authors suggest future work could focus on developing adaptive mechanisms to automatically calibrate these hyperparameters and exploring how CI-TTA can be integrated with training-time strategies for even greater generalization improvements.
Summary updated