{"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/semppl-predicting-pseudo-labels-for-better","title":"SemPPL: Predicting pseudo-labels for better contrastive representations","arxiv_id":"2301.05158","date":"2023-01-12","proceeding":null,"authors":["Matko Bošnjak","Pierre H. Richemond","Nenad Tomasev","Florian Strub","Jacob C. Walker","Felix Hill","Lars Holger Buesing","Razvan Pascanu","Charles Blundell","Jovana Mitrovic"],"abstract":"Learning from large amounts of unsupervised data and a small amount of supervision is an important open problem in computer vision. We propose a new semi-supervised learning method, Semantic Positives via Pseudo-Labels (SemPPL), that combines labelled and unlabelled data to learn informative representations. Our method extends self-supervised contrastive learning -- where representations are shaped by distinguishing whether two samples represent the same underlying datum (positives) or not (negatives) -- with a novel approach to selecting positives. To enrich the set of positives, we leverage the few existing ground-truth labels to predict the missing ones through a $k$-nearest neighbours classifier by using the learned embeddings of the labelled data. We thus extend the set of positives with datapoints having the same pseudo-label and call these semantic positives. We jointly learn the representation and predict bootstrapped pseudo-labels. This creates a reinforcing cycle. Strong initial representations enable better pseudo-label predictions which then improve the selection of semantic positives and lead to even better representations. SemPPL outperforms competing semi-supervised methods setting new state-of-the-art performance of $68.5\\%$ and $76\\%$ top-$1$ accuracy when using a ResNet-$50$ and training on $1\\%$ and $10\\%$ of labels on ImageNet, respectively. Furthermore, when using selective kernels, SemPPL significantly outperforms previous state-of-the-art achieving $72.3\\%$ and $78.3\\%$ top-$1$ accuracy on ImageNet with $1\\%$ and $10\\%$ labels, respectively, which improves absolute $+7.8\\%$ and $+6.2\\%$ over previous work. SemPPL also exhibits state-of-the-art performance over larger ResNet models as well as strong robustness, out-of-distribution and transfer performance. We release the checkpoints and the evaluation code at https://github.com/deepmind/semppl .","url_abs":"https://arxiv.org/abs/2301.05158v2","url_pdf":"https://arxiv.org/pdf/2301.05158v2.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":"semppl-predicting-pseudo-labels-for-better","repo_url":"https://github.com/deepmind/semppl","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"jax","reach":null},{"paper_slug":"semppl-predicting-pseudo-labels-for-better","repo_url":"https://github.com/google-deepmind/semppl","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"jax","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"pseudo-label","task_name":"Pseudo Label"}],"methods":[{"method_slug":"1x1-convolution","method_name":"1x1 Convolution"},{"method_slug":"average-pooling","method_name":"Average Pooling"},{"method_slug":"batch-normalization","method_name":"Batch Normalization"},{"method_slug":"bottleneck-residual-block","method_name":"Bottleneck Residual Block"},{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"},{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"global-average-pooling","method_name":"Global Average Pooling"},{"method_slug":"kaiming-initialization","method_name":"Kaiming Initialization"},{"method_slug":"max-pooling","method_name":"Max Pooling"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"residual-block","method_name":"Residual Block"},{"method_slug":"residual-connection","method_name":"Residual Connection"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2301.05158","atlas_url":"https://app.syntology.ai/?focus=2301.05158","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2301.05158"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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":"deterministic:regex_extraction","url":"https://github.com/deepmind/semppl","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/google-deepmind/semppl","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":12,"unverified":4},"by_repo_kind":{"official":{"samples":16,"ran":12,"repositories":2}},"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":"7cf26db115ac0335","entry":"exclude_bias_and_norm","repo":"google-deepmind/semppl","repo_kind":"official","path":"utils/optimizers.py","file_url":"https://github.com/google-deepmind/semppl/blob/HEAD/utils/optimizers.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7cf26db115ac0335"}},{"code_sha256_prefix":"56b9317b9ed66304","entry":"hsv_to_rgb","repo":"google-deepmind/semppl","repo_kind":"official","path":"utils/augmentations.py","file_url":"https://github.com/google-deepmind/semppl/blob/HEAD/utils/augmentations.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"56b9317b9ed66304"}},{"code_sha256_prefix":"8df258170fa3cb79","entry":"l2_normalize","repo":"google-deepmind/semppl","repo_kind":"official","path":"utils/helpers.py","file_url":"https://github.com/google-deepmind/semppl/blob/HEAD/utils/helpers.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8df258170fa3cb79"}},{"code_sha256_prefix":"5e9e28416e760f15","entry":"learning_schedule","repo":"google-deepmind/semppl","repo_kind":"official","path":"utils/schedules.py","file_url":"https://github.com/google-deepmind/semppl/blob/HEAD/utils/schedules.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5e9e28416e760f15"}},{"code_sha256_prefix":"5b529484c13fcd15","entry":"load_checkpoint","repo":"google-deepmind/semppl","repo_kind":"official","path":"utils/checkpointing.py","file_url":"https://github.com/google-deepmind/semppl/blob/HEAD/utils/checkpointing.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5b529484c13fcd15"}},{"code_sha256_prefix":"9299bed7da61102a","entry":"normalize_images","repo":"google-deepmind/semppl","repo_kind":"official","path":"utils/dataset.py","file_url":"https://github.com/google-deepmind/semppl/blob/HEAD/utils/dataset.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9299bed7da61102a"}},{"code_sha256_prefix":"bf9bb14716c6dab9","entry":"rgb_to_hsv","repo":"google-deepmind/semppl","repo_kind":"official","path":"utils/augmentations.py","file_url":"https://github.com/google-deepmind/semppl/blob/HEAD/utils/augmentations.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bf9bb14716c6dab9"}},{"code_sha256_prefix":"79415fc4013fff5c","entry":"scale_by_lars","repo":"google-deepmind/semppl","repo_kind":"official","path":"utils/optimizers.py","file_url":"https://github.com/google-deepmind/semppl/blob/HEAD/utils/optimizers.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"79415fc4013fff5c"}},{"code_sha256_prefix":"37ae8f08fc24a7d8","entry":"softmax_cross_entropy","repo":"google-deepmind/semppl","repo_kind":"official","path":"utils/helpers.py","file_url":"https://github.com/google-deepmind/semppl/blob/HEAD/utils/helpers.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"37ae8f08fc24a7d8"}},{"code_sha256_prefix":"8c0e47e0bfa8f06f","entry":"target_ema","repo":"google-deepmind/semppl","repo_kind":"official","path":"utils/schedules.py","file_url":"https://github.com/google-deepmind/semppl/blob/HEAD/utils/schedules.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8c0e47e0bfa8f06f"}},{"code_sha256_prefix":"73ed5cd901b2ff52","entry":"topk_accuracy","repo":"google-deepmind/semppl","repo_kind":"official","path":"utils/helpers.py","file_url":"https://github.com/google-deepmind/semppl/blob/HEAD/utils/helpers.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"73ed5cd901b2ff52"}},{"code_sha256_prefix":"301ebdfc332bbcc9","entry":"transpose_images","repo":"google-deepmind/semppl","repo_kind":"official","path":"utils/dataset.py","file_url":"https://github.com/google-deepmind/semppl/blob/HEAD/utils/dataset.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"301ebdfc332bbcc9"}},{"code_sha256_prefix":"ec03c773fc93b2dd","entry":"ResNetTorso","repo":"deepmind/semppl","repo_kind":"official","path":"utils/networks.py","file_url":"https://github.com/deepmind/semppl/blob/HEAD/utils/networks.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":"ec03c773fc93b2dd"}},{"code_sha256_prefix":"43422aa37e912a67","entry":"add_weight_decay","repo":"google-deepmind/semppl","repo_kind":"official","path":"utils/optimizers.py","file_url":"https://github.com/google-deepmind/semppl/blob/HEAD/utils/optimizers.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":"43422aa37e912a67"}},{"code_sha256_prefix":"05611d15ac79d977","entry":"check_length","repo":"deepmind/semppl","repo_kind":"official","path":"utils/networks.py","file_url":"https://github.com/deepmind/semppl/blob/HEAD/utils/networks.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":"05611d15ac79d977"}},{"code_sha256_prefix":"c14a511164946e31","entry":"postprocess","repo":"google-deepmind/semppl","repo_kind":"official","path":"utils/augmentations.py","file_url":"https://github.com/google-deepmind/semppl/blob/HEAD/utils/augmentations.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":"c14a511164946e31"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}