Method for judging the degree of crimping defects of tension wire clamps based on X-ray images

Through the improved object detection model faster-rcnn based on X-ray images, the problem of tension clamp crimping defect detection is solved, efficient and accurate defect identification and judgment is achieved, and detection efficiency and accuracy are improved.

CN114549407BActive Publication Date: 2025-03-14GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210025249.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-11
Publication Date
2025-03-14
Estimated Expiration
2042-01-11

AI Technical Summary

Technical Problem

The prior art is difficult to effectively detect the defects of tension clamp crimping, especially in hidden projects, which is affected by the skills and environment of construction personnel, making it difficult to ensure the quality of crimping.

Method used

The X-ray image is used to determine the degree of defects of the tensile clamp crimping based on X-ray images, and the improved object detection model faster-rcnn is used to detect defects and process the X-ray image to determine the degree of defects in multiple regions.

Benefits of technology

It realizes rapid, accurate, batch identification and judgment of tension clamp defects, improves detection efficiency and accuracy, and reduces the dependence of manual inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114549407B_ABST
    Figure CN114549407B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for judging the degree of crimping defects of a tension clamp based on an X-ray image, comprising: obtaining an X-ray image of the tension clamp; framing the defective part of the X-ray image with a detection frame through an improved target detection model faster-rcnn, wherein the improved target detection model faster-rcnn has the following improvements: using an FPN network to obtain feature maps of different scales, using RoI Align to obtain candidate feature maps, using three cascaded R-CNN networks as detection network heads, and using soft-nms to filter out target detection frames of each region; performing image processing and judging the degree of defects on the target detection frames of each region according to partitions. The present invention can effectively and quickly identify and judge the degree of defects of the tension clamp, so as to achieve the effect of being able to replace manual recognition and judgment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image pattern recognition and computer vision, and in particular to a method for judging the degree of crimping defects of a tension wire clamp based on X-ray images. Background Art

[0002] In overhead transmission lines, the connection of conductors is a key project. The quality of crimping of overhead conductors is very important, which ensures the normal operation of the transmission line and makes the transmission line have a certain degree of anti-destruction ability.

[0003] When installing large-section steel-core aluminum stranded wire on overhead transmission lines, crimping type tension clamps are generally used for crimping installation. The function of the tension clamp is to fix the conductor on the insulator string of the non-linear tower. It not only bears the full tension of the conductor, but also undertakes the current-carrying task. Once such metal is installed, it will not be removed. The quality of the tension clamp crimping is directly related to the safe and stable operation of the transmission line. It not only bears the full tension of the conductor, but also undertakes the current-carrying task. The quality of the tension clamp crimping is directly related to the safe and stable operation of the transmission line.

[0004] The tension clamp is a fitting used to fix the conductor to withstand the tension of the conductor and hang the conductor on the tension string or pole tower. The tension clamp is generally used for transfer, connection and terminal connection. The tension clamp is mainly composed of two parts: aluminum casing and steel anchor. The aluminum tube and steel anchor, aluminum tube and conductor are usually crimped and formed by hydraulic method. Thus, the conductor and the tension clamp are combined into a whole. The part where the aluminum tube and steel anchor, aluminum tube and conductor are crimped is called the crimping part. The steel core aluminum stranded wire tension clamp is usually divided into three areas: A, B and C. Among them, area A is the part where the aluminum tube and steel anchor are crimped through the groove; area B is the non-pressed area of ​​the steel core of the aluminum tube and aluminum stranded wire; area C is the crimped part of the aluminum tube and steel core aluminum stranded wire. The main defects in area A are underpressure and pressure leakage between the aluminum tube and the steel anchor; the main defects in area B are the cavity formed between the steel core of the aluminum stranded wire and the steel anchor connecting tube, and water accumulation in the non-pressure area; the main defects in area C are pressure leakage between the aluminum stranded wire and the aluminum tube.

[0005] Since the crimping of tension clamps is a concealed project, affected by factors such as the skill level of construction workers and the high-altitude crimping environment, the crimping quality of tension clamps in transmission lines is often difficult to guarantee, so it is necessary to test the crimping quality of tension clamps.

[0006] Common inspection methods for the crimping quality of overhead transmission line tension clamps include appearance inspection, size inspection, mechanical property spot check inspection, etc. These methods have been widely used in engineering practice. However, it is impossible to detect defects such as burrs on the steel anchor and under-pressure of the aluminum tube in the groove of the steel anchor.

[0007] In recent years, China has begun to apply X-ray nondestructive testing technology to some electrical equipment inspections, and has achieved good inspection results. With the gradual promotion of X-ray nondestructive testing in electrical equipment inspections, this technology has also been initially applied to the crimping quality inspection of overhead power line conductors, steel cores, tension clamps, and aluminum tubes, and has achieved initial results. Compared with traditional methods, the use of X-ray nondestructive testing provides an intuitive and convenient means of inspection.

[0008] With the application of X-ray nondestructive testing technology in the quality inspection of tension clamp crimping, a large number of X-ray images of tension clamps need to be manually identified and judged whether there are defects. This requires a lot of human resources and time resources. In order to comply with the call of the State Grid to design and develop multifunctional intelligent equipment to reduce inspection costs and improve inspection efficiency, a high-precision method for detecting tension clamp crimping defects has high practical application value. Summary of the invention

[0009] The purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art, and proposes a method for judging the degree of defects in crimping of tension clamps based on X-ray images. The method mainly utilizes the improved target detection model faster-rcnn to identify defects in multiple areas in the original image; then the image processing scheme is designed to judge the degree of defects in multiple areas according to the requirements of emergency repair, so as to achieve the purpose of fast, accurate and batch identification and judgment of the degree of defects in tension clamps, thereby making up for the shortcomings of manual inspection and detection.

[0010] To achieve the above object, the technical solution provided by the present invention is: a method for judging the degree of crimping defects of a tension clamp based on X-ray images, comprising:

[0011] Obtaining X-ray images of the tension clamp;

[0012] The X-ray image is framed with a detection frame using the improved target detection model faster-rcnn. The improved target detection model faster-rcnn uses the following improvements: FPN network is used to obtain feature maps of different scales, RoI Align is used to obtain candidate feature maps, three cascaded R-CNN networks are used as the detection network head, and soft-nms is used to screen out target detection frames in each area;

[0013] The target detection frame in each area is partitioned and the degree of defect is judged; the image processing includes histogram statistics, binarization, mask segmentation and Ostu Otsu threshold, and the degree of defect is judged based on the result after image processing.

[0014] Furthermore, the structure of the improved target detection model faster-rcnn includes four main parts: ResNet backbone network, FPN network, region proposal network head rpn_head, and detection network head bbox_head;

[0015] The defective part is framed by the improved target detection model faster-rcnn, which includes the following processes:

[0016] Input the X-ray image into the ResNet backbone network to generate multiple feature maps with different resolutions;

[0017] Input multiple feature maps with different resolutions into the FPN network, perform feature fusion processing, and output multiple feature layers of different scales;

[0018] Input multiple feature layers of different scales into the region proposal network head rpn_head to generate multiple region candidate boxes;

[0019] Input multiple region candidate boxes into the detection network head bbox_head and output the detection box of the crimping defect.

[0020] Furthermore, the ResNet backbone network has a total of 5 stages, the first stage is denoted as C1, and its output is 320×256×64, the second stage is denoted as C2, and its output is 160×128×256, the third stage is denoted as C3, and its output is 80×64×512, the fourth stage is denoted as C4, and its output is 40×32×1024, and the fifth stage is denoted as C5, and its output is 20×16×2048; the X-ray image is input into the ResNet backbone network, and a total of 5 feature maps with different resolutions are obtained, which are denoted as C1-C5 in order.

[0021] Furthermore, the FPN network is used to perform feature fusion of feature maps. The top-down process of its structure is performed by upsampling, and the lateral connection is to fuse the upsampling result with the feature map of the same size generated from the bottom up. After the fusion, each fusion result is then convolved with a 3×3 convolution to eliminate the aliasing effect of upsampling. The FPN network outputs 5 feature layers of different scales.

[0022] Furthermore, the region proposal network head rpn_head generates a candidate box using RoI Align, including:

[0023] In each feature layer of different scales output by the FPN network, anchor frames of sizes 4×4, 8×8, 16×16, 32×32, and 64×64 are defined respectively, represented by anchor. In addition, each feature layer has three aspect ratios: 1:2, 1:1, and 2:1, so the entire feature pyramid has 15 anchors of different sizes.

[0024] The foreground candidate box is defined as the anchor whose IoU with the ground truth is greater than 0.5; the rpn_head structure of the region proposal network head is divided into two branches, one branch uses the softmax method to classify all anchor boxes to distinguish the foreground and background, and the other branch regresses the coordinates of the anchor box to obtain accurate candidate boxes; the candidate boxes are sorted from high to low according to the foreground confidence, and the top 2000 are selected and put together. Then, these candidate boxes are subjected to non-maximum suppression with a threshold of 0.7, leaving only the top 1000 candidate boxes to be input into the subsequent network;

[0025] After obtaining the candidate box, RoI Align is used instead of the original RoI Pooling. Compared with ROI Pooling, ROI Align can ensure the alignment between the candidate box and the extracted features, thereby greatly improving the accuracy; the candidate boxes of different sizes are mapped into a fixed 7×7 feature matrix, and the 7×7 candidate box features obtained by RoI Align are input into the detection network head bbox_head.

[0026] Furthermore, the detection network head bbox_head uses three cascaded R-CNN networks and soft-nms to output the target detection box and the target detection box category, including:

[0027] The IoU thresholds are set to 0.5, 0.6, and 0.7 respectively. The output of one R-CNN network is used to train the next R-CNN network to continuously optimize the detection and segmentation results.

[0028] Each R-CNN network calculates the probability vector of which category each candidate box belongs to through the fully connected layer and softmax, and uses the bounding box regression again to obtain the position offset of each candidate box for regression to obtain a more accurate target detection box;

[0029] Finally, the top 100 detection score areas are subjected to soft-nms to filter out the final target detection box.

[0030] Furthermore, the target detection frame performs image processing and defect degree determination according to the partitions, including:

[0031] The portion where the aluminum tube and the steel anchor are crimped by the groove is recorded as area A, and image processing and defect degree determination are performed on area A;

[0032] The non-pressed area of ​​the steel core of the aluminum tube and the aluminum strand is recorded as area B, and image processing and defect degree judgment are performed on area B;

[0033] The crimped portion of the aluminum tube and the aluminum stranded wire is recorded as area C, and image processing and defect degree determination are performed on area C.

[0034] Furthermore, the image processing of area A and the determination of the degree of defects include:

[0035] Get the groove target detection frame of area A, perform histogram analysis on the target detection frame, select the peak with low grayscale value plus the threshold of 15 as the threshold of binarization, set the grayscale below this threshold to 0, and set the grayscale above this threshold to 255, and perform expansion and corrosion on the image so that the grayscale value of the steel anchor imaging in area A is 0, and finally, obtain a binary image;

[0036] Traverse the obtained binary image from the first column from top to bottom, find the point p1 where the gray value changes from 255 to 0, and then find the point p2 where the gray value changes from 255 to 0. Similarly, traverse the last column from top to bottom to find the same two points as above, record them as p3 and p4, connect p1 and p3, and connect p2 and p4 to obtain two lines;

[0037] The two lines and the left and right edges of the binary image are used to form a quadrilateral. The grayscale values ​​of the areas outside the quadrilateral are set to 0. The binary image is then subjected to morphological processing by corrosion and expansion. At this time, a mask is formed, and only the grayscale value of the groove area is 255. Finally, the mask area of ​​the target detection frame is obtained.

[0038] The grooves in the mask area of ​​the acquired target detection frame are subjected to threshold segmentation using the Otsu method to convert the grooves into a binary image, in which the black color represents the aluminum tube part and the white color represents the undervoltage part. The histogram in the groove is statistically analyzed to determine whether the groove is a defective groove. If the number of pixels with a gray value of 0: the number of pixels with a gray value of 255 is ≥ 1, then there is an undervoltage defect in area A that needs to be processed, otherwise it is an undervoltage defect that does not need to be processed.

[0039] Furthermore, the image processing of area B and the determination of the degree of defects include:

[0040] Group the object detection frames in area B according to the normal category and cavity category of area B;

[0041] The target detection frames in each group are traversed. If there is only one target detection frame in each group, no processing is required. If there is a target detection frame in a group that contains another target detection frame, the area with the smaller target detection frame is selected as the only target detection frame of the group category. Then, for the target detection frames of the normal area and the cavity area of ​​area B, the horizontal lengths of the bounding boxes of the target detection frames are compared. If the horizontal length of the cavity area: the horizontal length of the normal area ≥ 1, it is judged that there is a cavity defect in area B, otherwise area B is normal and there is no defect.

[0042] Furthermore, the image processing of the C area and the determination of the degree of defects include:

[0043] There is discontinuity in the pressure leakage part of area C, so it is necessary to add the horizontal lengths of multiple pressure leakage target detection frames identified in area C and the horizontal lengths of multiple normal target detection frames. If the total horizontal length of the target detection frame in the pressure leakage area: the total horizontal length of the target detection frame in the normal area is ≥ 1, then there may be a pressure leakage defect in area C that needs to be processed, otherwise there is no pressure leakage defect in area C that needs to be processed;

[0044] If the above step determines that there may be a pressure leakage defect that needs to be processed, then determine whether there is a target detection frame at the edge of area C in the image. If there is, it changes from a possible existence to a certain existence of a pressure leakage defect that needs to be processed. If not, it is still a possible existence of a pressure leakage defect that needs to be processed.

[0045] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0046] 1. By improving the target detection model faster-rcnn, the disadvantage of deep neural network being prone to overfitting is effectively solved and the accuracy of the model is improved.

[0047] 2. A single network type can be used to directly output the defect types of multiple areas of the tension clamp, and the degree of defects can be judged to facilitate faster maintenance and repair.

[0048] 3. Compared with traditional image segmentation, the improved target detection model faster-rcnn has higher accuracy and better generalization, and can effectively replace manual recognition and judgment. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 Flow chart of the method of the present invention.

[0050] Figure 2 is a flow chart of the image processing method.

[0051] Figure 3This is the effect diagram of target detection. In the figure, Anormal is the normal target detection box in area A, Bnormal is the normal target detection box in area B, Cnormal is the normal target detection box in area C, and Clouya is the pressure-leaking target detection box in area C. DETAILED DESCRIPTION

[0052] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.

[0053] like Figures 1 to 3 As shown, the method for judging the degree of defects of tension clamp crimping based on X-ray images provided in this embodiment mainly uses the target detection model to identify defects in multiple areas in the original image, and then designs an image processing scheme to judge the degree of defects in multiple areas according to the requirements of emergency repair, so as to achieve the purpose of fast, accurate and batch recognition and judgment of the degree of defects of tension clamps, thereby making up for the shortcomings of manual inspection and detection. The specific situation is as follows:

[0054] 1) Set the inspection route of the drone and perform X-ray nondestructive testing imaging at the location where the tension clamp is located. Organize a certain number of X-ray images obtained into a data set. And perform image preprocessing on the obtained images to obtain their features later. Image preprocessing includes motion blur removal and contrast enhancement algorithms.

[0055] 2) Use annotation software to annotate multiple regions of the image obtained in step 1). The annotation is divided into 9 parts, namely, normal region A, undervoltage region A, leakage region A, normal region B, cavity region B, normal region C, leakage region C, and edge of region C.

[0056] The labeled images are integrated into a target detection dataset, and the dataset is divided into a training set, a validation set, and a test set.

[0057] 3) Use the target detection model to train the training set obtained in step 2), repeatedly adjust the hyperparameters during training until the loss index and mAP index on the validation set reach the ideal state, and then obtain the required target detection model. Use the target detection model to test the test set. If a recognition box with clear contours, complete structure and little overlap can be obtained, the target detection model is retained. Otherwise, repeat step 3).

[0058] 4) Using the target detection model obtained in step 3), target detection is performed on the X-ray camera image of the tension clamp to be detected. Target detection frames of different regions are obtained. Then, different regions are processed using image processing methods, and the degree of defects in multiple regions of the tension clamp is determined according to the defect definition standard.

[0059] In step 1), the X-ray imaging of the drone sometimes has low-contrast images and blur caused by the shaking of the drone when hovering. Therefore, an enhancement algorithm of contrast enhancement and de-motion blur is used to make the image easier for the target detection model to recognize.

[0060] In step 2), the marking of area A is the marking of a single steel anchor groove. According to whether the aluminum tube and the groove are completely crimped, it is divided into three categories: area A normal, area A under-pressure, and area A leaking pressure. The standard boxes between each groove should not overlap as much as possible. The marking standard of area B is the position of the aluminum stranded wire steel core in the steel anchor joint tube. The part of the aluminum stranded wire steel core in the steel anchor joint tube is marked as area B normal, and the part without the aluminum stranded wire steel core in the steel anchor joint tube is marked as area B cavity. The boundary boxes of area B normal and area B cavity do not overlap. The marking standard of area C is the degree of crimping of the aluminum stranded wire and the aluminum tube. The leaking part is marked as area C leaking pressure, and the normal part is marked as area C normal. Since the drone in step 1) cannot include all three areas of the tension clamp in one picture, some pictures only contain part of area C, which affects the judgment of the degree of defect. Therefore, an edge recognition of area C is added. The edge of area C is the position where the end of the aluminum tube is crimped with the steel core aluminum stranded wire. After marking, the data is expanded, including:

[0061] a. Random image rotation: the rotation angle is randomly selected between -20 degrees and +20 degrees;

[0062] b. Random image cropping: Randomly crop four fifths of the entire image;

[0063] c. Random horizontal flip;

[0064] d. Random contrast and color transitions.

[0065] In step 3), the target detection model used is Faster-rcnn, which is a two-stage target detection model with high accuracy and real-time performance. Further improvements have been made to the original framework of Faster-rcnn, including the following steps:

[0066] 3.1) Model structure

[0067] The input image is 1660*1037*1;

[0068] The entire model structure is divided into 4 main parts: ResNet backbone network, FPN network, region proposal network head rpn_head, detection network head bbox_head. The specific meanings of each part are as follows:

[0069] The main function of the ResNet backbone network is to extract the feature map of the image. The selected network is resnet50, which has 5 stages. The output of the first stage C1 is 320×256×64, the output of the second stage C2 is 160×128×256, the output of the third stage C3 is 80×64×512, the output of the fourth stage C4 is 40×32×1024, and the output of the fifth stage C5 is 20×16×2048. The batch normalization layer is used in the network structure, and the pre-trained model on ImageNet is used for initialization.

[0070] The main function of the FPN network (Feature Pyramid Network) is to fuse high- and low-level features. In its structure, the top-down process is performed by upsampling, and the lateral connection is to fuse the upsampling result with the feature map of the same size generated from the bottom up. After the fusion, a 3×3 convolution is used to convolve each fusion result in order to eliminate the aliasing effect of upsampling. The FPN network outputs 5 feature layers of different scales.

[0071] The main function of the regional proposal network head rpn_head is to generate candidate boxes. In each feature layer of different scales output by the FPN network, anchor boxes of sizes 4×4, 8×8, 16×16, 32×32, and 64×64 are defined respectively, represented by anchor. In addition, each scale layer has 3 aspect ratios: 1:2, 1:1, and 2:1, so the entire feature pyramid has 15 specifications of anchors; the foreground class candidate box is defined as an anchor whose IoU with the ground truth is greater than 0.5; the regional proposal network rpn structure is divided into two branches, one branch is to distinguish the foreground and background by binary classification of all anchor boxes through the softmax method, and the other branch is to regress the coordinates of the anchor box to obtain accurate candidate boxes; the candidate boxes are sorted from high to low according to the foreground confidence, the top 2000 are selected and put together, and then these candidate boxes are non-maximum suppressed with a threshold of 0.7, leaving only the top 1000 candidate boxes to be input into the subsequent network;

[0072] After obtaining the candidate boxes, RoI Align is used instead of the original RoI Pooling. Compared with ROI Pooling, ROI Align can ensure the alignment between the candidate boxes and the extracted features, thereby greatly improving the accuracy. Candidate boxes of different sizes are mapped into a fixed 7×7 feature matrix, and the 7×7 candidate box features obtained by RoI Align are input into the detection network head bbox_head;

[0073] The detection network head bbox_head here uses three cascaded R-CNN networks, and the IoU thresholds are set to 0.5, 0.6, and 0.7 respectively. The output of one R-CNN network is used to train the next R-CNN network to continuously optimize the detection and segmentation results; each R-CNN network calculates the probability vector of which category each candidate box belongs to through the fully connected layer and softmax, and uses the bounding box regression again to obtain the position offset of each candidate box for regression to obtain a more accurate target detection box. Finally, the top 100 detection score areas are subjected to soft-nms to filter out the final target detection box;

[0074] 3.2) Setting the loss function

[0075] The loss of the training process is divided into two parts, RPN loss and ROI loss Both losses are divided into classification loss and position regression loss. Classification loss uses cross entropy loss, and position regression loss uses L1Loss loss.

[0076] 3.3) Set training parameters

[0077] Except for the parameters of the ResNet backbone network, which are initialized using the ImageNet pre-trained model, all other layers are initialized using a Gaussian distribution with a mean of 0 and a standard deviation of 0.01. The experimental optimizer is set to SGD, the momentum is 0.9, the learning rate is 0.0025, and the batch size is 32 images.

[0078] 3.4) Save the model

[0079] After training is completed, the structure and weights of the target detection model are saved.

[0080] 4) Use the X-ray image to be detected to input the saved target detection model. Obtain target detection frames for multiple regions. Identify and judge the degree of defects in different regions. The specific steps are described as follows:

[0081] 4.1) Due to the different standards adopted for region B during labeling and the characteristics of soft-nms, sometimes two target detection frames are identified for the same region in the image, one of which contains the other. Considering the subsequent defect degree judgment, the number of target detection frames in the cavity region and the normal region of region B must be 1, so the target detection frames in region B need to be screened by post-processing. The screening steps are as follows:

[0082] a. Group the ROIs of region B according to the normal category of region B and the cavity category of region B.

[0083] b. Traverse the object detection frames in each group. If there is only one object detection frame in each group, no processing is required. If there is a case where an object detection frame in a group contains another object detection frame, the area with the smaller object detection frame is selected as the only object detection frame of the group category.

[0084] c. Obtain the target detection frames of the normal area and the cavity area of ​​area B from b, and compare the horizontal lengths of the boundary boxes of the target detection frames. If the horizontal length of the cavity area: the horizontal length of the normal area ≥ 1, it is determined that there is a cavity defect in area B. Otherwise, area B is normal and has no defects.

[0085] 4.2) Since the judgment standard of area A is the proportion of the part of the aluminum tube pressed into the steel anchor groove, the target detection model cannot accurately judge based on the proportion, and sometimes marks a groove as two target detection frames: underpressure and leaking. Therefore, it is necessary to obtain the groove target detection frame of the steel anchor in area A and perform traditional image processing. The processing steps are described as follows:

[0086] a. Get the groove target detection frame in area A, perform histogram analysis on the target detection frame, select the peak with lower grayscale value (the grayscale value is the grayscale value of the steel anchor on the X-ray image) and add a certain threshold of 15 as the threshold of binarization. The grayscale below this threshold is set to 0, and the grayscale above this threshold is set to 255. Perform expansion and erosion on the image so that the grayscale value of the steel anchor imaging in area A is all 0.

[0087] b. Traverse the binary image obtained in a from the first column from top to bottom, find the point p1 where the gray value changes from 255 to 0, and then find the point p2 where the gray value changes from 255 to 0. Similarly, traverse the last column from top to bottom and find the same two points as above, record them as p3 and p4. Connect p1 and p3, and connect p2 and p4.

[0088] c. The two lines obtained in b and the left and right edges of the binary image form a quadrilateral. The grayscale values ​​of the areas outside the quadrilateral are set to 0. The binary image is then subjected to morphological processing by corrosion and expansion. At this time, a mask is formed, and only the grayscale value of the groove area is 255.

[0089] d. Perform threshold segmentation of the groove in the target detection frame mask area of ​​area A, and convert the groove into a binary image, where black represents the aluminum tube part and white represents the undervoltage part. The histogram in the groove can be counted. If the number of pixels with a gray value of 0: the number of pixels with a gray value of 255 is ≥ 1, then there is an undervoltage defect in area A that needs to be processed, otherwise it is an undervoltage defect that does not need to be processed.

[0090] 4.3) Since the X-ray image may not be able to fully present the C area in the image, it is impossible to determine whether the C area has defects when the C area is not fully presented. The determination of the degree of defects in the C area is described as follows:

[0091] a. There is discontinuity in the leaking part of area C, so it is necessary to sum the horizontal length of the leaking target detection frame identified in area C and the horizontal length of the normal target detection frame. If the total horizontal length of the target detection frame in the leaking area: the total horizontal length of the target detection frame in the normal area is ≥ 1, then area C may have a leaking defect that needs to be processed, otherwise there is no leaking defect in area C that needs to be processed.

[0092] b. If the judgment in a is that there may be a pressure leakage defect that needs to be processed, then determine whether the image has a target detection frame with a C edge. If so, the image can be changed from a possible existence to a definite existence of a pressure leakage defect that needs to be processed. If not, it is still a possible existence of a pressure leakage defect that needs to be processed.

[0093] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. A method for judging the degree of crimping defects of tension clamps based on X-ray images, characterized in that: include: Obtaining X-ray images of the tension clamp; The X-ray image is framed with a detection frame using the improved target detection model faster-rcnn. The improved target detection model faster-rcnn uses the following improvements: FPN network is used to obtain feature maps of different scales, RoI Align is used to obtain candidate feature maps, three cascaded R-CNN networks are used as the detection network head, and soft-nms is used to screen out target detection frames in each area; The target detection frame of each area is processed according to the partition and the degree of defect is judged; the image processing includes histogram statistics, binarization, mask segmentation and Ostu Otsu threshold, and the degree of defect is judged based on the result after image processing; The target detection frame performs image processing and defect degree determination according to the partitions, including: The portion where the aluminum tube and the steel anchor are crimped by the groove is recorded as area A, and image processing and defect degree determination are performed on area A; The non-pressed area of ​​the steel core of the aluminum tube and the aluminum strand is recorded as area B, and image processing and defect degree judgment are performed on area B; The crimped part of the aluminum tube and the aluminum stranded wire is recorded as area C, and image processing and defect degree judgment are performed on area C; Image processing of area A and determination of defect degree include: Get the groove target detection frame of area A, perform histogram analysis on the target detection frame, select the peak with low grayscale value plus the threshold of 15 as the threshold of binarization, set the grayscale below this threshold to 0, and set the grayscale above this threshold to 255, and perform expansion and corrosion on the image so that the grayscale value of the steel anchor imaging in area A is 0, and finally, obtain a binary image; Traverse the obtained binary image from the first column from top to bottom, find the point p1 where the gray value changes from 255 to 0, and then find the point p2 where the gray value changes from 255 to 0. Similarly, traverse the last column from top to bottom to find the same two points as above, record them as p3 and p4, connect p1 and p3, and connect p2 and p4 to obtain two lines; The two lines and the left and right edges of the binary image are used to form a quadrilateral. The grayscale values ​​of the areas outside the quadrilateral are set to 0. The binary image is then subjected to morphological processing by corrosion and expansion. At this time, a mask is formed, and only the grayscale value of the groove area is 255. Finally, the mask area of ​​the target detection frame is obtained. The grooves in the mask area of ​​the target detection frame obtained from the X-ray image are subjected to threshold segmentation using the Otsu method to convert the grooves into a binary image, in which the black color represents the aluminum tube part and the white color represents the undervoltage part. The histogram in the groove is statistically analyzed to determine whether the groove is a defective groove. If the number of pixels with a gray value of 0: the number of pixels with a gray value of 255 is ≥1, then there is an undervoltage defect in area A that needs to be processed, otherwise it is an undervoltage defect that does not need to be processed.

2. The method for judging the degree of crimping defects of tension clamps based on X-ray images according to claim 1 is characterized in that: The structure of the improved target detection model faster-rcnn consists of 4 main parts: ResNet backbone network, FPN network, region proposal network head rpn_head and detection network head bbox_head; The defective part is framed by the improved target detection model faster-rcnn, which includes the following processes: Input the X-ray image into the ResNet backbone network to generate multiple feature maps with different resolutions; Input multiple feature maps with different resolutions into the FPN network, perform feature fusion processing, and output multiple feature layers of different scales; Input multiple feature layers of different scales into the region proposal network head rpn_head to generate multiple region candidate boxes; Input multiple region candidate boxes into the detection network head bbox_head and output the detection box of the crimping defect.

3. The method for judging the degree of crimping defects of tension clamps based on X-ray images according to claim 2 is characterized in that: The ResNet backbone network has a total of 5 stages, the first stage is denoted as C1, and its output is 320×256×64, the second stage is denoted as C2, and its output is 160×128×256, the third stage is denoted as C3, and its output is 80×64×512, the fourth stage is denoted as C4, and its output is 40×32×1024, and the fifth stage is denoted as C5, and its output is 20×16×2048; the X-ray image is input into the ResNet backbone network, and a total of 5 feature maps with different resolutions are obtained, which are denoted as C1-C5 in order.

4. The method for judging the degree of crimping defects of tension clamps based on X-ray images according to claim 2, characterized in that: The FPN network is used to perform feature fusion of feature maps. The top-down process of its structure is performed by upsampling, and the lateral connection is to fuse the upsampling result with the feature map of the same size generated from the bottom up. After the fusion, each fusion result is then convolved with a 3×3 convolution to eliminate the aliasing effect of upsampling. The FPN network outputs 5 feature layers of different scales.

5. The method for judging the degree of crimping defects of tension clamps based on X-ray images according to claim 2, characterized in that: The region proposal network head rpn_head uses RoI Align to generate candidate boxes, including: In each feature layer of different scales output by the FPN network, anchor frames of sizes 4×4, 8×8, 16×16, 32×32, and 64×64 are defined respectively, represented by anchor. In addition, each feature layer has three aspect ratios: 1:2, 1:1, and 2:1, so the entire feature pyramid has 15 anchors of different sizes. The foreground candidate box is defined as the anchor whose IoU with the ground truth is greater than 0.5; the rpn_head structure of the region proposal network head is divided into two branches, one branch uses the softmax method to classify all anchor boxes to distinguish the foreground and background, and the other branch regresses the coordinates of the anchor box to obtain accurate candidate boxes; the candidate boxes are sorted from high to low according to the foreground confidence, and the top 2000 are selected and put together. Then, these candidate boxes are subjected to non-maximum suppression with a threshold of 0.7, leaving only the top 1000 candidate boxes to be input into the subsequent network; After obtaining the candidate box, RoI Align is used instead of the original RoI Pooling. Compared with ROI Pooling, ROIAlign can ensure the alignment between the candidate box and the extracted features, thereby greatly improving the accuracy; the candidate boxes of different sizes are mapped into a fixed 7×7 feature matrix, and the 7×7 candidate box features obtained by RoI Align are input into the detection network head bbox_head.

6. The method for judging the degree of crimping defects of tension clamps based on X-ray images according to claim 2, characterized in that: The detection network head bbox_head uses three cascaded R-CNN networks and soft-nms to output the target detection box and the target detection box category, including: The IoU thresholds are set to 0.5, 0.6, and 0.7 respectively. The output of one R-CNN network is used to train the next R-CNN network to continuously optimize the detection and segmentation results. Each R-CNN network calculates the probability vector of which category each candidate box belongs to through the fully connected layer and softmax, and uses the bounding box regression again to obtain the position offset of each candidate box for regression to obtain a more accurate target detection box; Finally, the top 100 detection score areas are subjected to soft-nms to filter out the final target detection box.

7. The method for judging the degree of crimping defects of tension clamps based on X-ray images according to claim 1, characterized in that: Image processing of area B and determination of defect degree include: Group the object detection frames in area B according to the normal category and cavity category of area B; The target detection frames in each group are traversed. If there is only one target detection frame in each group, no processing is required. If there is a target detection frame in a group that contains another target detection frame, the area with the smaller target detection frame is selected as the only target detection frame of the group category. Then, for the target detection frames of the normal area and the cavity area of ​​area B, the horizontal lengths of the bounding boxes of the target detection frames are compared. If the horizontal length of the cavity area: the horizontal length of the normal area ≥ 1, it is judged that there is a cavity defect in area B, otherwise area B is normal and there is no defect.

8. The method for judging the degree of crimping defects of tension clamps based on X-ray images according to claim 1, characterized in that: Image processing of area C and determination of defect degree include: There is discontinuity in the pressure leakage part of area C, so it is necessary to add the horizontal lengths of multiple pressure leakage target detection frames identified in area C and the horizontal lengths of multiple normal target detection frames. If the total horizontal length of the target detection frame in the pressure leakage area: the total horizontal length of the target detection frame in the normal area is ≥ 1, then there may be a pressure leakage defect in area C that needs to be processed, otherwise there is no pressure leakage defect in area C that needs to be processed; If it is determined in the above steps that there may be a pressure leakage defect that needs to be processed, then determine whether there is a target detection frame at the edge of area C in the image. If so, it changes from a possible existence to a certain existence of a pressure leakage defect that needs to be processed. If not, it is still a possible existence of a pressure leakage defect that needs to be processed.

Citation Information

Patent Citations

  • Steel bar detection method based on deep convolutional neural network

    CN110264466A

  • Method and system for automatically acquiring strain clamp defect detection and identification report

    CN111709931A