Abstract
Few-shot image classification (FSL) often struggles with "feature pollution," where background noise and distracting objects interfere with the representation of the target category. We present FICUS (Few-shot Image Classification with Unsupervised Segmentation), a training-free pipeline that leverages the Deep Spectral Method (DSM) and the Segment Anything Model (SAM) to automatically extract and classify object instances from cluttered query images. By isolating semantic concepts without additional labels or fine-tuning, FICUS significantly improves classification accuracy across diverse benchmarks like PascalVOC and CUB-200-2011.
Introduction
In few-shot learning, a model must recognize a new category from just one to five examples. Most state-of-the-art methods utilize foundation models, such as Vision Transformers (ViT) trained with DINO, to convert an image into a single global embedding vector.
However, real-world images are rarely clean. An image labeled "dog" might also contain a park bench or a complex background. When a model creates a global embedding, it mixes the target "dog" features with irrelevant "bench" and "grass" features. In data-starved scenarios, this ambiguity leads to significant classification errors. FICUS addresses this by localizing and segmenting objects in the query image before classification, effectively "cleaning" the input for the model.
Methodology
FICUS is a three-step unsupervised methodology designed to work with existing pre-trained models without any additional training.
1. Instance Extraction
Instead of using a blind grid of points, FICUS employs the Deep Spectral Method (DSM). It analyzes the features of a pre-trained ViT to find "eigenmaps"—heatmaps that highlight distinct semantic concepts within the image. Points are sampled from these heatmaps to provide intelligent "prompts" for the Segment Anything Model (SAM).
2. Mask Selection and Refinement
SAM typically produces three masks of different scales (small, medium, large) for every prompt. To identify the most relevant mask, FICUS applies Otsu’s method to the DSM heatmaps to create a reference mask. It retains the SAM mask that exhibits the highest Intersection over Union (IoU) with this reference. Redundant masks are subsequently filtered out using Non-Maximum Suppression (NMS).
3. Classification
The original image and all extracted crops are passed through an encoder. FICUS uses an adapted Nearest Class Mean (NCM) classifier. A query image is assigned to a class if any of its crops—or the whole image itself—shows a high cosine similarity to that class's prototype.
Experimental Results
The researchers evaluated FICUS on three diverse datasets: PascalVOC (cluttered detection images), CUB-200-2011 (fine-grained bird species), and ImageNet (general classification).
Key Performance Gains
FICUS consistently outperformed the whole-image baseline and standard SAM segmentation (AMG) across nearly all tests. On the challenging PascalVOC dataset in a 1-shot scenario, FICUS improved accuracy from 66.43% to 67.86%. When combined with human-cropped support images, the accuracy jumped further to 71.64%.
Key Insights
- Localization is a Bottleneck: The study demonstrates that even manual cropping provides a massive jump in accuracy, confirming that the primary hurdle in FSL is noise within the data rather than just a lack of labels.
- The "Safety Net" Approach: By always including the original, uncropped image in its candidate set, FICUS ensures that if unsupervised segmentation fails, the model can still fall back on the global view.
- Spectral Guidance vs. Random Grids: Using DSM to guide SAM is more efficient and accurate than SAM’s default Automatic Mask Generator (AMG), which uses a simple grid of points.
Conclusion and Future Work
FICUS proves that unsupervised localization can significantly mitigate feature pollution in few-shot learning. While the current pipeline focuses on cleaning query images, future work aims to make the process fully unsupervised for the support set as well. Additionally, the authors plan to explore transductive settings and address the computational overhead associated with running spectral decomposition and SAM for every query image.
Summary updated