Research on an Improved YOLOv8 Detection Method for Surface Defects of Optical Components
Abstract
1. Introduction
2. YOLOv8 Network
YOLOv8 Network Structure
3. The Improved BACG-YOLOv8 Network Model Is Designed
3.1. BRA Attention Mechanism
3.2. Context-GuideFPN Module
3.2.1. Introduce the SE Attention Mechanism
3.2.2. The Context-GuideFPN Module Is Introduced
4. Experiment and Analysis
4.1. Surface Defect Characteristic Dataset and Platform Construction
4.1.1. Defect Image Acquisition Based on Microscopic Dark-Field Imaging
4.1.2. Surface Defect Image Preprocessing
- (1)
- Image filter processing
4.1.3. Image Annotation and Enhancement of Surface Defects
- (1)
- Defect image annotation
- (2)
- Defect sample expansion
- a
- Image flipped
- b
- image translation
- c
- picture orientation
4.2. Evaluating Indicator
4.3. Experimental Results and Analysis
4.3.1. Experimental Environment Setup
| Computing Platform | PC |
|---|---|
| CPU | Intel core i9-9900k CPU @3.60 GHz |
| GPU | NVIDIA RTX3090*2 |
| internal storage | 64 G |
| memory | 11 GB GDDR6 |
| software environment | Windows 10 Professional, Python3.6.2, CUDA11.6 |
4.3.2. Analysis of Network Training Results
4.3.3. Ablation Experiment
4.3.4. The Results and Analysis of the Surface Defect Extraction
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Li, M.; Zhu, Y.; Lu, J.; Yang, Y.; Cong, M.; Sheng, L.; Qiang, P.; Cui, W.; Zhang, Z.; Wang, Y.; et al. Optical design and simulation of Einstein Probe satellite follow-up x-ray telescope. Opt. Eng. 2021, 60, 025102. [Google Scholar] [CrossRef]
- Huang, G.; Cui, C.; Lei, X.; Li, Q.; Yan, S.; Li, X.; Wang, G. A Review of Optical Interferometry for High-Precision Length Measurement. Micromachines 2025, 16, 6. [Google Scholar] [CrossRef] [PubMed]
- Gu, H.; Yao, L.; Li, Z.; Wei, C.; Xu, J.; Yang, L.; Li, C.; Liu, T.; Jiang, X.; Wang, C.; et al. Detection of absorptive defects in high-quality fused silica optic surface with laser thermal pumping and improved dynamic micro-interferometric imaging. Opt. Lasers Eng. 2026, 196, 109399. [Google Scholar] [CrossRef]
- Gomez, S.; Hale, K.; Burrows, J.; Griffiths, B. Measurements of surface defects on optical components. Meas. Sci. Technol. 1998, 9, 607. [Google Scholar] [CrossRef]
- Yin, Z.; Liu, H.; Zhao, L.; Cheng, J.; Tan, C.; Li, X.; Chen, Y.; Lin, Z.; Chen, M. Efficient and precise detection for surface flaws on large-aperture optics based on machine vision and machine learning. Opt. Laser Technol. 2023, 159, 13. [Google Scholar] [CrossRef]
- Wang, Q.; Wu, B.; Zhu, P.; Li, P.; Zuo, W.; Hu, Q. ECA-Net: Efficient Channel Attention for Deep Convolutional Neural Networks. In Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA, 14–19 June 2020. [Google Scholar] [CrossRef]
- Huang, J.; Zhang, W.; Jin, W.; Hu, H. Surface defect size measurement of planar optical components based on image segmentation. Opt. Laser Technol. 2025, 187, 112818. [Google Scholar] [CrossRef]
- Ming, W.; Shen, F.; Li, X.; Zhang, Z.; Du, J.; Chen, Z.; Cao, Y. A comprehensive review of defect detection in 3C glass components—ScienceDirect. Measurement 2025, 158, 107722. [Google Scholar] [CrossRef]
- Sun, H.; Cao, Q.; Ruan, Y.; Bai, L.; Xu, J. Light scattering peak matrix and Bayesian inference: An effective methodology for characterizing rectangular surface defects in advanced optics with roughness interference. Opt. Laser Technol. 2025, 192 Pt B, 113541. [Google Scholar] [CrossRef]
- Huang, J.; Zhang, W.; Jin, W.; Hu, H. Surface defect detection of planar optical components based on OPT-YOLO. Opt. Lasers Eng. 2025, 190, 108974. [Google Scholar] [CrossRef]
- Hu, H.; Li, Y.; Wang, J.; Lu, Y. Aerial Photovoltaic Panel Infrared Image Defect Detection Method Based on Improved YOLOv8. In Proceedings of the 2024 9th International Conference on Intelligent Computing and Signal Processing (ICSP), Xi’an, China, 19–21 April 2024; pp. 1777–1780. [Google Scholar] [CrossRef]
- Zhao, Y.; Sun, G.; Wang, H.; Hu, H. Surface Defect Detection of Aluminum Profiles Based on CDA-YOLOv8. Laser Optoelectron. Prog. 2025, 62, 637007. [Google Scholar]
- Zhu, G.; Qi, H.; Lv, K. DGYOLOv8: An Enhanced Model for Steel Surface Defect Detection Based on YOLOv8. Mathematics 2025, 13, 831. [Google Scholar] [CrossRef]
- Chen, P.; Xie, F. A Machine Learning Approach for Automated Detection of Critical PCB Flaws in Optical Sensing Systems. Photonics 2023, 10, 984. [Google Scholar] [CrossRef]
- Schröder, S.; Herffurth, T.; Blaschke, H.; Duparré, A. Angle-resolved scattering: An effective method for characterizing thin-film coatings. Appl. Opt. 2010, 50, C164–C171. [Google Scholar] [CrossRef] [PubMed]
- Zhang, Y.; Yang, Y.; Li, C.; Wu, F.; Chai, H.; Yan, K.; Zhou, L.; Li, Y.; Liu, D.; Bai, J.; et al. Defects evaluation system for spherical optical surfaces based on microscopic scattering dark-field imaging method. Appl. Opt. 2016, 55, 6162. [Google Scholar] [CrossRef] [PubMed]
- Guo, S.; Wang, S.; Wang, S.; Wu, L.; Liu, D. Dark-field surface defects detection method for multi-surface-shape large aperture optical components. Appl. Opt. 2024, 63, 6686–6695. [Google Scholar] [CrossRef]



















| Defect Type | Dig | Scratch | Broken Edge | Bubble |
|---|---|---|---|---|
| Appearance | ![]() | ![]() ![]() | ![]() | ![]() |
| ISO 10110-7 | Length < 2 mm | Long scratch length > 2 mm | Description requirements to be met | Gas not discharged in time during production and processing |
| GB/T 1185-2006 | Rough pockmarks corresponding to basic series of tolerance | Aspect ratio of long scratch > 160:1 | ||
| MIL-PRF-13830 B | A maximum size pockmark is allowed in the 20 mm area | Maximum size–total scratch length < One quarter of the element diameter | Ignored when not entering the effective aperture | One is allowed in the area with an optical diameter of 20 mm |
| Test Method | Core Principles | Advantage | Limitations | Typical Accuracy/Applications |
|---|---|---|---|---|
| Dark-field scattering method | Defects cause light scattering | Sensitive to small defects, the equipment is relatively simple | Small depth-to-width ratio/smooth defects may be missed | Submicron level |
| Microscopic dark-field + reverse identification | Scattering imaging + electromagnetic simulation + inverse solving | Quantifiable 3D information with high accuracy | The system is complex, the calibration requirement is high, and the speed is relatively slow | <100 nm |
| Deep UV interference method | 193 nm interferometric wavefront measurement | Ultra-high resolution, comprehensive evaluation of surface shape and local defects | The equipment is expensive and the environment is demanding | At the nanoscale, wafer/high-end objective lens |
| Focus on 3D reconstruction | Point scan optical tomography + 3D modeling | It provides true 3D morphology and strong chromatographic capacity | Slow scanning speed, high equipment cost | Submicron, VR lens |
| Deep learning | Image acquisition + AI feature learning and classification | High automation, adapt to complex texture, fast speed, standard unified | The model needs to be optimized/updated by relying on a large amount of annotated data | Meet the needs of production line, improve efficiency and reduce cost |
| Blazed compression scan | Prism compresses light spot + scan image | Improving the resolution of a single dimension is suitable for detecting specific structures | Application scenarios are relatively specific | Wafer defects |
| Lens Model | SPZF0763 + ZF-1.42C | ||
|---|---|---|---|
| optical magnification | 1.0×~9.0× | ||
| operating distance | 90 mm | ||
| multiplying power | 1.0× | 3.0× | 9.0× |
| NA | 0.02 | 0.048 | 0.08 |
| resolution ratio (μm) | 16.8 | 7.0 | 4.2 |
| depth of field (mm) | 2.0 | 0.27 | 0.05 |
| aberration | 0.21% | 0.19% | 0.14% |
| maximum compatible camera | 2/3″CCD | ||
| install | C joggle | ||
| Algorithm | Rep ↑ | Localization Error ↓ | Correctness ↑ | FLOPs/G ↓ | Params ↓ |
|---|---|---|---|---|---|
| SuperPoint | 0.612 | 1.078 | 0.681 | 26.289 | 1.304 |
| SuperPoint-CBAM | 0.620 | 1.095 | 0.723 | 26.290 | 1.306 |
| SuperPoint-Efficient Feature Convolution | 0.623 | 1.094 | 0.719 | 9.899 | 0.568 |
| Ours algorithm | 0.628 | 1.068 | 0.737 | 9.900 | 0.570 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Ma, B.; Zhao, J.; Zhou, S.; Wang, H.; Xu, J.; Liu, B.; Hou, J.; Liu, W. Research on an Improved YOLOv8 Detection Method for Surface Defects of Optical Components. Micromachines 2025, 16, 1373. https://doi.org/10.3390/mi16121373
Ma B, Zhao J, Zhou S, Wang H, Xu J, Liu B, Hou J, Liu W. Research on an Improved YOLOv8 Detection Method for Surface Defects of Optical Components. Micromachines. 2025; 16(12):1373. https://doi.org/10.3390/mi16121373
Chicago/Turabian StyleMa, Bei, Jialong Zhao, Shun Zhou, Hongjun Wang, Junqi Xu, Bingcai Liu, Jingyao Hou, and Weiguo Liu. 2025. "Research on an Improved YOLOv8 Detection Method for Surface Defects of Optical Components" Micromachines 16, no. 12: 1373. https://doi.org/10.3390/mi16121373
APA StyleMa, B., Zhao, J., Zhou, S., Wang, H., Xu, J., Liu, B., Hou, J., & Liu, W. (2025). Research on an Improved YOLOv8 Detection Method for Surface Defects of Optical Components. Micromachines, 16(12), 1373. https://doi.org/10.3390/mi16121373






