{"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/190409925","title":"Attention Augmented Convolutional Networks","arxiv_id":"1904.09925","date":"2019-04-22","proceeding":"ICCV 2019 10","authors":["Irwan Bello","Barret Zoph","Ashish Vaswani","Jonathon Shlens","Quoc V. Le"],"abstract":"Convolutional networks have been the paradigm of choice in many computer vision applications. The convolution operation however has a significant weakness in that it only operates on a local neighborhood, thus missing global information. Self-attention, on the other hand, has emerged as a recent advance to capture long range interactions, but has mostly been applied to sequence modeling and generative modeling tasks. In this paper, we consider the use of self-attention for discriminative visual tasks as an alternative to convolutions. We introduce a novel two-dimensional relative self-attention mechanism that proves competitive in replacing convolutions as a stand-alone computational primitive for image classification. We find in control experiments that the best results are obtained when combining both convolutions and self-attention. We therefore propose to augment convolutional operators with this self-attention mechanism by concatenating convolutional feature maps with a set of feature maps produced via self-attention. Extensive experiments show that Attention Augmentation leads to consistent improvements in image classification on ImageNet and object detection on COCO across many different models and scales, including ResNets and a state-of-the art mobile constrained network, while keeping the number of parameters similar. In particular, our method achieves a $1.3\\%$ top-1 accuracy improvement on ImageNet classification over a ResNet50 baseline and outperforms other attention mechanisms for images such as Squeeze-and-Excitation. It also achieves an improvement of 1.4 mAP in COCO Object Detection on top of a RetinaNet baseline.","url_abs":"https://arxiv.org/abs/1904.09925v5","url_pdf":"https://arxiv.org/pdf/1904.09925v5.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":"190409925","repo_url":"https://github.com/Data-drone/attention_augmented_cnn","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"190409925","repo_url":"https://github.com/JinLi711/Attention-Augmented-Convolution","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok"}},{"paper_slug":"190409925","repo_url":"https://github.com/JinLi711/Convolution_Variants","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok"}},{"paper_slug":"190409925","repo_url":"https://github.com/MaczekO/AttentionNetworkProject","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"190409925","repo_url":"https://github.com/MartinGer/Attention-Augmented-Convolutional-Networks","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"190409925","repo_url":"https://github.com/MartinGer/Bottleneck-Transformers-for-Visual-Recognition","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"190409925","repo_url":"https://github.com/gan3sh500/attention-augmented-conv","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok"}},{"paper_slug":"190409925","repo_url":"https://github.com/infinitemugen/Attention-Conv-Pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"190409925","repo_url":"https://github.com/khwajawisal/Attention-augmented-Convolutional-Neural-Networks","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok"}},{"paper_slug":"190409925","repo_url":"https://github.com/leaderj1001/Attention-Augmented-Conv2d","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"190409925","repo_url":"https://github.com/leaderj1001/Stand-Alone-Self-Attention","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"190409925","repo_url":"https://github.com/lschirmer/Attention-Augmented-Convolutional-Keras-Networks","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok"}},{"paper_slug":"190409925","repo_url":"https://github.com/sebastiani/pytorch-attention-augmented-convolution","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"190409925","repo_url":"https://github.com/titu1994/keras-attention-augmented-convs","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"classification","task_name":"General Classification"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"object-detection","task_name":"Object Detection"},{"task_slug":"image-classification","task_name":"image-classification"},{"task_slug":"object-detection-1","task_name":"object-detection"}],"methods":[{"method_slug":"1x1-convolution","method_name":"1x1 Convolution"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-augmented-convolution","method_name":"Attention-augmented 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":"convolution","method_name":"Convolution"},{"method_slug":"cosine-annealing","method_name":"Cosine Annealing"},{"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":"fpn","method_name":"FPN"},{"method_slug":"focal-loss","method_name":"Focal Loss"},{"method_slug":"global-average-pooling","method_name":"Global Average Pooling"},{"method_slug":"inverted-residual-block","method_name":"Inverted Residual Block"},{"method_slug":"kaiming-initialization","method_name":"Kaiming Initialization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"max-pooling","method_name":"Max Pooling"},{"method_slug":"mnasnet","method_name":"MnasNet"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"pointwise-convolution","method_name":"Pointwise Convolution"},{"method_slug":"randomhorizontalflip","method_name":"Random Horizontal Flip"},{"method_slug":"random-resized-crop","method_name":"Random Resized Crop"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"residual-block","method_name":"Residual Block"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"retinanet","method_name":"RetinaNet"},{"method_slug":"sgd-with-momentum","method_name":"SGD with Momentum"},{"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"},{"method_slug":"weight-decay","method_name":"Weight Decay"},{"method_slug":"wide-residual-block","method_name":"Wide Residual Block"},{"method_slug":"wideresnet","method_name":"WideResNet"}],"datasets_introduced":[],"methods_introduced":[{"slug":"attention-augmented-convolution","name":"Attention-augmented Convolution","full_name":"Attention-augmented Convolution"}],"results":[{"leaderboard":"/sota/image-classification-on-cifar-100","task":"Image Classification","dataset":"CIFAR-100","model":"AA-Wide-ResNet","rank_in_archive_order":116,"of":211,"metrics":{"Percentage correct":"81.6"},"uses_additional_data":true},{"leaderboard":"/sota/image-classification-on-imagenet","task":"Image Classification","dataset":"ImageNet","model":"AA-ResNet-152","rank_in_archive_order":776,"of":1060,"metrics":{"Top 1 Accuracy":"79.1%"},"uses_additional_data":false},{"leaderboard":"/sota/object-detection-on-coco","task":"Object Detection","dataset":"COCO test-dev","model":"AA-ResNet-10 + RetinaNet","rank_in_archive_order":206,"of":225,"metrics":{"Operations per network pass":"24.5G","box mAP":"39.2"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1904.09925","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1904.09925"}},"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/titu1994/keras-attention-augmented-convs","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MartinGer/Attention-Augmented-Convolutional-Networks","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/sebastiani/pytorch-attention-augmented-convolution","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/leaderj1001/Attention-Augmented-Conv2d","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/khwajawisal/Attention-augmented-Convolutional-Neural-Networks","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Data-drone/attention_augmented_cnn","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MartinGer/Bottleneck-Transformers-for-Visual-Recognition","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/JinLi711/Convolution_Variants","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/gan3sh500/attention-augmented-conv","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/lschirmer/Attention-Augmented-Convolutional-Keras-Networks","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/infinitemugen/Attention-Conv-Pytorch","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MaczekO/AttentionNetworkProject","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/leaderj1001/Stand-Alone-Self-Attention","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/JinLi711/Attention-Augmented-Convolution","reach":{"status":"ok"}}],"summary":{"ran_fixture":2,"ran_honours":1,"unverified":3},"by_repo_kind":{"listed":{"samples":5,"ran":3,"repositories":3}},"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":1,"samples":[{"code_sha256_prefix":"1d9d5fc614f317c3","entry":"combine_heads_2d","repo":"Data-drone/attention_augmented_cnn","repo_kind":"listed","path":"pytorch_code/self_atten_utils.py","file_url":"https://github.com/Data-drone/attention_augmented_cnn/blob/HEAD/pytorch_code/self_atten_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1d9d5fc614f317c3"}},{"code_sha256_prefix":"6478c4d903d597e7","entry":"shape_list","repo":"Data-drone/attention_augmented_cnn","repo_kind":"listed","path":"pytorch_code/self_atten_utils.py","file_url":"https://github.com/Data-drone/attention_augmented_cnn/blob/HEAD/pytorch_code/self_atten_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6478c4d903d597e7"}},{"code_sha256_prefix":"4b0f0775e4c3c5e4","entry":"split_heads_2d","repo":"Data-drone/attention_augmented_cnn","repo_kind":"listed","path":"pytorch_code/self_atten_utils.py","file_url":"https://github.com/Data-drone/attention_augmented_cnn/blob/HEAD/pytorch_code/self_atten_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4b0f0775e4c3c5e4"}},{"code_sha256_prefix":"364793b4a69b5ada","entry":"augmented_conv2d","repo":"titu1994/keras-attention-augmented-convs","repo_kind":"listed","path":"attn_augconv.py","file_url":"https://github.com/titu1994/keras-attention-augmented-convs/blob/HEAD/attn_augconv.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":"364793b4a69b5ada"}},{"code_sha256_prefix":"923798bb3c385c76","entry":"load_data","repo":"leaderj1001/Attention-Augmented-Conv2d","repo_kind":"listed","path":"AA-Wide-ResNet/preprocess.py","file_url":"https://github.com/leaderj1001/Attention-Augmented-Conv2d/blob/HEAD/AA-Wide-ResNet/preprocess.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":"923798bb3c385c76"}},{"code_sha256_prefix":"10b86d2ef7ff73c5","entry":"prepare_data","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":"10b86d2ef7ff73c5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}