CN115631411A - Method for detecting damage of insulator in different environments based on STEN network - Google Patents

Method for detecting damage of insulator in different environments based on STEN network Download PDF

Info

Publication number
CN115631411A
CN115631411A CN202211190509.8A CN202211190509A CN115631411A CN 115631411 A CN115631411 A CN 115631411A CN 202211190509 A CN202211190509 A CN 202211190509A CN 115631411 A CN115631411 A CN 115631411A
Authority
CN
China
Prior art keywords
insulator
network
loss
attention
sample
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211190509.8A
Other languages
Chinese (zh)
Inventor
纪超
王博雅
黄新波
陈国燕
侯威
宋智伟
张凡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xian Polytechnic University
Original Assignee
Xian Polytechnic University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xian Polytechnic University filed Critical Xian Polytechnic University
Priority to CN202211190509.8A priority Critical patent/CN115631411A/en
Publication of CN115631411A publication Critical patent/CN115631411A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • G06V20/176Urban or other man-made structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • G06V10/462Salient features, e.g. scale invariant feature transforms [SIFT]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/52Scale-space analysis, e.g. wavelet analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/762Arrangements for image or video recognition or understanding using pattern recognition or machine learning using clustering, e.g. of similar faces in social networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/7715Feature extraction, e.g. by transforming the feature space, e.g. multi-dimensional scaling [MDS]; Mappings, e.g. subspace methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/80Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
    • G06V10/806Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • G06V20/17Terrestrial scenes taken from planes or by drones
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content

Abstract

The invention aims to provide a method for detecting insulator damage in different environments based on an STEN network, which comprises the steps of firstly acquiring a polling video to obtain insulator pictures in different environments, expanding the obtained insulator pictures, and taking the expanded insulator pictures as a real insulator sample library; then dividing a training set and a test set, labeling the training set by using a labeling tool Labellmg, and storing information of the labeled insulator picture to obtain sample data; establishing an online attention accumulation mechanism OAAM for improvement to obtain a STEN target detection network, and further obtaining a test set reference network with optimal weight data; and finally obtaining the insulator defect detection result. The invention solves the problem that the defects of the insulator are difficult to accurately detect under different environments in the prior art.

Description

Method for detecting damage of insulator in different environments based on STEN network
Technical Field
The invention belongs to the technical field of image processing, and particularly relates to a method for detecting damage of insulators in different environments based on an STEN network.
Background
With the continuous enlargement of the scale of the transmission line in China, the inconvenience of the routing inspection of the transmission line is caused. In the years, the computer vision technology is rapidly developed, so that people have new understanding in the vision field, the computer vision technology is profoundly influencing the life of people, and technical support is provided for safety detection of a power system. Before the computer technology is not mature, the insulators can be identified and screened only by manpower, so that visual fatigue is easy to generate, and the inspection efficiency is reduced. At present, the computer technology is mature, the computer technology can replace manpower to identify high-definition pictures of insulators, so that the power inspection is developed to the direction of full automation, and a real intelligent power grid is realized.
Unmanned aerial vehicle imaging platform is built by the subsidiary imaging device of unmanned aerial vehicle and ripe computer vision technique and forms, and transmission line's the mode of patrolling and examining has been patrolled and examined by the manual work of tradition most and turn to more high-efficient, accurate unmanned aerial vehicle and patrol and examine. The high-definition camera borne by the unmanned aerial vehicle can shoot high-definition pictures of the insulators on the power transmission line, and the pictures contain GPS data on each tower and label data on each insulator. If the insulator information in the picture can be accurately positioned and screened, a basis can be provided for the subsequent insulator defect inspection and maintenance. And the picture shot by the unmanned aerial vehicle is transmitted to the client by the 5G network, and finally, the defect is positioned and identified by utilizing an algorithm.
Disclosure of Invention
The invention aims to provide a method for detecting insulator damage in different environments based on a STEN network, and solves the problem that the defects of insulators in different environments are difficult to accurately detect in the prior art.
The technical scheme adopted by the invention is that the method for detecting the damage of the insulator in different environments based on the STEN network is implemented according to the following steps:
step 1, collecting a polling video, obtaining insulator pictures in different environments through the polling video, expanding the obtained insulator pictures, and taking the expanded insulator pictures as a real insulator sample library;
step 2, dividing the real insulator sample library obtained in the step 1 into a training set and a testing set, and randomly selecting 20% of the training set and 80% of the testing set as the training set;
step 3, labeling the training set selected in the step 2 by using a labeling tool Labellmg, and storing information of the labeled insulator picture to obtain sample data;
step 4, establishing an online attention accumulation mechanism OAAM to improve the existing target detection network yolov5 to obtain a STEN target detection network, and training the STEN target detection network by using the sample data obtained in the step 3 to obtain a test set reference network with optimal weight data;
and 5, processing the test set obtained in the step 2 by using the test set reference network with the optimal weight data obtained in the step 4 to obtain an insulator defect detection result.
The present invention is also characterized in that,
the step 1 is implemented according to the following steps:
step 1.1, shooting a patrol video through a high-definition camera, and obtaining a large number of insulator pictures in different environments from the obtained patrol video;
step 1.2, the insulator picture obtained in the step 1.1 is rotated, noised and mirrored to expand a data set;
and step 1.3, the insulator picture obtained in the step 1.1 and the data set which is expanded in the step 1.2 are used as a real insulator sample library together.
Step 3 is implemented specifically according to the following steps:
step 3.1, determining an insulator picture to be marked, finding an area where the insulator defect is located in the picture, and then marking to obtain a marking frame of the area where the insulator defect is located;
step 3.2, setting the marking frame of the region where the insulator defect is located obtained in the step 3.1 into two types of state tags, namely break tag and expansion tag respectively according to two defect types of damage and self-explosion of the insulator in the picture, and obtaining marking frame marking information with the state tags and the region where the insulator defect is located;
3.3, utilizing a marking tool Labellmg to generate an xml document containing position information and category information of the defect area of the marking frame marking information obtained in the step 3.2, wherein the position information is an abscissa x of the central point position of the marking frame of the area where the insulator defect is located min With the ordinate y max And the width w and the height h of the marking frame of the area where the insulator defect is located; the category information is certain state information of the broken insulator or the spontaneous explosion marked out in the step 3.2;
and 3.1, 3.2 and 3.3, obtaining the marked insulator picture and the xml document with the marked information as sample data.
Step 4 is specifically implemented according to the following steps:
step 4.1, the online attention accumulation mechanism OAAM is composed of a channel attention accumulation mechanism and a space attention module, and the online attention accumulation mechanism OAAM is specifically as follows:
firstly, obtaining feature maps under three different scales by convolution kernels of 3*3, 5*5 and 7*7 of three different sizes for sample data obtained in the step 3, respectively sending the obtained feature maps under the three different scales to a channel attention accumulation mechanism, and learning characteristics of each channel to obtain a channel attention feature map under the three scales; secondly, the obtained channel attention feature maps under the three scales are subjected to size adjustment through convolution operation and then are fused, and the fused channel attention feature maps are continuously sent to a space attention module to learn the position features of the defect target, so that a mask label of the defect area is obtained; finally, clustering the training set selected in the step 2 by using the conventional K-mems algorithm, and performing loss calculation on the training set and the obtained mask label for training the OAAM to obtain the optimal weight parameter of the online attention accumulation mechanism and the sample data set with enhanced significance;
step 4.2, improving two aspects of a sample distribution mode and a loss function of the traditional yolov5 network to obtain an improved yolov5 target detection network;
step 4.3, the OAAM in the step 4.1 and the yolov5 target detection network improved in the step 4.2 jointly form a STEN target detection network;
and 4.4, training the STEN target detection network by using the training set obtained in the step 2.1, obtaining weight parameters of the STEN target detection network by training, and finally obtaining a test set reference network with optimal weight data.
Step 4.1 is specifically carried out according to the following steps:
step 4.1.1, the channel attention accumulation mechanism comprises 3 branches, and each branch acquires a feature map specifically as follows:
let F in For the initial characterization of the input channel attention accumulation mechanism, we first use convolution layers with ReLU activation functionExtracting the features to obtain a feature map F r Then, the feature map F is r Sending the obtained data to the existing multilayer perceptron MLP after pooling operation for further feature extraction, and multiplying the further extracted features by a Sigmoid activation function and a channel statistical coefficient to obtain a feature map
Figure BDA0003869151010000041
Finally, the feature map is processed
Figure BDA0003869151010000042
Input feature map F associated with channel attention accumulation mechanism in Performing element-by-element addition to obtain the output of each branch
Figure BDA0003869151010000043
Feature map F r The calculation is as shown in the formula (1),
F r =f r (F in ) (1)
wherein, f r (. To) shows that the first step of feature extraction operation, including two layers of convolution operation and one ReLU activation operation, F in Input feature diagram representing the channel attention accumulation mechanism, F r R =1,2,3, representing the feature map obtained after the completion of the initial feature extraction of the r-th branch, and F r Further extracting features, wherein the steps are shown in formulas (2) to (4):
f ca (F r )=σ(MLP(AvgPool(F r ))+ (2)
MLP(MaxPool(F r )))
coef=f ca (F r ) (3)
Figure BDA0003869151010000051
wherein f is ca (. Is) the operation performed by the channel attention mechanism, coef represents the channel statistics,
Figure BDA0003869151010000052
represents the firstThe feature preliminarily extracted by the r branch channel attention accumulation mechanism is multiplied by coef, r is 1,2,3, MLP represents a multilayer perceptron, avgPool (. Cndot.) represents average pooling operation, maxPool (. Cndot.) represents maximum pooling operation, and finally each branch of the channel attention accumulation module outputs
Figure BDA0003869151010000053
Expressed as:
Figure BDA0003869151010000054
wherein the content of the first and second substances,
Figure BDA0003869151010000055
representing the final output characteristic diagram of the r branch of the channel attention accumulation mechanism;
the channel attention accumulation mechanism is provided with three branches with the same structure but different convolution kernels, wherein the sizes of Conv1, conv2 and Conv3 convolution kernels are 3 multiplied by 3,5 multiplied by 5,7 multiplied by 7 respectively, so that the channel attention accumulation mechanism extracts feature information from three different scales respectively to obtain a feature map
Figure BDA0003869151010000056
Figure BDA0003869151010000057
And fusing the feature maps using a 1 x 1 convolution and upsampling operation
Figure BDA0003869151010000058
Figure BDA0003869151010000059
Wherein f is fuse (. C.) represents a fusion operation [ ·]Representing a joining operation, F out An output feature map representing a channel attention accumulation mechanism;
step 4.1.2, feature map F out By passingPerforming characteristic dimension reduction on the two dimension-reduction convolutional layers Conv4 and Conv5 with the same size; secondly, calculating a space attention diagram by using matrix multiplication and Softmax; then multiplying the spatial attention map by the output of Conv 6; finally, adding the product result and the original input element by element to obtain a mask label and a saliency characteristic map of the target area as the output of a space attention mechanism;
4.1.3, clustering the sample data by using the conventional K-meas algorithm to obtain a clustering result of the position of the insulator defect area;
step 4.1.4, calculating IOU by using the mask label obtained in step 4.1.2 and the clustering result obtained in step 4.1.3 mask Lost to train OAAM modules as IOU mask When the loss is less than the threshold, training is completed, IOU mask The formula for calculating the loss is shown in equation (7):
Figure BDA0003869151010000061
wherein, the mask _ bbox represents the mask label of the target area obtained in the step 4.1.2; and p _ bbox represents the clustering result of the insulator defect target position obtained in the step 4.1.3.
Step 4.2 is specifically as follows:
step 4.2.1, sending the obtained attention feature map of the OAAM into an improved yolov5 target detection network for prediction to obtain a sample anchor frame;
step 4.2.2, primarily screening the positive sample anchor frame according to the position of the central point of the sample anchor frame obtained in the step 4.2.1 by using a center prior method, eliminating a large number of negative samples with central points deviating from the target area, and using Euclidean distance as a standard for measuring the deviation degree, wherein the formula is shown as (8):
Figure BDA0003869151010000062
l (n) represents the Euclidean distance between the center point of the anchor frame and the center point of the real frame, and the obtained center point of the anchor frame is marked as { (a) n ,b n ) N =1,2,3, ·, k }, where k is the number of anchor frames, { (a) i ,b i ) The center point of a real frame is represented, and m represents the number of anchor frames;
step 4.2.3, extracting information of the positive sample anchor frame preliminarily screened in the step 4.2.2 to obtain the position, the category and the confidence information of the anchor frame, then calculating a Loss function by using the extracted positive sample anchor frame information and training data containing correct labels, calculating cost by using the Loss function, screening out a sample with the lowest cost as a positive sample, and selecting the optimal transmission Loss C of a positive label unit fg Is defined as:
Figure BDA0003869151010000071
where, theta is a parameter of the model,
Figure BDA0003869151010000072
and
Figure BDA0003869151010000073
indicated are prediction category information and prediction location information,
Figure BDA0003869151010000074
and
Figure BDA0003869151010000075
representing true category information and true location information, L cls And L IoU The category loss and the position loss are shown, and alpha is a balance coefficient;
introducing a negative label cost into the cost, and transporting one unit of negative label from the background to the demander d j Cost C of negative sample label bg Is defined as:
Figure BDA0003869151010000077
where φ represents a negative sample label;
will C fg And C bg Connecting in one dimension to obtain the total loss matrix C epsilon R (m+1)×n For S i The value of (a) varies from constant k to the following formula:
Figure BDA0003869151010000076
from the currently known supply vector S e R m+1 And the demand vector d ∈ R n Obtaining an optimal allocation strategy pi through the existing Sinkhorn iteration * ∈R (m+1)×n I.e. the optimal allocation of positive and negative samples;
step 4.2.4, the yolov5 target detection model divides the original Loss function into three types, namely Loss IOU ,Loss conf And Loss cls The composition of the original loss function is shown in formula (12):
Loss=Loss cls +Loss IOU +Loss conf (12)
the standard cross entropy loss function is shown in equation (13):
Figure BDA0003869151010000081
in the formula, alpha represents the probability value of the sample to the class prediction, and gamma represents the class of the sample label;
the balanced cross entropy loss function uses a balance coefficient beta to measure the weight of positive and negative samples, as shown in equation (14):
Figure BDA0003869151010000082
in Focal local, lambda and (1-. Alpha.) are used δ Adjust for sample imbalance as shown in equation (15):
Figure BDA0003869151010000083
the above equations (8) to (15) together constitute an improved yolov5 target detection network.
Step 4.4 is specifically as follows:
step 4.4.1, firstly training the improved yolov5 target detection network, and carrying out contour detection on all pictures in a training set to obtain a marked contour point (x) i ,y i ) N, then picking the contour map, calculating the minimum bounding box of all contour maps, and the coordinate of the upper left corner of the minimum Bao Weikuang is (x) min ,y max ) The coordinate of the lower right corner is (x) max ,y min ) And performing loss calculation and precision calculation with an output result obtained after iterative training of the improved yolov5 target detection network obtained in the step 4.2, wherein the loss calculation is shown in formulas (12) to (15), and the precision calculation is shown in formulas (16) to (19);
step 4.4.2, training OAAM, and performing IOU on the mask label of the target area obtained in the step 4.1.2 and the clustering result of the insulator defect area obtained in the step 4.1.3 mask Loss calculation when IOU mask When the value is not increased any more, the trained OAAM module, IOU, is obtained mask Calculating as shown in equation (7):
and 4.4.3, performing mu times of iterative training, storing the weight data with the optimal effect, and obtaining the test set reference network with the optimal weight data.
The invention has the beneficial effects that the method for detecting the damage of the insulator in different environments based on the STEN network can be used for enhancing the significance of the defect area by the OAAM aiming at the problems of missed detection caused by small defect area and insufficient significance in the insulator data set; the traditional yolov5 network is improved, the traditional label distribution strategy is improved, the SimOTA algorithm is adopted to find the optimal distribution based on the whole situation, and the detection precision of the target frame is improved; and secondly, the detection precision and efficiency of the algorithm are improved by improving the loss function of the algorithm. The experimental result shows that the STEN target detection algorithm has higher accuracy, recall rate and mAP value compared with various popular algorithms.
Drawings
Fig. 1 is a flowchart of insulator defect detection performed by a STEN network in the insulator damage detection method in different environments based on the STEN network according to the present invention;
fig. 2 is a schematic diagram of a channel attention accumulation mechanism in the method for detecting insulator breakage in different environments based on the STEN network;
fig. 3 is a schematic diagram of a spatial attention mechanism in the method for detecting the damage of the insulator in different environments based on the STEN network according to the present invention;
fig. 4 is a schematic diagram of an OAAM module in the method for detecting damage to an insulator in different environments based on a STEN network according to the present invention;
fig. 5 is an effect diagram of the STEN network for detecting the defects of the insulator in different environments in the method for detecting the damage of the insulator in different environments based on the STEN network according to the present invention;
fig. 6 is a comparison graph of the accuracy change curves of the comparison algorithm for the self-explosion and breakage detection of the insulator in the insulator breakage detection method based on the STEN network in different environments;
fig. 7 is a comparison graph of recall rate change curves of self-explosion and breakage detection of the insulator based on comparison algorithms in the method for detecting breakage of the insulator in different environments based on the sted network.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
The invention discloses a method for detecting insulator damage in different environments based on a STEN network, a flow chart is shown in figure 1, and the method is implemented according to the following steps:
step 1, collecting inspection videos, and obtaining insulator pictures in different environments such as severe weather, complex backgrounds, overexposure, small targets and the like through the inspection videos.
Expanding the obtained insulator picture, and taking the expanded insulator picture as a real insulator sample library;
the step 1 is implemented according to the following steps:
step 1.1, shooting a patrol video through a high-definition camera, and obtaining a large number of insulator pictures in different environments from the obtained patrol video, such as severe weather, complex background, overexposure, small targets and the like;
step 1.2, the insulator picture obtained in the step 1.1 is rotated, noised and mirrored to expand a data set;
and step 1.3, using the insulator picture obtained in the step 1.1 and the data set expanded in the step 1.2 together as a real insulator sample library for 2937 pieces in total.
Step 2, dividing the real insulator sample library obtained in the step 1 into a training set and a testing set, and randomly selecting 20% of the training set and 80% of the testing set as the training set;
step 3, labeling the training set selected in the step 2 by using a labeling tool Labellmg, and storing information of the labeled insulator picture to obtain sample data;
step 3 is specifically implemented according to the following steps:
step 3.1, determining an insulator picture to be marked, finding an area where the insulator defect is located in the picture, and then marking to obtain a marking frame of the area where the insulator defect is located;
step 3.2, setting the marking frame of the region where the insulator defect is located obtained in the step 3.1 into two types of state tags, namely break tag and expansion tag respectively according to two defect types of damage and self-explosion of the insulator in the picture, and obtaining marking frame marking information with the state tags and the region where the insulator defect is located;
3.3, utilizing a marking tool Labellmg to generate an xml document containing position information and category information of the defect area of the marking frame marking information obtained in the step 3.2, wherein the position information is an abscissa x of the central point position of the marking frame of the area where the insulator defect is located min With ordinate y max And the width w and the height h of the marking frame of the area where the insulator defect is located; the category information is certain type of state information of the broken or spontaneous explosion of the insulator divided in the step 3.2;
and 3.1, 3.2 and 3.3, obtaining marked insulator pictures and xml documents with marking information as sample data.
Step 4, establishing an Online Attention Accumulation Mechanism OAAM (Online Attention Accumulation Mechanism) and using the existing SimOTA algorithm (simple Optimal Transport Assignment) and the Focal Loss function to respectively improve the sample distribution mode and the Loss function of the traditional yolov5 network to obtain an improved yolov5 target detection network, forming a STEN target detection network by the Online Attention Accumulation Mechanism OAAM and the improved yolov5 target detection network together, and training the STEN target detection network by using the sample data obtained in the step 3 to obtain a test set reference network with Optimal weight data;
step 4 is specifically implemented according to the following steps:
step 4.1, the Online Attention Accumulation Mechanism OAAM (Online Attention Accumulation Mechanism) provided by the present invention is composed of two parts, i.e. a channel Attention Accumulation Mechanism and a spatial Attention module, and the structures of the channel Attention Accumulation Mechanism and the spatial Attention module are respectively shown in fig. 2 and 3.
The working principle of the online attention accumulation mechanism OAAM is specifically as follows:
firstly, obtaining feature maps under three different scales by the sample data obtained in the step 3 through convolution kernels of 3*3, 5*5 and 7*7 with three different sizes, respectively sending the obtained feature maps under the three different scales to a channel attention accumulation mechanism, learning each channel feature, and obtaining a channel attention feature map under the three scales; secondly, the obtained channel attention feature maps under the three scales are subjected to size adjustment through convolution operation and then are fused, the fused channel attention feature maps are continuously sent to a space attention module to learn the position features of the defect target, the significance of the defect area is improved, and a mask label of the defect area is obtained; finally, clustering the training set selected in the step 2 by using the conventional K-mems algorithm, and performing loss calculation on the training set and the obtained mask label for training the OAAM to obtain the optimal weight parameter of the online attention accumulation mechanism and the sample data set with enhanced significance;
step 4.1 is specifically carried out according to the following steps:
step 4.1.1, the channel attention accumulation mechanism comprises 3 branches, and each branch acquires a feature map specifically as follows:
let F in For inputting the initial feature map of the channel attention accumulation mechanism, firstly, extracting features by using the convolution layer with the ReLU activation function to obtain a feature map F r Then, the feature map F r After pooling operation, the data are sent to an existing Multilayer Perceptron MLP (Multi layer Perceptron) for further feature extraction, and feature graphs are obtained after the further extracted features are multiplied by channel statistical coefficients through Sigmoid activation functions
Figure BDA0003869151010000121
Finally, the feature map is processed
Figure BDA0003869151010000122
Input feature map F associated with channel attention accumulation mechanism in Performing element-by-element addition to obtain the output of each branch
Figure BDA0003869151010000123
Characteristic diagram F r The calculation is as shown in equation (1),
F r =f r (F in ) (1)
wherein f is r (. Cndot.) represents performing a first step of feature extraction, including two layers of convolution and a ReLU activation operation, F in Input feature map representing the mechanism of channel attention accumulation, F r R =1,2,3, representing the feature map obtained after the completion of the initial feature extraction of the r-th branch, and F r Further extracting features, wherein the steps are shown in formulas (2) to (4):
f ca (F r )=σ(MLP(AvgPool(F r ))+ (2)
MLP(MaxPool(F r )))
coef=f ca (F r ) (3)
Figure BDA0003869151010000131
wherein f is ca (. Is an operation performed by a channel attention mechanism, coef insteadThe statistical coefficients of the channels are shown,
Figure BDA0003869151010000132
representing the result of multiplying the feature preliminarily extracted by the r-th branch channel attention accumulation mechanism by coef, taking 1,2,3 MLP as the multilayer perceptron, avgPool (DEG) as the average pooling operation, maxPool (DEG) as the maximum pooling operation, and finally outputting each branch of the final channel attention accumulation module
Figure BDA0003869151010000133
Expressed as:
Figure BDA0003869151010000134
wherein the content of the first and second substances,
Figure BDA0003869151010000135
representing the final output characteristic diagram of the r branch of the channel attention accumulation mechanism;
the channel attention accumulation mechanism is provided with three branches with the same structure but different convolution kernels, wherein the sizes of Conv1, conv2 and Conv3 convolution kernels are 3 multiplied by 3,5 multiplied by 5,7 multiplied by 7 respectively, so that the channel attention accumulation mechanism extracts feature information from three different scales respectively to obtain a feature map
Figure BDA0003869151010000136
Figure BDA0003869151010000137
And fusing the feature maps using a 1 x 1 convolution and upsampling operation
Figure BDA0003869151010000138
Figure BDA0003869151010000139
Wherein f is fuse (. Represents a fusion operation [. Cndot.)]RepresentsConnection operation, F out An output profile representing a channel attention accumulation mechanism;
in step 4.1.2, the channel feature map output by the channel attention accumulation mechanism in step 4.1.1 is sent to the spatial attention mechanism to extract the position features of the defect region. Each convolution layer of the spatial attention mechanism has 1 x 1 convolution kernel local spatial features, firstly, a feature map F out Performing characteristic dimension reduction through two dimension reduction convolutional layers Conv4 and Conv5 with the same size; secondly, calculating a space attention diagram by using matrix multiplication and Softmax; then multiplying the spatial attention map by the output of Conv 6; finally, adding the product result and the original input element by element to obtain a mask label and a saliency characteristic map of the target area as the output of the spatial attention mechanism;
step 4.1.3, clustering the sample data by using the conventional K-meas algorithm to obtain a clustering result of the position of the insulator defect region;
step 4.1.4, calculating IOU by using the mask label obtained in step 4.1.2 and the clustering result obtained in step 4.1.3 mask Lost to train OAAM modules as IOU mask When the loss is less than the threshold, training is completed, IOU mask The formula for calculating the loss is shown in equation (7):
Figure BDA0003869151010000141
wherein, the mask _ bbox represents the mask label of the target area obtained in the step 4.1.2; and p _ bbox represents the clustering result of the insulator defect target position obtained in the step 4.1.3.
Fig. 4 shows a structure of an Online Attention Accumulation Mechanism OAAM (Online Attention Accumulation Mechanism) in step 4.1, which is composed of a channel Attention Accumulation Mechanism in step 4.1.1 and a spatial Attention Mechanism in step 4.1.2, and an Attention feature map of OAAM and a mask label of a defect area are specifically described as follows:
assuming that the input image size of the online attention accumulation mechanism is w × h × c, firstly, features at different scales are obtained through rolling blocks with different sizesSetting the size of scale 1 as e multiplied by f multiplied by b, the size of scale 2 as g multiplied by 0h multiplied by 1t and the size of scale 3 as l multiplied by 2m multiplied by 3n, respectively inputting the obtained feature maps with the sizes of e multiplied by 4f multiplied by 5b, g multiplied by 6h multiplied by 7t and l multiplied by 8m multiplied by 9n into a channel attention accumulation module and extracting features by using a pooling operation to obtain the results of 1 multiplied by 0b, 1 multiplied by 11 multiplied by 2t and 1 multiplied by 31 multiplied by 4 n; obtaining feature maps with the sizes of 1 × 51 × 6b/r, 1 × 71 × 8t/r and 1 × 91 × n/r after passing through the full connection layer FC1, wherein the scaling parameter r can effectively reduce the number of feature map channels, and the feature map channel dimensions are improved to 1 × 1 × b, 1 × 1 × t and 1 × 1 × n through the full connection layer FC 2; after the activation function, the obtained characteristic diagram and the input characteristic diagram F of the channel attention accumulation mechanism are obtained in Performing multiplication operation to extract channel features of a defect area, thereby obtaining a feature map of channel attention under 3 scales, finally performing convolution and up-sampling to finally obtain a feature map with the size of w × h × c, after the channel features are emphasized through splicing operation, inputting the feature into a space attention module to extract position features, compressing the channel number to the dimension of c/r through two dimension-reduction convolution layers Conv4 and Conv5 with the same size by the space attention module, performing element multiplication operation on the two obtained feature maps to obtain an attention map, and then performing Softmax calculation to obtain [ w × h ] attention map]×[w×h]And (5) performing multiplication calculation on the result and the Conv6 output feature map, and finally performing element-by-element addition operation on the result and the space attention module input image to obtain an attention feature map of the OAAM and a mask label of the defect area.
Step 4.2, improving two aspects of a sample distribution mode and a loss function of the traditional yolov5 network to obtain an improved yolov5 target detection network;
step 4.2 is specifically as follows:
step 4.2.1, sending the obtained attention feature map of the OAAM into an improved yolov5 target detection network for prediction to obtain a sample anchor frame;
and 4.2.2, the improved yolov5 target detection network integrates the global optimal idea in the process of distributing the positive and negative sample anchor frames, and a high-confidence-degree distribution mode based on the global situation is found for all targets in the image by adopting a SimOTA algorithm. Preliminarily screening a positive sample anchor frame according to the position of the central point of the sample anchor frame obtained in the step 4.2.1 by using a center prior method, eliminating a large number of negative samples with central points deviating from a target area, and taking Euclidean distance as a standard for measuring deviation degree, wherein the formula (8) is as follows:
Figure BDA0003869151010000151
l (n) represents the Euclidean distance between the center point of the anchor frame and the center point of the real frame, and the obtained center point of the anchor frame is marked as { (a) n ,b n ) N =1,2,3, ·, k }, where k is the number of anchor frames, { (a) i ,b i ) The center point of a real frame is represented, and m represents the number of anchor frames;
step 4.2.3, extracting information of the positive sample anchor frame preliminarily screened in the step 4.2.2 to obtain the position, the category and the confidence information of the anchor frame, then calculating a Loss function by using the extracted positive sample anchor frame information and training data containing correct labels, calculating cost by using the Loss function, screening out a sample with the lowest cost as a positive sample, and selecting the optimal transmission Loss C of a positive label unit fg Is defined as:
Figure BDA0003869151010000161
where, theta is a parameter of the model,
Figure BDA0003869151010000162
and
Figure BDA0003869151010000163
indicating prediction category information and prediction location information,
Figure BDA0003869151010000164
and
Figure BDA0003869151010000165
representing true category information and true location information, L cls And L IoU Representing class losses and bitsLoss, α is the equilibrium coefficient;
in the training process, besides the distribution of positive labels, a large number of anchor boxes are regarded as negative samples, so that the cost of negative labels cost needs to be introduced in the cost of cost, and one unit of negative labels is transported to a demander d from the background j Cost C of negative sample label bg Is defined as:
Figure BDA0003869151010000166
where φ represents a negative sample label;
for the sake of general description, reference will be made to C fg And C bg Connecting in one dimension to obtain the total loss matrix C epsilon R (m+1)×n For S i The value of (a) varies from constant k to the following formula:
Figure BDA0003869151010000167
from the currently known supply vector S e R m+1 And the demand vector d ∈ R n Obtaining an optimal allocation strategy pi through the existing Sinkhorn iteration * ∈R (m+1)×n I.e. the optimal allocation of positive and negative samples;
step 4.2.4, the yolov5 target detection model divides the original Loss functions into three types, namely Loss IOU ,Loss conf And Loss cls The composition of the original loss function is shown in formula (12):
Loss=Loss cls +Loss IOU +Loss conf (12)
the standard cross entropy loss function is shown in equation (13):
Figure BDA0003869151010000171
in the formula, alpha represents the probability value of the sample to the class prediction, and gamma represents the class of the sample label;
the balanced cross entropy loss function uses the balance coefficient β to measure the weight of the positive and negative samples, as shown in equation (14):
Figure BDA0003869151010000172
the use of lambda and (1-. Alpha.) in Focal local δ Adjust for sample imbalance as shown in equation (15):
Figure BDA0003869151010000173
the above equations (8) to (15) together constitute an improved yolov5 target detection network.
Step 4.3, the OAAM in the step 4.1 and the yolov5 target detection network improved in the step 4.2 jointly form a STEN target detection network with better detection effect;
and 4.4, training the STEN target detection network by using the training set obtained in the step 2.1, training to obtain the most suitable weight parameters of the STEN target detection network, and finally obtaining the test set reference network with the best weight data.
Step 4.4 is specifically as follows:
step 4.4.1, firstly training the improved yolov5 target detection network, and carrying out contour detection on all pictures in a training set to obtain a marked contour point (x) i ,y i ) N, then picking the contour map, calculating the minimum bounding box of all contour maps, and the coordinate of the upper left corner of the minimum Bao Weikuang is (x) min ,y max ) The coordinate of the lower right corner is (x) max ,y min ) And performing loss calculation and precision calculation with an output result obtained after iterative training of the improved yolov5 target detection network obtained in the step 4.2, wherein the loss calculation is shown in formulas (12) to (15), and the precision calculation is shown in formulas (16) to (19);
step 4.4.2, training OAAM, and carrying out IOU (input output Unit) on the mask label of the target area obtained in the step 4.1.2 and the clustering result of the insulator defect area obtained in the step 4.1.3 mask Loss calculation when IOU mask No longer increasing in valueAdding time to obtain the trained OAAM module, IOU mask Calculating as shown in equation (7):
and 4.4.3, performing mu times of iterative training, storing the weight data with the optimal effect, and obtaining the test set reference network with the optimal weight data.
Selecting the weight data with the best effect in the mu iteration results in the step 4 as the test set reference network weight, inputting the test set into a reference network for testing to obtain an insulator defect test result, and verifying the network performance, wherein the specific steps are as follows:
the performance evaluation is carried out by adopting the indexes of accuracy, recall ratio, intersection ratio and average accuracy rate mean value, and the calculation formula is as follows:
Figure BDA0003869151010000181
Figure BDA0003869151010000182
Figure BDA0003869151010000183
wherein:
TP represents a detected positive case; FP represents a detected negative case; TN indicates an undetected negative case; FN indicates an undetected positive case; t _ bbox represents the marked real frame of the insulator; p _ bbox represents the insulating subframe calculated by the algorithm; IOU stands for cross-over ratio;
the mAP calculation formula is shown as (19), wherein n is the number of groups of the calculation pictures:
Figure BDA0003869151010000191
and 5, processing the test set obtained in the step 2 by using the test set reference network with the optimal weight data obtained in the step 4 to obtain an insulator defect detection result.
Inputting the test set into an STEN target detection network for testing to obtain an insulator defect test result, which specifically comprises the following steps:
(1) The STEN target detection network provided by the invention can effectively reduce the weight of irrelevant information and improve the significance of a target area. The SimOTA algorithm can effectively find the global optimal distribution mode. The loss function of the improved model can effectively relieve the problem of sample imbalance.
(2) The detection results of the STEN target detection network on the insulator breakage and spontaneous explosion defects in different environments are shown in fig. 5, and it can be seen from the figure that the STEN target detection network can accurately detect the two defects of insulator breakage and spontaneous explosion under the conditions of severe weather, complex background, overexposure, small target and the like, and compared with other popular algorithms, the detection accuracy and recall rate are higher, the robustness is higher, and the method is more suitable for detecting the insulator defects in different environments.
(3) The mAP of the STEN target detection network for detecting the self-explosion and damage defects of the insulator reaches 96.8%, the precision reaches 96.1%, and the recall rate is 91.4%. Compared with the traditional yolov5 model, the mAP is improved by 2.5%, the precision is improved by 1.71%, the recall rate is improved by 0.42%, and the detection precision of the STEN target detection network is higher and the omission factor is low.
(4) As can be seen from fig. 6 (a), when the IoU threshold is 0.5, the accuracy of the sted target detection network for detecting the damage defect is higher than that of other popular algorithms, and the change curve is relatively gentle, which indicates that the performance of the sted target detection network is stable, and the detection accuracy is not greatly influenced by the change of the IoU threshold; fig. 6 (b) is a graph of the relationship between the accuracy of the sted defect detection by the STEN target detection network and the change of IoU threshold, and it can be seen that when the IoU threshold is 0.5, the accuracy of the self-exploded defect detection by the STEN target detection network is higher than that of other popular algorithms. Fig. 7 (a) is a graph of the variation of the recall rate of the damage defect detection by each comparison algorithm with the IoU threshold, wherein the recall rate is higher than that of the other comparison algorithms when the IoU threshold takes 0.5, the variation curve of the recall rate of the STEN target detection network is smoother, and the recall rate of the self-explosion defect detection is higher than that of the other comparison algorithms when the threshold of IoU takes 0.5, as shown in fig. 7 (b). The undetected condition of the STEN target detection network for detecting the self-explosion and damage of the insulator is improved compared with other popular algorithms.
(5) Compared with other attention mechanisms, the OAAM has higher speed and higher accuracy.
Firstly, performing feature extraction on an input picture by adopting a convolution kernel with the size of 3 multiplied by 3,5 multiplied by 5,7 multiplied by 7, and enhancing the significance of a defect region target of an insulator; secondly, improving a traditional label distribution mode by adopting a SimOTA algorithm (simple Optimal Transport Assignment) to obtain a global high-confidence mode of the positive and negative sample labels; finally, improving the standard cross entropy Loss function by utilizing the Focal local Loss function. Designing a network module: an Online Attention Accumulation Mechanism (OAAM) is proposed to enhance the significance of the defect region, and the OAAM can effectively mine meaningful information from feature maps with different sizes and reduce the weight of irrelevant information. And sending the obtained characteristic diagram into an improved yolov5 network for defect area detection. Experiment results show that the proposed STEN Target Enhancement Network (Self-adaptation Target Enhancement Network) can rapidly and accurately detect defective insulators in different environments, and effectively inhibit irrelevant information.

Claims (7)

1. The method for detecting the damage of the insulator in different environments based on the STEN network is characterized by comprising the following steps:
step 1, collecting a polling video, obtaining insulator pictures in different environments through the polling video, expanding the obtained insulator pictures, and taking the expanded insulator pictures as a real insulator sample library;
step 2, dividing the real insulator sample library obtained in the step 1 into a training set and a testing set, and randomly selecting 20% of the training set and 80% of the testing set as the training set;
step 3, labeling the training set selected in the step 2 by using a labeling tool Labellmg, and storing information of the labeled insulator picture to obtain sample data;
step 4, establishing an online attention accumulation mechanism OAAM to improve the existing target detection network yolov5 to obtain a STEN target detection network, and training the STEN target detection network by using the sample data obtained in the step 3 to obtain a test set reference network with optimal weight data;
and 5, processing the test set obtained in the step 2 by using the test set reference network with the optimal weight data obtained in the step 4 to obtain an insulator defect detection result.
2. The method for detecting insulator damage in different environments based on STEN network as claimed in claim 1, wherein the step 1 is implemented by the following steps:
step 1.1, shooting a patrol video through a high-definition camera, and obtaining a large number of insulator pictures in different environments from the obtained patrol video;
step 1.2, the insulator picture obtained in the step 1.1 is rotated, noised and mirrored to expand a data set;
and step 1.3, the insulator picture obtained in the step 1.1 and the data set which is expanded in the step 1.2 are used as a real insulator sample library together.
3. The method for detecting damage to an insulator in different environments based on an STEN network as claimed in claim 2, wherein the step 3 is specifically implemented according to the following steps:
step 3.1, determining an insulator picture to be marked, finding an area where the insulator defect is located in the picture, and then marking to obtain a marking frame of the area where the insulator defect is located;
step 3.2, the marking frame of the area where the insulator defect is located, which is obtained in the step 3.1, is respectively set to be a breakout state label and an expansion state label according to two defect types of damage and spontaneous explosion of the insulator in the picture, and marking frame mark information of the area where the state label and the insulator defect are located is obtained;
step 3.3, stepGenerating an xml document containing position information and category information of the defect area by utilizing the marking information of the marking frame obtained in the step 3.2 and utilizing a marking tool Labellmg, wherein the position information is an abscissa x of the central point position of the marking frame of the area where the insulator defect is located min With ordinate y max And the width w and the height h of the marking frame of the region where the insulator defect is located; the category information is certain state information of the broken insulator or the spontaneous explosion marked out in the step 3.2;
and 3.1, 3.2 and 3.3, obtaining the marked insulator picture and the xml document with the marked information as sample data.
4. The method for detecting damage to an insulator in different environments based on an STEN network as claimed in claim 3, wherein the step 4 is specifically implemented according to the following steps:
step 4.1, the online attention accumulation mechanism OAAM is composed of a channel attention accumulation mechanism and a space attention module, and the online attention accumulation mechanism OAAM is specifically as follows:
firstly, obtaining feature maps under three different scales by the sample data obtained in the step 3 through convolution kernels of 3*3, 5*5 and 7*7 with three different sizes, respectively sending the obtained feature maps under the three different scales to a channel attention accumulation mechanism, learning each channel feature, and obtaining a channel attention feature map under the three scales; secondly, the obtained channel attention feature maps under the three scales are subjected to size adjustment through convolution operation and then are fused, and the fused channel attention feature maps are continuously sent to a space attention module to learn the position features of the defect target, so that a mask label of the defect area is obtained; finally, clustering the training set selected in the step 2 by using the conventional K-mems algorithm, and performing loss calculation on the training set and the obtained mask label for training the OAAM to obtain the optimal weight parameter of the online attention accumulation mechanism and the sample data set with enhanced significance;
step 4.2, improving two aspects of a sample distribution mode and a loss function of the traditional yolov5 network to obtain an improved yolov5 target detection network;
step 4.3, the OAAM in the step 4.1 and the yolov5 target detection network improved in the step 4.2 jointly form a STEN target detection network;
and 4.4, training the STEN target detection network by using the training set obtained in the step 2.1, training to obtain weight parameters of the STEN target detection network, and finally obtaining a test set reference network with optimal weight data.
5. The method for detecting damage to the insulator in different environments based on the STEN network as claimed in claim 4, wherein the step 4.1 is implemented according to the following steps:
step 4.1.1, the channel attention accumulation mechanism comprises 3 branches, and each branch acquires a feature map specifically as follows:
let F in For inputting the initial feature map of the channel attention accumulation mechanism, firstly, extracting features by using the convolution layer with the ReLU activation function to obtain a feature map F r Then, the feature map F is r Sending the obtained data to the existing multilayer perceptron MLP after pooling operation for further feature extraction, and multiplying the further extracted features by a Sigmoid activation function and a channel statistical coefficient to obtain a feature map
Figure FDA0003869151000000031
Finally, the feature map is processed
Figure FDA0003869151000000032
Input feature map F associated with channel attention accumulation mechanism in Performing element-by-element addition to obtain the output of each branch
Figure FDA0003869151000000033
Feature map F r The calculation is as shown in equation (1),
F r =f r (F in ) (1)
wherein f is r (. To) shows that the first step of feature extraction operation, including two layers of convolution operation and one ReLU activation operation,F in input feature diagram representing the channel attention accumulation mechanism, F r R =1,2,3, representing the feature map obtained after the completion of the initial feature extraction of the r-th branch, and F r Further extracting features, wherein the steps are shown in formulas (2) to (4):
f ca (F r )=σ(MLP(AvgPool(F r ))+ (2)
MLP(MaxPool(F r )))
coef=f ca (F r ) (3)
Figure FDA0003869151000000041
wherein f is ca (. Is) the operation performed by the channel attention mechanism, coef represents the channel statistics,
Figure FDA0003869151000000042
representing the result of multiplying the feature preliminarily extracted by the r-th branch channel attention accumulation mechanism by coef, taking 1,2,3 MLP as the multilayer perceptron, avgPool (DEG) as the average pooling operation, maxPool (DEG) as the maximum pooling operation, and finally outputting each branch of the final channel attention accumulation module
Figure FDA0003869151000000043
Expressed as:
Figure FDA0003869151000000044
wherein, the first and the second end of the pipe are connected with each other,
Figure FDA0003869151000000045
representing the final output characteristic diagram of the r branch of the channel attention accumulation mechanism;
the channel attention accumulation mechanism is provided with three branches with the same structure but different convolution kernels, wherein volumes Conv1, conv2 and Conv3The sizes of the kernels are respectively 3 multiplied by 3,5 multiplied by 5,7 multiplied by 7, so that the channel attention accumulation mechanism extracts feature information from three different scales respectively to obtain a feature map
Figure FDA0003869151000000046
Figure FDA0003869151000000047
And fusing the feature maps using a 1 x 1 convolution and upsampling operation
Figure FDA0003869151000000048
Figure FDA0003869151000000049
Wherein f is fuse (. Represents a fusion operation [. Cndot.)]Representing a connection operation, F out An output profile representing a channel attention accumulation mechanism;
step 4.1.2, feature map F out Performing characteristic dimension reduction through two dimension reduction convolutional layers Conv4 and Conv5 with the same size; secondly, calculating a space attention diagram by using matrix multiplication and Softmax; then multiplying the spatial attention map by the output of Conv 6; finally, adding the product result and the original input element by element to obtain a mask label and a saliency characteristic map of the target area as the output of a space attention mechanism;
4.1.3, clustering the sample data by using the conventional K-meas algorithm to obtain a clustering result of the position of the insulator defect area;
step 4.1.4, calculating IOU by using the mask label obtained in step 4.1.2 and the clustering result obtained in step 4.1.3 mask Lost to train OAAM modules as IOU mask When the loss is less than the threshold, training is completed, IOU mask The formula for calculating the loss is shown in equation (7):
Figure FDA0003869151000000051
wherein, the mask _ bbox represents the mask label of the target area obtained in the step 4.1.2; and p _ bbox represents the clustering result of the insulator defect target position obtained in the step 4.1.3.
6. The method for detecting damage to the insulator in different environments based on the STEN network according to claim 5, wherein the step 4.2 is specifically as follows:
step 4.2.1, sending the obtained attention feature map of the OAAM into an improved yolov5 target detection network for prediction to obtain a sample anchor frame;
step 4.2.2, primarily screening the positive sample anchor frame according to the position of the central point of the sample anchor frame obtained in the step 4.2.1 by using a center prior method, eliminating a large number of negative samples with central points deviating from the target area, and using Euclidean distance as a standard for measuring the deviation degree, wherein the formula is shown as (8):
Figure FDA0003869151000000052
l (n) represents the Euclidean distance between the center point of the anchor frame and the center point of the real frame, and the obtained center point of the anchor frame is marked as { (a) n ,b n ) N =1,2,3, ·, k }, where k is the number of anchor frames, { (a) i ,b i ) The center point of a real frame is represented, and m represents the number of anchor frames;
step 4.2.3, extracting information of the positive sample anchor frame preliminarily screened in the step 4.2.2 to obtain the position, the category and the confidence information of the anchor frame, then calculating a Loss function by using the extracted positive sample anchor frame information and training data containing correct labels, calculating cost by using the Loss function, screening out a sample with the lowest cost as a positive sample, and selecting the optimal transmission Loss C of a positive label unit fg Is defined as:
Figure FDA0003869151000000061
where, theta is a parameter of the model,
Figure FDA0003869151000000062
and
Figure FDA0003869151000000063
indicating prediction category information and prediction location information,
Figure FDA0003869151000000064
and
Figure FDA0003869151000000065
representing true category information and true location information, L cls And L IoU The category loss and the position loss are shown, and alpha is a balance coefficient;
introducing a negative label cost into the cost, and transporting one unit of negative label from the background to the demander d j Cost C of negative sample label bg Is defined as:
Figure FDA0003869151000000066
where φ represents a negative sample label;
c is to be fg And C bg Connecting in one dimension to obtain the total loss matrix C epsilon R (m+1)×n For S i The value of (a) varies from constant k to the following formula:
Figure FDA0003869151000000067
from the currently known supply vector S e R m+1 And the demand vector d ∈ R n Obtaining an optimal allocation strategy pi through the existing Sinkhorn iteration * ∈R (m+1)×n I.e. the optimal allocation of positive and negative samples;
step 4.2.4, the yolov5 target detection model divides the original Loss functions into three types, namely Loss IOU ,Loss conf And Loss cls The composition of the original loss function is shown in formula (12):
Loss=Loss cls +Loss IOU +Loss conf (12)
the standard cross entropy loss function is shown in equation (13):
Figure FDA0003869151000000071
in the formula, alpha represents the probability value of the sample to the class prediction, and gamma represents the class of the sample label;
the balanced cross entropy loss function uses a balance coefficient beta to measure the weight of positive and negative samples, as shown in equation (14):
Figure FDA0003869151000000072
in Focal local, lambda and (1-. Alpha.) are used δ Adjust for sample imbalance as shown in equation (15):
Figure FDA0003869151000000073
the above equations (8) to (15) together constitute an improved yolov5 target detection network.
7. The method for detecting insulator damage in different environments based on STEN network as claimed in claim 6, wherein said step 4.4 is as follows:
step 4.4.1, firstly training the improved yolov5 target detection network, and carrying out contour detection on all pictures in a training set to obtain a marked contour point (x) i ,y i ) N, then picking the contour map, calculating the minimum bounding box of all contour maps, and the upper left corner of the minimum bounding box is seatedIs marked as (x) min ,y max ) The coordinate of the lower right corner is (x) max ,y min ) And performing loss calculation and precision calculation with an output result obtained after iterative training of the improved yolov5 target detection network obtained in the step 4.2, wherein the loss calculation is shown in formulas (12) to (15), and the precision calculation is shown in formulas (16) to (19);
step 4.4.2, training OAAM, and carrying out IOU (input output Unit) on the mask label of the target area obtained in the step 4.1.2 and the clustering result of the insulator defect area obtained in the step 4.1.3 mask Loss calculation when IOU mask When the value is not increased any more, the trained OAAM module, IOU, is obtained mask Calculating as shown in equation (7):
and 4.4.3, performing mu times of iterative training, storing the weight data with the optimal effect, and obtaining the test set reference network with the optimal weight data.
CN202211190509.8A 2022-09-28 2022-09-28 Method for detecting damage of insulator in different environments based on STEN network Pending CN115631411A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211190509.8A CN115631411A (en) 2022-09-28 2022-09-28 Method for detecting damage of insulator in different environments based on STEN network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211190509.8A CN115631411A (en) 2022-09-28 2022-09-28 Method for detecting damage of insulator in different environments based on STEN network

Publications (1)

Publication Number Publication Date
CN115631411A true CN115631411A (en) 2023-01-20

Family

ID=84905332

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211190509.8A Pending CN115631411A (en) 2022-09-28 2022-09-28 Method for detecting damage of insulator in different environments based on STEN network

Country Status (1)

Country Link
CN (1) CN115631411A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116895030A (en) * 2023-09-11 2023-10-17 西华大学 Insulator detection method based on target detection algorithm and attention mechanism
CN117408996A (en) * 2023-12-13 2024-01-16 山东锋士信息技术有限公司 Surface defect detection method based on defect concentration and edge weight loss

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116895030A (en) * 2023-09-11 2023-10-17 西华大学 Insulator detection method based on target detection algorithm and attention mechanism
CN116895030B (en) * 2023-09-11 2023-11-17 西华大学 Insulator detection method based on target detection algorithm and attention mechanism
CN117408996A (en) * 2023-12-13 2024-01-16 山东锋士信息技术有限公司 Surface defect detection method based on defect concentration and edge weight loss
CN117408996B (en) * 2023-12-13 2024-04-19 山东锋士信息技术有限公司 Surface defect detection method based on defect concentration and edge weight loss

Similar Documents

Publication Publication Date Title
CN108961235B (en) Defective insulator identification method based on YOLOv3 network and particle filter algorithm
CN111047554B (en) Composite insulator overheating defect detection method based on instance segmentation
CN110245678B (en) Image matching method based on heterogeneous twin region selection network
CN115631411A (en) Method for detecting damage of insulator in different environments based on STEN network
CN110827251A (en) Power transmission line locking pin defect detection method based on aerial image
CN111461083A (en) Rapid vehicle detection method based on deep learning
CN114283117A (en) Insulator defect detection method based on improved YOLOv3 convolutional neural network
CN113920107A (en) Insulator damage detection method based on improved yolov5 algorithm
CN109376580B (en) Electric power tower component identification method based on deep learning
CN112837315B (en) Deep learning-based transmission line insulator defect detection method
CN111680705B (en) MB-SSD method and MB-SSD feature extraction network suitable for target detection
CN110443279B (en) Unmanned aerial vehicle image vehicle detection method based on lightweight neural network
CN115147418B (en) Compression training method and device for defect detection model
CN113297915A (en) Insulator recognition target detection method based on unmanned aerial vehicle inspection
CN116863274A (en) Semi-supervised learning-based steel plate surface defect detection method and system
CN116385958A (en) Edge intelligent detection method for power grid inspection and monitoring
CN116597224A (en) Potato defect detection method based on improved YOLO V8 network model
CN111652846A (en) Semiconductor defect identification method based on characteristic pyramid convolution neural network
CN115049945A (en) Method and device for extracting lodging area of wheat based on unmanned aerial vehicle image
CN113962973A (en) Power transmission line unmanned aerial vehicle intelligent inspection system and method based on satellite technology
CN116994161A (en) Insulator defect detection method based on improved YOLOv5
CN111179278B (en) Image detection method, device, equipment and storage medium
CN117541534A (en) Power transmission line inspection method based on unmanned plane and CNN-BiLSTM model
CN116363610A (en) Improved YOLOv 5-based aerial vehicle rotating target detection method
CN115861595A (en) Multi-scale domain self-adaptive heterogeneous image matching method based on deep learning

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination