{"id":13737699,"url":"https://github.com/OatmealLiu/class-iNCD","last_synced_at":"2025-05-08T15:31:02.549Z","repository":{"id":44397268,"uuid":"512447115","full_name":"OatmealLiu/class-iNCD","owner":"OatmealLiu","description":"PyTorch implementation for the paper Class-incremental Novel Class Discovery (ECCV 2022)","archived":false,"fork":false,"pushed_at":"2023-03-28T08:22:11.000Z","size":4766,"stargazers_count":63,"open_issues_count":1,"forks_count":11,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-08-04T03:11:06.297Z","etag":null,"topics":["clustering","incremental-learning","novel-class-discovery","open-world-semi-supervised-learning","self-supervised-learning","semi-supervised-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OatmealLiu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-07-10T13:49:56.000Z","updated_at":"2024-07-24T11:02:41.000Z","dependencies_parsed_at":"2024-01-07T06:00:32.629Z","dependency_job_id":"5f3fec35-7c5e-4013-be1a-184bc5dec30a","html_url":"https://github.com/OatmealLiu/class-iNCD","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OatmealLiu%2Fclass-iNCD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OatmealLiu%2Fclass-iNCD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OatmealLiu%2Fclass-iNCD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OatmealLiu%2Fclass-iNCD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OatmealLiu","download_url":"https://codeload.github.com/OatmealLiu/class-iNCD/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224742243,"owners_count":17362229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clustering","incremental-learning","novel-class-discovery","open-world-semi-supervised-learning","self-supervised-learning","semi-supervised-learning"],"created_at":"2024-08-03T03:01:57.735Z","updated_at":"2024-11-15T06:30:49.348Z","avatar_url":"https://github.com/OatmealLiu.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Class-incremental Novel Class Discovery (ECCV2022)\n\u003e Class-incremental Novel Class Discovery (ECCV2022)\n\u003e\n\u003e Subhankar Roy†, Mingxuan Liu†, Zhun Zhong, Nicu Sebe, and Elisa Ricci\n\u003e\n\u003e † equal contribution\n\nThis Github repository presents the PyTorch implementation for the paper **Class-incremental Novel Class Discovery** \\[[arXiv](https://arxiv.org/abs/2207.08605)\\], accepted with a poster presentation at European Conference on Computer Vision (ECCV) held at Tel Aviv International Convention Center on October 23-27, 2022.\n\n![](figures/framework.png)\n\n\n## Preparation\n### Environment\n```shell\nPython \u003e= 3.8.8\nPyTorch \u003e= 1.10.0 \n```\n\n`environment.yaml` includes all the dependencies for conda installation. To install (Please pre-install [Anaconda](https://www.anaconda.com/)):\n```shell\nconda env create -f environment.yaml\n```\nTo activate the installed environment:\n```shell\nconda activate iNCD\n```\n\n### Dataset\nOption 1\n- Download our prepared datasets (CIFAR-10, CIFAR-100 and TinyImagenet) from drive [datasets](https://drive.google.com/file/d/1O0PPC_Bk16XLLe-UFCSw1UdbRSc-DyOI/view?usp=drive_link)\n- Move the downloaded `datasets.zip` file to `./data/` folder.\n```shell\n# cd to the repository root\ncd data\nunzip datasets.zip\n```\n\nOption 2\n- For CIFAR-10 and CIFAR-100 simply download the datasets and put into `./data/datasets/`.\n- For TinyImagenet, to download and generate image folders to `./data/datasets/`. Please follow https://github.com/tjmoon0104/pytorch-tiny-imagenet\n\n## Training and Testing\n![](figures/setting.png)\n\n### Step 1: Supervised learning with labelled data\n```shell\n# Pre-train on CIFAR-10 (# of base classes: 5)\nCUDA_VISIBLE_DEVICES=0 sh step1_scripts/pretrain_cifar10.sh\n\n# Pre-train on CIFAR-100 (# of base classes: 80)\nCUDA_VISIBLE_DEVICES=0 sh step1_scripts/pretrain_cifar100.sh\n\n# Pre-train on TinyImagenet (# of base classes: 180)\nCUDA_VISIBLE_DEVICES=0 sh step1_scripts/pretrain_tinyimagenet.sh\n```\n\n### Step 2: Class-incremental Novel Class Discovery (class-iNCD) with unlabeled data\n```shell\n# class-iNCD on CIFAR-10 (# of novel classes: 5)\nCUDA_VISIBLE_DEVICES=0 sh step2_scripts_cifar10/incd_OG_FRoST.sh\n\n# class-iNCD on CIFAR-100 (# of novel classes: 20)\nCUDA_VISIBLE_DEVICES=0 sh step2_scripts_cifar100/incd_OG_FRoST.sh\n\n# class-iNCD on TinyImagenet (# of novel classes: 20)\nCUDA_VISIBLE_DEVICES=0 sh step2_scripts_tinyimagenet/incd_OG_FRoST.sh\n```\n\n### Two-steps class-iNCD\n```shell\n# Two-step class-iNCD on CIFAR-100 (80-10-10)\nCUDA_VISIBLE_DEVICES=0 sh two-steps_scripts/auto_2step_incd_OG_FRoST_cifar100.sh\n\n# Two-step class-iNCD on TinyImagenet (180-10-10)\nCUDA_VISIBLE_DEVICES=0 sh two-steps_scripts/auto_2step_incd_OG_FRoST_tinyimagenet.sh\n```\n\n## Evaluation Protocol\n![](figures/evalutation.png)\n\n## Testing the Trained Model\nYou can use the following scripts to test the trained models under class-iNCD and two-step class-iNCD settings.\n\nWe also provide our trained models which you can use to reproduce the experimental results in our paper:\n- Download our trained model weights from drive [trained models](https://drive.google.com/file/d/1R6EB2biQj5iBPYZwC7dAzoy-qMJ-Naz6/view?usp=sharing)\n- Move the downloaded `experiments.zip` file to `./data/` folder. Then:\n```shell\n# cd to the repository root\ncd data\nunzip experiments.zip # Note: this will replace your saved model weights in your `./data/experiments/` folder\n```\n\n### Test class-iNCD setting\n```shell\n# CIFAR-10\nsh test_cifar10/test_FRoST_incd.sh\n\n# CIFAR-100\nsh test_cifar100/test_FRoST_incd.sh\n\n# TinyImagenet\nsh test_tinyimagenet/test_FRoST_incd.sh\n```\n\n### Test two-step class-iNCD setting\n```shell\n# Two-step class-iNCD on CIFAR-100 (80-10-10)\nsh test_cifar100/test_FRoST_2step_incd.sh\n\n# Two-step class-iNCD on TinyImagenet (180-10-10)\nsh test_tinyimagenet/test_FRoST_2step_incd.sh\n```\n\n## Evaluation Results\nTable 1: Comparison with state-of-the-art methods in class-iNCD\n\n![](figures/results_SOTA-HM.png)\n\nTable 2: Comparison with the state-of-the-art methods in the two-step class-iNCD setting where new classes arrive in two episodes, instead of one. New-1-J: new classes performance from joint head at first step, New-1-N: new classes performance from novel head at first step, etc\n\n![](figures/results_2step-iNCD.png)\n\nTable 3: Ablation study on the proposed feature distillation (FD), feature replay (FR) and self-training (ST) that form our FRoST\n\n![](figures/results_ablation.png)\n\nTable 4: Ablation study comparing FRoST with LwF (logits-KD)\n\n![](figures/results_LwF.png)\n\nTable 5: Ablation study on having a single and separated heads for old and new classes. Joint: class-agnostic head; Novel: new classes classifier head\n\n![](figures/results_heads.png)\n\n\n## Citation\n```\n@inproceedings{roy2022class,\n  title={Class-incremental Novel Class Discovery},\n  author={Roy, Subhankar and Liu, Mingxuan and Zhong, Zhun and Sebe, Nicu and Ricci, Elisa},\n  booktitle={Proceedings of the European Conference on Computer Vision (ECCV)},\n  year={2022}}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOatmealLiu%2Fclass-iNCD","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOatmealLiu%2Fclass-iNCD","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOatmealLiu%2Fclass-iNCD/lists"}