What’s in a Name? Beyond Class Indices for Image Recognition

August 30, 2024 · View on GitHub

This repository is the official implementation of the CVPR2024 CVinW workshop paper (Spotlight): "What’s in a Name? Beyond Class Indices for Image Recognition" Kai Han, Xiaohu Huang, Yandong Li, Sagar Vaze, Jie Li, and Xuhui Jia

teaser image

Semantic Category Discovery (SCD): Given a collection of images and a large (essentially unconstrained) vocabulary, assign class names to each image.

License

SCD is released under the CC BY-NC-SA 4.0 license.

Performance

We conduct experiments in two settings, i.e., unsupervised and partially supervised.

Table 1. Results in the unsupervised setting. We use DINO features for the initial clustering step and report metrics for semantic accuracy (involving class naming, left) and clustering (right). ‘TE’ denotes using the textual enhancement technique.

MethodImageNet-100 sACCSoft-sACCACCStanford Dogs sACCSoft-sACCACCCUB sACCSoft-sACCACC
Zero-shot transfer (UB)85.092.085.160.483.260.854.183.255.8
Zero-shot transfer (Baseline)22.757.773.251.777.447.220.277.434.4
Ours (Semantic Naming)41.271.378.253.879.157.924.579.146.5
Ours (Semantic Naming) w/TE43.072.581.354.180.058.733.580.042.6

Table 2. Results in the partially supervised setting. We use GCD features for the initial clustering step and report metrics for semantic accuracy (involving class naming, left) and clustering (right). ‘TE’ denotes using the textual enhancement technique.

MethodImageNet-100 sACCSoft-sACCACCStanford Dogs sACCSoft-sACCACCCUB sACCSoft-sACCACC
Zero-shot transfer (UB)85.092.085.160.483.260.854.155.855.8
Zero-shot transfer (Baseline)22.757.774.151.777.460.820.257.754.0
Ours (Semantic Naming)54.877.578.753.779.662.135.379.652.9
Ours (Semantic Naming) w/TE55.776.580.655.580.658.835.380.642.5

Dependency

To install the dependencies, you can use the the following command:

pip install -r requirements.txt

Besides, you need to get into the local_utils/k_means_constrained folder, and install the package:

python setup.py install

Data Preparation

The used datasets can be donwloaded from the links below:

DatasetLink
CUBLink
Standford Dogslink
ImageNetlink

You also need to download the extracted features, gcd pretrained weights, and zero-shot weights and put them into the respective folders.

Evaluation

  • Unsupervised Setting

You can just modify the configurations based on what you needs in the script.

sh script/evaluate_unsupervised.sh
  • Partially Supervised Setting

You can just modify the configurations based on what you needs in the script.

sh script/evaluate_unsupervised.sh

BibTex

@inproceedings{han2024whats,
  title={What's in a Name? Beyond Class Indices for Image Recognition},
  author={Kai Han and Xiaohu Huang and Yandong Li and Vaze Sagar and Jie Li and Xuhui Jia},
  booktitle={CVPR Workshops},
  year={2024}
}