Official implementation of our NeurIPS 2024 paper: Happy: A Debiased Learning Framework for Continual Generalized Category Discovery [arXiv]
We study the under-explored setting of continual generalized category discovery (C-GCD) as follows:
🔖 The core difference between C-GCD and class-incremental learning (CIL) is that C-GCD is unsupervised continual learning, while CIL is purely supervised. At each continual stage of C-GCD, unlabeled training data could contain both old and new classes.
We introduce our method: Happy, which is characterized by Hardness-aware prototype sampling and soft entropy regularization, as follows:
We conduct experiments on 6 datasets:
- Generic datasets: CIFAR-100, TinyImageNet and ImageNet-100
- Fine-grained datasets: CUB, Stanford Cars, FGVC-Aircraft
Set paths to datasets in config.py
CIFAR100
CUDA_VISIBLE_DEVICES=0 python train_happy.py --dataset_name 'cifar100' --batch_size 128 --transform 'imagenet' --lr 0.1 --memax_weight 1 --eval_funcs 'v2' --num_old_classes 50 --prop_train_labels 0.8 --train_session offline --epochs_offline 100 --continual_session_num 5 --online_novel_unseen_num 400 --online_old_seen_num 25 --online_novel_seen_num 25
CUB
CUDA_VISIBLE_DEVICES=0 python train_happy.py --dataset_name 'cub' --batch_size 128 --transform 'imagenet' --lr 0.1 --memax_weight 2 --eval_funcs 'v2' --num_old_classes 100 --prop_train_labels 0.8 --train_session offline --epochs_offline 100 --continual_session_num 5 --online_novel_unseen_num 25 --online_old_seen_num 5 --online_novel_seen_num 5
--train_session
as offline
CIFAR100
CUDA_VISIBLE_DEVICES=0 python train_happy.py --dataset_name 'cifar100' --batch_size 128 --transform 'imagenet' --warmup_teacher_temp 0.05 --teacher_temp 0.05 --warmup_teacher_temp_epochs 10 --lr 0.01 --memax_old_new_weight 1 --memax_old_in_weight 1 --memax_new_in_weight 1 --proto_aug_weight 1 --feat_distill_weight 1 --radius_scale 1.0 --hardness_temp 0.1 --eval_funcs 'v2' --num_old_classes 50 --prop_train_labels 0.8 --train_session online --epochs_online_per_session 30 --continual_session_num 5 --online_novel_unseen_num 400 --online_old_seen_num 25 --online_novel_seen_num 25 --init_new_head --load_offline_id Old50_Ratio0.8_20240418-002807 --shuffle_classes --seed 0
CUB
CUDA_VISIBLE_DEVICES=0 python train_happy.py --dataset_name 'cub' --batch_size 128 --transform 'imagenet' --warmup_teacher_temp 0.05 --teacher_temp 0.05 --warmup_teacher_temp_epochs 10 --lr 0.01 --memax_old_new_weight 1 --memax_old_in_weight 1 --memax_new_in_weight 1 --proto_aug_weight 1 --feat_distill_weight 1 --radius_scale 1.0 --eval_funcs 'v2' --num_old_classes 100 --prop_train_labels 0.8 --train_session online --epochs_online_per_session 20 --continual_session_num 5 --online_novel_unseen_num 25 --online_old_seen_num 5 --online_novel_seen_num 5 --init_new_head --load_offline_id Old100_Ratio0.8_20240506-165445 --shuffle_classes --seed 0
--train_session
as online
--load_offline_id
according to offline training save path
--continual_session_num
, --online_novel_unseen_num
, --online_old_seen_num
and --online_novel_seen_num
the same as offline training stage.
@article{ma2024happy,
title={Happy: A Debiased Learning Framework for Continual Generalized Category Discovery},
author={Ma, Shijie and Zhu, Fei and Zhong, Zhun and Liu, Wenzhuo and Zhang, Xu-Yao and Liu, Cheng-Lin},
journal={arXiv preprint arXiv:2410.06535},
year={2024}
}
In building this repository, we reference SimGCD.
This project is licensed under the MIT License - see the LICENSE file for details.
If you have further questions or discussions, feel free to contact me:
Shijie Ma (mashijie2021@ia.ac.cn)