Hyperbolic Category Discovery
By
Yuanpei Liu*,
Zhenqi He*, and
Kai Han.
First, you need to clone the HypCD repository from GitHub. Open the terminal and run the following command:
git clone https://github.com/Visual-AI/HypCD.git
cd HypCD
We recommend setting up a conda environment for the project:
conda create --name=hypcd python=3.8
conda activate hypcd
pip install -r requirements.txt
Install the kmeans_pytorch:
git clone https://github.com/subhadarship/kmeans_pytorch
cd kmeans_pytorch
pip install --editable .
Download the pretrained DINO/DINOv2 weights from their official repository to the PRETRAINED_PATH.
Set paths to datasets, pretrained weights, and log directories in config.py.
We use generic object recognition datasets, including CIFAR-10/100 and ImageNet-100:
We also use fine-grained benchmarks (CUB, Stanford-cars, FGVC-aircraft). You can find the datasets in:
We use the slurm system to run the code. The scripts to train and eval each method can be found in the folder /scripts. For example, to train and eval the HypSimGCD models.
Eval the model
sbatch scripts/eval_HypSimGCD.cmd cub v1 0.1 2.0
Train the model:
sbatch scripts/train_HypSimGCD.cmd cub v1 0.1 2.0 0.3
Just change the dataset name (cub), its corresponding DINO version (v1) and the hyperparameters. The detailed parameters used on each dataset can be found in the file scripts/eval_HypSimGCD.cmd. The resulted logs can be found in the directory logs.
If you find this repo useful for your research, please consider citing our paper:
@inproceedings{liu2025hyperbolic,
title={Hyperbolic Category Discovery},
author={Liu, Yuanpei and He, Zhenqi and Han, Kai},
booktitle={CVPR},
year={2025}
}
