{"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/tdan-top-down-attention-networks-for-enhanced","title":"TDAM: Top-Down Attention Module for Contextually Guided Feature Selection in CNNs","arxiv_id":"2111.13470","date":"2021-11-26","proceeding":null,"authors":["Shantanu Jaiswal","Basura Fernando","Cheston Tan"],"abstract":"Attention modules for Convolutional Neural Networks (CNNs) are an effective method to enhance performance on multiple computer-vision tasks. While existing methods appropriately model channel-, spatial- and self-attention, they primarily operate in a feedforward bottom-up manner. Consequently, the attention mechanism strongly depends on the local information of a single input feature map and does not incorporate relatively semantically-richer contextual information available at higher layers that can specify \"what and where to look\" in lower-level feature maps through top-down information flow. Accordingly, in this work, we propose a lightweight top-down attention module (TDAM) that iteratively generates a \"visual searchlight\" to perform channel and spatial modulation of its inputs and outputs more contextually-relevant feature maps at each computation step. Our experiments indicate that TDAM enhances the performance of CNNs across multiple object-recognition benchmarks and outperforms prominent attention modules while being more parameter and memory efficient. Further, TDAM-based models learn to \"shift attention\" by localizing individual objects or features at each computation step without any explicit supervision resulting in a 5% improvement for ResNet50 on weakly-supervised object localization. Source code and models are publicly available at: https://github.com/shantanuj/TDAM_Top_down_attention_module .","url_abs":"https://arxiv.org/abs/2111.13470v3","url_pdf":"https://arxiv.org/pdf/2111.13470v3.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":"tdan-top-down-attention-networks-for-enhanced","repo_url":"https://github.com/shantanuj/tdam_top_down_attention_module","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"multi-label-classification","task_name":"Multi-Label Classification"},{"task_slug":"object-localization","task_name":"Object Localization"},{"task_slug":"object-recognition","task_name":"Object Recognition"},{"task_slug":"weakly-supervised-object-localization","task_name":"Weakly-Supervised Object Localization"},{"task_slug":"feature-selection","task_name":"feature selection"}],"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":"convolution","method_name":"Convolution"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"max-pooling","method_name":"Max Pooling"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"sigmoid-activation","method_name":"Sigmoid Activation"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2111.13470","atlas_url":"https://app.syntology.ai/?focus=2111.13470","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2111.13470"}},"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/shantanuj/tdam_top_down_attention_module","reach":null}],"summary":{"ran_fixture":1,"ran_draft_wrong":1,"unverified":1},"by_repo_kind":{"official":{"samples":3,"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":"e58d1346e0148935","entry":"accuracy","repo":"shantanuj/tdam_top_down_attention_module","repo_kind":"official","path":"training_and_usage_scripts/custom_utils.py","file_url":"https://github.com/shantanuj/tdam_top_down_attention_module/blob/HEAD/training_and_usage_scripts/custom_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e58d1346e0148935"}},{"code_sha256_prefix":"443fc146ae802f4d","entry":"get_sorted_max_over_t","repo":"shantanuj/tdam_top_down_attention_module","repo_kind":"official","path":"training_and_usage_scripts/custom_utils.py","file_url":"https://github.com/shantanuj/tdam_top_down_attention_module/blob/HEAD/training_and_usage_scripts/custom_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"443fc146ae802f4d"}},{"code_sha256_prefix":"8166275d7eed870a","entry":"average_checkpoints","repo":"shantanuj/tdam_top_down_attention_module","repo_kind":"official","path":"training_and_usage_scripts/custom_utils.py","file_url":"https://github.com/shantanuj/tdam_top_down_attention_module/blob/HEAD/training_and_usage_scripts/custom_utils.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":"8166275d7eed870a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}