# Integrating Prior Knowledge into Attention for Ship Detection in SAR Images
## 5 Experiments and Results
### Ablation Study
#### 5.8.2 Attention Components  
BDAM is a hybrid attention mechanism, in which the channel attention mechanism follows the implementation of CBAM. Our innovation and work focus on the spatial attention mechanism of BDAM. We call our spatial attention mechanism Brightness and Density Spatial Attention Mechanism (BDSM). Previous comparative experiments can only prove the effectiveness of BDAM, but are not enough to prove the effectiveness of BDSM.  
To demonstrate the effectiveness of BDSM, we design the ablation experiments. The accuracy of the four algorithms with only the channel attention mechanism, only BDAM, and only BDSM is compared. In addition, spatial attention in CBAM uses the feature map output at the upper layer of the feature extraction network as input, which is very different from BDSM. Therefore, we also compared it with CBAM in the ablation experiment to demonstrate the effect of the prior knowledge map. Table 11 presents the results of the ablation experiments. The only dataset we used in the ablation experiment is HRSID.  
Comparing BDSM with BDAM, under four baselines and six evaluation criteria, BDAM wins a total of 12 winners and 9 runners-up, while BDSM wins a total of 11 winners and 8 runners-up. BDSM performs similarly to BDAM, and even slightly better than BDAM occasionally. For example, BDSM achieves 4 winners and 2 runner-ups in RetinaNet, and 3 winners and 1 runner-up in \(AP\) metrics. BDAM adds CAM to BDSM, but BDAM has a humble improvement over BDSM. It indicates that BDSM plays a much larger role than CAM in BDAM.  
Comparing CAM with BDAM, the effect of adding CAM is worse than adding BDAM for all metrics of different baselines. BDAM adds BDSM to CAM, and its effect has been greatly improved. This suggests the effectiveness of BDSM. The difference between BDAM and CBAM is the different spatial attention mechanisms, and BDAM beats CBAM in all metrics and baselines. This also shows that BDAM's spatial attention (BDSM) is superior to CBAM's spatial attention.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Algorithm** & \(AP\) & \(AP_{50}\) & \(AP_{75}\) & \(AP_{8}\) & \(AP_{M}\) & \(AP_{L}\) \\ \hline Faster R-CNN & 0.659 & 0.959 & 0.776 & 0.638 & 0.700 & 0.678 \\ Input Size/4 & 0.659 & 0.959 & 0.779 & 0.639 & 0.696 & 0.663 \\ Input Size/16 & 0.661 & **0.969** & 0.790 & 0.639 & 0.709 & 0.676 \\ Input Size/64 & **0.664** & 0.961 & **0.798** & **0.643** & 0.702 & **0.720** \\ Input Size/256 & 0.661 & 0.959 & 0.779 & 0.634 & **0.713** & 0.681 \\ Input Size/1024 & 0.659 & 0.960 & 0.774 & 0.638 & 0.705 & 0.664 \\ \hline \hline \end{tabular}
\end{table}
Table 10: Experimental results of different size weighting maps. Bolded data represent the best and underlined data represent the second best.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Algorithm** & \(AP\) & \(AP_{30}\) & \(AP_{75}\) & \(AP_{8}\) & \(AP_{M}\) & \(AP_{L}\) \\ \hline + BDAM & **0.664** & **0.961** & **0.798** & **0.643** & **0.702** & **0.720** \\ + BDAM * & 0.427 & 0.727 & 0.453 & **0.516** & 0.280 & 0.166 \\ \hline \hline \end{tabular}
\end{table}
Table 9: Performance of insertion in block and insertion in stage on Faster R-CNN. Bolded data represent the best and underlined data represent the second best.  
From the above comparative experiments, we believe that BDSM is effective and plays a major role in BDAM.