{"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/ml-decoder-scalable-and-versatile","title":"ML-Decoder: Scalable and Versatile Classification Head","arxiv_id":"2111.12933","date":"2021-11-25","proceeding":null,"authors":["Tal Ridnik","Gilad Sharir","Avi Ben-Cohen","Emanuel Ben-Baruch","Asaf Noy"],"abstract":"In this paper, we introduce ML-Decoder, a new attention-based classification head. ML-Decoder predicts the existence of class labels via queries, and enables better utilization of spatial data compared to global average pooling. By redesigning the decoder architecture, and using a novel group-decoding scheme, ML-Decoder is highly efficient, and can scale well to thousands of classes. Compared to using a larger backbone, ML-Decoder consistently provides a better speed-accuracy trade-off. ML-Decoder is also versatile - it can be used as a drop-in replacement for various classification heads, and generalize to unseen classes when operated with word queries. Novel query augmentations further improve its generalization ability. Using ML-Decoder, we achieve state-of-the-art results on several classification tasks: on MS-COCO multi-label, we reach 91.4% mAP; on NUS-WIDE zero-shot, we reach 31.1% ZSL mAP; and on ImageNet single-label, we reach with vanilla ResNet50 backbone a new top score of 80.7%, without extra data or distillation. Public code is available at: https://github.com/Alibaba-MIIL/ML_Decoder","url_abs":"https://arxiv.org/abs/2111.12933v2","url_pdf":"https://arxiv.org/pdf/2111.12933v2.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":"ml-decoder-scalable-and-versatile","repo_url":"https://github.com/alibaba-miil/ml_decoder","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"classification-1","task_name":"Classification"},{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":"fine-grained-image-classification","task_name":"Fine-Grained Image Classification"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"multi-label-classification","task_name":"Multi-Label Classification"},{"task_slug":"multi-label-zero-shot-learning","task_name":"Multi-label zero-shot learning"},{"task_slug":"zero-shot-learning","task_name":"Zero-Shot Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/fine-grained-image-classification-on-stanford","task":"Fine-Grained Image Classification","dataset":"Stanford Cars","model":"TResNet-L + ML-Decoder","rank_in_archive_order":4,"of":83,"metrics":{"Accuracy":"96.41%"},"uses_additional_data":true},{"leaderboard":"/sota/image-classification-on-cifar-100","task":"Image Classification","dataset":"CIFAR-100","model":"Swin-L + ML-Decoder","rank_in_archive_order":2,"of":211,"metrics":{"Percentage correct":"95.1"},"uses_additional_data":true},{"leaderboard":"/sota/multi-label-classification-on-ms-coco","task":"Multi-Label Classification","dataset":"MS-COCO","model":"ML-Decoder(TResNet-XL, resolution 640)","rank_in_archive_order":4,"of":34,"metrics":{"mAP":"91.4"},"uses_additional_data":false},{"leaderboard":"/sota/multi-label-classification-on-ms-coco","task":"Multi-Label Classification","dataset":"MS-COCO","model":"ML-Decoder(TResNet-L, resolution 640)","rank_in_archive_order":7,"of":34,"metrics":{"mAP":"91.1"},"uses_additional_data":false},{"leaderboard":"/sota/multi-label-classification-on-openimages-v6","task":"Multi-Label Classification","dataset":"OpenImages-v6","model":"TResNet-M","rank_in_archive_order":2,"of":4,"metrics":{"mAP":"86.8"},"uses_additional_data":false},{"leaderboard":"/sota/multi-label-zero-shot-learning-on-nus-wide","task":"Multi-label zero-shot learning","dataset":"NUS-WIDE","model":"ML-Decoder","rank_in_archive_order":5,"of":10,"metrics":{"mAP":"31.1"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2111.12933","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2111.12933"}},"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/alibaba-miil/ml_decoder","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_fixture":1,"ran_draft_wrong":1,"unverified":3},"by_repo_kind":{"official":{"samples":5,"ran":2,"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":"f52b226226096fdd","entry":"average_precision","repo":"alibaba-miil/ml_decoder","repo_kind":"official","path":"src_files/helper_functions/helper_functions.py","file_url":"https://github.com/alibaba-miil/ml_decoder/blob/HEAD/src_files/helper_functions/helper_functions.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f52b226226096fdd"}},{"code_sha256_prefix":"ad1cabd96edaffc7","entry":"conv2d","repo":"alibaba-miil/ml_decoder","repo_kind":"official","path":"src_files/models/tresnet/tresnet.py","file_url":"https://github.com/alibaba-miil/ml_decoder/blob/HEAD/src_files/models/tresnet/tresnet.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ad1cabd96edaffc7"}},{"code_sha256_prefix":"54592dfdb8ffa941","entry":"create_model","repo":"alibaba-miil/ml_decoder","repo_kind":"official","path":"src_files/models/utils/factory.py","file_url":"https://github.com/alibaba-miil/ml_decoder/blob/HEAD/src_files/models/utils/factory.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":"54592dfdb8ffa941"}},{"code_sha256_prefix":"0759c5625039d127","entry":"mAP","repo":"alibaba-miil/ml_decoder","repo_kind":"official","path":"src_files/helper_functions/helper_functions.py","file_url":"https://github.com/alibaba-miil/ml_decoder/blob/HEAD/src_files/helper_functions/helper_functions.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":"0759c5625039d127"}},{"code_sha256_prefix":"14016c70fb929ac2","entry":"parse_args","repo":"alibaba-miil/ml_decoder","repo_kind":"official","path":"src_files/helper_functions/helper_functions.py","file_url":"https://github.com/alibaba-miil/ml_decoder/blob/HEAD/src_files/helper_functions/helper_functions.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":"14016c70fb929ac2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}