Abstract
Visual representation learning often relies on massive labeled datasets. We propose Spatial Context Networks (SCN), a self-supervised method that leverages the spatial relationships between image patches as a supervisory signal. By training a network to predict the feature representation of a target patch from a context patch given their relative offset, we demonstrate that models can learn high-level semantic structures. Our results show that this contextual refinement improves the performance of standard ImageNet pre-trained models on object categorization and detection tasks without additional human labels.
Introduction: The Power of Context
Deep learning's success in computer vision is largely built on massive labeled datasets like ImageNet. However, manual annotation is expensive and doesn't scale well for fine-grained tasks. While researchers often use "pre-trained" models as a starting point, these models are static and might not capture the specific contextual nuances of a new dataset.
We address this by asking: can a network learn that "wheels appear below car bodies" or "wings are attached to fuselages" simply by observing their spatial co-occurrence? Unlike auto-encoders that reconstruct pixels, SCN aims to learn high-level semantic information by predicting intermediate feature representations.
Methods: Learning from Spatial Offsets
The core idea of SCN is inspired by the "skip-gram" model in NLP. Instead of predicting a word from its neighbors, we predict a patch's features from a neighboring patch and their relative spatial distance.
The process involves selecting two patches from an image. We found that using object proposals (like EdgeBox) to select these patches is significantly more effective than choosing random patches. This ensures the network learns about object parts rather than background noise. The model then attempts to reconstruct the high-level features (e.g., the $fc7$ layer of a VGG-19) of the target patch using only the context patch and the real-valued spatial offset.
Architecture and Training
The SCN employs a dual-stream architecture during training. The "Top Stream" acts as a teacher, extracting fixed features from the target patch. The "Bottom Stream" is the learner, processing the context patch.
As shown in the diagram, the Spatial Context Module integrates the learner's features with the spatial offset $o_{ij}$ to minimize a loss against the target features. This forces the network to learn the relationship between object parts and their spatial layouts. At test time, the refined "Bottom Stream" is used as a standard feature extractor for downstream tasks like classification and detection, removing the need for the spatial context module.
Key Results and Insights
Our experiments on the PASCAL VOC 2007 dataset reveal several key findings:
- Performance Boost: SCN-refined VGG-19 features achieved 79.0% accuracy in object categorization, surpassing the standard ImageNet pre-trained baseline of 76.9%.
- Detection Improvement: In a Fast R-CNN setup, SCN features improved mean Average Precision (mAP) by 0.7 points over the original model.
- Semantic Understanding: The model demonstrated "blind recognition," identifying objects with 56.3% accuracy by looking only at a neighbor and the spatial relationship, proving it had learned meaningful spatial priors.
Conclusion
Spatial Context Networks demonstrate that local context is a powerful, "free" supervisory signal. By regressing to intermediate feature representations rather than raw pixels, SCNs focus on semantic relationships. This approach not only provides a path for unsupervised learning but also offers a method to refine and improve existing supervised models using unlabeled data.
Summary updated