Abstract
Relevant Feature Focusing (ReFF) is a novel training-time regularization technique designed to mitigate the impact of spurious features on Convolutional Neural Networks (CNNs). By employing a pseudo-annotator to generate regional masks and an explanation-based loss function, ReFF encourages models to focus on task-relevant features. This approach improves robustness against distribution shifts without increasing inference-time computational costs.
Introduction
Standard deep learning assumes that training and test data come from the same distribution (i.i.d.). In the real world, this assumption often fails. For example, if a model only sees "sheep" on "grassy fields" during training, it might mistakenly learn that "grass" is the defining feature of a sheep. When it later encounters a sheep on a paved road, it fails; conversely, it might misclassify a grassy park as a "sheep."
These are called spurious features—patterns that correlate with labels in the training set but are irrelevant to the actual task. This paper tackles the challenge of training models that are "right for the right reasons," ensuring they focus on task-relevant features that remain stable even when the background or context changes.
Methodology
The authors introduce ReFF, which consists of two main components used only during the training phase:
- Explanation Regularizer: Most "explainable AI" tools like Grad-CAM are used after training to see what a model learned. ReFF brings this into the training loop. It calculates a Grad-CAM map for multiple layers of the CNN and compares it to a regional mask (an annotation showing where the object is). Unlike previous methods that try to force the model's attention to perfectly match a binary mask, ReFF uses an "Outside-In" trick: it only penalizes the model for looking outside the task-relevant region. This gives the model the flexibility to decide which specific pixels inside the object are most important.
- Pseudo-annotator: Manually masking every image in a massive dataset is prohibitively expensive. To solve this, the authors use a small subset of manually annotated images to train a "pseudo-annotator" (based on the pix2pix architecture). This model then automatically generates "soft" masks for the rest of the training data.
Because these components are only used to calculate the loss function during training, the final deployed model is a standard, off-the-shelf CNN (like ResNet-50) with zero extra latency.
Experimental Setup
The authors evaluated ReFF on three distinct types of data:
- Textured MNIST: A synthetic dataset where MNIST digits are placed on specific background textures to precisely measure reliance on spurious features.
- ISIC2017: A real-world dataset of skin lesion images containing artifacts like medical markers, hair, or skin scales that can confuse a standard classifier.
- Oxford-IIIT Pet: A standard natural image dataset (cats and dogs) used to verify performance on "clean" data where spurious correlations are less dominant.
Results and Discussion
Key findings from the evaluation include:
- Robustness to Bias: On the Textured MNIST dataset with 100% correlation between digits and backgrounds, the baseline model achieved only 31.29% accuracy on the test set. ReFF boosted this to 46.68%.
- Efficiency with Minimal Data: On the ISIC2017 skin lesion dataset, ReFF improved accuracy from 73.00% to 76.11% using only 20 manual annotations per class to train the pseudo-annotator.
- Flexibility and Multi-Layer Regularization: By only penalizing attention outside the object mask, ReFF avoids the "over-fitting" problem of earlier methods. Furthermore, applying regularization across multiple layers (from early textures to late semantic features) was significantly more effective than regularizing just the final layer.
- The Power of "Soft" Masks: Interestingly, models trained with masks from the pseudo-annotator sometimes outperformed those trained with "perfect" manual masks, suggesting that "soft" outputs provide a more natural, informative signal for the CNN.
Conclusion
ReFF demonstrates that integrating explanations into the training loop can significantly enhance model robustness against spurious correlations. While it requires a small initial manual effort for regional annotations and depends on the pseudo-annotator's quality, it offers a path toward models that generalize better to real-world distribution shifts. Future work may explore unsupervised object discovery to eliminate the need for manual regional annotations entirely.
Summary updated