# Defect Detection for Wear Debris Based on Few-Shot Contrastive Learning
## 6 Conclusions  
The defects in the wear debris defect dataset have smaller category variance and excessive scale variation, and it's difficult for common object detection model to deal with this situation. We propose a meta-learning based few-shot object detection method in this paper. Firstly, Aligned Contrastive Loss is proposed to address the misalignment between proposals and novel class examples and constrain the distance in projection space. Then, a novel Multi-Scale Fusion module, which learns knowledge from support branch, is proposed to address the multi-scale problem. Compared with Baseline, the above methods achieved AP accuracy improvement of 2.08% (5 shot), 3.17% (10 shot), and 3.49% (30 shot) on the wear debris defect dataset. In Addition, Aligned Contrastive Loss and Multi-scale Fusion also significantly surpassed baseline in the 20 way-10 shot setting of the MS COCO dataset, proving the effectiveness of our methods.  
\begin{table}
\begin{tabular}{c c c c c c} \hline  & \begin{tabular}{c} **w/o Alignment** \\ **Module** \\ \end{tabular} & \begin{tabular}{c} **w/ Alignment** \\ **Module** \\ \end{tabular} & \begin{tabular}{c} **AP** \\ \end{tabular} & \
\begin{tabular}{c} **AP50** \\ \end{tabular} &
\begin{tabular}{c} **AP75** \\ \end{tabular} \\ \hline
5 way-5 shot & ✓ & & 11.14 & 20.44 & **11.43** \\  & & ✓ & **11.47** & **20.62** & 11.34 \\ \hline
5 way-10 shot & ✓ & & 12.14 & 22.16 & 12.38 \\  & & ✓ & **12.62** & **23.60** & **12.58** \\ \hline
5 way-30 shot & ✓ & & 17.52 & 30.71 & 18.49 \\  & & ✓ & **17.84** & **32.07** & **18.77** \\ \hline \end{tabular}
\end{table}
Table 6: The ablation result for Alignment module in Aligned Contrastive Loss.  
\begin{table}
\begin{tabular}{c c c c c c} \hline  & \begin{tabular}{c} **w/o Support** \\ **Information** \\ \end{tabular} & \begin{tabular}{c} **w/ Support** \\ **Information** \\ \end{tabular} & \begin{tabular}{c} **AP** \\ \end{tabular} & \
\begin{tabular}{c} **AP50** \\ \end{tabular} &
\begin{tabular}{c} **AP75** \\ \end{tabular} \\ \hline
5 way-5 shot & ✓ & & **12.53** & **22.15** & **13.50** \\  & & ✓ & 12.47 & 21.87 & 13.32 \\ \hline
5 way-10 shot & ✓ & & 14.31 & 25.46 & 15.10 \\  & & ✓ & **14.46** & **25.59** & **15.50** \\ \hline
5 way-30 shot & ✓ & & 17.05 & 30.26 & 18.97 \\  & & ✓ & **18.98** & **32.31** & **20.65** \\ \hline \end{tabular}
\end{table}
Table 7: The ablation result for using support information in Multi-Scale Fusion.  
**Author Contributions:** Conceptualization, H.L. and H.W.; Methodology, H.L. and H.W.; Investigation, H.L.; Validation, H.L.; Writing--original draft preparation, H.L.; Writing--review and editing, H.L., H.W. and L.L. All authors have read and agreed to the published version of the manuscript.  
This research received no external funding.  
**Institutional Review Board Statement:** Not applicable.  
**Informed Consent Statement:** Not applicable.  
**Data Availability Statement:** The MS COCO dataset is available at [[https://cocodataset.org](https://cocodataset.org)]([https://cocodataset.org](https://cocodataset.org)) (accessed on 3 September 2022).  
**Acknowledgments:** Additionally, the authors would like to thank all the reviewers who participated in the review.  
**Conflicts of Interest:** The authors declare no conflict of interest.