YOLO v5-based improved strain clamp X-ray DR image defect detection method and related device

By improving the YOLO v5 model, using dynamic ReLU activation function, EIOU loss function and deformable convolution kernel, the problem of high labor intensity, insufficient experience and real-time performance of power tool defect detection in the prior art is solved, and the automation and efficiency of tension clamp defect detection is achieved.

CN119850581APending Publication Date: 2025-04-18GUANGDONG YUEDIANKE TESTING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510010210.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The prior art has high labor intensity, experience-dependent and real-time performance in the detection of defects of power tools. In addition, deep learning-based algorithms require huge data sets and complex network structures, and the model converges slowly.

Method used

The improved tension-resistant wire clip X-ray DR image defect detection method based on YOLO v5 is adopted, and the shape of different types of defects is adapted to the shapes of different types of defects through dynamic ReLU activation function, EIOU loss function and deformable convolution kernel, and the accuracy and accuracy of detection are improved.

Benefits of technology

The automation and efficiency of tension clamp defect detection is achieved, the ability to identify diverse defect forms is improved, and the dependence on experience and manual intervention is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850581A_ABST
    Figure CN119850581A_ABST
Patent Text Reader

Abstract

The invention provides an improved strain clamp X-ray DR image defect detection method based on YOLO v5 and a related device, the method is realized based on a pre-trained improved YOLOv5 model, and the improved YOLOv5 model is obtained by replacing related parts of a basic YOLOv5 model with a dynamic ReLU activation function and / or an EIOU loss function and / or a deformable convolution kernel; according to the method and the related device, an X-ray DR image of the strain clamp is detected by utilizing an improved YOLOv5 model, and a defect detection result of the strain clamp is obtained; wherein the improved YOLOv5 model adapts to the shapes of different types of defects through a dynamic ReLU activation function and / or an EIOU loss function and / or a deformable convolution kernel. According to the method, the improved YOLOv5 model is utilized according to the characteristics of typical defects of the strain clamp, and higher accuracy and precision are achieved during defect detection of the strain clamp.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of power equipment detection, and in particular relates to an improved YOLO v5-based tension clamp X-ray DR image defect detection method and related devices. Background Art

[0002] In recent decades, with the rapid development of China's power system, my country has established a huge transmission network. The huge number of transmission equipment has put forward higher requirements for the safety of transmission fittings in the transmission network. Among them, transmission fittings such as tension clamps, joint pipes, and suspension clamps are important components of transmission equipment. Since these transmission fittings are exposed to the outdoor environment all year round and are always under the static load of overhead transmission lines, it is an important means to maintain the stable operation of the power system to maintain the health of the transmission fittings. At present, the industry mainly monitors the status of power fittings by non-destructive testing of X-rays, and manually judges whether there are defects in the power fittings by taking DR images of the power fittings produced by the X-ray flaw detector. This method is labor-intensive, highly dependent on experience, and the real-time nature of defect prediction is also insufficient. With the rapid development of image analysis and pattern recognition technology, some researchers have proposed that common defects can be detected with the help of traditional image methods through manually designed features. Some researchers have also introduced deep learning frameworks into this field, such as R-CNN, SSD, etc., and based on these models, they have improved the training data set, improved the deep learning framework model, or integrated the deep learning algorithm with the traditional algorithm to improve the accuracy of defect prediction.

[0003] The existing methods that rely on manually designed features have low universality. When faced with some similar or atypical defects, for example, according to T_CEC 526-2021 "Technical Guidelines for Radiographic Inspection of Overhead Transmission Line Line Clamps", under-, leaking, excessive, and over-pressure are based on the degree of crimping defects made on the different margins after crimping the aluminum crimping tube crimping area of ​​the wire clamp. The identification of these defects is difficult to achieve with algorithms that use manually designed features. Common deep learning-based algorithms have relatively ideal recognition effects for the above situations, but these algorithms are based on large data sets and data augmentation to improve data richness. A more complex network structure is also required when training the algorithm, and the model converges slowly. Summary of the invention

[0004] In view of this, the present invention provides an improved tension clamp X-ray DR image defect detection method and related device based on YOLO v5, aiming to solve the above-mentioned problems existing in the prior art.

[0005] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0006] In a first aspect, the present invention provides a method for detecting defects in X-ray DR images of tension clamps based on an improved YOLO v5, wherein the method is implemented based on a pre-trained improved YOLOv5 model, and the improved YOLOv5 model is obtained by replacing relevant parts of a basic YOLOv5 model with a dynamic ReLU activation function and / or an EIOU loss function and / or a deformable convolution kernel;

[0007] The method comprises the following steps:

[0008] The improved YOLOv5 model is used to detect the X-ray DR image of the tension clamp to obtain the defect detection results of the tension clamp;

[0009] Among them, the improved YOLOv5 model adapts to the shapes of different types of defects through dynamic ReLU activation function and / or EIOU loss function and / or deformable convolution kernel.

[0010] Furthermore, the dynamic ReLU activation function replaces the default activation function of the basic YOLOv5 model. The expression of the dynamic ReLU activation function is as follows:

[0011]

[0012] In the formula, and is a hyperparameter The output linear coefficient, K is the number of functions, k is the function index, and c is the number of channels.

[0013] Furthermore, the EIOU loss function replaces the default loss function of the basic YOLOv5 model. The expression of the EIOU loss function is as follows:

[0014]

[0015] In the formula, is the overlapping area of ​​the target box and the prediction box, , are the center point coordinates of the target box and the predicted box respectively, , are the width and height of the minimum bounding rectangle of the target box and the prediction box, respectively. , , , are the width and height of the prediction box and the target box respectively, is the Euclidean distance.

[0016] Furthermore, the deformable convolution kernel replaces the default Backbone convolution kernel of the basic YOLOv5 model. The deformable convolution kernel has two convolution layers of the same size, one of which is used to perform a convolution operation on the input feature map to obtain a normal convolution matrix, and the other convolution layer is used to learn the offset to obtain an offset matrix. The output of the deformable convolution kernel is obtained by superimposing the normal convolution matrix and the offset matrix.

[0017] Furthermore, the expression of the deformable convolution kernel is as follows:

[0018]

[0019] In the formula, is the center point of the convolution kernel, is the offset relative to the center point, is the second offset relative to the center point, is the weight coefficient.

[0020] Further, the defects of the X-ray DR image of the tension clamp include at least: local defects;

[0021] The area of ​​the local defect portion meets a smaller condition than the area of ​​the entire image and / or the aspect ratio of the local defect portion meets a larger condition and / or the edge contour of the local defect portion is irregular.

[0022] In a second aspect, the present invention provides an improved X-ray DR image defect detection device for tension clamps based on YOLO v5, wherein the device is implemented based on a pre-trained improved YOLOv5 model, and the improved YOLOv5 model is obtained by replacing relevant parts of the basic YOLOv5 model with a dynamic ReLU activation function and / or an EIOU loss function and / or a deformable convolution kernel;

[0023] The device includes:

[0024] The defect detection module is used to detect the X-ray DR image of the tension clamp using the improved YOLOv5 model to obtain the defect detection result of the tension clamp;

[0025] Among them, the improved YOLOv5 model adapts to the shapes of different types of defects through dynamic ReLU activation function and / or EIOU loss function and / or deformable convolution kernel.

[0026] In a third aspect, the present invention provides a computer device, the device comprising a processor and a memory:

[0027] The memory is used to store the computer program and send the instructions of the computer program to the processor;

[0028] The processor executes, according to the instructions of the computer program, a method for detecting defects in X-ray DR images of tension clamps improved based on YOLO v5 as described in the first aspect.

[0029] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the present invention implements a method for detecting defects in X-ray DR images of tension clamps improved based on YOLO v5 as in the first aspect.

[0030] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, characterized in that when the computer program is executed by a processor, it implements a method for detecting defects in X-ray DR images of tension clamps improved based on YOLO v5 as in the first aspect.

[0031] In summary, the present invention provides a method and related device for detecting defects in X-ray DR images of tension clamps based on an improved YOLO v5, which is implemented based on a pre-trained improved YOLOv5 model. The improved YOLOv5 model is obtained by replacing the relevant parts of the basic YOLOv5 model with dynamic ReLU activation function and / or EIOU loss function and / or deformable convolution kernel; the method and related device use the improved YOLOv5 model to detect X-ray DR images of tension clamps to obtain defect detection results of tension clamps; wherein the improved YOLOv5 model adapts to the shapes of different types of defects through dynamic ReLU activation function and / or EIOU loss function and / or deformable convolution kernel. The present invention uses the improved YOLOv5 model based on the characteristics of typical defects of tension clamps, and has higher accuracy and precision in defect detection of tension clamps. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0033] Figure 1 A schematic diagram of a flow chart of a method for detecting defects in X-ray DR images of tension clamps based on an improved YOLO v5 according to an embodiment of the present invention;

[0034] Figure 2 The YOLO v5 network structure diagram provided by the present invention;

[0035] FIG3 (a) is a fracture diagram of the steel core of the tension clamp provided by the present invention;

[0036] FIG3 (b) is a diagram of the inner cavity of the tension clamp steel anchor pipe provided by the present invention;

[0037] FIG3 (c) is a crack diagram of the tension clamp steel anchor pipe provided by the present invention;

[0038] FIG3 (d) is a diagram of the leakage pressure of the tension clamp provided by the present invention;

[0039] Figure 4 Backbone network structure diagram provided for the embodiment of the present invention;

[0040] Figure 5 A schematic diagram of a deformable convolution operation provided by an embodiment of the present invention;

[0041] Figure 6 A schematic diagram of the adaptive learning capability of the deformable convolution for defective images provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0042] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] See also Figure 1 and 2 , Figure 1 The process of the improved X-ray DR image defect detection method for tension clamps based on YOLO v5 is shown; Figure 2 The network structure of the YOLO v5 model is shown.

[0044] This embodiment provides a method for detecting defects in X-ray DR images of tension clamps based on an improved YOLO v5. The method is implemented based on a pre-trained improved YOLOv5 model. The improved YOLOv5 model is obtained by replacing relevant parts of the basic YOLOv5 model with a dynamic ReLU activation function and / or an EIOU loss function and / or a deformable convolution kernel.

[0045] The method comprises the following steps:

[0046] The improved YOLOv5 model is used to detect the X-ray DR image of the tension clamp to obtain the defect detection results of the tension clamp;

[0047] Among them, the improved YOLOv5 model adapts to the shapes of different types of defects through dynamic ReLU activation function and / or EIOU loss function and / or deformable convolution kernel.

[0048] Compared with the traditional model, the improved YOLOv5 model proposed in this embodiment has made at least one improvement in the activation function, loss function and convolution kernel, aiming to improve its performance in X-ray DR image defect detection of tension clamps, especially when facing diverse defect forms.

[0049] like Figure 2 As shown in the figure, the YOLOv5 model includes an input module, a backbone network module, a feature pyramid network (Neck) module, and a detection head.

[0050] (Prediction) module.

[0051] The input module rearranges the pixels of the input image to enhance the representation capability of the features.

[0052] The CBL (Convolution-BatchNorm-LeakyReLU) part of the Backbone module is a combination of convolutional layers, batch normalization layers, and LeakyReLU activation functions; the Res unit contains two CBL modules, which enhance the depth and performance of the network through residual connections; the CSP1_X (Cross Stage Partial) module contains X Res units, which improves the performance of the network through feature fusion and feature segmentation; SPP (Spatial Pyramid Pooling) is a spatial pyramid pooling module used to extract features of different scales. CSP2_X is similar to CSP1_X, but contains 2X Res units.

[0053] The Neck module also includes the CBL part and the CSP2_1 part. Concat is a concatenation operation of feature maps, which is used to fuse features of different scales. UpSample is an upsampling operation, which is used to increase the resolution of feature maps.

[0054] The prediction head (Prediction) module includes a convolutional layer CONV, which is used to generate the final prediction result.

[0055] Based on the above YOLO v5 model, this embodiment uses dynamic ReLU to replace the original ReLU to improve the nonlinear representation ability of the network; or uses EIOU_Loss to replace the original GIOU_Loss to improve the regression accuracy of the bounding box; or introduces a deformable convolutional network module (Deformable Convolutional Networks) to replace the original square convolution kernel to enhance the network's adaptability to targets of different shapes.

[0056] like Figure 1 As shown in the figure, the method proposed in this embodiment uses the above-mentioned improvement measures to retrain the YOLOv5 model. In this process, dynamic ReLU helps the model learn more complex feature representations; the EIOU loss function optimizes the bounding box regression quality; and the deformable convolution enhances the model's ability to recognize defects of different shapes. Applying the new model to actual X-ray DR images of tension clamps can achieve automated and efficient defect detection.

[0057] This embodiment provides a method for detecting defects in X-ray DR images of tension clamps based on an improved YOLO v5. The method utilizes an improved YOLOv5 model according to the characteristics of typical defects of tension clamps, and has higher accuracy and precision in defect detection of tension clamps.

[0058] Common defects of tension clamps include steel core fracture, cavity inside the tube, and crack in the steel anchor tube. The defect area usually only occupies a very small part of the image, which is a typical feature of local defects. Steel core fracture and steel anchor tube crack also have the characteristics of large length-width ratio and irregular edge contour of the defect. The typical spectrum of this type of local defects is shown in Figure 3, where Figure 3 (a) is steel core fracture, Figure 3 (b) is cavity inside the steel anchor tube, Figure 3 (c) is steel anchor tube crack, and Figure 3 (d) is pressure leakage. The following proposes some specific improvement measures for this type of defect.

[0059] In one embodiment, a dynamic function Dynamic ReLU (DyReLu) is proposed as a new activation function to replace the default SiLU activation function of the YOLO v5 model.

[0060] In view of the above-mentioned defects, background iteration will generate a lot of redundant information during feature extraction, so it is necessary to improve or reselect a suitable activation function to replace the default SiLU activation function of the YOLO v5 model. Similar to the ReLU function and LReLU activation function, this function is a static function that takes the same operation on all input data. In order to improve the representation ability of the function model and adaptively learn the target, this experiment uses the dynamic function Dynamic ReLU (DyReLu) as a new activation function, which can encode the global context as a hyperfunction and adjust the piecewise linear activation function accordingly, and finally obtain a dynamic function:

[0061]

[0062] In the formula, and is a hyperparameter The output linear coefficient, K is the number of functions, k is the function index, and c is the number of channels.

[0063]

[0064] Adding dynamic functions Compared with the original SiLU activation function, the additional computational effort caused by DyReLu is negligible, but the ability to identify targets and backgrounds is significantly improved.

[0065] In one embodiment, an EIOU loss function is proposed to replace the default loss function of the basic YOLOv5 model.

[0066] To address the above-mentioned defects, the YOLO v5 model ( The minimum enclosing rectangular box area that can surround the prediction box and the target box, is the union area of ​​the prediction box and the target box), which solves the problem that the loss is equal to zero when the prediction box and the real box do not overlap, but when the prediction box and the real box are included, it will degenerate into , it is impossible to distinguish the positional relationship between the actual target and the predicted target, resulting in The convergence rate of the loss slows down. Considering that the shape of the defect image is long and narrow with irregular edge contours as shown above, this embodiment proposes EIOU_Loss, which integrates the overlap area, center point distance, and length and width true difference into the calculation of the loss function. The expression of the EIOU loss function is as follows:

[0067]

[0068] In the formula, is the overlapping area of ​​the target box and the prediction box, , are the center point coordinates of the target box and the predicted box respectively, , are the width and height of the minimum bounding rectangle of the target box and the prediction box, respectively. , , , are the width and height of the prediction box and the target box respectively, is the Euclidean distance between the two, and the same goes for the others.

[0069] In one embodiment, a deformable convolution kernel is proposed to replace the default Backbone convolution kernel of the basic YOLOv5 model. The deformable convolution kernel has two convolution layers of the same size, one of which is used to perform a convolution operation on the input feature map to obtain a normal convolution matrix, and the other convolution layer is used to learn the offset to obtain an offset matrix. The output of the deformable convolution kernel is obtained by superimposing the normal convolution matrix and the offset matrix.

[0070] See also Figure 4Backbone is the core component of the YOLO v5 model, responsible for extracting high-order features of the image. After the input image passes through the convolution layer and pooling layer of Backbone, the size of the feature map gradually decreases, the number of channels gradually increases, and the important features of the input image are retained. These extracted feature maps will be further passed to the subsequent feature pyramid network (Neck) and detection head (Prediction) for processing. In YOLO v5, common Backbone networks include CSPDarknet53 or ResNet, etc. These networks are relatively lightweight and can minimize the amount of calculation and memory usage while ensuring high detection accuracy. Its structure mainly includes Conv module, C3 module and SPPF module. The Conv module consists of convolution layer, BN layer and activation function. The C3 module is responsible for adaptively aggregating the previous feature map, while the SPPF module obtains more comprehensive spatial information through weighted fusion of global features and local features. The YOLO v5 model adopts a fixed geometric structure. Convolution kernel operation, the convolution unit samples the input feature map at a fixed position, lacks an internal adaptation mechanism to process geometric transformations, and is difficult to accurately extract features from irregularly shaped graphics. This embodiment replaces the Backbone convolution kernel with a deformable convolution kernel. The convolution operation of the deformable convolution kernel is shown in FIG. 5. For the input feature map in the figure, assuming that the original convolution operation is N=3, that is, the convolution kernel is 3×3 in size, then in order to learn the offset matrix, we define another 3×3 convolution layer (the convolution layer above the schematic diagram), the output dimension is the original feature map size, and the number of channels is equal to 2*N (representing The deformable convolution can be seen as a superposition operation based on the offset matrix generated above and the ordinary convolution matrix.

[0071] In one embodiment, a deformable convolution kernel is proposed, and the expression of the deformable convolution kernel is as follows:

[0072]

[0073] In the formula, is the center point of the convolution kernel, is the offset relative to the center point, is the second offset relative to the center point, is the weight coefficient.

[0074] The above deformable convolution kernel replaces the regular convolution kernel of Backbone: ( is the center point of the convolution kernel, is the offset relative to the center point), so that the feature extraction area is more biased towards the target area of ​​interest.

[0075] Deformable convolution is particularly effective when dealing with objects with irregular shapes and large aspect ratios, such as Figure 6 By comparing the feature extraction methods of deformable convolution and conventional convolution when learning the defects of tension clamps, it can be seen that deformable convolution can adapt to the actual shape of the object and learn its feature information.

[0076] In one embodiment, the defects of the X-ray DR image of the tension clamp include at least: local defects;

[0077] The area of ​​the local defect portion meets a smaller condition than the area of ​​the entire image and / or the aspect ratio of the local defect portion meets a larger condition and / or the edge contour of the local defect portion is irregular.

[0078] The area of ​​the local defect part is small relative to the total area of ​​the entire image, which means that these defects do not occupy most of the image area, but a relatively small part of the image. Such characteristics make detection more challenging because defects may be easily masked by background noise or other non-defective areas. The aspect ratio (ratio of length to width) of the local defect part is large, which means that the defect presents an elongated shape, such as a crack or crack. This type of defect may be more difficult for traditional rectangular box detection methods because it requires the model to accurately capture very narrow and long targets. The edge contours of the local defect part are irregular, which means that the boundary of the defect is not a smooth or simple geometric shape, but may be jagged, curved or other complex shapes. This irregularity increases the difficulty of feature extraction and accurate positioning because the model needs to be able to recognize and distinguish these complex and changing edges.

[0079] For the above types of defects, the improved YOLO v5 model can improve the detection accuracy of these specific types of defects.

[0080] Based on the same inventive concept, the embodiment of the present application also provides a device for detecting X-ray DR image defects of tension clamps based on YOLO v5, which is used to implement the above-mentioned method for detecting X-ray DR image defects of tension clamps based on YOLO v5. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme described in the above-mentioned method. Therefore, the specific limitations in the embodiment of the device for detecting X-ray DR image defects of tension clamps based on YOLO v5 provided below can be referred to the limitations of the method for detecting X-ray DR image defects of tension clamps based on YOLO v5 above, and will not be repeated here.

[0081] This embodiment provides a tension clamp X-ray DR image defect detection device based on YOLO v5 improvement. The device is implemented based on a pre-trained improved YOLOv5 model. The improved YOLOv5 model is obtained by replacing the relevant parts of the basic YOLOv5 model with a dynamic ReLU activation function and / or an EIOU loss function and / or a deformable convolution kernel.

[0082] The device includes:

[0083] The defect detection module is used to detect the X-ray DR image of the tension clamp using the improved YOLOv5 model to obtain the defect detection result of the tension clamp;

[0084] Among them, the improved YOLOv5 model adapts to the shapes of different types of defects through dynamic ReLU activation function and / or EIOU loss function and / or deformable convolution kernel.

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

[0086] An embodiment of the present invention also provides a computer device, comprising: a memory and a processor and a computer program stored in the memory. When the computer program is executed on the processor, the improved X-ray DR image defect detection method for tension clamps based on YOLO v5 as described in any one of the above methods is implemented.

[0087] The computer device may be a desktop computer, a notebook computer, a palm computer, a cloud server, etc. The computer device may include, but is not limited to, a processor and a memory.

[0088] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0089] In some embodiments, the memory may be an internal storage unit of the computer device, such as a hard disk or memory of the computer device. In other embodiments, the memory may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Further, the memory may include both an internal storage unit and an external storage device of the computer device. The memory is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory may also be used to temporarily store data that has been output or is to be output.

[0090] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for detecting defects in X-ray DR images of tension clamps improved by YOLO v5 as described in any one of the above methods is implemented.

[0091] In this embodiment, if the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, USB flash drive, mobile hard disk, disk or optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0092] An embodiment of the present invention also provides a computer program product, including a computer program, characterized in that when the computer program is executed by a processor, it implements the X-ray DR image defect detection method for tension clamps based on the improved YOLO v5 as described in any one of the above methods.

[0093] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0094] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0095] In the embodiments disclosed in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0096] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. The improved X-ray DR image defect detection method for tension clamps based on YOLO v5 is characterized by: The method is implemented based on a pre-trained improved YOLOv5 model, where the improved YOLOv5 model is obtained by replacing relevant parts of the basic YOLOv5 model with a dynamic ReLU activation function and / or an EIOU loss function and / or a deformable convolution kernel; The method comprises the following steps: The improved YOLOv5 model is used to detect the X-ray DR image of the tension clamp to obtain the defect detection result of the tension clamp; The improved YOLOv5 model adapts to the shapes of different types of defects through the dynamic ReLU activation function and / or EIOU loss function and / or deformable convolution kernel.

2. The improved tension clamp X-ray DR image defect detection method based on YOLO v5 according to claim 1 is characterized in that: The dynamic ReLU activation function replaces the default activation function of the basic YOLOv5 model. The expression of the dynamic ReLU activation function is as follows: In the formula, and is a hyperparameter The output linear coefficient, K is the number of functions, k is the function index, and c is the number of channels.

3. The improved method for detecting defects in X-ray DR images of tension clamps based on YOLO v5 according to claim 1 is characterized in that: The EIOU loss function replaces the default loss function of the basic YOLOv5 model. The expression of the EIOU loss function is as follows: In the formula, is the overlapping area of ​​the target box and the prediction box, , are the center point coordinates of the target box and the predicted box respectively, , are the width and height of the minimum bounding rectangle of the target box and the prediction box, respectively. , , , are the width and height of the prediction box and the target box respectively, is the Euclidean distance.

4. The improved method for detecting defects in X-ray DR images of tension clamps based on YOLO v5 according to claim 1 is characterized in that: The deformable convolution kernel replaces the default Backbone convolution kernel of the basic YOLOv5 model. The deformable convolution kernel has two convolution layers of the same size, one of which is used to perform a convolution operation on the input feature map to obtain a common convolution matrix, and the other convolution layer is used to learn the offset to obtain an offset matrix. The output of the deformable convolution kernel is obtained by superimposing the common convolution matrix and the offset matrix.

5. The improved method for detecting defects in X-ray DR images of tension clamps based on YOLO v5 according to claim 4 is characterized in that: The expression of the deformable convolution kernel is as follows: In the formula, is the center point of the convolution kernel, is the offset relative to the center point, is the second offset relative to the center point, is the weight coefficient.

6. The improved method for detecting defects in X-ray DR images of tension clamps based on YOLO v5 according to claim 1 is characterized in that: The defects of the X-ray DR image of the tension clamp include at least: local defects; The area of ​​the local defect portion accounts for a smaller area of ​​the entire image and / or the aspect ratio of the local defect portion meets a larger condition and / or the edge contour of the local defect portion is irregular.

7. The improved X-ray DR image defect detection device for tension clamps based on YOLO v5 is characterized in that: The device is implemented based on a pre-trained improved YOLOv5 model, where the improved YOLOv5 model is obtained by replacing relevant parts of the basic YOLOv5 model with a dynamic ReLU activation function and / or an EIOU loss function and / or a deformable convolution kernel; The device comprises: A defect detection module, used to detect the X-ray DR image of the tension clamp using the improved YOLOv5 model to obtain a defect detection result of the tension clamp; The improved YOLOv5 model adapts to the shapes of different types of defects through the dynamic ReLU activation function and / or EIOU loss function and / or deformable convolution kernel.

8. A computer device, characterized in that: The device comprises a processor and a memory: The memory is used to store a computer program and send instructions of the computer program to the processor; The processor executes the improved YOLO v5-based X-ray DR image defect detection method for tension clamps as described in any one of claims 1 to 6 according to the instructions of the computer program.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, it implements a method for detecting defects in X-ray DR images of tension clamps based on improved YOLOv5 as described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, it implements a method for detecting defects in X-ray DR images of tension clamps based on improved YOLO v5 as described in any one of claims 1 to 6.