Welding defect detection method, device and equipment, storage medium and program product
By training and fine-tuning the defect general detection model, the problem that defect detection models in the prior art are difficult to adapt to multiple varieties and short-cycle detection of production lines is solved, and general welding defect detection for similar products is achieved.
Patent Information
- Application Number
- CN202411744729.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-25
AI Technical Summary
The existing defect detection model is difficult to adapt to the testing requirements of multiple varieties and short-cycle production lines, and it is impossible to achieve general inspection of similar products.
Through the pre-trained data set obtained based on data augmentation, a general defect detection model is trained, and the model is fine-tuned based on the defect sample image of the target product to obtain an object detection model that detects the defects of the target product.
Accurate detection of welding defects and defects to be quantified in welding images is achieved, and can adapt to the testing needs of multiple varieties and short-cycle lines, without special training for a single product.
Smart Images

Figure CN119693312A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of defect detection, and in particular to a method for detecting welding defects, a device for detecting welding defects, equipment for detecting welding defects, a storage medium and a computer program product. Background Art
[0002] In the manufacturing process of precision products, unstable processes, insufficient mechanical positioning accuracy, and environmental factors in the factory often lead to various forms of defects in the products. These defects not only affect the appearance of the products but also pose safety hazards. Therefore, defect detection has always been an indispensable part of industrial production. With the development of computer vision, many AI detection solutions have emerged, such as anomaly detection, image classification, target detection, image segmentation, etc. These technologies can process large amounts of data and accurately identify tiny defects, sometimes even beyond the recognition ability of the human eye.
[0003] At present, it is not complicated to train a high-precision defect detection model for a single product. However, for similar types of products, it is necessary to collect samples again and retrain, and the model cannot be universal. In other words, the current model construction scheme cannot meet the requirements of multi-variety and short-cycle inspection of production lines, and it is urgent to develop a universal model construction scheme for similar products.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide a welding defect detection method, a welding defect detection device, a welding defect detection equipment, a storage medium and a computer program product, aiming to solve the technical problem that the current defect detection model is difficult to adapt to the production line detection requirements.
[0006] To achieve the above objectives, the present application proposes a method for detecting welding defects, which comprises:
[0007] Based on the pre-training data set obtained by data augmentation, a general defect detection model is trained;
[0008] Based on the defect sample image of the target product, fine-tuning the general defect detection model to obtain a target detection model for detecting defects of the target product;
[0009] Defects in the actual defect image of the target product are detected by the target detection model.
[0010] In one embodiment, the step of fine-tuning the general defect detection model based on the defect sample image of the target product to obtain a target detection model for detecting defects of the target product includes:
[0011] Obtain welding defect detection datasets, including normal welding images and annotated defect sample images in laser welding, spot welding, and pressure welding scenarios;
[0012] Adjusting the general defect detection model with reference to the detection task of welding defects;
[0013] The adjusted model is trained using the welding defect detection dataset to obtain a welding defect detection model.
[0014] In one embodiment, the method further comprises:
[0015] Acquire welding images and input them into welding defect detection models;
[0016] In the welding defect detection model, welding defects in the welding image are determined by classification and recognition;
[0017] For the welding defects to be quantified among the welding defects, a quantification result is determined through target detection and / or segmentation processing.
[0018] In one embodiment, the step of determining the quantification result of the welding defects to be quantified by target detection and / or segmentation processing includes:
[0019] For the solder defect of the solder ball at the midpoint of the solder defect, determine the size and number of the solder ball by target detection; and / or,
[0020] For the welding defects of insufficient tin in the solder joints, the area ratio of the insufficient tin area in the solder joints to the solder pads is determined by segmentation processing.
[0021] In one embodiment, the step of acquiring the welding image and inputting it into the welding defect detection model includes:
[0022] Acquire defect sample images in laser welding, spot welding and pressure welding scenarios;
[0023] Classifying and labeling welding defects, as well as target detection and segmentation processing of defects to be quantified, are performed on the defect sample images to obtain training data;
[0024] Based on the training data, a welding defect detection model is trained.
[0025] In one embodiment, after the step of determining the quantification result of the welding defects to be quantified through target detection and / or segmentation processing, the method further comprises:
[0026] Weighted reasoning is performed on the welding defects obtained by classification and identification and the quantitative results determined by target detection and / or segmentation processing to obtain the quality results of welding defect detection.
[0027] In addition, to achieve the above-mentioned purpose, the present application also proposes a welding defect detection device, the welding defect detection device comprising:
[0028] A training module is used to train a general defect detection model based on a pre-training data set obtained through data augmentation;
[0029] A fine-tuning module, used to fine-tune the general defect detection model based on a defect sample image of a target product to obtain a target detection model for detecting defects of the target product;
[0030] The application module is used to detect defects in the actual defect image of the target product through the target detection model.
[0031] In addition, to achieve the above-mentioned objectives, the present application also proposes a welding defect detection device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the welding defect detection method as described above.
[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the welding defect detection method described above are implemented.
[0033] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the welding defect detection method as described above.
[0034] One or more technical solutions proposed in this application have at least the following technical effects:
[0035] In this application, a method for detecting welding defects is proposed. A general defect detection model is obtained by training a pre-training data set obtained based on data enhancement; based on the defect sample image of the target product, the general defect detection model is fine-tuned to obtain a target detection model for detecting defects of the target product; finally, the defects in the actual defect image of the target product are detected by the target detection model. In this way, through the general model of the welding defect detection model, the welding defects in the welding image and the quantification results of the welding defects to be quantified can be determined, without the need to specifically train the corresponding defect detection model for a single product, thereby meeting the multi-variety and short-cycle detection requirements of the production line. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0038] Figure 1 A schematic diagram of a process flow provided for the first embodiment of the method for detecting welding defects of the present application;
[0039] Figure 2 This is an application diagram of Embodiment 1 of the method for detecting welding defects of the present application;
[0040] Figure 3 A schematic diagram of a flow chart of a second embodiment of a method for detecting welding defects of the present application;
[0041] Figure 4 This is an application diagram of Embodiment 2 of the method for detecting welding defects of the present application;
[0042] Figure 5 This is a schematic diagram of the module structure of a welding defect detection device according to an embodiment of the present application;
[0043] Figure 6 This is a schematic diagram of the equipment structure of the hardware operating environment involved in the welding defect detection method in the embodiment of the present application.
[0044] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0045] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0046] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0047] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a welding defect detection device, etc. The following takes the welding defect detection device as an example to illustrate this embodiment and the following embodiments.
[0048] Based on this, the embodiment of the present application provides a welding defect detection device method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the welding defect detection equipment method of the present application.
[0049] In this embodiment, the welding defect detection method includes steps S10 to S30:
[0050] Step S10, training a general defect detection model based on the pre-training data set obtained by data enhancement;
[0051] Step S20, fine-tuning the general defect detection model based on the defect sample image of the target product to obtain a target detection model for detecting defects of the target product;
[0052] Step S30: detecting defects in the actual defect image of the target product through the target detection model.
[0053] Defective images collected during the industrial manufacturing process often have a long-tail distribution phenomenon, which leads to weak generalization ability of the learned model. In order to solve this problem, this embodiment adopts a data enhancement strategy. First, simple processing is performed through traditional image processing technology, and then diverse high-definition data is generated through data generation technology. For example, styleGAN (Style-based Generative Adversarial Network) is used to achieve data enhancement, so as to generate additional training samples by transforming the original data, increase the diversity and scale of the training set, thereby improving the generalization ability of the model and reducing the risk of overfitting.
[0054] In order to solve the problems of long development cycle and high sample dependence of product appearance defect detection models based on deep learning, this embodiment develops a modeling solution based on large model technology through vertical domain universal large model technology, which solves the problems of long cycle and high sample dependence in the traditional modeling process. The vertical domain universal model can be fine-tuned to be applied to similar defect detection of different products of the same type, and can be applied to the existing intelligent defect detection of various product production lines of welding parts in the factory.
[0055] In one embodiment, referring to Figure 4 First, in the data set generation stage, for small sample defect items, high-quality large-scale pre-training data sets are obtained through data generation, cleaning, enhancement and compression. Then, in the model pre-training stage, the pre-training data set is learned through GPU cluster distributed training to generate a reusable pre-trained large model. Next, in the model fine-tuning stage, the defect samples of new products, that is, the defect data set of specific products, are added through transfer learning and other methods to fine-tune and generate a target detection product detection model. For example, based on the defect sample images of the target product, the general defect detection model is fine-tuned to obtain a target detection model for detecting defects of the target product. Secondly, in the model deployment stage, after model pruning and knowledge distillation compression, the model is deployed to infer and judge the defects and generate the final quality inspection results. For example, the classification head, detection head and segmentation head are used to perform detection respectively, and the weighted reasoning of each detection result is performed to obtain the quality inspection result of welding defect detection. In this way, the problems of high data dependence, long online cycle and one project one modeling are solved. In an application scenario based on this, the data set size and verification results are shown in Table 1 below:
[0056]
[0057] Table 1
[0058] Among them, 8:2 in the pre-training training method refers to the data volume ratio between the training set and the validation set, and 1 / 5 in the migration training method refers to the ratio between the data of the training set and validation set of the current migration learning and the data of the traditional training method.
[0059] After multiple experiments with a small amount of data, the solution of this embodiment achieved good expected results during the test process, achieved the purpose of reducing data dependence and improving the R&D cycle, and can achieve the goal of replacing the existing modeling method. The battery, antenna and preparation line in Table 1 are the names of the projects being produced in the factory. By collecting data in real time and combining the actual situation online for migration modeling, the customer's requirements for the detection capability of the AI model are met, and the rationality and effectiveness of the solution are also verified.
[0060] In a feasible implementation manner, the step S20 includes:
[0061] Obtain welding defect detection datasets, including normal welding images and annotated defect sample images in laser welding, spot welding, and pressure welding scenarios;
[0062] Adjust the general defect detection model with reference to the welding defect detection task;
[0063] The adjusted model is trained using the welding defect detection dataset to obtain a welding defect detection model.
[0064] In one embodiment, in the data preparation stage, a new welding defect detection data set is obtained, including normal welding images and welding images containing different types of defects, and data annotation is performed. In the model adjustment stage, the model weights obtained by training are used as pre-training weights, and the detection head or feature pyramid of the original model is redesigned to re-match the new detection task, and the first few layers of the pre-trained model are frozen to keep its parameters unchanged to prevent over-adjustment. In the model training stage, the adjusted model is trained using a new data set, and the data volume requirement is reduced by adopting strategies such as transfer learning and prompt learning, so as to obtain a welding defect detection model. In the model evaluation stage, the performance of the model is evaluated on the validation set, including indicators such as accuracy, recall rate, and precision rate. The model is adjusted and optimized according to the evaluation results to further improve performance.
[0065] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , the method further comprises:
[0066] Step T10, acquiring a welding image and inputting it into a welding defect detection model;
[0067] Step T20, in the welding defect detection model, determining welding defects in the welding image by classification and recognition;
[0068] Step T30, determining a quantification result of the welding defects to be quantified through target detection and / or segmentation processing.
[0069] The welding images in the welding data set are usually images centered on the welding area, and the welding area is large. There are three scenarios for defect detection, namely laser welding, spot welding, and pressure welding. The defect types in the three scenarios are quite different. Refer to Table 2-1 and Table 2-2 below. Pressure welding is only divided into whether it is defective or not; the number of defect types in laser welding is moderate and all are related to laser welding; the number of defect types in spot welding is large, including but not limited to welding problems such as solder joints and leads; in addition, the solder ball defect has quantitative indicators of quantity and size, and the solder joint has a quantitative indicator of area ratio.
[0070]
[0071] Table 2-1
[0072]
[0073] Table 2-2
[0074] There are many defect categories in welding data, the characteristics of multiple defects are relatively small, the defect situation is complex, and some defects in spot welding scenarios (such as leads) do not meet the conditions for target detection and semantic segmentation. The classification model with attention mechanism as the backbone has the ability to understand context, can effectively capture global information, and classify various defects through multi-scale fusion capabilities. It has high classification accuracy and strong migration ability. For solder ball defects that need to be quantified in size and quantity, the defect is usually small in size but regular, which is suitable for target detection models that are more sensitive to small targets. For solder joint under-welding defects that need to be quantified in area, the segmentation model can identify the target at the pixel level, which can be quantified by the number of pixels.
[0075] In one embodiment, referring to Figure 2 , the defect detection model based on classification accompanied by target detection and segmentation as quantification methods can fully utilize and extract image data features, and obtain defect detection results efficiently and accurately. Furthermore, first, the welding defect type classification head is used to classify and identify the welding defects in the welding image; then, the defect type is classified by the defect type judgment module, and the welding defects to be quantified in the welding defects, such as the solder ball type, are statistically counted through the target detection of the target defect detection head, and the insufficient tin type is quantitatively judged by the defect area segmentation head.
[0076] In a feasible implementation manner, the step T30 includes:
[0077] For solder defects with solder balls at the midpoint of the solder defect, determine the size and number of solder balls through target detection; and / or,
[0078] For welding defects in which the solder joints have insufficient tin, the area ratio of the solder joints with insufficient tin in the pad is determined through segmentation processing.
[0079] According to the classification results, the two categories that need to be quantified for secondary inspection are mainly divided into two scenarios: (1) Solder ball defects with size and quantity requirements: For this type of defects, the target detection method is proposed. Through the target detection model, the bounding box of each solder ball can be obtained, so as to accurately locate their position in the image. Subsequently, quantitative analysis can be performed based on the size of the target box and the number of sizes that meet the requirements. (2) Solder joint tin deficiency defects with area ratio requirements: Compared with solder ball defects, solder joint tin deficiency defects usually need to consider their area ratio in the welding area. The solder area and pad can be detected through the segmentation model. Using segmentation technology, the solder area and the surrounding substrate surface can be accurately distinguished, and then the pixel number ratio of the solder joint tin deficiency defect can be obtained.
[0080] In a feasible implementation manner, the step T10 includes:
[0081] Acquire defect sample images in laser welding, spot welding and pressure welding scenarios;
[0082] Classify and annotate the defect sample images for welding defects, as well as target detection and segmentation processing of the defects to be quantified, to obtain training data;
[0083] Based on the training data, a welding defect detection model is trained.
[0084] Classification and annotation of welding defect detection, as well as detection and segmentation of defect targets that need to be quantified, are required for classification and annotation. For classification and annotation, it is necessary to determine the type of welding defect to be annotated, select representative welding defect image samples, ensure that the number of each category is relatively even, and the image features are obvious, so as to facilitate model learning and generalization. For solder ball defects that need to be quantified, ensure that the bounding box of the target detection annotation is consistent with the actual position of the defect, so that the training model can accurately identify and locate the defect. For solder joint tin deficiency defects that need to be quantified, segmentation and annotation are performed, and the defective area in the image is annotated at the pixel level so that the model can learn the specific shape and boundary of the defect. Segmentation and annotation require more detailed and precise annotation to ensure the accuracy and quality of the annotation.
[0085] In one embodiment, during the process of marking defects, semi-automatic marking is performed based on the SAM (Segment Anything Model) large model to improve marking efficiency.
[0086] In addition, establish a quality control mechanism, including training and review of labeling personnel, regular sampling inspection of labeling results, etc., to ensure the accuracy and consistency of labeling data. Monitor data distribution to ensure that the number of categories is relatively balanced. If necessary, use data enhancement technology to expand the data set to increase the diversity and quantity of data to improve the generalization ability and robustness of the model, such as commonly used data enhancement technologies such as rotation, flipping, scaling, translation, brightness adjustment, etc.
[0087] The above effectively performs classification labeling, target detection, and segmentation labeling for welding defect detection, providing a reliable data basis for training high-quality detection models.
[0088] Input the labeled dataset images into the classification model to be trained. At this stage, select appropriate training parameters, including learning rate, batch size, number of iterations, etc., to ensure that the model can fully learn the features and patterns in the dataset during training. Through repeated trials and adjustments, the model performs well on the training set and avoids overfitting.
[0089] In addition, we pay attention to the performance of the model on the validation set and optimize and improve the model based on the validation results, which involves adjusting the model architecture, adjusting training parameters, or introducing regularization techniques to improve the generalization ability and accuracy of the model. Through continuous training and optimization, the model performance initially meets the expected requirements.
[0090] Among them, the main requirements of welding defect detection are multi-label classification, target detection and semantic segmentation. In order to reduce the development workload and model reusability, Swin-Transformer is used as the backbone of the model network. Swin-Transformer adopts a structure connected by sliding windows and attention mechanisms. Its V2 version with up to 3 billion parameters solves the shortcomings of excessive feature variance and low model migration accuracy during training, and has excellent performance in multi-label classification, target detection and semantic segmentation.
[0091] The tasks of the welding defect detection model include classification, target detection and segmentation. The prediction head architectures are as follows: 1. Classification head. The classification head consists of multiple fully connected layers. The ReLU activation function is used between the fully connected layers. Finally, the softmax activation function is used to output the output space of the number of classes to obtain the prediction results. 2. Target detection head. The target detection head structure is designed with reference to the Faster R-CNN network structure. 3. Segmentation head. The instance segmentation head structure is designed with reference to the Mask R-CNN network structure. The basic structure of Mask R-CNN is roughly the same as that of Faster R-CNN. ROI Pooling is replaced by ROI Align, and a fully connected layer is added for segmentation tasks.
[0092] In a feasible implementation manner, the step T30 includes:
[0093] Weighted reasoning is performed on the welding defects obtained by classification and identification and the quantitative results determined by target detection and / or segmentation processing to obtain the quality results of welding defect detection.
[0094] In one embodiment, weighted reasoning is performed on the welding defects obtained by classification and identification and the quantitative results determined by target detection and / or segmentation processing. For example, a preset weight is assigned to each of the welding defects obtained by classification and identification and the quantitative results determined by target detection and / or segmentation processing to obtain a weighted result. The weighted result is used to characterize the credibility of the quality results of the welding defect detection, thereby obtaining a quality result of the welding defect detection having a credibility greater than the preset credibility.
[0095] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the detection method of welding defects in the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0096] This application also provides a welding defect detection device, please refer to Figure 5 , the welding defect detection device comprises:
[0097] A training module 10 is used to train a general defect detection model based on a pre-training data set obtained by data enhancement;
[0098] A fine-tuning module 20, configured to fine-tune the general defect detection model based on a defect sample image of a target product to obtain a target detection model for detecting defects of the target product;
[0099] The application module 30 is used to detect defects in an actual defect image of a target product through a target detection model.
[0100] In one embodiment, the fine-tuning module 30 is further used for:
[0101] Obtain welding defect detection datasets, including normal welding images and annotated defect sample images in laser welding, spot welding, and pressure welding scenarios;
[0102] Adjust the general defect detection model with reference to the welding defect detection task;
[0103] The adjusted model is trained using the welding defect detection dataset to obtain a welding defect detection model.
[0104] In one embodiment, the welding defect detection device further includes a welding detection module, which is used to:
[0105] Acquire welding images and input them into welding defect detection models;
[0106] In the welding defect detection model, welding defects in welding images are determined through classification and recognition;
[0107] For welding defects to be quantified among welding defects, quantification results are determined through target detection and / or segmentation processing.
[0108] In one embodiment, the welding detection module is further used for:
[0109] For solder defects with solder balls at the midpoint of the solder defect, determine the size and number of solder balls through target detection; and / or,
[0110] For welding defects in which the solder joints have insufficient tin, the area ratio of the solder joints with insufficient tin in the pad is determined through segmentation processing.
[0111] In one embodiment, the welding detection module is further used for:
[0112] Before the step of acquiring the welding image and inputting it into the welding defect detection model:
[0113] Acquire defect sample images in laser welding, spot welding and pressure welding scenarios;
[0114] Classify and annotate the defect sample images for welding defects, as well as target detection and segmentation processing of the defects to be quantified, to obtain training data;
[0115] Based on the training data, a welding defect detection model is trained.
[0116] In one embodiment, the welding detection module is further used for:
[0117] After the step of determining the quantification result of the welding defects to be quantified by target detection and / or segmentation processing:
[0118] Weighted reasoning is performed on the welding defects obtained by classification and identification and the quantitative results determined by target detection and / or segmentation processing to obtain the quality results of welding defect detection.
[0119] The welding defect detection device provided by the present application adopts the welding defect detection method in the above embodiment, which can solve the technical problem that the current defect detection model is difficult to adapt to the production line detection requirements. Compared with the prior art, the beneficial effects of the welding defect detection device provided by the present application are the same as the beneficial effects of the welding defect detection method provided by the above embodiment, and the other technical features of the welding defect detection device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0120] The present application provides a device for detecting welding defects, and the device for detecting welding defects includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for detecting welding defects in the above-mentioned embodiment one.
[0121] Reference below Figure 6 , which shows a schematic diagram of the structure of a welding defect detection device suitable for implementing the embodiment of the present application. The welding defect detection device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The welding defect detection device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0122] like Figure 6As shown, the detection device for welding defects may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the detection device for welding defects are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the welding defect detection device to communicate with other devices wirelessly or by wire to exchange data. Although the welding defect detection device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.
[0123] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0124] The welding defect detection device provided by the present application adopts the welding defect detection method in the above embodiment, which can solve the technical problem that the current defect detection model is difficult to adapt to the production line detection requirements. Compared with the prior art, the beneficial effects of the welding defect detection device provided by the present application are the same as the beneficial effects of the welding defect detection method provided by the above embodiment, and the other technical features of the welding defect detection device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.
[0125] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0126] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0127] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the method for detecting welding defects in the above-mentioned embodiment.
[0128] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0129] The computer-readable storage medium may be included in the welding defect detection device; or it may exist independently without being assembled into the welding defect detection device.
[0130] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the welding defect detection device, the welding defect detection device enables the following: to obtain a welding image and input it into a welding defect detection model; in the welding defect detection model, to determine the welding defects in the welding image through classification and identification; and to determine the quantification results of the welding defects to be quantified among the welding defects through target detection and / or segmentation processing.
[0131] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0132] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0133] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0134] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned welding defect detection method, and can solve the technical problem that the current defect detection model is difficult to adapt to the production line detection requirements. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the welding defect detection method provided in the above-mentioned embodiment, and will not be repeated here.
[0135] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned welding defect detection method when executed by a processor.
[0136] The computer program product provided by this application can solve the technical problem that the current defect detection model is difficult to adapt to the production line detection requirements. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the welding defect detection method provided in the above embodiment, which will not be repeated here.
[0137] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for detecting welding defects, characterized in that: The welding defect detection method includes: Based on the pre-training data set obtained by data augmentation, a general defect detection model is trained; Based on the defect sample image of the target product, fine-tuning the general defect detection model to obtain a target detection model for detecting defects of the target product; Defects in the actual defect image of the target product are detected by the target detection model.
2. The method for detecting welding defects according to claim 1, characterized in that: The step of fine-tuning the general defect detection model based on the defect sample image of the target product to obtain a target detection model for detecting defects of the target product comprises: Obtain welding defect detection datasets, including normal welding images and annotated defect sample images in laser welding, spot welding, and pressure welding scenarios; Adjusting the general defect detection model with reference to the detection task of welding defects; The adjusted model is trained using the welding defect detection dataset to obtain a welding defect detection model.
3. The method for detecting welding defects according to claim 1, characterized in that: The method further comprises: Acquire welding images and input them into welding defect detection models; In the welding defect detection model, welding defects in the welding image are determined by classification and recognition; For the welding defects to be quantified among the welding defects, a quantification result is determined through target detection and / or segmentation processing.
4. The method for detecting welding defects according to claim 3, characterized in that: The step of determining the quantification result of the welding defects to be quantified by target detection and / or segmentation processing comprises: For the solder defect of the solder ball at the midpoint of the solder defect, determine the size and number of the solder ball by target detection; and / or, For the welding defects of insufficient tin in the solder joints, the area ratio of the insufficient tin area in the solder joints to the solder pads is determined by segmentation processing.
5. The method for detecting welding defects according to claim 3, characterized in that: The step of acquiring the welding image and inputting it into the welding defect detection model includes: Acquire defect sample images in laser welding, spot welding and pressure welding scenarios; Classifying and labeling welding defects, as well as target detection and segmentation processing of defects to be quantified, are performed on the defect sample images to obtain training data; Based on the training data, a welding defect detection model is trained.
6. The method for detecting welding defects according to claim 3, characterized in that: After the step of determining the quantification result of the welding defects to be quantified by target detection and / or segmentation processing, the method further comprises: Weighted reasoning is performed on the welding defects obtained by classification and identification and the quantitative results determined by target detection and / or segmentation processing to obtain the quality results of welding defect detection.
7. A welding defect detection device, characterized in that: The welding defect detection device comprises: A training module is used to train a general defect detection model based on a pre-training data set obtained through data augmentation; A fine-tuning module, used to fine-tune the general defect detection model based on a defect sample image of a target product to obtain a target detection model for detecting defects of the target product; The application module is used to detect defects in the actual defect image of the target product through the target detection model.
8. A welding defect detection device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for detecting welding defects as described in any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the welding defect detection method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method for detecting welding defects as claimed in any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Method and system for detecting laser welding defects based on active learning
CN119887772A