Weld joint quality defect real-time detection method based on deep learning
By introducing MHSA and ShuffleAttention mechanisms into the YOLOV8 network, combined with image preprocessing technology, the problem of low accuracy in real-time detection of weld quality defects is solved, efficient identification and real-time monitoring of weld quality defects are achieved, and weld detection is improved. accuracy and efficiency.
Patent Information
- Application Number
- CN202410806396.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-09-13
AI Technical Summary
During the laser welding process of new energy vehicle battery boxes, weld quality defects such as pores, welding deflections and lack of fusion are difficult to identify in real time. Traditional manual inspection is costly, slow and has low accuracy. The existing deep learning model has low recognition accuracy and The speed is slow and it is difficult to meet the needs of real-time quality inspection.
Using the improved YOLOV8 network, by adding the MHSA attention mechanism in the backbone layer and the ShuffleAttention attention mechanism in the head layer, combined with the preprocessing methods of set grayscale processing, Gaussian filtering and image enhancement, an optimized weld quality defect detection model is constructed , and realize real-time detection and identification through industrial cameras and SQL sever database.
The identification accuracy of weld quality defects has been significantly improved. The identification accuracy of welding deviation, lack of fusion and pores has been increased by 1%, 9% and 28% respectively, realizing real-time quality monitoring and meeting the needs of industrial production.
Smart Images

Figure CN118644466A
Abstract
Description
Technical Field
[0001] The present invention relates to a real-time detection method for weld quality defects based on deep learning, and specifically to a real-time detection method for laser welding weld quality defects based on improved YOLOV8n, belonging to the technical field of non-destructive defect detection. Background Art
[0002] During the laser welding process of the battery box of new energy vehicles, its welds usually have quality defects such as pores, welding deviation, and lack of fusion. Weld quality defects will affect the safety of new energy vehicles to a certain extent. Therefore, before and after the welding process, the quality of the product needs to be checked in time. However, in actual production, it is difficult to achieve real-time process quality defect identification for the quality defects of the welds. Most companies use traditional manual visual observation after milling to judge quality defects. However, manual inspection has high costs, low inspection speed, and low recognition accuracy, which causes companies to spend a lot of money on quality control every year. With the development of artificial intelligence technology, scholars have continuously proposed real-time quality defect detection models based on deep learning, but due to its low recognition accuracy and slow recognition speed, it is difficult to apply the research to the field to achieve real-time quality defect detection and identification.
[0003] The Yolo series of algorithms are specially designed for real-time target detection. Their recognition frame rate can meet the needs of real-time quality monitoring. However, the unimproved YOLOV8n still has low recognition accuracy for tiny quality defects such as pores in the molten pool state. Therefore, the unimproved algorithm is difficult to meet the actual welding quality inspection needs of battery boxes. Summary of the invention
[0004] In order to solve the above technical problems, the purpose of the present invention is to provide a real-time detection method for weld quality defects based on deep learning. The technical solutions adopted are as follows:
[0005] The present invention provides a real-time detection method for weld quality defects based on deep learning, the method comprising:
[0006] Acquire the weld processing image of the molten pool state during the laser welding process;
[0007] Construct a defect detection network and improve it to obtain an optimized defect detection network. Specifically, add the MHSA attention mechanism to the backbone layer and the ShuffleAttention mechanism to the head layer. The defect detection network is the YOLOV8 network.
[0008] A sample data set is obtained, and an image preprocessing method that integrates grayscale processing, Gaussian filtering, sharpening, and image enhancement is used to process the sample data set to obtain training images. The preprocessed sample data is used to train the improved network; the weld quality defects in the molten pool state are detected using the trained improved defect detection network and the images to be detected; and the detection system is connected to the SQL sever database to realize real-time detection data collection.
[0009] In the above-mentioned real-time detection method for weld quality defects based on deep learning, the sample data set is preprocessed, including:
[0010] The image is processed by a preprocessing method that integrates grayscale processing, Gaussian filtering, sharpening and image enhancement.
[0011] In the above-mentioned real-time detection method of weld quality defects based on deep learning, adding the MHSA attention mechanism to the back bone layer includes:
[0012] Add the MHSA attention mechanism to the 11th layer in the backbone.
[0013] In the above-mentioned real-time detection method of weld quality defects based on deep learning, the ShuffleAttention mechanism is added to the head layer, including:
[0014] Add the ShuffleAttention mechanism to the 13th layer in the head.
[0015] In the above-mentioned real-time detection method for weld quality defects based on deep learning, the step of obtaining a sample data set and preprocessing the sample data set includes:
[0016] Obtain a sample data set, where the images in the sample data set are in jpg image format. Use labelimg software to label the images in the sample data set. The label format is a txt label file suitable for optimizing the target detection model. The labeled sample data set is divided into a training set, a test set, and a validation set to complete the preprocessing of the sample data set.
[0017] In the above-mentioned real-time detection method for weld quality defects based on deep learning, the quality defects of the weld in the molten pool state during laser welding are detected by using the trained optimized defect detection network and the image to be detected, including:
[0018] The image to be detected is input into the trained optimized target detection model, and a defect detection image of the weld is output; wherein the defect detection image includes the defect type of each defect, and the position of each defect in the defect detection image is marked.
[0019] In the above-mentioned real-time detection method of weld quality defects based on deep learning, information collection is achieved through the system and database, including:
[0020] The system interface is built through the pyqt5 module in python to realize quality defect recognition through pictures, videos and camera calls. At the same time, the quality inspection data is saved through the SQL sever database and processing decisions are provided. When the number of frames with defects recognized is greater than 20% of the total number of recognized frames, the system gives a stop inspection instruction.
[0021] The present invention also provides a system using the above-mentioned real-time detection method for weld quality defects based on deep learning. The system is a real-time detection and identification system for laser welding weld quality defects based on python and SQL sever database. The specific framework of the system includes a weld image acquisition module, a laser welding manufacturing module, a defect feature extraction module and a network improvement module. The recognition function of the system is divided into picture recognition, video recognition and calling industrial cameras for real-time processing quality detection and identification. The system also loads other YOLOV8n network models to realize other types of processing quality defect recognition. Finally, the system collects and analyzes the welding quality inspection data through the SQL database to realize real-time quality defect monitoring of the entire processing process.
[0022] An embodiment of the present invention provides a real-time detection method for weld quality defects based on deep learning, the method comprising:
[0023] The weld image in the molten pool state is obtained and a preprocessing method integrating grayscale processing, Gaussian filtering, sharpening and image enhancement is performed to obtain the image to be detected after preprocessing;
[0024] An improved YOLOV8 automobile battery box weld quality defect detection model that integrates MHSA and Shuffle Attention dual attention mechanisms was constructed. The MHSA attention mechanism was added to the back bone layer, and the ShuffleAttention mechanism was added to the head layer.
[0025] Based on the improved algorithm and database, a real-time detection and recognition system is built, and industrial cameras at the processing site can be used to realize real-time quality defect detection.
[0026] Obtain a sample data set, preprocess the sample data set, and use the preprocessed sample data to train the optimized defect detection network; call the industrial camera to obtain the processing screen of the processing site in real time, and use the trained optimized defect detection network and the image to be detected
[0027] Detect weld quality defects in the molten pool state.
[0028] Preferably, the MHSA attention mechanism is added to the backbone layer, including:
[0029] Add the MHSA attention mechanism to the 11th layer in the backbone.
[0030] Preferably, adding a Shuffle Attention mechanism to the head layer includes: adding a Shuffle Attention mechanism to the 13th layer in the head.
[0031] Preferably, a real-time detection system is built based on the improved algorithm, including:
[0032] By building the system interface with the pyqt5 module in python, it is possible to identify quality defects using pictures, videos, and cameras. At the same time, the quality inspection data is saved through the SQL sever database, and processing decisions are provided. When the number of frames with identified defects is greater than 20% of the total number of identified frames, the system gives a stop inspection instruction.
[0033] Preferably, obtaining a sample data set and preprocessing the sample data set include:
[0034] Obtain a sample data set, where the images in the sample data set are in jpg image format. Use labelimg software to label the images in the sample data set. The label format is a txt label file suitable for optimizing the target detection model. The labeled sample data set is divided into a training set, a test set, and a validation set to complete the preprocessing of the sample data set.
[0035] Preferably, the weld quality defects in the molten pool state are detected using the trained optimized defect detection network and the image to be detected, including:
[0036] The image to be detected is input into the trained optimized target detection model, and the weld quality defect detection image under the molten pool state is output; wherein the defect detection image includes the defect type of each defect, and the position of each defect in the defect detection image is marked.
[0037] The present invention has at least the following beneficial effects: the present invention proposes a weld image preprocessing method integrating grayscale processing, Gaussian filtering, image sharpening and image enhancement. Reduce image noise interference and effectively amplify defect features in the molten pool state; at the same time, the present invention establishes a YOLOV8 weld quality defect detection model that integrates MHSA and Shuffle Attention dual attention mechanisms. After the algorithm is improved, the recognition accuracy of welding deviation is improved by 1%, the recognition accuracy of unfused quality defects is improved by 9%, and the recognition accuracy of porosity defects is improved by 28%. The accuracy is significantly improved, and it has certain practical application value; at the same time, the present invention develops a real-time detection and recognition system for weld quality defects based on the improved YOLOV8 algorithm. The system recognition function is divided into picture recognition, video recognition and real-time processing quality detection and recognition by calling industrial cameras. The system can also load other YOLOV8n network models to realize other types of processing quality defect recognition, so the system has high practical applicability. Finally, the system collects and analyzes the welding quality inspection data through the SQL database to realize real-time quality defect monitoring of the entire processing process. The present invention effectively improves the accuracy of weld quality defect detection in the molten pool state by optimizing the target detection model. At the same time, the use of network detection shortens the time of weld quality defect detection in the molten pool state, improves the detection efficiency, and can meet the needs of industrial production. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A method flow chart of a weld quality defect detection method based on YOLOV8 provided in an embodiment of the present invention;
[0039] Figure 2 Provide an improved defect detection network structure diagram for an embodiment of the present invention;
[0040] Figure 3 A schematic diagram of the MHSA attention mechanism provided by an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of the Shuffle Attention mechanism module provided by an embodiment of the present invention;
[0042] Figure 5 A structural diagram of a real-time detection method for weld quality defects provided by an embodiment of the present invention;
[0043] Figure 6 The main system interface of the real-time detection method for weld quality defects provided by the embodiment of the present invention;
[0044] Figure 7 A database structure diagram of the system in the real-time detection and identification method for weld quality defects provided by an embodiment of the present invention;
[0045] Figure 8 This is a data analysis interface of the system in the real-time detection and identification method of weld quality defects provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of a real-time detection method for laser welding quality defects based on deep learning proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures, or characteristics in one or more embodiments may be combined in any suitable form.
[0047] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0048] The following is a detailed description of a method for real-time detection and identification of laser welding quality defects based on deep learning provided by the present invention in conjunction with the accompanying drawings.
[0049] Example:
[0050] The main application scenarios of the present invention are: in the welding process of new energy vehicles, the welds usually have quality defects such as pores, welding deviation, and lack of fusion. Weld quality defects will affect the safety of new energy vehicles to a certain extent. Therefore, before and after the welding process, it is necessary to check the quality of the product in time; therefore, the main work of the present invention is to study and improve the detection algorithm for real-time detection and identification of laser welding quality defects based on deep learning, preprocess the initial image data, and develop a detection system to improve the recognition accuracy of tiny quality defects such as pores.
[0051] See also Figure 1 , which shows a flow chart of a method for real-time detection of laser welding quality defects based on deep learning provided by an embodiment of the present invention, the method comprising the following steps:
[0052] Step S1, obtaining a surface image of the weld in a molten pool state.
[0053] Step S2: The weld image data in the molten pool state is subjected to a preprocessing method integrating grayscale processing, Gaussian filtering, sharpening, and image enhancement.
[0054] First, grayscale processing is performed. Color images contain data from three channels, which is complicated to process. In order to simplify the processing process, the color image is converted into a grayscale image. The grayscale image unifies the RGB values of the pixels, and the grayscale range is 0 to 255. This greatly reduces computer processing time and makes data processing easier.
[0055] The weighted average method was selected in the study to grayscale the weld image, eliminate redundant information, and speed up image processing. The weighted average method formula is as follows. In the formula, R, G, and B are the three channel color components respectively; Gray(i,j) represents the processed image.
[0056] Gray(i,j)=0.299×R(i,j)+
[0057] 0.578×G(i,j)+0.144×B(i,j)
[0058] At the welding site, the noise generated by the welding process and other noise in the environment will interfere with the captured weld image, affecting the accuracy and clarity of the weld edge information, thereby adversely affecting the extraction of the weld area. Therefore, in this study, Gaussian filtering is used to reduce noise for the weld dataset. The following formula is Gaussian filtering, where (u, v) represents the coordinates of the pixel point; σ represents the standard deviation.
[0059]
[0060] Weld imaging systems usually require high-quality images to accurately detect and analyze weld features and defects. The original image may be affected by various factors, such as camera quality, lighting conditions, etc., which may cause the image to be blurry or lack clarity. Therefore, sharpening the original image can help improve the image quality and make the features of tiny quality defects such as pores in the weld more clearly visible.
[0061] Image sharpening enhances the sharpness of an image by convolving it with a convolution kernel. Here, the convolution kernel used is a 3x3 matrix with a center value of 9 and surrounding values of -1. The purpose of this convolution kernel is to emphasize the edges and details in the image, thereby enhancing the sharpness of the image. The specific steps are as follows:
[0062] Read original images: First, read the original images from the specified folder. These images are usually captured by the weld imaging system or other camera devices.
[0063] Define the convolution kernel: A 3x3 convolution kernel is used in the code, with a center value of 9 and surrounding values of -1, as shown in the following formula. The function of this convolution kernel is to slide over the image and perform a convolution operation with the image. The convolution operation involves multiplying the value of the convolution kernel with the pixel value of the image, adding the results, and then placing the result in the new image at the corresponding position.
[0064]
[0065] Convolution operation: Apply a convolution kernel to the original image. The value in the convolution kernel determines how the convolution operation affects the image. Here, a value of 9 in the convolution kernel means that the center pixel is strongly weighted, while a value of -1 for the surrounding pixels means that the surrounding pixels are lightly weighted to highlight the edges and details in the image. This is shown in the following formula:
[0066] S(x,y)=∑(I(xi,yi)*K(i,j)
[0067] Where (x, y) is the pixel coordinate in the output image S, and (i, j) is the element coordinate in the convolution kernel K. ∑ represents the sum of all elements of the convolution kernel K.
[0068] In the weld imaging system, the collected original image may have problems such as low contrast and low grayscale value. In this case, the grayscale of the background area is higher, while the grayscale of the welding area is lower, resulting in a blurred image, making subsequent feature extraction difficult. In order to improve the image quality and highlight the welding area, the image is enhanced. Histogram equalization enhancement mainly enhances the image contrast. It changes the histogram distribution of the weld grayscale image so that the corresponding cumulative distribution function of the image becomes a linear function. The steps of the HE algorithm are:
[0069] Calculate the probability mass function of all pixels in the weld grayscale image. The probability mass function is shown in the following formula. This function gives the probability of each grayscale value in the image. j Represents the number of a certain grayscale value; n represents the total number of all grayscale values; j represents the size of the grayscale value, which ranges from 0 to 255.
[0070]
[0071] Calculate the cumulative distribution function of all pixels. The cumulative distribution function is the sum of the probabilities of all pixels appearing. The formula of the cumulative distribution function is shown below. j represents the probability mass function of the pixel; k represents the size of the grayscale value.
[0072]
[0073] Calculate the grayscale value of the weld grayscale image according to the mapping of the cumulative distribution function. The mapped grayscale value is the grayscale value of the image histogram equalization. The calculation process is shown in the following formula. k is the cumulative distribution function; k represents the size of the gray value.
[0074] y k =int((max(k)-min(k)))×s k
[0075] At this point, the image to be detected for weld quality defects in the molten pool state can be obtained.
[0076] Step S3, constructing a defect detection network, and improving the defect detection network to obtain an optimized defect detection network.
[0077] After obtaining the image to be detected, it is necessary to build a defect detection network. It should be noted that the defect detection network in the present invention is a YOLOV8n model, but the traditional YOLOV8n network is not accurate in detecting small defects in weld quality defects in the molten pool state, and cannot meet the industrial production requirements. Therefore, it is necessary to further improve the defect detection network so that it can more accurately detect weld quality defects in the molten pool state.
[0078] Construct a defect detection network, where the defect detection is a YOLOV8n network. The defect detection network includes a backbone network and a detection head. The backbone network is used for feature extraction, and the detection head includes two parts, namely neck and prediction. Use top-down and bottom-up connection methods (FPN+PAN) to perform multi-scale fusion processing on the features extracted by the backbone network and then send them to the detection layer.
[0079] First of all, since the targets detected by the present invention are all weld quality defects in the molten pool state, the current detection algorithm is not friendly to small target detection, because before YOLOV8n adds the attention mechanism, it scans global features, resulting in insufficient defect feature acquisition capabilities. Therefore, the present invention constructs an improved YOLOV8 automobile battery box weld quality defect detection model that integrates MHSA and ShuffleAttention dual attention mechanisms, adds MHSA attention mechanism to the back bone layer, and adds ShuffleAttention attention mechanism to the head layer. Its specific structure is as follows Figure 2 shown.
[0080] Therefore, the specific method of adding attention mechanism to the defect detection network is as follows: adding MHSA attention mechanism to the 11th layer in the backbone and adding Shuffle Attention mechanism to the 13th layer in the head.
[0081] MHSA stands for Multi-Head Self-Attention. MHSA includes self-attention mechanism and multi-head attention mechanism. This design can improve the generalization ability of the model and improve the model's ability to obtain global context information. For weld images, improving the ability to recognize tone features through multi-head attention mechanism helps learn the relationship between objects, so that the model can collect and associate feature information from a large field. The MHSA module structure is as follows: Figure 3 shown.
[0082] To process two-dimensional images, the improved YOLOV8n model transforms the feature map x∈R through the Patch Embed module. H *W*C The spatial dimension is adjusted to a one-dimensional sequence x p ∈R N*(P·C) Where (H, W) is the resolution of the original feature map, C is the number of channels, (P, P) is the resolution of each image block, and N = HW / P 2 is the number of image blocks, i.e., the effective input sequence length of the MHSA module.
[0083] In order to make the MHSA module utilize the order information of the sequence, the position information of the sequence is added to the feature sequence, and three identical feature matrices Q, K and V are generated. The feature matrices are projected h times to the Cq, Ck and Cv dimensions through linear projection to calculate the dot product attention in parallel. The calculation formula 1 is as follows:
[0084]
[0085] ShuffleAttention enhances the representation ability of features by rearranging input features. First, the input features are randomly arranged, and then the arranged features are concatenated with the original features. Secondly, the similarity between the concatenated features and the original features is calculated through convolution operation. Finally, the similarity is converted into attention weights through the Softmax function. This time, targeted improvements are made to image features, and the ShuffleAttention (SA) module is introduced in the head layer to solve the problem of low accuracy in identifying small defects in welds. The SA module structure is as follows: Figure 4 After adding the ShuffleAttention module, the model can increase the diversity of welding quality defect features through random arrangement, thereby improving the expression ability of pore features and further improving recognition accuracy.
[0086] Step S4, obtaining a sample data set, preprocessing the sample data set, and using the preprocessed sample data to train the optimized defect detection network; using the trained optimized defect detection network and the image to be detected to detect weld quality defects in the molten pool state.
[0087] After optimizing the defect detection network and obtaining the optimized defect detection network, the optimized defect detection network needs to be trained.
[0088] First, obtain the sample data set, where the sample data set used for training is a public data set, and the format of the images in the sample data set is jpg format. Then use the labelimg software to label the images in the sample data set. The label format is a txt label file suitable for the yolo algorithm. In addition, the labeled sample data set is divided into training set, test set and validation set. Specifically, create a folder named images, which contains three folders, train, val, and test, to store the image files of the training set, test set, and validation set respectively. Next, create a folder named labels, which contains three folders, train, val, and test, to store the label files of the training set, test set, and validation set respectively, to complete the preprocessing of the sample data set.
[0089] During the training of the optimized defect detection network, the weld quality defect images in the molten pool state in the sample data set are scaled to a preset size and then sent to the improved optimized defect detection network for training. The specific process is as follows: 640×640 pixels are selected as the image size of the input model, the official weight is selected as the initial weight of the model, the learning rate of the initial weight is set to 0.0005, the weight decay is 0.0005, the maximum number of model training times is 300 times, and the batch size is 16.
[0090] During the training process, the superiority of the optimized defect detection network can be determined through various model evaluation indicators. The indicators for evaluating superiority include: Precision (precision), Recall (recall), AP (Average Precision). With recall as the horizontal axis and precision as the vertical axis, a PR curve can be drawn. The area under the PR curve is defined as AP, mAP (the average AP of each category). The calculation formulas for each evaluation indicator are as follows:
[0091]
[0092]
[0093] Among them, TP indicates the number of positive classes predicted as positive classes; TN indicates the number of positive classes predicted as negative classes; FP indicates the number of negative classes predicted as positive classes; FN indicates the number of negative classes predicted as negative classes; r(k) indicates the kth largest recall rate; max(p(r(k))) is the maximum precision value at point r. The training results of the optimized defect detection network are compared with the unimproved defect detection network. The results show that the optimized defect detection network has better accuracy in PCB bare board defect detection. The results are shown in Tables 1 and 2. Table 1 is the ablation experiment data conducted to prove the effectiveness of the improvement, and Table 2 is the detection data compared with other algorithms.
[0094] Table 1. Comparison data of ablation experiments
[0095]
[0096] Table 2 Comparison of other algorithms
[0097] algorithm Accuracy Frame rate mAP50% mAP50-95% Faster-RCNN 0.45931 6 0.47698 0.27951 YOLOV5 0.48631 27 0.58413 0.30548 YOLO V7 0.53147 29 0.61457 0.33654 YOLOV8n 0.54705 35 0.64448 0.3492 Improved YOLOV8n 0.77333 42 0.78813 0.53735
[0098] After the training of the optimized defect detection network is completed, the image to be detected is input into the trained optimized defect detection network, and a weld quality defect detection image under the molten pool state is output, wherein the defect detection image includes the defect type of each defect, and each defect is marked in the defect detection image.
[0099] In order to increase the practical application ability of the defect recognition model, a real-time detection and recognition system for laser welding weld quality defects was built based on Python and SQL sever database. The specific framework of the system is as follows: Figure 5 shown.
[0100] The present invention applies the pyqt5 module in python to develop a real-time weld detection system based on deep learning. The detection system includes model selection, image recognition, video recognition and camera real-time recognition.
[0101] The main function of the system is to use industrial cameras to identify the quality defects of welds in the laser welding process in real time. In practical applications, the processing images can be transmitted in real time through industrial cameras, and the algorithm scans the transmitted images frame by frame in real time. By calling the trained deep learning model for detection, the real-time detection function of the quality defects of welds in the remote welding process can be realized. The system interface is as follows Figure 6 Shown
[0102] The inspection data is collected through SQL sever software. Due to the frequent occurrence of weld quality defects in the battery box welding process, the amount of weld quality defect information is large, and some quality defects need to be judged according to the on-site situation, resulting in the need to archive the data, so the design of the database is extremely important. In the process of entering historical fault information, different shift data are stored in different tables, and there is also a certain connection between the tables. The overall structure of the system database is as follows Figure 7 shown.
[0103] When the qualified rate is lower than the set standard, the quality control personnel log in to the database, retrieve the corresponding shift and equipment data, and conduct quality analysis based on its environmental parameters and welding parameters, and give improvement suggestions based on the analysis results. Figure 8 shown.
[0104] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The above is a description of a specific embodiment of this specification. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0105] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0106] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the present invention should be included in the protection scope of the present invention.
Claims
1. A real-time detection method for weld quality defects based on deep learning, characterized in that: The method includes: Acquire the weld processing image of the molten pool state during the laser welding process; Construct a defect detection network and improve it to obtain an optimized defect detection network. Specifically, add the MHSA attention mechanism to the back bone layer and the Shuffle Attention mechanism to the head layer. The defect detection network is the YOLOV8n model. A sample data set is obtained, and an image preprocessing method that integrates grayscale processing, Gaussian filtering, sharpening, and image enhancement is used to process the sample data set to obtain training images. The preprocessed sample data is used to train the improved network; the weld quality defects in the molten pool state are detected using the trained improved defect detection network and the images to be detected; and the detection system is connected to the SQL sever database to realize real-time detection data collection.
2. The real-time detection method for weld quality defects based on deep learning according to claim 1 is characterized in that: Preprocess the sample data set, including: The image is processed by a preprocessing method that integrates grayscale processing, Gaussian filtering, sharpening and image enhancement.
3. The real-time detection method for weld quality defects based on deep learning according to claim 1 or 2, characterized in that: Adding the MHSA attention mechanism to the back bone layer includes: Add MHSA attention mechanism to the 11th layer in back bone.
4. The real-time detection method for weld quality defects based on deep learning according to claim 3 is characterized in that: Adding the Shuffle Attention mechanism to the head layer includes: Add the Shuffle Attention mechanism to the 13th layer in the head layer.
5. The real-time detection method for weld quality defects based on deep learning according to claim 4 is characterized in that: The step of obtaining a sample data set and preprocessing the sample data set includes: Obtain a sample data set, where the images in the sample data set are in jpg image format. Use labelimg software to label the images in the sample data set. The label format is a txt label file suitable for optimizing the target detection model. The labeled sample data set is divided into a training set, a test set, and a validation set to complete the classification of the training set samples.
6. The real-time detection method for weld quality defects based on deep learning according to claim 5 is characterized in that: The method of using the trained optimized defect detection network and the image to be detected to detect the quality defects of the weld in the molten pool state during the laser welding process includes: The image to be detected is input into the trained optimized target detection model, and a defect detection image of the weld is output; wherein the defect detection image includes the defect type of each defect, and the position of each defect in the defect detection image is marked.
7. The real-time detection method for weld quality defects based on deep learning according to claim 1 is characterized in that: Information collection is achieved through systems and databases, including: The system interface is built through the pyqt5 module in python to realize quality defect recognition through pictures, videos and camera calls. At the same time, the quality inspection data is saved through the SQL sever database and processing decisions are provided. When the number of frames with defects recognized is greater than 20% of the total number of recognized frames, the system gives a stop inspection instruction.
8. The real-time detection method for weld quality defects based on deep learning according to claim 7 is characterized in that: An industrial application system was built based on the defect recognition model. The system is a real-time detection and identification system for laser welding weld quality defects based on python and SQL sever database. The specific framework of the system includes weld image acquisition module, laser welding manufacturing module, defect feature extraction module and network improvement module. The recognition functions of the system are divided into picture recognition, video recognition and calling industrial cameras for real-time processing quality detection and identification. The system also loads other YOLOV8n network models to realize other types of processing quality defect recognition. Finally, the system collects and analyzes the welding quality inspection data through the SQL database to realize real-time quality defect monitoring of the entire processing process.
Citation Information
Cited By
Wine box abnormity automatic detection method and system based on deep learning
CN118823018A
Butt welding back weld width prediction and control method and system
CN119426842A
Underwater feature recognition and tracking research based on deep learning
CN119963852A
Welding defect identification method and system based on molten pool image
CN120198421A
Cover plate welding seam fusion width measuring method and device based on ultrasonic image
CN120254050A
