Abstract
Self-supervised contrastive learning has shown immense potential in learning visual representations. However, its application to fine-grained recognition remains under-explored. We observe that standard contrastive methods often rely on background textures, limiting their ability to localize foreground objects. We introduce Cross-View Saliency Alignment (CVSA), a framework that utilizes saliency-based data augmentation and a novel alignment loss to focus the model on discriminative foreground features. Our experiments demonstrate that CVSA significantly improves performance on both small- and large-scale fine-grained classification benchmarks.
The Problem: Background Cheating in Contrastive Learning
Standard self-supervised learning (SSL) frameworks like MoCo or BYOL typically rely on RandomResizedCrop (RRC) to generate different "views" of an image. In fine-grained scenarios—where the difference between classes (e.g., bird species) is subtle—this approach has a major flaw. If the foreground object is small, random crops may capture only background elements like branches or sky.
The model then "cheats" by associating these background textures with the image identity. This prevents the network from learning the precise localization and discriminative foreground features necessary for fine-grained recognition.
Methods: Cross-View Saliency Alignment (CVSA)
To address this, we propose CVSA, which forces the model to ignore background shortcuts and focus on the object of interest.
1. SaliencySwap (SS) Augmentation
Instead of random cropping, we use a saliency detector to identify the foreground object. SaliencySwap crops this region and pastes it onto a different background image. This ensures that every view contains the actual object, while the background varies significantly, preventing the model from relying on static environmental cues.
2. Cross-View Saliency Alignment Loss
To further reinforce localization, we introduce a Saliency Alignment Module. This module calculates a cross-view attention map between the features of two different views of the same object. We then apply a loss ($L_{Align}$) to align this attention map with the ground-truth saliency mask. This provides an explicit signal to the model about which regions are most important for representation.
3. Dual-Stage Pipeline
We employ a two-stage pre-training strategy:
- General Pre-training: Initial training on large-scale datasets (e.g., ImageNet) to learn fundamental visual textures.
- Fine-grained CVSA: Specialized pre-training on target fine-grained datasets using our saliency-aware components to hone localization and discrimination.
Key Results and Insights
CVSA consistently outperforms state-of-the-art SSL baselines across multiple benchmarks:
- Performance Gains: On the CUB-200-2011 dataset, CVSA improved the top-1 accuracy of a BYOL baseline by over 2%, reaching 69.14% in the dual-stage setting.
- Improved Localization: Qualitative Grad-CAM visualizations confirm that CVSA models focus tightly on the object, whereas RRC-based models often attend to irrelevant background features like branches or roads.
- Robustness: CVSA is more robust to the scale of augmentations because the saliency-based approach ensures the object is always present in the view.
Conclusion
By identifying "background cheating" as a primary bottleneck in fine-grained self-supervised learning, we developed CVSA to prioritize foreground localization. Our results show that incorporating saliency as a prior—even if coarse—is a powerful tool for building more discriminative and robust visual representations for complex classification tasks.
Summary updated