Insulator defect detection method and device based on improved Yolov8m

By introducing coordinate attention mechanism and feature channel shuffling operation in YOLOv8m, a CACS-YOLO model was constructed, which solved the problem of insufficient detection accuracy and real-time performance in insulator defect detection, and achieved high-precision and efficient detection effects.

CN119418040APending Publication Date: 2025-02-11GUANGDONG POWER GRID CO LTD DONGGUAN POWER SUPPLY BUREAU
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411645041.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

The prior art faces the dual challenges of detection of insulator defects, and the YOLO algorithm has poor detection results under complex backgrounds and variable weather conditions.

Method used

In YOLOv8m, the coordinate attention mechanism (CAM) and feature channel shuffling operation (CSO) are introduced to build a CACS-YOLO model to enhance the fusion ability of low-level detail features and high-level positioning features.

Benefits of technology

It improves the accuracy and real-time performance of insulator defect detection, achieves high-precision detection results, and maintains good generalization capabilities under variable weather conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119418040A_ABST
    Figure CN119418040A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of defect detection, and discloses an insulator defect detection method and device based on improved Yolov8m, and the method comprises the following steps: processing and dividing an insulator detection data set; a coordinate attention mechanism and a feature channel shuffling operation are added in the Yolov8m, and an insulator defect detection model for improving the Yolov8m is established; training the improved model by using the training set to obtain a target detection model; and inputting a test set sample into the target detection model for defect detection, and evaluating a result. A lightweight insulator defect detection model is constructed, a coordinate attention mechanism (CAM) and a YOLO of a feature channel shuffling operation (CSO) are added, redundant information is reduced, meanwhile, low-layer detail features and high-layer positioning features are fully enhanced, fusion of deep information and shallow information is achieved, and the accuracy of target detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of defect detection, and in particular to an insulator defect detection method and device based on improved Yolov8m. Background Art

[0002] Insulator defects in transmission lines threaten the safe and stable operation of power systems. Therefore, insulator defect detection plays a vital role in the power sector. Currently, the YOLO algorithm is widely used in insulator fault detection. However, insulator defect detection using YOLO still faces the dual challenges of detection accuracy and real-time performance. Therefore, it is necessary to improve the existing technology.

[0003] The above information is presented as background information only to assist with understanding the present disclosure and no determination or admission is made as to whether any of the above may be used as prior art with respect to the present disclosure. Summary of the invention

[0004] The present invention provides an insulator defect detection method and device based on improved Yolov8m to solve the problems existing in the prior art.

[0005] To achieve the above object, the present invention provides the following technical solutions:

[0006] An insulator defect detection method based on improved Yolov8m comprises the following steps:

[0007] Process and divide the insulator inspection data set;

[0008] By adding coordinate attention mechanism and feature channel shuffling operation in Yolov8m, an improved Yolov8m insulator defect detection model is established;

[0009] The improved model is trained using the training set to obtain a target detection model;

[0010] The test set samples are input into the target detection model for defect detection, and the results are evaluated.

[0011] Optionally, the processing and dividing the insulator detection data set includes:

[0012] The insulator detection dataset is standardized and normalized.

[0013] Optionally, the processing and dividing the insulator detection data set includes:

[0014] Divide the dataset into training and testing sets.

[0015] Optionally, the ratio of the training set to the test set is 7:3.

[0016] Optionally,

[0017] The improved Yolov8m model includes improved feature extraction, fusion and prediction related structures;

[0018] The insulator defect detection model of improved Yolov8m is established by adding a coordinate attention mechanism and a feature channel shuffling operation in Yolov8m, including:

[0019] Based on Yolov8m, a coordinate attention mechanism based on feature reuse and feature channel shuffling operations is added to build a CACS-YOLO model including feature extraction layer, feature fusion layer and prediction layer, and the C2f_2 module is improved to the C2f_1 module.

[0020] Optionally, the feature extraction layer is used to perform multi-layer convolution feature extraction on the preprocessed image to form a feature map;

[0021] The feature fusion layer consists of FPN structure and PAN structure, which is used to realize the fusion of deep and shallow information;

[0022] The prediction layer is used to make multi-scale predictions for feature maps of different sizes;

[0023] The C2f_1 module is an improved module based on C2f_2, which adds CAM based on feature reuse and feature CSO.

[0024] Optionally, the step of training the improved model using the training set to obtain the target detection model includes:

[0025] The training model uses the Adam optimization algorithm and the learning rate decay strategy. The training is stopped when the model loss value no longer decreases for a specific number of consecutive epochs.

[0026] Optionally, the learning rate is initialized to a specific value, and after a specific number of epochs the learning rate decays to a specific ratio of the original value.

[0027] Optionally, the specific value is 0.001, the specific number of lawsuits is 10, the specific ratio is 0.9, and the specific number of times is 5.

[0028] The present invention also provides an insulator defect detection device based on improved Yolov8m, which is used to implement the insulator defect detection method based on improved Yolov8m as described in any one of the above items, including:

[0029] A data processing and partitioning module is used to process and partition the insulator detection data set;

[0030] Model building module, by adding coordinate attention mechanism and feature channel shuffling operation in Yolov8m, an improved insulator defect detection model of Yolov8m is established;

[0031] A model training module is used to train the improved model using the training set to obtain a target detection model;

[0032] The detection and evaluation module is used to input the test set samples into the target detection model for defect detection and evaluate the results. Compared with the prior art, the present invention has the following beneficial effects:

[0033] The present invention provides an insulator defect detection method and device based on improved Yolov8m, constructs a lightweight insulator defect detection model, adds YOLO with coordinate attention mechanism (CAM) and feature channel shuffling operation (CSO), and fully enhances low-level detail features and high-level positioning features while reducing redundant information, realizes the fusion of deep information and shallow information, and improves the accuracy of target detection.

[0034] The present invention has other features and advantages, which will be apparent from or will be described in detail in the accompanying drawings and the following detailed description incorporated herein, which together serve to explain the specific principles of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] 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.

[0036] Figure 1 It is a flow chart of an insulator defect detection method based on improved Yolov8m provided by the present invention;

[0037] Figure 2 It is a CACS-YOLO model architecture diagram in an insulator defect detection method based on improved Yolov8m provided by the present invention;

[0038] Figure 3 It is a schematic diagram of the CAM structure in the insulator defect detection method based on the improved Yolov8m provided by the present invention;

[0039] Figure 4It is a schematic diagram of a CAM structure in which bottleneck is introduced into an insulator defect detection method based on improved Yolov8m provided by the present invention;

[0040] Figure 5 It is a schematic diagram of semi-characteristic channel processing in an insulator defect detection method based on improved Yolov8m provided by the present invention;

[0041] Figure 6 It is the number of channels of the feature graph at different feature extraction times in the insulator defect detection method based on improved Yolov8m provided by the present invention;

[0042] Figure 7 It is an effect diagram of a new bottleneck layer in an insulator defect detection method based on improved Yolov8m provided by the present invention;

[0043] Figure 8 It is a confusion matrix of CACS-YOLO on SFRID in an insulator defect detection method based on improved Yolov8m provided by the present invention;

[0044] Fig. 9 It is the prediction result of the trained CACS-YOLO model in the insulator defect detection method based on the improved Yolov8m provided by the present invention under different weather conditions;

[0045] Fig.10 It is a structural block diagram of an insulator defect detection device based on improved Yolov8m provided by the present invention.

[0046] Figure numerals: 10, data processing and division module; 20, model building module; 30, model training module; 40, detection and evaluation module. DETAILED DESCRIPTION

[0047] In order to explain in detail the possible application scenarios, technical principles, specific schemes that can be implemented, and the purposes and effects that can be achieved, the following is a detailed description of the specific embodiments listed in conjunction with the accompanying drawings. The embodiments described herein are only used to more clearly illustrate the technical solutions of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.

[0048] Reference to "embodiment" herein means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. The term "embodiment" appearing in various places in the specification does not necessarily refer to the same embodiment, nor does it particularly limit its independence or association with other embodiments. In principle, in the present application, as long as there is no technical contradiction or conflict, the various technical features mentioned in the embodiments can be combined in any way to form a corresponding implementable technical solution.

[0049] Unless otherwise defined, the technical terms used in this document have the same meanings as those generally understood by those skilled in the art to which this application belongs; the use of relevant terms in this document is only for describing specific embodiments and is not intended to limit this application.

[0050] In the description of this application, the term "and / or" is an expression used to describe the logical relationship between objects, indicating that three relationships may exist, for example, A and / or B, which means: A exists, B exists, and A and B exist at the same time. In addition, the character " / " in this article generally indicates that the objects before and after are in an "or" logical relationship.

[0051] In the present application, terms such as “first” and “second” are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship of quantity, priority or sequence between these entities or operations.

[0052] Without further limitations, in this application, the words "include", "comprises", "has" or other similar expressions used in the sentences are intended to cover non-exclusive inclusion. These expressions do not exclude the presence of additional elements in the process, method or product including the elements, so that the process, method or product including a series of elements may include not only those limited elements, but also other elements not explicitly listed, or also include elements inherent to such process, method or product.

[0053] Similar to the understanding in the Examination Guidelines, in this application, expressions such as "greater than", "less than", "exceed" and the like are understood to exclude the number itself; expressions such as "above", "below", "within" and the like are understood to include the number itself. In addition, in the description of the embodiments of this application, "multiple" means more than two (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups", "multiple times", etc., unless otherwise clearly and specifically limited.

[0054] In the description of the embodiments of the present application, space-related expressions used, such as "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "vertical", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicate the orientation or position relationship based on the orientation or position relationship shown in the specific embodiments or drawings, and are only for the convenience of describing the specific embodiments of the present application or facilitating the reader's understanding, and do not indicate or imply that the referred device or component must have a specific position, a specific orientation, or be constructed or operated in a specific orientation, and therefore cannot be understood as a limitation on the embodiments of the present application.

[0055] Unless otherwise expressly specified or limited, in the description of the embodiments of the present application, the terms such as "install", "connect", "connect", "fix", "set", etc. used should be understood in a broad sense. For example, the "connection" can be a fixed connection, a detachable connection, or an integrated setting; it can be a mechanical connection, an electrical connection, or a communication connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. For technicians in the technical field to which the present application belongs, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.

[0056] Insulator defects in transmission lines threaten the safe and stable operation of power systems. Therefore, insulator defect detection plays a vital role in the power sector. At present, the YOLO algorithm is widely used in insulator fault detection. However, insulator defect detection using YOLO still faces the dual challenges of detection accuracy and real-time performance. Therefore, the present invention constructs a lightweight insulator defect detection model, namely, YOLO with coordinate attention mechanism (CAM) and feature channel shuffle operation (CSO), called CACS-YOLO.

[0057] Embodiment 1

[0058] Please refer to Figure 1 The embodiment of the present invention provides an insulator defect detection method based on improved Yolov8m, comprising the following steps:

[0059] S1. Process and divide the insulator detection data set;

[0060] In this embodiment, the processing and dividing of the insulator detection data set includes:

[0061] The insulator detection dataset is standardized and normalized, and the dataset is divided into a training set and a test set, where the ratio of the training set to the test set is 7:3.

[0062] S2. By adding coordinate attention mechanism and feature channel shuffling operation in Yolov8m, an improved Yolov8m insulator defect detection model is established;

[0063] Wherein, the improved Yolov8m model includes structures related to improved feature extraction, fusion and prediction;

[0064] The insulator defect detection model of improved Yolov8m is established by adding a coordinate attention mechanism and a feature channel shuffling operation in Yolov8m, including:

[0065] Based on Yolov8m, a coordinate attention mechanism based on feature reuse and feature channel shuffling operations is added to build a CACS-YOLO model including feature extraction layer, feature fusion layer and prediction layer, and the C2f_2 module is improved to the C2f_1 module.

[0066] In this embodiment, the feature extraction layer is used to perform multi-layer convolution feature extraction on the preprocessed image to form a feature map;

[0067] The feature fusion layer consists of FPN structure and PAN structure, which is used to realize the fusion of deep and shallow information;

[0068] The prediction layer is used to make multi-scale predictions for feature maps of different sizes;

[0069] The C2f_1 module is an improved module based on C2f_2, which adds CAM based on feature reuse and feature CSO.

[0070] The insulator defect detection model is introduced in detail below.

[0071] In the actual context of insulator detection, the presence of small defect targets and challenging environmental conditions, such as rainy or foggy days, emphasize the necessity of enhancing low-level detail features. This is crucial to accurately distinguish similar features and ensure effective detection in complex scenes. It is also important to enhance high-level positioning features to emphasize the edges of insulators against complex backgrounds. In addition, information redundancy in the detection process will weaken the detection performance. Therefore, this embodiment adds CAM based on feature reuse and feature CSO on the basis of YOLOv8m. This introduction fully enhances low-level detail features and high-level positioning features while reducing redundant information. As a result, an improved insulator detection model called CACS-YOLO was developed, as shown in Figure 2. Figure 2 The following is the CACS-YOLO model architecture diagram.

[0072] CACS-YOLO model architecture:

[0073] The CACS-YOLO model architecture consists of three parts: feature extraction layer, feature fusion layer and prediction layer. The feature extraction layer performs multi-layer convolution feature extraction on the preprocessed image to form a feature map. The feature fusion layer consists of an FPN structure and a path aggregation network (PAN) structure. The combination of FPN and PAN can achieve the fusion of deep information and shallow information, improving the accuracy of target detection. The prediction layer is designed as feature maps of three sizes, and multi-scale prediction is performed for objects of different sizes.

[0074] The basic modules of CACS-YOLO are:

[0075] ConvBNSiLU is the basic module of CACS-YOLO, which consists of a convolutional layer, a batch normalization layer, and a SiLU activation function. represents the size of the convolution kernel, represents the step size of the convolution kernel, represents the padding of the convolution, Indicates the number of output channels after this layer structure. C2f_1 is an improved module based on C2f_2 with the addition of CAM based on feature reuse and feature CSO. C2f_2 is the feature fusion module of the original YOLOv8. In addition, C2f_1 is added to the residual structure that C2f_2 does not have.

[0076] CAM based on feature reuse:

[0077] During the insulator inspection process of transmission lines, due to the shooting angle of drones, the background of insulator images is usually complex, mainly including the sky, city, grass, trees, lakes, etc. In addition, the climatic conditions (thick fog and rain) during drone shooting also increase the complexity of the insulator image background. This is more common when the insulator target is surrounded by a complex background, which makes target recognition difficult and increases the possibility of missed detection. Introducing an attention mechanism in insulator fault detection can focus on the important features of the insulator and suppress or ignore other irrelevant feature information in the background, thereby improving the accuracy of insulator fault detection.

[0078] CAM not only considers the channel information, but also the position information related to the direction, which is suitable for insulator detection under complex backgrounds, such as Figure 3 The figure shows a schematic diagram of the CAM structure.

[0079] The principle is to decompose the global average pooling, and the expression is as follows:

[0080] (1)

[0081]

[0082] The input feature map is of dimension C×H×W Pooling is performed in the H direction and the W direction to generate feature maps of dimensions C×H×1 and C×1×W respectively.

[0083] The generated C×1×W feature map is transformed and then concatenated. The formula is as follows:

[0084] (3)

[0085] Where: is a fully connected layer, δ is the rectified linear unit (ReLU) activation function, .

[0086] In the spatial dimension, the split operation Split into and , and then use 1×1 convolution to perform dimensionality increase operations, and then combine the sigmoid activation function to obtain the final attention vector and .

[0087]

[0088]

[0089] in, and are two 1×1 convolution transformations, and σ represents the sigmoid activation function.

[0090] Finally, the output formula of CAM can be written as follows:

[0091] (6)

[0092] The use of the attention mechanism enhances important features while suppressing noise features. However, since the attention mechanism only focuses on localized information, this is not enough for insulator detection, which requires attention to both low-level details and high-level positioning information. Moreover, when the attention mechanism uses the learned attention weights to weight features, it is easy to filter out some features that are originally useful but small in scale. Therefore, a feature reuse strategy is needed to make up for the drawbacks of the attention mechanism. Regarding the specific measures for feature reuse, this embodiment puts CAM into the bottleneck of C2f_1, such as Figure 4 As shown, it is a schematic diagram of the CAM structure with bottleneck introduced.

[0093] The principle is as follows:

[0094]

[0095] in It represents the bottleneck layer after the introduction of CAM. represents the input feature map, Represents a module consisting of an integration of a 1×1 convolution, a 3×3 convolution and a CAM.

[0096] The residual branch of the bottleneck layer converts the original input feature map With feature map The fusion is then processed by feature extraction. This fusion ensures that the output structure retains the unprocessed pre-processed features and promotes feature reuse. This design helps prevent the attention mechanism from filtering out valuable features when applying the learned attention weights.

[0097] Feature CSO consists of two parts: semi-feature channel processing and CSO. Although feature reuse is achieved using the residual branching method, the stacking of modules after the bottleneck is introduced by CAM leads to information redundancy. This redundancy affects the detection performance of the model, making it insufficient to rely solely on the residual structure to support feature reuse. Therefore, it is necessary to propose an idea for a feature reuse strategy to further weaken information redundancy. In this regard, this embodiment proposes a semi-feature channel processing method, which corresponds to the channel splitting in the CACS-YOLO architecture. The specific principles of this method are as follows:

[0098]

[0099]

[0100] (10)

[0101]

[0102] in represents a feature map with c channels, express The nth channel in the feature map, represents the bottleneck layer for half feature channel processing, Represents a module consisting of an integration of a 1×1 convolution, a 3×3 convolution, and a CAM.

[0103] The concept of half-feature channel processing is to use only half of the feature channels for feature extraction. This reduces the number of model parameters and computational complexity while retaining the features before processing, achieving the effect of feature reuse. However, it is worth noting that this method also leads to the problem of blocked channel interaction, such as Figure 5 As shown, it is a schematic diagram of semi-feature channel processing. It can be understood that this will affect the detection performance of the model.

[0104] Based on the research on semi-feature channel processing, as an example, this embodiment counts the number of channels of a feature map with 512 channels at different feature extraction times through a six-layer bottleneck, such as Figure 6 As shown, Figure 6 (a) is the number of channels for feature extraction before improvement; Figure 6 (b) is the number of channels for feature extraction after improvement.

[0105] from Figure 6 (a) It can be seen that the number of channels that retain the original features reaches 256, and the number of channels that extract 6 features also reaches 256. This shows a polarization effect, indicating that the bottleneck layer retains too many original features and only extracts features from half of the channels that exist in the original image. Therefore, the channel is essentially divided into two unrelated branches. In order to enhance the interaction ability of the channel, this embodiment introduces CSO on this basis. For a bottleneck block with two groups, this embodiment first divides the channels in each group into several subgroups, and then provides different subgroups for each group in the next layer. This allows effective channel interaction. The effect achieved is as follows Figure 7 As shown, this is the effect of the new bottleneck layer.

[0106] Similarly, this embodiment takes the feature map of 6 layers and 512 channels after introduction as an example, and counts the number of channels with different feature extraction numbers after improvement, such as Figure 6 (b) as shown.

[0107] It can be seen that after the feature maps of 512 channels pass through the 6 new bottleneck layers, 8 channels retain their original features, and the remaining 504 channels have undergone feature extraction to varying degrees. This observation emphasizes that adding CSO can improve the interactivity of channels. Finally, this embodiment combines semi-feature channel processing with CSO and establishes a new bottleneck, such as Figure 3 shown.

[0108] In order to demonstrate the excellent performance of the proposed CACS-YOLO in detecting insulator defects, this section conducts comparative experiments with several classic target detection models, including PPYOLOE, RTDETR, Gold-YOLO, and YOLOv8m. All models use the same dataset for training and testing. Training is stopped when the model reaches convergence. The experimental results are shown in Table 1.

[0109] Table 1

[0110]

[0111] Table 1 shows that CACS-YOLO's mAP@.5:.95 is 10.6% higher than PPYOLO-m, which indicates that CACS-YOLO can improve detection ability more than PPYOLO-m with RepRes module. RT-DETR with hybrid encoder is divided into r18 and r50 versions according to the number of layers. The mAP@.5:.95 obtained by testing is 4.2% and 2.6% lower than that of CACS-YOLO, respectively. Although Gold-YOLO promotes multi-scale feature fusion, its mAP@.5:.95 of s version and m version is 3.1% and 2.8% lower than that of CACS-YOLO, respectively. CACS-YOLO's mAP@.5:.95 is 0.8% higher than YOLOv8m and has less consumption than YOLOv8m. The comparison shows that the introduction of CAM based on feature reuse and feature CSO in CACS-YOLO can achieve lightweight while also showing excellent detection ability.

[0112] After training and testing on a specific data set, CACS-YOLO achieved an mAP@.5:.95 of 96.9%, achieving high-precision detection of insulator defects. In addition, the number of parameters and computational complexity have been reduced, which reduces the running delay of the model on edge devices, thereby improving real-time performance. At the same time, CACS-YOLO achieved an FPS of 132, which can meet the edge deployment in real-world scenarios.

[0113] Figure 8 The confusion matrix of CACS-YOLO on SFRID is shown. Each element Ci,j in the confusion matrix represents the number of samples that are actually labeled as category i but predicted as category j by the model. The confusion matrix reflects the accuracy of the model in detecting targets of different categories. It can be understood that only a very small number of insulator targets are missed, that is, they are mistaken for "background", and a very small number of backgrounds are mistaken for insulators. Importantly, there is no false detection of defective targets, and the number of missed defective targets is extremely low. This result is of great significance to insulator inspection engineering, because the risk of false detection of defects exceeds the risk of false detection of background and insulators.

[0114] Fig. 9The prediction results of the trained CACS-YOLO model under different weather conditions are shown. Due to the use of the cutout method for data enhancement, some images in the dataset may have partial occlusion of insulators. It is worth noting that the model shows significant efficacy in predicting insulators and their defects under sunny, foggy and rainy days. This also shows that the work done by the present invention not only improves the detection performance of the model, but also promotes the generalization ability of the model for foggy and rainy weather.

[0115] S3, using the training set to train the improved model to obtain a target detection model;

[0116] In this embodiment, the improved model is trained using the training set to obtain the target detection model, including:

[0117] The training model uses the Adam optimization algorithm and the learning rate decay strategy. The training is stopped when the model loss value no longer decreases for a specific number of consecutive epochs.

[0118] In this embodiment, the initial value of the learning rate is a specific value, and the learning rate decays to an original specific proportion after each specific number of epochs.

[0119] In this embodiment, the specific value is 0.001, the specific number of lawsuits is 10, the specific ratio is 0.9, and the specific number of times is 5.

[0120] S4. Input the test set samples into the target detection model for defect detection and evaluate the results.

[0121] Please refer to Fig.10 The embodiment of the present invention provides an insulator defect detection device based on improved Yolov8m, which is used to implement the insulator defect detection method based on improved Yolov8m as described in the above embodiment, including:

[0122] The data processing and partitioning module 10 is used to process and partition the insulator detection data set; the data processing and partitioning module 10 includes a data standardization unit and a data normalization unit, which are used to perform data standardization and normalization operations; and also includes a data set partitioning unit, which is used to partition the data set into a training set and a test set according to a predetermined ratio;

[0123] A model building module 20 is used to establish an improved Yolov8m insulator defect detection model by adding a coordinate attention mechanism and a feature channel shuffling operation in Yolov8m; the model building module 20 includes a feature extraction submodule, a feature fusion submodule and a prediction submodule; the feature extraction submodule is used to perform multi-layer convolution feature extraction on the preprocessed image to form a feature map, the feature fusion submodule is used to realize deep and shallow information fusion through the FPN structure and the PAN structure, the prediction submodule is used to design feature maps of three sizes for multi-scale prediction, and the model building module 20 also includes a unit for improving the C2f module, and a coordinate attention mechanism based on feature reuse and a feature channel shuffling operation are added on the basis of the C2f_2 module to form a C2f_1 module;

[0124] A model training module 30 is used to train the improved model using the training set to obtain a target detection model. The module includes an optimization algorithm unit for using the Adam optimization algorithm, a learning rate adjustment unit for adjusting the learning rate according to a set strategy, and a training stop judgment unit for judging the model loss value to determine when to stop training.

[0125] The detection and evaluation module 40 is used to input the test set samples into the target detection model for defect detection and evaluate the results. The module includes multiple indicator calculation units for calculating evaluation indicators such as accuracy, recall rate, mAP, etc.

[0126] Finally, it should be noted that although the above embodiments have been described in the specification and drawings of this application, this does not limit the scope of patent protection of this application. All technical solutions generated by replacing or modifying equivalent structures or equivalent processes based on the essential concept of this application using the contents recorded in the specification and drawings of this application, as well as directly or indirectly implementing the technical solutions of the above embodiments in other related technical fields, are included in the scope of patent protection of this application.

Claims

1. An insulator defect detection method based on improved Yolov8m, characterized in that: The steps include: Process and divide the insulator inspection data set; By adding coordinate attention mechanism and feature channel shuffling operation in Yolov8m, an improved Yolov8m insulator defect detection model is established; The improved model is trained using the training set to obtain a target detection model; The test set samples are input into the target detection model for defect detection, and the results are evaluated.

2. The insulator defect detection method based on improved Yolov8m according to claim 1 is characterized in that: The processing and dividing of the insulator detection data set includes: The insulator detection dataset is standardized and normalized.

3. The insulator defect detection method based on improved Yolov8m according to claim 1 is characterized in that: The processing and dividing of the insulator detection data set includes: Divide the dataset into training and testing sets.

4. The insulator defect detection method based on improved Yolov8m according to claim 3 is characterized in that: The ratio of training set to test set is 7:

3.

5. The insulator defect detection method based on improved Yolov8m according to claim 1 is characterized in that: The improved Yolov8m model includes improved feature extraction, fusion and prediction related structures; The insulator defect detection model of improved Yolov8m is established by adding a coordinate attention mechanism and a feature channel shuffling operation in Yolov8m, including: Based on Yolov8m, a coordinate attention mechanism based on feature reuse and feature channel shuffling operations is added to build a CACS-YOLO model including feature extraction layer, feature fusion layer and prediction layer, and the C2f_2 module is improved to the C2f_1 module.

6. The insulator defect detection method based on improved Yolov8m according to claim 5 is characterized in that: The feature extraction layer is used to perform multi-layer convolution feature extraction on the preprocessed image to form a feature map; The feature fusion layer consists of FPN structure and PAN structure, which is used to realize the fusion of deep and shallow information; The prediction layer is used to make multi-scale predictions for feature maps of different sizes; The C2f_1 module is an improved module based on C2f_2, which adds CAM based on feature reuse and feature CSO.

7. The insulator defect detection method based on improved Yolov8m according to claim 1 is characterized in that: The improved model is trained using the training set to obtain the target detection model, including: The training model uses the Adam optimization algorithm and the learning rate decay strategy. The training is stopped when the model loss value no longer decreases for a specific number of consecutive epochs.

8. The insulator defect detection method based on improved Yolov8m according to claim 7 is characterized in that: The initial value of the learning rate is a specific value, and after a specific number of epochs, the learning rate decays to a specific proportion of the original value.

9. The insulator defect detection method based on improved Yolov8m according to claim 8 is characterized in that: The specific value is 0.001, the specific number of lawsuits is 10, the specific ratio is 0.9, and the specific number of times is 5.

10. An insulator defect detection device based on improved Yolov8m, characterized in that: The method for detecting insulator defects based on the improved Yolov8m according to any one of claims 1 to 9 comprises: A data processing and partitioning module is used to process and partition the insulator detection data set; Model building module, by adding coordinate attention mechanism and feature channel shuffling operation in Yolov8m, an improved insulator defect detection model of Yolov8m is established; A model training module is used to train the improved model using the training set to obtain a target detection model; The detection and evaluation module is used to input the test set samples into the target detection model for defect detection and evaluate the results.

Citation Information

Cited By

  • Soldering tin defect detection method and device, electronic equipment and storage medium

    CN120411109A