CN117671587A - Power equipment defect detection method and system based on self-supervision learning - Google Patents
Power equipment defect detection method and system based on self-supervision learning Download PDFInfo
- Publication number
- CN117671587A CN117671587A CN202311641419.0A CN202311641419A CN117671587A CN 117671587 A CN117671587 A CN 117671587A CN 202311641419 A CN202311641419 A CN 202311641419A CN 117671587 A CN117671587 A CN 117671587A
- Authority
- CN
- China
- Prior art keywords
- self
- network
- supervision
- power equipment
- defect detection
- 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
Links
- 230000007547 defect Effects 0.000 title claims abstract description 98
- 238000001514 detection method Methods 0.000 title claims abstract description 94
- 238000000034 method Methods 0.000 claims abstract description 54
- 238000012549 training Methods 0.000 claims abstract description 45
- 238000013140 knowledge distillation Methods 0.000 claims abstract description 22
- 230000008447 perception Effects 0.000 claims abstract description 18
- 230000002159 abnormal effect Effects 0.000 claims abstract description 11
- 230000008014 freezing Effects 0.000 claims abstract description 8
- 238000007710 freezing Methods 0.000 claims abstract description 8
- 230000006870 function Effects 0.000 claims description 25
- 238000003860 storage Methods 0.000 claims description 14
- 238000013507 mapping Methods 0.000 claims description 11
- 238000012545 processing Methods 0.000 claims description 9
- 238000010276 construction Methods 0.000 claims description 6
- 238000004821 distillation Methods 0.000 claims description 5
- 230000008569 process Effects 0.000 claims description 5
- 230000001133 acceleration Effects 0.000 claims description 4
- 230000006835 compression Effects 0.000 claims description 4
- 238000007906 compression Methods 0.000 claims description 4
- 238000004590 computer program Methods 0.000 claims description 4
- 238000000605 extraction Methods 0.000 claims description 4
- 238000002372 labelling Methods 0.000 claims description 4
- 238000012360 testing method Methods 0.000 claims description 4
- 230000009466 transformation Effects 0.000 claims description 4
- 230000004913 activation Effects 0.000 claims description 3
- 238000005520 cutting process Methods 0.000 claims description 3
- 238000011156 evaluation Methods 0.000 claims description 3
- 230000004927 fusion Effects 0.000 claims description 3
- 230000007246 mechanism Effects 0.000 claims description 3
- 238000011176 pooling Methods 0.000 claims description 3
- 239000013598 vector Substances 0.000 claims description 3
- 238000012795 verification Methods 0.000 claims description 3
- 238000009966 trimming Methods 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 4
- 230000006378 damage Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000013527 convolutional neural network Methods 0.000 description 2
- 238000013135 deep learning Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000018109 developmental process Effects 0.000 description 2
- 238000010801 machine learning Methods 0.000 description 2
- 238000013508 migration Methods 0.000 description 2
- 230000005012 migration Effects 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000012706 support-vector machine Methods 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000007797 corrosion Effects 0.000 description 1
- 238000005260 corrosion Methods 0.000 description 1
- 238000003066 decision tree Methods 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 239000004744 fabric Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000009776 industrial production Methods 0.000 description 1
- 239000012212 insulator Substances 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 239000002184 metal Substances 0.000 description 1
- 229910052751 metal Inorganic materials 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000007637 random forest analysis Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/50—Context or environment of the image
- G06V20/52—Surveillance or monitoring of activities, e.g. for recognising suspicious objects
-
- 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/0464—Convolutional networks [CNN, ConvNet]
-
- 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
- G06N3/09—Supervised learning
-
- 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
- G06N3/096—Transfer learning
-
- 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/40—Extraction of image or video features
- G06V10/44—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
- G06V10/443—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by matching or filtering
- G06V10/449—Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters
- G06V10/451—Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters with interaction between the filter responses, e.g. cortical complex cells
- G06V10/454—Integrating the filters into a hierarchical structure, e.g. convolutional neural networks [CNN]
-
- 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
- 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/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02J—CIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
- H02J13/00—Circuit arrangements for providing remote indication of network conditions, e.g. an instantaneous record of the open or closed condition of each circuitbreaker in the network; Circuit arrangements for providing remote control of switching means in a power distribution network, e.g. switching in and out of current consumers by using a pulse code signal carried by the network
- H02J13/00032—Systems characterised by the controlled or operated power network elements or equipment, the power network elements or equipment not otherwise provided for
-
- 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)
- Evolutionary Computation (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- General Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Biomedical Technology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Molecular Biology (AREA)
- Multimedia (AREA)
- General Engineering & Computer Science (AREA)
- Biophysics (AREA)
- Mathematical Physics (AREA)
- Data Mining & Analysis (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computational Linguistics (AREA)
- Databases & Information Systems (AREA)
- Medical Informatics (AREA)
- Power Engineering (AREA)
- Biodiversity & Conservation Biology (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a method and a system for detecting defects of power equipment based on self-supervision learning, which comprise the following steps: firstly, carrying out image enhancement on an acquired power equipment image, constructing a self-supervision sample set, and selecting a high-quality equipment abnormal image from the self-supervision sample set to label the high-quality equipment abnormal image, and constructing a supervised sample set; secondly, designing a novel ViT network comprising a layered embedding module, a local perception module and a dynamic attention focusing module, and training the novel ViT network on a self-supervision sample set through contrast learning to obtain a pre-training model; then, extracting an encoder part in the pre-training model, adding an FPN network and a detection head network, constructing an equipment defect detection network, freezing the weight of the encoder, and performing fine adjustment on the network by using a supervised sample set; and finally, compressing and accelerating the equipment defect detection model with the volume larger than the set value by using knowledge distillation. The method and the device can improve the defect detection precision of the power equipment under the condition of a small number of marked samples.
Description
Technical Field
The invention relates to a power equipment defect detection technology, in particular to a power equipment defect detection method and system based on self-supervision learning.
Background
The power system is a key infrastructure of the modern society, and safe and stable operation of power equipment is becoming increasingly important in current daily life and industrial production. Whether the power transmission or transformation equipment is in the outdoor or natural environment. The electric power equipment is extremely easy to be corroded, such as metal corrosion, equipment damage, equipment oil seepage, dial damage, insulator damage, pollution and other various equipment components are abnormal. By using artificial intelligence technology, the power equipment fault can be prevented by timely detecting and identifying abnormality, and huge economic loss caused by equipment fault and shutdown is avoided, so that the safe and stable operation of a power system is ensured.
Before deep learning techniques are widely used, conventional defect detection algorithms generally perform anomaly detection by using Canny edge detection, hough detection, line detection, texture analysis, region segmentation, and other techniques. With the development of machine learning technology, machine learning algorithms such as Support Vector Machines (SVMs), decision trees, random forests, etc. have also been used for anomaly detection of power images. With the rapid development of deep learning technology, the convolutional neural network is particularly suitable for anomaly detection of power equipment due to strong feature extraction capability, such as Faster R-CNN, yolo series and the like. The generation countermeasure network (GAN) may be used to generate a normal power image that is compared to the actual image to detect anomalies. For the situation of fewer samples, the migration learning allows the model to use pre-training knowledge in other fields to perform migration fine tuning to meet specific tasks of the power image. The above methods are all supervised learning categories, however, as the collected data is increased, it is more difficult to manually label all the data.
Disclosure of Invention
The invention aims to: the invention aims to provide a method and a system for detecting defects of power equipment based on self-supervision learning, which can improve the detection precision of the defects of substation equipment under the condition of a small number of marked samples.
The technical scheme is as follows: the invention discloses a power equipment defect detection method based on self-supervision learning, which comprises the following steps of:
constructing a sample set: acquiring a plurality of power equipment images shot by an image sensing device, constructing a self-supervision data set, carrying out image enhancement on each image in the self-supervision data set, constructing a sample pair, and forming a self-supervision sample set; selecting high-quality abnormal images from the self-supervision data set to label, and constructing a supervised sample set for subsequent fine adjustment;
constructing a novel ViT network: constructing a novel ViT network comprising a layered embedding module, a local perception module and a dynamic attention focusing module;
training novel ViT network: training a novel ViT network by utilizing a self-supervision sample set in a contrast learning mode to obtain a self-supervision pre-training model;
constructing a power equipment defect detection network: extracting an encoder part in the self-supervision pre-training model, adding an FPN network and a detection head network, and constructing a power equipment defect detection network;
trimming a power device defect detection network: freezing the weight of an encoder part in the self-supervision pre-training model, and performing fine adjustment on the power equipment defect detection network by using a supervision sample set to obtain a power equipment defect detection model;
knowledge distillation: and compressing and accelerating the power equipment defect detection model with the volume larger than the set value by using a knowledge distillation method to obtain the lightweight power equipment defect detection model.
Further, the constructing a sample set specifically includes:
collecting power equipment images in each time period, generating image sample pairs by a data enhancement method of color transformation through image cutting, and constructing a self-supervision sample set;
selecting high-quality equipment defect images from the self-supervision sample set to label and construct a supervision sample set;
and repeating the steps, periodically updating the acquired image data, constructing an image sample set of the power equipment, and dividing a training set, a verification set and a test set according to tasks in different stages.
Further, the novel ViT network specifically includes:
the hierarchical embedding module is used for dividing the images in the input self-supervision sample set into N patch block images respectively in an overlapping or non-overlapping mode, and assigning a position code to each patch block image;
the local perception module is used for extracting local characteristics of each patch block image, and splicing the extracted vectors with the position codes to be used as input of the dynamic attention focusing module; the local perception module comprises a convolution layer, a BatchNorm layer, an activation layer, a pooling layer and a linear mapping layer;
the dynamic attention focusing module is used for processing the local characteristics obtained by the local perception module, and embedding a dynamic weight into each patch block image so as to dynamically adjust the attention degree of the network to different patches; after the dynamic weight is applied, the adjusted embedded representation is input to a linear mapping layer in the local perception module; the output of the linear mapping layer is passed to Transformer Encoder for further processing of the image features.
Further, the output of the linear mapping layer is passed to Transformer Encoder for further processing of the image features, including the following:
the dynamic attention focusing module further performs feature extraction fusion by using a residual self-attention network to generate an enhanced feature representation, and the expression is as follows:
Z=F(X)+X
wherein F represents a self-attention mechanism, specifically:
F(X)=VA
wherein q=xw Q ,K=XW K ,V=XW V ,W Q ,W K ,W V And C scaling coefficients for weight parameters in the network.
Further, the training novel ViT network specifically includes:
training a novel ViT network by using a contrast learning mode, respectively extracting feature graphs of image pairs by using the same network in the forward operation process of the novel ViT network, and using a contrast loss function as a loss evaluation function, wherein the expression is as follows:
wherein q represents an original sample; k (k) + Representing a positive sample; k (k) - Representing a negative sample; τ represents a temperature coefficient; sim () function represents any similarity function, q and k using a contrast loss function + Pull it in while pushing it away from other negative samples.
Further, the knowledge distillation specifically includes:
the power equipment defect detection model is used as a teacher model, knowledge distillation is used, network knowledge is transferred to a simplified student model with the volume smaller than that of the teacher model, so that compression and acceleration of the power equipment defect detection model are realized, a lightweight power equipment defect detection model is obtained, a cross entropy loss function is used as a distillation loss function of the power equipment defect detection model, and the cross entropy loss function is as follows:
where loss represents cross entropy loss; n represents the number of samples in the sample set; i represents the i-th sample in the sample set; y is i A tag value representing an i-th sample; p is p i Indicating the probability that the i-th sample is predicted to be positive.
Based on the same inventive concept, the power equipment defect detection system based on self-supervision learning of the invention comprises:
the sample set construction module: the method comprises the steps of acquiring a plurality of power equipment images shot by image sensing equipment, constructing a self-supervision data set, carrying out image enhancement on each image in the self-supervision data set, constructing a sample pair, and forming a self-supervision sample set; the method comprises the steps of acquiring a self-supervision data set, selecting a high-quality abnormal image from the self-supervision data set for labeling, and constructing a supervised sample set for subsequent fine tuning;
and a network construction module: the novel ViT network comprises a layered embedding module, a local perception module and a dynamic attention focusing module; the method comprises the steps of extracting an encoder part in a self-supervision pre-training model, adding an FPN network and a detection head network, and constructing a power equipment defect detection network;
the network training module is used for training the novel ViT network by utilizing the self-supervision sample set in a contrast learning mode to obtain a self-supervision pre-training model;
the model fine tuning module is used for freezing the weight of the encoder part in the self-supervision pre-training model, and carrying out fine tuning on the power equipment defect detection network by using the supervision sample set to obtain a power equipment defect detection model;
and the knowledge distillation module is used for compressing and accelerating the power equipment defect detection model with the volume larger than the set value by using a knowledge distillation method to obtain the lightweight power equipment defect detection model.
Based on the same inventive concept, the power equipment defect detection device based on self-supervised learning comprises a processor and a memory, wherein the memory stores computer instructions, the processor is used for executing the computer instructions stored in the memory, and the electronic equipment realizes the steps of the power equipment defect detection method based on self-supervised learning when the computer instructions are executed by the processor.
Based on the same inventive concept, a computer-readable storage medium of the present invention has stored thereon a computer program which, when executed by a processor, implements the steps of the above-described self-supervised learning-based power equipment defect detection method.
The beneficial effects are that: compared with the prior art, the invention has the remarkable technical effects that:
(1) The invention fully considers the situation that the electric power data has huge scale and few marked high-quality samples. In order to fully utilize large-scale image data, a novel ViT network is designed, and the problem of insufficient labeling data is solved.
(2) Through the combination of pre-training and fine tuning, the model can learn general features on a large amount of data first, and then perform fine tuning of specific tasks on supervised data, thereby improving the generalization capability of the model.
(3) By model distillation, a pre-trained model with a large amount of parameters can be compressed into a smaller model while retaining its key features and functions, thereby reducing computational complexity.
(4) The image data of the power equipment often has its specificity, but the new ViT network combines self-supervised learning and supervised fine tuning to capture these specificities well. The final model has stronger robustness, accuracy, high efficiency and generalization in the power scene.
Drawings
Fig. 1 is a schematic flow chart of a method for detecting defects of power equipment based on self-supervision learning according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a defect detection model according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a self-supervising pre-training encoder network structure disclosed in an embodiment of the present invention;
FIG. 4 is a schematic diagram of a knowledge distillation disclosed in an embodiment of the present invention;
FIG. 5 is a schematic diagram of a power equipment defect detection system based on self-supervised learning according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a power equipment defect detection device based on self-supervised learning according to an embodiment of the present invention.
Detailed Description
The technical scheme of the invention is described in detail below with reference to the detailed description and the attached drawings.
Example 1
Referring to fig. 1, fig. 1 is a flow chart of a method for detecting defects of a power device based on self-supervised learning according to an embodiment of the present invention. The method for detecting the defects of the electrical equipment described in fig. 1 is applied to an electrical system, for example, for detecting the defects of the electrical equipment, and the embodiment of the invention is not limited. As shown in fig. 1 and 2, the self-supervised learning-based power equipment defect detection method may include the operations of:
s1, constructing a sample set: acquiring a plurality of power equipment images shot by an image sensing device, constructing a self-supervision data set, carrying out image enhancement on each image in the self-supervision data set, constructing a sample pair, and forming a self-supervision sample set; and selecting high-quality abnormal images from the self-supervision data set to label, and constructing a supervised sample set for subsequent fine tuning. The method comprises the following specific steps:
s1.1, collecting power equipment images of each time period, generating image sample pairs through data enhancement methods such as image cutting, color transformation and the like, and constructing a self-supervision sample set;
s1.2, selecting high-quality equipment defect images from a self-supervision sample set to label and construct a supervision sample set;
s1.3, repeating the steps, periodically updating the acquired image data, constructing an image sample set of the power equipment, and dividing a training set, a verification set and a test set according to tasks in different stages.
In this embodiment, power device images from multiple perspectives and scenes captured by sensing devices such as unmanned aerial vehicles, control balls, cameras, and the like are collected.
S2, as shown in FIG. 3, constructing a novel ViT network: a novel ViT network comprising a layered embedding module, a local perception module and a dynamic attention focusing module is constructed. The method comprises the following steps:
the hierarchical embedding module is used for dividing the images in the input self-supervision sample set into N patch block images respectively in an overlapping or non-overlapping mode, and assigning a position code to each patch block image;
the local perception module is used for extracting local characteristics of each patch block image, and splicing the extracted vectors with the position codes to be used as input of the dynamic attention focusing module; the local perception module comprises a convolution layer, a BatchNorm layer, an activation layer, a pooling layer and a linear layer;
the dynamic attention focusing module is used for processing the local characteristics obtained by the local perception module, and embedding a dynamic weight into each patch block image so as to dynamically adjust the attention degree of the network to different patches; after the dynamic weights are applied, the adjusted embedded representation is input to the linear mapping layer; the output of the linear mapping layer is passed to Transformer Encoder for further processing of the image features.
In this embodiment, the output result of the linear mapping layer is passed to Transformer Encoder to further process the image features, including the following:
the dynamic attention focusing module further performs feature extraction fusion by using a residual self-attention network to generate an enhanced feature representation, and the expression is as follows:
Z=F(X)+X
wherein F represents a self-attention mechanism, specifically:
F(X)=VA
wherein q=xw Q ,K=XW K ,V=XW V ,W Q ,W K ,W V And C scaling coefficients for weight parameters in the network.
S3, training a novel ViT network: and training the novel ViT network by utilizing the self-supervision sample set in a contrast learning mode to obtain a self-supervision pre-training model. The method comprises the following steps:
training a novel ViT network by using a contrast learning mode, respectively extracting feature graphs of image pairs by using the same network in the forward operation process of the novel ViT network, and using a contrast loss function as a loss evaluation function, wherein the expression is as follows:
wherein q represents an original sample; k (k) + Representing a positive sample; k (k) - Representing a negative sample; τ represents a temperature coefficient; the sim () function represents any similarity function, herein cosine similarity is used, q and k are compared using a contrast loss function + Pull it in while pushing it away from other negative samples.
S4, constructing a power equipment defect detection network: extracting an encoder part in the self-supervision pre-training model, adding an FPN network and a detection head network, and constructing a power equipment defect detection network;
s5, fine tuning a power equipment defect detection network: freezing the weight of an encoder part in the self-supervision pre-training model, and performing fine adjustment on a power equipment defect detection network by using a supervision sample set to obtain a power equipment defect detection model, so that the defect detection capacity of the model is increased;
s6, knowledge distillation: and compressing and accelerating a defect detection model with the volume larger than a set value by using a knowledge distillation method. The method comprises the following steps:
as shown in fig. 4, the defect detection model acts as a teacher model, using knowledge distillation, delivering network knowledge to a smaller, simplified neural network (student model) to achieve model compression and acceleration. The cross entropy loss function is used as the distillation loss function of the model. The cross entropy loss function is as follows:
where loss represents cross entropy loss; n represents the number of samples in the sample set; i represents the i-th sample in the sample set; y is i A tag value representing an i-th sample; p is p i Indicating the probability that the i-th sample is predicted to be positive.
The following is a test for performing defect detection on a real power equipment image sample set, where the sample set contains 1986 power equipment defect images, the resolution is 1080p, and an experiment is performed by using an NVIDIA a100 machine, and the experimental results are shown in the following table:
accuracy (%) | Recall (%) | mAP(%) |
90.02 | 88.21 | 89.15 |
Specifically, distillation is used to compare performance indexes of teacher network and student network. The student network uses the resnet101 as a backbone network, the results are shown in the following table:
as can be seen from experimental results, the method for detecting the defects of the power equipment can accurately identify the defects of the equipment. After knowledge distillation, the student model can greatly reduce the dependence on resources on the premise of basically keeping the identification precision of the original model. Therefore, important technical support can be provided for safe and efficient operation of the power equipment, and a power system can be energized efficiently.
The scheme of the invention can solve the problem that the unmarked data cannot be effectively utilized, and fully utilizes the unmarked data to improve the detection precision; the method has the advantages that the defect detection precision of the substation equipment can be improved under the condition of a small quantity of marked samples, hidden danger affecting the stable operation of the power equipment can be found timely and efficiently, the quick response of power grid operation and maintenance personnel is facilitated, and the safe and stable operation of a power grid is ensured.
Example 2
Referring to fig. 5, fig. 5 is a schematic structural diagram of a power equipment defect detection system based on self-supervised learning according to an embodiment of the present invention. The system can realize defect detection of the power equipment, and specifically comprises the following steps:
the sample set construction module: the method comprises the steps of acquiring a plurality of power equipment images shot by image sensing equipment, constructing a self-supervision data set, carrying out image enhancement on each image in the self-supervision data set, constructing a sample pair, and forming a self-supervision sample set; the method comprises the steps of acquiring a self-supervision data set, selecting a high-quality abnormal image from the self-supervision data set for labeling, and constructing a supervised sample set for subsequent fine tuning;
and a network construction module: the novel ViT network comprises a layered embedding module, a local perception module and a dynamic attention focusing module; the method comprises the steps of extracting an encoder part in a self-supervision pre-training model, adding an FPN network and a detection head network, and constructing a power equipment defect detection network;
the network training module is used for training the novel ViT network by utilizing the self-supervision sample set in a contrast learning mode to obtain a self-supervision pre-training model;
the model fine tuning module is used for freezing the weight of the encoder part in the self-supervision pre-training model, and carrying out fine tuning on the power equipment defect detection network by using the supervision sample set to obtain a power equipment defect detection model;
and the knowledge distillation module is used for compressing and accelerating the power equipment defect detection model with the volume larger than the set value by using a knowledge distillation method to obtain the lightweight power equipment defect detection model.
In an alternative embodiment, the power device defect detection method includes: a) Collecting images shot by image sensing equipment such as a monitoring camera, a cloth control ball, an unmanned aerial vehicle and the like to construct a self-supervision sample set, and selecting abnormal images with better quality from the images to label the abnormal images to construct the supervision sample set for subsequent fine adjustment; b) Constructing a novel ViT network structure, which comprises a layered embedding module, a local sensing module, a dynamic attention focusing module and the like; c) Training a novel ViT network by contrast learning by using the self-supervision sample set after data enhancement; d) Constructing a power equipment defect detection network, wherein the power equipment defect detection network comprises an encoder network part in a novel ViT network, a FPN network and a detection head network; e) Freezing the weight of the encoder network, performing fine adjustment on the power equipment defect detection network by using a supervised sample set, and increasing the defect detection capacity of the model; e) For larger defect detection networks, the method of knowledge distillation is used for compression and acceleration.
Example 3
Referring to fig. 6, fig. 6 is a schematic structural diagram of a power equipment defect detection device based on self-supervised learning according to an embodiment of the present invention. The apparatus described in fig. 6 can be applied to an electric power system, for example, for defect detection of an electric power apparatus, and the embodiment of the invention is not limited.
As shown in fig. 6, the apparatus may include a processor and a memory, where the memory stores computer instructions, and the processor is configured to execute the computer instructions stored in the memory, where the electronic apparatus implements the steps of the method according to the above embodiment and achieves technical effects consistent with the method.
The memory may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) and/or cache memory. The device may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, memory may be used to read from or write to non-removable, non-volatile magnetic media (commonly referred to as a "hard disk drive"). A program/utility having a set (at least one) of program modules may be stored, for example, in a memory, such program modules including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules typically carry out the functions and/or methods of the embodiments described herein.
The processor executes various functional applications and data processing by running programs stored in the memory, for example, to implement the method provided by the first embodiment of the present invention.
Example 4
Embodiment 4 of the present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method described in the above embodiments and achieves technical effects consistent with the above methods.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Of course, the storage medium containing the computer executable instructions provided in the embodiments of the present invention is not limited to the above method operations, but may also perform the related operations in the method provided in any embodiment of the present invention.
The foregoing embodiments have been provided for the purpose of illustrating the general principles of the present invention and are not to be construed as limiting the invention, but are intended to cover all modifications, alternatives, equivalents, and improvements made thereon.
Claims (10)
1. The method for detecting the defects of the power equipment based on the self-supervision learning is characterized by comprising the following steps of:
constructing a sample set: acquiring a plurality of power equipment images shot by an image sensing device, constructing a self-supervision data set, carrying out image enhancement on each image in the self-supervision data set, constructing a sample pair, and forming a self-supervision sample set; selecting high-quality abnormal images from the self-supervision data set to label, and constructing a supervised sample set for subsequent fine adjustment;
constructing a novel ViT network: constructing a novel ViT network comprising a layered embedding module, a local perception module and a dynamic attention focusing module;
training novel ViT network: training a novel ViT network by utilizing a self-supervision sample set in a contrast learning mode to obtain a self-supervision pre-training model;
constructing a power equipment defect detection network: extracting an encoder part in the self-supervision pre-training model, adding an FPN network and a detection head network, and constructing a power equipment defect detection network;
trimming a power device defect detection network: freezing the weight of an encoder part in the self-supervision pre-training model, and performing fine adjustment on the power equipment defect detection network by using a supervision sample set to obtain a power equipment defect detection model;
knowledge distillation: and compressing and accelerating the power equipment defect detection model with the volume larger than the set value by using a knowledge distillation method to obtain the lightweight power equipment defect detection model.
2. The method for detecting defects of electrical equipment based on self-supervised learning as set forth in claim 1, wherein the constructing the sample set specifically includes:
collecting power equipment images in each time period, generating image sample pairs by a data enhancement method of color transformation through image cutting, and constructing a self-supervision sample set;
selecting high-quality equipment defect images from the self-supervision sample set to label and construct a supervision sample set;
and repeating the steps, periodically updating the acquired image data, constructing an image sample set of the power equipment, and dividing a training set, a verification set and a test set according to tasks in different stages.
3. The method for detecting defects of power equipment based on self-supervised learning as set forth in claim 1, wherein the novel ViT network specifically includes:
the hierarchical embedding module is used for dividing the images in the input self-supervision sample set into N patch block images respectively in an overlapping or non-overlapping mode, and assigning a position code to each patch block image;
the local perception module is used for extracting local characteristics of each patch block image, and splicing the extracted vectors with the position codes to be used as input of the dynamic attention focusing module; the local perception module comprises a convolution layer, a BatchNorm layer, an activation layer, a pooling layer and a linear mapping layer;
the dynamic attention focusing module is used for processing the local characteristics obtained by the local perception module, and embedding a dynamic weight into each patch block image so as to dynamically adjust the attention degree of the network to different patches; after the dynamic weight is applied, the adjusted embedded representation is input to a linear mapping layer in the local perception module; the output of the linear mapping layer is passed to Transformer Encoder for further processing of the image features.
4. A method of power plant defect detection based on self-supervised learning as recited in claim 3, wherein the output of the linear mapping layer is passed to Transformer Encoder for further processing of the image features, comprising the steps of:
the dynamic attention focusing module further performs feature extraction fusion by using a residual self-attention network to generate an enhanced feature representation, and the expression is as follows:
Z=F(X)+X
wherein F represents a self-attention mechanism, specifically:
F(X)=VA
wherein q=xw Q ,K=XW K ,V=XW V ,W Q ,W K ,W V And C scaling coefficients for weight parameters in the network.
5. The method for detecting defects of power equipment based on self-supervised learning as set forth in claim 1, wherein the training novel ViT network specifically comprises:
training a novel ViT network by using a contrast learning mode, respectively extracting feature graphs of image pairs by using the same network in the forward operation process of the novel ViT network, and using a contrast loss function as a loss evaluation function, wherein the expression is as follows:
wherein q represents an original sample; k (k) + Representing a positive sample; k (k) - Representing a negative sample; τ represents a temperature coefficient; the sim () function represents any similarityFunction, q and k are compared using a contrast loss function + Pull it in while pushing it away from other negative samples.
6. The method for detecting defects of electrical equipment based on self-supervised learning as set forth in claim 1, wherein the knowledge distillation specifically includes:
the power equipment defect detection model is used as a teacher model, knowledge distillation is used, network knowledge is transmitted to a simplified student model with the size smaller than that of the teacher model, so that compression and acceleration of the defect detection model are realized, and the lightweight power equipment defect detection model is obtained.
7. The method for detecting defects of electrical equipment based on self-supervised learning as recited in claim 6, wherein the knowledge distillation process uses a cross entropy loss function as a distillation loss function of the defect detection model, the cross entropy loss function being as follows:
where loss represents cross entropy loss; n represents the number of samples in the sample set; i represents the i-th sample in the sample set; y is i A tag value representing an i-th sample; p is p i Indicating the probability that the i-th sample is predicted to be positive.
8. A self-supervised learning-based power equipment defect detection system, comprising:
the sample set construction module: the method comprises the steps of acquiring a plurality of power equipment images shot by image sensing equipment, constructing a self-supervision data set, carrying out image enhancement on each image in the self-supervision data set, constructing a sample pair, and forming a self-supervision sample set; the method comprises the steps of acquiring a self-supervision data set, selecting a high-quality abnormal image from the self-supervision data set for labeling, and constructing a supervised sample set for subsequent fine tuning;
and a network construction module: the novel ViT network comprises a layered embedding module, a local perception module and a dynamic attention focusing module; the method comprises the steps of extracting an encoder part in a self-supervision pre-training model, adding an FPN network and a detection head network, and constructing a power equipment defect detection network;
the network training module is used for training the novel ViT network by utilizing the self-supervision sample set in a contrast learning mode to obtain a self-supervision pre-training model;
the model fine tuning module is used for freezing the weight of the encoder part in the self-supervision pre-training model, and carrying out fine tuning on the power equipment defect detection network by using the supervision sample set to obtain a power equipment defect detection model;
and the knowledge distillation module is used for compressing and accelerating the power equipment defect detection model with the volume larger than the set value by using a knowledge distillation method to obtain the lightweight power equipment defect detection model.
9. A self-supervised learning based power equipment defect detection apparatus, comprising a processor and a memory, the memory having stored therein computer instructions for executing the computer instructions stored in the memory, the electronic apparatus implementing the steps of the self-supervised learning based power equipment defect detection method as claimed in any one of claims 1 to 7 when the computer instructions are executed by the processor.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the steps of the self-supervised learning-based power plant defect detection method as recited in any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311641419.0A CN117671587A (en) | 2023-12-01 | 2023-12-01 | Power equipment defect detection method and system based on self-supervision learning |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311641419.0A CN117671587A (en) | 2023-12-01 | 2023-12-01 | Power equipment defect detection method and system based on self-supervision learning |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117671587A true CN117671587A (en) | 2024-03-08 |
Family
ID=90063582
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311641419.0A Pending CN117671587A (en) | 2023-12-01 | 2023-12-01 | Power equipment defect detection method and system based on self-supervision learning |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117671587A (en) |
-
2023
- 2023-12-01 CN CN202311641419.0A patent/CN117671587A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115829999A (en) | Insulator defect detection model generation method, device, equipment and storage medium | |
CN111179249A (en) | Power equipment detection method and device based on deep convolutional neural network | |
CN113569672B (en) | Lightweight target detection and fault identification method, device and system | |
CN113515655B (en) | Fault identification method and device based on image classification | |
Zheng et al. | Component identification and defect detection in transmission lines based on deep learning | |
CN117557775B (en) | Substation power equipment detection method and system based on infrared and visible light fusion | |
CN116152611B (en) | Multistage multi-scale point cloud completion method, system, equipment and storage medium | |
CN113205039A (en) | Power equipment fault image identification and disaster investigation system and method based on multiple DCNNs | |
CN117993868B (en) | Dual-mode attention-based power grid engineering project audit early warning method and system | |
CN117788976A (en) | Intelligent substation data enhancement and anomaly identification method | |
CN114519293A (en) | Cable body fault identification method based on hand sample machine learning model | |
CN117849193A (en) | Online crack damage monitoring method for neodymium iron boron sintering | |
CN116805387B (en) | Model training method, quality inspection method and related equipment based on knowledge distillation | |
CN116580285B (en) | Railway insulator night target identification and detection method | |
CN117671587A (en) | Power equipment defect detection method and system based on self-supervision learning | |
CN115100546A (en) | Mobile-based small target defect identification method and system for power equipment | |
CN112036472A (en) | Visual image classification method and system for power system | |
CN117152646B (en) | Unmanned electric power inspection AI light-weight large model method and system | |
CN117173385B (en) | Detection method, device, medium and equipment of transformer substation | |
Yu et al. | Research on identification and detection of foreign body intrusion for overhead lines | |
Yu et al. | InsDetecter: An Insulator Detection Algorithm Based on Foreground Focusing and Multi-Scale Interaction | |
CN117636249A (en) | Insect condition monitoring and identifying method, device, equipment and medium for learning with few samples | |
CN118864989A (en) | Substation anomaly identification method and equipment based on multi-mode large model | |
Yin et al. | Intelligent Detection Algorithm and Implementation for Unmanned Aerial Vehicle Inspection of Transmission Lines | |
Lu et al. | Research on detection of insulator damage based on improved YOLOv4-tiny network |
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 |