{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/generalized-category-discovery","title":"Generalized Category Discovery","arxiv_id":"2201.02609","date":"2022-01-07","proceeding":"CVPR 2022 1","authors":["Sagar Vaze","Kai Han","Andrea Vedaldi","Andrew Zisserman"],"abstract":"In this paper, we consider a highly general image recognition setting wherein, given a labelled and unlabelled set of images, the task is to categorize all images in the unlabelled set. Here, the unlabelled images may come from labelled classes or from novel ones. Existing recognition methods are not able to deal with this setting, because they make several restrictive assumptions, such as the unlabelled instances only coming from known - or unknown - classes, and the number of unknown classes being known a-priori. We address the more unconstrained setting, naming it 'Generalized Category Discovery', and challenge all these assumptions. We first establish strong baselines by taking state-of-the-art algorithms from novel category discovery and adapting them for this task. Next, we propose the use of vision transformers with contrastive representation learning for this open-world setting. We then introduce a simple yet effective semi-supervised $k$-means method to cluster the unlabelled data into seen and unseen classes automatically, substantially outperforming the baselines. Finally, we also propose a new approach to estimate the number of classes in the unlabelled data. We thoroughly evaluate our approach on public datasets for generic object classification and on fine-grained datasets, leveraging the recent Semantic Shift Benchmark suite. Project page at https://www.robots.ox.ac.uk/~vgg/research/gcd","url_abs":"https://arxiv.org/abs/2201.02609v2","url_pdf":"https://arxiv.org/pdf/2201.02609v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"generalized-category-discovery","repo_url":"https://github.com/sgvaze/generalized-category-discovery","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"fine-grained-visual-recognition","task_name":"Fine-Grained Visual Recognition"},{"task_slug":"open-world-semi-supervised-learning","task_name":"Open-World Semi-Supervised Learning"},{"task_slug":"representation-learning","task_name":"Representation Learning"}],"methods":[],"datasets_introduced":[{"slug":"imagenet-100-gcd-split","name":"ImageNet-100 (GCD split)","full_name":""}],"methods_introduced":[],"results":[{"leaderboard":"/sota/open-world-semi-supervised-learning-on-cifar","task":"Open-World Semi-Supervised Learning","dataset":"CIFAR-10","model":"GCD (ViT-B-16)","rank_in_archive_order":5,"of":5,"metrics":{"All accuracy (50% Labeled)":"91.5","Novel accuracy (50% Labeled)":"88.2","Seen accuracy (50% Labeled)":"97.9"},"uses_additional_data":false},{"leaderboard":"/sota/open-world-semi-supervised-learning-on-1","task":"Open-World Semi-Supervised Learning","dataset":"ImageNet-100 (TEMI Split)","model":"GCD (ViT-B-16)","rank_in_archive_order":4,"of":5,"metrics":{"All accuracy (50% Labeled)":"74.1","Novel accuracy (50% Labeled)":"66.3","Seen accuracy (50% Labeled)":"89.8"},"uses_additional_data":false}],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2201.02609","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2201.02609"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/sgvaze/generalized-category-discovery","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_fixture":1,"ran":4,"unverified":6},"by_repo_kind":{"official":{"samples":11,"ran":5,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"55120f2026b56aa2","entry":"drop_path","repo":"sgvaze/generalized-category-discovery","repo_kind":"official","path":"models/vision_transformer.py","file_url":"https://github.com/sgvaze/generalized-category-discovery/blob/HEAD/models/vision_transformer.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"55120f2026b56aa2"}},{"code_sha256_prefix":"15d2b95b53f6db9a","entry":"evaluate_clustering","repo":"sgvaze/generalized-category-discovery","repo_kind":"official","path":"project_utils/cluster_utils.py","file_url":"https://github.com/sgvaze/generalized-category-discovery/blob/HEAD/project_utils/cluster_utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"15d2b95b53f6db9a"}},{"code_sha256_prefix":"1645ca2fb55ce1f8","entry":"purity_score","repo":"sgvaze/generalized-category-discovery","repo_kind":"official","path":"project_utils/cluster_utils.py","file_url":"https://github.com/sgvaze/generalized-category-discovery/blob/HEAD/project_utils/cluster_utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1645ca2fb55ce1f8"}},{"code_sha256_prefix":"bc2c748ee9fffddf","entry":"strip_state_dict","repo":"sgvaze/generalized-category-discovery","repo_kind":"official","path":"project_utils/general_utils.py","file_url":"https://github.com/sgvaze/generalized-category-discovery/blob/HEAD/project_utils/general_utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bc2c748ee9fffddf"}},{"code_sha256_prefix":"443a6ab0aca3d0e3","entry":"transform_moco_state_dict","repo":"sgvaze/generalized-category-discovery","repo_kind":"official","path":"project_utils/general_utils.py","file_url":"https://github.com/sgvaze/generalized-category-discovery/blob/HEAD/project_utils/general_utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"443a6ab0aca3d0e3"}},{"code_sha256_prefix":"569a0b5d2369b072","entry":"cluster_acc","repo":"sgvaze/generalized-category-discovery","repo_kind":"official","path":"project_utils/cluster_utils.py","file_url":"https://github.com/sgvaze/generalized-category-discovery/blob/HEAD/project_utils/cluster_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"569a0b5d2369b072"}},{"code_sha256_prefix":"aacf96bb3684f3d0","entry":"get_dino_head_weights","repo":"sgvaze/generalized-category-discovery","repo_kind":"official","path":"project_utils/general_utils.py","file_url":"https://github.com/sgvaze/generalized-category-discovery/blob/HEAD/project_utils/general_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"aacf96bb3684f3d0"}},{"code_sha256_prefix":"77f9f4c0ee87724e","entry":"info_nce_logits","repo":"sgvaze/generalized-category-discovery","repo_kind":"official","path":"methods/contrastive_training/contrastive_training.py","file_url":"https://github.com/sgvaze/generalized-category-discovery/blob/HEAD/methods/contrastive_training/contrastive_training.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"77f9f4c0ee87724e"}},{"code_sha256_prefix":"980dd2e8fa24f9da","entry":"pairwise_distance","repo":"sgvaze/generalized-category-discovery","repo_kind":"official","path":"methods/clustering/faster_mix_k_means_pytorch.py","file_url":"https://github.com/sgvaze/generalized-category-discovery/blob/HEAD/methods/clustering/faster_mix_k_means_pytorch.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"980dd2e8fa24f9da"}},{"code_sha256_prefix":"995a10f898196998","entry":"vit_small","repo":"sgvaze/generalized-category-discovery","repo_kind":"official","path":"models/vision_transformer.py","file_url":"https://github.com/sgvaze/generalized-category-discovery/blob/HEAD/models/vision_transformer.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"995a10f898196998"}},{"code_sha256_prefix":"996780ba4be89ba3","entry":"vit_tiny","repo":"sgvaze/generalized-category-discovery","repo_kind":"official","path":"models/vision_transformer.py","file_url":"https://github.com/sgvaze/generalized-category-discovery/blob/HEAD/models/vision_transformer.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"996780ba4be89ba3"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}