{"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/weakly-supervised-contrastive-learning-1","title":"Weakly Supervised Contrastive Learning","arxiv_id":"2110.04770","date":"2021-10-10","proceeding":"ICCV 2021 10","authors":["Mingkai Zheng","Fei Wang","Shan You","Chen Qian","ChangShui Zhang","Xiaogang Wang","Chang Xu"],"abstract":"Unsupervised visual representation learning has gained much attention from the computer vision community because of the recent achievement of contrastive learning. Most of the existing contrastive learning frameworks adopt the instance discrimination as the pretext task, which treating every single instance as a different class. However, such method will inevitably cause class collision problems, which hurts the quality of the learned representation. Motivated by this observation, we introduced a weakly supervised contrastive learning framework (WCL) to tackle this issue. Specifically, our proposed framework is based on two projection heads, one of which will perform the regular instance discrimination task. The other head will use a graph-based method to explore similar samples and generate a weak label, then perform a supervised contrastive learning task based on the weak label to pull the similar images closer. We further introduced a K-Nearest Neighbor based multi-crop strategy to expand the number of positive samples. Extensive experimental results demonstrate WCL improves the quality of self-supervised representations across different datasets. Notably, we get a new state-of-the-art result for semi-supervised learning. With only 1\\% and 10\\% labeled examples, WCL achieves 65\\% and 72\\% ImageNet Top-1 Accuracy using ResNet50, which is even higher than SimCLRv2 with ResNet101.","url_abs":"https://arxiv.org/abs/2110.04770v1","url_pdf":"https://arxiv.org/pdf/2110.04770v1.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":"weakly-supervised-contrastive-learning-1","repo_url":"https://github.com/KyleZheng1997/WCL","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"representation-learning","task_name":"Representation Learning"},{"task_slug":"self-supervised-image-classification","task_name":"Self-Supervised Image Classification"},{"task_slug":"semi-supervised-image-classification","task_name":"Semi-Supervised Image Classification"}],"methods":[{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"},{"method_slug":"simclrv2","method_name":"SimCLRv2"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/self-supervised-image-classification-on","task":"Self-Supervised Image Classification","dataset":"ImageNet","model":"WCL (ResNet-50)","rank_in_archive_order":82,"of":144,"metrics":{"Number of Params":"24M","Top 1 Accuracy":"74.7%"},"uses_additional_data":false},{"leaderboard":"/sota/semi-supervised-image-classification-on-1","task":"Semi-Supervised Image Classification","dataset":"ImageNet - 1% labeled data","model":"WCL (ResNet-50)","rank_in_archive_order":31,"of":65,"metrics":{"Top 1 Accuracy":"65.0%","Top 5 Accuracy":"86.3%"},"uses_additional_data":false},{"leaderboard":"/sota/semi-supervised-image-classification-on-2","task":"Semi-Supervised Image Classification","dataset":"ImageNet - 10% labeled data","model":"WCL (ResNet-50)","rank_in_archive_order":39,"of":75,"metrics":{"Top 1 Accuracy":"72.0%","Top 5 Accuracy":"91.2%"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2110.04770","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2110.04770"}},"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/KyleZheng1997/WCL","reach":null}],"summary":{"unverified":3},"by_repo_kind":{"official":{"samples":3,"ran":0,"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":3,"samples":[{"code_sha256_prefix":"73093b0f920cd6cd","entry":"WCL","repo":"KyleZheng1997/WCL","repo_kind":"official","path":"network/wcl.py","file_url":"https://github.com/KyleZheng1997/WCL/blob/HEAD/network/wcl.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"73093b0f920cd6cd"}},{"code_sha256_prefix":"8b8c4d6834df2cd4","entry":"concat_all_gather","repo":"KyleZheng1997/WCL","repo_kind":"official","path":"network/wcl.py","file_url":"https://github.com/KyleZheng1997/WCL/blob/HEAD/network/wcl.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8b8c4d6834df2cd4"}},{"code_sha256_prefix":"8322dc62874c8c98","entry":"concat_other_gather","repo":"KyleZheng1997/WCL","repo_kind":"official","path":"network/wcl.py","file_url":"https://github.com/KyleZheng1997/WCL/blob/HEAD/network/wcl.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8322dc62874c8c98"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}