{"url":"/method/danet","slug":"danet","name":"DANet","full_name":"Dual Attention Network","full_name_withheld":false,"description_markdown":"In the field of scene segmentation,\r\nencoder-decoder structures cannot make use of the global relationships \r\nbetween objects, whereas RNN-based structures \r\nheavily rely on the output of the long-term memorization.\r\nTo address the above problems, \r\nFu et al. proposed a novel framework, \r\n the dual attention network (DANet), \r\nfor natural scene image segmentation. \r\nUnlike CBAM and BAM, it adopts a self-attention mechanism \r\ninstead of simply stacking convolutions to compute the spatial attention map,\r\nwhich enables the network to capture global information directly. \r\n\r\nDANet uses in parallel a position attention module and a channel attention module to capture feature dependencies in spatial and channel domains. Given the input feature map $X$, convolution layers are applied first in the position attention module to obtain new feature maps. Then the position attention module selectively aggregates the features at each position using a weighted sum of features at all positions, where the weights are determined by feature similarity between corresponding pairs of positions. The channel attention module has a similar form except for dimensional reduction to model cross-channel relations. Finally the outputs from the two branches are fused to obtain final feature representations. For simplicity, we reshape the feature map $X$ to $C\\times (H \\times W)$ whereupon the overall process can be written as \r\n\\begin{align}\r\n    Q,\\quad K,\\quad V &= W_qX,\\quad W_kX,\\quad W_vX\r\n\\end{align}\r\n\\begin{align}\r\n    Y^\\text{pos} &=  X+ V\\text{Softmax}(Q^TK)\r\n\\end{align}\r\n\\begin{align}\r\n    Y^\\text{chn} &=  X+ \\text{Softmax}(XX^T)X \r\n\\end{align}\r\n\\begin{align}\r\n    Y &= Y^\\text{pos} + Y^\\text{chn}\r\n\\end{align}\r\nwhere $W_q$, $W_k$, $W_v \\in \\mathbb{R}^{C\\times C}$ are used to generate new feature maps.   \r\n\r\nThe position attention module enables\r\nDANet to capture long-range contextual information\r\nand adaptively integrate similar features at any scale\r\nfrom a global viewpoint,\r\nwhile the channel attention module is responsible for \r\nenhancing useful channels \r\nas well as suppressing noise. \r\nTaking spatial and channel \r\nrelationships into consideration explicitly\r\nimproves the feature representation for scene segmentation.\r\nHowever, it is computationally costly, especially for large input feature maps.","description_state":"present","introduced_year":null,"introduced_by":{"title":"Dual Attention Network for Scene Segmentation","paper":"/paper/dual-attention-network-for-scene-segmentation","first_author":"Jun Fu","n_authors":7,"url_abs":null,"archive_paper_url":"https://paperswithcode.com/paper/dual-attention-network-for-scene-segmentation"},"source":{"url":"http://arxiv.org/abs/1809.02983v4","title":"Dual Attention Network for Scene Segmentation","url_on_a_paper_host":true},"code_snippet_url":null,"code_snippet_url_on_a_code_host":false,"categories":[{"area":"General","area_id":"general","collection":"Attention Mechanisms","url":"/methods/category/attention-mechanisms","pwc_aliases":["attention-mechanisms-1"]}],"n_papers_tagged":10,"archive_num_papers":10,"papers_newest_first":[{"paper":null,"title":"ECG Arrhythmia Detection Using Disease-specific Attention-based Deep Learning Model","date":"2024-07-25","arxiv_id":"2407.18033","n_code_links":0,"syntology":null},{"paper":null,"title":"Rethinking Residual Connection in Training Large-Scale Spiking Neural Networks","date":"2023-11-09","arxiv_id":"2311.05171","n_code_links":0,"syntology":null},{"paper":null,"title":"Distractor-aware Event-based Tracking","date":"2023-10-22","arxiv_id":"2310.14194","n_code_links":0,"syntology":null},{"paper":null,"title":"Improving Deep Attractor Network by BGRU and GMM for Speech Separation","date":"2023-08-07","arxiv_id":"2308.03332","n_code_links":0,"syntology":null},{"paper":"/paper/monocular-depth-distribution-alignment-with","title":"Monocular Depth Distribution Alignment with Low Computation","date":"2022-03-09","arxiv_id":"2203.04538","n_code_links":1,"syntology":null},{"paper":"/paper/danets-deep-abstract-networks-for-tabular","title":"DANets: Deep Abstract Networks for Tabular Data Classification and Regression","date":"2021-12-06","arxiv_id":"2112.02962","n_code_links":1,"syntology":null},{"paper":"/paper/invertible-denoising-network-a-light-solution","title":"Invertible Denoising Network: A Light Solution for Real Noise Removal","date":"2021-04-21","arxiv_id":"2104.10546","n_code_links":1,"syntology":{"ran":3,"of":3,"unverified":0,"pointer_only":0}},{"paper":null,"title":"Multi-Attention-Network for Semantic Segmentation of Fine Resolution Remote Sensing Images","date":"2020-09-03","arxiv_id":"2009.02130","n_code_links":0,"syntology":null},{"paper":null,"title":"Attention Scaling for Crowd Counting","date":"2020-06-01","arxiv_id":null,"n_code_links":0,"syntology":null},{"paper":"/paper/dual-attention-network-for-scene-segmentation","title":"Dual Attention Network for Scene Segmentation","date":"2018-09-09","arxiv_id":"1809.02983","n_code_links":12,"syntology":{"ran":0,"of":7,"unverified":7,"pointer_only":5}}],"papers_shown":10,"tasks":[{"task":"/task/segmentation","name":"Segmentation","papers":2},{"task":"/task/semantic-segmentation","name":"Semantic Segmentation","papers":2},{"task":"/task/arrhythmia-detection","name":"Arrhythmia Detection","papers":1},{"task":"/task/crowd-counting","name":"Crowd Counting","papers":1},{"task":"/task/deep-learning","name":"Deep Learning","papers":1},{"task":"/task/denoising","name":"Denoising","papers":1},{"task":"/task/depth-estimation","name":"Depth Estimation","papers":1},{"task":"/task/diagnostic","name":"Diagnostic","papers":1},{"task":"/task/image-denoising","name":"Image Denoising","papers":1},{"task":"/task/management","name":"Management","papers":1},{"task":"/task/monocular-depth-estimation","name":"Monocular Depth Estimation","papers":1},{"task":"/task/object","name":"Object","papers":1},{"task":"/task/object-tracking","name":"Object Tracking","papers":1},{"task":null,"name":"Position","papers":1},{"task":"/task/scene-segmentation","name":"Scene Segmentation","papers":1},{"task":"/task/speech-separation","name":"Speech Separation","papers":1},{"task":"/task/thermal-image-segmentation","name":"Thermal Image Segmentation","papers":1},{"task":"/task/visual-object-tracking","name":"Visual Object Tracking","papers":1},{"task":"/task/global-optimization","name":"global-optimization","papers":1},{"task":"/task/regression-1","name":"regression","papers":1}],"tasks_shown":20,"n_tasks":20,"usage_by_year":[{"year":"2018","papers":1},{"year":"2020","papers":2},{"year":"2021","papers":2},{"year":"2022","papers":1},{"year":"2023","papers":3},{"year":"2024","papers":1}],"row_source":"methods_table","archive":{"source":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","archive_url":"https://paperswithcode.com/method/danet"},"syntology_read_at":"2026-09-24T18:15:14+00:00"}