Power transmission line insulator defect detection method based on improved YOLOv8s
By improving the network structure and loss function of the YOLOv8s model, the accuracy and missed detection rate issues of insulator defect detection during drone inspections were resolved, and high-precision small target detection was achieved to meet the needs of transmission line inspections.
Patent Information
- Application Number
- CN202510859030.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-10-17
AI Technical Summary
Existing drone inspection methods have problems with low detection accuracy and high missed detection rate in transmission line insulator defect detection, especially when detecting small targets in complex backgrounds.
By improving the YOLOv8s model, the Conv modules of the P1, P3, P5, and P7 layers of the backbone network are replaced with APEDown modules, the Conv module of the neck network is replaced with the SCDSConv module, and the detection head of the head network is replaced with the GSDetect module. The improved ATFL loss function is used to enhance feature extraction and target detection capabilities.
The model's accuracy in detecting small targets has been improved, the missed detection rate has been reduced, and the detection accuracy has been increased to 90.4%, meeting the high-precision requirements for transmission line insulator status inspections while reducing the amount of calculation.
Smart Images

Figure CN120807415A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application generally relate to the technical field of power transmission lines, and in particular to a power transmission line insulator defect detection method based on improved YOLOv8s. BACKGROUND
[0002] As a key component in power transmission lines, insulators play an irreplaceable role in achieving electrical insulation and mechanical support. Since insulators are usually exposed to outdoor environments, they are prone to defects such as flickering, damage, and self-explosion. Therefore, regular inspection of the status of insulators is particularly important for ensuring the safe operation of power transmission lines.
[0003] Currently, the main inspection methods for power transmission lines are manual inspection and unmanned aerial vehicle (UAV) inspection. Manual inspection often has low detection efficiency, is prone to misjudgment, and has high costs. UAV inspection, on the other hand, can provide a good aerial perspective, is highly maneuverable, and has a low cost. It can capture high-resolution images and transmit them in real time.
[0004] However, due to the complexity of the environment captured by the UAV, the large variation in perspective, and the severe natural background interference, the insulator defect targets in the images often have small sizes, blurred outlines, and low contrast with the background. In addition, the images often contain multiple target objects with large size differences, which further increases the detection difficulty. In this case, although the existing mainstream target detection algorithms can be applied to insulator defect detection in power transmission lines, there is still much room for improvement in terms of detection accuracy. SUMMARY
[0005] To solve the above problems, the present application replaces the Conv modules in the P1 layer, P3 layer, P5 layer, and P7 layer of the backbone network with APEDown modules to enhance the extraction of deeper feature information and the perception of multi-scale targets. All Conv modules in the neck network are replaced with SCDSConv modules to reduce the miss detection rate of small targets in target detection and further improve the stability of the model. The detection head Detect in the head network is replaced with the GSDetect module to improve the expression ability of the model target detection head for complex defects. The BCE loss function is replaced with the improved ATFL loss function to significantly improve the focusing ability of the model on insulator defect features. The average detection accuracy mAP@0.5 of the improved model reaches 90.4%, which is 2.8% higher than that of the original YOLOv8s model. This improves the accuracy of small target detection, reduces the miss detection rate, and reduces the computational complexity, meeting the high-precision requirements of insulator status inspection in power transmission lines.
[0006] According to an embodiment of the present application, a method for power transmission line insulator defect detection based on improved YOLOv8s is provided.
[0007] In the first aspect of the present application, a method for power transmission line insulator defect detection based on improved YOLOv8s is provided. The method comprises:
[0008] Step S01: Collecting the original image of the power transmission line insulator defect, and pre-processing the image to obtain a data set;
[0009] Step S02: Constructing an improved YOLOv8s power transmission line insulator defect detection model: replacing the Conv module of P1 layer, P3 layer, P5 layer and P7 layer in the backbone network with APEDown module; replacing the Conv module of P16 layer and P19 layer in the neck network with SCDSConv module; replacing the detection head Detect in the head network with GSDetect module; replacing the BCE loss function with the improved ATFL loss function;
[0010] Step S03: Inputting the data set into the model for training;
[0011] Step S04: Using the trained model to detect the power transmission line insulator defect to obtain the defect type.
[0012] Further, the APEDown module in step S02 comprises an AvgPool2d module, two PBS modules, a 3x3 Conv module, a MaxPool2d module, a 1x1 Conv module and an EMA attention mechanism, and the PBS module comprises a PConv local convolution, a BN layer and a SiLU activation function.
[0013] After the input tensor is sampled by AvgPool2d, it is divided into two branches in the channel dimension, one branch is subjected to convolution operation on part of the channels by the PBS module to extract spatial features, and the remaining channels are directly retained, and then 3x3 convolution is further used to realize spatial down-sampling and channel compression; the other branch is subjected to 3x3 MaxPool2d operation to extract backbone features, and then the PBS module is used to enhance part of the channels, and then 1x1 convolution is used to realize channel mapping; the outputs of the two branches are spliced in the channel dimension to form a fusion feature map, and finally the EMA attention mechanism is introduced.
[0014] Further, the SCDSConv module in step S02 combines the SCDown module and the DSConv module, and after adjusting the channel dimension of the feature map through 1*1 point convolution, the spatial down-sampling is performed using 3*3 deep convolution, and the down-sampled feature is input into the DSConv module, and then the BatchNorm layer and the ReLU activation function are used to enhance the feature stability and the nonlinear expression ability.
[0015] Further, the DSConv module decomposes the convolution kernel into VQK and DS, and the DS includes KDS and CDS, each value of the KDS is used to control the quantization process of each block in the depth direction in the VQK, and the CDS is used to dynamically adjust the channel distribution inside each block.
[0016] Further, the quantization process mainly includes four stages: initialization, forward propagation, backward propagation and update of the convolution kernel parameters; the initialization stage assigns values to the weights and bias terms of the convolution kernel; the forward propagation stage completes feature extraction by performing a shift operation on the input tensor and combining point-by-point convolution; the backward propagation stage calculates the gradient of the loss function on each parameter for effective update of the parameters; and the formula for updating the convolution kernel parameters is: In the formula, indicates the convolution kernel parameter after the t+1 iteration; alpha is a smoothing coefficient, and the value range is [0, 1]; is an input adjustment factor.
[0017] Further, the GSDetect module in step S02 decouples the input feature map into a classification branch and a regression branch, the classification branch realizes Cls classification through one standard convolution to predict the target category, and the regression branch realizes Box regression through one standard convolution to predict the target bounding box coordinates.
[0018] Further, the GSConv module is composed of a DWConv module, a Conv module, a Concat module and a channel shuffle module, the input feature map is compressed to half of the output channel through a Conv module to obtain a first feature map, the first feature map is subjected to DWConv convolution operation to obtain a second feature map, the first feature map and the second feature map are spliced in the channel dimension, and then the channel shuffle operation is performed.
[0019] In a second aspect of the present application, an improved YOLOv8s-based power line insulator defect detection device is provided. The device comprises:
[0020] An image acquisition module: used for acquiring the original image of the power line insulator defect, and pre-processing the image to obtain a data set;
[0021] The model construction module is used for constructing the improved YOLOv8s power line insulator defect detection model, wherein the Conv modules of P1 layer, P3 layer, P5 layer and P7 layer in the backbone network are replaced by APEDown modules; the Conv modules of P16 layer and P19 layer in the neck network are replaced by SCDSConv modules; the detection head Detect in the head network is replaced by a GSDetect module; and the BCE loss function is replaced by an improved ATFL loss function.
[0022] The model training module is used for inputting the data set into the model for training.
[0023] The defect detection module is used for detecting the power line insulator defects by using the trained model to obtain the defect type.
[0024] In a third aspect of the application, an electronic device is provided. The electronic device comprises a memory and a processor, the memory having stored thereon a computer program, the processor implementing the method according to the first aspect of the application when executing the program.
[0025] In a fourth aspect of the application, a computer readable storage medium is provided, having stored thereon a computer program, the program being executed by a processor to implement the method according to the first aspect of the application.
[0026] The Conv modules of P1 layer, P3 layer, P5 layer and P7 layer in the backbone network are replaced by APEDown modules, the perception ability of the model to deeper feature information and multi-scale targets is enhanced; all the Conv modules in the neck network are replaced by SCDSConv modules, the missing detection rate of small targets in target detection is reduced, and the stability of the model is further improved; the detection head Detect in the head network is replaced by a GSDetect module, the expression ability of the model target detection head to complex defects is improved; the BCE loss function is replaced by an improved ATFL loss function, and the focusing ability of the model on insulator defect features is significantly improved; the average detection precision mAP@0.5 of the improved model reaches 90.4%, which is 2.8% higher than that of the original YOLOv8s model, the accuracy of the model in small target detection is improved, the missing detection rate is reduced, the calculation amount is reduced, and the high-precision requirement of power line insulator state inspection is met.
[0027] It should be understood that the content described in the summary section is not intended to limit the key or important features of the embodiments of the application, nor to limit the scope of the application. Other features of the application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0028] The above and other features, aspects, and advantages of embodiments of the present application will become more apparent with reference to the following detailed description when taken in conjunction with the accompanying drawings. In the drawings:
[0029] Figure 1 A method flow chart of power transmission line insulator defect detection based on improved YOLOv8s according to embodiments of the present application is shown;
[0030] Figure 2 An improved YOLOv8s model structure schematic diagram according to embodiments of the present application is shown;
[0031] Figure 3 An APEDown module structure schematic diagram according to embodiments of the present application is shown;
[0032] Figure 4 An SCDSConv module structure schematic diagram according to embodiments of the present application is shown;
[0033] Figure 5 A DSConv module structure schematic diagram according to embodiments of the present application is shown;
[0034] Figure 6 A GSDetect module structure schematic diagram according to embodiments of the present application is shown;
[0035] Figure 7 A GSConv module structure schematic diagram according to embodiments of the present application is shown;
[0036] Figure 8 A validation set test ablation experiment result graph according to embodiments of the present application is shown;
[0037] Figure 9 A detection comparison result graph according to embodiments of the present application is shown;
[0038] Figure 10 A device block diagram of power transmission line insulator defect detection based on improved YOLOv8s according to embodiments of the present application is shown;
[0039] Figure 11 An equipment schematic diagram of power transmission line insulator defect detection based on improved YOLOv8s according to embodiments of the present application is shown. DETAILED DESCRIPTION
[0040] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0041] According to the embodiments of the present application, a method for detecting defects of insulators of a power transmission line based on an improved YOLOv8s is proposed. By replacing the Conv modules in the P1 layer, the P3 layer, the P5 layer and the P7 layer in the backbone network with APEDown modules, the extraction of deeper feature information and the perception of multi-scale targets are enhanced. By replacing all the Conv modules in the neck network with SCDSConv modules, the missing detection rate of small targets in target detection is reduced, and the stability of the model is further improved. By replacing the detection head Detect in the head network with a GSDetect module, the expression ability of the model target detection head for complex defects is improved. By replacing the BCE loss function with an improved ATFL loss function, the focusing ability of the model on insulator defect features is significantly improved. The average detection precision mAP@0.5 of the improved model reaches 90.4%, which is 2.8% higher than that of the original YOLOv8s model. The accuracy of small target detection of the model is improved, the missing detection rate is reduced, the computational complexity is reduced, and the high-precision requirement of the insulator state inspection of the power transmission line is met.
[0042] The principles and spirits of the present application will be explained in detail below with reference to several representative embodiments of the present application.
[0043] Figure 1 is a method flow diagram for detecting defects of insulators of a power transmission line based on an improved YOLOv8s according to an embodiment of the present application. The method comprises:
[0044] Step S01: Collecting original images of defects of insulators of a power transmission line, and pre-processing the images to obtain a data set;
[0045] Step S02: Constructing an improved YOLOv8s model: replacing the Conv modules in the P1 layer, the P3 layer, the P5 layer and the P7 layer in the backbone network with APEDown modules; replacing all the Conv modules in the neck network with SCDSConv modules; replacing the detection head Detect in the head network with a GSDetect module; and replacing the BCE loss function with an improved ATFL loss function;
[0046] Step S03: Inputting the data set into the improved YOLOv8s model for training;
[0047] Step S04: detecting the insulator defects of the power transmission line using the trained model to obtain the defect type.
[0048] It should be noted that although the operations of the method of the present application are described in a specific order in the above embodiments and drawings, this does not require or imply that the operations must be performed in this specific order, or that all of the shown operations must be performed to achieve the desired result. Additionally or alternatively, certain steps can be omitted, multiple steps can be combined into one step, and / or one step can be divided into multiple steps.
[0049] In order to more clearly explain the above method for detecting insulator defects of a power transmission line based on an improved YOLOv8s, a specific embodiment will be described below, however, it should be noted that this embodiment is only for better illustrating the present application and does not constitute an improper limitation on the present application.
[0050] The method for detecting insulator defects of a power transmission line based on an improved YOLOv8s will be further described in more detail below with a specific example:
[0051] Step S01: Collecting original images of insulator defects of a power transmission line. In order to improve the adaptability and generalization ability of the model to various possible situations, data enhancement techniques are used, including rotating the image, weather simulation, motion blur, and adjusting the color gamut of the image to enhance the image. Noise and Cutout methods are introduced to further increase the diversity of the data, simulate the decline in the quality of the inspection image caused by factors such as climate change or shooting angle during the inspection process, and thus enhance the learning ability and robustness of the model to various defect manifestations. Finally, 600 pixel x 600 pixel size images are generated. The insulator defect images of the power transmission line are labeled by Labelimg to obtain the data set for training the YOLOv8s model. The data set is divided into a training set and a validation set in a ratio of 8:2, with 3384 images in the training set and 846 images in the validation set.
[0052] Step S02: Constructing an improved YOLOv8s model: replacing the Conv modules in the P1, P3, P5, and P7 layers of the Backbone network with APEDown modules; replacing all the Conv modules in the neck network with SCDSConv modules; replacing the detection head Detect in the head network with the GSDetect module; and replacing the BCE loss function with the improved ATFL loss function, as shown in Figure 2
[0053] As shown in Figure 3 As shown, the APEDown module is an efficient downsampling module that integrates partial convolution PConv, a double-branch structure, and EMA attention mechanism, for enhancing feature expression while compressing spatial dimensions. The PConv partial convolution module is a new lightweight convolution structure that applies filters only on partial input channels while leaving the rest unchanged. This design takes full advantage of the redundancy between different channels in the feature map, selectively processes channel information, effectively reduces redundant calculations, and improves accuracy without significantly compromising feature expression. Specifically, the calculation formulas of the PConv module and the ordinary convolution module are as follows:
[0054] FLOPs = h x w x k 2 x c p 2
[0055] FLOPs = h x w x k 2 x c 2
[0056]
[0057] where h and w are the height and width of the feature map, k is the size of the convolution kernel, cp is the number of partial input channels of the PConv module, and c is the number of input channels of the ordinary convolution module. In the PConv module, only 1 / 4 of the input channels participate in the convolution operation, and it can be seen that FLOPs is only 1 / 16 of the ordinary convolution module.
[0058] The APEDown module includes an AvgPool2d module, two PBS modules, a 3x3 Conv module, a MaxPool2d module, a 1x1 Conv module, and an EMA attention mechanism. First, the input tensor is sampled by the AvgPool2d (average pooling layer), then it is divided into two branches in the channel dimension. One branch is convolved by the PConv partial convolution to form the PBS module (PConv + BN layer + SiLU activation function) to extract spatial features on partial channels, and the remaining channels are directly retained. Then, 3x3 convolution is used to further realize spatial downsampling and channel compression. The other branch is processed by 3x3 MaxPool2d (max pooling) to extract the backbone features, then the PBS module is used to enhance partial channels, and finally, 1x1 convolution is used to realize channel mapping. Finally, the outputs of the two branches are concatenated in the channel dimension to form a more rich fused feature map. To further improve the model's attention to local structures and key regions, the EMA attention mechanism is introduced to improve the model's perception of multi-scale targets.
[0059] The SCDSConv module combines a SCDown (space-channel down-sampling) module and a DSConv (distribution shift convolution) module. As shown in Figure 4 The SCDown module effectively improves the running efficiency and feature processing capability of the model through the cooperative operation of spatial down-sampling and channel decoupling. First, the channel dimension is adjusted through 1x1 point convolution, then 3x3 deep convolution is used for spatial down-sampling, and then the down-sampled features are input to the DSConv module, and then the BatchNorm layer and the ReLU activation function are used to enhance the feature stability and nonlinear expression capability.
[0060] As shown in Figure 5 The DSConv module decomposes the convolution kernel into a VQK (variable quantization kernel) and a DS (distribution shift component). The DS includes a KDS (kernel distribution shifter) and a CDS (channel distribution shifter). Each value of the KDS is used to control the quantization process of each BLK (block) in the VQK in the depth direction, thereby realizing the distribution shift operation of the convolution kernel. At the same time, the CDS is used to dynamically adjust the channel distribution inside each block to enhance the expression capability of the features.
[0061] Specifically, the quantization process mainly includes four stages: initialization, forward propagation, backward propagation, and update of the convolution kernel parameters.
[0062] In the initialization stage, the weights and bias terms of the convolution kernel are first assigned values.
[0063] In the forward propagation stage, feature extraction is completed by performing a shift operation on the input tensor and combining point-wise convolution. Before forward calculation, the effective convolution weight needs to be calculated according to the current quantization parameter, and the calculation formula is as follows:
[0064] W r =ξ R ⊙W
[0065] In the formula, W r is the effective weight; ξ R is the extended distribution shifter, which is used to align with the size of the convolution kernel; W is the original weight tensor; and the symbol represents the Hadamard (element-wise) product operation.
[0066] Subsequently, the convolution operation is performed to obtain the output feature map Y, and the whole process is represented as:
[0067]
[0068] In the formula, Y i,j represents the value of the output feature map at position (i, j); X i+m,j+nrepresents the value of the input feature map at (i+m, j+n); represents the weight of the effective convolution kernel at (m, n); ξ m,n represents the quantization factor at (m, n).
[0069] In the back propagation phase, the gradient of the loss function with respect to each parameter needs to be calculated to achieve effective updating of the parameters.
[0070] where the gradient of the distribution shifter can be calculated by the following formula:
[0071]
[0072] where, and represents the component of the tensor; J(ijkl) represents the element on the Jacobian matrix.
[0073] The weight gradient formula is:
[0074]
[0075] where W represents the original weight tensor.
[0076] The parameter updating formula of the convolution kernel is:
[0077]
[0078] where, represents the convolution kernel parameter after the t+1 iteration; α is the smoothing coefficient, and the value range is [0, 1]; is the input adjustment factor.
[0079] As shown in Figure 6 , the original YOLOv8s detection head adopts a decoupled structure, which separately processes the classification task and the regression task. Each branch is usually composed of two 3×3 convolutions and one 1×1 convolution to better focus on its own function.
[0080] The GSDetect module first passes the input feature map into two layers of GSConv modules in series for feature extraction and enhancement, effectively compressing redundant channels and improving semantic expression ability. Subsequently, the enhanced feature map is decoupled into a classification branch (Cls) and a regression branch (Box). The classification branch realizes Cls classification through a standard convolution to predict the target class. The regression branch realizes Box regression through a standard convolution to predict the target bounding box coordinates. Compared with the traditional structure of repeatedly stacking 3×3 convolutions, the GSDetect module replaces redundant convolution operations by introducing single-channel shared convolution, thereby strengthening the relevance and expression of feature extraction, and thus improving the detection accuracy and the model's ability to distinguish target boundaries.
[0081] As shown in Figure 7 The GSConv module is composed of a DWConv module, a Conv module, a Concat module, and a channel shuffle module. Assuming that the number of input feature channels is C1 and the number of output channels is C2, the GSConv module replaces the traditional stacked convolution operation with a lightweight and efficient structure to optimize the computational efficiency and feature expression ability of the detection head. First, the module uses a standard convolution to compress the input channels to C2 / 2 to obtain the first feature map, which extracts basic semantic information. Then, DWConv convolution is performed on each channel to obtain the second feature map to extract fine-grained features within each channel. The first feature map and the second feature map are concatenated in the channel dimension to obtain information with C2 channels. Then, the channel shuffle operation is used to evenly exchange the information extracted by different paths among the channels, achieving efficient information reorganization and sharing. GSConv is a convolution form with global sparsity features, which only performs calculations in important areas and breaks the isolation between channels through the Shuffle strategy, effectively enhancing the semantic linkage relationship between channels. Compared with traditional convolution operations, GSConv can significantly improve the perception of fine-grained defect features, enabling the model to maintain high discrimination accuracy under limited feature resolution conditions.
[0082] Step S03: input the data set into the improved YOLOv8s model for training.
[0083] In the original YOLOv8s model, the binary cross-entropy (BCE) classification loss is replaced with an improved ATFL loss function for optimization. The traditional BCE loss function formula is as follows:
[0084] L BCE = -((1-y)log(1-p)+ylog(p))
[0085] In the formula, y is the true label; p is the predicted probability.
[0086] In the transmission line insulator defect detection task, the number of target samples, i.e., positive samples, is much smaller than that of background samples (negative samples). The BCE loss function in the original YOLOv8s model cannot distinguish the importance of positive and negative samples, which may cause the model to learn background features during training, thereby weakening the recognition ability of key targets. To address the imbalance between positive and negative samples, the FL (Focal Loss) uses an adjustment factor to solve the problem, and its formula is as follows:
[0087]
[0088]
[0089] where p is the predicted probability; y is the true label; L BCE is the binary cross-entropy loss; γ represents the control factor strength. Although FL reduces the loss weight of easy samples, it also causes the loss weight of difficult samples to be low. Therefore, the improved ATFL loss function is used to strengthen the target loss and weaken the background loss through an adaptive threshold mechanism to distinguish simple backgrounds and complex detection targets. By dividing samples with a prediction probability greater than 0.5 into easy samples and samples less than this threshold into complex samples, and completing adaptive optimization of hyperparameters, the detection performance is improved. The formula is as follows:
[0090]
[0091] where λ is a fixed hyperparameter; p t is the current predicted probability; p' c is the next epoch prediction value.
[0092] Step S04: using the trained model to detect the insulator defects of the transmission line to obtain the defect type.
[0093] As Figure 8 shown, the above module improvements can improve detection accuracy to varying degrees. From the ablation experiment results, it can be seen that the improved YOLOv8s model performs better in transmission line insulator defect detection than the original YOLOv8s model. The FLOPS, Precision, Recall, mAP@0.5, and mAP@0.5-0.95 are increased by 2%, 4.4%, 2%, 2.8%, and 2.9%, respectively. The model's false detection and missed detection rates are reduced, the transmission line insulator defect detection accuracy is improved, and the computational load is also reduced to some extent, further enhancing the small target defect detection capability in complex backgrounds. In summary, the performance is improved, which can meet the application requirements of high-precision detection of transmission line insulator images and effectively solve the precise detection of small target defects in complex backgrounds. The formula for determining the model performance using the precision (P), recall (R), and mean average precision (mAP) indicators is as follows:
[0094]
[0095]
[0096] Wherein, TP is the number of correctly predicted positive samples, FN is the number of predicted negative samples, FP is the number of predicted positive samples, AP is the average precision of a single class, mAP is the average detection precision of all objects, and N is the total number of classes. mAP@0.5 represents the average precision of all classes when the IOU threshold is equal to 0.5, and mAP@0.5:0.95 represents the average precision at multiple thresholds ranging from 0.5 to 0.95 (step size 0.05).
[0097] As shown in Figure 9 (a) and Figure 9 (b), it can be seen that the original YOLOv8s model has low precision, missed detection and false detection before improvement, especially in small target defect detection. The improved YOLOv8s model not only improves the detection precision of each target, but also effectively solves the missed detection and false detection problems of the original model, has obvious advantages in detection effect, and better meets the actual application requirements.
[0098] Based on the same inventive concept, the application also provides a device for detecting defects of insulators of a power transmission line based on the improved YOLOv8s. The implementation of the device can be referred to the implementation of the above method, and the repeated parts will not be described again. As shown in Figure 10 , the device 100 comprises:
[0099] An image acquisition module 101: used for acquiring an original image of a defect of an insulator of a power transmission line, and pre-processing the image to obtain a data set;
[0100] A model construction module 102: used for constructing an improved YOLOv8s model for detecting defects of insulators of a power transmission line: replacing the Conv module of P1 layer, P3 layer, P5 layer and P7 layer in the backbone network with APEDown module; replacing the Conv module of P16 layer and P19 layer in the neck network with SCDSConv module; replacing the detection head Detect in the head network with GSDetect module; replacing the BCE loss function with an improved ATFL loss function;
[0101] A model training module 103: used for inputting the data set into the model for training;
[0102] A defect detection module 104: used for detecting defects of insulators of a power transmission line using the trained model to obtain the defect type.
[0103] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described modules can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0104] As shown in Figure 11As shown, the device includes a central processing unit (CPU) which can perform various appropriate actions and processes according to computer program instructions stored in a read only memory (ROM) or computer program instructions loaded into a random access memory (RAM) from a storage unit. In the RAM, various programs and data required for operation of the device can also be stored. The CPU, the ROM, and the RAM are connected to each other through a bus. An input / output (I / O) interface is also connected to the bus.
[0105] A plurality of components in the device are connected to the I / O interface, including: an input unit such as a keyboard, a mouse, etc.; an output unit such as various types of displays, speakers, etc.; a storage unit such as a magnetic disk, a magneto optical disk, etc.; and a communication unit such as a network card, a modem, a wireless communication transceiver, etc. The communication unit allows the device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0106] The processing unit performs the various methods and processes described above, such as the method steps S01-S04. For example, in some embodiments, the method steps S01-S04 can be implemented as a computer software program tangibly embodied in a machine readable medium, such as the storage unit. In some embodiments, part or all of the computer program can be loaded onto and / or installed on the device via the ROM and / or the communication unit. One or more of the method steps S01-S04 described above can be performed when the computer program is loaded into the RAM and executed by the CPU. Alternatively, in other embodiments, the CPU can be configured, by way of firmware or otherwise, to perform the method steps S01-S04.
[0107] The functionality described herein above can be performed, at least in part, by one or more hardware logic components. For example, and without limitation, example types of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Application-specific Integrated Circuits (ASICs), Application-specific Standard Products (ASSPs), System-on-a-chip systems (SOCs), Complex Programmable Logic Devices (CPLDs), etc.
[0108] Program code for carrying out the methods of the present application can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program code, when executed by the processor or controller, causes the functions / acts specified in the flowcharts and / or block diagrams to be implemented. The program code can execute entirely on a machine, partly on a machine, as a stand-alone software package, partly on a machine and partly on a remote machine or entirely on a remote machine or server.
[0109] In the context of the present application, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
[0110] Moreover, while operations have been depicted in a particular order, this should not be understood as requiring such order nor that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing can be advantageous. Likewise, while several specific implementation details have been discussed, these should not be construed as limitations on the scope of the present application. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable sub-combination.
[0111] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
Claims
1. A method for detecting defects in transmission line insulators based on improved YOLOv8s, characterized in that: The method includes: Step S01: collecting original images of transmission line insulator defects and preprocessing the images to obtain a data set; Step S02: Construct an improved YOLOv8s transmission line insulator defect detection model: replace the Conv modules of the P1, P3, P5, and P7 layers in the backbone network with the APEDown module; replace the Conv modules of the P16 and P19 layers in the neck network with the SCDSConv module; replace the detection head Detect in the head network with the GSDetect module; replace the BCE loss function with the improved ATFL loss function; Step S03: input the data set into the model for training; Step S04: Use the trained model to detect transmission line insulator defects and obtain the defect type.
2. The method for detecting transmission line insulator defects based on improved YOLOv8s according to claim 1, characterized in that: The APEDown module described in step S02 includes an AvgPool2d module, two PBS modules, a 3×3Conv module, a MaxPool2d module, a 1×1Conv module and an EMA attention mechanism. The PBS module includes PConv local convolution, BN layer and SiLU activation function; After the input tensor is sampled by AvgPool2d, it is divided into two branches in the channel dimension. One branch undergoes convolution operations on some channels through the PBS module to extract spatial features, and the remaining channels are directly retained. Subsequently, 3×3 convolution is performed to further achieve spatial downsampling and channel compression; the other branch extracts backbone features through a 3×3 MaxPool2d operation, and then enhances some channels through the PBS module, followed by 1×1 convolution to achieve channel mapping; the outputs of the two branches are spliced in the channel dimension to form a fused feature map, and finally the EMA attention mechanism is introduced.
3. The method for detecting transmission line insulator defects based on improved YOLOv8s according to claim 1, characterized in that: The SCDSConv module described in step S02 combines the SCDown module with the DSConv module. After the feature map adjusts the channel dimension through 1×1 point convolution, 3×3 depth convolution is used for spatial downsampling. The downsampled features are input to the DSConv module and the BatchNorm layer and ReLU activation function are used to enhance the feature stability and nonlinear expression ability.
4. The method for detecting transmission line insulator defects based on improved YOLOv8s according to claim 3, characterized in that: The DSConv module decomposes the convolution kernel into two parts, VQK and DS, and DS includes KDS and CDS. Each value of KDS is used to regulate the quantization process of each block in the depth direction in VQK, and CDS is used to dynamically adjust the channel distribution within each block.
5. The method for detecting transmission line insulator defects based on improved YOLOv8s according to claim 4, characterized in that: The quantization process mainly includes four stages: initialization, forward propagation, back propagation and updating of convolution kernel parameters; the initialization stage assigns values to the weights and bias items of the convolution kernel; In the forward propagation stage, feature extraction is completed by performing a shift operation on the input tensor and combining it with point-by-point convolution. The back propagation stage calculates the gradient of the loss function with respect to each parameter to achieve effective parameter update. The formula for updating the convolution kernel parameters is: Where, Indicates that the convolution kernel parameters have undergone the t+1th iteration; α is the smoothing coefficient, and its value range is [0,1]; is the input adjustment factor.
6. The method for detecting defects in transmission line insulators based on improved YOLOv8s according to claim 1, characterized in that: The GSDetect module described in step S02 decouples the input feature map into a classification branch and a regression branch. The classification branch implements Cls classification through a standard convolution and predicts the target category. The regression branch implements Box regression through a standard convolution and predicts the target bounding box coordinates.
7. The method for detecting transmission line insulator defects based on improved YOLOv8s according to claim 6, characterized in that: The GSConv module is composed of a DWConv module, a Conv module, a Concat module and a channel shuffling module. The input feature map passes through a Conv module to compress the input channel to half of the output channel to obtain a first feature map, and then the first feature map is subjected to a DWConv convolution operation to obtain a second feature map. The first feature map and the second feature map are spliced in the channel dimension, and then a channel shuffling operation is performed.
8. A device for detecting defects in transmission line insulators based on improved YOLOv8s, characterized in that: The device implements the method according to any one of claims 1 to 7, comprising: Image acquisition module: used to collect original images of transmission line insulator defects and preprocess the images to obtain data sets; Model building module: used to build an improved YOLOv8s transmission line insulator defect detection model: replace the Conv modules of the P1, P3, P5, and P7 layers in the backbone network with the APEDown module; replace the Conv modules of the P16 and P19 layers in the neck network with the SCDSConv module; replace the detection head Detect in the head network with the GSDetect module; replace the BCE loss function with the improved ATFL loss function; Model training module: used to input data sets into the model for training; Defect detection module: used to detect transmission line insulator defects using the trained model and obtain the defect type.
9. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Power transmission line insulator equipment detection method and system based on YOLO
CN121767809A