CN114821368A - Power defect detection method based on reinforcement learning and Transformer - Google Patents
Power defect detection method based on reinforcement learning and Transformer Download PDFInfo
- Publication number
- CN114821368A CN114821368A CN202210482372.7A CN202210482372A CN114821368A CN 114821368 A CN114821368 A CN 114821368A CN 202210482372 A CN202210482372 A CN 202210482372A CN 114821368 A CN114821368 A CN 114821368A
- Authority
- CN
- China
- Prior art keywords
- vector
- image
- transformer
- feature
- network
- 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.)
- Granted
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 34
- 230000002787 reinforcement Effects 0.000 title claims abstract description 32
- 230000007547 defect Effects 0.000 title claims abstract description 20
- 239000013598 vector Substances 0.000 claims abstract description 90
- 238000000034 method Methods 0.000 claims abstract description 28
- 238000012549 training Methods 0.000 claims description 31
- 238000000605 extraction Methods 0.000 claims description 22
- 230000009471 action Effects 0.000 claims description 21
- 238000010586 diagram Methods 0.000 claims description 18
- 230000002776 aggregation Effects 0.000 claims description 17
- 238000004220 aggregation Methods 0.000 claims description 17
- 238000010606 normalization Methods 0.000 claims description 17
- 230000006870 function Effects 0.000 claims description 15
- 238000012545 processing Methods 0.000 claims description 9
- 238000007689 inspection Methods 0.000 claims description 7
- 239000011159 matrix material Substances 0.000 claims description 7
- 230000007246 mechanism Effects 0.000 claims description 6
- 230000006835 compression Effects 0.000 claims description 4
- 238000007906 compression Methods 0.000 claims description 4
- 238000013527 convolutional neural network Methods 0.000 claims description 4
- 238000011176 pooling Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 claims description 4
- 230000004913 activation Effects 0.000 claims description 3
- 238000002372 labelling Methods 0.000 claims description 3
- 238000012216 screening Methods 0.000 claims description 3
- 238000013135 deep learning Methods 0.000 abstract description 5
- 230000003416 augmentation Effects 0.000 abstract 1
- 239000012212 insulator Substances 0.000 description 10
- 230000005540 biological transmission Effects 0.000 description 8
- 238000004364 calculation method Methods 0.000 description 7
- 238000011160 research Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 208000025274 Lightning injury Diseases 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000012512 characterization method Methods 0.000 description 1
- 230000007797 corrosion Effects 0.000 description 1
- 238000005260 corrosion Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000006116 polymerization reaction Methods 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 238000012876 topography Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/10—Terrestrial scenes
- G06V20/17—Terrestrial scenes taken from planes or by drones
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
- G06V10/765—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects using rules for classification or partitioning the feature space
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing 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/774—Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/40—Scenes; Scene-specific elements in video content
- G06V20/41—Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/40—Scenes; Scene-specific elements in video content
- G06V20/46—Extracting features or characteristics from the video content, e.g. video fingerprints, representative shots or key frames
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y04—INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
- Y04S—SYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
- Y04S10/00—Systems supporting electrical power generation, transmission or distribution
- Y04S10/50—Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Software Systems (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Computing Systems (AREA)
- Computational Linguistics (AREA)
- Databases & Information Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Medical Informatics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Data Mining & Analysis (AREA)
- Molecular Biology (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Remote Sensing (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a power defect identification method based on reinforcement learning and Transformer, which comprises the following steps: 1, acquiring an original data set by an unmanned aerial vehicle aerial photography, and generating a confrontation network augmentation data set through deep convolution; 2, extracting image features by using a reinforcement learning module to search a foreground region; and 3, compressing the feature vector of the background region through a Transformer module, further extracting features, and finally obtaining a final prediction result through a full connection layer. The invention realizes the detection of the electric power defect area by utilizing deep learning, thereby reducing the labor cost, being not influenced by external factors such as weather, background and the like, and improving the detection efficiency and the detection precision.
Description
Technical Field
The invention relates to the field of deep learning, in particular to a power defect detection method based on reinforcement learning and a Transformer.
Background
With the continuous increase of the power demand in China, the scale of the power transmission line is rapidly enlarged, and the power transmission line is exposed in a complex natural environment for a long time and is interfered by natural conditions such as rainwater corrosion, lightning stroke and the like, so that various faults are easy to occur, and the safe and stable operation of a power grid is influenced. Therefore, the high-efficiency inspection of the power transmission line is important for ensuring normal operation of production and life.
Many transmission lines erect in the region of rare people, and the topography is complicated, and the cost and the degree of difficulty that traditional manual work was patrolled and examined are all higher. Therefore, many areas adopt unmanned aerial vehicle to carry on image acquisition device's mode, gather transmission line's image and video data fast to the work load is patrolled and examined in significantly reducing. However, because the aerial images are large in quantity and complex in background, when workers adopt manual judgment, the efficiency is low, judgment errors are easy to occur, and the requirement of routing inspection is difficult to meet. Therefore, the research of the power transmission line detection fault detection method based on the aerial image of the unmanned aerial vehicle has important theoretical and practical values.
With the continuous development of unmanned aerial vehicle technology and computer technology, research on detection in the aspect of power transmission lines at home and abroad has made a certain progress, and the method can be divided into a traditional image processing method and a deep learning method according to the principle of an identification algorithm. Feature extraction in traditional image processing methods mainly relies on artificially designed extractors. The document [ frequency tuning-based insulator identification and positioning ] provides a frequency tuning-based insulator identification and positioning algorithm, and the insulator positioning in a complex background is realized by threshold segmentation in HSV color space and calculation of significance information of a target object by using a frequency tuning method. The document [ a contact network insulator identification method based on Canny edge feature points ] provides a contact network insulator identification method based on Canny edge feature points, and the intelligent identification of the contact network insulator is realized by extracting image edge features by using Canny and extracting feature points on an edge image by using an SURF algorithm. However, the traditional algorithm excessively depends on manually designing an extractor, the calculation amount is large, and the detection precision and speed can not meet the requirements of practical application.
With the continuous improvement of computer computing ability, deep learning is continuously applied in new fields, and gradually becomes mainstream due to good generalization and characterization ability. Currently, a model based on a combined significant region and a Fast-CNN is used for insulator characteristic detection research, so that the insulator working state detection effect in a power transmission line is improved; according to the insulator defect detection method of the lightweight YOLOV3, an improved lightweight network is constructed by a framework, and insulator positioning and fault detection are realized. In the methods, the power failure detection is performed by using the reinforcement learning model, so that the detection performance is greatly improved compared with the traditional method, but the following problems exist: 1) the data sets are relatively few, and the general performance of the trained model under different environments is poor; 2) a final prediction result is obtained through a deep network, and the information of a small target object cannot be reconstructed, so that the detection precision is influenced; 3) the prior frame needs to be set for detection, the performance is greatly influenced by the design of the prior frame, and meanwhile, the calculation related to the anchor window in training and detection occupies a large amount of calculation resources, so that the method cannot be well adapted to circuit inspection tasks in various different environments; 4) background-independent detection occupies a large amount of computing resources, and influences the final detection result.
Disclosure of Invention
Aiming at the defects of the prior art, the invention aims to solve the problems of poor universality, excessive dependence on a priori frame, occupation of computing resources by irrelevant background, influence on precision and the like in different environments of the conventional power defect detection method, and provides a depth-based power defect detection method so as to realize intelligent power defect inspection, reduce labor cost and improve detection efficiency and detection accuracy.
The invention adopts the following technical scheme for solving the technical problems:
the invention discloses a power defect identification method based on reinforcement learning and a Transformer, which is characterized by comprising the following steps of:
step 1, collecting an electric power inspection aerial image set, using a depth convolution to generate a countermeasure network for data enhancement to obtain an expanded image data set, standardizing the expanded image data set, and labeling each standardized image with a target detection frame to obtain a training data set;
step 2, constructing a reinforcement learning module for screening foreground regions and background regions, inputting the training data set into the reinforcement learning module for training, and obtaining a foreground region characteristic vector set F of the ith image in the training data set i,f And background region vector set F i,b ;
Step 3, according to the foreground characteristic vector set F of the ith image i,f And background region vector set F i,b Using bilinear pooling layer to assemble F vector to the background region i,b Performing information compression on the non-key area to obtain a feature vector set F with the number of M i,c Then the foreground feature vector set F i,f After the connection, a new vector combination F is obtained i * ;
Step 4, combining the new vectors of the ith image F i * Inputting the feature into a Transformer module for feature extraction to obtain a feature map T i And then, processing the characteristic diagram by using a full connection layer, and outputting a prediction result, so that a loss function is constructed according to the prediction result and a real result, the loss function is used for training parameters of the Transformer module, and finally the trained Transformer module is obtained and used for identifying the power defect.
The method for identifying an electric power defect according to the present invention is also characterized in that the step 2 includes:
step 2.1, constructing a reinforcement learning module, comprising: a main network and a DQN network for extracting the characteristics of the DetNet; randomly initializing parameters of the reinforcement learning module;
the main network is a convolutional neural network constructed based on hole convolution and comprises X convolutional blocks; wherein, the x-th convolution block is formed by a convolution kernel with the size of c 1 Having a common convolution layer, a convolution kernel size of c 2 Has a hole convolution layer and a convolution kernel size of c 2 Wherein, a batch normalization layer and a ReLu activation function are connected behind each convolution block;
the DQN network composition consists of a fully connected network;
2.2, setting the space of an experience pool D according to the number of pictures in the training data set, and initializing the experience pool D;
step 2.3, inputting the ith image with the target detection frame in the training data set into the extraction trunk network for feature extraction to obtain a feature map F with the size of C multiplied by n i (ii) a C represents a characteristic diagram F i N represents a feature map F i Length or width of (d);
step 2.4, the characteristic diagram F is processed i Dividing the motion space into n multiplied by n block unit areas with equal size, wherein each block unit area represents one motion selection, and obtaining a motion space marked as A i ={a i,1 ,a i,2 ,,...,a i,t ,...,a i,n×n },a i,t An operation for selecting the t-th unit area in the ith image;
step 2.5, calculating the reward score r of the unit area selected by the t action in the ith image by using the formula (1) i,t Thereby obtaining the characteristic diagram F i Is rewarding function J i ={j i,1 ,j i,2 ,,...,j i,t ,...,j i,n×n };
In the formula (1), Δ i,t Representing the number of target object pixels contained in the t unit area in the ith image; delta i,all Representing the total number of pixels of the t-th unit area in the ith image;
step 2.6, setting the characteristic diagram F i State space s of i ;
Step 2.7, inputting the state space into the DQN network, obtaining the score of each action in the action space, selecting the K actions with the highest score by a greedy strategy, and selecting the actions from the state space s i And K actions of it constitute a Q value table Q(s) i ,a i );
And calculating K reward values obtained under the current K actions according to a reward function R, so as to obtainAnd K prize values and Q values table Q(s) i ,a i ) The formed ith tuple is stored in an experience pool D;
step 2.8, sequentially processing all images in the training data set according to the process from the step 2.3 to the step 2.7, thereby filling the experience pool D;
2.9, randomly selecting the G group in the experience pool D, and updating parameters in the primary reinforcement learning module by using a back propagation algorithm;
step 2.10, z is performed according to the procedure from step 2.3 to step 2.9 1 And storing the final reinforcement learning module after secondary updating, inputting the images in the training data set into the final reinforcement learning module, and outputting a final feature map F 'from the ith image' i Selecting the feature map F' i Taking the K unit areas with the highest medium reward value as a foreground area feature vector set F i,f ={f i,f,l And 1., K, with the remaining unit area as the background area vector set F i,b ={f i,b,r 1, ·, n × n-K }; wherein f is i,f,l Feature vectors representing the ith foreground region in the ith image, f i,b,r A feature vector representing the r-th background region in the i-th image.
The step 3 comprises the following steps:
step 3.1, obtaining an aggregation weight vector a corresponding to the r background region vector in the ith image by using the formula (2) i,r :
a i,r =f i,b,r W a (2)
In the formula (2), W a Representing a weight matrix with one dimension of C multiplied by M; a is i,r ={a i,r,m 1,. and M, wherein M represents a compressed vector dimension; a is i,r,m Is an aggregate weight vector a i,r The mth element in the ith image represents the mth aggregation weight corresponding to the characteristic vector of the mth background area in the ith image;
step 3.2, utilizing the formula (3) to perform the m-th aggregation weight a corresponding to the r-th background region feature vector in the i-th image i,r,m Carrying out standardization processing to obtain the r-th background region feature vector pair in the ith imageCorresponding mth normalized polymerization weight a' i,r,m :
In the formula (3), a i,r',m The mth aggregation weight corresponding to the characteristic vector of the mth background area in the ith image is shown,the m-th aggregation weight sum of all the background region feature vectors in the i-th image is represented;
step 3.2, obtaining the r characteristic projection vector f 'in the i image by using the formula (4)' i,r :
f′ i,r =f i,r W v (4)
In the formula (4), W v Representing a weight matrix with one dimension of C multiplied by C;
step 3.3, obtaining the m-th compressed feature vector f in the ith image by using the formula (5) i,m Thereby obtaining a compressed background region feature vector set F i,c ={f i,m ,|m=1,...,M}:
In formula (5), a represents convolution between vectors.
The step 4 specifically comprises the steps of:
step 4.1, constructing a Transformer module, which comprises the following steps: a Transformer feature extraction network and an end-to-end detector; and randomly initializing parameters of the Transformer module;
the Transformer feature extraction network branch is Y Transformer blocks constructed based on Transformer-encode, wherein the Y Transformer block sequentially comprises a first normalization layer, a multi-head self-attention mechanism layer, a second normalization layer and a multi-layer perceptron, wherein the input of the first normalization layer is in jump connection with the output of the multi-head attention mechanism layer, and the input of the second normalization layer is in jump connection with the output of the multi-layer perceptron;
the end-to-end detector is comprised of a fully connected network;
step 4.2, collecting the new vector F of the ith image i * Sending the data into the Transformer feature extraction network, and obtaining a feature map T with highly concentrated information after feature extraction of Y Transformer blocks in sequence i Then the characteristic diagram T is used i Inputting the data into the end-to-end detector for prediction to obtain a prediction result.
Compared with the prior art, the invention has the beneficial effects that:
1. the method applies the deep convolution to generate the confrontation network to data enhancement, generates the picture through the training deep learning network, improves the size of the data set, and improves the generalization performance of the model under different environments.
2. According to the method, the cavity convolution is used for feature extraction, on the premise that pooling loss information is avoided, the receptive field is enlarged, each convolution output contains information in a large range, and compared with common convolution, the sensing capability of small target objects and the positioning capability of large target objects are improved.
3. According to the method, the key area is extracted from the characteristic diagram by using reinforcement learning, and the characteristic diagram of the background area is compressed by adopting the bilinear layer, so that the calculation proportion of irrelevant background information in a transform network is reduced, the calculation speed is increased, and the influence of irrelevant information vectors on the final detection result is reduced.
4. The method finally and directly outputs the final detection result through a group of feedforward networks, avoids the dependence of detection precision on the design of the anchor frame when the anchor frame is adopted in the traditional method and the unbalance problem of the positive anchor frame and the negative anchor frame in the training process by using a prior frame, and improves the efficiency and the precision of calculation.
Drawings
FIG. 1 is a flow chart of the algorithm of the present invention.
Detailed Description
In this embodiment, referring to fig. 1, a method for identifying an electrical defect based on reinforcement learning and a Transformer is performed according to the following steps:
step 1, collecting an electric power inspection aerial image set, using a depth convolution to generate a countermeasure network for data enhancement to obtain an expanded image data set, standardizing the expanded image data set, and labeling each standardized image with a target detection frame to obtain a training data set; in this embodiment, there are 8192 pictures in the training data set;
step 2, constructing a reinforcement learning module for screening the foreground region and the background region, inputting the training data set into the reinforcement learning module for training, and obtaining a foreground region characteristic vector set F of the ith image in the training data set i,f And background region vector set F i,b ;
Step 2.1, constructing a reinforcement learning module, comprising: a main network and a DQN network for extracting the characteristics of the DetNet; randomly initializing parameters of the reinforcement learning module;
the main network is a convolutional neural network constructed based on the hole convolution and comprises X convolutional blocks; wherein, the x-th convolution block is formed by a convolution kernel with the size of c 1 ×c 1 Has a common convolution, with a convolution kernel size of c 2 ×c 2 Has a hole convolution layer and a convolution kernel size of c 3 ×c 3 Wherein, each convolution block is connected with a batch normalization layer and a ReLu activation function; in this embodiment, the size of X is 6, and the size of the xth convolution block is c 1 =1、c 2 3 and c 3 =1。
The DQN network consists of fully connected networks;
2.2, setting the space of an experience pool D according to the number of pictures in the training data set, and initializing the experience pool D; in this embodiment, the spatial size of the experience pool D is 8192.
Step 2.3, inputting the ith image with the target detection frame in the training data set into an extraction trunk network for feature extraction to obtain a feature map F with the size of C multiplied by n i (ii) a C represents the number of channels of the feature map F, n represents the feature map F i Length or width of (d); in this embodiment, the number C of feature map channels is 256, and the length n is 28;
step 2.4, converting the characteristic diagram F i Dividing the motion space into n multiplied by n block unit areas with equal size, wherein each block unit area represents one motion selection, and obtaining a motion space marked as A i ={a i,1 ,a i,2 ,,...,a i,t ,...,a i,n×n },a i,t An operation for selecting the t-th unit region in the ith picture; in this embodiment, the feature map is divided into 28 × 28 block unit areas;
step 2.5, calculating the reward score r of the unit area selected by the t-th action in the ith picture by using the formula (1) i,t Thereby obtaining the reward function J of the characteristic diagram F i ={j i,1 ,j i,2 ,,...,j i,t ,...,j i,n×n };
In the formula (1), Δ i,t Representing the number of target object pixels contained in the t unit area in the ith picture; delta i,all Representing the total number of pixels of the t unit area in the ith picture;
step 2.6, setting a characteristic diagram F i State space s of i ;
Step 2.7, inputting the state space into the DQN network, obtaining the score of each action in the action space, selecting the K actions with the highest score by using a greedy strategy, and selecting the actions from the state space s i And K actions of it constitute a Q value table Q(s) i ,a i );
And calculating K rewards obtained under the current K actions according to a reward function RValues, and thus K prize values and Q values table Q(s) i ,a i ) The formed ith tuple is stored in an experience pool D; in this embodiment, the value of K is set to 260, i.e., 260 actions with the highest scores are selected by using a greedy strategy;
step 2.8, sequentially processing all images in the training data set according to the process from the step 2.3 to the step 2.7, thereby filling the experience pool D;
2.9, randomly selecting the G group in the experience pool D, and updating parameters in the primary reinforcement learning module by using a back propagation algorithm;
step 2.10, z is performed according to the procedure from step 2.3 to step 2.9 1 And storing the final reinforcement learning module after secondary updating, inputting the images in the training data set into the final reinforcement learning module, and outputting a final feature map F 'from the ith image' i Selecting a feature map F' i Taking the K unit areas with the highest medium reward value as a foreground area feature vector set F i,f ={f i,f,l And 1., K, with the remaining unit area as the background area vector set F i,b ={f i,b,r 1, ·, n × n-K }; wherein f is i,f,l Feature vectors representing the ith foreground region in the ith image, f i,b,r A feature vector representing the r-th background region in the i-th image. In this embodiment, the reinforcement learning module trains the iteration number z 1 At 200, the foreground region feature vector set comprises 260 feature vectors, and the background region vector feature comprises 524 feature vectors;
step 3, according to the foreground characteristic vector set F of the ith image i,f And background region vector set F i,b Using bilinear pooling layer to set F of background region vectors i,b Performing information compression on the non-key area to obtain a feature vector set F with the number of M i,c Then, the foreground feature vector set F is obtained i,f After the connection, a new vector combination F is obtained i * ;
Step 3.1, obtaining an aggregation weight vector a corresponding to the r background region vector in the ith image by using the formula (2) i,r :
a i,r =f i,b,r W a (2)
In the formula (2), W a Representing a weight matrix with one dimension of C multiplied by M; a is i,r ={a i,r,m 1,. and M, wherein M represents a compressed vector dimension; a is i,r,m Is an aggregate weight vector a i,r The mth element in the ith image represents the mth aggregation weight corresponding to the characteristic vector of the mth background area in the ith image; the vector dimension M after compression in this embodiment is 60;
step 3.2, utilizing the formula (3) to perform the m-th aggregation weight a corresponding to the r-th background region feature vector in the i-th image i,r,m Carrying out normalization processing to obtain an m < th > normalized aggregation weight a 'corresponding to the r < th > background region feature vector in the i < th > image' i,r,m :
In the formula (3), a i,r',m The mth aggregation weight corresponding to the characteristic vector of the mth background area in the ith image is shown,the m-th aggregation weight sum of all the background region feature vectors in the i-th image is represented; thus changing the dimensionality and projecting the r vectors into the M vectors;
step 3.3, obtaining the r characteristic projection vector f 'in the i image by using the formula (4)' i,r :
f′ i,r =f i,r W v (4)
In the formula (4), W v Representing a weight matrix with one dimension of C multiplied by C; in this embodiment, W v Is a weight matrix with dimension of 256 multiplied by 256;
step 3.4, obtaining the m-th compressed feature vector f in the ith image by using the formula (5) i,m Thereby obtaining a compressed background region feature vector set F i,c ={f i,m ,|m=1,...,M}:
In formula (5), a represents convolution between vectors.
Step 4, combining the new vectors of the ith image F i * Inputting the feature into a Transformer module for feature extraction to obtain a feature map T i And then, processing the characteristic diagram by using the full connection layer, and outputting a prediction result, so that a loss function is constructed according to the prediction result and a real result, the loss function is used for training parameters of the Transformer module, and finally the trained Transformer module is obtained and used for identifying the power defect.
Step 4.1, constructing a Transformer module, comprising the following steps: a Transformer feature extraction network and an end-to-end detector; randomly initializing parameters of a Transformer module;
the Transformer feature extraction network branch is Y Transformer blocks constructed based on Transformer-encode, wherein the Y Transformer block sequentially consists of a first normalization layer, a multi-head self-attention mechanism layer, a second normalization layer and a multi-layer perceptron, wherein the input of the first normalization layer is in jump connection with the output of the multi-head attention mechanism layer, and the input of the second normalization layer is in jump connection with the output of the multi-layer perceptron; in this embodiment, the number Y of transform blocks is 6;
the end-to-end detector consists of a fully connected network; in this embodiment, the fully connected network is formed of three layers;
step 4.2, collecting the new vector F of the ith image i * Sending the data into a Transformer feature extraction network, and sequentially extracting the features of Y Transformer blocks to obtain a feature map T with highly concentrated information i Then, the feature map T is used i Inputting the data into an end-to-end detector for prediction to obtain a prediction result.
Claims (4)
1. A reinforcement learning and Transformer-based electric power defect identification method is characterized by comprising the following steps:
step 1, collecting an electric power inspection aerial image set, using a depth convolution to generate a countermeasure network for data enhancement to obtain an expanded image data set, standardizing the expanded image data set, and labeling each standardized image with a target detection frame to obtain a training data set;
step 2, constructing a reinforcement learning module for screening foreground regions and background regions, inputting the training data set into the reinforcement learning module for training, and obtaining a foreground region characteristic vector set F of the ith image in the training data set i,f And background region vector set F i,b ;
Step 3, according to the foreground characteristic vector set F of the ith image i,f And background region vector set F i,b Using bilinear pooling layer to assemble F vector to the background region i,b Performing information compression on the non-key area to obtain a feature vector set F with the number of M i,c Then the foreground feature vector set F i,f After the connection, a new vector combination F is obtained i * ;
Step 4, combining the new vectors of the ith image F i * Inputting the feature into a Transformer module for feature extraction to obtain a feature map T i And then, processing the characteristic diagram by using a full connection layer, and outputting a prediction result, so that a loss function is constructed according to the prediction result and a real result, the loss function is used for training parameters of the Transformer module, and finally the trained Transformer module is obtained and used for identifying the power defect.
2. The power defect identification method according to claim 1, wherein the step 2 comprises:
step 2.1, constructing a reinforcement learning module, comprising: a main network and a DQN network for extracting the characteristics of the DetNet; randomly initializing parameters of the reinforcement learning module;
the main network is a convolutional neural network constructed based on hole convolution and comprises X convolutional blocks; wherein, the x-th convolution block is sequentially formed by the sizes of convolution kernelsIs c 1 Having a common convolution layer, a convolution kernel size of c 2 Has a hole convolution layer and a convolution kernel size of c 2 Wherein, a batch normalization layer and a ReLu activation function are connected behind each convolution block;
the DQN network composition consists of a fully connected network;
2.2, setting the space of an experience pool D according to the number of pictures in the training data set, and initializing the experience pool D;
step 2.3, inputting the ith image with the target detection frame in the training data set into the extraction trunk network for feature extraction to obtain a feature map F with the size of C multiplied by n i (ii) a C represents a characteristic diagram F i N represents a feature map F i Length or width of (d);
step 2.4, the characteristic diagram F is processed i Dividing the motion space into n multiplied by n block unit areas with equal size, wherein each block unit area represents one motion selection, and obtaining a motion space marked as A i ={a i,1 ,a i,2 ,,...,a i,t ,...,a i,n×n },a i,t An operation for selecting the t-th unit area in the ith image;
step 2.5, calculating the reward score r of the unit area selected by the t action in the ith image by using the formula (1) i,t Thereby obtaining the characteristic diagram F i Is rewarding function J i ={j i,1 ,j i,2 ,,...,j i,t ,...,j i,n×n };
In the formula (1), Δ i,t Representing the number of target object pixels contained in the t unit area in the ith image; delta i,all Representing the total number of pixels of the t-th unit area in the ith image;
step 2.6, setting the characteristic diagram F i State space s of i ;
Step 2.7, input the state space intoIn the DQN network, the score of each action in the action space is obtained, K actions with the highest score are selected by a greedy strategy, and the state space s i And K actions of it constitute a Q value table Q(s) i ,a i );
And calculating K reward values obtained under the current K actions according to the reward function R, thereby obtaining K reward values and a Q value table Q(s) i ,a i ) The formed ith tuple is stored in an experience pool D;
step 2.8, sequentially processing all images in the training data set according to the process from the step 2.3 to the step 2.7, thereby filling the experience pool D;
2.9, randomly selecting the G group in the experience pool D, and updating parameters in the primary reinforcement learning module by using a back propagation algorithm;
step 2.10, z is performed according to the procedure from step 2.3 to step 2.9 1 And storing the final reinforcement learning module after secondary updating, inputting the images in the training data set into the final reinforcement learning module, and outputting a final feature map F 'from the ith image' i Selecting the feature map F' i Taking the K unit areas with the highest medium reward value as a foreground area feature vector set F i,f ={f i,f,l And 1., K, with the remaining unit area as the background area vector set F i,b ={f i,b,r 1, ·, n × n-K }; wherein f is i,f,l Feature vectors representing the ith foreground region in the ith image, f i,b,r A feature vector representing the r-th background region in the i-th image.
3. The power defect identification method according to claim 1, wherein the step 3 comprises:
step 3.1, obtaining an aggregation weight vector a corresponding to the r background region vector in the ith image by using the formula (2) i,r :
a i,r =f i,b,r W a (2)
In the formula (2), W a Representing a weight matrix with one dimension of C multiplied by M; a is i,r ={a i,r,m |m=1,...,M},MRepresenting the compressed vector dimensions; a is i,r,m Is an aggregate weight vector a i,r The mth element in the ith image represents the mth aggregation weight corresponding to the characteristic vector of the mth background area in the ith image;
step 3.2, utilizing the formula (3) to perform the m-th aggregation weight a corresponding to the r-th background region feature vector in the i-th image i,r,m Carrying out normalization processing to obtain an m < th > normalized aggregation weight a 'corresponding to the r < th > background region feature vector in the i < th > image' i,r,m :
In the formula (3), a i,r',m The mth aggregation weight corresponding to the characteristic vector of the mth background area in the ith image is shown,the m-th aggregation weight sum of all the background region feature vectors in the i-th image is represented;
step 3.2, obtaining the r characteristic projection vector f 'in the i image by using the formula (4)' i,r :
f′ i,r =f i,r W v (4)
In the formula (4), W v Representing a weight matrix with one dimension of C multiplied by C;
step 3.3, obtaining the m-th compressed feature vector f in the ith image by using the formula (5) i,m Thereby obtaining a compressed background region feature vector set F i,c ={f i,m ,|m=1,...,M}:
In formula (5), a represents convolution between vectors.
4. The method for identifying the power defect according to claim 1, wherein the step 4 specifically comprises the steps of:
step 4.1, constructing a Transformer module, comprising the following steps: a Transformer feature extraction network and an end-to-end detector; and randomly initializing parameters of the Transformer module;
the Transformer feature extraction network branch is Y Transformer blocks constructed based on Transformer-encode, wherein the Y Transformer block sequentially comprises a first normalization layer, a multi-head self-attention mechanism layer, a second normalization layer and a multi-layer perceptron, wherein the input of the first normalization layer is in jump connection with the output of the multi-head attention mechanism layer, and the input of the second normalization layer is in jump connection with the output of the multi-layer perceptron;
the end-to-end detector is comprised of a fully connected network;
step 4.2, collecting the new vector F of the ith image i * Sending the data into the Transformer feature extraction network, and obtaining a feature map T with highly concentrated information after feature extraction of Y Transformer blocks in sequence i Then the characteristic diagram T is used i Inputting the data into the end-to-end detector for prediction to obtain a prediction result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210482372.7A CN114821368B (en) | 2022-05-05 | 2022-05-05 | Electric power defect detection method based on reinforcement learning and transducer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210482372.7A CN114821368B (en) | 2022-05-05 | 2022-05-05 | Electric power defect detection method based on reinforcement learning and transducer |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114821368A true CN114821368A (en) | 2022-07-29 |
CN114821368B CN114821368B (en) | 2024-03-01 |
Family
ID=82510615
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210482372.7A Active CN114821368B (en) | 2022-05-05 | 2022-05-05 | Electric power defect detection method based on reinforcement learning and transducer |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114821368B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117094705A (en) * | 2023-10-19 | 2023-11-21 | 国网安徽省电力有限公司电力科学研究院 | Method, system and equipment for predicting defects of high-voltage switch cabinet |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11045271B1 (en) * | 2021-02-09 | 2021-06-29 | Bao Q Tran | Robotic medical system |
WO2021244079A1 (en) * | 2020-06-02 | 2021-12-09 | 苏州科技大学 | Method for detecting image target in smart home environment |
CN113808123A (en) * | 2021-09-27 | 2021-12-17 | 杭州跨视科技有限公司 | Machine vision-based dynamic detection method for liquid medicine bag |
CN114066820A (en) * | 2021-10-26 | 2022-02-18 | 武汉纺织大学 | Fabric defect detection method based on Swin-transducer and NAS-FPN |
-
2022
- 2022-05-05 CN CN202210482372.7A patent/CN114821368B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021244079A1 (en) * | 2020-06-02 | 2021-12-09 | 苏州科技大学 | Method for detecting image target in smart home environment |
US11045271B1 (en) * | 2021-02-09 | 2021-06-29 | Bao Q Tran | Robotic medical system |
CN113808123A (en) * | 2021-09-27 | 2021-12-17 | 杭州跨视科技有限公司 | Machine vision-based dynamic detection method for liquid medicine bag |
CN114066820A (en) * | 2021-10-26 | 2022-02-18 | 武汉纺织大学 | Fabric defect detection method based on Swin-transducer and NAS-FPN |
Non-Patent Citations (1)
Title |
---|
王刘旺;周自强;林龙;韩嘉佳;: "人工智能在变电站运维管理中的应用综述", 高电压技术, no. 01, 31 January 2020 (2020-01-31) * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117094705A (en) * | 2023-10-19 | 2023-11-21 | 国网安徽省电力有限公司电力科学研究院 | Method, system and equipment for predicting defects of high-voltage switch cabinet |
CN117094705B (en) * | 2023-10-19 | 2024-01-02 | 国网安徽省电力有限公司电力科学研究院 | Method, system and equipment for predicting defects of high-voltage switch cabinet |
Also Published As
Publication number | Publication date |
---|---|
CN114821368B (en) | 2024-03-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111062951B (en) | Knowledge distillation method based on semantic segmentation intra-class feature difference | |
CN109241982B (en) | Target detection method based on deep and shallow layer convolutional neural network | |
CN110930342B (en) | Depth map super-resolution reconstruction network construction method based on color map guidance | |
CN109146944B (en) | Visual depth estimation method based on depth separable convolutional neural network | |
CN112489164B (en) | Image coloring method based on improved depth separable convolutional neural network | |
CN111242844B (en) | Image processing method, device, server and storage medium | |
CN112785636B (en) | Multi-scale enhanced monocular depth estimation method | |
CN113066089B (en) | Real-time image semantic segmentation method based on attention guide mechanism | |
CN110009700B (en) | Convolutional neural network visual depth estimation method based on RGB (red, green and blue) graph and gradient graph | |
CN113449691A (en) | Human shape recognition system and method based on non-local attention mechanism | |
CN113554032A (en) | Remote sensing image segmentation method based on multi-path parallel network of high perception | |
CN113901928A (en) | Target detection method based on dynamic super-resolution, and power transmission line component detection method and system | |
CN114821368A (en) | Power defect detection method based on reinforcement learning and Transformer | |
CN114529793A (en) | Depth image restoration system and method based on gating cycle feature fusion | |
CN114581789A (en) | Hyperspectral image classification method and system | |
CN116523888B (en) | Pavement crack detection method, device, equipment and medium | |
CN116977631A (en) | Streetscape semantic segmentation method based on DeepLabV3+ | |
CN108596831B (en) | Super-resolution reconstruction method based on AdaBoost example regression | |
CN115331081A (en) | Image target detection method and device | |
CN111681176B (en) | Self-adaptive convolution residual error correction single image rain removing method | |
CN113240589A (en) | Image defogging method and system based on multi-scale feature fusion | |
CN112308772B (en) | Super-resolution reconstruction method based on deep learning local and non-local information | |
CN113239771A (en) | Attitude estimation method, system and application thereof | |
CN111899161A (en) | Super-resolution reconstruction method | |
CN115147774B (en) | Pedestrian re-identification method based on characteristic alignment in degradation environment |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |