{"url":"/method/sca-cnn","slug":"sca-cnn","name":"SCA-CNN","full_name":"Spatial and Channel-wise Attention-based Convolutional Neural Network","full_name_withheld":false,"description_markdown":"As CNN features are naturally spatial, channel-wise and multi-layer, \r\nChen et al. proposed a novel spatial and channel-wise attention-based convolutional neural network (SCA-CNN). \r\nIt was designed for the task of image captioning, and uses an encoder-decoder framework where a CNN first encodes an input image into a vector and then an LSTM decodes the vector into a sequence of words. Given an input feature map $X$ and the previous time step LSTM hidden state $h_{t-1} \\in \\mathbb{R}^d$, a spatial attention mechanism pays more attention to the semantically useful regions, guided by LSTM hidden state $h_{t-1}$. The  spatial attention model is:\r\n\r\n\\begin{align}\r\na(h_{t-1}, X) &= \\tanh(Conv_1^{1 \\times 1}(X) \\oplus W_1 h_{t-1})\r\n\\end{align}\r\n\r\n\\begin{align}\r\n\\Phi_s(h_{t-1}, X) &= \\text{Softmax}(Conv_2^{1 \\times 1}(a(h_{t-1}, X)))    \r\n\\end{align}\r\n\r\nwhere $\\oplus$ represents  addition of a matrix and a vector. Similarly, channel-wise attention aggregates global information first, and then computes a channel-wise attention weight vector with the hidden state $h_{t-1}$:\r\n\\begin{align}\r\nb(h_{t-1}, X) &= \\tanh((W_2\\text{GAP}(X)+b_2)\\oplus W_1h_{t-1})\r\n\\end{align}\r\n\\begin{align}\r\n\\Phi_c(h_{t-1}, X) &= \\text{Softmax}(W_3(b(h_{t-1}, X))+b_3)    \r\n\\end{align}\r\nOverall, the  SCA mechanism can be written in one of two ways. If channel-wise attention is applied before spatial attention, we have\r\n\\begin{align}\r\nY &= f(X,\\Phi_s(h_{t-1}, X \\Phi_c(h_{t-1}, X)), \\Phi_c(h_{t-1}, X)) \r\n\\end{align}\r\nand  if spatial attention comes first:\r\n\\begin{align}\r\nY &= f(X,\\Phi_s(h_{t-1}, X), \\Phi_c(h_{t-1}, X \\Phi_s(h_{t-1}, X)))\r\n\\end{align}\r\nwhere $f(\\cdot)$ denotes the modulate function which takes the feature map $X$ and attention maps as input and then outputs the modulated feature map $Y$.\r\n\r\nUnlike previous attention mechanisms which consider each image region equally and use global spatial information to tell the network where to focus, SCA-Net leverages the semantic vector to produce the spatial attention map as well as the channel-wise attention weight vector. Being more than a powerful attention model, SCA-CNN also provides a better understanding of where and what the model should focus on during sentence generation.","description_state":"present","introduced_year":null,"introduced_by":{"title":"SCA-CNN: Spatial and Channel-wise Attention in Convolutional Networks for Image Captioning","paper":"/paper/sca-cnn-spatial-and-channel-wise-attention-in","first_author":"Long Chen","n_authors":7,"url_abs":null,"archive_paper_url":"https://paperswithcode.com/paper/sca-cnn-spatial-and-channel-wise-attention-in"},"source":{"url":"http://arxiv.org/abs/1611.05594v2","title":"SCA-CNN: Spatial and Channel-wise Attention in Convolutional Networks for Image Captioning","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":2,"archive_num_papers":2,"papers_newest_first":[{"paper":"/paper/aesthetic-attributes-assessment-of-images","title":"Aesthetic Attributes Assessment of Images","date":"2019-07-11","arxiv_id":"1907.04983","n_code_links":2,"syntology":{"ran":0,"of":1,"unverified":1,"pointer_only":1}},{"paper":"/paper/sca-cnn-spatial-and-channel-wise-attention-in","title":"SCA-CNN: Spatial and Channel-wise Attention in Convolutional Networks for Image Captioning","date":"2016-11-17","arxiv_id":"1611.05594","n_code_links":2,"syntology":null}],"papers_shown":2,"tasks":[{"task":"/task/image-captioning","name":"Image Captioning","papers":2},{"task":"/task/attribute","name":"Attribute","papers":1},{"task":"/task/sentence","name":"Sentence","papers":1},{"task":"/task/transfer-learning","name":"Transfer Learning","papers":1}],"tasks_shown":4,"n_tasks":4,"usage_by_year":[{"year":"2016","papers":1},{"year":"2019","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/sca-cnn"},"syntology_read_at":"2026-09-24T18:15:14+00:00"}