# Target State Classification by Attention-Based Branch Expansion Network
## 3 Proposed Methods
### Methods
#### 3.2.2 ABE Networks and Attention Module  
There exist two challenges to our datasets. Since the same object has different states and different objects may be in the same state, such as \"held\" with hands as the same confusing feature, it can easily lead to confusion between classes. Similarly, the \"wearing-state\" has the characteristics of a large intra-class gap and a small inter-class gap. Another challenge is that the amount of data is relatively small. We try to find a lightweight method to improve the recognition rate without significantly increasing the number of parameters. Inspired by CBAM [19] and BAM [39], the plug-and-play attention mechanism is a wise choice, which is consistent with our block-stacked-mode network structure. Figure 4 shows the ABE networks with different structures, which have different depths and widths consisting of different numbers of the multi-branch block with each block followed by an attention module (represent in dotted blue block). We further explain the connection mechanism between the attention module and the multi-branch block in  
Figure 3: Xception and 3 branch expansion networks. Note that each separable convolution layer is followed by batch normalization (not marked in the figure). (**a**) Xception. (**b**–**d**) Branch extension networks with different depths and widths after core structure recombination, respectively, denoted as “XC Depth-Width”. The depth and width here represent the number of the stacked block and the parallel branches in each block, respectively. Figure 5, which is linearly repeatable, according to the depth of the ABE models. To distinguish these attention-based networks, we use a similar naming convention \"ABE depth-width\" defined in Section 3.2 to name each network as (a) \"ABE 8-1\", (b) \"ABE 4-2\", (c) \"ABE 2-4\" or (d) \"ABE 1-8\", corresponding to the 4 sub-graphs in Figure 4. In particular, \"ABE 8-1\" refers to attention-based Xception, which has a single branch with a core structure that repeats 8 times sequentially. THe attention module is placed at the end of each core structure in the \"Middle Flow\" of Xception. We introduce our plug-and-play dual-attention module below. Through a large number of comparative experiments, we find that using both channel attention and spatial attention and combining them in the way of parallel residual connection achieves the best results on our datasets. The improved attention module is shown in Figure 6. The parallel connection means that feature F is input into the two attention modules to generate spatial attention and channel attention, respectively, and then the two are concatenated together. Residual connection refers to attaching the input feature to the output feature graph of the attention module to facilitate the learning of the deep network. Figure 4: Attention-based branch expansion networks. The attention module is plugged at the end of each multi-branch block. (**a**) Attention-based Xception. (**b–d**) “ACE Depth-Width” networks with the same structure of the 3 new “XC” networks. The input feature map \(F\in\mathbb{R}^{C\times H\times W}\) from a separable convolution block is fed to the attention module, and a 1D channel attention map \(M_{c}\in\mathbb{R}^{C\times 1\times 1}\) and a 2D spatial attention map \(M_{s}\in\mathbb{R}^{1\times H\times W}\) are produced. We follow the same practice as CBAM to calculate the channel attention map \(M_{c}\) and spatial attention map \(M_{s}\). The channel attention focuses on \"what\" is important in the input to obtain the spatial information to obtain the 1D channel descriptor. [PERSON] et al. [41] also proposed to use average pooling to generate channel-wise statistics by aggregating \(F\) through spatial dimensions \(H\times W\). In addition, [PERSON] et al. [19] believed that the max pool also contains another important clue.