SERE: Exploring Feature Self-Relation for Self-Supervised Transformer

Zhong-Yu Li, Shanghua Gao, Ming-Ming Cheng · DOI

TL;DR

This paper introduces SERE (Self-relation Exploration for Self-supervised Transformer), a novel self-supervised learning approach for Vision Transformers (ViTs). Instead of relying solely on feature embeddings, SERE leverages the inherent spatial and channel self-relation capabilities of ViTs to learn richer representations, leading to improved performance across various downstream vision tasks.

What Problem Does This Paper Address?

Self-supervised learning (SSL) has proven highly effective for training deep neural networks, especially for vision tasks where labeled data is scarce. While CNNs have benefited greatly from SSL, Vision Transformers (ViTs) possess unique architectural properties, particularly their self-attention mechanisms, that allow them to model relationships between different parts of an image (spatial relations) and within feature channels. However, most existing SSL methods for ViTs largely adapt strategies designed for CNNs, such as instance-level discrimination, and fail to fully exploit these ViT-specific relational modeling capabilities. This oversight limits the potential of ViTs in SSL. The paper aims to bridge this gap by proposing a method that explicitly utilizes and enhances ViT's inherent spatial and channel self-relation modeling abilities for more effective self-supervised representation learning.

Methods

The core of SERE lies in using "feature self-relations" as a new representation form for SSL, complementing traditional feature embeddings. The authors define two types of self-relations:

  • Spatial Self-relation: This captures how different image patches relate to each other within a single image. It's inspired by the Multi-Head Self-Attention (MHSA) mechanism in ViTs, which aggregates spatial information. The method extracts features from overlapping regions of two augmented views of an image and then computes a spatial self-relation matrix. This matrix represents the relationships between patches, normalized to form probability distributions.
  • Channel Self-relation: This focuses on the relationships between different feature channels within an image. This is motivated by the Feedforward Network (FFN) in ViTs, which implicitly models channel interactions. Similar to spatial self-relation, channel self-relation is computed as a matrix representing the correlations between channels, again normalized into probability distributions.

These self-relations are then used as representations within existing SSL frameworks (like DINO, MoCo v3, iBOT) by replacing or augmenting the standard feature embeddings. The authors propose a combined loss function that can incorporate image-level embeddings (L1), spatial self-relation (Lp), and channel self-relation (Lc).

Datasets

The paper utilizes several standard datasets for training and evaluation:

  • ImageNet-1K: Used for pre-training and classification tasks.
  • ImageNet-S300: Used for semi-supervised semantic segmentation.
  • PASCAL VOC2012: Used for semantic segmentation and object detection.
  • ADE20K: Used for semantic segmentation.
  • COCO: Used for object detection and instance segmentation.
  • CIFAR-10, CIFAR-100, iNaturalist19, Flowers, Cars: Used for transfer learning experiments on classification.

No new benchmarks were introduced; the focus was on evaluating SERE on existing downstream tasks.

Key Insights and Ideas

  • ViT's Relational Power: The paper highlights that ViTs are inherently good at modeling spatial and channel relationships, a property often overlooked by existing SSL methods that primarily focus on feature embeddings.
  • Self-Relations as a Complementary Representation: SERE demonstrates that feature self-relations are not just an alternative but a complementary representation to traditional feature embeddings. Combining them leads to superior performance.
  • Orthogonality of Representations: The self-relations (spatial and channel) are shown to be orthogonal to image-level and patch-level embeddings, meaning they capture different aspects of the data and can be combined for synergistic gains.
  • Enhanced Invariance: SERE improves the invariance of learned representations to image augmentations, leading to more robust models.
  • MIM Complementarity: SERE can be combined with Masked Image Modeling (MIM) approaches to further boost performance, suggesting that different SSL paradigms can be synergistic.

Key Results

  • Improved Classification: SERE consistently improves Top-1 accuracy on ImageNet-1K classification, outperforming baselines like DINO and iBOT by up to 1.2% and 0.6% respectively, even with fewer pre-training epochs.
  • Stronger Segmentation: SERE significantly boosts performance on semantic segmentation tasks (PASCAL VOC, ADE20K, ImageNet-S), achieving improvements of up to 2.9% in mIoU on ImageNet-S when initialized with self-supervised weights.
  • Better Detection and Instance Segmentation: SERE also shows gains in object detection (COCO) and instance segmentation, improving APb by 0.6% and APm by 0.5%.
  • Efficiency: SERE can achieve competitive or better results with fewer pre-training epochs compared to some existing methods.
  • Robustness: The method is shown to be robust to different hyperparameter settings for loss weights.
  • Qualitative Improvements: Visualizations of attention maps show that SERE produces more precise and less noisy attention maps compared to MIM-based methods.

Limitations and Future Work

  • CNN Adaptability: While SERE is designed for ViTs, the paper briefly explores its application to CNNs (ResNet-50). The improvements are present but significantly smaller than those observed in ViTs, suggesting SERE is more tailored to transformer architectures. The authors suggest that while SERE is more suitable for ViTs, it can still offer benefits to CNNs.
  • Hyperparameter Sensitivity: While generally robust, the paper investigates the effect of temperature parameters (tp, tc) and loss weights (α, β), indicating that optimal settings might vary.
  • Future Directions: The paper implicitly suggests exploring more sophisticated ways to combine spatial and channel self-relations, or investigating their application in other transformer-based models beyond vision. The complementary nature of SERE with MIM also opens avenues for hybrid SSL approaches.

Summary updated

BibTeX
@article{li2023sere,
  author = {Zhong-Yu Li and Shanghua Gao and Ming-Ming Cheng},
  title = {{SERE: Exploring Feature Self-Relation for Self-Supervised Transformer}},
  journal = {IEEE Trans. Pattern Anal. Mach. Intell.},
  year = {2023},
  doi = {10.1109/tpami.2023.3309979},
}
Figure