{"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/unicom-universal-and-compact-representation","title":"Unicom: Universal and Compact Representation Learning for Image Retrieval","arxiv_id":"2304.05884","date":"2023-04-12","proceeding":null,"authors":["Xiang An","Jiankang Deng","Kaicheng Yang","Jaiwei Li","Ziyong Feng","Jia Guo","Jing Yang","Tongliang Liu"],"abstract":"Modern image retrieval methods typically rely on fine-tuning pre-trained encoders to extract image-level descriptors. However, the most widely used models are pre-trained on ImageNet-1K with limited classes. The pre-trained feature representation is therefore not universal enough to generalize well to the diverse open-world classes. In this paper, we first cluster the large-scale LAION400M into one million pseudo classes based on the joint textual and visual features extracted by the CLIP model. Due to the confusion of label granularity, the automatically clustered dataset inevitably contains heavy inter-class conflict. To alleviate such conflict, we randomly select partial inter-class prototypes to construct the margin-based softmax loss. To further enhance the low-dimensional feature representation, we randomly select partial feature dimensions when calculating the similarities between embeddings and class-wise prototypes. The dual random partial selections are with respect to the class dimension and the feature dimension of the prototype matrix, making the classification conflict-robust and the feature embedding compact. Our method significantly outperforms state-of-the-art unsupervised and supervised image retrieval approaches on multiple benchmarks. The code and pre-trained models are released to facilitate future research https://github.com/deepglint/unicom.","url_abs":"https://arxiv.org/abs/2304.05884v1","url_pdf":"https://arxiv.org/pdf/2304.05884v1.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":"unicom-universal-and-compact-representation","repo_url":"https://github.com/deepglint/unicom","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"unicom-universal-and-compact-representation","repo_url":"https://github.com/OML-Team/open-metric-learning","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"unicom-universal-and-compact-representation","repo_url":"https://github.com/RocketFlash/easy_metric_learning/tree/master/tools","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"image-retrieval","task_name":"Image Retrieval"},{"task_slug":"metric-learning","task_name":"Metric Learning"},{"task_slug":"representation-learning","task_name":"Representation Learning"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"self-supervised-image-classification","task_name":"Self-Supervised Image Classification"},{"task_slug":"supervised-image-retrieval","task_name":"Supervised Image Retrieval"}],"methods":[{"method_slug":"clip","method_name":"CLIP"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/image-classification-on-imagenet","task":"Image Classification","dataset":"ImageNet","model":"Unicom (ViT-L/14@336px) (Finetuned)","rank_in_archive_order":54,"of":1060,"metrics":{"Top 1 Accuracy":"88.3"},"uses_additional_data":false},{"leaderboard":"/sota/image-retrieval-on-google-landmarks-dataset","task":"Image Retrieval","dataset":"Google Landmarks Dataset v2 (retrieval, testing)","model":"UNICOM-ViT-L-14-512px","rank_in_archive_order":2,"of":4,"metrics":{"mAP@100":"36.4"},"uses_additional_data":false},{"leaderboard":"/sota/image-retrieval-on-google-landmarks-dataset","task":"Image Retrieval","dataset":"Google Landmarks Dataset v2 (retrieval, testing)","model":"UNICOM-ViT-B-16-512px","rank_in_archive_order":3,"of":4,"metrics":{"mAP@100":"35.7"},"uses_additional_data":false},{"leaderboard":"/sota/image-retrieval-on-google-landmarks-dataset-1","task":"Image Retrieval","dataset":"Google Landmarks Dataset v2 (retrieval, validation)","model":"UNICOM-ViT-L-14-512px","rank_in_archive_order":1,"of":3,"metrics":{"mAP@100":"33.1"},"uses_additional_data":false},{"leaderboard":"/sota/image-retrieval-on-google-landmarks-dataset-1","task":"Image Retrieval","dataset":"Google Landmarks Dataset v2 (retrieval, validation)","model":"UNICOM-ViT-B-16-512px","rank_in_archive_order":2,"of":3,"metrics":{"mAP@100":"32.4"},"uses_additional_data":false},{"leaderboard":"/sota/image-retrieval-on-sop","task":"Image Retrieval","dataset":"SOP","model":"Unicom+ViT-L@336px","rank_in_archive_order":1,"of":14,"metrics":{"R@1":"91.2"},"uses_additional_data":true},{"leaderboard":"/sota/image-retrieval-on-inaturalist","task":"Image Retrieval","dataset":"iNaturalist","model":"Unicom+ViT-L@336px","rank_in_archive_order":1,"of":10,"metrics":{"R@1":"88.9"},"uses_additional_data":true},{"leaderboard":"/sota/metric-learning-on-cars196","task":"Metric Learning","dataset":"CARS196","model":"Unicom+ViT-L@336px","rank_in_archive_order":1,"of":36,"metrics":{"R@1":"98.2"},"uses_additional_data":true},{"leaderboard":"/sota/metric-learning-on-cub-200-2011","task":"Metric Learning","dataset":"CUB-200-2011","model":"Unicom+ViT-L@336px","rank_in_archive_order":1,"of":30,"metrics":{"R@1":"90.1"},"uses_additional_data":true},{"leaderboard":"/sota/metric-learning-on-in-shop-1","task":"Metric Learning","dataset":"In-Shop","model":"Unicom+ViT-L@336px","rank_in_archive_order":1,"of":15,"metrics":{"R@1":"96.7"},"uses_additional_data":true},{"leaderboard":"/sota/metric-learning-on-stanford-online-products-1","task":"Metric Learning","dataset":"Stanford Online Products","model":"Unicom+ViT-L@336px","rank_in_archive_order":1,"of":33,"metrics":{"R@1":"91.2"},"uses_additional_data":true},{"leaderboard":"/sota/self-supervised-image-classification-on","task":"Self-Supervised Image Classification","dataset":"ImageNet","model":"Unicom (ViT-B/16)","rank_in_archive_order":38,"of":144,"metrics":{"Number of Params":"80M","Top 1 Accuracy":"79.1%"},"uses_additional_data":true},{"leaderboard":"/sota/self-supervised-image-classification-on","task":"Self-Supervised Image Classification","dataset":"ImageNet","model":"Unicom (ViT-B/32)","rank_in_archive_order":78,"of":144,"metrics":{"Number of Params":"80M","Top 1 Accuracy":"75.0%"},"uses_additional_data":true}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2304.05884","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2304.05884"}},"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/OML-Team/open-metric-learning","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/RocketFlash/easy_metric_learning/tree/master/tools","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/deepglint/unicom","reach":null}],"summary":{"ran_violates":1,"ran_draft_wrong":1,"ran_fixture":1,"unverified":3},"by_repo_kind":{},"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":6,"samples":[{"code_sha256_prefix":"7bff6f3b3cb560e7","entry":"convert_to_custom_text_state_dict","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"7bff6f3b3cb560e7"}},{"code_sha256_prefix":"dcd422d66b0581d8","entry":"get_cast_dtype","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"dcd422d66b0581d8"}},{"code_sha256_prefix":"10893c4608c08075","entry":"split_to_even_chunks","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"10893c4608c08075"}},{"code_sha256_prefix":"275eb8fe6104bf3a","entry":"build_model_from_openai_state_dict","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"275eb8fe6104bf3a"}},{"code_sha256_prefix":"bb35e3ac741bb2c9","entry":"get_mm_adapter_state_maybe_zero_3","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"bb35e3ac741bb2c9"}},{"code_sha256_prefix":"735025744c1ab0cf","entry":"maybe_zero_3","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"735025744c1ab0cf"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}