# Integrating Prior Knowledge into Attention for Ship Detection in SAR Images
## 5 Experiments and Results
### Qualitative Results  
To prove the validity of BDAM, we add it to four popular detectors (Faster R-CNN, YOLOv4, RetinaNet, and SSD) for experiments and compare it with the original algorithms. In addition, we compare the effects with attention mechanisms EAM [17], BCA [93], and CBAM [67]. The first two are specially designed for SAR images while the last one is one of the most popular for general purpose. Tables 6-8 show the performance of these four algorithms on the three datasets, where the bold data represent the one with the best results for a certain metric of the same algorithm, and the underlined data represent the one with the second best results. Figures 10 and 11 show the recognition results of some images. As illustrated in Tables 6-8, BDAM performs well with all detectors on all three datasets. Namely, the BDAM achieves 10 winners and 2 runners-up with Faster R-CNN; 9 winners and 2 runners-up with RetinaNet; 10 winners and 2 runners-up with SSD; and 7 winners and 2 runners-up with RetinaNet. We can notice that all baselines have a stable improvement on the detection ability of large targets after adding BDAM. For example, on the SSDD data, RetinaNet's \(AP_{L}\) improves by 7.7% after adding BDAM while it improves by 9.2% on the HRSID dataset, which is a significant improvement. Tables 6 and 7 reveal that performance of each method on \(AP_{M}\) is better than that of \(AP_{S}\) and \(AP_{L}\). Although there is no large ship in Table 8, the performance of \(AP_{M}\) is better than \(AP_{S}\). In addition, from the three tables, we observe that the improvement of our model is insignificant on \(AP_{M}\). It indicates that the detectors we used learned features well on medium size targets. BDAM could not improve detectors further if sufficient information has been utilized. On SSDD (Table 6), BDAM combined with YOLOv4 underperforms other combinations. Unlike other detectors, YOLOv4 uses Mosaic as one of its data augmentation strategies. Mosaic extends CutMix by mixing four images at a time as one training image, which aims to enrich the background. However, the reality images are likely to contain no objects, which is equivalent to adding a lot of noise to the training process of the model. Adding appropriate noise to the training process can be beneficial to prevent the model from overfitting. However, it hinders BDAM. If an image does not contain objects, then the prior knowledge map obtained by clustering is likely to be an all-0 image. It makes BDAM not work well but increases the training burden of the model. Therefore, we follow the YOLOv [47] approach. Instead of \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Operation** & **Total Time Spent** & **Average Time Spent (Per Image)** & **FPS** \\ \hline brightness & 71.3828 s & 0.0879 s & 11.375 \\ density & 217.8586 s & 0.2683 s & 3.727 \\ the complete process & 289.2406 s & 0.1781 s & 5.615 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Time consumption for representing the prior knowledge. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Operation** & **Total Time Spent** & **Average Time Spent (Per Image)** & **FPS** \\ \hline brightness & 7.2804 s & 0.00897 s & 11.532 \\ density & 7.0043 s & 0.0086 s & 115.929 \\ the prior knowledge map & 2.1932 s & 0.0027 s & 370.233 \\ the complete process & 18.0784 s & 0.0223 s & 44.916 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Time consumption of combining the prior knowledge with SSD. using Mosaic in all epochs, we only use Mosaic in the first 70% epochs. However, limited by the amount of data, BDAM still does not perform as well on SSDD as it does on HRSID.