TL;DR
Contrastive self-supervised learning often suffers because randomly sampled negative examples are too easy for the model to distinguish. This paper introduces SynBY, which synthesizes hard negative samples "on the fly" in the feature space and integrates them into the momentum-based MoBY framework for Vision Transformers (ViTs). By making the contrastive task more challenging, SynBY boosts linear evaluation accuracy on ImageNet across both standard (DeiT) and hierarchical (Swin) transformer architectures while acting as a natural regularizer.
What Problem Does This Paper Address?
In self-supervised contrastive learning (such as SimCLR and MoCo), an encoder learns visual representations by pulling different views of the same image together and pushing views of different images apart. However, standard approaches typically sample negative pairs uniformly at random from a mini-batch or a memory bank. Most of these random negatives look vastly different from the query image, making them trivially easy to discriminate and limiting the model's incentive to learn fine-grained visual details.
While generating "synthetic" hard negatives in feature space has shown promise for convolutional neural networks, its impact on Vision Transformers—which have fundamentally different inductive biases and training stabilities—has remained largely unexplored.
Methods
The authors build SynBY by combining the MoBY framework (a momentum-contrast transformer approach) with SynCo (a synthetic hard negative generation technique):
- Framework Backbone: Like MoBY, SynBY uses an online encoder (backbone + projection head + prediction head) and a target encoder updated via exponential moving average (momentum).
- Hard Negative Mining & Synthesis: For a query vector $q$, the method retrieves the top-$N$ hardest negatives $Q_N$ from the existing negative queue $Q$ based on cosine similarity. A synthesis function $\mathcal{F}(q, Q_N; \xi)$ constructs a set of synthetic hard negative features $Q_s$.
- Augmented Contrastive Loss: The synthetic negatives are normalized and appended to the regular memory queue $Q$. The online encoder is then trained using the standard InfoNCE loss over both real and synthetic negatives.
- Simplified Regularization: Unlike MoCo-v3, which requires explicit stabilization "tricks" (such as freezing patch projection layers), SynBY relies on the regularization provided by synthetic negatives.
Query Image ──> Online Transformer ──> Projector ──> Predictor ──┐
├──> InfoNCE Loss
Key Image ──> Target Transformer ──> Projector ───> Keys ───────┤
└──> Synthetic ──┘
Negatives
Datasets
- ImageNet ILSVRC-2012: Used for full pretraining (300 epochs) and linear probe evaluation (100 epochs on frozen representations).
- ImageNet-100: A 100-class subset of ImageNet used for rapid ablation studies (pretrained for 100 epochs).
- Note: No new datasets or benchmarks were created for this study.
Key Insights and Ideas
- Inherent Regularization Eliminates Stability "Tricks": ViT pretraining is notoriously brittle. MoCo-v3 famously required freezing the initial patch embedding layer to prevent training collapses. In SynBY, freezing patch embeddings actually harms performance ($66.4\%$ vs. $67.2\%$ on DeiT-S). The synthetic negatives themselves supply enough regularizing friction to stabilize training naturally.
- Lower Drop Path Rates Are Optimal: MoBY typically uses a drop path rate (stochastic depth) of $0.2$. Because synthetic negatives already act as an extra regularizer, the authors found a gentler drop path rate of $0.1$ for the online encoder yielded the best performance.
- Architecture-Dependent Sensitivity:
- DeiT-S (pure ViT, lack of spatial inductive bias) is sensitive to hardness parameters and works best with more aggressive, moderately hard negatives at medium-to-high proportions.
- Swin-T (hierarchical ViT with local shifted windows) is inherently more stable and performs consistently well across virtually all tested hardness thresholds and proportions.
- Sharper Attention Maps: Visualizations show that self-attention heads trained with synthetic negatives focus more tightly on semantically meaningful foreground objects compared to baseline MoBY.
Key Results
- ImageNet Top-1 Linear Evaluation (300 epochs):
- DeiT-S (22M params): SynBY achieves 73.0%, outperforming MoBY ($72.8\%$), DINO ($72.5\%$), and MoCo-v3 ($72.5\%$).
- Swin-T (29M params): SynBY achieves 75.2%, outperforming MoBY ($75.0\%$).
- Hyperparameter Robustness: Ablations on ImageNet-100 confirm that SynBY works reliably out of the box with default MoBY hyperparameters (queue size $K=4096$, temperature $\tau=0.2$, momentum $m=0.99$), requiring minimal architectural retuning.
Limitations and Future Work
- Scale of Ablations: Hyperparameter ablations were restricted to ImageNet-100 and 100 epochs, which might not fully mirror convergence dynamics on larger datasets or longer schedules.
- Evaluation Scope: The evaluation was limited to linear classification on ImageNet; dense downstream tasks like object detection, instance segmentation, or semantic segmentation were not assessed.
- Future Directions: The authors suggest extending synthetic negative generation beyond pure vision models into multimodal vision-language pretraining frameworks (e.g., CLIP-style cross-modal contrastive learning).
Summary updated