Welding defect detection method and system

The welding defect detection model is constructed through the YOLO11 algorithm, which solves the problem of low efficiency of manual determination of welding defects, realizes automated detection and high-quality welding defect positioning, and improves welding production efficiency.

CN120495271APending Publication Date: 2025-08-15GUANGZHOU CHUANGZHILI INTELLIGENT TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510673411.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

Existing welding defect detection relies on manual judgment, is inefficient and prone to missed inspection, making it difficult to achieve automated inspection.

Method used

The YOLO11 algorithm is used to construct the region of interest extraction model, permeable line model and welding defect model, and the data set is generated through X-ray image annotation, and the object detection model is trained to realize the bead region extraction and defect positioning.

Benefits of technology

It realizes automatic detection of welding defects, improves detection quality and efficiency, reduces computing resource overhead, provides physical dimensions and position information of welding defects, and supports automated welding production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120495271A_ABST
    Figure CN120495271A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of welding defect detection, and provides a welding defect detection method and system, and the method comprises the steps: constructing a region-of-interest extraction model, a permeability meter line model and a welding defect model based on a target detection algorithm; inputting a to-be-detected welding image into the region-of-interest extraction model to obtain a penetration meter region, a welding bead region and a positioning mark region; inputting the permeameter area into the permeameter line model to obtain a visible line detection result, and obtaining image calibration information based on the visible line detection result; the welding bead area is input into the welding defect model, and a defect detection result is obtained; based on the image calibration information and the positioning mark area, the defect detection result is mapped to the physical welding area, welding defects are positioned, automatic detection of welding production is achieved, and then the production quality of welding workpieces is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of welding defect detection, and in particular relates to a welding defect detection method and system. Background Art

[0002] The welding process is a key link to ensure the effective connection of different workpieces. Various complex factors in the welding process, such as welding process problems, often lead to defects in welding, which in turn cause quality problems in the product. In order to improve product quality, it is usually necessary to detect possible problems in a timely manner during the production process.

[0003] Since welding defects usually occur inside the welded part of the workpiece, non-destructive detection methods such as X-rays or ultrasound are needed to obtain the internal conditions. In the existing technology, after obtaining the image of the internal conditions, manual work is often required to find and determine the welding defects. This not only places high demands on the inspectors, but may also lead to missed inspections due to various reasons.

[0004] Therefore, realizing the automation of defect detection is an important means to improve welding quality and has considerable economic value. Summary of the Invention

[0005] The embodiments of the present application provide a welding defect detection method and system, which can solve one of the above-mentioned problems in the prior art.

[0006] In a first aspect, an embodiment of the present application provides a welding defect detection method, comprising: Based on the target detection algorithm, the region of interest extraction model, penetrometer line model and welding defect model are constructed; Inputting the welding image to be inspected into the region of interest extraction model to obtain the penetrometer area, weld bead area and positioning mark area; Inputting the penetrometer area into the penetrometer line model to obtain visible line detection results, and obtaining image calibration information based on the visible line detection results; Inputting the weld bead area into the welding defect model to obtain a defect detection result; Based on the image calibration information and the positioning mark area, the defect detection result is mapped to the physical welding area to locate the welding defect.

[0007] Furthermore, the target detection algorithm is the YOLO11 algorithm; The target detection algorithm is based on which a region of interest extraction model, a penetrometer line model and a welding defect model are constructed, including: Acquire image samples of the welding part, and preprocess the image samples to obtain a target data set; The target data set is input into the YOLO11 algorithm to obtain a region of interest extraction model, a penetrometer line model, and a welding defect model.

[0008] Furthermore, the acquiring of image samples of the welding part and preprocessing of the image samples to obtain a target data set includes: Using X-ray photography equipment to photograph each welding position to obtain a plurality of weld bead images, and selecting samples from the plurality of weld bead images to obtain image samples; dividing the image sample into a first image sample and a second image sample; Labeling the regions of interest in the first image sample using Labelme software to obtain a region of interest data set, wherein the regions of interest include a weld bead region, a penetrometer region, and a positioning mark region; Using Labelme software to label the penetrometer lines in the second image sample to obtain a penetrometer line dataset, where the penetrometer lines are visible lines in the second image sample; For the first image sample and the second image sample with defects, marking the welding defect type to obtain a defect detection data set, wherein the welding defect type includes point defects and strip defects; The images in the defect detection dataset, the region of interest dataset, and the penetrometer line dataset are respectively subjected to size change and uniformization processing, and are randomly divided into a training set and a test set according to a preset ratio.

[0009] Furthermore, the step of inputting the welding image to be inspected into the region of interest extraction model to obtain the penetrometer region, the weld bead region, and the positioning mark region includes: Preprocess the welding image to be inspected and add image features to obtain a welding feature image; Converting the welding feature image into a standard feature image, and obtaining a model output region through a region of interest extraction model; The model output area is decoded, and NMS screening is performed to eliminate invalid results to obtain the penetrometer area, weld area and positioning mark area, wherein the weld area includes the weld area range and the weld direction type.

[0010] Furthermore, after inputting the penetrometer area into the penetrometer line model to obtain the visible line detection result, the method includes: Based on the confidence order, the overlapping frames with low confidence are eliminated, and the serial number sorting method of each visible transmittance meter line is determined by the serial number difference formula; Based on the sequence number sorting method, correct the incorrect sequence numbers in the visible penetrometer lines to obtain the number of visible lines; The imaging quality of the welding image to be inspected is determined based on the number of visible lines.

[0011] Furthermore, obtaining image calibration information based on the visible line detection result includes: intercepting the image area corresponding to the first n visible transmittance meter lines in descending order of visibility in the visible line detection result; For each of the image regions, adaptive binarization and Hough line detection method are used to obtain a corresponding straight line equation; Based on the straight line equation, calculating the pixel line distance between two adjacent visible penetrance meter lines; The pixel line distance is proportionally converted to the actual penetrometer line distance to obtain image calibration information.

[0012] Furthermore, inputting the weld bead area into the welding defect model to obtain defect detection results includes: intercepting a weld bead region in the welding image to be detected, and performing uniform processing on the weld bead in the weld bead region; Slicing each weld bead after the unified processing to obtain multiple weld bead slices; Inputting each of the weld bead slices into the welding defect model to obtain regional detection results of the plurality of weld bead slices; All the regional inspection results are combined into one weld bead inspection result, and the overlapping areas in the weld bead inspection results are screened using NMS; For long strip defects that are cut off during the slicing process, the intersection-union ratio is used to determine whether they can be merged; Based on the screening results and the merging results, a defect detection result is generated, where the defect detection result is a prediction result box of the defect.

[0013] Furthermore, mapping the defect detection result to a physical welding area based on the image calibration information and the positioning mark area includes: Processing the positioning mark area to obtain a positioning coordinate origin; Based on the coordinate information of the positioning coordinate origin and the prediction result frame, combined with the image calibration information, the physical relative position of the welding defect is calculated; Based on the width information and height information of the prediction result frame and combined with the image calibration information, the actual physical size of the welding defect is calculated.

[0014] Furthermore, the processing of the positioning mark area to obtain the positioning coordinate origin includes: intercepting a positioning mark area in the welding image to be detected, and segmenting a cross-shaped center mark from the positioning mark area; Using a skeleton thinning algorithm to thin the center mark, and using a Hough line detection algorithm to extract two corresponding mutually perpendicular marking lines from the thinned center mark; The intersection of the two marking straight lines is calculated, and the intersection is used as the origin of the positioning coordinates.

[0015] In a second aspect, an embodiment of the present application provides a welding defect detection system, comprising: The target detection model construction module is used to build the region of interest extraction model, penetrometer line model and welding defect model based on the target detection algorithm; A region of interest extraction module is used to input the welding image to be inspected into the region of interest extraction model to obtain the positioning mark area, the penetrometer area and the weld bead area; an image calibration information determination module, inputting the penetrometer area into the penetrometer line model to obtain a visible line detection result, and obtaining image calibration information based on the visible line detection result; A welding defect detection module, configured to input the weld area into the welding defect model to obtain a defect detection result; The welding defect positioning module is used to map the defect detection results to the physical welding area based on the image calibration information and the positioning mark area, and to locate and analyze the welding defects.

[0016] Compared with the prior art, the embodiments of the present application have the following beneficial effects: 1. By utilizing a large number of existing X-ray images of welded workpieces and having them annotated by professionals, a large and high-quality X-ray welding defect dataset was obtained, which was then used to train and test the target detection model. Ultimately, a region of interest extraction model, a penetrometer line model, and a welding defect model were generated for subsequent welding defect detection.

[0017] 2. The region of interest extraction model is used to simultaneously extract the weld area and calibrate the image. By removing the background, the possibility of misidentification caused by background content is greatly reduced, the output quality of welding defect detection is improved, and the cost is reduced.

[0018] 3. During the defect detection process, the welds in the weld area are unified and sliced, thereby reducing the computing resource overhead and the requirements for computing equipment, which is conducive to the final application and deployment of the welding defect detection method.

[0019] 4. Based on the image calibration information and positioning mark area, the defect detection results are calibrated on the workpiece, that is, the actual physical size and physical relative position of the welding defect can be obtained at the same time, which helps the staff to make subsequent judgments and analyses, realizes the automated detection of welding production, and thus improves the production quality of welded workpieces. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0021] Figure 1 This is a flow chart of a welding defect detection method provided by one embodiment of the present invention; Figure 2 It is a structural diagram of a welding defect detection system provided by one embodiment of the present invention. DETAILED DESCRIPTION

[0022] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.

[0023] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0024] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0025] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0026] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0027] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0028] See also Figure 1 As shown, the present invention is a welding defect detection method, comprising the following steps: S100: Based on the target detection algorithm, construct the region of interest extraction model, the penetrometer line model and the welding defect model; In this application, by utilizing a large number of existing X-ray images of welding workpieces and having them annotated by professionals, a large amount of X-ray welding defect data set with high-quality annotations was obtained, so as to train and test the target detection model, and finally generate a region of interest extraction model, a penetrometer line model and a welding defect model for subsequent detection of welding defects.

[0029] In some embodiments, the target detection algorithm is the YOLO11 algorithm; Furthermore, the above step S100 includes: Acquire image samples of the welding part, and preprocess the image samples to obtain a target data set; The target data set is input into the YOLO11 algorithm to obtain a region of interest extraction model, a penetrometer line model, and a welding defect model.

[0030] In this embodiment, the YOLO11 algorithm is trained by the target data set to obtain three target detection models, namely, a region of interest extraction model for detecting weld beads, positioning marks, and the area where the penetrometer is located in the complete welding image, a penetrometer line model for detecting each penetrometer line in the penetrometer area, and a welding defect model for detecting welding defects in the weld bead area.

[0031] Specifically, the YOLO11 algorithm is a target detection algorithm optimized on the basis of YOLOv8, which achieves a dual improvement in accuracy and speed, and has stronger adaptability to complex scenes. When training the target detection model, the input data is subjected to random flipping, random scaling, random erasing, random cropping and Mosiac enhanced data enhancement methods to enhance the robustness of the model. At the same time, the output results are obtained through feature extraction, feature fusion and target prediction modules. The loss is calculated after decoding, and then reverse gradient propagation is used for automatic training to optimize the model parameters, and then the category, position and confidence of the predicted target are obtained from the image. Specifically, in this embodiment, the target data set is input into the YOLO11 neural network constructed by the YOLO11 algorithm, and then the YOLO11 neural network is trained using the corresponding target data set.

[0032] In some embodiments, obtaining image samples of a welding part and preprocessing the image samples to obtain a target data set include: Using X-ray photography equipment to photograph each welding position to obtain a plurality of weld bead images, and selecting samples from the plurality of weld bead images to obtain image samples; dividing the image sample into a first image sample and a second image sample; Labeling the regions of interest in the first image sample using Labelme software to obtain a region of interest data set, wherein the regions of interest include a weld bead region, a penetrometer region, and a positioning mark region; Using Labelme software to label the penetrometer lines in the second image sample to obtain a penetrometer line dataset, where the penetrometer lines are visible lines in the second image sample; For the first image sample and the second image sample with defects, marking the welding defect type to obtain a defect detection data set, wherein the welding defect type includes point defects and strip defects; The images in the defect detection dataset, the region of interest dataset, and the penetrometer line dataset are resized and unified, and randomly divided into a training set and a test set according to a preset ratio.

[0033] In this embodiment, a welding part on any welding workpiece is photographed by a traditional X-ray photographic device or a digital X-ray photographic device, and an X-ray image production data set with a large number of weld bead images is generated. The weld bead images photographed by the traditional X-ray photographic device need to be digitized, and then samples with various defects and a small number of defect-free samples are selected from the X-ray image production data set. On this basis, samples with too poor quality are eliminated to generate image samples for subsequent training of the target detection model.

[0034] More specifically, the image sample is divided into a first image sample and a second image sample, which are used for training the region of interest extraction model and the penetrometer line model respectively. Specifically, for the first image sample, the region of interest in the welding image is marked with Labelme software, specifically the weld bead area, the penetrometer area and the positioning mark area, and then the region of interest data set is generated. Furthermore, in some embodiments of the present application, based on the different orientations of the weld bead, it can be further divided into a transverse weld bead area and a longitudinal weld bead area; for the second image sample, the penetrometer line is marked with Labelme software. Specifically, in Labelme software, a penetrometer line is assigned to each penetrometer line. A unique category label is obtained and numbered in sequence. Only visible lines in the image are annotated to obtain a penetrometer line dataset. In one possible embodiment, the number of category labels is 7. Furthermore, the images in the region of interest dataset and the penetrometer line dataset need to be resized and unified respectively so that each input data has a unified input format for the corresponding target detection model and is trained. Subsequently, the input data for the region of interest extraction model or the penetrometer line model needs to be simultaneously unified to meet the corresponding input requirements and ensure the accuracy of the final output data of the region of interest extraction model or the penetrometer line model.

[0035] For the welding defect model, the samples with defects in the first image sample and the second image sample are marked with welding defect types. It can be understood that during the welding process, various defects may exist in the weld, which are mainly divided into two categories: point defects and long strip defects. Therefore, in this embodiment, the point defects and long strip defects in the defective samples are marked to generate a defect detection data set. Furthermore, in some embodiments of the present application, the direction of the long strip welds of each image sample in the defect detection data set is uniformly processed as horizontal, and the long strip welds are cut from left to right to obtain weld slices, wherein the length of the weld slice should be smaller than the horizontal dimension of the weld slice. At the same time, the welding defect types marked in the image samples are annotated and transformed so that the defect annotations in the corresponding weld slices are retained, and the part of the long strip defects that exceeds the slices is truncated.

[0036] In this embodiment, the defect detection dataset, the region of interest dataset, and the penetrometer line dataset are randomly divided into a training set and a test set based on a preset allocation ratio. Thus, the region of interest extraction model, the penetrometer line model, and the welding defect model can be trained and tested respectively.

[0037] S200, inputting the welding image to be inspected into the region of interest extraction model to obtain a penetrometer area, a weld bead area, and a positioning mark area; This application simultaneously realizes the extraction and image calibration of the weld area through the region of interest extraction model. By eliminating the background, the possibility of misidentification caused by background content is greatly reduced, the output quality of welding defect detection is improved, and the overhead is reduced.

[0038] Specifically, the regions of interest in the welding image to be detected can be obtained through the region of interest extraction model, specifically the penetrometer area, the weld area and the positioning mark area. The positioning coordinate origin of the welding image to be detected can be obtained through the positioning mark area, and the visible lines in the welding image to be detected can be obtained through the penetrometer area. The image calibration information can be obtained through the visible lines and the positioning coordinate origin, combined with the actual penetrometer line distance, which is the conversion relationship between the welding image to be detected and the physical welding area. By detecting the weld area, the defect detection result can be obtained, and then, through the above conversion relationship, the defect detection result is mapped to the physical welding area. It can be understood that the welding image to be detected is an image corresponding to the weld taken on the workpiece by X-ray photography equipment, and the physical welding area is the actual weld area, that is, the relative area of the weld on the workpiece.

[0039] In some embodiments, step S200 includes: Preprocess the welding image to be inspected and add image features to obtain a welding feature image; Converting the welding feature image into a standard feature image, and obtaining a model output region through a region of interest extraction model; The model output area is decoded, and NMS screening is performed to eliminate invalid results to obtain the penetrometer area, weld area and positioning mark area, wherein the weld area includes the weld area range and the weld direction type.

[0040] In this embodiment, before performing relevant defect processing on the welding image to be detected, it needs to be preprocessed. Specifically, bilateral filtering is used to suppress noise on the welding image to be detected, and the CLAHE histogram equalization algorithm is used to enhance the contrast of the image, improve the grayscale difference between the weld and the image background, enhance the features of the grayscale image, and generate a welding feature image. Furthermore, the welding feature image is converted into an image that can be processed by the region of interest extraction model. Specifically, the welding feature image is converted into a 640*640 size and normalized to finally generate a standard feature image.

[0041] In this embodiment, after the standard feature image is input into the region of interest extraction model, the region of interest extraction model outputs the prediction results of each region of interest, which is the model output area. By decoding the model output area, the corresponding region of interest can be obtained, and then NMS is used for screening to eliminate invalid regions of interest with low confidence or duplication, and finally the penetrometer area, positioning mark area and weld area are obtained, wherein the weld area includes the weld area range and the weld direction type, and the weld direction type is specifically a transverse weld and a longitudinal weld.

[0042] S300, inputting the penetrometer area into the penetrometer line model to obtain visible line detection results, and obtaining image calibration information based on the visible line detection results; In this embodiment, a corresponding penetrometer area is captured from the welding image to be inspected and preprocessed, such as denoising and contrast enhancement, to extract key information of the penetrometer lines and reduce background interference. The preprocessed penetrometer area is then input into the penetrometer line model to obtain visible line detection results, wherein the visible line detection results include the position and serial number of the visible penetrometer lines.

[0043] In some embodiments, after inputting the penetrometer area into the penetrometer line model to obtain visible line detection results, the method includes: Based on the confidence order, the overlapping frames with low confidence are eliminated, and the serial number sorting method of each visible transmittance meter line is determined by the serial number difference formula; Based on the sequence number sorting method, correct the incorrect sequence numbers in the visible penetrometer lines to obtain the number of visible lines; The imaging quality of the welding image to be inspected is determined based on the number of visible lines.

[0044] In this embodiment, the visible line detection result can be further corrected based on the visible line detection result obtained by the penetrometer line model, and the imaging quality of the welding image to be detected can be judged at the same time, thereby improving the accuracy of welding defect detection.

[0045] Specifically, the detection frames of the visible transmittance line output by the transmittance line model are sorted according to the confidence order. For two overlapping detection frames, the overlapping frame with low confidence is removed to avoid repeated detection.

[0046] Furthermore, the serial numbers of each visible penetrometer line are corrected. Specifically, the serial number difference formula is: , where d represents the sorting direction. When d is greater than 0, it means the sequence number increases from left to right. When d is less than 0, it means the sequence number decreases from left to right. represents the sequence number of the nth visible penetrometer line from left to right. Therefore, the sequence number difference formula described above can be used to determine the sequence number ordering for each visible penetrometer line, that is, whether the sequence numbers are increasing or decreasing from left to right. The sequence number ordering method can then be used to determine whether the sequence numbers for each visible penetrometer line are correctly ordered. For incorrect sequence numbers, further corrections are performed. Specifically, based on the sequence number ordering method, each pair of adjacent sequence numbers is checked to see if they conform to the direction corresponding to the sequence number ordering method. Sequence numbers that do not conform to the overall direction are marked as incorrect and adjusted according to the sequence number ordering method. This directional correction ensures that the detected sequence number arrangement conforms to the physical order, reducing false detections and misordering, thereby improving processing efficiency.

[0047] In this embodiment, based on the corrected visible transmittance meter lines, the number of visible transmittance meter lines can be finally determined, thereby judging the imaging quality and more accurately judging whether the imaging is clear and uniform.

[0048] In some embodiments, obtaining image calibration information based on the visible line detection result includes: intercepting the image area corresponding to the first n visible transmittance meter lines in descending order of visibility in the visible line detection result; For each of the image regions, adaptive binarization and Hough line detection method are used to obtain a corresponding straight line equation; Based on the straight line equation, calculating the pixel line distance between two adjacent visible penetrance meter lines; The pixel line distance is proportionally converted to the actual penetrometer line distance to obtain image calibration information.

[0049] In this embodiment, n visible penetrometer lines are selected from the corrected visible line detection results according to their visibility, and the ratio of the visible penetrometer lines to their actual positions on the workpiece is converted to obtain the proportional relationship between the weld image to be inspected and the weld bead on the workpiece, i.e., image calibration information, which is used to ultimately locate the welding defect on the workpiece.

[0050] In this embodiment, the image area corresponding to n visible penetrating lines is subjected to adaptive binarization and Hough line detection methods respectively to obtain line equations. Specifically, an adaptive threshold method is used to automatically calculate the threshold based on the local features of the image area, and the image is converted into a binary image to more clearly separate the visible penetrating lines and the background image. Then, the visible penetrating lines are detected in the binary image and their line equations are extracted. Specifically, for each detected visible penetrating line, its starting point coordinates (x1, y1) and The end point coordinates are (x2, y2), and the slope k and intercept b of the visible penetrometer line are calculated from them, where the slope is: k = (x2 − x1) / (y2 − y1), and the intercept is: b = y1 − k × x1. The final straight line equation is expressed as: y = kx + b. Based on the straight line equations of each visible penetrometer line, the pixel line distance between two adjacent penetrometer lines is calculated. In a preferred embodiment, the number of selected visible penetrometer lines is 3. When the pixel line distance is proportionally converted to the actual penetrometer line distance, the conversion formula is specifically: , where s represents the image calibration information, represents the pixel line distance between the first two visible penetrometer lines, is the pixel line distance between the last two visible penetrometer lines, Indicates the actual penetrometer line distance.

[0051] S400, inputting the weld bead area into the welding defect model to obtain a defect detection result; During the defect detection process, this application reduces computing resource overhead and lowers the requirements for computing equipment by unifying and slicing each weld in the weld area, which is beneficial to the final application deployment of the welding defect detection method.

[0052] In some embodiments, step S400 includes: intercepting a weld bead region in the welding image to be detected, and performing uniform processing on the weld bead in the weld bead region; Slicing each weld bead after the unified processing to obtain multiple weld bead slices; Inputting each of the weld bead slices into the welding defect model to obtain regional detection results of the plurality of weld bead slices; All the regional inspection results are combined into one weld bead inspection result, and the overlapping areas in the weld bead inspection results are screened using NMS; For long strip defects that are cut off during the slicing process, the intersection-union ratio is used to determine whether they can be merged; Based on the screening results and the merging results, a defect detection result is generated, where the defect detection result is a prediction result box of the defect.

[0053] In this embodiment, the weld area in the input welding defect model needs to be preprocessed to make it conform to the input format of the welding defect model. The specific preprocessing process corresponds to the preprocessing process of the defect detection data set during the construction of the welding defect model. Specifically, the corresponding weld area is intercepted from the welding image to be detected to eliminate the interference of the background area on the defect detection, and then the longitudinal long strip welds in the weld area are rotated and unified into the horizontal direction, and scaled proportionally until they are the same as the longitudinal length preset in the defect detection data set. Then, the horizontal slicing process is performed, and the weld area is cut with a step size slightly smaller than the slice length for standby use to ensure that there are overlapping parts between the slices, and the areas beyond the weld area are filled with black. If there are multiple welds in the weld area, the same slicing process is performed on each of them, and finally multiple weld slices are obtained.

[0054] It is understandable that if, during the construction of the welding defect model and the preprocessing of the defect detection data set, the long welds are uniformly processed as vertical and horizontally sliced, then the weld areas in the input welding defect model need to be processed synchronously to ensure the accuracy of the final output results.

[0055] In this embodiment, when performing defect detection on the weld area, each weld slice is input into the defect detection model respectively, and is decoded and screened to obtain the regional detection result on each weld slice. The regional detection results generated by all weld slices are integrated to generate a weld detection result. For the overlapping areas, NMS is used to screen the overlapping areas to remove invalid prediction results. In addition, during the weld slicing process, the long strip defects in the weld area may be partially truncated. Therefore, the intersection-union ratio is used to determine whether the detected long strip defects can be merged. The specific formula is: , where A and B represent the detection frames corresponding to the two long strip defects that need to be judged. Represents the intersection area of two detection frames, It represents the area of the union of two detections. If IoU ≥ T, it means that there is enough overlap between the two long strip defects and they need to be merged. It can be understood that T represents the preset threshold, which is used to determine whether the two long strip defects should be merged. The choice of threshold T depends on the specific application scenario and requirements. Generally speaking, if you want to merge defects with a high degree of overlap, you can choose a relatively large threshold, such as T=0.5; if you want to control the merging conditions more strictly, you can choose a smaller threshold, such as T=0.3.

[0056] In this embodiment, the weld detection results after screening and merging are aggregated into defect detection results, which include prediction result boxes for each defect to facilitate subsequent defect detection.

[0057] S500 : Based on the image calibration information and the positioning mark area, map the defect detection result to the physical welding area to locate the welding defect.

[0058] This application calibrates the defect detection results on the workpiece based on image calibration information and positioning mark areas, that is, while obtaining the welding defects, its actual physical size and physical relative position can be obtained, which helps the staff to make subsequent judgments and analyses, realizes the automated detection of welding production, and thus improves the production quality of welded workpieces.

[0059] In some embodiments, step S500 includes: Processing the positioning mark area to obtain a positioning coordinate origin; Based on the coordinate information of the positioning coordinate origin and the prediction result frame, combined with the image calibration information, the physical relative position of the welding defect is calculated; Based on the width information and height information of the prediction result frame and combined with the image calibration information, the actual physical size of the welding defect is calculated.

[0060] In this embodiment, the defect detection result obtained in step S400 needs to be combined with the image calibration information and physically positioned on the workpiece to facilitate subsequent positioning and processing of welding defects.

[0061] Specifically, by processing the positioning mark area, the positioning coordinate origin of the welding image to be detected is determined, and based on the positioning coordinate origin, the coordinate position of each prediction result frame is determined. It is worth noting that in the above step S300, for each detected visible penetrometer line, its starting point coordinates (x1, y1) and end point coordinates (x2, y2) are marked, and the marking is also based on the positioning coordinate origin. Therefore, the coordinate position of the prediction result frame and the conversion relationship of the image calibration information are finally formed based on the positioning coordinate origin, thereby ensuring the reliability and practicality of the mapping relationship.

[0062] In this embodiment, the physical relative position of the welding defect represents the relative position of the welding defect on the workstation, and the specific calculation formula is: ; , where x and y represent the physical relative positions of the welding defects, and Indicates the coordinates of the upper left corner of the prediction result box, and represents the origin of the positioning coordinates, s represents the image calibration information; and the physical actual size of the welding defect represents the actual size of the welding defect at the workstation. The specific calculation formula is: ; , where w represents the physical actual width of the welding defect, h represents the physical actual height of the welding defect, and Respectively represent the width and height of the prediction result box.

[0063] In some embodiments, processing the positioning mark area to obtain the positioning coordinate origin includes: intercepting a positioning mark area in the welding image to be detected, and segmenting a cross-shaped center mark from the positioning mark area; Using a skeleton thinning algorithm to thin the center mark, and using a Hough line detection algorithm to extract two corresponding mutually perpendicular marking lines from the thinned center mark; The intersection of the two marking straight lines is calculated, and the intersection is used as the origin of the positioning coordinates.

[0064] In this embodiment, a corresponding positioning mark area is intercepted from the welding image to be detected, and the positioning mark area is processed using an adaptive threshold binarization algorithm to exclude irrelevant background images in the image. Then, a cross-shaped center mark is segmented from the positioning mark area, and a skeleton thinning algorithm is used to thin the cross-shaped center mark to obtain a cross-shaped skeleton. The Hough line detection algorithm is used to propose two mutually perpendicular marking lines corresponding to the cross-shaped skeleton, and the intersection of the two marking lines is calculated, which is the positioning coordinate origin.

[0065] See also Figure 2 As shown, the present invention also provides a welding defect detection system, the system comprising: The target detection model construction module 201 is used to construct a region of interest extraction model, a penetrometer line model and a welding defect model based on the target detection algorithm; The region of interest extraction module 202 is used to input the welding image to be inspected into the region of interest extraction model to obtain the positioning mark area, the penetrometer area and the weld bead area; An image calibration information determination module 203 inputs the penetrometer area into the penetrometer line model to obtain a visible line detection result, and obtains image calibration information based on the visible line detection result; The welding defect detection module 204 is used to input the weld area into the welding defect model to obtain a defect detection result; The welding defect positioning module 205 is used to map the defect detection result to the physical welding area based on the image calibration information and the positioning mark area, and to locate and analyze the welding defect.

[0066] In the present application, the above-mentioned target detection model construction module, region of interest extraction module, image calibration information determination module, welding defect detection module and welding defect positioning module are systematically encapsulated to generate a welding defect detection system and packaged into a mirror file. The welding defect detection system of the present application supports containerized operation on a single server or on a Kubernetes cluster, provides services to the outside in the form of an API interface in JSON format, and supports acceleration using GPU resources; when the welding defect detection system receives an X-ray image of the welding area, that is, the welding image to be detected, it returns the number of visible lines of the penetrometer for measuring the image quality, as well as the welding defect location, welding defect type and welding defect size. Therefore, the welding defect detection system based on the present application can automatically output the above-mentioned information related to the welding defect, and then can analyze and determine the welding defect, thereby performing operations such as repairing the welding defect to ensure the quality requirements of the workpiece during the production process.

[0067] It is understandable that if Figure 1 The contents of the welding defect detection method embodiment shown in FIG. 1 are applicable to the welding defect detection system embodiment. The functions specifically implemented by the welding defect detection system embodiment are similar to those in FIG. Figure 1 The welding defect detection method embodiment shown is the same as that shown in FIG. Figure 1 The beneficial effects achieved by the welding defect detection method embodiment shown are also the same.

[0068] It should be noted that the information interaction, execution process and other contents between the above-mentioned systems are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0069] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0070] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A welding defect detection method, characterized in that: include: Based on the target detection algorithm, the region of interest extraction model, penetrometer line model and welding defect model are constructed; Inputting the welding image to be inspected into the region of interest extraction model to obtain the penetrometer area, weld bead area and positioning mark area; Inputting the penetrometer area into the penetrometer line model to obtain visible line detection results, and obtaining image calibration information based on the visible line detection results; Inputting the weld bead area into the welding defect model to obtain a defect detection result; Based on the image calibration information and the positioning mark area, the defect detection result is mapped to the physical welding area to locate the welding defect.

2. The method according to claim 1, wherein The target detection algorithm is the YOLO11 algorithm; The target detection algorithm is based on which a region of interest extraction model, a penetrometer line model and a welding defect model are constructed, including: Acquire image samples of the welding part, and preprocess the image samples to obtain a target data set; The target data set is input into the YOLO11 algorithm to obtain a region of interest extraction model, a penetrometer line model, and a welding defect model.

3. The method according to claim 2, wherein The step of obtaining image samples of the welding part and preprocessing the image samples to obtain a target data set includes: Using X-ray photography equipment to photograph each welding position to obtain a plurality of weld bead images, and selecting samples from the plurality of weld bead images to obtain image samples; dividing the image sample into a first image sample and a second image sample; Labeling the regions of interest in the first image sample using Labelme software to obtain a region of interest data set, wherein the regions of interest include a weld bead region, a penetrometer region, and a positioning mark region; Using Labelme software to label the penetrometer lines in the second image sample to obtain a penetrometer line dataset, where the penetrometer lines are visible lines in the second image sample; For the first image sample and the second image sample with defects, marking the welding defect type to obtain a defect detection data set, wherein the welding defect type includes point defects and strip defects; The images in the defect detection dataset, the region of interest dataset, and the penetrometer line dataset are respectively subjected to size change and uniformization processing, and are randomly divided into a training set and a test set according to a preset ratio.

4. The method according to claim 1, wherein The step of inputting the welding image to be inspected into the region of interest extraction model to obtain the penetrometer region, the weld bead region, and the positioning mark region comprises: Preprocess the welding image to be inspected and add image features to obtain a welding feature image; Converting the welding feature image into a standard feature image, and obtaining a model output region through a region of interest extraction model; The model output area is decoded, and NMS screening is performed to eliminate invalid results to obtain the penetrometer area, weld area and positioning mark area, wherein the weld area includes the weld area range and the weld direction type.

5. The method according to claim 1, wherein After inputting the penetrometer area into the penetrometer line model and obtaining the visible line detection result, the method includes: Based on the confidence order, the overlapping frames with low confidence are eliminated, and the serial number sorting method of each visible transmittance meter line is determined by the serial number difference formula; Based on the sequence number sorting method, correct the incorrect sequence numbers in the visible penetrometer lines to obtain the number of visible lines; The imaging quality of the welding image to be inspected is determined based on the number of visible lines.

6. The method according to claim 1, wherein The obtaining of image calibration information based on the visible line detection result includes: intercepting the image area corresponding to the first n visible transmittance meter lines in descending order of visibility in the visible line detection result; For each of the image regions, adaptive binarization and Hough line detection method are used to obtain a corresponding straight line equation; Based on the straight line equation, calculating the pixel line distance between two adjacent visible penetrance meter lines; The pixel line distance is proportionally converted to the actual penetrometer line distance to obtain image calibration information.

7. The method according to claim 1, wherein Inputting the weld bead area into the welding defect model to obtain defect detection results includes: intercepting a weld bead region in the welding image to be detected, and performing uniform processing on the weld bead in the weld bead region; Slicing each weld bead after the unified processing to obtain multiple weld bead slices; Inputting each of the weld bead slices into the welding defect model to obtain regional detection results of the plurality of weld bead slices; All the regional inspection results are combined into one weld bead inspection result, and the overlapping areas in the weld bead inspection results are screened using NMS; For long strip defects that are cut off during the slicing process, the intersection-union ratio is used to determine whether they can be merged; Based on the screening results and the merging results, a defect detection result is generated, where the defect detection result is a prediction result box of the defect.

8. The method according to claim 7, wherein Mapping the defect detection result to a physical welding area based on the image calibration information and the positioning mark area includes: Processing the positioning mark area to obtain a positioning coordinate origin; Based on the coordinate information of the positioning coordinate origin and the prediction result frame, combined with the image calibration information, the physical relative position of the welding defect is calculated; Based on the width information and height information of the prediction result frame and combined with the image calibration information, the actual physical size of the welding defect is calculated.

9. The method according to claim 8, wherein The processing of the positioning mark area to obtain the positioning coordinate origin includes: intercepting a positioning mark area in the welding image to be detected, and segmenting a cross-shaped center mark from the positioning mark area; Using a skeleton thinning algorithm to thin the center mark, and using a Hough line detection algorithm to extract two corresponding mutually perpendicular marking lines from the thinned center mark; The intersection of the two marking straight lines is calculated, and the intersection is used as the origin of the positioning coordinates.

10. A welding defect detection system, characterized in that: include: The target detection model construction module is used to build the region of interest extraction model, penetrometer line model and welding defect model based on the target detection algorithm; A region of interest extraction module is used to input the welding image to be inspected into the region of interest extraction model to obtain the positioning mark area, the penetrometer area and the weld bead area; an image calibration information determination module, inputting the penetrometer area into the penetrometer line model to obtain a visible line detection result, and obtaining image calibration information based on the visible line detection result; A welding defect detection module, configured to input the weld area into the welding defect model to obtain a defect detection result; The welding defect positioning module is used to map the defect detection results to the physical welding area based on the image calibration information and the positioning mark area, and to locate and analyze the welding defects.

Citation Information

Cited By

  • Image processing system and method for circumferential weld DR detection data

    CN121544626A

  • An image processing system and method for DR inspection data of circumferential welds

    CN121544626B