[Paper Review] CaFT: Clustering and Filter on Tokens of Transformer for Weakly Supervised Object Localization
CaFT proposes a novel weakly supervised object localization method using Vision Transformer (ViT) by clustering patch tokens and applying a lightweight Attention Filter (AtF) head to generate accurate object masks without handcrafted thresholds. It achieves 97.55% and 69.86% localization accuracy on CUB-200 and ImageNet-1K with ground-truth class labels, outperforming prior CAM-based methods by eliminating reliance on discriminative regions and threshold selection.
Weakly supervised object localization (WSOL) is a challenging task to localize the object by only category labels. However, there is contradiction between classification and localization because accurate classification network tends to pay attention to discriminative region of objects rather than the entirety. We propose this discrimination is caused by handcraft threshold choosing in CAM-based methods. Therefore, we propose Clustering and Filter of Tokens (CaFT) with Vision Transformer (ViT) backbone to solve this problem in another way. CaFT first sends the patch tokens of the image split to ViT and cluster the output tokens to generate initial mask of the object. Secondly, CaFT considers the initial mask as pseudo labels to train a shallow convolution head (Attention Filter, AtF) following backbone to directly extract the mask from tokens. Then, CaFT splits the image into parts, outputs masks respectively and merges them into one refined mask. Finally, a new AtF is trained on the refined masks and used to predict the box of object. Experiments verify that CaFT outperforms previous work and achieves 97.55\% and 69.86\% localization accuracy with ground-truth class on CUB-200 and ImageNet-1K respectively. CaFT provides a fresh way to think about the WSOL task.
Motivation & Objective
- To address the limitation of CAM-based methods that focus on discriminative regions rather than full objects due to handcrafted thresholding.
- To eliminate the need for manual threshold selection in activation map-based localization.
- To improve localization accuracy by leveraging the class token in Vision Transformer for cluster-based mask generation.
- To develop a lightweight, pseudo-supervised head (AtF) that refines initial masks from clustering for robust object localization.
- To provide a new paradigm for WSOL by combining clustering with deep learning on ViT features.
Proposed method
- Clustering is applied to ViT-processed patch tokens to group feature vectors, with the cluster containing the class token selected as the foreground object mask.
- A lightweight Attention Filter (AtF) head is trained on the initial cluster mask as pseudo-label to refine the object mask from ViT tokens.
- The image is split into multiple parts, each processed independently to generate partial masks, which are then merged into a refined global mask.
- A second AtF head is trained on the refined masks to predict the final object bounding box.
- Feature maps from the last three ViT layers and their position embeddings are fused before clustering and AtF to improve representation quality.
- The AtF module uses 1×1 or 3×3 convolutions with batch normalization and activation to learn foreground-background distinctions from token-level features.
Experimental results
Research questions
- RQ1Can clustering of ViT patch tokens, guided by the class token, effectively generate an initial object mask without thresholding?
- RQ2Does a lightweight Attention Filter (AtF) head trained on cluster-generated pseudo masks improve localization accuracy over direct regression or classification?
- RQ3How does multi-scale fusion of ViT features (from multiple layers) affect clustering and mask generation performance?
- RQ4What is the optimal architecture for the AtF head in terms of kernel size and depth to avoid overfitting and improve edge detection?
- RQ5Can pseudo-labels from clustering be used effectively to train a robust localization head, and how does this compare to bounding box regression?
Key findings
- CaFT achieves 97.55% localization accuracy on CUB-200 with ground-truth class labels, significantly outperforming prior CAM-based methods.
- On ImageNet-1K, CaFT reaches 69.86% localization accuracy with ground-truth class, demonstrating strong generalization on large-scale data.
- The AtF head trained on cluster-generated pseudo masks outperforms box regression heads, even when using the same pseudo labels, due to better stability and noise filtering.
- AtF with 1×1 convolutions (AtFS) achieves the best performance and generalization, while 3×3 kernels introduce overfitting and degrade edge detection.
- Fusing features from the last three ViT layers improves mask quality, and including position embeddings further boosts performance by 0.05%.
- Direct training of deep networks (ResNet50, VGG16) on pseudo masks leads to overfitting and worse performance than clustering alone, highlighting the need for lightweight, task-specific heads like AtF.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.