# Research on Automated Fiber Placement Surface Defect Detection Based on Improved YOLOv7
## 1 Introduction  
Composite materials are assembled structures combined of different materials, characterized by being lightweight, having high strength, and exhibiting corrosion resistance, making them widely utilized in aerospace, automotive manufacturing, and other fields [1]. The significant increase in the use of composite materials relies on the support of automated fiber placement (AFP) technology. AFP technology combines the advantages of tape winding technology and tape laying technology. It utilizes a placement head to form multiple pre-impregnated fiber tows or dry fiber bundles into a narrow band of adjustable width, which is then laid on the mold surface and consolidated by pressure rollers and heating devices for shaping. A typical fiber placement machine, as shown in Figure 1, mainly consists of three parts: the machine body, the creep system, and the fiber placement head. The primary function of the machine body is to enable the rapid movement of the placement head and the positioning in spatial coordinates. The creep system is responsible for the storage, unwinding, film recovery, tension control, transmission, and guiding of the prepreg tow material rolls. The placement head primarily performs the functions of pressing, feeding, cutting, guiding, heating, and rolling the prepreg tow, placing it onto the mold [2]. However, the specificity of the AFP process poses a series of laying quality issues, primarily manifested in various surface defects generated during AFP, including foreign objects, overlaps, gaps, and twists. These defects lead to negative impacts such as local heterogeneity and stress concentration in composite materials, resulting in a potential maximum performance reduction of 12% [3; 4; 5; 6; 7]. Therefore, timely and accurate detection and repair of these defects are crucial. Current methods for detecting surface defects in AFP primarily rely on manual inspection, yet this approach presents some notable issues. Firstly, manual inspection requires a significant amount of time, effort, and human resources. Approximately 20% of the time in the composite material automated laying process is spent inspecting and repairing surface defects, severely limiting productivity improvement. Secondly, manual inspection suffers from subjectivity and consistency issues, as different inspectors may have varying judgments regarding defects, especially concerning subtle defects. Therefore, the development of an AFP defect detection system that can enhance detection efficiency and accuracy and reduce human resource allocation is of significant importance for improving the performance and product quality of AFP machines. Currently, there are three main technological approaches for surface defect detection in AFP of composite materials. One approach is based on laser technology for detection. The laser projection-assisted inspection system developed by [PERSON] et al. (2015) [PERSON] et al. (2015) can only achieve assisted inspection, fundamentally still relying on manual inspection. With the widespread application of laser triangulation sensors in industrial inspection, [PERSON] et al. [9] integrated laser triangulation sensors on the laying head to achieve defect detection of gaps, overlaps, and foreign objects to some extent. However, after in-depth research by many researchers, it was found that relying solely on the position information of the filament edges results in low accuracy in determining surface defects of the layers, and the detection speed is also not ideal. Another approach is based on infrared thermal imaging defect detection technology. [PERSON] et al. (2017) [PERSON] et al. (2017) [PERSON] et al. (2017) proposed an online automatic laying detection scheme based on infrared thermal imaging and computer image processing technology. The core of this system is to use infrared thermal imaging combined with edge detection algorithms to extract filament shape and position, thereby determining laying information and identifying defects such as gaps and twists. Similarly, [PERSON] et al.