Welding mark defect detection method and device and storage medium
By improving the YOLOv11 model and BiFPN network, and combining the diffusion model and hybrid attention algorithm, diverse defect samples are generated, which solves the problems of insufficient samples and real-time performance in the welding inspection of lithium battery connectors, and achieves high-precision and efficient weld defect detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEFEI GUOXUAN HIGH TECH POWER ENERGY
- Filing Date
- 2026-01-22
- Publication Date
- 2026-05-05
AI Technical Summary
Existing technologies for detecting welding defects in lithium battery connectors suffer from insufficient sample size and difficulty in meeting real-time requirements, resulting in limitations in detection accuracy and speed.
An improved YOLOv11 model is adopted, which uses a bidirectional parallel feature propagation topology and BiFPN network, combined with a diffusion model and a hybrid attention algorithm, to generate diverse defect samples, and then perform feature fusion and reconstruction to improve detection accuracy and speed.
It enhances the robustness and generalization of weld mark defect detection, meets the requirements for millisecond-level real-time detection, and improves detection accuracy and efficiency.
Smart Images

Figure CN121981990A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of welding quality inspection technology, and in particular relates to a method, device and storage medium for detecting weld defects. Background Technology
[0002] As a key component for internal electrical connections in lithium batteries, the welding quality of lithium battery connectors directly affects the battery's conductivity, safety, and lifespan. Therefore, quality control of connectors, especially the inspection of weld quality, is crucial. In the manufacturing process of lithium batteries, improper production processes can lead to batteries failing to meet production standards, thus affecting the normal operation of the production line. Currently, anomaly detection in connectors mainly relies on traditional machine vision technology. However, traditional machine vision technology can typically only process simple, regular image features, while images acquired from laser welding of connectors usually contain rich color information, including metallic luster, coating color, and background texture. These factors can interfere with traditional grayscale processing or simple color space conversion, making it difficult for machine vision algorithms to accurately identify defective areas.
[0003] With the development of deep learning technology, defect detection algorithms based on convolutional neural networks have been widely used. For example, Chinese patent CN114862777A, entitled "A Method and System for Detecting Welded Connector Pieces," uses an instance segmentation algorithm to simultaneously locate, classify, and segment defect targets at the pixel level. However, in practical industrial applications, these algorithms face numerous challenges. On the one hand, due to the relatively mature manufacturing process of power lithium batteries, the number of defect samples encountered in actual production is limited, leading to insufficient samples during the training process of deep learning models, severely affecting the model's generalization ability and detection accuracy. On the other hand, although anomaly detection algorithms can alleviate the problem of insufficient samples to some extent, the detection speed requirements at the power lithium battery production site are extremely high, typically requiring the processing of a single image at the millisecond level, making it difficult to meet real-time requirements. Summary of the Invention
[0004] The purpose of this invention is to provide a method, device and storage medium for detecting solder stamp defects. By improving the feature fusion module of the YoLov11 model, its feature extraction and fusion capabilities are enhanced. Defect samples are constructed based on the collected normal samples to train the improved YoLov11 model, thereby improving the model's defect detection accuracy and speed.
[0005] To achieve the above objectives, the present invention is implemented using the following technical solution:
[0006] In a first aspect, the present invention provides a method for detecting solder joint defects, comprising:
[0007] Acquire images of the solder joints of the battery under test;
[0008] The solder image of the battery connector to be tested is input into a pre-trained defect detection model to obtain the solder defect detection result; the solder defect detection result includes the defect detection category and the corresponding detection box;
[0009] The defect detection model is obtained by replacing the phased unidirectional serial feature propagation path in the YOLOv11 model with a bidirectional parallel feature propagation topology. The sample set used to train the defect detection model includes normal samples and diverse defect samples. The normal samples include normal solder images collected during the historical welding process of battery connectors. The defect samples include defect solder images collected during the historical welding process of battery connectors and defect solder reconstructed images obtained by reconstructing defects from normal solder images.
[0010] By using historical normal weldment images and defective weldment images as a foundation, and employing defect sample synthesis technology based on normal weldment images, the bottleneck problem of scarce defect samples in industrial scenarios is solved. The defect detection model is trained simultaneously using normal samples and diverse defect samples, ensuring a high degree of matching between the training data distribution and the actual application scenario. This allows the model to cover various weldment situations in practical applications, improving the accuracy of defect category judgment and defect region identification. Furthermore, the phased unidirectional serial feature propagation path of YOLOv11 is replaced with a bidirectional parallel feature propagation topology, enabling the model to process features at different semantic levels in parallel. This significantly enhances the perception and recognition capabilities of multi-scale defect targets, improving the robustness and generalization of weldment defect detection.
[0011] Optionally, the defect detection model is obtained by replacing PANet of the YOLOv11 neck network with BiFPN.
[0012] By introducing learnable weight parameters through BiFPN, the network can automatically evaluate and balance the importance of feature maps at different scales during feature fusion, avoiding the shortcomings of PANet where features at all scales are treated equally. While retaining the ability to fuse multi-scale features, it reduces redundant computation through an efficient weighted fusion mechanism, lowers the model's computational complexity, and improves forward inference speed, thus better meeting the millisecond-level real-time detection requirements of production lines. In addition, BiFPN's bidirectional cross-scale connection design enhances the feature representation ability of small targets and detailed defects, improving localization accuracy and segmentation mask quality.
[0013] Optionally, both the defective solder image and the normal solder image are obtained by real-time acquisition of the historical welding process of the battery connector by an industrial CCD camera, and after standardization of the pixel values of each channel.
[0014] By standardizing the pixel values of each channel in the images collected during historical welding processes, the training convergence speed of the subsequent weld defect detection model can be effectively accelerated, preventing gradient explosion or vanishing problems. At the same time, the model can make full use of the weights pre-trained on the expanded sample set for transfer learning, improving training efficiency and detection accuracy.
[0015] Optionally, the defective weld reconstructed image obtained by defect reconstruction of a normal weld image includes:
[0016] Defects are injected into normal solder joint images using a diffusion model to obtain low-resolution composite images of defective solder joints.
[0017] The hybrid attention algorithm is used to reconstruct the low-resolution defect weld image, resulting in a defect weld reconstruction image with the same resolution as the images collected during the historical welding process.
[0018] By using a diffusion model to inject defects at low resolution, the computational load and memory usage of the generation process are significantly reduced, making it possible to deploy on limited hardware resources. Subsequently, a hybrid attention algorithm is used to perform super-resolution reconstruction on the low-resolution synthetic image, accurately restoring it to the target resolution and effectively preserving the texture details of the generated tiny defects. This ensures both generation efficiency and the industrial-grade detection accuracy requirements of the final image, achieving high-quality defect sample expansion under resource constraints and resolving the contradiction between hardware memory limitations and the need for high-resolution defect image generation.
[0019] Optionally, the step of injecting defects into a normal solder joint image using a diffusion model to obtain a low-resolution composite image of defective solder joints includes:
[0020] Gaussian noise is gradually added to a normal solder joint image to obtain a noisy image; the expression for adding Gaussian noise to the normal solder joint image in step t is:
[0021] ,
[0022] in, The image at time t is a noisy image. This is the initial, normal solder joint image. The cumulative product of noise scheduling parameters. Standard Gaussian noise;
[0023] A denoising algorithm is used to denoise the noisy image, and defect guidance conditions are introduced during the denoising process to generate a low-resolution composite image of defective weld marks; wherein, the defect guidance conditions include preset defect prompt words.
[0024] By gradually adding Gaussian noise in a forward diffusion process, the model can learn the complete degradation distribution from clear images to pure noise, establishing a mathematical foundation for reverse generation. Preset prompts are introduced in the reverse generation process, which realizes the controllability and diversity of defect generation. It can generate different types, shapes and locations of weld defects according to needs, enriching the distribution space of training samples and enhancing the model's adaptability to various unknown defect patterns.
[0025] Optionally, the step of using a hybrid attention algorithm to reconstruct the low-resolution defect weld image to obtain a reconstructed defect weld image with the same resolution as the images acquired during the historical welding process includes:
[0026] A convolution operation is performed on the low-resolution composite image of defective weld marks to obtain an initial feature map;
[0027] The initial feature map is captured locally using a window attention mechanism, and the channel weights of the initial feature map are dynamically adjusted using a channel attention mechanism to obtain a reconstructed image of the defective weld mark with a resolution consistent with the acquired image.
[0028] The window attention mechanism divides the feature map into non-overlapping windows and independently calculates self-attention within each window, significantly reducing the computational complexity of global self-attention while effectively capturing local details and texture features of solder defects. The channel attention mechanism dynamically adjusts the weights of each feature channel, enabling the model to adaptively focus on feature channels that are more important for defect reconstruction and suppress irrelevant background noise. The hybrid attention mechanism, which combines the two, balances computational efficiency and reconstruction quality, ensuring that the super-resolution image can clearly and accurately restore defect details while meeting industrial inspection requirements.
[0029] Optionally, the defect detection model includes a backbone network, a neck network containing the BiFPN, and a detection head;
[0030] The training method for the defect detection model includes:
[0031] The backbone network extracts features from the input sample images to obtain multi-scale global semantic features.
[0032] Cross-scale fused features are obtained by fusing multi-scale global semantic features through a neck network;
[0033] The detection head obtains the solder stamp defect detection result based on cross-scale fusion feature mapping; wherein, the solder stamp defect detection result also includes a confidence score;
[0034] Loss is calculated based on the defect detection category and the pre-labeled true defect category of the sample image, the detection box and the pre-labeled true box of the sample image, and the confidence score and the pre-labeled true label of the sample image; wherein, the defect category includes no defect and defect present; the pre-labeled true box of normal samples includes the weldment area boundary box; the pre-labeled true box of defect samples includes the defect area boundary box;
[0035] The parameters of the defect detection model are adjusted based on the loss calculation results to obtain a trained defect detection model.
[0036] By pre-annotating the boundaries of the overall weldment area on normal samples, positional supervision signals are provided for the defect detection model during training, helping the defect detection model learn the overall features of normal weldments and further improving the accuracy of the defect detection model in identifying defect categories.
[0037] Optionally, the process of fusing multi-scale global semantic features through the neck network to obtain cross-scale fused features includes:
[0038] BiFPN is used to extract multi-level bidirectional features from multi-scale global semantic features, and the extracted multi-level bidirectional features are then weighted and fused.
[0039] The steps for bidirectional feature extraction at each layer include:
[0040] In the top-down path, the deep semantic features in the multi-scale global semantic features are upsampled through the Upsample layer, and the upsampled features are concatenated with the features of the corresponding scale in the multi-scale global semantic features. Then, the concatenated features are enhanced by the C2f module.
[0041] In the bottom-up path, separable deep convolutional layers are used to downsample the low-level semantic features in the multi-scale global semantic features. The downsampled features are then concatenated with the features of the corresponding scale in the top-down path. The concatenated features are then enhanced by the C2f module to output a cross-scale fused feature vector.
[0042] The bidirectional fusion mechanism achieves the complementarity and enhancement of semantic and spatial information, enabling the output cross-scale fused feature vector to have strong semantic discriminative power and accurate positioning ability, thereby improving the detection performance of small target defects and boundary ambiguity defects.
[0043] In a second aspect, the present invention provides a solder stamp defect detection device, comprising:
[0044] The module for acquiring images of solder marks under test is used to acquire images of solder marks on the connectors of the battery under test.
[0045] Defect detection result acquisition module: used to input the solder image of the battery connector piece under test into the pre-trained defect detection model to obtain the solder defect detection result; wherein, the solder defect detection result includes the defect detection category and the corresponding detection box;
[0046] The defect detection model is obtained by replacing the phased unidirectional serial feature propagation path in the YOLOv11 model with a bidirectional parallel feature propagation topology. The sample set used to train the defect detection model includes normal samples and diverse defect samples. The normal samples include normal solder images collected during the historical welding process of battery connectors. The defect samples include defect solder images collected during the historical welding process of battery connectors and defect solder reconstructed images obtained by reconstructing defects from normal solder images.
[0047] The detection method is modularized by the device, which clarifies the functional division between the module for acquiring the image of the weld stamp to be tested and the module for acquiring the defect detection result. This facilitates hardware deployment and software integration on the actual production line. The modular design improves the maintainability and scalability of the system. When it is necessary to upgrade the camera or change the detection algorithm, only the corresponding module needs to be replaced without affecting the overall architecture.
[0048] Thirdly, the present invention provides a computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the solder stamp defect detection method as described in any of the first aspects.
[0049] By solidifying the above detection method in the form of a computer program product, a carrier for software deployment is provided, which makes the technical solution for detecting weld defects easy to install in existing industrial control computers, servers or edge computing devices, and can achieve specific technical effects without changing the hardware structure.
[0050] Compared with existing technologies, the beneficial effects achieved by this invention are as follows: A lightweight YOLOv11 instance segmentation model is used, and its feature fusion network is improved. The phased unidirectional serial feature propagation path in the feature fusion network is replaced with a bidirectional parallel feature propagation topology to form a defect detection model, enhancing the model's multi-scale feature extraction and fusion capabilities. While maintaining high accuracy, the defect detection speed is significantly improved, meeting the millisecond-level real-time detection requirements of battery connector welding production lines. Furthermore, defect weld samples are generated based on normal weld samples, increasing sample richness and further improving the detection accuracy of the defect detection model. A diffusion model is used to generate industrial defects. The diffusion model employs a dual mechanism of forward diffusion and reverse diffusion. The forward diffusion process gradually adds noise to the normal image, while the reverse diffusion process learns to reconstruct the defect image from the noise. This allows the model to learn the complex feature distribution of real defects, generating diverse and highly realistic training samples, greatly alleviating the problem of scarce industrial defect samples. A resolution-grading enhancement strategy of low-resolution generation and super-resolution reconstruction is adopted. First, an image is generated at a lower resolution, and then a super-resolution algorithm is used to upscale the generated medium-resolution image to the target resolution, overcoming the limitations of hardware memory on high-resolution image generation. Attached Figure Description
[0051] Figure 1 The diagram shown is a flowchart of a solder mark defect detection method in one embodiment of the present invention. Detailed Implementation
[0052] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.
[0053] Example 1
[0054] like Figure 1 As shown, this embodiment provides a method for detecting solder stamp defects, including the following steps:
[0055] Step S1: Acquisition and annotation of solder stamp images
[0056] Image acquisition: An industrial CCD camera is used to acquire images in real time during the welding process of lithium battery connectors. The original image resolution is 4000 * 3000 pixels. The acquired data includes normal solder samples and various defect samples.
[0057] Data standardization: To accelerate model convergence and prevent gradient explosion, the acquired images are normalized. Assume the input image is... The pixel values of each channel are normalized using Z-Score, and the calculation formula is as follows:
[0058] ,
[0059] in, and These represent the mean and standard deviation of the ImageNet dataset across the three RGB channels, respectively. For standardized images.
[0060] Image annotation: The labelme annotation tool is used to annotate the bounding boxes of defective regions in standardized images. The defect category is marked as 1, indicating that a defect exists, and the confidence label is marked as 1. For images without defects, the bounding boxes of weld areas are annotated, the defect category is marked as 0, indicating that there is no defect, and the confidence label is marked as 0.
[0061] Step S2: The DualAnoDiff algorithm generates defect samples.
[0062] To address the scarcity of industrial defect samples, a stable-Diffusion-based DualAnoDiff algorithm is employed to generate diverse defect samples. This process comprises two stages: forward diffusion and reverse generation.
[0063] Forward diffusion process (noise addition): into normal samples Gaussian noise is gradually added to the mixture until it tends towards an isotropic Gaussian distribution. The noise addition process at step t can be represented as:
[0064] ,
[0065] in, The image at time t is a noisy image. The cumulative product of noise scheduling parameters. This is standard Gaussian noise. Through this process, the texture structure of normal samples is destroyed, transforming them into a latent feature space distribution.
[0066] Reverse generation process (defect reconstruction): The trained denoising network predicts noise and reconstructs the image. A defect-guided condition is introduced during this process to inject defect features while denoising, generating a composite image of the defect weldment with a resolution of 1280*1280. .
[0067] Step S3: HAT super-resolution reconstruction restores resolution
[0068] To overcome the memory limitations of generative models and reproduce the details required for industrial-grade inspection, a hybrid attention HAT method is used to synthesize low-resolution defect weldment images. The model is then reconstructed. The HAT model uses Window Attention to capture local features, while Channel Attention enhances global information interaction.
[0069] Super-resolution process: synthesizing images of generated defective solder marks. Input the HAT model, and the model learns the mapping relationship from the low-resolution space to the high-resolution space. Outputs high-resolution images of defective solder joints. :
[0070] ,
[0071] in, These are the weight parameters for the HAT model. The output... The resolution has been increased to 4000*3000, while retaining the details of the generated minor imperfections in the texture.
[0072] Image annotation: The labelme annotation tool was used to annotate the boundary boxes of the defective weld reconstructed image, and the defect category was labeled as 1 and the confidence label was labeled as 1.
[0073] Combine the labeled samples from step S1 and step S3 to construct a sample set for training the defect detection model.
[0074] Step S4: Build and train the defect detection model
[0075] The YOLOv11 instance segmentation algorithm was selected as the basic detection framework, and its neck network was optimized: the original PANet (path aggregation network) structure was replaced with BiFPN (weighted bidirectional feature pyramid network) to enhance multi-scale feature fusion capabilities, reduce computational overhead, and improve detection speed, resulting in the YOLOv11-BiFPN model as the defect detection model. BiFPN introduces learnable weights to balance the importance of feature maps at different scales, performing bidirectional feature extraction on multi-scale global semantic features at multiple nodes, and then weighting and fusing the extracted bidirectional features from each node. The weighted fusion formula for a specific node is as follows:
[0076] ,
[0077] in, The output features after fusion For the input feature layer, For the corresponding learnable weights, , To prevent the denominator from being Small amount.
[0078] The bidirectional feature extraction steps at each node in BiFPN include: In the top-down path, the deep semantic features in the multi-scale global semantic features are upsampled through the Upsample layer, and the upsampled features are concatenated with the corresponding scale features in the multi-scale global semantic features. Then, the concatenated features are refined by the C2f module. In the bottom-up path, the low-level semantic features in the multi-scale global semantic features are downsampled through the separable depthwise convolutional layer, and the downsampled features are concatenated with the corresponding scale features in the upsampled path. Then, the concatenated features are refined by the C2f module, and a cross-scale fused feature vector is output.
[0079] YOLOv11-BiFPN instance splitting:
[0080] The input to the defect detection model is a 4000 * 3000 sample image. The backbone network extracts features from the input 4000 * 3000 sample images to obtain multi-scale global semantic features. The neck network performs weighted fusion of the multi-scale global semantic features to obtain cross-scale fusion features. The detection head outputs the defect category, detection box (location coordinates, segmentation mask) and confidence score based on the cross-scale fusion feature mapping.
[0081] The loss function for defect categories uses Focal Loss, and the calculation formula is as follows:
[0082] ,
[0083] in, Loss is categorized as defect type. Balance the weights for each category; Predict probabilities for the class of the model.
[0084] The loss function for the detection boxes is CIoU Loss, and the calculation formula is as follows:
[0085] ,
[0086] in, The intersection-union ratio is defined as the ratio of the area of the intersection of two frames to the area of their union. The square of the Euclidean distance between the center point of the detection box and the center point of the ground truth box (the sum of the squares of the coordinate differences between the two center points); The square of the diagonal length of the smallest closed rectangle that covers both frames (the sum of the squares of the rectangle's width and height). To measure the consistency of the aspect ratio between the detection bounding box and the ground truth bounding box, It is an adaptive weighting coefficient that balances the influence of the aspect ratio term.
[0087] The loss function for confidence is the binary cross-entropy, calculated as follows:
[0088] ,
[0089] in, For confidence loss, This is the true confidence level label. This represents the confidence score for the prediction.
[0090] The formula for calculating the combined loss of the solder stamp inspection model is as follows:
[0091] ,
[0092] in, As the weight for confidence loss, when the defect category is normal solder joint, set to When the value is close to 0, and the defect category is defective solder mark, set it to... =1; The weights for the loss based on the defect category; The weights are used to calculate the loss of the detection boxes.
[0093] Results output and post-processing:
[0094] Non-maximum suppression (NMS): After the model outputs prediction results, redundant detection boxes are removed using NMS. An IoU threshold of 0.45 is set; for detection boxes with an overlap exceeding this threshold, the one with the highest confidence is retained.
[0095] Coordinate mapping: The detected defect coordinates (x, y, w, h) and segmentation mask are directly mapped onto the 4000*3000 sample image, and the defect type, confidence score, and defect location information predicted in the current iteration are output.
[0096] Step S4: Application of Defect Detection Model
[0097] The image of the weld bead to be tested is acquired and preprocessed to make its size, resolution and other parameters consistent with the sample image. The preprocessed image of the weld bead to be tested is then input into the trained defect detection model to obtain the predicted location and type of weld bead defect.
[0098] Example 2
[0099] This embodiment provides a solder stamp defect detection device, including:
[0100] The module for acquiring images of solder marks under test is used to acquire images of solder marks on the connectors of the battery under test.
[0101] Defect detection result acquisition module: used to input the solder image of the battery connector piece under test into the pre-trained defect detection model to obtain the solder defect detection result; wherein, the solder defect detection result includes the defect detection category and the corresponding detection box;
[0102] The defect detection model is obtained by replacing the phased unidirectional serial feature propagation path in the YOLOv11 model with a bidirectional parallel feature propagation topology. The sample set used to train the defect detection model includes normal samples and diverse defect samples. The normal samples include normal solder images collected during the historical welding process of battery connectors. The defect samples include defect solder images collected during the historical welding process of battery connectors and defect solder reconstructed images obtained by reconstructing defects from normal solder images.
[0103] The apparatus provided in this embodiment can execute the solder stamp detection method provided in any step of Embodiment 1, and has the corresponding functional modules and beneficial effects of the method.
[0104] Example 3
[0105] This embodiment provides a computer storage medium storing a computer program. When the computer program is executed by a processor, it implements the solder mark detection method provided in any step of Embodiment 1.
[0106] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0107] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0108] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0109] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0110] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
Claims
1. A method for detecting weld stamp defects, characterized in that, include: Acquire images of the solder marks on the connectors of the battery under test; The solder image of the battery connector to be tested is input into a pre-trained defect detection model to obtain the solder defect detection result; the solder defect detection result includes the defect detection category and the corresponding detection box; The defect detection model is obtained by replacing the phased unidirectional serial feature propagation path in the YOLOv11 model with a bidirectional parallel feature propagation topology. The sample set used to train the defect detection model includes normal samples and diverse defect samples. The normal samples include normal solder images collected during the historical welding process of battery connectors. The defect samples include defect solder images collected during the historical welding process of battery connectors and defect solder reconstructed images obtained by reconstructing defects from normal solder images.
2. The method for detecting solder joint defects according to claim 1, characterized in that, The defect detection model is obtained by replacing PANet in the YOLOv11 neck network with BiFPN.
3. The method for detecting solder joint defects according to claim 1, characterized in that, Both the defective and normal solder joint images were obtained by real-time acquisition of the historical welding process of the battery connector using an industrial CCD camera, and then processed by standardization of the pixel values of each channel.
4. The method for detecting solder joint defects according to claim 1, characterized in that, Defective weld reconstructed images obtained by reconstructing defects from normal weld images include: Defects are injected into normal solder joint images using a diffusion model to obtain low-resolution composite images of defective solder joints. The hybrid attention algorithm is used to reconstruct the low-resolution composite image of the defective weld mark, resulting in a reconstructed image of the defective weld mark with the same resolution as the images collected during the historical welding process.
5. The method for detecting solder joint defects according to claim 4, characterized in that, The method of injecting defects into a normal solder joint image using a diffusion model to obtain a low-resolution composite image of defective solder joints includes: Gaussian noise is gradually added to a normal solder joint image to obtain a noisy image; the expression for adding Gaussian noise to the normal solder joint image in step t is: , in, The image at time t is a noisy image. This is the initial, normal solder joint image. The cumulative product of noise scheduling parameters. Standard Gaussian noise; A denoising algorithm is used to denoise the noisy image, and defect guidance conditions are introduced during the denoising process to generate a low-resolution composite image of defective weld marks; wherein, the defect guidance conditions include preset defect prompt words.
6. The method for detecting solder joint defects according to claim 4, characterized in that, The process of reconstructing a low-resolution defect weldment image using a hybrid attention algorithm to obtain a reconstructed defect weldment image with the same resolution as images acquired during historical welding processes includes: A convolution operation is performed on the low-resolution composite image of defective weld marks to obtain an initial feature map; The initial feature map is captured locally using a window attention mechanism, and the channel weights of the initial feature map are dynamically adjusted using a channel attention mechanism to obtain a reconstructed image of the defective weld mark with a resolution consistent with the acquired image.
7. The method for detecting solder joint defects according to claim 2, characterized in that, The defect detection model includes a backbone network, a neck network containing the BiFPN, and a detection head; The training method for the defect detection model includes: The backbone network extracts features from the input sample images to obtain multi-scale global semantic features. Cross-scale fused features are obtained by fusing multi-scale global semantic features through a neck network; The detection head obtains the solder stamp defect detection result based on cross-scale fusion feature mapping; wherein, the solder stamp defect detection result also includes a confidence score; Loss is calculated based on the defect detection category and the pre-labeled true defect category of the sample image, the detection box and the pre-labeled true box of the sample image, and the confidence score and the pre-labeled true label of the sample image; wherein, the defect category includes no defect and defect present; the pre-labeled true box of normal samples includes the weldment area boundary box; the pre-labeled true box of defect samples includes the defect area boundary box; The parameters of the defect detection model are adjusted based on the loss calculation results to obtain a trained defect detection model.
8. The method for detecting solder joint defects according to claim 7, characterized in that, The process of fusing multi-scale global semantic features through a neck network to obtain cross-scale fused features includes: BiFPN is used to extract multi-level bidirectional features from multi-scale global semantic features, and the extracted multi-level bidirectional features are then fused. The steps for bidirectional feature extraction at each layer include: In the top-down path, the deep semantic features in the multi-scale global semantic features are upsampled through the Upsample layer, and the upsampled features are concatenated with the features of the corresponding scale in the multi-scale global semantic features. Then, the concatenated features are enhanced by the C2f module. In the bottom-up path, separable deep convolutional layers are used to downsample the low-level semantic features in the multi-scale global semantic features. The downsampled features are then concatenated with the features of the corresponding scale in the top-down path. The concatenated features are then enhanced by the C2f module to output a cross-scale fused feature vector.
9. A welding stamp defect detection device, characterized in that, include: The module for acquiring images of solder marks under test is used to acquire images of solder marks on the connectors of the battery under test. Defect detection result acquisition module: used to input the solder image of the battery connector piece under test into the pre-trained defect detection model to obtain the solder defect detection result; wherein, the solder defect detection result includes the defect detection category and the corresponding detection box; The defect detection model is obtained by replacing the phased unidirectional serial feature propagation path in the YOLOv11 model with a bidirectional parallel feature propagation topology. The sample set used to train the defect detection model includes normal samples and diverse defect samples. The normal samples include normal solder images collected during the historical welding process of battery connectors. The defect samples include defect solder images collected during the historical welding process of battery connectors and defect solder reconstructed images obtained by reconstructing defects from normal solder images.
10. A computer storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the solder mark defect detection method as described in any one of claims 1-8.
Citation Information
Patent Citations
Connecting piece welding detection method and system
CN114862777A