# Feature Augmentation Based on Pixel-Wise Attention for Rail Defect Detection
## 4 Results
### Ablation Study  
We conduct a series of ablation studies to analyze the effectiveness of our proposed method. All ablation studies are conducted on the 8-class rail defect test dataset if not otherwise stated. All results are averaged over 10 random runs. Impact of multiple support defects. We test our method on a different number of support defects per category. We randomly select 2, 3, 4, and 5 support defects in each category, and train our model. The validation and test results of our model are shown in Figure 8. As can be seen from the figure, although the validation performance of the model is slightly improved when using two support defects per category (e.g., 0.7% improvement of YOLOv5s, from 84.62% to 85.21%), the overall performance trend of the model decreases with the increase of the number of support defects. This result indicates that although more support defects can introduce more diverged defect patterns to the model, it cannot help improve the detection performance of the model. Instead, the redundant defect patterns may confuse the model and impede the detection process. Figure 8: Effect of different number of support defects per category on validation and test performance of (**a**) YOLOv5s with FA and (**b**) YOLOv5s6 with FA. Figure 7: Three group of PR curves, from top to bottom are PR curves of: YOLOv5s and YOLOv5s with FA, YOLOv5s6 and YOLOv5s6 with FA, and two YOLO models with FA compared with two Faster R-CNN models. Impact of support feature generation methods. Support class prototypes are usually generated by averaging all support images of each class [20, 44, 45]. In this section, we analyze the effectiveness of two support class prototype feature generation methods other than averaging: random selection and summation and normalization (add and norm). Random selection means to randomly select one of the support feature for subsequent feature augmentation, while summation and normalization apply normalization after adding all the support features. We further set the number of support defects per category to be 2. The detection results are shown in Table 4. As shown in the table, the model perform best by averaging all support images. However, the model does not degrade much when adopting random selection or by averaging only two support images, but the amount of calculation during training is greatly reduced. Impact of Mask. We studied the effect of the mask operation within the detection process. The detection results are shown in Table 5. From the two tables we can see that the detection performance of the model decreases slightly without mask operation. This result is easy to understand, since the mask operation can effectively remove the background information interference of non-defect parts. It can help the model to focus more on useful objects rather than the background. Generalization on existing backbones. We evaluate the generalization ability of our proposed feature augmentation method by plugging it to popular object detection backbones other than YOLO, such as Faster R-CNN and RetinaNet [27]. These two backbones are typical two-stage and one-stage object detection frameworks. As shown in Table 6, our proposed feature augmentation module boosts the two backbones by around 1% mAP@5. It demonstrates the generality of our method. Yet we still prefer our module to be plugged to one-stage object detection frameworks for faster detection ability. \begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Method** & **Backbone** & **[EMAIL_ADDRESS]** & **[EMAIL_ADDRESS]** & **FPS** \\ \hline Faster R-CNN [4] & R50 & 0.719 & 0.333 & 8.49 \\ Faster R-CNN [4] + FA & R50 & 0.727 & 0.346 & 8.13 \\ \hline RetinaNet [46] & R50 & 0.687 & 0.328 & 24.26 \\ RetinaNet [46] + FA & R50 & 0.696 & 0.337 & 20.98 \\ \hline SSD [27] & VGG16 & 0.684 & 0.321 & 21.78 \\ SSD [27] + FA & VGG16 & 0.698 & 0.342 & 19.91 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Generalization of FA module applied to object detection backbones.