Distilling Self-Supervised Vision Transformers for Weakly-Supervised Few-Shot Classification & Segmentation

Dahyun Kang, Piotr Koniusz, Minsu Cho, Naila Murray

Introduction

Few-shot learning represents a significant frontier in computer vision, aiming to enable models to recognize and segment novel objects from just a handful of examples. However, the dual task of few-shot classification and segmentation (FS-CS) typically demands extensive pixel-level ground-truth (GT) masks for training—a requirement that is both financially and logistically prohibitive.

While weakly-supervised approaches utilizing only image-level labels offer a potential solution, they often struggle with generalization to unseen classes and produce coarse segmentation boundaries. This paper introduces the Classification-Segmentation Transformer (CST), a framework that addresses these challenges by distilling the inherent object-centric knowledge from self-supervised Vision Transformers (ViTs).

The Classification-Segmentation Transformer (CST)

The core of the proposed method is a lightweight learner module built upon a frozen ViT backbone pretrained with DINO. DINO-pretrained models are known to exhibit emergent properties where internal attention maps naturally align with object boundaries, even without explicit supervision.

Detailed architecture of the CST module, showing the integration of the frozen DINO ViT backbone with decoupled classification and segmentation heads.

As shown in the architecture above, the CST processes tokens from both a "support" image (the example) and a "query" image (the target). It computes multi-head cosine similarity to establish correlations between the two, allowing the model to identify semantically similar regions across different images. Crucially, the model employs decoupled task heads for classification and segmentation. This separation ensures that the spatial requirements of segmentation do not interfere with the categorical requirements of classification.

Leveraging Self-Supervision and Mixed Supervision

A key insight of this work is that self-supervised features (DINO) are superior to class-supervised features (ImageNet-1K) for few-shot tasks. While class-supervised models tend to focus on the most discriminative parts of an object (e.g., a bird's beak), self-supervised models maintain a more holistic view of object boundaries.

To handle the lack of ground-truth masks during training, CST utilizes the DINO backbone's internal attention maps as "pseudo-labels." In scenarios where a small amount of pixel-level data is available (e.g., 5% of the dataset), the authors introduce a mask enhancer. This small CNN module learns to refine the noisy, initial pseudo-masks into sharp, accurate boundaries, significantly closing the performance gap with fully supervised methods.

Experimental Results

The CST was evaluated on the Pascal-$5^i$ and COCO-$20^i$ benchmarks. The results demonstrate a substantial leap in performance for weakly-supervised FS-CS.

Qualitative results demonstrating the transition from noisy query pseudo-GT masks to refined enhanced masks, which closely approximate the ground truth.

On the Pascal-$5^i$ dataset using only image-level labels, CST achieved a 33.2% mIoU, representing a 100% improvement over the previous state-of-the-art baseline, ASNet (15.6%). Furthermore, CST outperformed fully supervised methods like HSNet and PANet, despite being significantly more parameter-efficient, adding only 0.4M learnable parameters to the system.

Limitations and Future Directions

Despite its success, the model faces challenges such as "vehicular class confusion," where it may misidentify similar categories (e.g., segmenting a car instead of a bus) due to the semantic proximity of their self-supervised features. Additionally, while the pseudo-labels are effective, they remain noisier than human annotations. Future work may explore incorporating other weak supervision signals, such as bounding boxes or scribbles, to further enhance mask quality without incurring high annotation costs.

Summary updated

BibTeX
@inproceedings{kang2023distilling,
  author = {Dahyun Kang and Piotr Koniusz and Minsu Cho and Naila Murray},
  title = {{Distilling Self-Supervised Vision Transformers for Weakly-Supervised Few-Shot Classification \& Segmentation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
}
Figure