Cable low-voltage sheath surface defect detection method, system, equipment and medium

By designing a decoupling head module based on the loss function and adaptive feature fusion of the bounding box shape and scale, the cable low-voltage sheath surface defect detection model is improved, which solves the problems of low efficiency and poor consistency of the traditional method, and achieves efficient small-scale detection. Target defect detection improves detection accuracy.

CN118691897AActive Publication Date: 2024-09-24INSPUR QILU SOFTWARE IND
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202410852575.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-09-24
Estimated Expiration
2044-06-28

AI Technical Summary

Technical Problem

Traditional cable low-voltage sheath surface defect detection methods have low efficiency and poor consistency. Deep learning methods have false detections and missed detections when dealing with diverse cables and defect types, making it difficult to effectively detect small target defects.

Method used

Design a decoupling head module based on the loss function of bounding box shape and scale and adaptive feature fusion to improve the bounding box regression capability and feature representation of the anchor box detector, and improve the efficiency and accuracy of the defect detection model.

Benefits of technology

Through modular design and training, the performance and flexibility of the low-voltage sheath surface defect detection model have been improved, and the detection accuracy has reached 91.3%, effectively solving the problem of low defect detection rate for small targets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118691897A
    Figure CN118691897A
Patent Text Reader

Abstract

The invention discloses a cable low-voltage sheath surface defect detection method, system and device and a medium, belongs to the technical field of computer identification and image processing, and aims to solve the technical problem of how to improve the detection rate of a low-voltage sheath surface defect small target so as to improve the performance and flexibility of a model. According to the technical scheme, the method comprises the steps that S1, according to analysis of a small target defect detection task, a loss function based on the shape and the scale of a bounding box is designed and used for training of a cable low-voltage sheath defect detection model, and the problem that a detector based on an anchor frame is sensitive to small target defects on bounding box regression is solved; and S2, designing a decoupling head module AFFD with adaptive feature fusion according to analysis of the structure and the optimization path of the cable low-voltage sheath defect detection model, and further decoupling defect positioning and classification tasks, so that the defect detection model learns proper feature representation in different sub-tasks, and the efficiency and the accuracy of the defect detection model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of computer recognition and image processing, and in particular to a method, system, equipment and medium for detecting surface defects of a cable low-voltage sheath. Background Art

[0002] With the continuous investment in infrastructure construction, the cable industry has shown a steady growth trend. The safety and reliability of cable products are of vital importance, which is related to the stable operation of the power system and the safety of people's lives and property. For example, when producing low-voltage sheaths, due to improper material selection and imprecise processing technology, the surface of the low-voltage sheath will produce disjointed, particles and other production quality problems, resulting in substandard final products.

[0003] Traditional manual inspection is inefficient, inconsistent, and easily affected by personal subjectivity. Traditional image processing methods have some limitations and rely mainly on predefined algorithms and rules to process and analyze image data. This method has limited generalization capabilities in the face of diverse cable and defect types, and usually needs to be adjusted and optimized for specific situations. Deep learning methods have good generalization capabilities when dealing with diverse cable and defect types, while meeting the requirements of real-time detection. However, deep learning methods also have some shortcomings. Due to the small difference in features between positive and negative samples, the small difference in features between categories, and the small scale of the target, the YOLO-based target detection model has some false detections and missed detections.

[0004] Therefore, how to improve the detection rate of small targets with surface defects on low-pressure sheaths and thereby improve the performance and flexibility of the model is a technical problem that needs to be solved urgently. Summary of the invention

[0005] The technical task of the present invention is to provide a method, system, equipment and medium for detecting surface defects of cable low-voltage sheath to solve the problem of how to improve the detection rate of small targets of low-voltage sheath surface defects, thereby improving the performance and flexibility of the model.

[0006] The technical task of the present invention is achieved in the following way: a method for detecting surface defects of a low-voltage cable sheath, the method is as follows:

[0007] S1. Based on the analysis of small target defect detection tasks, a loss function based on bounding box shape and scale is designed for training the cable low-voltage sheath defect detection model to improve the problem that the anchor-based detector is sensitive to small target defects in bounding box regression;

[0008] S2. Based on the analysis of the structure and optimization path of the cable low-voltage sheath defect detection model, a decoupling head module AFFD for adaptive feature fusion is designed to further decouple the defect location and classification tasks, so that the defect detection model can learn suitable feature representations in different subtasks, thereby improving the efficiency and accuracy of the defect detection model.

[0009] S3. Combine step S1 and step S2 to design and train a modular cable low-voltage sheath defect detection model, and use the finally obtained cable low-voltage sheath detection model to perform defect detection on the input image; wherein, defect detection includes two subtasks: defect location and defect classification.

[0010] As a preference, the loss function based on the bounding box shape and scale is designed as follows:

[0011] According to the shape deviation of the GT (Ground Truth) true value box and the predicted bounding box, the weight coefficients are set in the horizontal and vertical directions respectively. The formula is as follows:

[0012]

[0013] Among them, w mbr and h mbr Represents the width and height of the minimum bounding rectangle of the true value box and the predicted box respectively; and The coordinates of the upper left corner and lower right corner of the prediction box and the true value box respectively;

[0014] The bounding box is modeled as a two-dimensional Gaussian distribution, and the similarity of the Gaussian distribution is measured by using the normalized Wasserstein distance (NWD). Among them, the Wasserstein distance can measure the distribution similarity even if there is no overlap or the overlap is negligible. In addition, the Wasserstein distance (NWD) is insensitive to objects of different scales and is suitable for measuring the similarity between tiny objects. Specifically:

[0015] Let the bounding box be B = (cx, cy, w, h). For two bounding boxes, the second-order Wasserstein distance is defined as:

[0016]

[0017] Use the normalized index to measure similarity:

[0018]

[0019] Among them, C is a constant determined by the data set, and C is set to the average absolute size of the target in the data set; the normalized Wasserstein distance with the shape scale factor added is:

[0020]

[0021] The normalized Wasserstein distance loss function based on the shape scale factor is:

[0022] L NWD-shape =1-NWD(B a ,B b ).

[0023] As a preferred option, the adaptive feature fusion decoupling head module AFFD is used to generate spatially coarse feature encodings with stronger semantic information for classification tasks, while providing high-resolution feature maps containing edge information for positioning tasks, regressing object boundaries, further disentangling the feature encodings of classification tasks and positioning tasks, and improving the overall performance of the network.

[0024] More optimally, the adaptive feature fusion decoupling head module AFFD performs deep and shallow adaptive feature fusion in front of the detection head through a feature pyramid-like structure, and then sends them to the head for corresponding decoding output. The classification task fuses the deeper features of the current layer to embed rich semantic features into the current layer; the regression task fuses the features of two adjacent layers to obtain rich spatial detail information.

[0025] More optimally, the adaptive feature fusion decoupling head module AFFD adds a fourth branch of the small target detection layer based on the YOLOv5 network structure to further improve the detection capability of small targets;

[0026] The network structure corresponding to the decoupling head module AFFD of adaptive feature fusion includes Neck and AFFD Head; Neck adopts FPN, and FPN includes p1, p2, p3 and p4; among them, p1-p4 represent the features of different levels in the feature pyramid, and each feature has different spatial resolutions;

[0027] AFFD Head includes AFFD-x-cls and AFFD-x-reg, which are set one-to-one with p1, p2, p3 and p4 in FPN; AFFD-x-cls and AFFD-x-reg represent the decoupling of classification and regression tasks for the features of the x-th layer, and the feature map obtained after adaptive feature fusion;

[0028] Specifically, for the p2 layer features, AFFD-2-cls is used to receive the feature maps from AFFD-3-cls and perform weighted fusion by learning weight coefficients α and β; AFFD-2-reg is used to receive the feature maps from AFFD-1-reg and AFFD-3-reg and perform weighted fusion by learning weight coefficients α, β and γ.

[0029] As a preferred method, the method of obtaining the input image is as follows:

[0030] The cable is guided to a shooting unit via a transmission device, and the shooting unit is equipped with a light source lighting device and a camera shooting unit for image acquisition and transmission;

[0031] After image acquisition, it is transmitted to the back-end processing equipment via the network solution. The back-end processing equipment is equipped with a trained computer vision target detection algorithm to process and analyze the image, thereby identifying defects and displaying the analysis results.

[0032] A cable low-voltage sheath surface defect detection system, the system comprising:

[0033] The loss function design module is used to design a loss function based on the shape and scale of the bounding box according to the analysis of the small target defect detection task. It is used to train the cable low-voltage sheath defect detection model and improve the problem that the anchor-based detector is sensitive to small target defects in bounding box regression.

[0034] The decoupling head design module is used to design the adaptive feature fusion decoupling head module AFFD according to the structure and optimization path of the cable low-voltage sheath defect detection model, further decouple the defect location and classification tasks, so that the defect detection model can learn suitable feature representations in different subtasks, and improve the efficiency and accuracy of the defect detection model;

[0035] The modular processing module is used to design and train a modular cable low-voltage sheath defect detection model in combination with the loss function design module and the decoupling head design module. The input image is used for defect detection through the finally acquired cable low-voltage sheath detection model. Among them, defect detection includes two subtasks: defect location and defect classification.

[0036] Preferably, the loss function design module includes:

[0037] The weight coefficient setting submodule is used to set the weight coefficients in the horizontal and vertical directions respectively for the shape deviation of the GT (Ground Truth) true value box and the predicted bounding box. The formula is as follows:

[0038]

[0039] Among them, w mbr and h mbr Represents the width and height of the minimum bounding rectangle of the true value box and the predicted box respectively; and The coordinates of the upper left corner and lower right corner of the prediction box and the true value box respectively;

[0040] The modeling submodule is used to model the bounding box as a two-dimensional Gaussian distribution and measure the similarity of the Gaussian distribution by using the normalized Wasserstein distance (NWD). The Wasserstein distance can measure the distribution similarity even if there is no overlap or the overlap is negligible. In addition, the Wasserstein distance (NWD) is insensitive to objects of different scales and is suitable for measuring the similarity between tiny objects. Specifically:

[0041] Let the bounding box be B = (cx, cy, w, h). For two bounding boxes, the second-order Wasserstein distance is defined as:

[0042]

[0043] Use the normalized index to measure similarity:

[0044]

[0045] Among them, C is a constant determined by the data set, and C is set to the average absolute size of the target in the data set; the normalized Wasserstein distance with the shape scale factor added is:

[0046]

[0047] The normalized Wasserstein distance loss function based on the shape scale factor is:

[0048] L NWD-shape =1-NWD(B a ,B b );

[0049] The adaptive feature fusion decoupling head module AFFD is used to generate spatially coarse feature codes with stronger semantic information for classification tasks, and provide high-resolution feature maps containing edge information for positioning tasks, regress object boundaries, further disentangle the feature codes of classification tasks and positioning tasks, and improve the overall performance of the network; the adaptive feature fusion decoupling head module AFFD adds a fourth branch of the small target detection layer based on the YOLOv5 network structure to further improve the detection capability of small targets;

[0050] The network structure corresponding to the decoupling head module AFFD of adaptive feature fusion includes Neck and AFFD Head; Neck adopts FPN, and FPN includes p1, p2, p3 and p4; among them, p1-p4 represent the features of different levels in the feature pyramid, and each feature has different spatial resolutions;

[0051] AFFD Head includes AFFD-x-cls and AFFD-x-reg, which are set one-to-one with p1, p2, p3 and p4 in FPN; among them, AFFD-x-cls and AFFD-x-reg represent the decoupling of classification and regression tasks for the features of the x-th layer, and the feature maps obtained after adaptive feature fusion.

[0052] An electronic device comprising: a memory and at least one processor;

[0053] Wherein, the memory stores a computer program;

[0054] The at least one processor executes the computer program stored in the memory, so that the at least one processor performs the above-mentioned method for detecting surface defects of the low-voltage sheath of the cable.

[0055] A computer-readable storage medium stores a computer program, which can be executed by a processor to implement the above-mentioned cable low-voltage sheath surface defect detection method.

[0056] The cable low-voltage sheath surface defect detection method, system, equipment and medium of the present invention have the following advantages:

[0057] (i) The present invention designs a loss function based on the shape and scale of the bounding box, which effectively eliminates the influence of the inherent attributes such as the shape and scale of the bounding box on the bounding box regression, is suitable for detectors based on intersection-over-union and anchor boxes, and improves the detection effect of small target defects;

[0058] (ii) The present invention designs a decoupling head module with adaptive feature fusion, improves the feature representation of defect detection subtasks, optimizes the feature allocation and fusion of different subtasks, and improves the performance and flexibility of the model; at the same time, in order to solve the problem of spatial misalignment in defect detection, the subtasks are effectively decoupled to more accurately locate and classify defects;

[0059] (III) The present invention performs modular design and model training to obtain a low-voltage sheath surface defect detection model. Through testing and experiments, the accuracy of the optimized model is effectively improved, and the model accuracy is finally improved to 91.3%. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] The present invention is further described below in conjunction with the accompanying drawings.

[0061] Attached Figure 1 Schematic diagram of the adaptive feature fusion decoupling head module. DETAILED DESCRIPTION

[0062] The cable low-voltage sheath surface defect detection method, system, equipment and medium of the present invention are described in detail below with reference to the drawings and specific embodiments of the specification.

[0063] Embodiment 1:

[0064] This embodiment provides a method for detecting surface defects of a low-voltage cable sheath, which is specifically as follows:

[0065] S1. Based on the analysis of small target defect detection tasks, a loss function based on bounding box shape and scale is designed for training the cable low-voltage sheath defect detection model to improve the problem that the anchor-based detector is sensitive to small target defects in bounding box regression;

[0066] S2. Based on the analysis of the structure and optimization path of the cable low-voltage sheath defect detection model, a decoupling head module AFFD for adaptive feature fusion is designed to further decouple the defect location and classification tasks, so that the defect detection model can learn suitable feature representations in different subtasks, thereby improving the efficiency and accuracy of the defect detection model.

[0067] S3. Combine step S1 and step S2 to design and train a modular cable low-voltage sheath defect detection model, and use the finally obtained cable low-voltage sheath detection model to perform defect detection on the input image; wherein, defect detection includes two subtasks: defect location and defect classification.

[0068] In this embodiment, the method for obtaining the input image is as follows:

[0069] ① The cable is guided to the shooting unit via the transmission device. The shooting unit is equipped with a light source lighting device and a camera shooting unit for image acquisition and transmission;

[0070] ② After image acquisition, it is transmitted to the back-end processing equipment via the network solution. The back-end processing equipment is equipped with a trained computer vision target detection algorithm to process and analyze the image, thereby identifying defects and displaying the analysis results.

[0071] The intersection-over-union (IoU)-based metric is very sensitive to positional deviations of tiny objects, and will greatly reduce detection performance when used in anchor-based detectors. Tiny objects typically exhibit extremely limited appearance information, which increases the difficulty of learning discriminative features, resulting in failures in detecting tiny objects. For tiny objects, the characteristic of having few pixels will increase the difficulty of selecting positive and negative samples during training. Since the sensitivity of IoU to objects of different scales varies greatly, for tiny objects (e.g., 6×6 pixels), a small positional deviation will result in a significant drop in IoU (from 0.53 to 0.06). The sensitivity of IoU to tiny objects and the inaccuracy of label assignment will ultimately lead to difficulties in convergence during network training, so IoU is not a good metric for tiny objects. The loss function designed in step S1 of this embodiment based on bounding box shape and scale is as follows:

[0072] S101. For the shape deviation of the GT (Ground Truth) true value box and the predicted bounding box, set the weight coefficient in the horizontal direction and the vertical direction respectively. The formula is as follows:

[0073]

[0074] Among them, w mbr and h mbr Represents the width and height of the minimum bounding rectangle of the true value box and the predicted box respectively; and The coordinates of the upper left corner and lower right corner of the prediction box and the true value box respectively;

[0075] S102, the bounding box is modeled as a two-dimensional Gaussian distribution, and the similarity of the Gaussian distribution is measured by using the normalized Wasserstein distance (NWD); wherein the Wasserstein distance can measure the distribution similarity even if there is no overlap or the overlap is negligible; in addition, the Wasserstein distance (NWD) is insensitive to objects of different scales and is suitable for measuring the similarity between tiny objects; specifically:

[0076] ① Let the bounding box be B = (cx, cy, w, h). For two bounding boxes, the second-order Wasserstein distance is defined as:

[0077]

[0078] ②Use the normalized index to measure similarity:

[0079]

[0080] Among them, C is a constant determined by the data set, and C is set to the average absolute size of the target in the data set; the normalized Wasserstein distance with the shape scale factor added is:

[0081]

[0082] ③The normalized Wasserstein distance loss function based on the shape scale factor is:

[0083] L NWD-shape =1-NWD(B a ,B b ).

[0084] Defect detection includes two subtasks: defect location and defect classification. However, the preferences of these two subtasks for defect features are inconsistent. The location task tends to require edge features of defects, while the classification task requires more semantic context information of defects. The general single-stage target detection method has different receptive field branches, each of which is a coupled head that receives the same feature map input and then predicts the classification and location tasks. Some methods attempt to decouple the output head and split it into independent branches for defect classification and bounding box regression tasks respectively. Although this decoupling method can make the two different subtasks converge better, it cannot fundamentally solve the problem due to the inconsistent preferences of the two subtasks for features. In response to the above problems, the adaptive feature fusion decoupling head module AFFD in step S2 of this embodiment is used to generate spatially coarse feature encoding with stronger semantic information for classification tasks, and at the same time provide high-resolution feature maps containing edge information for positioning tasks to better regress object boundaries, further disentangle the feature encoding of classification tasks and positioning tasks, and improve the overall performance of the network.

[0085] Secondly, the inconsistency between different feature scales is a defect of the single-stage target detector based on the feature pyramid. Although structures such as FPN (feature pyramid) fuse multi-scale features through top-down and bottom-up paths, this fusion is sometimes not sufficient. Each layer of feature maps in the feature pyramid may not completely eliminate the differences between different scales during the fusion process, resulting in insufficient feature expression capabilities. Unlike other feature fusion methods, such as element-wisesum (element-by-element addition) or concatenation (feature splicing), here by adding weight parameters of feature map branches of different scales, the network can directly learn how to filter features of other levels in space and fuse features of different layers together. In this way, the detection head can adaptively select the most useful features according to the spatial position and scale context of each feature to improve the accuracy of detection. In addition, the decoupling head module AFFD of the adaptive feature fusion in step S2 of this embodiment adds a fourth branch of the small target detection layer based on the YOLOv5 network structure to further improve the detection capability of small targets.

[0086] The adaptive feature fusion decoupling head module AFFD in step S2 of this embodiment performs deep and shallow adaptive feature fusion in front of the detection head through a similar feature pyramid structure, and then sends them to the head for corresponding decoding output. The classification task fuses the deeper features of the current layer to embed rich semantic features into the current layer; the regression task fuses the features of two adjacent layers to obtain rich spatial detail information.

[0087] As attached Figure 1 As shown in the figure, the network structure corresponding to the decoupling head module AFFD of the adaptive feature fusion includes Neck and AFFD Head; Neck adopts FPN, and FPN includes p1, p2, p3 and p4; among them, p1-p4 represent the features of different levels in the feature pyramid, and each feature has different spatial resolutions;

[0088] AFFD Head includes AFFD-x-cls and AFFD-x-reg, which are set one-to-one with p1, p2, p3 and p4 in FPN; AFFD-x-cls and AFFD-x-reg represent the decoupling of classification and regression tasks for the features of the x-th layer, and the feature map obtained after adaptive feature fusion;

[0089] Specifically, for the p2 layer features, AFFD-2-cls is used to receive the feature maps from AFFD-3-cls and perform weighted fusion by learning weight coefficients α and β; AFFD-2-reg is used to receive the feature maps from AFFD-1-reg and AFFD-3-reg and perform weighted fusion by learning weight coefficients α, β and γ.

[0090] Embodiment 2:

[0091] This embodiment provides a cable low-voltage sheath surface defect detection system, the system comprising:

[0092] The loss function design module is used to design a loss function based on the shape and scale of the bounding box according to the analysis of the small target defect detection task. It is used to train the cable low-voltage sheath defect detection model and improve the problem that the anchor-based detector is sensitive to small target defects in bounding box regression.

[0093] The decoupling head design module is used to design the adaptive feature fusion decoupling head module AFFD according to the structure and optimization path of the cable low-voltage sheath defect detection model, further decouple the defect location and classification tasks, so that the defect detection model can learn suitable feature representations in different subtasks, and improve the efficiency and accuracy of the defect detection model;

[0094] The modular processing module is used to design and train a modular cable low-voltage sheath defect detection model in combination with the loss function design module and the decoupling head design module. The input image is used for defect detection through the finally acquired cable low-voltage sheath detection model. Among them, defect detection includes two subtasks: defect location and defect classification.

[0095] The loss function design module in this embodiment includes:

[0096] The weight coefficient setting submodule is used to set the weight coefficients in the horizontal and vertical directions respectively for the shape deviation of the GT (Ground Truth) true value box and the predicted bounding box. The formula is as follows:

[0097]

[0098] Among them, w mbr and h mbr Represents the width and height of the minimum bounding rectangle of the true value box and the predicted box respectively; and The coordinates of the upper left corner and lower right corner of the prediction box and the true value box respectively;

[0099] The modeling submodule is used to model the bounding box as a two-dimensional Gaussian distribution and measure the similarity of the Gaussian distribution by using the normalized Wasserstein distance (NWD). The Wasserstein distance can measure the distribution similarity even if there is no overlap or the overlap is negligible. In addition, the Wasserstein distance (NWD) is insensitive to objects of different scales and is suitable for measuring the similarity between tiny objects. Specifically:

[0100] Let the bounding box be B = (cx, cy, w, h). For two bounding boxes, the second-order Wasserstein distance is defined as:

[0101]

[0102] Use the normalized index to measure similarity:

[0103]

[0104] Among them, C is a constant determined by the data set, and C is set to the average absolute size of the target in the data set; the normalized Wasserstein distance with the shape scale factor added is:

[0105]

[0106] The normalized Wasserstein distance loss function based on the shape scale factor is:

[0107] L NWD-shape =1-NWD(B a ,B b ).

[0108] The adaptive feature fusion decoupling head module AFFD in this embodiment is used to generate spatially coarse feature coding with stronger semantic information for classification tasks, and at the same time provide high-resolution feature maps containing edge information for positioning tasks, regress object boundaries, further disentangle the feature coding of classification tasks and positioning tasks, and improve the overall performance of the network; the adaptive feature fusion decoupling head module AFFD adds a fourth branch of the small target detection layer based on the YOLOv5 network structure, further improving the detection capability of small targets.

[0109] As attached Figure 1 As shown, the network structure corresponding to the decoupling head module AFFD of the adaptive feature fusion in this embodiment includes Neck and AFFD Head; Neck adopts FPN, and FPN includes p1, p2, p3 and p4; wherein p1-p4 represent features of different levels in the feature pyramid, and each feature has different spatial resolutions;

[0110] AFFD Head includes AFFD-x-cls and AFFD-x-reg, which are set one-to-one with p1, p2, p3 and p4 in FPN; among them, AFFD-x-cls and AFFD-x-reg represent the decoupling of classification and regression tasks for the features of the x-th layer, and the feature maps obtained after adaptive feature fusion.

[0111] Embodiment 3:

[0112] This embodiment also provides an electronic device, including: a memory and a processor;

[0113] Wherein, the memory stores computer-executable instructions;

[0114] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the cable low-voltage sheath surface defect detection method in any embodiment of the present invention.

[0115] The processor may be a central processing unit (CPU), or 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. The processor may be a microprocessor or any conventional processor, etc.

[0116] The memory can be used to store computer programs and / or modules. The processor realizes various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the terminal, etc. In addition, the memory can also include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash memory card, at least one disk storage period, a flash memory device, or other volatile solid-state storage devices.

[0117] Embodiment 4:

[0118] This embodiment also provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions are loaded by a processor, so that the processor executes the cable low-voltage sheath surface defect detection method in any embodiment of the present invention. Specifically, a system or device equipped with a storage medium can be provided, on which a software program code that implements the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or device reads and executes the program code stored in the storage medium.

[0119] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.

[0120] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RYM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer via a communication network.

[0121] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.

[0122] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or the expansion unit is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.

[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting surface defects of a low-voltage cable sheath, characterized in that: The method is as follows: S1. Based on the analysis of small target defect detection tasks, a loss function based on bounding box shape and scale is designed for training the cable low-voltage sheath defect detection model to improve the problem that the anchor-based detector is sensitive to small target defects in bounding box regression; S2. Based on the analysis of the structure and optimization path of the cable low-voltage sheath defect detection model, a decoupling head module AFFD for adaptive feature fusion is designed to further decouple the defect location and classification tasks, so that the defect detection model can learn suitable feature representations in different subtasks, thereby improving the efficiency and accuracy of the defect detection model. S3. Combine step S1 and step S2 to design and train a modular cable low-voltage sheath defect detection model, and use the finally obtained cable low-voltage sheath detection model to perform defect detection on the input image; wherein, defect detection includes two subtasks: defect location and defect classification.

2. The method for detecting surface defects of a low-voltage cable sheath according to claim 1, characterized in that: The loss function designed based on bounding box shape and scale is as follows: According to the shape deviation of the GT true value box and the predicted bounding box, the weight coefficients are set in the horizontal and vertical directions respectively. The formula is as follows: Among them, w mbr and h mbr Represents the width and height of the minimum bounding rectangle of the true value box and the predicted box respectively; and The coordinates of the upper left corner and lower right corner of the prediction box and the true value box respectively; The bounding box is modeled as a two-dimensional Gaussian distribution, and the similarity of the Gaussian distribution is measured by using the normalized Wasserstein distance; among them, the Wasserstein distance can measure the distribution similarity even if there is no overlap or the overlap is negligible; specifically: Let the bounding box be B = (cx, cy, w, h). For two bounding boxes, the second-order Wasserstein distance is defined as: Use the normalized index to measure similarity: Among them, C is a constant determined by the data set, and C is set to the average absolute size of the target in the data set; the normalized Wasserstein distance with the shape scale factor added is: The normalized Wasserstein distance loss function based on the shape scale factor is: L NWD-shape =1-NWD(B a ,B b )。 3. The method for detecting surface defects of a low-voltage cable sheath according to claim 1, characterized in that: The adaptive feature fusion decoupling head module AFFD is used to generate spatially coarse feature encodings with stronger semantic information for classification tasks. At the same time, it provides high-resolution feature maps containing edge information for localization tasks, regresses object boundaries, further disentangles the feature encodings of classification tasks and localization tasks, and improves the overall performance of the network.

4. The method for detecting surface defects of a low-voltage cable sheath according to any one of claims 1 to 3, characterized in that: The adaptive feature fusion decoupling head module AFFD performs deep and shallow adaptive feature fusion in front of the detection head through the feature pyramid structure, and then sends them to the head for corresponding decoding output. The classification task fuses the deeper features of the current layer to embed rich semantic features into the current layer. The regression task fuses the features of two adjacent levels to obtain rich spatial detail information.

5. The method for detecting surface defects of a low-voltage cable sheath according to claim 4, characterized in that: The adaptive feature fusion decoupling head module AFFD adds a fourth branch of the small target detection layer based on the YOLOv5 network structure to further improve the detection capability of small targets; The network structure corresponding to the decoupling head module AFFD of adaptive feature fusion includes Neck and AFFD Head; Neck adopts FPN, and FPN includes p1, p2, p3 and p4; among them, p1-p4 represent the features of different levels in the feature pyramid, and each feature has different spatial resolutions; AFFD Head includes AFFD-x-cls and AFFD-x-reg, which are set one-to-one with p1, p2, p3 and p4 in FPN; AFFD-x-cls and AFFD-x-reg represent the decoupling of classification and regression tasks for the features of the x-th layer, and the feature map obtained after adaptive feature fusion; Specifically, for the p2 layer features, AFFD-2-cls is used to receive the feature maps from AFFD-3-cls and perform weighted fusion by learning weight coefficients α and β; AFFD-2-reg is used to receive the feature maps from AFFD-1-reg and AFFD-3-reg and perform weighted fusion by learning weight coefficients α, β and γ.

6. The method for detecting surface defects of a low-voltage cable sheath according to claim 1, characterized in that: The specific method of obtaining the input image is as follows: The cable is guided to the shooting unit via the transmission device, and the shooting unit is equipped with a light source lighting device and a camera shooting unit for image acquisition and transmission; After image acquisition, it is transmitted to the back-end processing equipment via the network solution. The back-end processing equipment is equipped with a trained computer vision target detection algorithm to process and analyze the image, thereby identifying defects and displaying the analysis results.

7. A cable low-voltage sheath surface defect detection system, characterized in that: The system includes: The loss function design module is used to design a loss function based on the shape and scale of the bounding box according to the analysis of the small target defect detection task. It is used to train the cable low-voltage sheath defect detection model and improve the problem that the anchor-based detector is sensitive to small target defects in bounding box regression. The decoupling head design module is used to design the adaptive feature fusion decoupling head module AFFD according to the structure and optimization path of the cable low-voltage sheath defect detection model, further decouple the defect location and classification tasks, so that the defect detection model can learn suitable feature representations in different subtasks, and improve the efficiency and accuracy of the defect detection model; The modular processing module is used to design and train a modular cable low-voltage sheath defect detection model in combination with the loss function design module and the decoupling head design module. The input image is used for defect detection through the finally acquired cable low-voltage sheath detection model. Among them, defect detection includes two subtasks: defect location and defect classification.

8. The cable low-voltage sheath surface defect detection system according to claim 7 is characterized in that: The loss function design module includes: The weight coefficient setting submodule is used to set the weight coefficients in the horizontal and vertical directions respectively for the shape deviation of the GT true value box and the predicted bounding box. The formula is as follows: Among them, w mbr and h mbr Represents the width and height of the minimum bounding rectangle of the true value box and the predicted box respectively; and The coordinates of the upper left corner and lower right corner of the prediction box and the true value box respectively; The modeling submodule is used to model the bounding box as a two-dimensional Gaussian distribution and measure the similarity of the Gaussian distribution by using the normalized Wasserstein distance; among them, the Wasserstein distance can measure the distribution similarity even if there is no overlap or the overlap is negligible; specifically: Let the bounding box be B = (cx, cy, w, h). For two bounding boxes, the second-order Wasserstein distance is defined as: Use the normalized index to measure similarity: Among them, C is a constant determined by the data set, and C is set to the average absolute size of the target in the data set; the normalized Wasserstein distance with the shape scale factor added is: The normalized Wasserstein distance loss function based on the shape scale factor is: L NWD-shape =1-NWD(B a ,B b ); The adaptive feature fusion decoupling head module AFFD is used to generate spatially coarse feature codes with stronger semantic information for classification tasks, and provide high-resolution feature maps containing edge information for positioning tasks, regress object boundaries, further disentangle the feature codes of classification tasks and positioning tasks, and improve the overall performance of the network; the adaptive feature fusion decoupling head module AFFD adds a fourth branch of the small target detection layer based on the YOLOv5 network structure to further improve the detection capability of small targets; The network structure corresponding to the decoupling head module AFFD of adaptive feature fusion includes Neck and AFFD Head; Neck adopts FPN, and FPN includes p1, p2, p3 and p4; among them, p1-p4 represent the features of different levels in the feature pyramid, and each feature has different spatial resolutions; AFFD Head includes AFFD-x-cls and AFFD-x-reg, which are set one-to-one with p1, p2, p3 and p4 in FPN; among them, AFFD-x-cls and AFFD-x-reg represent the decoupling of classification and regression tasks for the features of the x-th layer, and the feature maps obtained after adaptive feature fusion.

9. An electronic device, characterized in that: include: memory and at least one processor; Wherein, the memory stores a computer program; The at least one processor executes the computer program stored in the memory, so that the at least one processor executes the cable low-voltage sheath surface defect detection method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which can be executed by a processor to implement the method for detecting surface defects of a low-voltage cable sheath as claimed in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Model training method and device

    CN111797711A

  • Wasserstein distance and difference measurement-combined chest radiograph anomaly recognition domain self-adaptive method and Wasserstein distance and difference measurement-combined chest radiograph anomaly recognition domain self-adaptive system

    CN115601535A

  • Marine small target aerial image recognition model training method in foggy day scene

    CN117893879A

  • Intelligent detection method and system for concrete highway pavement cracks

    CN118134912A

  • Generating geological facies models with fidelity to the diversity and statistics of training images using improved generative adversarial networks

    US20220335689A1