Weld seam recognition model, pipeline image processing method, system, device and medium
Patent Information
- Application Number
- CN202310427800.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-20
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-04-20
AI Technical Summary
[0007]本发明要解决的技术问题是为了克服现有技术中标注效率低、成本高且输出结果存在差异的缺陷,提供一种焊缝识别模型的处理方法、管道图像的处理方法、焊缝识别模型的处理系统、管道图像的处理系统、设备及介质
[0047]Based on common knowledge in the field, the above-mentioned preferred conditions can be combined arbitrarily to obtain various preferred embodiments of the present invention.
Smart Images

Figure CN116823720B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image model training technology, and in particular to a method for processing weld recognition models, a method for processing pipeline images, a system for processing weld recognition models, a system, equipment, and medium for processing pipeline images. Background Technology
[0002] In the field of industrial vision technology development and application, high-quality and accurate data annotation is the foundation for industrial vision models to achieve excellent performance. However, existing open-source annotation tools are mainly geared towards natural environment scenarios, such as security monitoring and autonomous driving. They lack the ability to provide customized annotation for industrial applications, and large-scale data annotation work needs to be outsourced to third-party professional annotation teams in the cloud, which poses a significant risk to data security management.
[0003] X-ray images of weld seams are a typical type of industrial image. Industrial images are diverse (infrared, X-ray, etc.) and have high requirements for annotation quality. Conventional software cannot meet the special preprocessing requirements of industrial images (such as contrast enhancement, grayscale equalization, and noise reduction).
[0004] During the welding process, uncertainties such as improper adjustment of welding parameters (welding power, shielding gas flow rate, welding speed) and complex welding environments can lead to internal defects in the weld, including depressions, undercut, porosity, lack of fusion, and insufficient weld width and height. To ensure the quality of welded products, efficient and accurate defect detection of the weld area is necessary.
[0005] X-ray imaging is a common non-destructive testing method for welds. The images show that weld defects are extremely small and sparsely distributed. Therefore, when annotating and training weld X-ray images, it is necessary to annotate not only the location of weld defects but also the weld region. Due to the sparse distribution of defects, a large number of images need to be annotated to meet the training requirements, making the annotation task very difficult and slow.
[0006] The current annotation method involves using ordinary annotation tools. First, certified professional inspectors annotate the specific weld defects, and then ordinary annotators supplement the annotation of the weld area. The annotation process is complicated, consumes a lot of time and manpower, and the standards for manual annotation are difficult to unify, resulting in differences in the output results and interfering with the subsequent defect identification process. Summary of the Invention
[0007] The technical problem to be solved by the present invention is to overcome the defects of low annotation efficiency, high cost and inconsistent output results in the prior art, and to provide a method for processing weld recognition models, a method for processing pipeline images, a system for processing weld recognition models, a system for processing pipeline images, equipment and medium.
[0008] The present invention solves the above-mentioned technical problems through the following technical solution:
[0009] The first aspect provides a method for processing a weld identification model, the method comprising:
[0010] Obtain a training sample set, which includes a first training sample and a second training sample;
[0011] Wherein, the first training sample is pipe image data with the weld seam area marked, and the second training sample is pipe image data with the weld seam area not marked;
[0012] Using the first training sample as input, a pre-set target detection network model is used for fully supervised training to obtain an initial weld recognition model.
[0013] The initial weld identification model was copied and used as both the teacher and student models.
[0014] The second training sample is used as input, and the corresponding first pipe image data with weld seam area marked is used as output. Semi-supervised training is performed based on the teacher model and the student model to obtain the updated initial weld seam recognition model.
[0015] If the weld recognition accuracy of the initial weld recognition model exceeds the target threshold, the initial weld recognition model with corresponding weight parameters is saved as the target weld recognition model, and the forward inference script corresponding to the target weld recognition model is encapsulated.
[0016] Preferably, the preset target detection network model adopts the YOLO network model.
[0017] Preferably, the step of performing semi-supervised training based on the teacher model and the student model to obtain the updated initial weld recognition model includes:
[0018] The first training sample is input into the student model, and the output is the second pipe image data with the weld seam area marked.
[0019] The first loss is calculated based on the first training sample and the second pipeline image data;
[0020] The second training sample, which has undergone weak enhancement processing, is input into the teacher model, and the output is the third pipeline image data with pseudo-labels.
[0021] The enhanced third pipeline image data is input into the student model for forward inference to obtain the first pipeline image data.
[0022] The second loss is calculated based on the first pipeline image data and the third pipeline image data;
[0023] The total loss is calculated based on the first loss and the second loss, and the student model is back-reasoned based on the total loss to update the weight parameters of the student model.
[0024] The updated weight parameters are then synchronized with the teacher model using the EMA algorithm to complete one iteration.
[0025] The semi-supervised training steps are repeated on the updated student model and the teacher model until the weld recognition accuracy of the initial weld recognition model exceeds the target threshold.
[0026] Preferably, the weak enhancement process includes vertically and / or horizontally flipping the second training sample;
[0027] The enhanced processing includes performing at least one of the following transformations on the third pipeline image data: random image attribute changes, grayscale changes, and Gaussian blur changes.
[0028] Preferably, the pipe image data includes scanned image data of a pipe with an circumferential weld.
[0029] A second aspect provides a method for processing pipe images, the method comprising:
[0030] Acquire the image data of the pipeline to be identified;
[0031] The pipeline image data to be identified is input into the target weld recognition model, and the target weld recognition model is parsed based on the corresponding forward inference script to obtain the target image data with the weld area marked on the pipeline image data to be identified.
[0032] The target weld identification model and the forward inference script are obtained based on the aforementioned weld identification model processing method.
[0033] Identify welding defects within the weld area.
[0034] The third aspect provides a processing system for a weld seam recognition model, the processing system comprising: a sample acquisition module, a fully supervised training module, a replication module, a semi-supervised training module, and a processing module;
[0035] The sample acquisition module is used to acquire a training sample set, which includes a first training sample and a second training sample; wherein, the first training sample is pipe image data with weld seam areas marked, and the second training sample is pipe image data with unmarked weld seam areas.
[0036] The fully supervised training module is used to take the first training sample as input and perform fully supervised training using a preset target detection network model to obtain an initial weld recognition model.
[0037] The copying module is used to copy the initial weld seam recognition model as both the teacher model and the student model.
[0038] The semi-supervised training module is used to take the second training sample as input and the corresponding first pipe image data with weld seam area marked as output, and perform semi-supervised training based on the teacher model and the student model to obtain the updated initial weld seam recognition model.
[0039] The processing module is configured to, in response to the initial weld recognition model having a weld recognition accuracy exceeding a target threshold, save the initial weld recognition model with corresponding weight parameters as the target weld recognition model, and encapsulate the forward inference script corresponding to the target weld recognition model.
[0040] The fourth aspect provides a pipeline image processing system, which includes: an image acquisition module, a weld recognition module, and a defect recognition module;
[0041] The acquisition module is used to acquire the image data of the pipeline to be identified;
[0042] The weld recognition module is used to input the pipeline image data to be recognized into the target weld recognition model, parse the target weld recognition model based on the corresponding forward inference script, and obtain the target image data with the weld area marked on the pipeline image data to be recognized.
[0043] The target weld identification model and the forward inference script are obtained based on the aforementioned weld identification model processing system.
[0044] The defect identification module is used to identify welding defects within the weld area.
[0045] A fifth aspect provides an electronic device, including a memory, a processor, and a computer program stored in the memory and for running on the processor, wherein the processor executes the computer program to implement the aforementioned processing method for a weld seam recognition model; or, to implement the aforementioned processing method for a pipe image.
[0046] A sixth aspect provides a computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the aforementioned processing method for weld seam recognition models; or, implements the aforementioned processing method for pipe images.
[0047] Based on common knowledge in the field, the above-mentioned preferred conditions can be combined arbitrarily to obtain various preferred embodiments of the present invention.
[0048] The significant advantages of this invention are as follows: By inputting pipeline image data including weld areas, and training a model network using a semi-supervised training algorithm based on the YOLOv5 target detection algorithm and an average teacher model, a weld recognition model capable of being applied to weld area annotation in various types of pipeline images is obtained. This enables automated, standardized, and rapid processing of weld areas in pipeline image data, replacing the original manual annotation process, saving considerable time and labor costs. Furthermore, it provides highly accurate and standardized pipeline image data with uniformly annotated weld areas for subsequent welding defect identification in pipeline images, improving the overall efficiency of pipeline image data processing. By encapsulating the forward inference script of the weld recognition model as a microservice, the weld recognition model can be combined with annotation software for image and detection result interaction, improving user efficiency. Attached Figure Description
[0049] Figure 1 This is a first flowchart of the processing method for the weld identification model in Embodiment 1 of the present invention;
[0050] Figure 2 This is a flowchart of step S104 in the weld identification model processing method of Embodiment 1 of the present invention;
[0051] Figure 3 This is an example diagram of the semi-supervised training process in the weld seam recognition model processing method of Embodiment 1 of the present invention;
[0052] Figure 4 This is a flowchart of the pipeline image processing method according to Embodiment 2 of the present invention;
[0053] Figure 5 This is a schematic diagram of the processing system for the weld seam recognition model in Embodiment 3 of the present invention;
[0054] Figure 6 This is a schematic diagram of the pipeline image processing system according to Embodiment 4 of the present invention;
[0055] Figure 7 This is a schematic diagram of the hardware structure of the electronic device according to Embodiment 5 of the present invention. Detailed Implementation
[0056] The present invention will be further illustrated by way of embodiments below, but the present invention is not limited to the scope of the embodiments described herein.
[0057] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," and "counterclockwise," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0058] Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0059] Example 1
[0060] This embodiment provides a method for processing a weld seam identification model, such as... Figure 1 As shown, the processing method includes:
[0061] S101. Obtain a training sample set, wherein the training sample set includes a first training sample and a second training sample;
[0062] Wherein, the first training sample is pipe image data with the weld seam area marked, and the second training sample is pipe image data with the weld seam area not marked;
[0063] S102. Using the first training sample as input, a preset target detection network model is used for fully supervised training to obtain an initial weld recognition model.
[0064] S103. Copy the initial weld recognition model as the teacher model and the student model respectively;
[0065] S104. Using the second training sample as input and the corresponding first pipe image data with weld seam area marked as output, perform semi-supervised training based on the teacher model and the student model to obtain the updated initial weld seam recognition model.
[0066] S105. In response to the weld recognition accuracy of the initial weld recognition model exceeding the target threshold, the initial weld recognition model with corresponding weight parameters is saved as the target weld recognition model, and the forward inference script corresponding to the target weld recognition model is encapsulated.
[0067] In one possible approach, the pipe image data includes scanned image data of a pipe with an circumferential weld.
[0068] As an feasible approach, taking the X-ray image of a small-diameter circumferential weld as an example, where the diameter of the small-diameter pipe ranges from 30 to 100 mm, the X-ray images include DR (Direct Digit Radiography) images and RT (Radiographic Testing) images. The film of the X-ray images is converted into corresponding digital pipe image data, and a pipe image dataset is constructed as the training set for the weld recognition model, which includes pipe image data with weld areas.
[0069] As one feasible approach, a subset of images in the training set can be annotated using a labeling tool, including at least the weld seam region. Depending on the specific requirements, both the weld seam region and the corresponding welding defects can be labeled simultaneously. In one embodiment, a bounding box is used to outline the complete weld seam region within the pipe image, with the edge of the annotation box closely aligned with the target weld seam region. Furthermore, labels can be added to the pipe images corresponding to the annotated weld seam regions. These labels may include, but are not limited to, weld type, weld region, and pipe type.
[0070] As one possible approach, the preset target detection network model adopts the YOLO network model.
[0071] Among them, the preferred target detection algorithm is YOLOv5, which is used as the preset target detection network model. YOLOv5 includes, but is not limited to, other variants such as YOLOv5n, YOLOv5m, YOLOv5l, YOLOv5x, YOLOv5n6, YOLOv5s6, YOLOv5m6, YOLOv5l6, and YOLOv5x6.
[0072] By using the lightweight YOLOv5 series network, the network depth and width can be improved, and the size of the detection box can be flexibly adjusted according to the target weld object. It is suitable for scenarios where the location and size of the weld target in pipeline images change frequently and the model needs to be retrained continuously.
[0073] As a feasible approach, such as Figure 2 As shown, step S104, which involves semi-supervised training based on the teacher model and the student model to obtain the updated initial weld recognition model, includes:
[0074] S1041. Input the first training sample into the student model and output the second pipe image data with the weld seam area marked.
[0075] S1042. Calculate the first loss based on the first training sample and the second pipeline image data;
[0076] S1043. Input the second training sample, which has undergone weak enhancement processing, into the teacher model, and output the third pipeline image data with pseudo-labels.
[0077] S1044. Input the enhanced third pipeline image data into the student model to perform forward inference to obtain the first pipeline image data.
[0078] S1045. Calculate the second loss based on the first pipeline image data and the third pipeline image data;
[0079] S1046. Calculate the total loss based on the first loss and the second loss, and perform reverse reasoning on the student model based on the total loss to update the weight parameters of the student model;
[0080] S1047. Synchronize the updated weight parameters with the teacher model based on the EMA algorithm to complete one iteration;
[0081] S1048. Repeat the semi-supervised training step for the updated student model and the teacher model until the weld recognition accuracy of the initial weld recognition model exceeds the target threshold.
[0082] As an feasible approach, based on the deep learning object detection algorithm YOLOv5, a semi-supervised object detection network is formed by combining the detection network with a semi-supervised learning method using an average teacher model.
[0083] First, the student model is trained under full supervision, and YOLOv5 is selected as the detector. The first supervised training sample is augmented by mosaic (a data augmentation method) and input into the student network. The inference result of the weld area corresponding to the first training sample is compared with the labeled weld area of the first training sample to calculate the first loss Loss_L. The supervised loss is used to perform back-inference on the student network to complete one iteration.
[0084] Secondly, a pseudo-label is generated on the unlabeled second training samples using the teacher model. The second training samples with labels are then used as third pipeline data images to achieve supervised training of the student model. The initially generated teacher model uses the same object detection network as the student model, and the parameters of the teacher model are subsequently updated using the EMA (Exponential Moving Average) method during the semi-supervised process.
[0085] As an feasible approach, in a semi-supervised training process, the teacher model generates pseudo-labels on the weakly enhanced second training samples as third pipeline image data. The pipeline image data is then strongly enhanced and input into the student model for the corresponding iteration round for forward inference to obtain the first pipeline image data. A second loss, Loss_pseudo, is calculated based on the weld region labels on the first pipeline image data and the pseudo-labels on the third pipeline data. The first loss, Loss_L, and the second loss, Loss_pseudo, are then weighted and summed to obtain the total loss, total_loss. In one embodiment, the regression loss calculation for both the student model and the teacher model uses CIoU loss (Computer Input Output Units loss) to improve the accuracy of the bounding boxes and accelerate model convergence. The total loss is used for backpropagation of the student network. Then, the updated student model parameters are synchronized to the teacher model using the EMA method to complete one iteration, until the weld recognition accuracy in the first pipeline image data output by the student model exceeds the target threshold.
[0086] As one feasible approach, the target detection accuracy threshold for the student model is 90%. When the weld seam recognition accuracy output by the student model fails to meet the target threshold, the number of the first training samples can be gradually increased to improve the efficiency of the semi-supervised training process until the target detection accuracy of the student model meets the target threshold. The weight parameters corresponding to the student model that meets the target threshold are saved to obtain the corresponding target weld seam recognition model. The forward inference script corresponding to the target weld seam recognition is then encapsulated. In one embodiment, the forward inference script corresponding to the target weld seam recognition is encapsulated as a microservice, and the target weld seam recognition model is used as a functional module of the corresponding annotation software. The microservice calls the target weld seam recognition model in the annotation software to achieve image and detection result interaction with the annotation software. The software identifies the weld seam region in the image and outputs the annotation box, attributes, status information, and confidence score of the weld seam region, providing intuitive annotation references for annotation users and reliable processing data for subsequent image processing.
[0087] As one possible approach, the weak enhancement process includes vertically and / or horizontally flipping the second training sample;
[0088] The enhanced processing includes performing at least one of the following transformations on the third pipeline image data: random image attribute changes, grayscale changes, and Gaussian blur changes.
[0089] By performing minor and major augmentation on the image data during training, the generality and robustness of the output model can be improved.
[0090] The working principle of the weld identification model processing method in this embodiment is illustrated below with a specific example:
[0091] A training set for weld recognition and detection was constructed using X-ray image data of small-diameter circumferential welds.
[0092] Random sampling is performed in the training set; preferably, 32% of the pipeline image data in the training set is selected as the samples to be labeled. If the number of samples to be labeled corresponding to 32% of the training set is less than 200, then at least 200 pipeline image data are selected as the samples to be labeled.
[0093] The samples to be labeled are bounded together to label the weld areas in the pipe images as supervised data, i.e., the first training sample set. The remaining unlabeled pipe image data in the training set are used as unsupervised data, i.e., the second training sample set.
[0094] like Figure 3 As shown, based on steps S102 to S105, a semi-supervised training algorithm based on the deep learning target detection algorithm YOLOv5 and combined with the average teacher model is constructed to form a training network for the target weld recognition model.
[0095] The input image for the detection model is a standardized Img image (a type of image format) with a uniform size. The input image is set to a fixed pixel resolution of 640×640. Using this resolution as a standard, the target rectangle bounding box positions in the sample information described in step S2 are linearly mapped to this input scale. The data is then standardized, with a mean of [105.844, 94.952, 92.057] and a standard deviation of [66.053, 71.831, 67.929], corresponding to the three RGB channels. The training set contains 115 labeled images and 657 unlabeled images, while the test set contains 193 labeled images.
[0096] The detector selected is YOLOv5s, the input image size is 640×640, and the corresponding parameters use default values. Supervised data is input into the student model after Mosaic enhancement, and the output is the prediction result pred of the pipe image data with the weld seam area marked. The first loss Loss_L is calculated by comparing the weld seam marked area Target in the supervised data with the prediction result pred.
[0097] Unsupervised data is augmented using Weak to obtain Weak_Img, which is then input into the teacher model. The teacher model outputs a pseudo-label pseudo_Target with a confidence threshold of 0.85 and an IOU (Intersection over Union) threshold of 0.6 for NMS (Non-Maximum Suppression) to ensure the reliability of the targets detected by the pseudo-label. Therefore, relatively strict NMS parameters are chosen. Unsupervised data with pseudo-labels is augmented using Strong to obtain img_str, which is then input into the student model to obtain a prediction result Pred_pseudo based on the pseudo-label. The prediction result Pred_pseudo and the pseudo-label pseudo_Target are used to calculate the second loss Loss_pseudo. The total loss Total_Loss is calculated based on the first loss Loss_L and the second loss Loss_pseudo.
[0098] When calculating the total loss for one semi-supervised iteration, the weight of the consistency loss between the teacher and student models on unlabeled training data is 0.5, and the weight of the supervised loss of the student model on labeled training data is 1. The EMA transfer rate of the student model when transferring parameters to the teacher network is 0.99, and a total of 200 epochs are trained (an epoch is defined as when a complete dataset passes through the neural network once and returns once). The number of iterations for fully supervised training is 50 epochs.
[0099] The detection results show that if a weld seam area exists in the image, the bounding box region of the target is output, along with its attributes, state description, and confidence level. During the test, the IOU threshold is set to 0.5; that is, if the CIoU loss between the predicted detection box and the labeled true target box is greater than 0.5, it is considered a correct detection; otherwise, it is considered an incorrect detection. The confidence threshold is set to 0.001.
[0100] The obtained target weld identification model has an average accuracy (AP) of approximately 0.995 for DR image detection of small-diameter pipe circumferential welds and an average accuracy (AP) of approximately 0.973 for RT image detection of small-diameter pipe circumferential welds.
[0101] The final target weld identification model that meets the target threshold will be obtained, and the forward inference script corresponding to the target weld identification model will be encapsulated as a microservice.
[0102] The weld recognition model processing method provided in this embodiment inputs pipeline image data including weld areas and trains a model network based on the YOLOv5 target detection algorithm combined with a semi-supervised training algorithm using an average teacher model. This results in a weld recognition model applicable to various types of pipeline images, enabling automated and standardized rapid processing of weld areas in pipeline image data. This replaces the original manual annotation process, saving significant time and labor costs. Furthermore, it provides highly accurate and standardized pipeline image data with uniformly annotated weld areas for subsequent welding defect identification in pipeline images, improving the overall efficiency of pipeline image data processing. By encapsulating the forward inference script of the weld recognition model as a microservice, the weld recognition model can be combined with annotation software for image and detection result interaction, improving user efficiency.
[0103] Example 2
[0104] This embodiment provides a method for processing pipeline images, such as... Figure 4 As shown, the method for processing the pipeline image includes:
[0105] S201. Obtain the image data of the pipeline to be identified;
[0106] S202. Input the pipeline image data to be identified into the target weld recognition model, and parse the target weld recognition model based on the corresponding forward inference script to obtain the target image data with the weld area marked on the pipeline image data to be identified.
[0107] The target weld identification model is obtained based on the weld identification model processing method in Example 1;
[0108] S203. Identify welding defects within the weld area.
[0109] As one feasible approach, by inputting the pipeline image data to be identified into the target weld recognition model in Example 1, where the pipeline image data includes, but is not limited to, weld areas such as circumferential welds, the pipeline image data is preprocessed to mark the weld areas. In one embodiment, the pipeline image data to be identified can be cropped based on the weld areas. Alternatively, based on labels such as weld type, weld area, and pipeline type, masks of weld marking areas corresponding to pipeline image data with the same or similar labels can be obtained for batch cropping. Then, corresponding welding defects are identified within the cropped weld areas, improving the accuracy of welding defect identification in the pipeline image data.
[0110] The pipeline image processing method provided in this embodiment utilizes the weld recognition model in Embodiment 1 to automate and standardize the rapid processing of weld areas in pipeline image data, replacing the original manual annotation process. This saves significant time and labor costs and provides highly accurate and standardized pipeline image data with uniformly annotated weld areas for subsequent identification of welding defects in pipeline images, thereby improving the overall efficiency of pipeline image data processing. By encapsulating the forward inference script of the weld recognition model as a microservice, the weld recognition model can be combined with annotation software to enable interaction between images and detection results, improving user efficiency.
[0111] Example 3
[0112] This embodiment provides a processing system 100 for weld seam recognition models, such as... Figure 5 As shown, the processing system includes: a sample acquisition module 101, a fully supervised training module 102, a replication module 103, a semi-supervised training module 104, and a processing module 105;
[0113] The sample acquisition module 101 is used to acquire a training sample set, which includes a first training sample and a second training sample; wherein, the first training sample is pipe image data with weld seam areas marked, and the second training sample is pipe image data with weld seam areas not marked.
[0114] The fully supervised training module 102 is used to take the first training sample as input and perform fully supervised training using a preset target detection network model to obtain an initial weld recognition model.
[0115] The copying module 103 is used to copy the initial weld recognition model as a teacher model and a student model, respectively.
[0116] The semi-supervised training module 104 is used to take the second training sample as input and the corresponding first pipe image data with weld seam area marked as output, and perform semi-supervised training based on the teacher model and the student model to obtain the updated initial weld seam recognition model.
[0117] The processing module 105 is configured to, in response to the initial weld recognition model having a weld recognition accuracy exceeding a target threshold, save the initial weld recognition model with corresponding weight parameters as a target weld recognition model, and encapsulate the forward inference script corresponding to the target weld recognition model.
[0118] As one possible approach, the preset target detection network model adopts the YOLO network model.
[0119] As one possible implementation, the semi-supervised training module 104 includes a first training unit, a second training unit, a loss calculation unit, and an iterative training unit;
[0120] The first training unit is used to input the first training sample into the student model and output the second pipe image data with the weld area marked.
[0121] The second training unit is used to input the second training samples, which have undergone weak enhancement processing, into the teacher model and output the third pipeline image data with pseudo-labels; it is also used to input the third pipeline image data, which has undergone strong enhancement processing, into the student model for forward inference to obtain the first pipeline image data.
[0122] The loss calculation unit is used to calculate a first loss based on the first training sample and the second pipeline image data; calculate a second loss based on the first pipeline image data and the third pipeline image data; calculate a total loss based on the first loss and the second loss; and perform reverse reasoning on the student model based on the total loss to update the weight parameters of the student model.
[0123] The iterative training unit is used to synchronize the updated weight parameters to the teacher model based on the EMA algorithm to complete one iteration;
[0124] The semi-supervised training steps are repeated on the updated student model and the teacher model until the weld recognition accuracy of the initial weld recognition model exceeds the target threshold.
[0125] As one possible approach, the weak enhancement process includes vertically and / or horizontally flipping the second training sample;
[0126] The enhanced processing includes performing at least one of the following transformations on the third pipeline image data: random image attribute changes, grayscale changes, and Gaussian blur changes.
[0127] In one possible approach, the pipe image data includes scanned image data of a pipe with an circumferential weld.
[0128] It should be noted that the implementation principle of the weld recognition model processing system in this embodiment is the same as that of the weld recognition model processing method in Embodiment 1, so it will not be repeated here.
[0129] The weld seam recognition model processing system provided in this embodiment inputs pipeline image data including weld seam areas. It trains a model network using a semi-supervised training algorithm based on the YOLOv5 target detection algorithm combined with an average teacher model. This results in a weld seam recognition model applicable to various types of pipeline images, enabling automated and standardized rapid processing of weld seam areas in pipeline image data. This replaces the original manual annotation process, saving significant time and labor costs. Furthermore, it provides highly accurate and standardized pipeline image data with uniformly annotated weld seam areas for subsequent identification of welding defects in pipeline images, improving the overall efficiency of pipeline image data processing. By encapsulating the forward inference script of the weld seam recognition model as a microservice, it allows for interaction between the weld seam recognition model and annotation software, enabling image and detection result interaction and improving user efficiency.
[0130] Example 4
[0131] This embodiment provides a pipeline image processing system 200, such as... Figure 6 As shown, the pipeline image processing system includes: an image acquisition module 201, a weld recognition module 202, and a defect recognition module 203;
[0132] The image acquisition module 201 is used to acquire the image data of the pipeline to be identified;
[0133] The weld recognition module 202 is used to input the pipeline image data to be recognized into the target weld recognition model, parse the target weld recognition model based on the corresponding forward inference script, and obtain the target image data with the weld area marked on the pipeline image data to be recognized.
[0134] The target weld identification model and the forward inference script are obtained based on the weld identification model processing system described in Embodiment 3.
[0135] The defect identification module 203 is used to identify welding defects in the weld area.
[0136] It should be noted that the implementation principle of the pipeline image processing system in this embodiment is the same as that of the pipeline image processing method in Embodiment 2, so it will not be described again here.
[0137] The pipeline image processing system provided in this embodiment utilizes the weld recognition model from Embodiment 1 to automate and standardize the rapid processing of weld areas in pipeline image data. This replaces the original manual annotation process, saving significant time and labor costs. Furthermore, it provides highly accurate and standardized pipeline image data with uniformly annotated weld areas for subsequent weld defect identification in pipeline images, improving the overall efficiency of pipeline image data processing. By encapsulating the forward inference script of the weld recognition model as a microservice, the weld recognition model can be combined with annotation software to enable interaction between images and detection results, improving user efficiency.
[0138] Example 5
[0139] like Figure 7 The diagram shown is a structural schematic of an electronic device provided in Embodiment 5 of the present invention. It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the processing method for the weld seam recognition model of Embodiment 1; or, the processing method for the pipeline image of Embodiment 2. Figure 7 The electronic device 30 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0140] The electronic device 30 may be in the form of a general-purpose computing device, such as a server device. The components of the electronic device 30 may include, but are not limited to: at least one processor 31, at least one memory 32, and a bus 33 connecting different system components (including memory 32 and processor 31).
[0141] Bus 33 includes a data bus, an address bus, and a control bus.
[0142] The memory 32 may include volatile memory, such as random access memory (RAM) 321 and / or cache memory 322, and may further include read-only memory (ROM) 323.
[0143] The memory 32 may also include a program / utility 325 having a set (at least one) of program modules 324, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0144] The processor 31 executes various functional applications and data processing by running computer programs stored in the memory 32, such as the weld seam recognition model processing method of Embodiment 1 of the present invention; or the pipeline image processing method of Embodiment 2.
[0145] Electronic device 30 can also communicate with one or more external devices 34 (e.g., keyboard, pointing device, etc.). This communication can be performed via input / output (I / O) interface 35. Furthermore, the model-generated device 30 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public network, such as the Internet) via network adapter 36. As shown, network adapter 36 communicates with other modules of the model-generated device 30 via bus 33. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the model-generated device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems.
[0146] It should be noted that although several units / modules or sub-units / modules of the electronic device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.
[0147] Example 6
[0148] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the processing method for the weld identification model of Embodiment 1; or the processing method for the pipeline image of Embodiment 2.
[0149] The readable storage medium may be more specifically adopted, including but not limited to: portable disk, hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical storage device, magnetic storage device, or any suitable combination thereof.
[0150] In possible implementations, the present invention can also be implemented as a program product comprising program code, which, when the program product is run on a terminal device, causes the terminal device to execute the processing method for implementing the weld identification model of Embodiment 1; or the pipeline image processing method of Embodiment 2.
[0151] The program code for executing the present invention can be written in any combination of one or more programming languages. The program code can be executed entirely on the user device, partially on the user device, as a standalone software package, partially on the user device and partially on a remote device, or entirely on a remote device.
[0152] While specific embodiments of the present invention have been described above, those skilled in the art should understand that these are merely illustrative examples, and the scope of protection of the present invention is defined by the appended claims. Those skilled in the art can make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but all such changes and modifications fall within the scope of protection of the present invention.
Claims
1. A method for processing a weld seam identification model, characterized in that, The processing method includes: Obtain a training sample set, which includes a first training sample and a second training sample; Wherein, the first training sample is pipe image data with the weld seam area marked, and the second training sample is pipe image data with the weld seam area not marked; The pipeline image data includes DR or RT images of small-diameter circumferential welds, where the small diameter is 30-100mm. Using the first training sample as input, a pre-set target detection network model is used for fully supervised training to obtain an initial weld recognition model. The initial weld identification model was copied and used as both the teacher and student models. Using the second training sample as input and the corresponding first pipe image data labeled with weld seam areas as output, semi-supervised training is performed based on the teacher model and the student model to obtain the updated initial weld seam recognition model, including: The first training sample is input into the student model, and the output is the second pipe image data with the weld seam area marked. The first loss is calculated based on the first training sample and the second pipeline image data; The second training sample, which has undergone weak enhancement processing, is input into the teacher model, and the output is the third pipeline image data with pseudo-labels. The enhanced third pipeline image data is input into the student model for forward inference to obtain the first pipeline image data. The second loss is calculated based on the first pipeline image data and the third pipeline image data; The total loss is calculated based on the first loss and the second loss, and the student model is back-reasoned based on the total loss to update the weight parameters of the student model. The updated weight parameters are then synchronized with the teacher model using the EMA algorithm to complete one iteration. Repeat the semi-supervised training steps on the updated student model and the teacher model; If the weld recognition accuracy of the initial weld recognition model exceeds the target threshold, the initial weld recognition model with corresponding weight parameters is saved as the target weld recognition model, and the forward inference script corresponding to the target weld recognition model is encapsulated. Specifically, if the CIoU loss between the predicted detection box and the labeled real target box of the initial weld recognition model is greater than 0.5, it is considered a correct detection; otherwise, it is considered an incorrect detection, and the confidence threshold of the corresponding prediction result is forcibly set to 0.
001. The encapsulation of the forward inference script corresponding to the target weld identification model includes: The forward inference script corresponding to the target weld recognition model is encapsulated as a microservice and used as a functional module of the corresponding annotation software. The microservice calls and parses the target weld recognition model to interact with the annotation software on image and detection results. In the annotation software, the weld region in the image is identified, and the annotation box, attributes, status description and confidence of the weld region are output. If the weld recognition accuracy cannot meet the target threshold, the number of the first training samples is increased, and the fully supervised training and semi-supervised training steps are repeated until the weld recognition accuracy of the initial weld recognition model exceeds the target threshold.
2. The processing method for the weld identification model according to claim 1, characterized in that, The preset target detection network model adopts the YOLO network model.
3. The processing method for the weld identification model according to claim 1, characterized in that, The weak enhancement process includes vertically and / or horizontally flipping the second training sample. The enhanced processing includes performing at least one of the following transformations on the third pipeline image data: random image attribute changes, grayscale changes, and Gaussian blur changes.
4. The processing method for the weld identification model according to claim 1, characterized in that, The pipeline image data includes scanned image data of pipelines with circumferential welds.
5. A method for processing pipeline images, characterized in that, The method for processing the pipeline image includes: Acquire the image data of the pipeline to be identified; The pipeline image data to be identified is input into the target weld recognition model, and the target weld recognition model is parsed based on the corresponding forward inference script to obtain the target image data with the weld area marked on the pipeline image data to be identified. The target weld identification model and the forward inference script are obtained based on the processing method of the weld identification model according to any one of claims 1 to 4; Identify welding defects within the weld area.
6. A processing system for a weld seam identification model, characterized in that, The processing system includes: a sample acquisition module, a fully supervised training module, a replication module, a semi-supervised training module, and a processing module; The sample acquisition module is used to acquire a training sample set, which includes a first training sample and a second training sample; wherein, the first training sample is pipe image data with the weld seam area marked, and the second training sample is pipe image data with the weld seam area not marked; the pipe image data includes DR images or RT images of small-diameter circumferential weld seams, wherein the small-diameter pipe is 30-100mm. The fully supervised training module is used to take the first training sample as input and perform fully supervised training using a preset target detection network model to obtain an initial weld recognition model. The copying module is used to copy the initial weld seam recognition model as both the teacher model and the student model. The semi-supervised training module is used to take the second training sample as input and the corresponding first pipe image data with weld seam area marked as output, and perform semi-supervised training based on the teacher model and the student model to obtain the updated initial weld seam recognition model. The semi-supervised training module includes a first training unit, a second training unit, a loss calculation unit, and an iterative training unit; The first training unit is used to input the first training sample into the student model and output the second pipe image data with the weld area marked. The second training unit is used to input the second training samples, which have undergone weak enhancement processing, into the teacher model and output the third pipeline image data with pseudo-labels; it is also used to input the third pipeline image data, which has undergone strong enhancement processing, into the student model for forward inference to obtain the first pipeline image data. The loss calculation unit is used to calculate a first loss based on the first training sample and the second pipeline image data; calculate a second loss based on the first pipeline image data and the third pipeline image data; calculate a total loss based on the first loss and the second loss; and perform reverse reasoning on the student model based on the total loss to update the weight parameters of the student model. The iterative training unit is used to synchronize the updated weight parameters to the teacher model based on the EMA algorithm to complete one iteration; Repeat the semi-supervised training steps on the updated student model and the teacher model; The processing module is configured to, in response to the initial weld recognition model having a weld recognition accuracy exceeding a target threshold, save the initial weld recognition model with corresponding weight parameters as a target weld recognition model, and encapsulate the forward inference script corresponding to the target weld recognition model. Specifically, if the CIoU loss between the predicted detection box and the labeled real target box of the initial weld recognition model is greater than 0.5, it is considered a correct detection; otherwise, it is considered an incorrect detection, and the confidence threshold of the corresponding prediction result is forcibly set to 0.
001. The encapsulation of the forward inference script corresponding to the target weld identification model includes: The forward inference script corresponding to the target weld recognition model is encapsulated as a microservice and used as a functional module of the corresponding annotation software. The microservice calls and parses the target weld recognition model to interact with the annotation software on image and detection results. In the annotation software, the weld region in the image is identified, and the annotation box, attributes, status description and confidence of the weld region are output. The processing module is further configured to, if the weld recognition accuracy cannot meet the target threshold, increase the number of the first training samples and repeat the fully supervised training and semi-supervised training steps until the weld recognition accuracy of the initial weld recognition model exceeds the target threshold.
7. A pipeline image processing system, characterized in that, The pipeline image processing system includes: an image acquisition module, a weld recognition module, and a defect recognition module; The image acquisition module is used to acquire the image data of the pipeline to be identified; The weld recognition module is used to input the pipeline image data to be recognized into the target weld recognition model, parse the target weld recognition model based on the corresponding forward inference script, and obtain the target image data with the weld area marked on the pipeline image data to be recognized. The target weld identification model and the forward inference script are obtained based on the processing system of the weld identification model described in claim 6. The defect identification module is used to identify welding defects within the weld area.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and for running on the processor, characterized in that, When the processor executes a computer program, it implements the processing method for the weld recognition model as described in any one of claims 1-4; or, it implements the processing method for the pipeline image as described in claim 5.
9. A computer storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the processing method for the weld identification model as described in any one of claims 1-4; or, it implements the processing method for the pipeline image as described in claim 5.
Citation Information
Patent Citations
Seamless steel rail weld defect identification device and method based on deep learning
CN113111875A