# Enhanced YOLOv8 with BiFPN-SimAM for Precise Defect Detection in Miniature Capacitors
## 5 Conclusions  
In the domain of automatic visual inspection (AVI) for miniature capacitor quality control, the accurate detection and characterization of small-sized defects remains a formidable challenge. These challenges stem from the small size and limited sample availability of defective micro-capacitors, leading to issues such as reduced detection accuracy and increased false-negative rates in existing inspection methods. In response to these issues, this research endeavored to introduce an enhanced YOLOv8 model algorithm, specifically designed to elevate the accuracy of detecting minuscule capacitive defects in industrial production settings. Our novel algorithm significantly augmented the model's capability to identify intricate, small-sized targets by leveraging the SimAM attention module and integrating the BiFPN (bidirectional feature pyramid network) structure. The BiFPN, with its sophisticated approach to feature fusion and layer connectivity, significantly bolstered the model's efficiency in discerning fine details, a key aspect in the realm of tiny defect detection.  
Furthermore, we substituted the Wise-IoU loss function for the traditional CIoU loss function, a calculated step that successfully lessened the negative influence of anomalous samples during model training. This enhanced the model's generalization capabilities, leading to a fortified detection performance overall. Our experimental results, validated using the micro-capacitor surface defect (MCSD) dataset comprising 1358 images representing four distinct types of micro-capacitor defects, speak volumes about the effectiveness of our approach, especially evident in the significant uptick in the mean average precision (mAP) metric. Impressively, we achieved this without piling on computational costs or sacrificing frame rate. This underscores our model's robustness and its competitive edge in pinpointing minute capacitive defects in industrial processes.  
We aim to broaden the scope of the MCSD dataset in future work to include a wider variety of faults. We are also dedicated to continuously improving and fine-tuning our system. We are optimistic that with persistent enhancements, our model will prove invaluable across a broad spectrum of practical applications, substantially elevating accuracy and efficiency in industrial quality control.  
Although our proposed enhanced YOLOv8 model shows significant progress in the detection of defects in miniature capacitors, there are still some limitations. One of the main issues is the reliance on the MCSD dataset. Although this dataset contains a wide range of defect types, it may not be a comprehensive representation of the kinds of defects that can occur in various industrial environments, which may limit the applicability and effectiveness of the model when confronted with environments with unknown defect types or deviations from the parameters of the dataset. Furthermore, although replacing the Wise-IoU loss function with the CIoU loss function yielded positive results in our tests, the generalization of this approach to all possible industrial application scenarios needs to be further explored.  
Conceptualization, N.L. and Z.Z.; Methodology, N.L. and Z.Z.; Software, N.L.; Validation, N.L. and T.Y.; Formal analysis, N.L.; Investigation, N.L. and T.Y.; Resources, N.L.; Data curation, N.L.; Writing--original draft preparation, T.Y.; Writing--review and editing, T.Y.; Visualization, Z.Z.; Supervision, C.G. and P.Z.; Project administration, C.G. and P.Z.; Funding acquisition, C.G. and P.Z. All authors have read and agreed to the published version of the manuscript.  
This work was supported in part by the National Natural Science Foundation of China under Grant 62075031.