Microsoft Word - 08-AJST69044排板.docx Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 15, No. 1, 2025 51 In-depth Application of YOLOv8 Algorithm Improvement in Automotive Airbag Defect Detection Weijian Shao1, Zhihua Hu1, *, Taohuang Liu2 1School of Intelligent Manufacturing and Control Engineering, Shanghai Polytechnic University, Shanghai, 201209, China 2School of Intelligent Manufacturing and Control Engineering, Shanghai Polytechnic University, Shanghai, 201209, China * Corresponding author: Zhihua Hu (Email: zhhu@sspu.edu.cn) Abstract: With the rapid development of the automobile industry, the quality inspection of airbags, as a key component of automobile safe driving equipment, is crucial. However, the traditional manual quality inspection methods have problems such as low efficiency and susceptibility to human factors. In order to solve these problems, this paper proposes an airbag defect detection algorithm based on the improved YOLOv8. By using the SIoU loss function and optimizing the C2f module, the model's ability to detect defects on small targets is improved. The experimental results show that the improved algorithm achieves a mean accuracy (mAP) of 98.3% in detecting defects such as stylus bending, spring assembly misalignment, and snaps, which is 0.9 percentage points higher than that of the pre-improved YOLOv8 model, and the detection efficiency is significantly improved, which provides powerful technical support for the quality control of automobile manufacturing. Keywords: Airbag; Defect detection; Deep learning; Target detection. 1. Introduction Airbags [1][2]generally use an inflatable soft bag as the main body, which is usually mounted on the steering wheel, dashboard, and seat sides. When a vehicle collision occurs, the sensor will detect the collision signal and trigger the airbag's inflation device, so that the airbag inflates and expands in an instant, forming a cushion to reduce the collision strength between the passengers and the vehicle's internal hard parts. Therefore, automotive airbags as a critical moment in the occurrence of traffic accidents can ensure the safety of the driver's life as a key safety device, its quality directly affects the safety performance of the vehicle. Traditional detection means rely on manual detection or simple image processing technology, there are problems such as low detection efficiency and high false alarm rate. With the rapid development of deep learning, CNN-based target detection technology has gradually been widely used in the industrial field. the YOLO series of algorithms, as a representative of real-time target detection, has become an important tool for industrial defect detection by virtue of its advantages of fast detection speed and high accuracy. yolov8 is the newest version of the YOLO series. It shows high performance in object detection and image segmentation tasks. Compared to previous versions, YOLOv8[3][7] has significant advantages by further optimizing the architecture and training methods. In terms of speed, the YOLO series is known for real-time detection, and YOLOv8 still maintains this advantage with significant advantages; in terms of accuracy, compared to the previous versions (such as YOLOv5 and YOLOv7), YOLOv8 has a significant improvement in detection accuracy, especially in the task of small object detection. At the same time, there are some limitations YOLOv8's performance in some complex industrial scenarios still has room for improvement, for example, the robustness and accuracy of the model may be insufficient in detecting safety hazards with complex backgrounds or small defects. In this regard, this paper improves YOLOv8 based on YOLOv8, which meets the actual needs of safety detection, and verifies the effect of the improved model in practical applications through experiments. 2. YOLOv8 Algorithm The YOLOv8 network mainly consists of Backbone, Neck and Head, and its network structure is shown in Fig. 1. According to the size of the model can be divided into five models YOLOv8n, YOLOv8s, YOLOv8m, YOLOv8l and YOLOv8x[8][11]. Figure 1. YOLOv8 Network Architecture Diagram The Input [12]input layer imports the airbag defect images to the YOLOv8 network.The Backbone[13] layer YOLOv8 uses CSPNet (Cross Stage Partial Network) as the backbone network, which improves the expressive ability and training efficiency of the model by extracting features in stages.The Neck [14] layer YOLOv8 uses FPN (Feature Pyramid Network) and PAN (Path Aggregation Network) to efficiently combine features at different levels through up-sampling and down- sampling operations.Head Layer YOLOv8 makes important 52 structural improvements. Specifically, it abandons the coupled head in YOLOv5 in favor of a decoupled head, and realizes the transition from Anchor Based to Anchor Free. This series of improvements helps to improve detection accuracy and efficiency. 3. Algorithmic Improvements 3.1. SIoU Loss Function In target detection, SIoU and CIoU are two evaluation metrics used to measure the similarity of bounding boxes.The calculation of SIoU is based on the ratio of the intersection area and the concatenation area of the two bounding boxes, so the calculation speed is faster, which is suitable for scenarios with requirements on calculation speed. CIoU, on the other hand, further considers factors such as the distance between the center points of the bounding boxes and the aspect ratio on the basis of SIoU. In view of the computational efficiency advantage of SIoU, this paper chooses to use the SIoU loss function to replace the loss function in the original model in the following section: 3.1.1. Angle cost,the definition is as follows: 21 2sin (arcsin( ) ) cos(2*(arcsin( ) )) 4 4 h hc c          (1) Where: hc is denoted as the height difference between the centroid of the real frame and the predicted frame, is the distance between the centroid of the real frame and the predicted frame,arcsin( hc  )is equal to the angle α, and hc  =sin(α), where: 2 2( ) ( ) x x y gt gt c c c cyb b b b     (2) max( , ) min( , ) y y gt gt h c cy c cyc b b b b  (3) ( x gt cb , y gt cb ) are the real frame center coordinates, ( xc b , cyb ) are the predicted frame center coordinates, and the angle loss is 0 ,whenαis 2  or 0.During the training process, if α< 4  , then minimize α, otherwise minimize β, β= 4  -α; 3.1.2. Distance cost, the definition is as follows: , (1 ) 2 yx x t x y e e e            (4) Where: 2 ( ) gt cc xx x w b b c    (5) ( ) gt cycy y h b b c    (6) 2    (7) gt cxb , cxb x are the x-coordinates of the real and predicted bounding boxes, gt cyb , cyb y are the y-coordinates of the real and predicted bounding boxes, wc 、 hc are the width and height of the smallest outer rectangle of the real and predicted boxes; 3.1.3. Shape cost, the definition is as follows: , (1 ) (1 ) (1 )t w hw w w t w h e e e              (8) Where: max( , ) gt w gt w w w w w   (9) max( , ) gt h gt h h w h h   (10) ( , )w h and ( , )gt gtw h are the width and height of the predicted and real frames, respectively, and θ controls how much attention is paid to shape loss, with θ close to 4; 3.1.4. The final SIoU loss function is defined as follows: 1 2SIoULoss IoU      (11) GT GT B B IoU B B    (12) Where: GTB B denotes the intersection of the real frame and the predicted frame, while GTB B denotes the intersection of the real frame and the predicted frame;the calculation of SIou is based on the ratio of the intersection area and the concatenation area of the two bounding boxes, which is faster, and suitable for scenarios with requirements on the calculation speed. 3.2. CESE_C2f Module The following figure shows the CESE_C2f module, which is further optimized based on the C2f module. The figure shows that the number of channels in the input feature map is first halved by a convolutional layer, and then the features are divided into two parts by a Split operation: one part directly provides the gradient flow, and the other part is sequentially passed through the multilayered CESE (Chain-like Efficient Squeeze-Excitation) structure.Inside the CESE, the features are upscaled by Pw_Conv (Pointwise Convolution), and then by Dw_Conv (Depthwise Convolution). (Inside CESE, Pw_Conv (Pointwise Convolution) is used for upscaling, and Dw_Conv (Depthwise Convolution) is used for depth- separable convolution, which significantly reduces the amount of computation while retaining more effective features. CESE also incorporates a lightweight ESE (Efficient Squeeze-and-Excitation) attention mechanism, which achieves similar attention effects as traditional SE through Max Pooling, Conv2d, and Hard Sigmoid, without 53 significantly increasing the number of parameters and computation of the model. Eventually, the features output from CESE are fused with the previous gradient stream at Concat or Add, which not only further enriches the feature representation, but also improves the performance in small target detection and keeps the overall complexity low. With such a chained structural design, the CESE_C2f module enhances the model's focus on small targets, accelerates the convergence and improves the detection accuracy while reducing the computational burden. Figure 2. CESE_C2f Structure Diagram 4. Experiments And Analysis of Results 4.1. Experimental Platforms The YOLOv8 model used in the sub-experiment is configured under the operating system of Windows 10, the CPU model is Intel(R)Core(TM)i7-7700HQ CPU@2.80GHz, the running memory is 16G, the GPU model is NVIDIA GeForce GTX 1050Ti and the deep learning framework is Pytorch2.4.1+cu124, running architecture is Cuda12.6, development environment is Python3.9.0. 4.2. Model Introduction Airbag models typically refer to computer models used to simulate and predict the behavior of automotive airbags during a crash event. These models are important tools in the design and testing process of automotive safety systems, and they help engineers understand and optimize the timing, shape, and size of airbag deployments and how well they work with other safety systems. They are also an important source of data sets for this paper. As shown in Figure 3, the model shows some of the main parts of the airbag system, including the stylus, snap, spring, and airbag. Figure 3. Airbag Models 4.3. Dataset Production Considering that there is no public dataset dedicated to airbag defects, this paper builds its own dataset containing three types of typical defects: bent stylus, misaligned spring assembly, and broken snap. The defect areas are labeled by tools such as LabelImg. To alleviate the problem of insufficient data volume, various enhancement operations, including rotation, cropping, Gaussian noise, Mosaic, etc., are used to improve the robustness and generalization ability of the model. Among them, the original dataset contains 1100 images of spring assembly, 1200 images of stylus bending and 1000 images of snap breakage. Based on these images, the total dataset is increased to 6000 images using the aforementioned data extension technique. Subsequently, the dataset was divided and packaged according to the specific application requirements. Specifically, 800 images are categorized as the test set, 900 are used for the validation set, and the remaining 4300 are used as the training set for model learning. 4.4. Indicators For Model Evaluation The evaluation metrics selected for the experiment include GFLOPs (Giga Floating Point Operations Per Second), Precision P (Precision), Recall R (Recall) for evaluation and mean average precision mAP (mean average precision). The calculation formula is as follows: Indicators For Model Evaluation 100% TP P TP FP    (13) 100% TP R TP FN    (14) 54 1 0 dAP P R  (15) 1 1 N i i mAP AP N    (16) 4.5. Analysis of Experimental Results After analyzing and comparing the experimental results with the YOLOv8 model, the improved model is analyzed according to each performance index. The comparison of the AP (Average Precision) values of the model before and after the improvement for the detection of three types of airbag defects such as stylus bending, spring assembly misalignment, and bayonet breakage are shown in Table 1.1. Table 1.1 Comparison of accuracy before and after model improvement Defect type YOLOV8 Improved stylus 0.988 0.990 spring 0.967 0.991 Snap fastening 0.968 0.991 mAp 0.974 0.983 It can be seen that after the improvement of the model, the detection accuracy of stylus bending is improved from 0.988 to 0.990; the detection accuracy of spring-specific mismatch defects is improved from 0.967 to 0.991; and the detection accuracy of snap breakage is improved from 0.968 to 0.991. In order to verify the superiority of the improved YOLOv8 algorithm, the following improvement models are considered in this experiment to comprehensively evaluate the impact of different improvement strategies on the model performance. These include the YOLOv8s model, the YOLOv8s + A model improved using SIoU, the YOLOv8s + B model improved using the CESE_C2f module, and the YOLOv8s + A + B model combining the two improvements together. Table 1.2 Comparison of experimental results of model improvement Model name mAP50 mAP50:95 P(%) R(%) Params (M) GFLOPs YOLOv8s 97.4 67 97 94.2 11.12 28.5 YOLOv8s+A 98.1 67.3 98 95.4 11.8 25.8 YOLOv8s+B 98.1 67.3 98 95.4 11.0 25.5 YOLOv8s+A+B 98.3 67.3 98 96 8.04 22.0 From Table 1.2, it can be seen that after using A and B improvement, the mAP50, mAP50:95, accuracy and regression rate are all improved, indicating that the improvement can improve the accuracy; at the same time, the number of model parameters and the computational volume are reduced, and the real-time detection performance of the model is improved. After adopting A+B improvement, it is found that the mAP50 accuracy rate is further improved, and the model computational pressure is further reduced, and the operation economy of the model is improved, which is more in line with the needs of the assembly line production of airbags. By comparing the PR curves of the model before and after the improvement in Figs. 3 and 4, it can be clearly seen that the improved model is better than the original model in terms of performance. Among them, the performance effect is more significant on two types of targets, namely, STYLUS and SPRING. Specifically, the AP value of stylus improves from 0.988 to 0.991, while the AP value of spring improves from 0.967 to 0.991.These results indicate that the detection performance of the defect detection model is successfully enhanced by the improvement of the C2f module. Figure 4. Original Model PR Curve 55 Figure 5. Improved Model PR Curve 5. Conclusion In this paper, an automatic detection method based on improved YOLOv8 is proposed for three types of common defects (bent stylus, misaligned spring assembly, broken snap) in airbag production. With the support of self-constructed dataset and various data enhancements, the detection accuracy and efficiency of small target and complex deformation defects are effectively improved by using the SIoU loss function and optimizing the C2f module. The experimental results show that the improved model can meet the industrial inspection requirements in terms of detection speed and accuracy, and has good generalization ability and engineering application value. In the future, it can be further combined with multi-sensor fusion and lightweight deployment scheme to expand to more types of parts automatic visual inspection scenarios. References [1] Wang Xiang. Design and Optimization of Side Impact Safety of Automobiles [D]. Hunan University, 2009. [2] LIU Zijian,HUANG Tianze,ZHANG Jianhua et al. Research on airbag protection of automobile occupants against collision damage [J]. Journal of Mechanical Engineering, 2001, (05): 12- 17. [3] RONG Guolin, CHAO Yongsheng, JIANG Xiao, et al. A visual inspection algorithm for mechanical parts based on improved YOLOv8s model [J]. Combined Machine Tools and Automated Machining Technology, 2025, (03): 31-35+40. DOI:10.13462/j.cnki.mmtamt.2025.03.007. [4] Shi R ,Li Z ,Wu Z , et al.An industrial carbon block insta nce segmentation algorithm based on improved YOLOv8[J]. Scientific Reports,2025,15(1):8147-8147. [5] Liu G ,Yan Y ,Meng J . Study on the detection technology for inner-wall outer surface defects of the automotive ABS brake master cylinder based on BM-YOLOv8 [J]. Measurement Science and Technology, 2024, 35 (5): [6] Xie W ,Sun X ,Ma W . A light weight multi-scale feature fusion steel surface defect detection model based on YOLOv8 [J]. Measurement Science and Technology, 2024, 35 (5): [7] Liu L ,Li P ,Wang D , et al. A wind turbine damage detection algorithm designed based on YOLOv8 [J]. Applied Soft Computing, 2024, 154 111364-. [8] Chen Z ,Tian R ,Xiong D , et al. Multi-Dimensional Information Fusion You Only Look Once Network for Suspicious Object Detection in Millimeter Wave Images [J]. Electronics, 2024, 13 (4): [9] Guan H ,Deng H ,Ma X , et al. A corn canopy organs detection method based on improved DBi-YOLOv8 network [J]. European Journal of Agronomy, 2024, 154 127076-. [10] Zheng X ,Zou J ,Du S , et al. Small Target Detection in Refractive Panorama Surveillance Based on Improved YOLOv8. [J]. Sensors (Basel, Switzerland), 2024, 24 (3): [11] Lin Z ,Boqun L ,Yang C , et al. Research on improved YOLOv8 algorithm for insulator defect detection [J]. Journal of Real-Time Image Processing, 2024, 21 (1): [12] Li N ,Ye T ,Zhou Z , et al. Enhanced YOLOv8 with BiFPN- SimAM for Precise Defect Detection in Miniature Capacitors [J]. Applied Sciences, 2024, 14 (1): [13] H. Z W ,J. Y Z ,J. X W , et al. A YOLOV8-based approach for steel plate surface defect detection [J]. Metalurgija, 2024, 63 (1): 28-30. [14] Ma C ,Chi G ,Ju X , et al.YOLO-CWD: A novel model for crop and weed detection based on improved YOLOv8[J].Crop Protection,2025,192107169-107169.