Improved DCGAN-based power transformation defect data expansion method and system

Through the improved DCGAN algorithm, using the FReLU activation function and Wasserstein distance, combined with the BRA attention mechanism, the problem of scarcity of substation defect data samples and poor generation quality is solved, and more abundant and high-quality defect samples are generated, which improves substation defect identification. The amount of training data and accuracy of the model.

CN118865013APending Publication Date: 2024-10-29SHANDONG ZHIYANG ELECTRIC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410826354.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

There are few defect data samples in substations, making it difficult to support high-precision defect identification model training, and the existing DCGAN algorithm produces poor quality defect pictures in complex substation scenarios.

Method used

The improved DCGAN algorithm is used, the Relu activation function is replaced by FReLU, the Wasserstein distance is used as the loss function, and the Bi-Level Routing Attenton (BRA) attention mechanism is introduced to generate more defect samples through data cleaning and weak data enhancement.

Benefits of technology

It effectively expands the transformer defect data set, improves the quality of the generated defect samples, solves the vanishing gradient problem and establishes a better global feature relationship, and the generated defect samples are of higher quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118865013A_ABST
    Figure CN118865013A_ABST
Patent Text Reader

Abstract

The invention discloses a power transformation defect data expansion method and system based on an improved DCGAN, and mainly relates to the technical field of power transformation defect data generation. Comprising the following steps: acquiring a substation defect data set, and preprocessing to obtain a training data set; an improved DCGAN algorithm model is constructed for model training; and generating a large amount of power transformation defect image data by using a generator of the trained improved DCGAN model. The method has the beneficial effects that richer image information can be obtained, and a large number of defect samples can be generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of substation defect data generation, and in particular to a substation defect data expansion method and system based on improved DCGAN. Background Art

[0002] With the rapid development of intelligent inspection technology in the power field, the importance of substation defect identification, which is mainly based on deep learning tasks such as target detection and semantic segmentation, has become increasingly prominent. However, substation defect data often has the problem of few samples and cannot well support the further training of defect identification models. In order to further obtain a more accurate defect identification model, more training data needs to be introduced. However, in the daily inspection of substations, equipment defects rarely occur, and the number of defect samples that can be collected is limited.

[0003] Therefore, there is an urgent need for a substation defect data expansion method and system based on improved DCGAN to solve the above problems. Summary of the invention

[0004] The purpose of the present invention is to provide a substation defect data expansion method and system based on improved DCGAN, which can obtain richer image information and generate a large number of defect samples.

[0005] In order to achieve the above object, the present invention is implemented through the following technical solutions:

[0006] A method for expanding defect data of substation based on improved DCGAN includes the following steps:

[0007] S1: Collect substation defect data set and obtain training data set after preprocessing;

[0008] S2: construct an improved DCGAN algorithm model for model training, wherein the improved DCGAN algorithm includes: replacing the original Relu activation function with the FReLU activation function to accelerate model convergence, replacing the loss function in the original model with the Wasserstein distance, and introducing the BRA attention mechanism;

[0009] S3: Use the generator of the trained improved DCGAN model to generate a large amount of substation defect image data.

[0010] Preferably, in step S1, the substation defect data set is collected and preprocessed to obtain a training data set, specifically:

[0011] Collect defective pictures of real inspections in substation scenarios, and obtain training data after preprocessing. The preprocessing operation includes data cleaning and weak data enhancement methods. The weak data enhancement methods include: rotation, flipping and adding noise.

[0012] Preferably, the improved DCGAN algorithm model constructed in step S2 is specifically:

[0013] The ReLU activation function in the generator is replaced by the FReLU activation function, and the spatial context information is added to the activation function. The FReLU activation function is: FReLU=max(x,T(x)), where T(x) is the context feature extractor;

[0014] The loss function in the original model is replaced by Wasserstein distance, where the Wasserstein distance is the distance between the generated data distribution and the real data distribution. The calculation expression of the Wasserstein distance is: W(P,Q)=inf γ∈∏(P,Q) E (x,y) [‖xy‖], where P is the distribution of real defect images, Q is the distribution of defect images generated by the generator, W is the Wasserstein distance between the two image distributions, γ∈∏(P,Q) is the joint distribution of the real defect image and the generated defect image, inf means taking the minimum value, x and y are random variables sampled from P and Q, ‖xy‖ is the distance between x and y, and E is the expected value of the distance;

[0015] The attention mechanism is Bi-Level Routing Attenton dynamic sparse attention, that is, BRA attention mechanism. The specific method of the BRA attention mechanism includes:

[0016] The input feature data is divided into S×S different regions, each region contains HW / S 2 feature vectors, where H and W are the feature data height and width respectively. Three inputs query(q), key(k) and value(v) are obtained through linear mapping. The average values ​​of q and k are Q and K. The adjacency matrix vector of regional correlation is constructed through Q and K: A_r=QK T , where A_r is the vector for constructing the adjacency matrix, and T represents the matrix transpose;

[0017] Keep the index of the top n connections of each region I = topnIndex(A_r), where I is the index matrix, gathering k, v, K g =gather(k,I),V g =gather(v,I), for the aggregated K g ,V g Using attention operation: Where Att is the attention function, LCE(·) is parameterized using depthwise separable convolution, and sofmax is the normalized exponential function.

[0018] A substation defect data expansion system based on improved DCGAN, comprising:

[0019] Image acquisition module, used to collect substation defect data sets;

[0020] The preprocessing module is used to perform data cleaning and weak data enhancement operations on the collected substation defect data set to obtain a training data set;

[0021] The model training module is used to perform model training on the preprocessed training data set based on the improved DCGAN algorithm model to obtain a DCGAN algorithm model with the ability to generate substation defect data;

[0022] The image generation module is used as a generator of the DCGAN model trained in the model training module to generate a large amount of substation defect image data.

[0023] Compared with the prior art, the beneficial effects of the present invention are:

[0024] In order to solve the problem of insufficient defect data samples in substations, the weak data enhancement method is used to increase the amount of training data sets. At the same time, the deep learning model DCGAN is used to train the existing defect data sets to obtain richer image information and generate a large number of defect samples.

[0025] In view of the problem that the DCGAN algorithm model generates poor quality defect images in complex substation scenarios, the present invention generates substation defect data based on an improved DCGAN algorithm model, and uses Wasserstein distance to replace the loss function of the original algorithm model, which can effectively solve the problem of gradient disappearance during model training. At the same time, the RBA attention mechanism is introduced to better establish the relationship between global features to generate higher quality defect samples. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 Flow chart of the substation defect data expansion method based on improved DCGAN according to the present invention

[0027] Figure 2 The structural principle diagram of the improved CGAN model of the present invention

[0028] Figure 3 The generator network structure diagram of the improved CGAN model of the present invention

[0029] Figure 4 The discriminator network structure diagram of the improved CGAN model of the present invention

[0030] Figure 5 This is the structural principle diagram of the BRA attention module of the present invention

[0031] Figure 6Schematic diagram of the structure of the substation defect data expansion system based on the improved DCGAN of the present invention DETAILED DESCRIPTION

[0032] The present invention will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall within the scope limited by the application equally.

[0033] In the present invention, terms such as "upper", "lower", "left", "right", "front", "back", "vertical", "horizontal", "side", "bottom", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings. They are relational words determined only for the convenience of describing the structural relationships of the various parts or elements of the present invention, and do not specifically refer to any part or element in the present invention and should not be understood as limitations on the present invention.

[0034] In the present invention, terms such as "fixed connection", "connected", "connection", etc. should be understood in a broad sense, indicating that it can be fixedly connected, integrally connected or detachably connected; it can be directly connected or indirectly connected through an intermediate medium. Relevant scientific research or technical personnel in this field can determine the specific meanings of the above terms in the present invention according to specific circumstances, and they should not be understood as limiting the present invention.

[0035] Example:

[0036] like Figure 1 As shown, a method for expanding defect data of a substation based on an improved DCGAN includes the following steps:

[0037] S1: Collect substation defect data set and obtain training data set after preprocessing;

[0038] S2: construct an improved DCGAN algorithm model for model training, wherein the improved DCGAN algorithm includes: replacing the original Relu activation function with the FReLU activation function to accelerate model convergence, replacing the loss function in the original model with the Wasserstein distance, and introducing the BRA attention mechanism;

[0039] S3: Use the generator of the trained improved DCGAN model to generate a large amount of substation defect image data.

[0040] Wherein, in step S1, the substation defect data set is collected and preprocessed to obtain the training data set, specifically:

[0041] Collect defective pictures of real inspections in substation scenarios, and obtain training data after preprocessing. The preprocessing operation includes data cleaning and weak data enhancement methods. The weak data enhancement methods include: rotation, flipping and adding noise.

[0042] The improvements of the improved DCGAN algorithm model include:

[0043] like Figure 2 As shown, the loss function in the original model is replaced by Wasserstein distance, where the Wasserstein distance is the distance between the generated data distribution and the real data distribution. The calculation expression of the Wasserstein distance is: W(P,Q)=inf γ∈∏(P,Q) E (x,y) [‖xy‖], where P is the distribution of real defect images, Q is the distribution of defect images generated by the generator, W is the Wasserstein distance between the two image distributions, γ∈∏(P,Q) is the joint distribution of real defect images and generated defect images, inf means taking the minimum value, x and y are random variables sampled from P and Q, ‖xy‖ is the distance between x and y, and E is the expected value of the distance.

[0044] Improve the generator structure such as Figure 3 As shown in the figure, the ReLU activation function in the generator is replaced with the FReLU activation function, and spatial context information is added to the activation function. The FReLU activation function is: FReLU = max(x, T(x)), where T(x) is the context feature extractor. A BRA attention module is added.

[0045] Improve the discriminator structure such as Figure 4 As shown, add the BRA attention module.

[0046] The BRA attention mechanism algorithm structure is as follows Figure 5 As shown, the BRA attention mechanism is Bi-Level RoutingAttenton dynamic sparse attention, and the specific method of the BRA attention mechanism includes:

[0047] The input feature data is divided into S×S different regions, each region contains HW / S 2 feature vectors, where H and W are the feature data height and width respectively. Three inputs query(q), key(k) and value(v) are obtained through linear mapping. The average values ​​of q and k are Q and K. The adjacency matrix vector of regional correlation is constructed through Q and K: A_r=QK T , where A_r is the vector for constructing the adjacency matrix, and T represents the matrix transpose;

[0048] Keep the index of the top n connections of each region I = topnIndex(A_r), where I is the index matrix, gathering k, v, K g =gather(k,I),V g =gather(v,I), for the aggregated K g ,V g Using attention operation: Where Att is the attention function, LCE(·) is parameterized using depthwise separable convolution, and sofmax is the normalized exponential function.

[0049] S3, generating a large amount of substation defect image data based on the generator of the improved DCGAN model trained in step S2;

[0050] like Figure 6 As shown, the substation defect data expansion system based on the improved DCGAN specifically includes:

[0051] An image acquisition module, wherein the image acquisition module is used to collect a substation defect data set;

[0052] A preprocessing module, which is used to perform data cleaning and weak data enhancement operations on the collected substation defect data set to obtain a training data set;

[0053] A model training module, wherein the model training module is used to perform model training on the preprocessed training data set based on the improved DCGAN algorithm model to obtain a DCGAN algorithm model with the ability to generate substation defect data;

[0054] An image generation module is used as a generator of the DCGAN model trained in the model training module to generate a large amount of substation defect image data.

Claims

1. A method for expanding defect data of substation based on improved DCGAN, characterized in that: The following steps are involved: S1: Collect substation defect data set and obtain training data set after preprocessing; S2: construct an improved DCGAN algorithm model for model training, wherein the improved DCGAN algorithm includes: replacing the original Relu activation function with the FReLU activation function to accelerate model convergence, replacing the loss function in the original model with the Wasserstein distance, and introducing the BRA attention mechanism; S3: Use the generator of the trained improved DCGAN model to generate a large amount of substation defect image data.

2. According to the method for expanding defect data of substation based on improved DCGAN in claim 1, it is characterized in that: In step S1, the substation defect data set is collected and preprocessed to obtain a training data set, specifically: Collect defective pictures of real inspections in substation scenarios, and obtain training data after preprocessing. The preprocessing operation includes data cleaning and weak data enhancement methods. The weak data enhancement methods include: rotation, flipping and adding noise.

3. According to the method for expanding defect data of substation based on improved DCGAN in claim 1, it is characterized in that: The improved DCGAN algorithm model constructed in step S2 is specifically as follows: The ReLU activation function in the generator is replaced by the FReLU activation function, and the spatial context information is added to the activation function. The FReLU activation function is: FReLU=max(x, T(x)), where T(x) is a context feature extractor; The loss function in the original model is replaced by Wasserstein distance, where the Wasserstein distance is the distance between the generated data distribution and the real data distribution. The calculation expression of the Wasserstein distance is: W(P, Q) = inf γ∈∏(P,Q) E (x,y) [||xy||], where P is the distribution of real defect images, Q is the distribution of defect images generated by the generator, W is the Wasserstein distance between the two image distributions, γ∈∏(P,Q) is the joint distribution of the real defect image and the generated defect image, inf means taking the minimum value, x and y are random variables sampled from P and Q, ||xy| is the distance between x and y, and E is the expected value of the distance; The attention mechanism is Bi-Level Routing Attenton dynamic sparse attention, that is, BRA attention mechanism. The specific method of the BRA attention mechanism includes: The input feature data is divided into S×S different regions, each region contains HW / S 2 feature vectors, where H and W are the feature data height and width respectively. Three inputs query(q), key(k) and value(v) are obtained through linear mapping. The average values ​​of q and k are Q and K. The adjacency matrix vector of regional correlation is constructed through Q and K: A_r=QK T , where A_r is the vector for constructing the adjacency matrix, and T represents the matrix transpose; Keep the index of the top n connections of each region I = topnIndex(A_r), where I is the index matrix, gathering k, v, K g =gather(k,I),V g =gather(v, I), for the aggregated K g ,V g Use attention operation: Att(q, k, v) = sofmax(Q, K gT )×Vg+LCE(v), where Att is the attention function, LCE(·) is parameterized using depthwise separable convolution, and sofmax is the normalized exponential function.

4. A substation defect data expansion system based on improved DCGAN, characterized in that: include: Image acquisition module, used to collect substation defect data sets; The preprocessing module is used to perform data cleaning and weak data enhancement operations on the collected substation defect data set to obtain a training data set; The model training module is used to perform model training on the preprocessed training data set based on the improved DCGAN algorithm model to obtain a DCGAN algorithm model with the ability to generate substation defect data; The image generation module is used as a generator of the DCGAN model trained in the model training module to generate a large amount of substation defect image data.