Welding spot defect automatic detection method and device and storage medium

By improving the YOLOv8m model and combining SPD-Conv, GAM, and WIoU loss functions, automated detection of solder joint defects is achieved, solving the problems of false detection and missed detection in manual visual inspection, improving detection accuracy and efficiency, and reducing costs.

CN121544567APending Publication Date: 2026-02-17DONGGUAN HUABEL ELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511729051.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

In existing technologies, weld joint quality inspection relies on manual visual inspection, which is prone to false detections and missed detections, and is inefficient, affecting production speed and cost.

Method used

An improved YOLOv8m model is used for automatic detection of weld defects. The detection accuracy and efficiency are improved by introducing a spatial depth transformation convolution module (SPD-Conv), a global attention module (GAM), and a weighted intersection-union loss function (WIoU).

Benefits of technology

It has achieved automated solder joint inspection, which has improved inspection accuracy and efficiency, reduced labor costs, and can accurately identify defects such as missing solder joints and cold solder joints. The inspection speed reaches 20 PCB boards per second, which significantly improves factory production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121544567A_ABST
    Figure CN121544567A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses a welding spot defect automatic detection method and device and a storage medium. The welding spot defect automatic detection method comprises the following steps: providing a trained welding spot automatic detection model; based on the welding spot automatic detection model, performing feature extraction on the to-be-detected image including the welding spots to obtain a plurality of target features, and performing fusion on the plurality of target features to obtain a fusion feature according to a radical; detecting the fusion feature to obtain a welding spot defect detection result in the to-be-detected image; wherein the welding spot automatic detection model is an improved YOLOv8m model, and a convolution module in the improved YOLOv8m model adopts a space depth conversion convolution module. According to the embodiment of the invention, automatic detection of the welding spot can be realized, a small target quality detection scene in scenes such as mainboard and twisted pair welding in a workshop assembly line can be accurately adapted, the detection precision of the small target welding spot can be effectively improved, the detection efficiency is high, and the cost is low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an automatic detection method, apparatus and storage medium for weld joint defects. Background Technology

[0002] Currently, the quality inspection of solder joints after PCB boards are soldered to twisted-pair cables mainly relies on manual visual inspection. That is, after the motherboard is soldered to the twisted-pair cables (external wiring) by an automatic soldering machine on the factory assembly line, the quality of the solder joints at the connection between the motherboard and the twisted-pair cables is checked manually.

[0003] However, because the solder joints are silvery-white, manual inspection is not only prone to mis-inspection or omission due to visual fatigue, but also slow, affecting the factory's production speed and wasting a lot of manpower and financial resources.

[0004] Therefore, improvements to existing technologies are necessary.

[0005] The above information is provided as background information only to aid in understanding this application and does not constitute an assertion or admission that any of the above content can be used as prior art relative to this application. Summary of the Invention

[0006] This application provides an automatic detection method, device, and storage medium for weld joint defects, to overcome the shortcomings of manual visual inspection methods, such as easy misdetection, missed detection, and low detection efficiency.

[0007] To achieve the above objectives, this application provides the following technical solution:

[0008] In a first aspect, this application provides an automatic detection method for weld joint defects, including:

[0009] Provides a fully trained automatic solder joint detection model; the automatic solder joint detection model includes a backbone network, a neck network, and a detection head connected in sequence;

[0010] Based on the backbone network, feature extraction is performed on the image to be detected, including solder joints, to obtain multiple target features;

[0011] Based on the neck network, the multiple target features are fused to obtain fused features;

[0012] Based on the detection head, the fused features are detected to obtain the detection results of solder joint defects in the image to be detected;

[0013] The automatic solder joint detection model is an improved YOLOv8m model, and the convolution module in the improved YOLOv8m model adopts a spatial depth transformation convolution module.

[0014] Optionally, the spatial depth transformation convolution module includes: a first convolutional layer, a second convolutional layer, and a third convolutional layer connected in series.

[0015] The method for performing convolution operations on the image to be detected in the feature extraction step includes:

[0016] The first convolutional layer is applied to initially extract and output spatial features;

[0017] The second convolutional layer is applied to extract the spatial relationships between the spatial features and then the spatial features are enhanced and output accordingly.

[0018] The third convolutional layer is applied to reorganize and encode the features output by the second convolutional layer.

[0019] Optionally, the backbone network of the improved YOLOv8m model further includes a global attention module, which is located between the fast spatial pyramid pooling (SPPF) module of the backbone network and the cross-stage partial network 2 convolutional structure (C2f) module adjacent to the SPPF module.

[0020] Optionally, the global attention module includes a channel attention submodule and a spatial attention submodule.

[0021] Optionally, it also includes: pre-training the improved YOLOv8m model, and the dataset used during the training process includes images of good solder joints and images of bad solder joints, wherein the images of bad solder joints include images of missing solder joints, cold solder joints, and short solder joints.

[0022] Optionally, it also includes: during the training phase of the improved YOLOv8m model, using a weighted cross-union loss function to calculate the difference between the detection head output and the real data.

[0023] Optionally, it also includes: before training, applying an image annotation tool to label the collected dataset.

[0024] Optionally, it also includes: generating and displaying a GUI interface, the GUI interface including an operation interface, a real-world environment interface, and / or a detection result display interface.

[0025] Secondly, embodiments of this application provide an automatic solder joint defect detection device, including a processor and a memory, wherein the memory is used to store program instructions, and the processor is used to call the program instructions to execute the automatic solder joint defect detection method described above.

[0026] Secondly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions thereon, which are executed by a computer processor to implement the automatic detection method for weld joint defects described in any of the above claims.

[0027] Compared with the prior art, this application has the following beneficial effects:

[0028] The testing scenarios are highly targeted: it can realize automated solder joint testing and accurately adapt to small target quality testing scenarios such as motherboard and twisted pair welding in workshop production lines;

[0029] High detection accuracy: Based on the YOLOv8m model after introducing SPD-Conv, it can effectively improve the detection accuracy of small target solder joints (small proportion and few pixels) (up to 85%), avoid false detection and missed detection caused by human visual fatigue, and significantly improve the accuracy of identifying defects such as missing solder joints, cold solder joints and short solder joints.

[0030] High efficiency and low cost: Compared with manual inspection, the inspection speed is greatly improved, with a speed of at least 20 PCB boards per second, which effectively improves the factory's production efficiency while reducing manpower input.

[0031] This application has other features and advantages that will be apparent from or will be set forth in detail in the accompanying drawings and following detailed description, which together serve to explain the particular principles of this application. Attached Figure Description

[0032] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1 This is a diagram of the network structure of YOLOv8m in the existing technology;

[0034] Figure 2 This is an overall flowchart of the weld joint defect detection method provided in the embodiments of this application;

[0035] Figure 3 This is a network structure diagram of the improved YOLOv8m provided in the embodiments of this application;

[0036] Figure 4 This is a model structure diagram of the GAM module provided in the embodiments of this application. Detailed Implementation

[0037] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0038] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the embodiments of this application. As used in the specification and appended claims of the embodiments of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in the embodiments of this application refers to and includes any or all possible combinations of one or more of the listed items.

[0039] The following section introduces some relevant concepts in the embodiments of this application.

[0040] The YOLOv8 model is the latest iteration of the YOLO (You Only Look Once) series of real-time object detectors, boasting cutting-edge performance in both accuracy and speed. Building upon previous YOLO versions, YOLOv8 introduces new features and optimizations, making it ideal for a wide range of object detection tasks across various applications.

[0041] Key advantages of the YOLOv8 model:

[0042] ①Adopting an advanced backbone and neck architecture: YOLOv8 adopts a state-of-the-art backbone and neck architecture, thereby improving feature extraction and object detection performance.

[0043] ② Anchor-free Ultralytics Head: YOLOv8 uses an anchor-free Ultralytics head, which helps improve the accuracy and efficiency of the detection process compared to anchor-based methods.

[0044] ③ Optimize the trade-off between accuracy and speed: YOLOv8 focuses on maintaining the best balance between accuracy and speed, making it suitable for real-time target detection tasks in various application fields.

[0045] ④ Various pre-trained models: YOLOv8 provides a series of pre-trained models to meet various tasks and performance requirements.

[0046] Please see Figure 1The YOLOv8 model shown has a network architecture consisting of three core parts: Backbone: responsible for feature extraction, refining features from the original image layer by layer from low to high level. Neck: responsible for feature fusion, connecting the Backbone and Head to integrate multi-scale and multi-semantic features. Head: responsible for object detection, outputting the object's category, bounding box coordinates, and other final results.

[0047] The system comprises several layers: Conv (convolutional layer), which performs convolution operations on the image to extract local features and adjusts the number of channels / size of the feature map, introducing non-linear activation; C2f (CSP Bottleneck with 2 convolutions), which performs feature fusion by processing the input features in two branches: one branch is directly passed, and the other branch is merged after multiple convolutions, enabling cross-stage feature interaction, enhancing expressive power, and controlling computational cost; SPPF (Fast Spatial Pyramid Pooling), which performs multi-scale pooling on the feature map and then concatenates the results to extract multi-scale global features, enhancing adaptability to targets of different sizes; Upsample, which increases the size of the feature map through interpolation (such as bilinear interpolation), matching high-level semantic features (small size, many channels) with low-level fine-grained features (large size, few channels) in spatial dimensions, facilitating subsequent fusion; and Contact, which concatenates feature maps from different sources along the channel dimension, integrating multi-scale and multi-semantic information and improving feature richness. The Detect layer outputs the classification probability and bounding box coordinates of the target, completing the final detection task.

[0048] The overall detection process of the YOLOv8 model is as follows:

[0049] Backbone feature extraction: The input image is sequentially combined through multiple layers of Conv and C2f to gradually extract high-level semantic features (such as target shape and category information) from low-level features (such as edges and textures). Finally, multi-scale pooling is performed through SPPF to obtain feature maps at different levels.

[0050] Neck Feature Fusion: Upsample the high-level feature map output by Backbone, concatenate the feature maps of the previous layer using Concat, and then fuse them using C2f; repeat this process to achieve multi-scale feature fusion, so that the features simultaneously contain high-level semantics and low-level details;

[0051] Head detection output: The fused features are input into the Detect layer, which directly predicts the target's category and bounding box, completing end-to-end target detection.

[0052] To address the issues of false positives, missed positives, and low efficiency associated with traditional manual visual inspection methods, this application provides an automatic weld joint defect detection solution. This solution utilizes deep learning and target detection technologies to automatically detect weld joints, thereby improving factory production efficiency and reducing production costs while avoiding the waste of human resources.

[0053] Please see Figure 2 This application provides an automatic detection method for solder joint defects, including:

[0054] S1. Provides a fully trained automatic solder joint detection model.

[0055] The automatic solder joint detection model is an improved YOLOv8m model, which includes a backbone network, a neck network and a detection head connected in sequence. The convolution module in the improved YOLOv8m model adopts a spatial depth transformation convolution module.

[0056] Before training the model, it is necessary to collect a multi-dimensional solder joint dataset and label the dataset:

[0057] The dataset includes training and testing sets. It should contain images of both high-quality solder joints and images of defective solder joints such as missing solder joints, cold solder joints, and short solder joints. For dataset collection, the first priority is to ensure sufficient quantity (approximately 2000 images for the training set and 1000 images for the testing set) and to closely resemble real-world application scenarios, ideally collected in a production workshop. Secondly, to cover a wider range of defective solder joint images, multi-dimensional shooting is necessary; for example, four images of a single solder joint can be taken from different angles.

[0058] Given the characteristics of deep learning and object detection, labels are used to calculate the loss between the model's predictions and the true values ​​(such as bounding box regression loss and class loss), guiding the optimization of model parameters. Therefore, it is necessary to label the collected dataset, and this process can be accomplished using the labelimg annotation tool. labelimg can save label files in real time and update the modified label information to the corresponding txt label document in real time. Even if the window is accidentally closed, it will not affect the previous work.

[0059] S2. Based on the backbone network, feature extraction is performed on the image to be detected, including the solder joints, to obtain multiple target features.

[0060] S3. Based on the neck network, multiple target features are fused to obtain fused features.

[0061] S4. Based on the detection head, the fused features are detected to obtain the detection results of weld point defects in the image to be detected.

[0062] The inventors discovered that YOLOv8 has multiple versions, among which YOLOv8m has higher accuracy and a moderate number of parameters. However, the performance of YOLOv8m drops sharply in tasks with low image resolution or small target objects. The proportion of solder joints in the image data is also small, and most of them are small target objects. Therefore, the automatic solder joint detection model in this application selects YOLOv8m as the benchmark model and improves YOLOv8m by "introducing SPD-Conv (spatial depth transformation convolution)".

[0063] YOLOv8m contains many convolutional operations, mainly concentrated in the Backbone and Neck parts, used to collect various feature information. This process uses strided convolutions and / or pooling layers, which leads to the loss of subtle information and less effective feature representation learning. The core idea of ​​SPD-Conv is to combine spatial and depth information through efficient spatial encoding techniques, reducing redundant computation while maintaining high feature expressiveness. It consists of three convolutional layers, handling the transformation of spatial and depth information respectively. conv1 is responsible for initial spatial feature extraction, conv2 further extracts complex spatial relationships, and conv3 reassembles and encodes the features. SPD-Conv can downsample feature maps without losing learnable information, completely abandoning the widely used strided convolutions and pooling operations.

[0064] Introducing SPD-Conv spatial depth transformation convolution can reduce information loss and improve the accuracy of feature extraction, optimizing the model's ability to handle small objects and low-resolution images. Therefore, please refer to [link / reference needed]. Figure 3 In this embodiment of the application, SPD-Conv is introduced between the convolution operation Conv and the C2f module to improve the network's ability to recognize small target objects.

[0065] In YOLOv8m, the C2f module is an improved version of the C3 module in YOLOv5. The C2f module introduces more branches and skip connections in its structure (similar to the design of residual networks), which allows features from different levels to be more fully integrated. Its core function is to enhance feature extraction capabilities, optimize gradient flow, and enhance the model's ability to capture multi-scale features while maintaining computational efficiency.

[0066] In summary, this application uses YOLOv8m as the baseline model and replaces the original convolution operation in the baseline model with SPD-Conv to obtain the automatic solder joint detection model, which has the following advantages:

[0067] Reduce information loss: By abandoning the original stride convolution and pooling, the spatial and depth information transformation of three convolutional layers can completely preserve the subtle features such as the edge and texture of the solder joint, thus solving the problem of "easily losing details" in the original Conv module;

[0068] Stronger feature representation: Through the hierarchical processing of multiple convolutional layers, it can capture the local details of small targets and integrate global semantics, making the model more able to recognize small solder joints;

[0069] Better suited for low-resolution scenarios: Even with low image resolution, it can accurately identify small targets through complete feature preservation and enhancement, thus addressing the performance degradation of YOLOv8m in low-resolution, small-target tasks.

[0070] Based on the above advantages, by applying the above-mentioned automatic solder joint detection model, the embodiments of this application can realize automatic solder joint detection, which greatly improves the detection accuracy and efficiency and reduces the detection cost compared with the traditional manual visual inspection method.

[0071] The inventors also discovered that while YOLOv8m's backbone network (such as the C2f module) and feature fusion network (PAN-FPN) can extract multi-scale features, they assign similar weights to all feature channels and spatial locations by default, lacking active focus on "key features." However, in PCB solder joint inspection, the solder joint area may only occupy a very small portion of the image (small target), and there is a large amount of interfering information in the background (such as PCB circuitry and other components). YOLOv8m may allocate too much attention to background areas or non-defect areas, resulting in insufficient feature capture of subtle defects such as "missing solder joints" and "cold solder joints."

[0072] To address this issue, in one alternative implementation, embodiments of this application introduce a global attention mechanism—GAM—into the YOLOv8m model (its model structure is as follows). Figure 4 As shown, the GAM attention mechanism employs a dual-branch design of "channel attention + spatial attention." Specifically, the channel attention submodule uses 3D permutations to retain information across three dimensions, helping to capture features from more dimensions. A two-layer MLP enhances cross-dimensional channel-spatial dependencies, improving the model's ability to learn complex features. In the spatial attention submodule, to better focus on spatial information, two convolutional layers are used for spatial information fusion, enhancing the learning of spatial features, instead of using max pooling to avoid operations that could lead to information loss. By using grouped convolutions and channel shuffling, the number of parameters in ResNet50 is avoided from increasing significantly, which helps reduce computational overhead and memory usage.

[0073] like Figure 3As shown, in this embodiment, GAM is placed before the SPPF module and after the adjacent C2f module in the Backbone network of YOLOv8m. The feature map F1 obtained by C2f is input into the GAM attention mechanism, and after passing through the channel attention submodule to obtain feature map F2, and then through the spatial attention submodule to obtain a new feature map F3, and then feature map F3 is input into the SPPF module for subsequent processing.

[0074] GAM can dynamically learn the importance of feature channels (such as enhancing the channel weights related to solder joint texture and edges) and the attention to spatial location (such as focusing on the region where the solder joint is located), suppressing redundant information and allowing the model to focus more on valuable features. In other words, GAM not only enhances the feature response of solder joint-related channels, but also accurately focuses on the spatial region where the solder joint is located, complementing SPD-Conv and effectively solving the pain points of "insufficient feature capture and redundant information interference" in PCB solder joint (small target, strong background interference) detection.

[0075] Please see Figure 3 The network structure diagram of the improved YOLOv8m in this embodiment of the application is shown. The complete detection process of this network includes:

[0076] Backbone feature extraction: The input image is combined with multiple layers of SPD-Conv and C2f and repeated multiple times to gradually extract high-level semantic features (such as target shape and category information) from low-level features (such as edges and textures); then, the features are processed by the GAM module, and finally multi-scale pooling is performed through SPPF to obtain feature maps at different levels.

[0077] Neck feature fusion: The upsampled features are concatenated with the previous layer features Contact, and then processed through the SPD-Conv and C2f modules to achieve feature fusion;

[0078] Head detection output: The fused features are input into the Detect layer, which directly predicts the target's category and bounding box, completing end-to-end target detection.

[0079] The inventors also discovered that the CIoU loss function used in YOLOv8m employs a "equal weight" penalty strategy for all predicted boxes (regardless of their overlap with the ground truth boxes), lacking targeted optimization for "hard samples" (predicted boxes with low IoU) and insufficient sensitivity to positional errors of small targets. However, in the early stages of training, the model generates a large number of low-quality predicted boxes (such as boxes with extremely low overlap with the ground truth solder joint bounding boxes), but the CIoU penalty for these boxes is not significantly different from that for high-quality predicted boxes (high IoU), causing the model to waste excessive computational resources on "easy samples" while failing to learn enough about the "hard samples" (such as blurred boundaries of missing solder joints or small areas of faulty solder joints) that require focused optimization. Furthermore, while the CIoU loss function considers the distance between the center points of the bounding boxes, it does not dynamically adjust the penalty intensity according to the target scale. For small targets (such as solder joints with a diameter of only a few pixels), the positional offset of the same pixel has a much greater impact on IoU than for large targets, but the CIoU penalty intensity is not differentiated, making it difficult to improve the regression accuracy of small target bounding boxes.

[0080] Therefore, in an optional implementation, the loss function in the YOLOv8m model can also be optimized by using the WIoU (Weighted-IoU) loss function.

[0081] It should be noted that the loss function is applied during the training phase of the YOLOv8m model to compare the results output by the detection head with the labeled data. Its core function is to quantify the difference between the predicted results and the real target, and to guide parameter updates.

[0082] The WIoU loss function introduces a dynamic weighting mechanism, dynamically adjusting the loss weights based on the IoU value between the predicted and ground truth bounding boxes—the lower the IoU (the worse the quality) of the predicted box, the greater the loss weight. Its weight design implicitly adapts to scale—low IoU predicted boxes for small targets are assigned higher weights, forcing the model to be more sensitive to the positional errors of small targets, thereby optimizing the bounding box coordinates more precisely and reducing the localization deviation of small targets such as weld points. Therefore, this embodiment selects the WIoU loss function as the loss function for this network model to enhance the network's learning weights for difficult samples and small targets, effectively improving the accuracy and stability of bounding box regression.

[0083] Furthermore, this application embodiment can also implement a GUI interface design: to facilitate inspection operations, a GUI interface can be designed using PYQT5 based on the specific workshop environment. This interface can include operations and a display screen such as: start, select network, turn on camera, quantity of good products, quantity of defective products, etc. To reduce inspection costs, real-time inspection can be performed directly via a computer using the camera.

[0084] In summary, the embodiments of this application have the following advantages:

[0085] 1) Highly targeted testing scenarios: It can realize automated testing of PCB board and external twisted pair solder joints, accurately adapting to the quality testing scenarios of motherboard and twisted pair soldering in the workshop assembly line.

[0086] 2) High Detection Accuracy and Efficiency: Based on the optimized YOLOv8m model (introducing SPD-Conv, GAM attention mechanism, and WIoU loss function), the problem of low detection accuracy for small target solder joints (small proportion, few pixels) is solved, and the accuracy of identifying defects such as missing solder, cold solder, and short solder is significantly improved. At the same time, compared with manual inspection, the detection speed is greatly improved (manual inspection requires visual inspection of each piece, while this method can detect in real time), effectively improving factory production efficiency. The detection accuracy can reach over 85%, and the detection speed is at least 20 PCBs per second, which can reduce the manpower of the production line by one person.

[0087] 3) Reduce costs and manpower consumption: Replace traditional manual inspection methods, avoid false detection and missed detection caused by human visual fatigue, and reduce manpower input.

[0088] 4) High practicality: The GUI interface developed with PYQT5 can be designed on demand, integrating functions such as start detection, network selection, camera activation, and good and bad product quantity statistics. It is easy to operate; it supports direct access to the camera for real-time detection from the computer, eliminating the need to purchase expensive detection equipment, reducing deployment costs, and adapting to the actual application environment of the workshop.

[0089] This application also provides an automatic solder joint defect detection device, including a processor and a memory. The memory is used to store program instructions, and the processor is used to call the program instructions to execute the automatic solder joint defect detection method described above.

[0090] This application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the aforementioned method steps to implement the automatic detection method for solder joint defects in the above embodiments.

[0091] In this embodiment, the multi-scene shooting navigation device and the computer-readable storage medium are used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0092] Any combination of one or more computer-readable media may be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.

[0093] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0094] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0095] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0096] Finally, it should be noted that although the above embodiments have been described in the text and drawings of this application, this should not limit the scope of patent protection of this application. Any technical solutions that are based on the essential concept of this application and utilize the content described in the text and drawings of this application, resulting in equivalent structural or procedural substitutions or modifications, as well as the direct or indirect application of the technical solutions of the above embodiments to other related technical fields, are all included within the scope of patent protection of this application.

Claims

1. A method for automatically detecting a defect of a solder joint, characterized by, The method comprises the following steps: providing a completed training welding point automatic detection model; the welding point automatic detection model comprises a backbone network, a neck network and a detection head connected in sequence; based on the backbone network, performing feature extraction on the to-be-detected image comprising a welding point to obtain a plurality of target features; based on the neck network, fusing the plurality of target features to obtain fused features; based on the detection head, detecting the fused features to obtain a welding point defect detection result in the to-be-detected image; wherein the welding point automatic detection model is an improved YOLOv8m model, and a spatial depth conversion convolution module is used in the improved YOLOv8m model.

2. The method of claim 1, wherein The spatial depth conversion convolution module comprises a first convolution layer, a second convolution layer and a third convolution layer connected in sequence. In the feature extraction step, the method for performing convolution operation on the to-be-detected image comprises: applying the first convolution layer to preliminarily extract and output spatial features; applying the second convolution layer to extract the spatial relationship between the spatial features and output the spatial features after strengthening processing according to the spatial relationship; applying the third convolution layer to reorganize and encode the features output by the second convolution layer.

3. The method of claim 1, wherein The improved YOLOv8m model further comprises a global attention module in the backbone network, and the global attention module is arranged between a fast spatial pyramid pooling SPPF module of the backbone network and a cross-stage partial network 2 convolution structure C2f module adjacent to the SPPF module.

4. The method of claim 3, wherein The global attention module comprises a channel attention submodule and a spatial attention submodule.

5. The method of claim 1, wherein Further comprising: pre-training the improved YOLOv8m model, and the data set applied in the training process comprises welding point good pictures and welding point bad pictures, wherein the welding point bad pictures comprise missed welding pictures, virtual welding pictures and short welding pictures.

6. The method of claim 5, wherein Further comprising: In the training stage of the improved YOLOv8m model, a weighted intersection over union loss function is used to calculate the difference between the detection head output result and the real data.

7. The method of claim 5, wherein Further comprising: Before training, an image labeling tool is applied to perform a labeling operation on the collected data set.

8. The method of claim 1, wherein Further comprising: generating and displaying a GUI interface, wherein the GUI interface comprises an operation interface, a real environment interface and / or a detection result display interface.

9. A solder joint defect automatic detection apparatus characterized by comprising: The computer executable instructions are executed by the computer processor to implement the welding point defect automatic detection method as claimed in any one of claims 1 to 8.

10. A computer-readable storage medium having stored thereon computer- executable instructions, wherein, The computer executable instructions are executed by the computer processor to implement the welding point defect automatic detection method as claimed in any one of claims 1 to 8.