{"id":22283615,"url":"https://github.com/ashok-arjun/cscct","last_synced_at":"2025-07-28T21:32:52.937Z","repository":{"id":62812269,"uuid":"472401279","full_name":"ashok-arjun/CSCCT","owner":"ashok-arjun","description":"Official Implementation of the ECCV 2022 Paper \"Class-Incremental Learning with Cross-Space Clustering and Controlled Transfer\"","archived":false,"fork":false,"pushed_at":"2022-08-14T03:12:33.000Z","size":187,"stargazers_count":12,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-05T07:42:43.007Z","etag":null,"topics":["class-incremental-learning","computer-vision","continual-learning","deep-learning","eccv","eccv2022","incremental-learning","pytorch"],"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/ashok-arjun.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}},"created_at":"2022-03-21T15:36:21.000Z","updated_at":"2023-01-04T06:59:05.000Z","dependencies_parsed_at":"2022-11-07T04:46:09.735Z","dependency_job_id":null,"html_url":"https://github.com/ashok-arjun/CSCCT","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashok-arjun%2FCSCCT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashok-arjun%2FCSCCT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashok-arjun%2FCSCCT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashok-arjun%2FCSCCT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashok-arjun","download_url":"https://codeload.github.com/ashok-arjun/CSCCT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227960044,"owners_count":17847729,"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":["class-incremental-learning","computer-vision","continual-learning","deep-learning","eccv","eccv2022","incremental-learning","pytorch"],"created_at":"2024-12-03T16:41:22.012Z","updated_at":"2024-12-03T16:41:22.443Z","avatar_url":"https://github.com/ashok-arjun.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Class-Incremental Learning with Cross-Space Clustering and Controlled Transfer\n\nThe official implementation of our ECCV 2022 paper \"Class-Incremental Learning with Cross-Space Clustering and Controlled Transfer\".\u003cbr\u003e\n\u003ca href=\"https://arxiv.org/abs/2208.03767\" target=\"_blank\"\u003e[Paper]\u003c/a\u003e \u003ca href=\"https://cscct.github.io\" target=\"_blank\"\u003e[Project Page]\u003c/a\u003e\n\n## Getting Started\n\nIn order to run this repository, we advise you to install python 3.6 and PyTorch 1.2.0 with Anaconda.\n\nYou may download Anaconda and read the installation instruction on their official website:\n\u003chttps://www.anaconda.com/download/\u003e\n\nCreate a new environment and install PyTorch and torchvision on it:\n\n```bash\nconda create --yes --name CSCCT-PyTorch python=3.6\nconda activate CSCCT-PyTorch\nconda install --yes pytorch=1.2.0 \nconda install --yes torchvision -c pytorch\n```\n\nInstall other requirements:\n```bash\npip install tqdm scipy sklearn tensorboardX Pillow==6.2.2\n```\n\n## Running Experiments\n\n### Baselines\n\n```bash\npython main.py --nb_cl_fg=INITIAL_TASK_SIZE --nb_cl=TASK_SIZE --gpu=GPU --random_seed=1993 --baseline=BASELINE --branch_mode=single --branch_1=free --dataset=DATASET\n```\n\nThe above script can be used, replacing \n\n`INITIAL_TASK_SIZE` with the number of classes in the first task (given as $\\mathcal{B}$ in the paper),\n\n`TASK_SIZE` with the number of classes in every subsequent task (given as $\\mathcal{C}$ in the paper),\n\n`BASELINE` with either `'lucir'` or `'icarl'`,\n\n`DATASET` with either `'cifar100` or `'imagenet_sub'`,\n\n`GPU` with the GPU to run the model in.\n\n### Baselines + CSCCT\n\nTo add cross-space clustering and controlled transfer (CSCCT) to the baselines, follow the below directions.\n\nTo add **cross-space clustering (CSC)**, add the additional flags \n\n```bash\n--csc --csc_weight SPECIFY_CSC_WEIGHT\n```\n\nreplacing `SPECIFY_CSC_WEIGHT` with the appropriate weight for the CSC objective. The default value for `csc_weight` is $3$.\n\nTo add **controlled transfer(CT)**, add the additional flags\n\n```\n--ct --ct_weight SPECIFY_CT_WEIGHT --ct_temperature SPECIFY_CT_TEMP\n```\n\nreplacing `SPECIFY_CT_WEIGHT` with the appropriate weight for the CT objective, and `SPECIFY_CT_TEMP` with the temperature. \n\nThe default value for `ct_weight` is $1.5$, and default value for `ct_temperature` is $2$. \n\n\n### Note on datasets\n\nCIFAR100 is automatically downloaded to `./data`; the directory can be changed using the flag `--data_dir PATH`.\n\nImageNet-Subset is assumed to be present at `./data/imagenet_sub`; the parent directory (`./data`) can be changed using the flag `--data_dir PATH`.\n\nTo download ImageNet-Subset, the full ImageNet dataset from [the official ImageNet website](https://image-net.org/) (note: requires login) must be first downloaded. Then, the 100-class [train](https://github.com/arthurdouillard/incremental_learning.pytorch/blob/master/imagenet_split/train_100.txt) and [val](https://github.com/arthurdouillard/incremental_learning.pytorch/blob/master/imagenet_split/val_100.txt) splits (taken from the [codebase of PODNet](https://github.com/arthurdouillard/incremental_learning.pytorch)) should be used to remove the other 900 classes and preprocess the data.\n\n### Running Experiments on ImageNet\n\nTo run the experiments on ImageNet-Subset, you need to change the hyperparameters according to [this file](https://github.com/hshustc/CVPR19_Incremental_Learning/blob/master/imagenet-class-incremental/cbf_class_incremental_cosine_imagenet.py). \n\n## Bibtex\n\nIf you find this code useful, please cite our work:\n```\n@article{ashok2022class, \ntitle={Class-Incremental Learning with Cross-Space Clustering and Controlled Transfer}, \nauthor={Ashok, Arjun and Joseph, KJ and Balasubramanian, Vineeth}, \njournal={arXiv preprint arXiv:2208.03767}, year={2022} }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashok-arjun%2Fcscct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashok-arjun%2Fcscct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashok-arjun%2Fcscct/lists"}