CN112184654A - High-voltage line insulator defect detection method based on generation countermeasure network - Google Patents

High-voltage line insulator defect detection method based on generation countermeasure network Download PDF

Info

Publication number
CN112184654A
CN112184654A CN202011015019.5A CN202011015019A CN112184654A CN 112184654 A CN112184654 A CN 112184654A CN 202011015019 A CN202011015019 A CN 202011015019A CN 112184654 A CN112184654 A CN 112184654A
Authority
CN
China
Prior art keywords
image
network
insulator
model
ganomaly
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
CN202011015019.5A
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.)
Shanghai University of Electric Power
Shanghai Electric Power University
University of Shanghai for Science and Technology
Original Assignee
Shanghai Electric Power 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 Shanghai Electric Power University filed Critical Shanghai Electric Power University
Priority to CN202011015019.5A priority Critical patent/CN112184654A/en
Publication of CN112184654A publication Critical patent/CN112184654A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/95Investigating the presence of flaws or contamination characterised by the material or shape of the object to be examined
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8883Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges involving the calculation of gauges, generating models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • General Health & Medical Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Pathology (AREA)
  • Immunology (AREA)
  • Biochemistry (AREA)
  • Analytical Chemistry (AREA)
  • Biomedical Technology (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Signal Processing (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to a high-voltage line insulator defect detection method based on a generation countermeasure network, which comprises the following steps: establishing an image data set; constructing an improved GANOMaly model, and sending the feature maps output by each convolution layer in the encoder sub-network into the decoder sub-network for feature fusion by the improved GANOMaly model; constructing a loss function of an improved GANOMaly model; training an improved GANOMaly model; sending the insulator images with defects in the test set into a trained improved GANOMaly model to obtain a self-adaptive threshold; and sending the insulator image to be detected into a trained improved GANOMaly model to judge the type of the image. Compared with the prior art, the method solves the problems that the number of load examples in the insulator image is small, the load examples are difficult to collect, a great deal of effort is needed to label data, and the like, and improves the feasibility and the adaptability of the training process.

Description

High-voltage line insulator defect detection method based on generation countermeasure network
Technical Field
The invention relates to the field of insulator defect detection, in particular to a high-voltage line insulator defect detection method based on a generation countermeasure network.
Background
Insulators are important devices for electrically isolating and mechanically securing electrical wires in high voltage transmission systems. Insulator faults directly threaten the stability and safety of the transmission line. Statistically, the percentage of accidents caused by insulator defects accounts for the highest power system failures. Therefore, it is very important to detect the insulator defect intelligently and timely. In recent years, with the emergence of high-altitude operation platforms such as helicopters and unmanned aerial vehicles, the high-efficiency, accurate and safe operation of the high-altitude operation platforms becomes an important tool for detecting power equipment, and the development of an automatic defect detection technology becomes urgent need in order to overcome the limitation of manual detection.
In the prior art, the aerial images of the high-voltage line insulator are analyzed to judge whether the high-voltage line insulator has defects or not and determine the specific positions of the defects. Chinese patent CN106780438A discloses an image processing-based insulator defect detection method and system, in which an image processing-based algorithm is adopted, insulator images are preprocessed, the edge profile of a single-channel insulator image is extracted, morphological corrosion, expansion and other calculations are performed to obtain a pseudo-standard binary image, and whether a defect exists in an insulator is judged by comparison. Its advantages are easy implementation and simple operation. However, the method needs to use a large amount of insulator image data with defects, the number of defect samples is small in practice, the obtaining difficulty is high, and the result is easily influenced by complicated backgrounds of towers, mountains, rivers and the like in real samples due to simple operation, so that the method has no high robustness.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a high-voltage line insulator defect detection method based on a generation countermeasure network.
The purpose of the invention can be realized by the following technical scheme:
a high-voltage line insulator defect detection method based on a generation countermeasure network comprises the following steps:
s1: establishing an image data set, wherein the image data set comprises a training set and a testing set, the training set comprises normal insulator images, and the testing set comprises normal insulator images and defective insulator images;
s2: adding a codec connecting network between an encoder sub-network and a decoder sub-network of the GANOMaly model to obtain an improved GANOMaly model, wherein the codec connecting network sends feature maps output by each convolution layer in the encoder sub-network into the decoder sub-network for feature fusion;
s3: constructing a loss function of an improved GANOMaly model;
s4: inputting the training set into an improved GANOMaly model for training until the loss function of the improved GANOMaly model converges to the minimum, and acquiring a trained generated countermeasure network;
s5: sending the insulator images with defects in the test set into a trained improved GANOMaly model to obtain a self-adaptive threshold;
s6: and sending the insulator image to be detected into a trained improved GANOMaly model, acquiring the abnormal score of the insulator image to be detected, judging the insulator image to be abnormal if the abnormal score is greater than the self-adaptive threshold, and otherwise, judging the insulator image to be normal.
Preferably, the improved ganamaly model includes a generation network and a discrimination network, the generation network includes an encoder sub-network, a decoder sub-network and a codec connection network, the encoder sub-network includes five convolutional layers, the decoder sub-network includes five convolutional layers, and the codec connection network acquires the output characteristic diagram of the five convolutional layers of the encoder sub-network and then respectively sends the acquired output characteristic diagram into the five convolutional layers of the decoder sub-network to perform layer-by-layer fusion convolution.
Preferably, the outputs of the five convolutional layers of the encoder subnetwork are respectively a feature map F1、F2、F3、F4And the potential spatial vector Z of the original image,
the step S2, when the codec connection network sends the feature maps output by each convolutional layer in the encoder subnetwork into the decoder subnetwork for feature fusion, specifically includes: sending the latent space vector Z of the original image into the first convolutional layer of the decoder subnetwork and outputting a feature map F4', said characteristic map F4' and feature map F4Merging the two convolution layers and outputting a feature map F3', said characteristic map F3' and feature map F3Merging the two convolution layers and outputting a feature map F2', said characteristic map F2' and feature map F2The merged data is sent to the fourth convolutional layer of the decoder subnetwork and the characteristic diagram F is output1', said characteristic map F1' and feature map F1And after fusion, sending the fusion into a fifth convolutional layer of a decoder subnetwork and outputting a reconstructed image.
Preferably, the decision network includes a class encoder subnetwork, and the class encoder subnetwork is formed by adding a dense connection layer and a sigmoid activation function behind the encoder subnetwork.
Preferably, the S5 specifically includes: and sending the normal insulator image and the defective insulator image in the test set into a trained improved GANOMaly model, acquiring the abnormal score of the image in the test set, and respectively acquiring an abnormal score probability distribution curve of the normal insulator image and an abnormal score probability distribution curve of the defective insulator image, wherein the abnormal score value at the intersection of the abnormal score probability distribution curves of the normal insulator image and the defective insulator image is an adaptive threshold value.
Preferably, the loss function L of the improved GANomaly model is:
L=λadvLadvconLconlatLlat
wherein L isadvTo combat losses, LconFor context loss, LlatFor potential loss, λadvTo counter the loss balance coefficient, λconFor context loss balance factor, λlatThe balance factor is lost to potential.
Preferably, said antagonistic loss LadvComprises the following steps:
Figure BDA0002698765800000031
wherein X is an original image, X 'is a reconstructed image, D (X) represents the discrimination result of the discriminator on the original image, D (X') represents the discrimination result of the discriminator on the reconstructed image,
Figure BDA0002698765800000032
representing the original image sample in the original data distribution px
Preferably, said context loss LconComprises the following steps:
Figure BDA0002698765800000033
wherein X is an original image, X' is a reconstructed image,
Figure BDA0002698765800000034
representing the original image sample in the original data distribution px
Preferably, said potential loss LlatComprises the following steps:
Figure BDA0002698765800000035
wherein X is the original image, X 'is the reconstructed image, f (X) represents the feature vector extracted from the encoder subnetwork of the generation network to the original image, f (X') represents the feature vector extracted from the last convolution layer of the discriminator to the reconstructed image,
Figure BDA0002698765800000037
representing the original image sample in the original data distribution px
Preferably, the anomaly score calculation formula is as follows:
A(X)=ωR(X)+(1-ω)T(X)
wherein, X is an insulator image, a (X) is an abnormal score vector of the insulator image, ω is a weight coefficient, r (X) is a reconstruction score based on context loss, t (X) is a potential difference score based on potential loss, and a (X) is scaled in the range of [0,1 ].
Preferably, the context loss based reconstruction score r (x) is:
Figure BDA0002698765800000036
wherein L iscon(X) is the loss of context for the insulator image, X' is the reconstructed insulator image,
Figure BDA0002698765800000041
representing insulator image sampling in raw data distribution px
Preferably, the potential difference score t (x) based on potential loss is:
Figure BDA0002698765800000042
wherein L islat(X) is the potential loss of an insulator image, Z is the potential spatial vector of an insulator image, and Z' is the potential spatial vector of a reconstructed image of an insulator image.
Preferably, the calculation formula of the abnormal score of the insulator image to be detected is as follows:
A(θ)=ωR(θ)+(1-ω)T(θ)
wherein θ is an insulator image to be detected, ω is a weight coefficient, R (θ) is a reconstruction score based on the context loss, T (θ) is a potential difference score based on the potential loss, a (θ) is an abnormal score vector of the insulator to be detected, and a (θ) is scaled in a range of [0,1 ].
Preferably, the context loss based reconstruction score R (θ) is:
Figure BDA0002698765800000043
wherein L iscon(theta) context loss of insulator images to be detected, theta' reconstructing insulator images to be detected,
Figure BDA0002698765800000044
representing the sampling of the insulator image to be detected in the original data distribution px
Preferably, the potential difference score T (θ) based on potential loss is:
Figure BDA0002698765800000045
wherein L islat(theta) potential loss of insulator image to be detected, ZθFor potential spatial vectors, Z, of the insulator image to be detectedθ' is a potential spatial vector of the reconstructed image of the insulator image to be detected.
Compared with the prior art, the invention has the following advantages:
(1) the method adopts an improved GANOMaly model, the used data set only needs to contain a large amount of label-free positive sample image data and does not need a large amount of label-containing negative sample data, when the insulator image to be detected is input, if no abnormal condition exists, the original image can be restored by reconstructing the image by utilizing the strong image generating capacity of the GAN network, so that the error between the reconstructed image and the original image is smaller than a self-adaptive threshold value; if abnormal conditions exist, the data distribution of the image to be tested and the data distribution of the image of the positive sample are different, so that the error between the image to be tested and the reconstructed image is larger than the self-adaptive threshold, the model judges that the input insulator image is abnormal, the problems that the quantity of negative samples in the insulator image is small, the acquisition is difficult, a large amount of energy is needed to label the data and the like are solved, and the feasibility and the adaptability of the training process are improved.
(2) The invention improves the generation network of the GANOMaly, realizes the jump connection of the encoder sub-network and the decoder sub-network on the corresponding scale through the connection network of the coder and the decoder, and reserves the multi-scale information of local and global by the direct information transmission between layers, generates better reconstruction effect and ensures that the final detection accuracy is improved.
(3) The invention considers that the discrimination network can be used as a classifier and also has a feature extraction function, so that the discrimination network is used for replacing a second encoder in the GANOMaly model, the model is simplified, the parameter quantity needing to be trained is reduced, and the training is more efficient.
(4) The invention extracts the vector of the original image mapped to the potential space by generating the coding sub-network device of the network, extracts the vector of the reconstructed image mapped to the potential space by judging the network, compares the distance between the potential space vector of the original image and the potential space vector of the reconstructed image to represent the error between the original image and the potential image, and replaces a complex high-dimensional vector with a one-dimensional vector to reduce the calculation complexity.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a block diagram of the improved GANOMaly model of the present invention;
FIG. 3 is a data connection diagram of a characteristic diagram of the improved GANOMaly model of the present invention;
FIG. 4 is a schematic flow chart of the improved GANOMaly model training process of the present invention;
FIG. 5 is a schematic flow chart of the improved GANOMaly model detection process of the present invention;
FIG. 6 is a graph of normal data and abnormal data distribution according to the present invention;
FIG. 7 is a graph of AUC test results for the present invention and comparative models.
Detailed Description
The invention is described in detail below with reference to the figures and specific embodiments. Note that the following description of the embodiments is merely a substantial example, and the present invention is not intended to be limited to the application or the use thereof, and is not limited to the following embodiments.
Examples
A high-voltage line insulator defect detection method based on a generation countermeasure network comprises the following steps as shown in figure 1:
s1: establishing an image data set, wherein the image data set comprises a training set and a testing set, the training set comprises normal insulating subimages, and the testing set comprises normal insulating subimages and defective insulating subimages.
In this embodiment, when the image data set is established, the model of the present invention only needs to learn the data distribution of the proof sample during training, and therefore, a large number of normal insulator images need to be collected to make a training set of the proof sample. Meanwhile, in order to evaluate the performance of the model, obtain a detection adaptive threshold and improve the accuracy of the abnormal detection of the model, a testing link is added in the training step, so that a testing set needs to be manufactured, and a positive sample image and a negative sample image need to exist in the testing set at the same time. The positive example is a normal insulator image and the negative example is a defective insulator image. Therefore, a training total sample is firstly made, and because the existing public data set lacks an insulator image, in the embodiment, the training set data is shot by an unmanned aerial vehicle to acquire the insulator image of the normal sample, and the size of the shot original data image is 846 × 1152 × 3. To expand the data, the original data is randomly flipped and rotated by 90 ° to enrich the sample. And the image is cropped in a center-cut manner, and finally resize results in 1200 images of 64 × 64. 200 pieces were randomly drawn from the training set and placed into the test set.
Because negative sample image data needs to be used in a test set, but the number of defective insulator images is rare and difficult to acquire, a semantic segmentation model is adopted to extract an insulator part in positive sample data, the insulator images with defects are artificially manufactured, and the insulator images are fused with different backgrounds. And finally obtaining 400 pieces of image data of the test set, wherein the number of the positive samples and the number of the negative samples are 200.
S2: and adding a codec connection network between the encoder sub-network and the decoder sub-network of the GANOMaly model to obtain an improved GANOMaly model, wherein the codec connection network sends the feature maps output by each convolution layer in the encoder sub-network into the decoder sub-network for feature fusion.
Specifically, the overall framework of the modified GANomaly model is shown in fig. 2 and 3. The generation countermeasure network can be mainly divided into two parts of a generation network and a discrimination network, wherein the generation network G comprises an encoder sub-network GEA decoding subnetwork GDA codec connection network; the discriminating network D comprises a class encoder subnetwork DE
The generator network G learns the data distribution of the original image of the sample, reconstructs the image, the discrimination network D judges the authenticity of the reconstructed image, the generation network G and the discrimination network D carry out countermeasure training, and are continuously updated in an iterative mode until the value of the objective function L is converged and reaches the minimum value, so that the image generated by the generation network G is almost consistent with the original image, the discrimination network can not distinguish the authenticity of the generated image, and the training of the model is completed.
Encoder subnetwork GEThe method comprises five layers of convolution, wherein input data is an original image X, 1 layer is filled in the edge of the first four layers of convolution, the convolution step length is 2, down sampling is realized, the size is reduced by one half, and a BN layer and a LeakyReLU activation function layer are added after the convolution layer. And (4) the final layer of convolution has no filling, the convolution step is 1, and the one-dimensional potential space vector Z of the original image is output after convolution. Encoder subnetwork GEThe detailed parameters of each layer are shown in table 1 below:
table 1 encoder subnetwork parameter table
Figure BDA0002698765800000071
Decoder subnetwork GDOf (2) and an encoder subnetwork GEThe structure of the method is symmetrical, the first layer of transposition convolution is not filled, the convolution step length is 1, the input is a one-dimensional potential space vector Z of the original image, the last four layers of transposition convolution are filled with 1 layer at the edge, the convolution step length is 2, the up-sampling is realized, and the size is doubled. And (3) adding a BN layer and a ReLU activation function layer after the first four layers are transposed to the convolution layer, activating the last layer by using a tanh function without using BN, and outputting a reconstructed image X'.
As shown in Table 1, the outputs of the five convolutional layers of the encoder subnetwork are respectively a feature map F1、F2、F3、F4And the potential space vector Z of the original image, when the codec connection network in S2 sends the feature map output by each convolutional layer in the encoder subnetwork into the decoder subnetwork for feature fusion, the method specifically includes: feeding the latent space vector Z of the original image into the first convolutional layer of the decoder subnetwork and outputting a feature map F4', characteristic diagram F4' and feature map F4Merging the two convolution layers and outputting a feature map F3', characteristic diagram F3' and feature map F3Merging the two convolution layers and outputting a feature map F2', characteristic diagram F2' and feature map F2The merged data is sent to the fourth convolutional layer of the decoder subnetwork and the characteristic diagram F is output1', characteristic diagram F1' and feature map F1And after fusion, sending the fusion into a fifth convolutional layer of a decoder subnetwork and outputting a reconstructed image.
Decoder subnetwork GDThe detailed parameters of each layer are shown in table 2 below:
table 2 decoder subnet parameter table:
number of layers Inputting feature names Input size Number of convolution kernels Convolution kernel size Step size
1 Z (1,1,512) 512 (4,4) 1
2 F4+F4' (4,4,1024) 256 (4,4) 2
3 F3+F3' (8,8,512) 128 (4,4) 2
4 F2+F2' (16,16,256) 64 (4,4) 2
5 F1+F1' (32,32,128) 3 (4,4) 2
Number of layers Edge filling Batch standardization Activating a function Output size Outputting feature names
1 Valid BN ReLU (4,4,512) F4'
2 Same BN ReLU (8,8,256) F3'
3 Same BN ReLU (16,16,128) F2'
4 Same BN ReLU (32,32,64) F1'
5 Same None tanh (64,64,3) X’
Discriminating network routing class encoder subnetwork DEForm, class encoder subnetwork DEStructured like encoder subnetwork GEThe final layer of convolutional layer is output as a latent space vector Z' of the reconstructed image, except for the encoder-like subnetwork DEAnd a dense connecting layer is used after the last convolution layer, and a sigmoid activation function is used to play a role in judging the authenticity of the reconstructed image.
S3: and constructing a loss function of the improved GANOMaly model.
Specifically, the loss function L of the modified GANomaly model is:
L=λadvLadvconLconlatLlat
wherein L isadvTo combat losses, LconFor context loss, LlatFor potential loss, λadvTo counter the loss balance coefficient, λconFor context loss balance factor, λlatThe balance factor is lost to potential.
Wherein the loss L is resistedadvComprises the following steps:
Figure BDA0002698765800000081
wherein X is an original image, X 'is a reconstructed image, D (X) represents the discrimination result of the discriminator on the original image, D (X') represents the discrimination result of the discriminator on the reconstructed image,
Figure BDA0002698765800000082
representing the original image sample in the original data distribution px
Context loss LconComprises the following steps:
Figure BDA0002698765800000083
wherein X is an original image, X' is a reconstructed image,
Figure BDA0002698765800000091
representing the original image sample in the original data distribution px
Potential loss LlatComprises the following steps:
Figure BDA0002698765800000092
wherein X is the original image, X 'is the reconstructed image, f (X) represents the feature vector extracted from the encoder subnetwork of the generation network to the original image, f (X') represents the feature vector extracted from the last convolution layer of the discriminator to the reconstructed image,
Figure BDA0002698765800000093
representing the original image sample in the original data distribution px
S4: and inputting the training set into the improved GANOMaly model for training until the loss function of the improved GANOMaly model converges to the minimum, and acquiring a well-trained generated countermeasure network.
As shown in fig. 4, specifically, data in the training set is input into the generating network G, the generation network G and the discrimination network D perform the countermeasure training, and are continuously updated in an iterative manner until the value of the loss function L converges and reaches the minimum value, so that the reconstructed image generated by the generating network G is almost consistent with the original image, and the discrimination network cannot distinguish the authenticity of the generated image, thereby completing the training of the model. And recording and observing a loss function L in the training process, and reasonably adjusting the learning round number epoch and the learning rate to prevent the model from being over-fitted and influencing the generalization capability of the model.
S5: and sending the insulator images with the defects in the test set into a trained improved GANOMaly model to obtain a self-adaptive threshold value.
S5 specifically includes: and sending the normal insulator image and the defective insulator image in the test set into a trained improved GANOMaly model, acquiring the abnormal score of the image in the test set, and respectively acquiring an abnormal score probability distribution curve of the normal insulator image and an abnormal score probability distribution curve of the defective insulator image, wherein the abnormal score value at the intersection point of the abnormal score probability distribution curves of the normal insulator image and the defective insulator image is an adaptive threshold value.
The trained generation network G sends the insulator images with defects in the test set into a trained improved GANOMaly model, and potential space vectors Z of the original images X and reconstructed images X' to be detected are respectively and sequentially generated for the original images X of the insulator images input in the same batch; and the trained discrimination network D sequentially generates potential space vectors Z' of the to-be-detected reconstructed images through the last convolution layer of all to-be-detected reconstructed images input in the same batch. And calculating the distance between the potential space vector of the original image to be detected and the potential space vector of the reconstructed image to be detected, namely calculating the abnormal score.
The calculation formula of the abnormal score is as follows:
A(X)=ωR(X)+(1-ω)T(X)
wherein, X is an insulator image, a (X) is an abnormal score vector of the insulator image, ω is a weight coefficient, r (X) is a reconstruction score based on context loss, t (X) is a potential difference score based on potential loss, and a (X) is scaled in the range of [0,1 ].
The context loss-based reconstruction score r (x) is:
Figure BDA0002698765800000101
wherein L iscon(X) is the loss of context for the insulator image, X' is the reconstructed insulator image,
Figure BDA0002698765800000102
representing insulator image sampling in raw data distribution px
The potential difference score T (X) based on potential loss is:
Figure BDA0002698765800000103
wherein L islat(X) is the potential loss of an insulator image, Z is the potential spatial vector of an insulator image, and Z' is the potential spatial vector of a reconstructed image of an insulator image.
In this embodiment, the test set data is input into the trained model, the abnormal scores of the normal data and the abnormal data are calculated, the abnormal score probability distribution curves of the normal insulator image and the defective insulator image are respectively obtained, and the obtained results are shown in fig. 6. At an anomaly score of 0.2, the two probability curves intersect, so the adaptive threshold is taken to be 0.2.
S6: and sending the insulator image to be detected into a trained improved GANOMaly model, acquiring the abnormal score of the insulator image to be detected, judging the insulator image to be abnormal if the abnormal score is greater than the self-adaptive threshold, and otherwise, judging the insulator image to be normal.
In the training process of the model, only the insulator image of the sample is learned, so that the anomaly detection model can only reconstruct the input original image in the distribution mode of the image data of the sample, and only the original image of the sample can be restored.
As shown in fig. 5, therefore, in the present invention, the insulator image to be detected is input into the trained modified GANomaly model, and when a normal insulator image is input, the trained encoder sub-network GEAnd decoder subnetwork GDReconstructing the input original image to be detected in a manner of normal sample image data distribution to obtain a reconstructed image to be detected, wherein in this case, the reconstructed image to be detected can well restore the original image to be detected, and the distance between the reconstructed image to be detected and the original image to be detected, namely the abnormal score is smaller than the adaptive threshold value, and the model judges that the input insulator image is normal; when an abnormal insulator image is input, the trained encoder subnetwork GEAnd decoder subnetwork GDThe input original image to be tested is still reconstructed in a mode of data distribution of the normal sample image, but the data distribution of the abnormal image is different from the data distribution of the normal sample image, so that the original image to be tested cannot be well restored by the reconstructed image to be tested, the error between the reconstructed image to be tested and the original image to be tested is larger than the self-adaptive threshold value, and the model judges that the input insulator image is abnormal.
In S6, the method for calculating the abnormal score of the insulator image to be detected includes:
A(θ)=ωR(θ)+(1-ω)T(θ)
wherein θ is an insulator image to be detected, ω is a weight coefficient, R (θ) is a reconstruction score based on the context loss, T (θ) is a potential difference score based on the potential loss, a (θ) is an abnormal score vector of the insulator to be detected, and a (θ) is scaled in a range of [0,1 ].
The reconstruction score based on the context loss R (theta) is as follows:
Figure BDA0002698765800000111
wherein L iscon(theta) context loss of insulator images to be detected, theta' reconstructing insulator images to be detected,
Figure BDA0002698765800000112
representing the sampling of the insulator image to be detected in the original data distribution px
The potential difference score T (theta) based on the potential loss is as follows:
Figure BDA0002698765800000113
wherein L islat(theta) potential loss of insulator image to be detected, ZθFor potential spatial vectors, Z, of the insulator image to be detectedθ' is a potential spatial vector of the reconstructed image of the insulator image to be detected.
In this embodiment, the experimental environment is: the system Win10, the display card Tesla P100 and the deep learning framework pytorch1.2, and the comparison model is a GANOMaly model. In the process of model training, in order to objectively evaluate the performance of the model, after all samples in a training set are trained once, data of a test set are input into the model, and an AUC (area under the ROC curve) value is calculated, so that the performance of the abnormal detection model is evaluated. AUC is defined as the area under the ROC curve. Wherein, the ROC curve is called a receiver operating characteristic curve (receiver operating characteristic curve), and is a curve drawn according to a series of different two classification modes (boundary values or decision thresholds) by taking a true positive rate (sensitivity) as an ordinate and a false positive rate (1-specificity) as an abscissa. The reason why the AUC value is used as the evaluation standard of the model is that the ROC curve cannot clearly indicate which classifier has a better effect in many times, and the AUC value is used as a numerical value, so that the classifier with a larger AUC has a better effect. AUC 1 represents a perfect classifier, 0.5 < AUC < 1 represents an advantage over a random classifier.
The results of the test on the insulator data set by the GANOMaly model and the model of the invention are shown in FIG. 7, and the performance of the model of the invention is superior to that of the comparative model GANOMaly model.
The above embodiments are merely examples and do not limit the scope of the present invention. These embodiments may be implemented in other various manners, and various omissions, substitutions, and changes may be made without departing from the technical spirit of the present invention.

Claims (10)

1. A high-voltage line insulator defect detection method based on a generation countermeasure network is characterized by comprising the following steps:
s1: establishing an image data set, wherein the image data set comprises a training set and a testing set, the training set comprises normal insulator images, and the testing set comprises normal insulator images and defective insulator images;
s2: adding a codec connecting network between an encoder sub-network and a decoder sub-network of the GANOMaly model to obtain an improved GANOMaly model, wherein the codec connecting network sends feature maps output by each convolution layer in the encoder sub-network into the decoder sub-network for feature fusion;
s3: constructing a loss function of an improved GANOMaly model;
s4: inputting the training set into an improved GANOMaly model for training until the loss function of the improved GANOMaly model converges to the minimum, and acquiring a trained generated countermeasure network;
s5: sending the insulator images with defects in the test set into a trained improved GANOMaly model to obtain a self-adaptive threshold;
s6: and sending the insulator image to be detected into a trained improved GANOMaly model, acquiring the abnormal score of the insulator image to be detected, judging the insulator image to be abnormal if the abnormal score is greater than the self-adaptive threshold, and otherwise, judging the insulator image to be normal.
2. The method as claimed in claim 1, wherein the improved GANOMaly model comprises a generation network and a discrimination network, the generation network comprises an encoder sub-network, a decoder sub-network and a codec connection network, the encoder sub-network comprises five convolutional layers, the decoder sub-network comprises five convolutional layers, and the codec connection network acquires the output characteristic diagram of the five convolutional layers of the encoder sub-network and then respectively sends the five convolutional layers into the decoder sub-network to perform layer-by-layer fusion convolution.
3. The method as claimed in claim 2, wherein the outputs of the five convolutional layers of the encoder subnetwork are respectively a feature map F1、F2、F3、F4And the potential spatial vector Z of the original image,
the step S2, when the codec connection network sends the feature maps output by each convolutional layer in the encoder subnetwork into the decoder subnetwork for feature fusion, specifically includes: sending the latent space vector Z of the original image into the first convolutional layer of the decoder subnetwork and outputting a feature map F4', said characteristic map F4' and feature map F4Merging the two convolution layers and outputting a feature map F3', said characteristic map F3' and feature map F3Merging the two convolution layers and outputting a feature map F2', said characteristic map F2' and feature map F2The merged data is sent to the fourth convolutional layer of the decoder subnetwork and the characteristic diagram F is output1', said characteristic map F1' and feature map F1And after fusion, sending the fusion into a fifth convolutional layer of a decoder subnetwork and outputting a reconstructed image.
4. The method for detecting the insulator defect of the high-voltage line based on the generation countermeasure network as claimed in claim 2, wherein the discrimination network comprises a class encoder sub-network, and the class encoder sub-network is formed by adding a dense connection layer and a sigmoid activation function after the encoder sub-network.
5. The method for detecting the defect of the high-voltage line insulator based on the generated countermeasure network as claimed in claim 1, wherein the step S5 specifically comprises: and sending the normal insulator image and the defective insulator image in the test set into a trained improved GANOMaly model, acquiring the abnormal score of the image in the test set, and respectively acquiring an abnormal score probability distribution curve of the normal insulator image and an abnormal score probability distribution curve of the defective insulator image, wherein the abnormal score value at the intersection of the abnormal score probability distribution curves of the normal insulator image and the defective insulator image is an adaptive threshold value.
6. The method according to claim 1, wherein the loss function L of the improved GANOMaly model is as follows:
L=λadvLadvconLconlatLlat
wherein L isadvTo combat losses, LconFor context loss, LlatFor potential loss, λadvTo counter the loss balance coefficient, λconFor context loss balance factor, λlatThe balance factor is lost to potential.
7. The method of claim 6, wherein the countermeasure loss L is a loss of integrity of the insulatoradvComprises the following steps:
Figure FDA0002698765790000021
wherein X is an original image, X 'is a reconstructed image, D (X) represents the discrimination result of the discriminator on the original image, D (X') represents the discrimination result of the discriminator on the reconstructed image,
Figure FDA0002698765790000022
representing the original image sample in the original data distribution px
8. The method according to claim 6, wherein the context loss L is a measure of the defect in the insulator of the high voltage line based on the generated countermeasure networkconComprises the following steps:
Figure FDA0002698765790000023
wherein X is an original image, X' is a reconstructed image,
Figure FDA0002698765790000024
representing the original image sample in the original data distribution px
9. The method of claim 6, wherein the potential loss L is a loss of integrity of the insulatorlatComprises the following steps:
Figure FDA0002698765790000031
wherein X is the original image, X 'is the reconstructed image, f (X) represents the feature vector extracted from the encoder subnetwork of the generation network to the original image, f (X') represents the feature vector extracted from the last convolution layer of the discriminator to the reconstructed image,
Figure FDA0002698765790000032
representing the original image sample in the original data distribution px
10. The method for detecting the defect of the high-voltage line insulator based on the generation countermeasure network as claimed in claim 1, wherein the abnormal score is calculated by the following formula:
A(X)=ωR(X)+(1-ω)T(X)
wherein, X is an insulator image, a (X) is an abnormal score vector of the insulator image, ω is a weight coefficient, r (X) is a reconstruction score based on context loss, t (X) is a potential difference score based on potential loss, and a (X) is scaled in the range of [0,1 ].
CN202011015019.5A 2020-09-24 2020-09-24 High-voltage line insulator defect detection method based on generation countermeasure network Pending CN112184654A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011015019.5A CN112184654A (en) 2020-09-24 2020-09-24 High-voltage line insulator defect detection method based on generation countermeasure network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011015019.5A CN112184654A (en) 2020-09-24 2020-09-24 High-voltage line insulator defect detection method based on generation countermeasure network

Publications (1)

Publication Number Publication Date
CN112184654A true CN112184654A (en) 2021-01-05

Family

ID=73956160

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011015019.5A Pending CN112184654A (en) 2020-09-24 2020-09-24 High-voltage line insulator defect detection method based on generation countermeasure network

Country Status (1)

Country Link
CN (1) CN112184654A (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112686880A (en) * 2021-01-06 2021-04-20 哈尔滨市科佳通用机电股份有限公司 Method for detecting abnormity of railway locomotive component
CN112837295A (en) * 2021-02-01 2021-05-25 北京工业大学 Rubber glove defect detection method based on generation of countermeasure network
CN113030950A (en) * 2021-03-10 2021-06-25 电子科技大学 Small unmanned aerial vehicle classification method based on deep learning technology
CN113160190A (en) * 2021-04-27 2021-07-23 西安交通大学 Method, equipment, device and storage medium for detecting abnormity of fastener of contact network
CN113205013A (en) * 2021-04-19 2021-08-03 重庆创通联达智能技术有限公司 Object identification method, device, equipment and storage medium
CN113284086A (en) * 2021-03-31 2021-08-20 广东电力信息科技有限公司 Method and device for generating and detecting power scarcity defect image and related equipment
CN113378703A (en) * 2021-06-09 2021-09-10 成都恒创新星科技有限公司 Method and system for detecting state of garbage can
CN113450318A (en) * 2021-06-11 2021-09-28 东华大学 Primary power distribution system porcelain insulator detection method based on unmanned aerial vehicle autonomous vision
CN113468703A (en) * 2021-07-23 2021-10-01 河南工业大学 ADS-B message anomaly detector and detection method
CN113688857A (en) * 2021-04-26 2021-11-23 贵州电网有限责任公司 Method for detecting foreign matters in power inspection image based on generation countermeasure network
CN114022432A (en) * 2021-10-28 2022-02-08 湖北工业大学 Improved yolov 5-based insulator defect detection method
CN114359286A (en) * 2022-03-21 2022-04-15 湖南应超智能计算研究院有限责任公司 Insulator defect identification method, device and medium based on artificial intelligence
CN114397306A (en) * 2022-03-25 2022-04-26 南方电网数字电网研究院有限公司 Power grid grading ring hypercomplex category defect multi-stage model joint detection method
CN114648724A (en) * 2022-05-18 2022-06-21 成都航空职业技术学院 Lightweight efficient target segmentation and counting method based on generation countermeasure network
CN115578359A (en) * 2022-10-21 2023-01-06 千巡科技(深圳)有限公司 Few-sample defect detection method, system and device based on generation of countermeasure network and defect-free image measurement and storage medium
CN117315354A (en) * 2023-09-27 2023-12-29 南京航空航天大学 Insulator anomaly detection method based on multi-discriminant composite coding GAN network

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110555474A (en) * 2019-08-28 2019-12-10 上海电力大学 photovoltaic panel fault detection method based on semi-supervised learning

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110555474A (en) * 2019-08-28 2019-12-10 上海电力大学 photovoltaic panel fault detection method based on semi-supervised learning

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
SAMET AKCAY ET AL.: ""GANomaly: Semi-Supervised Anomaly Detection via Adversarial Training"", 《ARXIV》 *
SAMET AKÇAY ET AL.: ""Skip-GANomaly: Skip Connected and Adversarially Trained Encoder-Decoder Anomaly Detection"", 《INTERNATIONAL JOINT CONFERENCE ON NEURAL NETWORKS》 *
THOMAS SCHLEGL ET AL.: ""Unsupervised Anomaly Detection with Generative Adversarial Networks to Guide Marker Discovery"", 《ARXIV》 *
姜少彬等: ""一种硬盘故障预测的非监督对抗学习方法"", 《西安电子科技大学学报》 *
陶显等: ""基于深度学习的表面缺陷检测方法综述"", 《自动化学报》 *

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112686880A (en) * 2021-01-06 2021-04-20 哈尔滨市科佳通用机电股份有限公司 Method for detecting abnormity of railway locomotive component
CN112837295A (en) * 2021-02-01 2021-05-25 北京工业大学 Rubber glove defect detection method based on generation of countermeasure network
CN113030950A (en) * 2021-03-10 2021-06-25 电子科技大学 Small unmanned aerial vehicle classification method based on deep learning technology
CN113284086A (en) * 2021-03-31 2021-08-20 广东电力信息科技有限公司 Method and device for generating and detecting power scarcity defect image and related equipment
CN113205013B (en) * 2021-04-19 2023-04-07 重庆创通联达智能技术有限公司 Object identification method, device, equipment and storage medium
CN113205013A (en) * 2021-04-19 2021-08-03 重庆创通联达智能技术有限公司 Object identification method, device, equipment and storage medium
CN113688857A (en) * 2021-04-26 2021-11-23 贵州电网有限责任公司 Method for detecting foreign matters in power inspection image based on generation countermeasure network
CN113160190A (en) * 2021-04-27 2021-07-23 西安交通大学 Method, equipment, device and storage medium for detecting abnormity of fastener of contact network
CN113378703A (en) * 2021-06-09 2021-09-10 成都恒创新星科技有限公司 Method and system for detecting state of garbage can
CN113450318A (en) * 2021-06-11 2021-09-28 东华大学 Primary power distribution system porcelain insulator detection method based on unmanned aerial vehicle autonomous vision
CN113468703A (en) * 2021-07-23 2021-10-01 河南工业大学 ADS-B message anomaly detector and detection method
CN114022432A (en) * 2021-10-28 2022-02-08 湖北工业大学 Improved yolov 5-based insulator defect detection method
CN114022432B (en) * 2021-10-28 2024-04-30 湖北工业大学 Insulator defect detection method based on improved yolov5
CN114359286A (en) * 2022-03-21 2022-04-15 湖南应超智能计算研究院有限责任公司 Insulator defect identification method, device and medium based on artificial intelligence
CN114397306A (en) * 2022-03-25 2022-04-26 南方电网数字电网研究院有限公司 Power grid grading ring hypercomplex category defect multi-stage model joint detection method
CN114648724A (en) * 2022-05-18 2022-06-21 成都航空职业技术学院 Lightweight efficient target segmentation and counting method based on generation countermeasure network
CN114648724B (en) * 2022-05-18 2022-08-12 成都航空职业技术学院 Lightweight efficient target segmentation and counting method based on generation countermeasure network
CN115578359A (en) * 2022-10-21 2023-01-06 千巡科技(深圳)有限公司 Few-sample defect detection method, system and device based on generation of countermeasure network and defect-free image measurement and storage medium
CN117315354A (en) * 2023-09-27 2023-12-29 南京航空航天大学 Insulator anomaly detection method based on multi-discriminant composite coding GAN network
CN117315354B (en) * 2023-09-27 2024-04-02 南京航空航天大学 Insulator anomaly detection method based on multi-discriminant composite coding GAN network

Similar Documents

Publication Publication Date Title
CN112184654A (en) High-voltage line insulator defect detection method based on generation countermeasure network
CN110555474B (en) Photovoltaic panel fault detection method based on semi-supervised learning
CN109118479B (en) Capsule network-based insulator defect identification and positioning device and method
CN109977921B (en) Method for detecting hidden danger of power transmission line
US20230360390A1 (en) Transmission line defect identification method based on saliency map and semantic-embedded feature pyramid
CN110376522B (en) Motor fault diagnosis method of data fusion deep learning network
CN110827251A (en) Power transmission line locking pin defect detection method based on aerial image
CN110533631A (en) SAR image change detection based on the twin network of pyramid pondization
CN111259853A (en) High-resolution remote sensing image change detection method, system and device
CN113920107A (en) Insulator damage detection method based on improved yolov5 algorithm
CN106198551A (en) The detection method of a kind of transmission line of electricity defect and device
CN113657383B (en) Defect region detection method and device based on lightweight segmentation model
CN113222949B (en) X-ray image automatic detection method for plugging position of power equipment conductor
CN113608140A (en) Battery fault diagnosis method and system
CN115114965B (en) Wind turbine generator gearbox fault diagnosis method, device, equipment and storage medium
CN115527150A (en) Dual-branch video anomaly detection method combined with convolution attention module
CN113468703A (en) ADS-B message anomaly detector and detection method
CN114897858A (en) Rapid insulator defect detection method and system based on deep learning
CN113688857A (en) Method for detecting foreign matters in power inspection image based on generation countermeasure network
CN115082798A (en) Power transmission line pin defect detection method based on dynamic receptive field
CN116596920B (en) Real-time zero measurement method and system for long-string porcelain insulator unmanned aerial vehicle
CN112633123A (en) Heterogeneous remote sensing image change detection method and device based on deep learning
CN113762007B (en) Abnormal behavior detection method based on appearance and action feature double prediction
CN115456941A (en) Novel electric power insulator defect detection and identification method and system
CN113505817A (en) Self-adaptive weighting training method for bearing fault diagnosis model samples under unbalanced data

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210105