Abstract: We propose Fuse Local and Global Semantics in Representation Learning (FLAGS) to generate richer representations. FLAGS aims to extract both global and local semantics from images to benefit various downstream tasks. It shows promising results under common linear evaluation protocols. We also conduct detection and segmentation on PASCAL VOC and COCO to show that the representations extracted by FLAGS are highly transferable.
Introduction: The Semantic Tug-of-War
In modern computer vision, a fundamental tension exists between self-supervised learning (SSL) and supervised learning. Self-supervised methods, such as MoCo or SimCLR, are adept at capturing "global" semantics—the holistic scene context, including background elements and spatial relationships. This makes them particularly effective for tasks like object detection where context is key.
Conversely, supervised methods focus on "local" semantics—the specific features of an object that define its class label. While this leads to superior performance in image classification, it often neglects the broader environmental context. The authors of FLAGS argue that attempting to learn both semantic levels within a single feature space leads to "confused" models, as the different objectives pull the representation in conflicting directions. FLAGS addresses this by disentangling these semantics into separate latent subspaces.
Methodology: The FLAGS Framework
The core of FLAGS is a dual-branch architecture designed to prevent interference between global and local learning objectives.
Dual-Branch Architecture and Subspace Projection
Instead of mapping an image to a single feature vector, FLAGS projects features into two distinct hyperspheres (subspaces): one dedicated to global semantics and another to local semantics. This disentanglement allows the model to preserve the invariance of raw data in one space while capturing the specific variance of object-level features in another.
As shown in the architecture diagram, the query image $x$ is processed by an encoder to produce a query vector $q$, which is then branched into local (mlp_l_q) and global (mlp_g_q) projections. A momentum encoder maintains consistency by processing local and global keys to update respective queues. The final "Total loss" is a summation of independent local and global contrastive losses.
Similarity-Based Sampling Strategy
To effectively train these branches, FLAGS employs a novel sampling strategy within each image class to identify positive pairs for the contrastive loss:
- Global Positives: The model selects the most similar images in a class (top-k). These images typically share similar backgrounds and overall scene contexts.
- Local Positives: The model selects images with moderate similarity (from the middle of the sorted similarity list). These images share the same object category but feature different backgrounds, forcing the local branch to ignore the environment and focus strictly on the object's defining features.
Experimental Results
The effectiveness of FLAGS was evaluated across several standard benchmarks, demonstrating its versatility as a backbone for diverse vision tasks.
Image Classification
Under the linear evaluation protocol on ImageNet, FLAGS achieved an impressive 78.45% accuracy. This significantly outperforms MoCo v2, which reached 67.16%, highlighting the benefit of incorporating supervised local semantics into the representation.
Dense Downstream Tasks
The model's transferability was tested on object detection and segmentation tasks:
- COCO 2017: FLAGS achieved 38.34 AP in object detection, surpassing both standard supervised pre-training (38.20 AP) and MoCo v2 (37.88 AP). In instance segmentation, it reached a Mask AP of 33.51, outperforming the supervised baseline.
- PASCAL VOC: While the local branch provided less of a boost here—likely because objects in this dataset often dominate the frame, blurring the line between local and global—the overall framework remained competitive.
Key Insights and Limitations
FLAGS demonstrates that semantics are hierarchical. "Global" is not merely "unsupervised"; it encompasses the entire scene, while "local" is strictly about the entity defined by the label. By using "middle-ground" similarity images as local positives, the model effectively performs a natural "zoom-in," stripping away background noise.
However, the strategy of using the "middle-of-the-list" for local positives is a heuristic that can introduce noise if the selected images are too divergent from the query. Future work may involve refining this sampling to be more dynamic or class-aware to further improve the precision of learned local features.
Summary updated