{"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/cmt-convolutional-neural-networks-meet-vision","title":"CMT: Convolutional Neural Networks Meet Vision Transformers","arxiv_id":"2107.06263","date":"2021-07-13","proceeding":"CVPR 2022 1","authors":["Jianyuan Guo","Kai Han","Han Wu","Yehui Tang","Xinghao Chen","Yunhe Wang","Chang Xu"],"abstract":"Vision transformers have been successfully applied to image recognition tasks due to their ability to capture long-range dependencies within an image. However, there are still gaps in both performance and computational cost between transformers and existing convolutional neural networks (CNNs). In this paper, we aim to address this issue and develop a network that can outperform not only the canonical transformers, but also the high-performance convolutional models. We propose a new transformer based hybrid network by taking advantage of transformers to capture long-range dependencies, and of CNNs to model local features. Furthermore, we scale it to obtain a family of models, called CMTs, obtaining much better accuracy and efficiency than previous convolution and transformer based models. In particular, our CMT-S achieves 83.5% top-1 accuracy on ImageNet, while being 14x and 2x smaller on FLOPs than the existing DeiT and EfficientNet, respectively. The proposed CMT-S also generalizes well on CIFAR10 (99.2%), CIFAR100 (91.7%), Flowers (98.7%), and other challenging vision datasets such as COCO (44.3% mAP), with considerably less computational cost.","url_abs":"https://arxiv.org/abs/2107.06263v3","url_pdf":"https://arxiv.org/pdf/2107.06263v3.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":"cmt-convolutional-neural-networks-meet-vision","repo_url":"https://github.com/ggjy/cmt.pytorch","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"cmt-convolutional-neural-networks-meet-vision","repo_url":"https://github.com/FlyEgle/CMT-pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"cmt-convolutional-neural-networks-meet-vision","repo_url":"https://github.com/LKLQQ/CMT","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"mindspore","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"cmt-convolutional-neural-networks-meet-vision","repo_url":"https://github.com/Nanxiaohu666/CMT","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"cmt-convolutional-neural-networks-meet-vision","repo_url":"https://github.com/OmarAlsaqa/CMT-Convolutional-Neural-Networks-Meet-Vision-Transformers","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"cmt-convolutional-neural-networks-meet-vision","repo_url":"https://github.com/fogfog2/packnet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"cmt-convolutional-neural-networks-meet-vision","repo_url":"https://github.com/robin-ex/CMT","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"mindspore","reach":{"status":"ok"}},{"paper_slug":"cmt-convolutional-neural-networks-meet-vision","repo_url":"https://github.com/wilile26811249/CMT_CNN-meet-Vision-Transformer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"cmt-convolutional-neural-networks-meet-vision","repo_url":"https://github.com/yangyucheng000/CMT","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"mindspore","reach":null},{"paper_slug":"cmt-convolutional-neural-networks-meet-vision","repo_url":"https://github.com/yuranusduke/CMT-Convolutional-NN-Meets-ViT","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"cmt-convolutional-neural-networks-meet-vision","repo_url":"https://github.com/2023-MindSpore-4/Code8/tree/main/CMT","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"cmt-convolutional-neural-networks-meet-vision","repo_url":"https://github.com/MindSpore-paper-code-3/code6/tree/main/CMT","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"cmt-convolutional-neural-networks-meet-vision","repo_url":"https://github.com/leondgarse/keras_cv_attention_models/tree/main/keras_cv_attention_models/cmt","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"tf","reach":null},{"paper_slug":"cmt-convolutional-neural-networks-meet-vision","repo_url":"https://github.com/mindspore-courses/External-Attention-MindSpore/blob/main/model/backbone/CMT.py","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null}],"tasks":[],"methods":[{"method_slug":"1x1-convolution","method_name":"1x1 Convolution"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"average-pooling","method_name":"Average Pooling"},{"method_slug":"batch-normalization","method_name":"Batch Normalization"},{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"deit","method_name":"DeiT"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"depthwise-convolution","method_name":"Depthwise Convolution"},{"method_slug":"depthwise-separable-convolution","method_name":"Depthwise Separable Convolution"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"feedforward-network","method_name":"Feedforward Network"},{"method_slug":"inverted-residual-block","method_name":"Inverted Residual Block"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"pointwise-convolution","method_name":"Pointwise Convolution"},{"method_slug":"rmsprop","method_name":"RMSProp"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"sigmoid-activation","method_name":"Sigmoid Activation"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"squeeze-and-excitation-block","method_name":"Squeeze-and-Excitation Block"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2107.06263","atlas_url":"https://app.syntology.ai/?focus=2107.06263","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2107.06263"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/OmarAlsaqa/CMT-Convolutional-Neural-Networks-Meet-Vision-Transformers","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yangyucheng000/CMT","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/FlyEgle/CMT-pytorch","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/fogfog2/packnet","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yuranusduke/CMT-Convolutional-NN-Meets-ViT","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ggjy/cmt.pytorch","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/2023-MindSpore-4/Code8/tree/main/CMT","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/leondgarse/keras_cv_attention_models/tree/main/keras_cv_attention_models/cmt","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mindspore-courses/External-Attention-MindSpore/blob/main/model/backbone/CMT.py","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/LKLQQ/CMT","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/robin-ex/CMT","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-paper-code-3/code6/tree/main/CMT","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/wilile26811249/CMT_CNN-meet-Vision-Transformer","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Nanxiaohu666/CMT","reach":{"status":"ok"}}],"summary":{"ran_honours":2,"ran_fixture":1,"ran_violates":1,"unverified":5},"by_repo_kind":{"listed":{"samples":9,"ran":4,"repositories":4}},"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":"cb13a24e12e26db6","entry":"acc_top_n","repo":"FlyEgle/CMT-pytorch","repo_kind":"listed","path":"utils/calculate_acc.py","file_url":"https://github.com/FlyEgle/CMT-pytorch/blob/HEAD/utils/calculate_acc.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cb13a24e12e26db6"}},{"code_sha256_prefix":"ad55f49e9589b232","entry":"argmax","repo":"FlyEgle/CMT-pytorch","repo_kind":"listed","path":"utils/calculate_acc.py","file_url":"https://github.com/FlyEgle/CMT-pytorch/blob/HEAD/utils/calculate_acc.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ad55f49e9589b232"}},{"code_sha256_prefix":"fab5a21985473f72","entry":"parse_file","repo":"FlyEgle/CMT-pytorch","repo_kind":"listed","path":"utils/calculate_acc.py","file_url":"https://github.com/FlyEgle/CMT-pytorch/blob/HEAD/utils/calculate_acc.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fab5a21985473f72"}},{"code_sha256_prefix":"cf1c4151f4a77fec","entry":"to_2tuple","repo":"yangyucheng000/CMT","repo_kind":"listed","path":"src/cmt.py","file_url":"https://github.com/yangyucheng000/CMT/blob/HEAD/src/cmt.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"cf1c4151f4a77fec"}},{"code_sha256_prefix":"8f1240e9d0f3c80c","entry":"CMT_S","repo":"wilile26811249/CMT_CNN-meet-Vision-Transformer","repo_kind":"listed","path":"model/CMT.py","file_url":"https://github.com/wilile26811249/CMT_CNN-meet-Vision-Transformer/blob/HEAD/model/CMT.py","link_basis":"first_harvest_node","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":"8f1240e9d0f3c80c"}},{"code_sha256_prefix":"035e245b6e0d706d","entry":"CMT_Ti","repo":"wilile26811249/CMT_CNN-meet-Vision-Transformer","repo_kind":"listed","path":"model/CMT.py","file_url":"https://github.com/wilile26811249/CMT_CNN-meet-Vision-Transformer/blob/HEAD/model/CMT.py","link_basis":"first_harvest_node","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":"035e245b6e0d706d"}},{"code_sha256_prefix":"29efdfae78e7a9d8","entry":"CMT_XS","repo":"wilile26811249/CMT_CNN-meet-Vision-Transformer","repo_kind":"listed","path":"model/CMT.py","file_url":"https://github.com/wilile26811249/CMT_CNN-meet-Vision-Transformer/blob/HEAD/model/CMT.py","link_basis":"first_harvest_node","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":"29efdfae78e7a9d8"}},{"code_sha256_prefix":"ef3c65205cb58763","entry":"get_cifar","repo":"yuranusduke/CMT-Convolutional-NN-Meets-ViT","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/yuranusduke/CMT-Convolutional-NN-Meets-ViT/blob/HEAD/utils.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":"ef3c65205cb58763"}},{"code_sha256_prefix":"7c651ebc57e4167c","entry":"get_data_loader","repo":"yuranusduke/CMT-Convolutional-NN-Meets-ViT","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/yuranusduke/CMT-Convolutional-NN-Meets-ViT/blob/HEAD/utils.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":"7c651ebc57e4167c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}