{"url":"/method/channel-wise-cross-attention","slug":"channel-wise-cross-attention","name":"Channel-wise Cross Attention","full_name":"Channel-wise Cross Attention","full_name_withheld":false,"description_markdown":"**Channel-wise Cross Attention** is a module for semantic segmentation used in the [UCTransNet](https://paperswithcode.com/method/uctransnet) architecture. It is used to fuse features of inconsistent semantics between the Channel [Transformer](https://paperswithcode.com/method/transformer) and [U-Net](https://paperswithcode.com/method/u-net) decoder. It guides the channel and information filtration of the Transformer features and eliminates the ambiguity with the decoder features.\r\n\r\nMathematically, we take the $i$-th level Transformer output $\\mathbf{O\\_{i}} \\in \\mathbb{R}^{C×H×W}$ and i-th level decoder feature map $\\mathbf{D\\_{i}} \\in \\mathbb{R}^{C×H×W}$ as the inputs of Channel-wise Cross Attention. Spatial squeeze is performed by a [global average pooling](https://paperswithcode.com/method/global-average-pooling) (GAP) layer, producing vector $\\mathcal{G}\\left(\\mathbf{X}\\right) \\in \\mathbb{R}^{C×1×1}$ with its $k$th channel $\\mathcal{G}\\left(\\mathbf{X}\\right) = \\frac{1}{H×W}\\sum^{H}\\_{i=1}\\sum^{W}\\_{j=1}\\mathbf{X}^{k}\\left(i, j\\right)$. We use this operation to embed the global spatial information and then generate the attention mask:\r\n\r\n$$ \\mathbf{M}\\_{i} = \\mathbf{L}\\_{1} \\cdot \\mathcal{G}\\left(\\mathbf{O\\_{i}}\\right) + \\mathbf{L}\\_{2} \\cdot \\mathcal{G}\\left(\\mathbf{D}\\_{i}\\right) $$\r\n\r\nwhere $\\mathbf{L}\\_{1} \\in \\mathbb{R}^{C×C}$ and $\\mathbf{L}\\_{2} \\in \\mathbb{R}^{C×C}$ and being weights of two Linear layers and the [ReLU](https://paperswithcode.com/method/relu) operator $\\delta\\left(\\cdot\\right)$. This operation in the equation above encodes the channel-wise dependencies. Following [ECA-Net](https://paperswithcode.com/method/eca-net) which empirically showed avoiding dimensionality reduction is important for learning channel attention, the authors use a single [Linear layer](https://paperswithcode.com/method/linear-layer) and sigmoid function to build the channel attention map. The resultant vector is used to recalibrate or excite $\\mathbf{O\\_{i}}$ to $\\mathbf{\\bar{O}\\_{i}} = \\sigma\\left(\\mathbf{M\\_{i}}\\right) \\cdot \\mathbf{O\\_{i}}$, where the activation $\\sigma\\left(\\mathbf{M\\_{i}}\\right)$ indicates the importance of each channel. Finally, the masked $\\mathbf{\\bar{O}}\\_{i}$ is concatenated with the up-sampled features of the $i$-th level decoder.","description_state":"present","introduced_year":null,"introduced_by":{"title":"UCTransNet: Rethinking the Skip Connections in U-Net from a Channel-wise Perspective with Transformer","paper":"/paper/uctransnet-rethinking-the-skip-connections-in","first_author":"Haonan Wang","n_authors":4,"url_abs":null,"archive_paper_url":"https://paperswithcode.com/paper/uctransnet-rethinking-the-skip-connections-in"},"source":{"url":"https://arxiv.org/abs/2109.04335v3","title":"UCTransNet: Rethinking the Skip Connections in U-Net from a Channel-wise Perspective with Transformer","url_on_a_paper_host":true},"code_snippet_url":null,"code_snippet_url_on_a_code_host":false,"categories":[{"area":"Computer Vision","area_id":"computer-vision","collection":"Semantic Segmentation Modules","url":"/methods/category/semantic-segmentation-modules","pwc_aliases":[]},{"area":"General","area_id":"general","collection":"Attention Modules","url":"/methods/category/attention-modules","pwc_aliases":[]}],"n_papers_tagged":5,"archive_num_papers":5,"papers_newest_first":[{"paper":"/paper/enhancing-conditional-image-generation-with","title":"Enhancing Conditional Image Generation with Explainable Latent Space Manipulation","date":"2024-08-29","arxiv_id":"2408.16232","n_code_links":1,"syntology":null},{"paper":"/paper/boosting-medical-image-segmentation","title":"Boosting Medical Image Segmentation Performance with Adaptive Convolution Layer","date":"2024-04-17","arxiv_id":"2404.11361","n_code_links":1,"syntology":null},{"paper":"/paper/acc-unet-a-completely-convolutional-unet","title":"ACC-UNet: A Completely Convolutional UNet model for the 2020s","date":"2023-08-25","arxiv_id":"2308.13680","n_code_links":1,"syntology":null},{"paper":"/paper/lvit-language-meets-vision-transformer-in","title":"LViT: Language meets Vision Transformer in Medical Image Segmentation","date":"2022-06-29","arxiv_id":"2206.14718","n_code_links":1,"syntology":{"ran":1,"of":1,"unverified":0,"pointer_only":0}},{"paper":"/paper/uctransnet-rethinking-the-skip-connections-in","title":"UCTransNet: Rethinking the Skip Connections in U-Net from a Channel-wise Perspective with Transformer","date":"2021-09-09","arxiv_id":"2109.04335","n_code_links":3,"syntology":{"ran":1,"of":1,"unverified":0,"pointer_only":1}}],"papers_shown":5,"tasks":[{"task":"/task/image-segmentation","name":"Image Segmentation","papers":4},{"task":"/task/medical-image-segmentation","name":"Medical Image Segmentation","papers":4},{"task":"/task/semantic-segmentation","name":"Semantic Segmentation","papers":4},{"task":"/task/segmentation","name":"Segmentation","papers":2},{"task":"/task/conditional-image-generation","name":"Conditional Image Generation","papers":1},{"task":"/task/decoder","name":"Decoder","papers":1},{"task":"/task/denoising","name":"Denoising","papers":1},{"task":"/task/image-generation","name":"Image Generation","papers":1},{"task":"/task/pseudo-label","name":"Pseudo Label","papers":1},{"task":"/task/unet-segmentation","name":"UNET Segmentation","papers":1},{"task":"/task/text-annotation","name":"text annotation","papers":1}],"tasks_shown":11,"n_tasks":11,"usage_by_year":[{"year":"2021","papers":1},{"year":"2022","papers":1},{"year":"2023","papers":1},{"year":"2024","papers":2}],"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/channel-wise-cross-attention"},"syntology_read_at":"2026-09-24T18:15:14+00:00"}