# FSRFNet: Feature-selective and Spatial Receptive Fields Networks
## 3 Feature-selective and Spatial Receptive Fields (FSRF) Blocks
### Fuse  
Our goal is to enable neurons to adaptively adjust their RF sizes through the additive effects of feature-selective and spatial attention. The basic idea is to use two gates from the average and max channel (AMC) and average and max spatial (AMS) attention building blocks to control the flow of multiple branches carrying different scales of information into neurons in the next layer. We first combine the results of multiple branches (such as the two shown in Figure 1) by summing the elements, as follows:  
\[U=\overline{U}+\overline{U} \tag{2}\]  
We then input the feature map obtained from the previous step into the AMC and AMS attention building blocks, and flexibly select different information-space scales under the guidance of compact feature descriptors. The structure of the AMC attention building block is depicted in Figure 2. The AMC attention building block generates a channel attention map by using the inter-channel relationship of features. To compute the channel attention efficiently, we squeeze the spatial dimension of the input feature map into a channel descriptor by using global average pooling and global max pooling. We describe the detailed operation below. The preprocessed feature map U passes through two branches of the AMC attention building block. The first branch uses global average pooling to generate channel-wise statistics. Finally, a statistic \(\overline{z}\in\mathbb{R}^{C}\) is generated by shrinking U through its spatial dimensions \(H\times W\), such that the \(c\)-th element of \(\overline{z}\) is calculated by:  
\[\overline{z}_{c}=\mathrm{F}_{ga}(u_{c})=\frac{1}{H\times W}\sum_{i=1}^{H}\sum_ {j=1}^{W}u_{c}(i,j) \tag{3}\]  
where \(\mathrm{F}_{ga}(u_{c})\) indicates the global average pooling operator. Figure 2: The structure of the average and max channel (AMC) attention building block. Further, in order to take advantage of the information aggregated in the global average pooling, we then conduct a second operation, the purpose of which is to make full use of the dependencies between different feature maps. In order to achieve this effect, we use a dimensionality-reduction layer with parameters T\({}_{1}\) and reduction ratio \(r\), a ReLU layer, and a dimensionality-increasing layer with parameters T\({}_{2}\). The fully connected layers are used in the dimensionality-reduction layer and dimensionality-increasing layer. The average attention of the channel is computed as:  
\[\overline{s}=\mathrm{F}_{ex}(\overline{z}_{c},\mathrm{T})=\mathrm{T}_{2} \delta(\mathrm{T}_{1}\overline{z}) \tag{4}\]  
where \(\delta\) refers to the ReLU function, T\({}_{1}\in\mathbb{R}^{\overline{\mathrm{F}}\times\mathbb{C}}\), and T\({}_{2}\in\mathbb{R}^{\mathbb{C}\times\overline{\mathrm{F}}}\). The second branch uses global max pooling to generate channel-wise statistics. A statistic \(\overline{z}\in\mathbb{R}^{\mathbb{C}}\) is generated by shrinking U through its spatial dimensions \(H\times W\), such that the \(c\)-th element of \(\overline{z}\) is calculated by:  
\[\overline{z}_{c}=\mathrm{F}_{gm}(\mathrm{u}_{c})=\mathrm{max}\left(\sum_{i=1 }^{H}\sum_{j=1}^{W}u_{c}(i,j)\right) \tag{5}\]  
where \(\mathrm{F}_{gm}(\mathrm{u}_{c})\) indicates the global average pooling operator. Additionally, we conduct a second operation in order to take advantage of the information aggregated in the global max pooling, the purpose of which, as with the first branch, is to make full use of the dependencies between different feature maps. The maximum attention of the channel is computed as:  
\[\overline{s}=\mathrm{F}_{ex}(\overline{z},\mathrm{T})=\mathrm{T}_{2}\delta( \mathrm{T}_{1}\overline{z}) \tag{6}\]  
Finally, a multiplication activation function is used to process the feature information of the two branch outputs:  
\[s=\mathrm{F}_{add}(\overline{s},\overline{s})=\overline{s}+\overline{s} \tag{7}\]  
where \(s\in\mathbb{R}^{\mathbb{C}}\). The \(\mathrm{F}_{add}(\overline{s},\overline{s})\) indicates the channel-wise summation between \(\overline{s}\) and \(\overline{s}\).