Lightweight automobile body-in-white welding point quality detection method
The improved lightweight welding defect detection model DHN-YOLO solves the problems of low efficiency and low accuracy of traditional detection methods in automotive body-in-white weld point detection, achieving efficient and accurate weld point defect detection, and is suitable for real-time detection in intelligent manufacturing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUANGHE S & T COLLEGE
- Filing Date
- 2026-02-02
- Publication Date
- 2026-06-05
AI Technical Summary
Traditional inspection methods are inefficient and inaccurate in inspecting weld points on automotive body-in-white, and cannot effectively identify a variety of weld defects, affecting vehicle strength and safety.
An improved lightweight welding defect detection model, DHN-YOLO, is adopted, which combines a diversity branch block (DBB), a hierarchical spatial attention network (HSPAN), a dynamic sampling module (DySample), and a lightweight high-efficiency head (EH) to improve the accuracy and efficiency of weld joint defect detection.
It achieves high-precision weld defect detection, reduces computational costs and parameter redundancy, and improves small target recognition and boundary positioning capabilities, making it suitable for real-time detection in intelligent manufacturing.
Smart Images

Figure CN122156077A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent manufacturing technology, specifically relating to a method for quality inspection of weld points in lightweight automotive body-in-white. Background Technology
[0002] With the continuous advancement of intelligent manufacturing technology, weld quality inspection is playing an increasingly important role in the automotive industry. As a critical link in ensuring structural integrity and assembly quality during body-in-white (BIW) production, the number of weld points typically exceeds 4,000, and their quality directly affects the vehicle's strength, safety, and manufacturing stability. Weld defects take many forms, including false welds, spattered welds, lap welds, brazing, and twisted welds. These defects are usually caused by equipment errors, material inconsistencies, or environmental interference, and may lead to reduced structural strength or even safety hazards. Therefore, achieving accurate and efficient weld defect inspection has become a core requirement for intelligent body-in-white manufacturing.
[0003] In automotive body-in-white production, the large number of weld points and diverse defect types make traditional inspection methods inefficient and inaccurate. Therefore, there is an urgent need to design a new method for inspecting the quality of body weld points. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a scientifically sound, efficient, and highly accurate method for inspecting weld joint quality in lightweight automotive body-in-white. The method proposes an improved lightweight welding defect detection model (DHN-YOLO). This model is built on the YOLOv11n framework and incorporates three improvements: adding a diversity branch block (DBB) to the backbone to enrich multi-scale feature representation; integrating a hierarchical spatial attention network (HSPAN) and a dynamic sampling module (DySample) in the neck section to improve sensitivity to small targets and edge details; and employing a lightweight, efficient head (EH) to reduce redundancy and improve inference efficiency. DHN-YOLO provides high accuracy while reducing computational costs, offering an efficient and practical solution for welding quality inspection in intelligent manufacturing.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: a method for inspecting the quality of weld points in lightweight automotive body-in-white, comprising the following steps: S1. Based on YOLOv11n as the baseline model, construct a backbone network containing diversity branch blocks (DBB modules); S2. The design features a fusion neck structure, integrating a hierarchical spatial feature pyramid network (HSPAN module) and a DySample module; S3. Establish a lightweight, high-efficiency detection head (EH) that shares the two base convolutional layers between the classification and regression branches. S4. Establish specific evaluation indicators for weld joint defects to quantitatively evaluate the model performance and obtain the weld joint inspection quality results. S5. Conduct a quality inspection experiment on the weld points of the automotive body-in-white.
[0006] Furthermore, in step S1, a DBB module is introduced into the backbone network. This module extracts spatial features at different scales through multi-branch parallel convolutions and combines batch normalization, feature concatenation, and multi-scale fusion to enhance the model's ability to represent features of small-sized and shaped weld points. The DBB module adopts a training-inference decoupling design. During training, a multi-branch structure is used to enhance feature learning, while during inference, it is equivalently converted to a single convolution, balancing performance and efficiency.
[0007] Furthermore, step S2 specifically includes the following processes: The HSPAN module aims to enhance the attention response in the spatial dimension by explicitly modeling the importance of different spatial locations, thereby highlighting the solder joint area. Its core mechanism includes applying average pooling and max pooling operations along the channel dimension of the input feature map, concatenating the results, and then applying convolution operations to generate a spatial attention weight map. (1) In the formula, This is the input feature map, where [;] indicates concatenation along the channel direction. s It is the sigmoid function; then the resulting spatial attention map is sorted element by element. Applied to input features: (2) This process enhances the model's focus on high-response areas around the weld, improving its robustness in detecting small-scale defects such as spatter and false welds. The DySample module employs a dynamic, position-aware sampling strategy, replacing the traditional fixed-mesh sampling method, to handle the irregular shapes and textures of real-world solder joints. Its sampling process is as follows: (3) In the formula, Y ( p ) is the output at the specified location. X It is a learnable offset that is adaptively sampled from the input. oh i These are the convolution kernel weights. k This indicates the number of sampling points; this mechanism can capture local geometric features more accurately without significantly increasing the number of parameters. By combining the spatial attention capabilities of HSPAN with the adaptive sampling of DySample, the proposed network preserves both low-level edge details and high-level semantic context. This significantly improves the ability to identify small targets and locate boundaries in solder joint detection, providing high-quality feature input for the detection head.
[0008] Furthermore, step S3 specifically involves: simplifying the structure of the original decoupled detection head by sharing two basic convolutional layers between the classification and regression branches, thereby reusing parameters. This reduces computational complexity while maintaining classification and localization accuracy, and improves the feasibility of deploying the model on embedded devices. Furthermore, in step S4, the specific evaluation indicators for weld defects include precision P, recall R, and mean precision mAP, which comprehensively measure the model's accuracy, robustness, and generalization ability in detecting various welding defects; at the same time, the number of statistical parameters and computational complexity are reduced to ensure that the method meets the needs of real-time industrial detection. Detection accuracy is particularly important because too many false alarms can lead to unnecessary rework or inspection delays. Accuracy values... (4) Mean precision: (5) A high recall rate ensures that no defective solder joints are missed, thereby enhancing production safety and preventing potential structural failures. Recall rate: (6) TP (True Positive) refers to the number of solder joint defects correctly detected by the model, FP (False Positive) indicates that a defect-free solder joint is incorrectly identified as defective, and FN (False Negative) refers to actual solder joint defects that the model fails to detect.
[0009] Furthermore, step S5 specifically involves constructing a dedicated dataset containing 4134 solder joint images across eight categories: normal solder joints, spurious solder joints, edge solder joints, defective solder joints, spattered solder joints, overlapping solder joints, copper solder joints, and twisted solder joints. This dataset is divided into training, validation, and test sets in approximately a 7:2:1 ratio. The dataset was collected from an actual automotive body-in-white (BIW) production plant to ensure its authenticity and representativeness for industrial applications. All experiments were conducted on a Windows 11 system equipped with an Intel(R) Core(TM) i7-14650HX CPU and an NVIDIA RTX 4060 8GB GPU; the model was implemented using PyTorch 2.5.1, Python 3.11.10, and CUDA 12.6.
[0010] By adopting the above technical solution, compared with the prior art, the present invention has the following technical effects (significant progress): This invention addresses the challenges of detecting welding defects in automotive body-in-white by proposing an improved lightweight detection model: DHN-YOLO. These challenges include complex surface materials, diverse defect types, and small-scale features. Based on YOLOv11n, this model introduces three structural enhancements: a diversity branch block (DBB) in the backbone to enhance multi-scale feature modeling capabilities; a hierarchical spatial attention network (HSPAN) combined with a DySample module in the neck to achieve spatial attention guidance and edge detail preservation; and an efficient head (EH) design to reduce parameter redundancy and computational overhead while maintaining high detection accuracy. Experiments demonstrate that DHN-YOLO outperforms mainstream lightweight models in key metrics such as precision, recall, and mean precision. In terms of efficiency, DHN-YOLO requires only 1.71 million parameters and 420 million floating-point operations (GFLOPs), significantly reducing computational complexity and storage requirements compared to YOLOv11n, thus exhibiting excellent lightweight characteristics and engineering deployability. Attached Figure Description
[0011] Figure 1 This is a flowchart illustrating the present invention. Detailed Implementation
[0012] The embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples.
[0013] like Figure 1 As shown, a method for inspecting the quality of weld points in a lightweight automotive body-in-white according to the present invention includes the following steps: S1. Based on YOLOv11n as the baseline model, construct a backbone network containing diversity branch blocks (DBB modules); S2. The design features a fusion neck structure, integrating a hierarchical spatial feature pyramid network (HSPAN module) and a DySample module; S3. Establish a lightweight, high-efficiency detection head (EH) that shares the two base convolutional layers between the classification and regression branches. S4. Establish specific evaluation indicators for weld joint defects to quantitatively evaluate the model performance and obtain the weld joint inspection quality results. S5. Conduct a quality inspection experiment on the weld points of the automotive body-in-white.
[0014] In step S1, a DBB module is introduced into the backbone network. It extracts spatial features at different scales through multi-branch parallel convolution and combines batch normalization, feature concatenation and multi-scale fusion to enhance the model's ability to represent features of small-sized and diverse solder joints. The DBB module adopts a training-inference decoupling design. During training, a multi-branch structure is used to enhance feature learning, and during inference, it is equivalently converted to a single convolution, balancing performance and efficiency.
[0015] Step S2 specifically includes the following processes: The HSPAN module aims to enhance the attention response in the spatial dimension by explicitly modeling the importance of different spatial locations, thereby highlighting the solder joint area. Its core mechanism includes applying average pooling and max pooling operations along the channel dimension of the input feature map, concatenating the results, and then applying convolution operations to generate a spatial attention weight map. (1) In the formula, This is the input feature map, where [;] indicates concatenation along the channel direction. s It is the sigmoid function; then the resulting spatial attention map is sorted element by element. Applied to input features: (2) This process enhances the model's focus on high-response areas around the weld, improving its robustness in detecting small-scale defects such as spatter and false welds. The DySample module employs a dynamic, position-aware sampling strategy, replacing the traditional fixed-mesh sampling method, to handle the irregular shapes and textures of real-world solder joints. Its sampling process is as follows: (3) In the formula, Y ( p ) is the output at the specified location. X It is a learnable offset that is adaptively sampled from the input. oh i These are the convolution kernel weights. k This indicates the number of sampling points; this mechanism can capture local geometric features more accurately without significantly increasing the number of parameters. By combining the spatial attention capabilities of HSPAN with the adaptive sampling of DySample, the proposed network preserves both low-level edge details and high-level semantic context. This significantly improves the ability to identify small targets and locate boundaries in solder joint detection, providing high-quality feature input for the detection head.
[0016] Step S3 involves simplifying the structure of the original decoupled detection head by sharing two basic convolutional layers between the classification and regression branches. This enables parameter reuse, reducing computational complexity while maintaining classification and localization accuracy, and improving the feasibility of deploying the model on embedded devices. In step S4, the specific evaluation indicators for weld defects include precision P, recall R, and mean precision mAP, which comprehensively measure the model's accuracy, robustness, and generalization ability for detecting various welding defects; at the same time, the number of statistical parameters and computational complexity are reduced to ensure that the method meets the needs of real-time industrial detection. Detection accuracy is particularly important because too many false alarms can lead to unnecessary rework or inspection delays. Accuracy values... (4) Mean precision: (5) A high recall rate ensures that no defective solder joints are missed, thereby enhancing production safety and preventing potential structural failures. Recall rate: (6) TP (True Positive) refers to the number of solder joint defects correctly detected by the model, FP (False Positive) indicates that a defect-free solder joint is incorrectly identified as defective, and FN (False Negative) refers to actual solder joint defects that the model fails to detect.
[0017] Step S5 specifically involves constructing a dedicated dataset containing 4134 solder joint images across eight categories: normal solder joints, spurious solder joints, edge solder joints, defective solder joints, spattered solder joints, overlapping solder joints, copper solder joints, and twisted solder joints. This dataset is divided into training, validation, and test sets in approximately a 7:2:1 ratio. The dataset was collected from an actual automotive body-in-white (BIW) production plant to ensure its authenticity and representativeness for industrial applications. All experiments were conducted on a Windows 11 system equipped with an Intel(R) Core(TM) i7-14650HX CPU and an NVIDIA RTX 4060 8GB GPU; the model was implemented using PyTorch 2.5.1, Python 3.11.10, and CUDA 12.6.
[0018] To verify the performance advantages of the proposed improved model DHN-YOLO, comparative experiments were conducted against several mainstream advanced models in the field of automotive body defect detection. Each comparative model was trained and tested based on its officially released configuration. The comparison results are shown in Table 1, comprehensively demonstrating the performance differences in precision, recall, and mean precision.
[0019] Table 1 Comparative test results
[0020] As can be seen from the comparative experimental results in Table 1, the proposed DHN-YOLO model demonstrates overall advantages in detecting weld point defects in automotive body-in-white assemblies. In terms of detection accuracy, DHN-YOLO achieves a precision and recall rate of 95.3%, both higher than mainstream lightweight models such as YOLOv5n, YOLOv8n, and YOLOv9t, indicating stronger robustness in terms of accuracy and completeness of defect identification. Notably, DHN-YOLO achieves 97.1% and 72.7% mAP@0.5 and mAP@0.5:0.95 respectively, maintaining high precision while ensuring strong generalization ability in complex scenarios.
[0021] In terms of computational efficiency, DHN-YOLO requires only 1.71 million parameters and 4.2 GFLOPs (per billion floating-point operations), which is 33.7% smaller in parameter size and 33.3% lower in computational cost compared to YOLOv11n (2.58 million parameters and 6.3 GFLOPs), thus highlighting the advantages of its lightweight design.
[0022] The above embodiments illustrate the basic principles and features of the present invention, but are merely preferred embodiments and are not limited to these embodiments. Those skilled in the art, inspired by this patent, can make many modifications and improvements without departing from the spirit and scope of the claims, all of which fall within the scope of protection of the present invention. Therefore, the scope of this patent and its protection should be determined by the appended claims.
Claims
1. A method for inspecting the quality of weld points in lightweight automotive body-in-white, characterized in that: Includes the following steps: S1. Based on YOLOv11n as the baseline model, construct a backbone network containing diversity branch blocks (DBB modules); S2. The design features a fusion neck structure, integrating a hierarchical spatial feature pyramid network (HSPAN module) and a DySample module; S3. Establish a lightweight, high-efficiency detection head (EH) that shares the two base convolutional layers between the classification and regression branches. S4. Establish specific evaluation indicators for weld joint defects to quantitatively evaluate the model performance and obtain the weld joint inspection quality results. S5. Conduct a quality inspection experiment on the weld points of the automotive body-in-white.
2. The method for inspecting the quality of weld points in a lightweight automotive body-in-white according to claim 1, characterized in that: In step S1, a DBB module is introduced into the backbone network. It extracts spatial features at different scales through multi-branch parallel convolution and combines batch normalization, feature concatenation and multi-scale fusion to enhance the model's ability to represent features of small-sized and diverse solder joints. The DBB module adopts a training-inference decoupling design. During training, a multi-branch structure is used to enhance feature learning, and during inference, it is equivalently converted to a single convolution, balancing performance and efficiency.
3. The method for inspecting the quality of weld points in a lightweight automotive body-in-white according to claim 1, characterized in that: Step S2 details The process includes the following: The HSPAN module aims to enhance attention response in spatial dimensions by explicitly modeling the importance of different spatial locations, thereby highlighting the solder joint area; Its core mechanism includes applying average pooling and max pooling operations along the channel dimension of the input feature map, concatenating the results, and then applying convolution operations to generate a spatial attention weight map. (1) In the formula, This is the input feature map, where [;] indicates concatenation along the channel direction. σ It is the sigmoid function; then the resulting spatial attention map is sorted element by element. Applied to input features: (2) This process enhances the model's focus on high-response areas around the weld, improving its robustness in detecting small-scale defects such as spatter and false welds. The DySample module employs a dynamic, position-aware sampling strategy, replacing the traditional fixed-mesh sampling method, to handle the irregular shapes and textures of real-world solder joints. Its sampling process is as follows: (3) In the formula, Y ( p ) is the output at the specified location. X It is a learnable offset that is adaptively sampled from the input. ω i These are the convolution kernel weights. k This indicates the number of sampling points; this mechanism can capture local geometric features more accurately without significantly increasing the number of parameters. By combining the spatial attention capabilities of HSPAN with the adaptive sampling of DySample, the proposed network preserves both low-level edge details and high-level semantic context. This significantly improves the ability to identify small targets and locate boundaries in solder joint detection, providing high-quality feature input for the detection head.
4. The method for inspecting the quality of weld points in a lightweight automotive body-in-white according to claim 1, characterized in that: Step S3 involves simplifying the structure of the original decoupled detection head by sharing the two basic convolutional layers between the classification and regression branches. This enables parameter reuse, reduces computational complexity while maintaining classification and localization accuracy, and improves the feasibility of deploying the model on embedded devices.
5. The method for inspecting the quality of weld points in a lightweight automotive body-in-white according to claim 1, characterized in that: In step S4, the specific evaluation indicators for weld defects include precision P, recall R, and mean precision mAP, which comprehensively measure the model's accuracy, robustness, and generalization ability for detecting various welding defects; at the same time, the number of statistical parameters and computational complexity are reduced to ensure that the method meets the needs of real-time industrial detection. Detection accuracy is particularly important because too many false alarms can lead to unnecessary rework or inspection delays. Accuracy values... (4) Mean precision: (5) A high recall rate ensures that no defective solder joints are missed, thereby enhancing production safety and preventing potential structural failures. Recall rate: (6) TP (True Positive) refers to the number of solder joint defects correctly detected by the model, FP (False Positive) indicates that a defect-free solder joint is incorrectly identified as defective, and FN (False Negative) refers to actual solder joint defects that the model fails to detect.
6. The method for inspecting the quality of weld points in a lightweight automotive body-in-white according to claim 1, characterized in that: Step S5 specifically involves constructing a dedicated dataset containing 4134 solder joint images across eight categories: normal solder joints, spurious solder joints, edge solder joints, defective solder joints, spattered solder joints, overlapping solder joints, copper solder joints, and twisted solder joints. This dataset is divided into training, validation, and test sets in approximately a 7:2:1 ratio. The dataset was collected from an actual automotive body-in-white (BIW) production plant to ensure its authenticity and representativeness for industrial applications. All experiments were conducted on a Windows 11 system equipped with an Intel(R) Core(TM) i7-14650HX CPU and an NVIDIA RTX 4060 8GB GPU; the model was implemented using PyTorch 2.5.1, Python 3.11.10, and CUDA 12.6.