Cage stranding defect detection method and system

Through image acquisition and processing combined with enhanced SE attention mechanism, Soft-NMS and Focal-CIoU loss function, cage strand defect detection methods are solved, and real-time, safe and efficient cage stranded surface defect detection is achieved, which improves production efficiency and reduces costs.

CN120451745APending Publication Date: 2025-08-08INSPUR QILU SOFTWARE IND
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510638766.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-19
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the prior art, the detection of cage stranded surface defects relies on manual sampling efficiency and is prone to missed detection, the X-ray detection cost is high and there are radioactive hazards, so it is impossible to effectively identify subtle defects.

Method used

Image acquisition, image processing, introduction of enhanced SE attention mechanism, use Soft-NMS to screen prediction boxes and introduce Focal-CIoU loss function cage strand defect detection method, combined with coding wheel and industrial line array camera for image acquisition, dynamically adjust the shooting line frequency, and improve detection recall and accuracy.

Benefits of technology

Real-time, safe and efficient detection of cage-stranded surface defects is achieved, reducing false detection and missed detection, improving production efficiency and reducing costs, and detecting subtle defects that are difficult to observe in the human eye.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451745A_ABST
    Figure CN120451745A_ABST
Patent Text Reader

Abstract

The invention discloses a cage stranding defect detection method and system, and belongs to the technical field of computer vision, and the method comprises the following steps: collecting a defect data set generated in a cage stranding production process, and carrying out the image enhancement of the collected data set; marking pictures in the data set, and dividing the data set into a training set, a verification set and a test set in proportion; the method comprises the following steps: initializing Anchor frame parameters according to the characteristics of a cage stranding data set; an enhanced SE attention mechanism is introduced into the backbone network, feature map channels useful for the current task are improved, and feature channels useless for the current task are inhibited; screening a prediction frame by using a Soft-NMS (Non-Messaging Service); focal-CIoU is introduced, and contribution of a high-quality sample and a low-quality sample to loss is balanced through a regulatory factor alpha. According to the invention, the capability of detecting the surface defects of the cage stranding can be improved, and false detection and missing detection in the actual application process are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a cage defect detection method and system. Background Art

[0002] Medium-voltage cage-stranded cable production is a core process in power cable manufacturing, and its quality directly impacts the cable's long-term operational reliability, safety, and service life. Widely used in urban power grids, industrial distribution systems, and renewable energy grid integration, medium-voltage cables are critical infrastructure for power transmission. Therefore, improving the production quality of medium-voltage cage-stranded cables not only impacts production efficiency and costs, but also the reliability of urban power grids and industrial distribution systems.

[0003] Currently, most companies still rely on manual spot checks to detect surface defects in stranded wire. This method relies on operator experience and cannot monitor the production process in real time. Furthermore, dust in the workshop can affect visual judgment, easily leading to missed inspections. To address this, some companies use X-rays to penetrate conductors and observe internal structures through imaging technology. However, this method is expensive to use and maintain, and requires specialized operators. Workers are exposed to radiation hazards on-site for extended periods, requiring strict protective measures. Due to resolution limitations, this method cannot identify even subtle defects. Therefore, how to safely and efficiently detect stranded wire surface defects, thereby improving production efficiency and reducing costs, has become a pressing issue. Summary of the Invention

[0004] The technical task of the present invention is to provide a cage strand defect detection method and system, which can improve the ability to detect cage strand surface defects and reduce false detection and missed detection in actual application.

[0005] The technical solution adopted by the present invention to solve its technical problem is:

[0006] A method for detecting cage stranding defects, the implementation of which comprises the following steps:

[0007] S1. Image acquisition: Collect defect datasets generated during the cage stranding production process and perform image enhancement on the collected datasets;

[0008] S2. Image processing: Label the images in the dataset and divide the dataset into training set, validation set, and test set in proportion;

[0009] S3. Initialize parameters. Use the K-means clustering algorithm to initialize the anchor box parameters according to the characteristics of the caged dataset before training begins.

[0010] S4. Introducing the enhanced SE attention mechanism (ISENet) into the backbone network to enhance the feature map channels that are useful for the current task and suppress the feature channels that are not very useful for the current task;

[0011] S5. Use Soft-NMS instead of traditional NMS to filter prediction boxes;

[0012] S6. Introducing Focal-CIoU allows the model to focus more on high-quality samples during training, thereby accelerating convergence. By adjusting the factor α to balance the contribution of high-quality and low-quality samples to the loss, the model pays more attention to difficult samples during training, thereby improving the generalization ability of the model.

[0013] The backbone network adds the ISENet attention mechanism to enhance feature map channels that are useful for the current task and suppress feature channels that are less useful for the current task. Soft-NMS is introduced to avoid the problem of directly eliminating bounding boxes in NMS, thereby retaining more useful information and helping to improve the recall rate of detection. The Focal-CIOU loss function is introduced to accelerate convergence, making the model pay more attention to difficult samples during training and improving the model's generalization ability.

[0014] By adding the ISENet attention mechanism to the YOLOv5 backbone network and introducing Soft-NMS, we avoid the problem of directly eliminating bounding boxes in NMS, thereby retaining more useful information and helping to improve detection recall. Furthermore, by introducing Focal-CIOU technology, the added attention mechanism allows the model to focus more on key areas of the image, improving detection robustness and accuracy. Compared with the traditional YOLOv5 algorithm, both mAP@0.5 and mAP@.5:.95 are significantly improved, effectively reducing false detections and missed detections in actual operation.

[0015] Furthermore, the image acquisition method uses a combination of a coding wheel, an encoder, and an industrial linear array camera to reduce the impact of complex environments on image quality, improve safety and reliability, and solve the problem of difficult detection of tiny defects.

[0016] The cage stranding production line has multiple speed levels. If the same line frequency is used for acquisition at different speeds, the continuity and integrity of the image cannot be guaranteed, thus affecting the defect detection effect. At each speed, when the production line moves at a constant speed, the image acquisition method adopted by this method can dynamically adjust the shooting line frequency, thereby ensuring the continuity and integrity of the acquired image, and solving the impact of image distortion and faults caused by camera shake on defect detection.

[0017] Furthermore, the image processing is specifically implemented as follows:

[0018] S201: Use image scaling and adaptive scaling technologies to unify the size of images captured by the industrial line scan camera, and resize all images to 2048×2048 pixels.

[0019] S202: The images with uniform size adjusted in step S201 are annotated and divided into a training set, a validation set, and a test set in a ratio of 7:2:1.

[0020] Furthermore, the backbone network introduces an enhanced SE attention mechanism (ISENet), which is specifically implemented as follows:

[0021] S401, introduce the spatial information map, expand the receptive field of the larger feature map F' through the hollow convolution, highlight the area related to the target in the feature map, and enhance the spatial features of the effective information, and efficiently utilize the context information;

[0022] S402. Use dilated convolutions with receptive fields of 7×7 and 5×5 on the input large feature map F', use a 1×1 convolution layer to reduce the dimension, and add nonlinear features through the sigmoid function to obtain a feature map.

[0023] S403, the attention module generates a spatial attention feature map through a 3×3 convolution link, and uses the spatial information of the average pooling statistical feature map to obtain more semantic information.

[0024] Furthermore, the enhanced SE attention mechanism, i.e., ISENet, initializes the ISENet layer input according to the output of the previous layer C3;

[0025] S404. In order to adapt to the SPPF layer input, the ISENet layer output needs to be modified to have the same dimension as the SPPF layer input;

[0026] S405: Modify the input level of the neural network layer affected by ISENet in the detection head, which is greater than the 9th layer.

[0027] Furthermore, the use of Soft-NMS to filter the prediction box includes the following steps:

[0028] S501, as with traditional NMS, sort all detection boxes according to their scores;

[0029] S502: Select a detection frame with a high score as a reference frame;

[0030] S503: For each remaining detection box, the score is updated according to its IoU with the reference box, rather than directly overflowing. The score update is implemented by formula (1):

[0031] s = s × (1-IoU) (1);

[0032] Where s is the original score of the detection box, and IoU is the intersection over union (IoU) between the box and the reference box.

[0033] S504: Reorder the detection frames based on the updated scores, and select a detection frame according to the final score.

[0034] Furthermore, the introduction of Focal-CIoU adopts the Focal-CIoU loss function for yolov5:

[0035] L Focal-CIoU =(1-IoU) γ ·L CIoU (2);

[0036] Among them, γ is the Focal factor, which controls the weight attenuation of difficult and easy samples. The larger the value, the more the model pays attention to low IoU samples.

[0037] The present invention also claims protection for a cage stranding defect detection system, comprising:

[0038] Image acquisition module, used to collect defect data sets generated during the cage stranding production process and perform image enhancement on the collected data sets;

[0039] The image processing module is used to annotate the images in the dataset and divide the dataset into training set, validation set, and test set in proportion;

[0040] The initialization parameter module is used to use the K-means clustering algorithm to initialize the anchor box parameters according to the characteristics of the cage dataset before training begins;

[0041] Information acquisition module: an enhanced SE attention mechanism is introduced into the backbone network to obtain feature maps and spatial information;

[0042] Prediction box screening module, used to use Soft-NMS to screen prediction boxes:

[0043] The model training module introduces Focal-CIoU, which enables the model to focus more on high-quality samples during training, thereby accelerating convergence. By adjusting the factor α to balance the contribution of high-quality and low-quality samples to the loss, the model pays more attention to difficult samples during training, thereby improving the model's generalization ability.

[0044] The system realizes cage defect detection through the above method.

[0045] The present invention also claims protection for a cage stranding defect detection device comprising: at least one memory and at least one processor;

[0046] The at least one memory is configured to store a machine-readable program;

[0047] The at least one processor is configured to call the machine-readable program to implement the above method.

[0048] The present invention also claims protection for a computer-readable medium, characterized in that the computer-readable medium stores computer instructions, and when the computer instructions are executed by a processor, the above method is implemented.

[0049] Compared with the prior art, the cage defect detection method and system of the present invention have the following beneficial effects:

[0050] Based on Yolov5, this paper proposes a cage-stranded broken wire defect detection method with an enhanced attention mechanism. Compared to manual spot checks, this method enables real-time detection, resolving issues such as low manual inspection efficiency and high rates of missed and false detections. Compared to existing defect detection methods, this method is safe and reliable, and its 2K resolution can detect subtle defects that are difficult for the human eye to see. This addresses the pain points of difficult and costly detection in enterprises, improves production efficiency, and ultimately reduces costs and increases efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 is a flowchart of a method for detecting cage stranding defects provided by an embodiment of the present invention;

[0052] Figure 2 This is a comparison chart of the algorithm effects using the Focal-CIOU loss function and Soft-NMS provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0053] The present invention will be further described below with reference to specific embodiments.

[0054] The embodiment of the present invention provides a cage defect detection method. On the basis of the yolov5 detection method, by adding an attention mechanism, improving non-maximum suppression (NMS), loss function and other measures, the production efficiency and quality are improved. The cage defect detection method based on ISENet mainly includes six stages: image acquisition, image processing, initialization parameters, adding ISENet to the backbone network, improving NMS, and introducing Focal-CIOU loss function. By adding the ISENet attention mechanism to the backbone network in yolov5, the feature map channels that are useful for the current task are improved, and the feature channels that are not very useful for the current task are suppressed, and Soft-NMS is introduced to avoid the problem of directly eliminating the bounding box in NMS, thereby retaining more useful information, which helps to improve the recall rate of detection. The Focal-CIOU loss function is introduced to accelerate the convergence speed, so that the model pays more attention to difficult samples during training, and improves the generalization ability of the model.

[0055] like Figure 1 As shown, the implementation of this method includes the following steps:

[0056] S1. Image acquisition stage: Use an industrial line array camera to collect the defect dataset generated during the cage stranding production process, and perform image enhancement on the collected dataset.

[0057] This method uses a combination of a code wheel, an encoder, and an industrial line array camera for image acquisition. This reduces the impact of complex environments on image quality, improves safety and reliability, and solves the problem of difficult-to-detect tiny defects.

[0058] The cage stranding production line has multiple speed levels. If the same line frequency is used for acquisition at different speeds, the continuity and integrity of the image cannot be guaranteed, thus affecting the defect detection effect. At each speed, when the production line moves at a constant speed, the image acquisition method adopted by this method can dynamically adjust the shooting line frequency, thereby ensuring the continuity and integrity of the acquired image, and solving the impact of image distortion and faults caused by camera shake on defect detection.

[0059] S2, image processing stage: annotate the images in the dataset and divide the dataset into training set, validation set and test set in proportion. Specifically including:

[0060] S201: Use image scaling and adaptive scaling technologies to unify the size of images captured by the industrial line scan camera, and resize all images to 2048×2048 pixels.

[0061] S202: The images with uniform size adjusted in step S201 are annotated and divided into a training set, a validation set, and a test set in a ratio of 7:2:1.

[0062] S3. Initialize parameters. Use the K-means clustering algorithm to initialize the anchor box parameters according to the characteristics of the cage dataset before training begins.

[0063] S4: Introducing the enhanced SE attention mechanism (ISENet) into the backbone network to enhance the feature map channels that are useful for the current task and suppress the feature channels that are not very useful for the current task. Specifically:

[0064] S401, introduce the spatial information map, expand the receptive field of the larger feature map F' through the hollow convolution, highlight the area related to the target in the feature map, and enhance the spatial features of the effective information, and efficiently utilize the context information;

[0065] S402. Use dilated convolutions with receptive fields of 7×7 and 5×5 on the input large feature map F', use a 1×1 convolution layer to reduce the dimension, and add nonlinear features through the sigmoid function to obtain a feature map.

[0066] S403, the attention module generates a spatial attention feature map through a 3×3 convolution link, and uses the spatial information of the average pooling statistical feature map to obtain more semantic information.

[0067] S5. Use Soft-NMS instead of traditional NMS to filter prediction boxes:

[0068] S501, as with traditional NMS, sort all detection boxes according to their scores;

[0069] S502: Select a detection frame with a high score as a reference frame;

[0070] S503: For each remaining detection box, the score is updated according to its IoU with the reference box, rather than directly overflowing. The score update is implemented by formula (1):

[0071] s = s × (1-IoU) (1);

[0072] Where s is the original score of the detection box, and IoU is the intersection over union (IoU) between the box and the reference box.

[0073] S504: Reorder the detection frames based on the updated scores, and select a detection frame according to the final score.

[0074] S6. Introducing Focal-CIoU allows the model to focus more on high-quality samples during training, thereby accelerating convergence. By adjusting the factor α to balance the contribution of high-quality and low-quality samples to the loss, the model pays more attention to difficult samples during training, thereby improving the generalization ability of the model.

[0075] To further illustrate the implementation of this method in detail, the implementation process of this method is further explained below with reference to specific cases.

[0076] This case study consists of a network structure consisting of equipment equipped with linear scan cameras, encoder wheels, and encoders. The movement of the cage stranding production line drives the encoder wheels, which in turn triggers the encoders to capture images from the linear scan cameras. Unlike area scan cameras, linear scan cameras utilize a line-by-line imaging principle, enabling them to capture the entire cage stranding production line without duplication or omission, accurately locating defects.

[0077] The specific implementation steps of this case are as follows:

[0078] Step 1: Image Acquisition: In this case, the cage stranding production line moves at a speed of 30 m / min, driving the encoder wheel. The rear encoder rotates with the encoder wheel, triggering the line array camera to capture images of the cage stranding. The captured defect images are collected and image enhancement is performed on the captured dataset.

[0079] Step 2: Image processing: Label the images in the dataset and divide the dataset into training set, validation set, and test set in proportion.

[0080] Step 201: The images captured by the industrial line scan camera are resized using image scaling technology and adaptive scaling technology to adjust the size of all images to 2048×2048 pixels;

[0081] Step 202: Use labelImg to label the images with the same size after adjustment in step S201, and divide them into training set, validation set, and test set in a ratio of 7:2:1.

[0082] Step 3: Initialize the parameters. Use K-means clustering to initialize the anchor box parameters according to the characteristics of the cage dataset before training begins.

[0083] Step 4: In the backbone network, an enhanced SE attention mechanism (ISENet) is introduced before the SPPF network to enhance the feature map channels that are useful for the current task and suppress the feature channels that are not very useful for the current task.

[0084] Step 401: Initialize the ISENet layer input according to the output of the previous layer C3;

[0085] Step 402: Add the ISENet class, apply dilated convolutions with receptive fields of 7×7 and 5×5 on the input feature map F', use a 1×1 convolution layer to reduce the dimensionality, and add nonlinear features through the sigmoid function to obtain the feature map.

[0086] Step 403: The attention module generates a spatial attention feature map through a 3×3 convolution link, and uses the spatial information of the average pooling statistical feature map to obtain more semantic information;

[0087] Step 404: To adapt to the SPPF layer input, the ISENet layer output needs to be modified to have the same dimension as the SPPF layer input;

[0088] Step 405: Modify the input levels of the neural network layers in the detection head that are greater than the 9th layer and are influenced by ISENet.

[0089] Step 5: Use Soft-NMS instead of traditional NMS to filter the prediction box:

[0090] Step 501: As with traditional NMS, all detection boxes are sorted according to their scores;

[0091] Step 502: Select the detection frame with the highest score as the reference frame;

[0092] Step 503: For each remaining detection box, update the score based on its IoU with the reference box instead of directly overflowing. The score update is obtained by formula (1);

[0093] Step 504: Re-order the detection frames based on the updated scores, and select a detection frame based on the final score.

[0094] Step 6: Introduce Focal-CioU. The CIOU currently used for yolov5 is:

[0095]

[0096] Among them, IoU is the intersection-over-union ratio of the predicted box and the real box, ρ(b,b gt ) represents the Euclidean distance between the center point of the predicted box and the true box, c represents the diagonal length of the minimum closed area surrounding the predicted box and the true box, α is the balance parameter, and v is the parameter for the consistency of the star aspect ratio. It is modified as follows:

[0097] L Focal-CIoU =(1-IoU) γ ·L CIoU (2);

[0098] Among them, γ is the Focal factor, which controls the weight attenuation of difficult and easy samples. The larger the value, the more the model pays attention to low IoU samples.

[0099] Step 7: Model training. This example uses an i7-11700K processor and a 3080Ti graphics card running on Ubuntu. All networks are implemented using PyTorch, with a batch size of 64 and an initial learning rate of 0.01. Training is performed using the processed data set collected from the actual cage stranding production line in Step 2.

[0100] The test results are as follows Figure 2 The figures shown here are Yolov5 without the SE attention mechanism, using the CIOU loss function and traditional NMS, and Yolov5 with the ISENet attention mechanism of our method, using the Focal-CIOU loss function and Soft-NMS. As can be seen, our ISENet method, with its Focal-CIOU and improved NMS, achieves significant improvements in both mAP@0.5 and mAP@.5:.95, effectively reducing false positives and missed detections in actual tests.

[0101] An embodiment of the present invention further provides a cage defect detection system, which implements cage defect detection through the cage defect detection method described in the above embodiment.

[0102] The system includes:

[0103] 1. Image acquisition module, used to collect defect data sets generated during the cage stranding production process and perform image enhancement on the collected data sets.

[0104] Image acquisition is performed by combining a code wheel, an encoder, and an industrial line array camera. This reduces the impact of complex environments on image quality, improves safety and reliability, and solves the problem of difficult-to-detect tiny defects.

[0105] The cage stranding production line has multiple speed levels. If the same line frequency is used for acquisition at different speeds, the continuity and integrity of the image cannot be guaranteed, thus affecting the defect detection effect. At each speed, when the production line moves at a constant speed, the image acquisition method adopted by this method can dynamically adjust the shooting line frequency, thereby ensuring the continuity and integrity of the acquired image, and solving the impact of image distortion and faults caused by camera shake on defect detection.

[0106] 2. Image processing module, used to annotate the images in the dataset and divide the dataset into training set, validation set and test set in proportion.

[0107] (201) The images captured by the industrial line array camera were resized using image scaling technology and adaptive scaling technology, and all images were resized to 2048×2048 pixels;

[0108] (202) The images with uniform size adjusted in step (201) are annotated and divided into a training set, a validation set, and a test set according to a ratio of 7:2:1.

[0109] 3. Initialization parameter module, used to use K-means clustering algorithm to initialize the anchor box parameters according to the characteristics of the cage dataset before training begins.

[0110] 4. Information acquisition module: The enhanced SE attention mechanism (ISENet) is introduced into the backbone network to enhance the feature map channels that are useful for the current task and suppress the feature channels that are not very useful for the current task.

[0111] (401) Introducing the spatial information map, the receptive field of the larger feature map F' is expanded through the dilated convolution, highlighting the target-related area in the feature map, and improving the spatial features of the effective information, making efficient use of the context information; initializing the input of the ISENet layer according to the output of the previous layer C3;

[0112] (402) Using dilated convolutions with receptive field sizes of 7×7 and 5×5 on the input large feature map F', using a 1×1 convolution layer to reduce the dimension, and adding nonlinear features through the sigmoid function to obtain the feature map;

[0113] (403) The attention module generates a spatial attention feature map through 3×3 convolution links and uses the spatial information of the average pooling statistical feature map to obtain more semantic information.

[0114] (404) In order to adapt to the SPPF layer input, the ISENet layer output needs to be modified to have the same dimension as the SPPF layer input;

[0115] (405) Modify the input level of the neural network layer influenced by ISENet in the detection head, which is greater than the 9th layer.

[0116] 5. Prediction box screening module, used to use Soft-NMS to screen prediction boxes:

[0117] (501) As with traditional NMS, all detection boxes are sorted according to their scores;

[0118] (502) Selecting a detection frame with a high score as a reference frame;

[0119] (503) For each remaining detection box, the score is updated according to its IoU with the reference box, rather than directly overflowing. The score update is achieved by formula (1):

[0120] s = s × (1-IoU) (1);

[0121] Where s is the original score of the detection box, and IoU is the intersection over union (IoU) between the box and the reference box.

[0122] (504) Re-rank the detection frames based on the updated scores and select a detection frame based on the final score.

[0123] 6. The model training module introduces Focal-CIoU, which enables the model to focus more on high-quality samples during training, thereby accelerating convergence. By adjusting the factor α to balance the contribution of high-quality and low-quality samples to the loss, the model pays more attention to difficult samples during training, thereby improving the model's generalization ability.

[0124] The CIOU currently used for yolov5 is:

[0125]

[0126] Among them, IoU is the intersection-over-union ratio of the predicted box and the real box, ρ(b,b gt ) represents the Euclidean distance between the center point of the predicted box and the true box, c represents the diagonal length of the minimum closed area surrounding the predicted box and the true box, α is the balance parameter, and v is the parameter for the consistency of the star aspect ratio. It is modified as follows:

[0127] L Focal-CIoU =(1-IoU) γ ·LCIoU (2);

[0128] Among them, γ is the Focal factor, which controls the weight attenuation of difficult and easy samples. The larger the value, the more the model pays attention to low IoU samples.

[0129] Model training: This model runs on an Ubuntu system with an i7-11700K processor and a 3080Ti graphics card. All networks are implemented using PyTorch, with a batch size of 64 and an initial learning rate of 0.01. Training is performed using data processed by the image processing module using a dataset collected from a real production line.

[0130] The backbone network of this system adds the ISENet attention mechanism to enhance the feature map channels that are useful for the current task and suppress the feature channels that are less useful for the current task. Soft-NMS is introduced to avoid the problem of directly eliminating the bounding box in NMS, thereby retaining more useful information and helping to improve the recall rate of detection. The Focal-CIOU loss function is introduced to accelerate the convergence speed, so that the model pays more attention to difficult samples during training and improves the generalization ability of the model.

[0131] By adding the ISENet attention mechanism to the YOLOv5 backbone network and introducing Soft-NMS, we avoid the problem of directly eliminating bounding boxes in NMS, thereby retaining more useful information and helping to improve detection recall. Furthermore, by introducing Focal-CIOU technology, the added attention mechanism allows the model to focus more on key areas of the image, improving detection robustness and accuracy. Compared with the traditional YOLOv5 algorithm, both mAP@0.5 and mAP@.5:.95 are significantly improved, effectively reducing false detections and missed detections in actual operation.

[0132] An embodiment of the present invention further provides a cage stranding defect detection device, comprising: at least one memory and at least one processor;

[0133] The at least one memory is configured to store a machine-readable program;

[0134] The at least one processor is used to call the machine-readable program to implement the cage stranding defect detection method described in the above embodiment.

[0135] Embodiments of the present invention further provide a computer-readable medium having computer instructions stored thereon. When executed by a processor, the computer instructions cause the processor to perform the cage stranding defect detection method described in the above embodiments. Specifically, a system or device may be provided that includes a storage medium storing software program code that implements the functions of any of the above embodiments, and that causes a computer (or CPU or MPU) of the system or device to read and execute the program code stored in the storage medium.

[0136] 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 part of the present invention.

[0137] Examples of storage media for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code can be downloaded from a server computer via a communication network.

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

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

[0140] The present invention has been shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the code review methods in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the scope of protection of the present invention.

Claims

1. A method for detecting cage stranding defects, characterized in that: The implementation of this method includes the following steps: S1. Image acquisition: Collect defect datasets generated during the cage stranding production process and perform image enhancement on the collected datasets; S2. Image processing: Label the images in the dataset and divide the dataset into training set, validation set, and test set in proportion; S3. Initialize parameters. Use the clustering algorithm to initialize the anchor box parameters according to the characteristics of the cage dataset before training begins. S4: An enhanced SE attention mechanism is introduced into the backbone network to enhance the feature map channels that are useful for the current task and suppress the feature channels that are useless for the current task; S5. Use Soft-NMS to filter the prediction box; S6. Focal-CIoU is introduced to balance the contribution of high-quality and low-quality samples to the loss by adjusting the factor α, so that the model pays more attention to difficult samples during training to improve the generalization ability of the model.

2. A method for detecting cage stranding defects according to claim 1, characterized in that: The image acquisition is performed by combining a coding wheel, an encoder, and an industrial linear array camera.

3. A method for detecting cage stranding defects according to claim 1 or 2, characterized in that: The image processing is specifically implemented as follows: S201: Use image scaling and adaptive scaling technologies to resize images captured by industrial line scan cameras to 2048×2048 pixels. S202: The images with uniform size adjusted in step S201 are annotated and divided into a training set, a validation set, and a test set in a ratio of 7:2:

1.

4. A method for detecting cage stranding defects according to claim 1, characterized in that: The enhanced SE attention mechanism is introduced into the backbone network, and its specific implementation includes: S401, introduce the spatial information map, expand the receptive field of the large feature map F' through the hollow convolution, highlight the area related to the target in the feature map, and enhance the spatial characteristics of the effective information; S402. Use dilated convolutions with receptive fields of 7×7 and 5×5 on the input large feature map F', use a 1×1 convolution layer to reduce the dimension, and add nonlinear features through the sigmoid function to obtain a feature map. S403, the attention module generates a spatial attention feature map through a 3×3 convolution link, and uses the spatial information of the average pooling statistical feature map to obtain semantic information.

5. A method for detecting cage stranding defects according to claim 4, characterized in that: The enhanced SE attention mechanism, i.e. ISENet, initializes the ISENet layer input according to the output of the previous layer C3; S404, modify the ISENet layer output to be the same as the SPPF layer input dimension; S405. Modify the input level of the neural network layer affected by ISENet that is greater than the 9th layer in the detection head.

6. The method for detecting cage stranding defects according to claim 1, wherein: The specific implementation of using Soft-NMS to filter the prediction box includes the following steps: S501, sort all detection frames according to scores; S502: Select a detection frame with a high score as a reference frame; S503: For each remaining detection box, update the score according to its IoU with the reference box. The score update is achieved by formula (1): s = s × (1-IoU) (1); Where s is the original score of the detection box, and IoU is the intersection over union (IoU) between the box and the reference box. S504: Reorder the detection frames based on the updated scores, and select a detection frame according to the final score.

7. The method for detecting cage stranding defects according to claim 1, wherein: The introduction of Focal-CIoU adopts the Focal-CIoU loss function for yolov5: L Focal-CIoU =(1-IoU) γ ·L CIoU (2); Among them, γ is the Focal factor, which controls the weight attenuation of difficult and easy samples. The larger the value, the more the model pays attention to low IoU samples.

8. A cage defect detection system, characterized in that: include: Image acquisition module, used to collect defect data sets generated during the cage stranding production process and perform image enhancement on the collected data sets; The image processing module is used to annotate the images in the dataset and divide the dataset into training set, validation set, and test set in proportion; The initialization parameter module is used to use the clustering algorithm to initialize the anchor box parameters according to the characteristics of the cage dataset before training begins; Information acquisition module: an enhanced SE attention mechanism is introduced into the backbone network to obtain feature maps and spatial information; Prediction box screening module, used to use Soft-NMS to screen prediction boxes: The model training module introduces Focal-CIoU, which balances the contribution of high-quality and low-quality samples to the loss by adjusting the factor α. This allows the model to focus more on difficult samples during training, thereby improving the model's generalization ability. The system realizes cage stranding defect detection by the method described in any one of claims 1 to 7.

9. A cage defect detection device, characterized in that: include: at least one memory and at least one processor; The at least one memory is configured to store a machine-readable program; The at least one processor is configured to call the machine-readable program to implement the method according to any one of claims 1 to 7.

10. A computer-readable medium, characterized in that The computer-readable medium stores computer instructions, which, when executed by a processor, implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method for extracting building change area in double-time-phase remote sensing image based on twinborn mixed attention mechanism and multi-scale feature fusion

    CN118212532A

  • Cage stranding broken wire defect identification method and system based on artificial intelligence

    CN118279253A

  • Wheat stripe rust image detection method based on W-YOLOv5 model

    CN118609119A

  • Production line aluminum alloy ingot surface defect detection method, device and system and storage medium

    CN119671975A

  • Method and device for constructing neural network

    WO2022007867A1