{"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/unsupervised-visual-representation-learning-3","title":"Unsupervised Visual Representation Learning by Online Constrained K-Means","arxiv_id":"2105.11527","date":"2021-05-24","proceeding":"CVPR 2022 1","authors":["Qi Qian","Yuanhong Xu","Juhua Hu","Hao Li","Rong Jin"],"abstract":"Cluster discrimination is an effective pretext task for unsupervised representation learning, which often consists of two phases: clustering and discrimination. Clustering is to assign each instance a pseudo label that will be used to learn representations in discrimination. The main challenge resides in clustering since prevalent clustering methods (e.g., k-means) have to run in a batch mode. Besides, there can be a trivial solution consisting of a dominating cluster. To address these challenges, we first investigate the objective of clustering-based representation learning. Based on this, we propose a novel clustering-based pretext task with online \\textbf{Co}nstrained \\textbf{K}-m\\textbf{e}ans (\\textbf{CoKe}). Compared with the balanced clustering that each cluster has exactly the same size, we only constrain the minimal size of each cluster to flexibly capture the inherent data structure. More importantly, our online assignment method has a theoretical guarantee to approach the global optimum. By decoupling clustering and discrimination, CoKe can achieve competitive performance when optimizing with only a single view from each instance. Extensive experiments on ImageNet and other benchmark data sets verify both the efficacy and efficiency of our proposal. Code is available at \\url{https://github.com/idstcv/CoKe}.","url_abs":"https://arxiv.org/abs/2105.11527v3","url_pdf":"https://arxiv.org/pdf/2105.11527v3.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":"unsupervised-visual-representation-learning-3","repo_url":"https://github.com/idstcv/coke","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"clustering","task_name":"Clustering"},{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"image-clustering","task_name":"Image Clustering"},{"task_slug":"metric-learning","task_name":"Metric Learning"},{"task_slug":"online-clustering","task_name":"Online Clustering"},{"task_slug":"pseudo-label","task_name":"Pseudo Label"},{"task_slug":"representation-learning","task_name":"Representation Learning"},{"task_slug":"self-supervised-image-classification","task_name":"Self-Supervised Image Classification"},{"task_slug":"unsupervised-image-classification","task_name":"Unsupervised Image Classification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/image-clustering-on-cifar-10","task":"Image Clustering","dataset":"CIFAR-10","model":"CoKe","rank_in_archive_order":20,"of":40,"metrics":{"ARI":"0.732","Accuracy":"0.857","Backbone":"ResNet-18","NMI":"0.766","Train set":"Train"},"uses_additional_data":false},{"leaderboard":"/sota/self-supervised-image-classification-on","task":"Self-Supervised Image Classification","dataset":"ImageNet","model":"CoKe (ResNet-50)","rank_in_archive_order":61,"of":144,"metrics":{"Number of Params":"25M","Top 1 Accuracy":"76.4%"},"uses_additional_data":false},{"leaderboard":"/sota/unsupervised-image-classification-on-cifar-10","task":"Unsupervised Image Classification","dataset":"CIFAR-10","model":"CoKe","rank_in_archive_order":6,"of":9,"metrics":{"Accuracy":"85.7"},"uses_additional_data":false},{"leaderboard":"/sota/unsupervised-image-classification-on-cifar-20","task":"Unsupervised Image Classification","dataset":"CIFAR-20","model":"CoKe","rank_in_archive_order":12,"of":14,"metrics":{"Accuracy":"49.7"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2105.11527","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2105.11527"}},"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/idstcv/coke","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_fixture":1,"ran_violates":1,"ran_honours":1,"unverified":3},"by_repo_kind":{"official":{"samples":6,"ran":3,"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":"131a82fd65128218","entry":"accuracy","repo":"idstcv/coke","repo_kind":"official","path":"eval_lincls.py","file_url":"https://github.com/idstcv/coke/blob/HEAD/eval_lincls.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"131a82fd65128218"}},{"code_sha256_prefix":"c556c4f841693abe","entry":"has_file_allowed_extension","repo":"idstcv/coke","repo_kind":"official","path":"coke/folder.py","file_url":"https://github.com/idstcv/coke/blob/HEAD/coke/folder.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c556c4f841693abe"}},{"code_sha256_prefix":"5c22680084c0ea6f","entry":"validate","repo":"idstcv/coke","repo_kind":"official","path":"eval_lincls.py","file_url":"https://github.com/idstcv/coke/blob/HEAD/eval_lincls.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5c22680084c0ea6f"}},{"code_sha256_prefix":"73cecca9f3575f09","entry":"concat_all_gather","repo":"idstcv/coke","repo_kind":"official","path":"coke/builder_double_view.py","file_url":"https://github.com/idstcv/coke/blob/HEAD/coke/builder_double_view.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"73cecca9f3575f09"}},{"code_sha256_prefix":"10b3abf638e3b68c","entry":"is_image_file","repo":"idstcv/coke","repo_kind":"official","path":"coke/folder.py","file_url":"https://github.com/idstcv/coke/blob/HEAD/coke/folder.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"10b3abf638e3b68c"}},{"code_sha256_prefix":"b426c66097517bb9","entry":"make_dataset","repo":"idstcv/coke","repo_kind":"official","path":"coke/folder.py","file_url":"https://github.com/idstcv/coke/blob/HEAD/coke/folder.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b426c66097517bb9"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}