# Target State Classification by Attention-Based Branch Expansion Network
## 5 Discussion  
### Visualization and Overhead  
In addition to the above quantitative comparison between longitudinal and lateral, we also compared the performance of the model intuitively through visualization results. Figure 7 shows three groups of Grad-CAM visualization results for the eight networks. Grad-CAM [22] represents gradient-weighted class activation mapping that uses the gradient information of the last convolution layer flowing into the CNN to allocate important values for each neuron. This is a technique to visualize what is going on inside CNN by highlighting the learned important regions in a heatmap.  
We selected nine representative images from test sets of the three datasets to show the visualization results. For the first four \"XC depth-width\" models without attention, it can be seen that the key regions extracted by \"XC 1-8\" are more accurate and more complete, which is consistent with the conclusions of the previous Section 4.2. For example, the \"XC 1-8\" is most accurate in determining the position of \"newspapers\", \"metal cans\" and \"glass bottles\". We observe the following four models with the attention module plugged in and find that the model \"ABE 2-4\" has the best characteristic expression. It can be seen that \"ABE 2-4\" has the best attention ability for the \"Lw_s\" and \"Sd_1\" classes in columns 1 and 2, even better than \"XC 1-8\". The results are consistent with those in Section 4.3. It is worth mentioning that the advantage of \"ABE 2-4\" lies in the relatively accurate position information, such as \"Lw_s\" (column 1) and \"paper\" (column 7), which can see the boundary close to the original image. The qualitative visualization results are consistent with the quantitative results in Tables 4 and 5.  
In addition, we also discuss the influence of different model structures and the addition of attention on the number of model parameters and computation speed. We list the accuracy, the number of parameters, and single batch training time of the eight networks on the Trashnet dataset in Table 6. The first four models have the same number of parameters and training time since we just reorganize the eight linearly stacked core structures of Xception instead of deepening the stacking further or adding additional branches so that the number of layers and the number of channels in each layer of \"XC 4-2\", \"XC 2-4\" and \"XC 1-8\" is exactly equal to Xception. As for the ABE models, it can be seen from Figure 3 that the number of attention modules follows the depth of the model, which is a stacked-block structure, resulting in different parameters and training times for the four ABE models.  
Our attention module is a lightweight plug-and-play module that makes the exceeding amount of parameters and training time negligible in the premise of improving model performance. In general, the best model \"ABE 2-4\" with 2 M (2%) more parameters than Xception, and takes only 13 ms more training time for a single batch (32 images). We compare the performance of our \"ABE 2-4\" model with the SOTA technologies in Section 5.2 on the common dataset, Trashnet.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Method** & **Accuracy (\%)** & **Parameters (M)** & **S-B Train Time (ms)** \\ \hline Xception & 91.41 & 83.8 & 147 \\ XC 4-2 & 90.62 & 83.8 & 147 \\ XC 2-4 & 92.58 & 83.8 & 147 \\ XC 1-8 & 93.36 & 83.8 & 147 \\ \hline ABE 8-1 & 92.34 & 90.5 & 173 \\ ABE 4-2 & 91.88 & 87.2 & 163 \\ ABE 2-4 & 94.53 & 85.5 & 160 \\ ABE 1-8 & 91.80 & 84.7 & 155 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Comparison of accuracy, number of parameters and single batch training time of the 8 networks on Trashnet dataset.  
Figure 7: The Grad-CAM visualization results of 8 models. We compare Xception with 7 other models to see how different widths and depths affected the model’s performance, and how the attention module fits the widths and depths of the backbone.