Distribution network fault diagnosis method, device, equipment and readable storage medium
By building an enhanced convolutional neural network, combining residual structure, batch standardization, ShuffleNet and attention module, the subjectivity and adaptability problems of the existing distribution network fault diagnosis methods are solved, and efficient and automated fault diagnosis is achieved.
Patent Information
- Application Number
- CN202210406063.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-18
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2042-04-18
AI Technical Summary
The existing distribution network fault diagnosis methods have strong subjectivity and are uneven and structural imbalance that are not suitable for distribution networks, resulting in low diagnostic efficiency and poor data set transplantability.
Build a basic diagnostic network, add residual structure module, batch standardization layer, ShuffleNet module and attention module, supervise and train through Focal Loss as the objective function, form a diagnostic network to be trained, and preprocess the fault current information to generate a sample data set.
It realizes automated fault diagnosis, improves detection accuracy and data set portability, and can efficiently diagnose distribution network faults without manual participation.
Smart Images

Figure CN114841199B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine learning technology, and in particular to a distribution network fault diagnosis method, device, equipment and readable storage medium. Background Art
[0002] As the final stage of power transmission, the distribution network consists of multiple branches and transmits electricity to the final consumption point. These branches are scattered across vast rural and urban areas and are susceptible to different types of faults caused by different sources, such as severe weather conditions, vegetation growth, and equipment failures. Data shows that 80% of customer power outages are caused by distribution network failures. The duration of power outages is one of the most important reliability indicators for power companies, so it is very important to diagnose faults quickly and effectively to minimize downtime. The unevenness of the distribution network, the unbalanced structure, and the circuit branches hinder the direct application of transmission network fault diagnosis methods to the distribution network.
[0003] In recent years, different fault diagnosis technologies have been explored and proposed to solve these challenges, mainly expert systems, artificial neural networks, analytical models, etc. Expert systems use the expert's experience and relevant theoretical knowledge to establish a rule base and logically match it with power grid faults to diagnose faults. It is in line with human thinking and cognitive processes and has strong reasoning and interpretation capabilities. But at the same time, the expert system needs to update the rule base in real time, which makes maintenance more difficult. Artificial neural networks can automatically learn and adjust network parameters through sample training, input fault information, and output the type of fault diagnosed. However, this method requires a large amount of sample data to train the network, but it is actually difficult to obtain a large amount of complete fault sample data, and when the power grid structure changes, the network needs to be retrained and learned.
[0004] Petri nets use weighted directed graphs and matrix operations to diagnose distribution network faults, and use mathematical methods to derive and analyze the logical relationships between power grid components, protection and circuit breakers. However, the existing Petri net model requires the use of offline modeling and online calling to model all faulty components separately, which is not suitable for all networks. The analytical model is a mathematical model based on the protection fault hypothesis and the expected state of the circuit breaker in the system, which converts the fault diagnosis problem into an integer programming solution. However, traditional analytical models are prone to multiple solutions and misunderstandings. In large and complex systems, it is difficult to analyze and model the mechanism of the system. The increase in variable dimensions makes the solution more difficult.
[0005] Most of the current mainstream distribution network diagnosis methods mentioned above are based on manual feature extraction, which is subjective and can only express the specified characteristics of fault signals. In addition, due to the unevenness, structural imbalance, and circuit branches of the distribution network, these methods are not easy to transplant to other data sets for direct use. Summary of the invention
[0006] In order to solve the above technical problems, the present invention provides a distribution network fault diagnosis method, device, equipment and readable storage medium.
[0007] In a first aspect, the present invention provides a distribution network fault diagnosis method, the distribution network fault diagnosis method comprising:
[0008] Construct a basic diagnostic network, which includes convolutional layers, pooling layers, fully connected layers, activation functions, neural network hyperparameters, and softmax layers;
[0009] Add a residual structure module, a batch normalization layer, a ShuffleNet module, and an attention module to the basic diagnostic network to obtain a diagnostic network to be trained;
[0010] Preprocessing the fault current information collected by the fault recorder to obtain a sample data set;
[0011] The sample data set is used to train the diagnosis network to obtain the distribution network fault diagnosis network. During the training process, Focal Loss is used as the objective function for supervised training.
[0012] Distribution network fault diagnosis is performed based on the distribution network fault diagnosis network.
[0013] Optionally, the step of preprocessing the fault current information collected by the fault recorder to obtain a sample data set includes:
[0014] The fault current information collected by the fault recorder is imported into the MATLAB software, and the sample data set is obtained using the max function and for loop, where the fault current information is expressed as follows:
[0015] x=[Time I a I b I c FT FR FIA LV FL]
[0016] Among them, I a Indicates the A phase current, I b Indicates the B phase current, I c represents the C phase current, FT represents the fault type, FR represents the fault resistance, FIA represents the fault initial phase angle, LV represents the load size, and FL represents the fault location;
[0017] The sample dataset is represented as follows:
[0018]
[0019] Wherein, 1 to n are the labels of the fault current information 1 to n.
[0020] Optionally, the residual structure module is simplified based on the number of convolutional layers.
[0021] Optionally, the batch normalization layer is used to normalize the input value distribution of any neuron into a standard normal distribution.
[0022] Optionally, the ShuffleNet module is ShuffleNet_V2, which splits the input features into two branches in the channel dimension, one of which remains unchanged and performs the same mapping, and the other branch performs three consecutive convolutions with the same output and input channels.
[0023] Optionally, the attention module includes a channel attention module, which first performs a maximum pooling operation to obtain a pooling result M c , and perform average pooling on each channel to obtain the pooling result A c , assuming that the number of channels of the input feature is represented by c, M c and A c Input the fully connected layer respectively and output M c ' and A c ', after summing, it is input into the sigmoid function for normalization, and the output of the sigmoid function is the channel attention.
[0024] Optionally, the attention module further includes a spatial attention module, which first performs a maximum pooling operation on each channel to obtain a pooling result M s , and perform average pooling on each channel to obtain the pooling result A s , the length of the input feature is represented by s, and the concatenated pooling result [M s ,A s ], yes [M s ,A s ] performs a convolution operation with a convolution kernel size of [1,7,2] and a convolution kernel number of 1. The convolution result is input into the sigmoid function for normalization. The output result of the sigmoid function is the spatial attention.
[0025] In a second aspect, the present invention further provides a distribution network fault diagnosis device, the distribution network fault diagnosis device comprising:
[0026] The construction module is used to build a basic diagnostic network, which includes convolutional layers, pooling layers, fully connected layers, activation functions, neural network hyperparameters, and softmax layers;
[0027] An optimization module is used to add a residual structure module, a batch normalization layer, a ShuffleNet module, and an attention module to the basic diagnosis network to obtain a diagnosis network to be trained;
[0028] A data set construction module is used to pre-process the fault current information collected by the fault recorder to obtain a sample data set;
[0029] A training module is used to train the diagnosis network to be trained using a sample data set to obtain a distribution network fault diagnosis network. During the training process, Focal Loss is used as an objective function for supervised training.
[0030] A diagnosis module is used to perform distribution network fault diagnosis based on the distribution network fault diagnosis network.
[0031] In a third aspect, the present invention also provides a distribution network fault diagnosis device, which includes a processor, a memory, and a distribution network fault diagnosis program stored in the memory and executable by the processor, wherein when the distribution network fault diagnosis program is executed by the processor, the steps of the distribution network fault diagnosis method as described above are implemented.
[0032] In a fourth aspect, the present invention further provides a readable storage medium, on which a distribution network fault diagnosis program is stored, wherein when the distribution network fault diagnosis program is executed by a processor, the steps of the distribution network fault diagnosis method as described above are implemented.
[0033] In the present invention, a basic diagnosis network is constructed, and the basic diagnosis network includes a convolution layer, a pooling layer, a fully connected layer, an activation function, a neural network hyperparameter and a softmax layer; a residual structure module, a batch normalization layer, a ShuffleNet module and an attention module are added to the basic diagnosis network to obtain a diagnosis network to be trained; the fault current information collected by the fault recorder is preprocessed to obtain a sample data set; the diagnosis network to be trained is trained by the sample data set to obtain a distribution network fault diagnosis network, and during the training process, Focal Loss is used as an objective function for supervised training; and distribution network fault diagnosis is performed based on the distribution network fault diagnosis network. Through the present invention, the original power grid current data (i.e., the fault current information collected by the fault recorder) is used as input to output a fault diagnosis result, and no manual participation is required. It has the characteristics of high detection accuracy and good data set portability, and uses a simplified residual connection technology, uses Focal Loss as an objective function for supervised training, adds a batch normalization layer in the network for optimization, and reduces parameters based on the ShuffleNet network and improves accuracy based on the attention mechanism. The process can automatically determine a suitable CNN architecture for fault diagnosis problems. The CNN adopted in the present invention directly uses the current information sampled by the fault recorder of each node in the distribution network as input, without the need to use digital signal processing methods to extract frequency domain features and manually select features. It combines the respective advantages of the ShuffleNet module and the attention module to effectively improve the diagnosis accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic diagram of the hardware structure of a distribution network fault diagnosis device involved in an embodiment of the present invention;
[0035] Figure 2 A schematic diagram of a flow chart of an embodiment of a method for diagnosing a fault in a power distribution network according to the present invention;
[0036] Figure 3 A residual structure diagram used in an embodiment of a method for diagnosing faults in a power distribution network according to the present invention;
[0037] Figure 4 A simplified residual structure diagram used in an embodiment of a method for diagnosing faults in a power distribution network according to the present invention;
[0038] Figure 5 A schematic diagram of adding a residual structure module to the basic diagnostic network;
[0039] Figure 6 A schematic diagram of adding the ShuffleNet module to the basic diagnostic network;
[0040] Figure 7 Schematic diagram of the processing flow of the channel attention module;
[0041] Figure 8 Schematic diagram of the processing flow of the spatial attention module;
[0042] Fig. 9 Schematic diagram of the processing flow of the attention module;
[0043] Fig.10 Schematic diagram of adding ShuffleNet module and attention module to the basic diagnosis network;
[0044] Fig.11 This is a schematic diagram of functional modules of an embodiment of a distribution network fault diagnosis device of the present invention.
[0045] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0046] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0047] In a first aspect, an embodiment of the present invention provides a distribution network fault diagnosis device, which may be a device having a data processing function, such as a personal computer (PC), a notebook computer, or a server.
[0048] Reference Figure 1 , Figure 1 It is a hardware structure diagram of the distribution network fault diagnosis device involved in the embodiment of the present invention. In the embodiment of the present invention, the distribution network fault diagnosis device may include a processor 1001 (such as a central processing unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components; the user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard); the network interface 1004 may optionally include a standard wired interface, a wireless interface (such as wireless fidelity WIreless-FIdelity, WI-FI interface); the memory 1005 may be a high-speed random access memory (random access memory, RAM), or a stable memory (non-volatile memory), such as a disk storage, and the memory 1005 may optionally be a storage device independent of the aforementioned processor 1001. Those skilled in the art will understand that Figure 1The hardware structure shown in the figure does not constitute a limitation of the present invention, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.
[0049] Continue to refer to Figure 1 , Figure 1 The memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a distribution network fault diagnosis program. The processor 1001 may call the distribution network fault diagnosis program stored in the memory 1005 and execute the distribution network fault diagnosis method provided in the embodiment of the present invention.
[0050] In a second aspect, an embodiment of the present invention provides a distribution network fault diagnosis method.
[0051] In one embodiment, referring to Figure 2 , Figure 2 FIG. 1 is a flow chart of an embodiment of a method for diagnosing a fault in a power distribution network according to the present invention. Figure 2 As shown, the distribution network fault diagnosis method includes:
[0052] Step S10, constructing a basic diagnosis network, which includes a convolutional layer, a pooling layer, a fully connected layer, an activation function, a neural network hyperparameter, and a softmax layer;
[0053] In this embodiment, building a basic diagnostic network includes:
[0054] Construct a convolutional layer:
[0055] The convolution layer consists of a set of convolution kernels used to extract different features. The mathematical expression for its calculation is as follows:
[0056]
[0057] In the formula, the input feature map of the convolutional layer is composed of M j , the bias value is represented by b, the nonlinear activation function is represented by f(·), and the input feature map of the i-th convolution kernel of the l-1th layer network is represented by Indicates that the jth weight value of the i-th convolution kernel in the l-th layer is given by Indicates, * is the symbol of convolution operation, and finally outputs the jth feature map of the lth layer, that is,
[0058] Construct the pooling layer:
[0059] There are two common pooling operations: Average Pooling and Max Pooling. The general calculation process of pooling can be expressed as:
[0060]
[0061] In the formula, the multiplicative bias of the jth neuron in the lth layer network is given by Indicates that the additive bias of the jth neuron in the lth layer network is given by denoted by , and the sampling function is denoted by down(·).
[0062] Construct a fully connected layer:
[0063] The input of the fully connected layer is the features extracted by the previous layer of the network, and the output is a one-dimensional vector. Its mathematical expression is:
[0064] y=W d ·x+b d
[0065] Where x refers to the input of the fully connected layer, W d is the parameter matrix, b d is the bias vector.
[0066] Construct Relu activation function:
[0067] The activation function introduces nonlinearity into the calculation of the neural network. The nonlinear activation function of the output layer and the hidden layer used in this embodiment is the Relu function.
[0068] Construct neural network hyperparameters;
[0069] After a lot of tests, the Adam algorithm is more suitable for convolutional neural network distribution network fault diagnosis. The Adam algorithm can be expressed in mathematical formula as follows:
[0070] μ dα =α1μ dα +(1-γ1)dα
[0071] Y dα =γ2Y dα +(1-γ2)(dα) 2
[0072]
[0073]
[0074]
[0075] In the formula, the deviation of the exponential weighted average is corrected by the first two formulas. The hyperparameters of the Adam algorithm are represented by μ, γ1, and γ2. γ1 is generally taken as 0.9, and γ2 is generally taken as 0.999.
[0076] After a lot of tests, the Adam algorithm is more suitable for convolutional neural network distribution network fault diagnosis, and the objective function used is the cross entropy loss function.
[0077] Set the training sample set to α = {(α1, β1), (α2, β2), ..., (α n ,β n )},β∈{0,1}, then the mathematical expression of the cross entropy loss function is:
[0078]
[0079] In the formula, the probability that a sample is a positive class is represented by β∈[0,1], and p t It can be expressed as:
[0080]
[0081] You can get:
[0082] CE(p,β)=CE(p t )=-log(p t )
[0083] If N is used to represent the batch size during training, then the loss during one iteration can be expressed as:
[0084]
[0085] In the formula, the probability that the i-th sample belongs to the positive class is given by express.
[0086] Construct the Softmax layer:
[0087] Taking the output of the i-th node as an example, the mathematical definition of the Softmax function is:
[0088]
[0089] In the formula, z i is the output value of the ith node, and C is the number of output nodes, that is, the number of categories. The Softmax function can be used to convert the output values of multiple categories into a probability distribution in the range of [0,1].
[0090] Finally, the basic diagnostic network is obtained by combining the input, convolutional layer, pooling layer, fully connected layer, activation function, neural network hyperparameters, and softmax layer.
[0091] Step S20, adding a residual structure module, a batch normalization layer, a ShuffleNet module, and an attention module to the basic diagnostic network to obtain a diagnostic network to be trained;
[0092] In this embodiment, in order to solve the network degradation and gradient vanishing problems caused by the excessive depth of the convolutional neural network, a residual structure module is added to the basic diagnosis network. This embodiment can adopt a residual structure implemented by "jump link", as shown in the attached figure. Figure 3 shown.
[0093] Furthermore, in one embodiment, the residual structure module is simplified based on the number of convolutional layers.
[0094] In this embodiment, considering that only four convolutional layers are needed for distribution network fault diagnosis, the structure of the classical residual structure unit can also be simplified, as shown in the attached figure. Figure 4 As shown, a convolutional layer is used for simple feature extraction and then a “skip connection” is used to construct an identity mapping.
[0095] Reference Figure 5 , Figure 5 Schematic diagram of adding a residual structure module to the basic diagnostic network.
[0096] In this embodiment, a batch normalization layer is further added to the basic diagnosis network.
[0097] Furthermore, in one embodiment, the batch normalization layer is used to normalize the input value distribution of any neuron into a standard normal distribution.
[0098] In this embodiment, adding a BatchNormalization layer is to normalize the input value distribution of any neuron into a standard normal distribution. In each layer of the neural network model, the mean value is 0 and the variance is 1.
[0099] In order to reduce the amount of calculation, the ShuffleNet module is added to the basic diagnosis network.
[0100] Furthermore, in one embodiment, the ShuffleNet module is ShuffleNet_V2, which splits the input features into two branches in the channel dimension, one of which remains unchanged and performs the same mapping, while the other branch performs three consecutive convolutions with the same output and input channels.
[0101] In this embodiment, ShuffleNet_V2 is used. ShuffleNet_V2 divides the input features into two branches in the channel dimension. The number of channels of these two branches is cc′ and c′ respectively, where c′=c / 2. One branch remains unchanged and performs the same mapping, while the other branch performs three consecutive convolutions with the same output and input channels;
[0102] The ShuffleNet module can significantly reduce the amount of calculation by reducing the number of parameters in the network model. After testing, the amount of calculation was reduced to 36.104% of the original after the introduction of the ShuffleNet module, while the accuracy was only reduced by 0.00073%. Figure 6 , Figure 6 Schematic diagram of adding the ShuffleNet module to the basic diagnostic network.
[0103] In order to further improve the diagnostic accuracy, an attention module is added to the basic diagnostic network.
[0104] Furthermore, in one embodiment, the attention module includes a channel attention module, which first performs a maximum pooling operation to obtain a pooling result M c , and perform average pooling on each channel to obtain the pooling result A c , assuming that the number of channels of the input feature is represented by c, M c and A c Input the fully connected layer respectively and output M c ' and A c ', after summing, input the sigmoid function for normalization, and the output of the sigmoid function is the channel attention. Figure 7 , Figure 7 Schematic diagram of the processing flow of the channel attention module.
[0105] Furthermore, in one embodiment, the attention module further includes a spatial attention module, which first performs a maximum pooling operation on each channel to obtain a pooling result M s , and perform average pooling on each channel to obtain the pooling result A s , the length of the input feature is represented by s, and the concatenated pooling result [M s ,A s ], yes [M s ,A s ] performs a convolution operation with a convolution kernel size of [1,7,2] and a convolution kernel number of 1. The convolution result is input into the sigmoid function for normalization. The output of the sigmoid function is the spatial attention. Figure 8 , Figure 8 Schematic diagram of the processing flow of the spatial attention module.
[0106] Assume that the input of the network is X N =[x1,x2,…,x N ] indicates that the original network is composed of f H (·) indicates that the added feed-forward network is composed of f A(·) indicates that the output of the original network model and the feedforward network added by the attention mechanism can be expressed as:
[0107] H N =(h1,h2,…,h N )=f N (X N )
[0108] A N =(a1,a2,…,a N )=f A (X N ,Q)
[0109] Where the other input calculation of the attention mechanism is represented by Q. N and A N The combination is the final output of the attention module, which is usually combined with H using a weighted sum N and A N , then the final output Y of the attention module can be expressed as:
[0110]
[0111] The attention module (CBAM) allows the input features to pass through the channel attention module first, and then through the spatial attention module. The optimized convolutional neural network obtained by introducing the attention module can obtain the convolutional neural network constructed in this embodiment, which uses simplified residual connection technology, uses Focal Loss as the objective function for supervised training, adds a BatchNormalization layer to the network for optimization, and reduces parameters based on the ShuffleNet network and improves accuracy based on the attention mechanism (i.e., the diagnostic network to be trained). After testing, the diagnostic accuracy can be increased to more than 99% after the introduction of the ShuffleNet module. Refer to Fig. 9 , Fig. 9 Schematic diagram of the processing flow of the attention module.
[0112] Reference Fig.10 , Fig.10 Schematic diagram of adding ShuffleNet module and attention module to the basic diagnostic network.
[0113] Step S30, preprocessing the fault current information collected by the fault recorder to obtain a sample data set;
[0114] In this embodiment, the fault current information collected by the fault recorder is preprocessed to obtain a sample data set for use in a subsequent training process.
[0115] Furthermore, in one embodiment, step S30 includes:
[0116] The fault current information collected by the fault recorder is imported into the MATLAB software, and the sample data set is obtained using the max function and for loop, where the fault current information is expressed as follows:
[0117] x=[Time I a I b I c FT FR FIA LV FL]
[0118] Among them, I a Indicates the A phase current, I b Indicates the B phase current, I c represents the C phase current, FT represents the fault type, FR represents the fault resistance, FIA represents the fault initial phase angle, LV represents the load size, and FL represents the fault location;
[0119] The sample dataset is represented as follows:
[0120]
[0121] Wherein, 1 to n are the labels of the fault current information 1 to n.
[0122] Step S40, training the diagnosis network to be trained by using the sample data set to obtain a distribution network fault diagnosis network. During the training process, Focal Loss is used as the objective function for supervised training;
[0123] In this embodiment, the sample data set can be divided into a training set, a validation set and a test set in proportion, so as to train the diagnosis network to be trained to obtain a distribution network fault diagnosis network, and during the training process, Focal Loss is used as the objective function for supervised training.
[0124] The mathematical expression of Focal Loss is as follows:
[0125]
[0126] FL=-x t (1-p t ) y log(p t )
[0127] In the formula, the hyperparameters are represented by x and y, and the predicted probability of the sample is represented by p t The modulation factor is represented by (1-p t ) y When y≥1, the more accurate the prediction of a sample is, the higher its p t The closer it is to 1, the higher the modulation factor (1-p t ) yThe smaller it is, the less accurate the prediction of a sample is, and its p t The closer it is to 0, the higher the modulation factor (1-p t ) y The bigger it is.
[0128] Step S50: performing distribution network fault diagnosis based on the distribution network fault diagnosis network.
[0129] In this embodiment, it should be noted that, when performing fault diagnosis, the data input into the distribution network fault diagnosis network is the fault current information collected by the fault recorder.
[0130] In this embodiment, a basic diagnosis network is constructed, and the basic diagnosis network includes a convolution layer, a pooling layer, a fully connected layer, an activation function, a neural network hyperparameter, and a softmax layer; a residual structure module, a batch normalization layer, a ShuffleNet module, and an attention module are added to the basic diagnosis network to obtain a diagnosis network to be trained; the fault current information collected by the fault recorder is preprocessed to obtain a sample data set; the diagnosis network to be trained is trained by the sample data set to obtain a distribution network fault diagnosis network, and during the training process, Focal Loss is used as an objective function for supervised training; and distribution network fault diagnosis is performed based on the distribution network fault diagnosis network. Through this embodiment, the original grid current data (i.e., the fault current information collected by the fault recorder) is used as input to output the fault diagnosis result, and no manual participation is required. It has the characteristics of high detection accuracy and good data set portability, and uses a simplified residual connection technology, uses Focal Loss as an objective function for supervised training, adds a batch normalization layer to the network for optimization, and reduces parameters based on the ShuffleNet network and improves accuracy based on the attention mechanism. The process can automatically determine the appropriate CNN architecture for fault diagnosis problems. The CNN used in this embodiment directly uses the current information sampled by the fault recorder of each node in the distribution network as input. There is no need to use digital signal processing methods to extract frequency domain features and manually select features. It combines the respective advantages of the ShuffleNet module and the attention module to effectively improve the diagnosis accuracy.
[0131] Furthermore, in one embodiment, an IEEE34 distribution network simulation model built in PSCAD is used for experiments. The performance comparison with other existing methods is listed in detail. In order to restore the operation of the actual distribution network as much as possible and make the samples used for network training rich enough, it is necessary to consider all possible fault factors and simulate fault recorders near each node.
[0132] The distribution network system operates at 24.9 kV and 50 Hz, with a sampling frequency of 2000 Hz. The Multiple Run component in PSCAD is used to generate training data on transmission lines 808-812, 816-824, 834-842, and 846-848 under different fault types, fault resistances, initial phase angles, load sizes, and fault locations. The detailed configurations are listed in Table 1.
[0133]
[0134] Table 1 Simulation data set configuration for distribution network fault diagnosis
[0135] A total of 27648 three-phase current original simulation data sets containing fault characteristic parameter labels of 4 fault lines were generated and simulated. The original simulation data sets were imported into MATLAB and the max function and for loop were used to obtain the maximum values of all three-phase currents and the fault characteristic parameter label matrix, which were arranged as a one-dimensional vector as shown below as the input of the neural network.
[0136]
[0137] In order to perform cross-validation and prevent overfitting problems, all simulation data are divided into training set, validation set and test set in a ratio of 6:2:2. The training set is used to train the parameters of the convolutional neural network and adjust the network structure, and the validation set is used to avoid overfitting problems during training and network adaptive adjustment. The test set is used to evaluate the performance of the network structure. The original fault current data set is shown in Table 2, and the preprocessed current data set is shown in Table 3.
[0138]
[0139] Table 2 Original fault current data set
[0140]
[0141] Table 3. Preprocessed fault current data set
[0142] The Grid Search method is used to debug the network hyperparameters, and the hyperparameters suitable for the convolutional neural network after the introduction of the ShuffleNet module and the convolutional attention module are shown in Table 4.
[0143]
[0144] Table 4. Distribution network fault diagnosis parameters with the introduction of attention mechanism and ShuffleNet module
[0145] The artificial neural network (ANN), unoptimized convolutional neural network (CNN), optimized convolutional neural network (opt-CNN), optimized neural network with Shufflent module (opt-ShuCNN), and optimized distribution network fault diagnosis convolutional neural network with ShuffleNet module and attention module (opt-attention-ShuCNN) are used for distribution network fault diagnosis. The results obtained on the test set are comprehensively compared. The accuracy of the five models is shown in Table 5. The average accuracy is shown in
[0146] The average recall is shown in Table 7, and the average F1 value is shown in Table 8.
[0147]
[0148] Table 5 Accuracy of all models
[0149]
[0150] Table 6 Average accuracy of all models
[0151]
[0152] Table 7 Average recall of all models
[0153]
[0154] Table 8 Average F1 of ANN, CNN and opt-CNN models
[0155] Note: The average precision, average recall, and average F1 value are all obtained on the test set.
[0156] It can be seen that when using various network models to diagnose faults in the distribution network, the accuracy of the artificial neural network is the lowest, only 93.926%. After switching to the convolutional neural network, the accuracy has been greatly improved. After a series of optimizations of the convolutional neural network, the accuracy has been significantly improved, but the number of network parameters has also increased significantly, and the complexity of the calculation has increased. Subsequently, the ShuffleNet module was introduced to greatly reduce the number of parameters and the amount of calculation, but the calculation accuracy has slightly decreased. Finally, the convolutional attention module was introduced into the network, and the resulting network model had the most advantages. The amount of calculation was only slightly more complicated than before the convolutional attention module was added, but the calculation accuracy was greatly improved, with a diagnostic accuracy of up to 99.132%. It took into account both the amount of calculation and the diagnostic accuracy, and performed best among the five network models.
[0157] The second convolutional attention module classifies the channel attention obtained according to the operating status of the distribution network, and visualizes the channel attention mean of each distribution network operating status. It can be found that the channel attention in the network model can reflect the importance of each channel to a certain extent. The operating status of the distribution network can be expressed by the importance of each channel in the network model, which shows that the current characteristics of the distribution network are strongly correlated with the operating status. It is feasible to use convolutional neural networks for distribution network fault diagnosis, and its principle is explainable.
[0158] Furthermore, the evaluation index of the prediction result in this embodiment is:
[0159] 1) Confusion Matrix
[0160] By comparing the predicted results and true labels of the samples, and classifying each sample in the classification problem, we can get the number of correctly classified samples and the number of incorrectly classified samples. Arranging the number of correctly classified and incorrectly classified samples can further obtain the confusion matrix of the classification results, as shown in Table 9:
[0161]
[0162] Table 9 Confusion matrix for classification results
[0163] Among them, TP means that the sample is classified correctly and belongs to the original label category; TN means that the sample is classified correctly but does not belong to the original label category; FN means that the sample is classified incorrectly but belongs to the original label category; FP means that the sample is classified incorrectly and does not belong to the original label category.
[0164] 2) Precision
[0165] Precision refers to the ratio of the number of samples correctly judged by the classifier as a certain fault category to the total number of samples judged by the classifier as this fault category. It can reflect the accuracy of the classification of the constructed model. The calculation formula is as follows:
[0166]
[0167] 3) Recall
[0168] Recall rate refers to the ratio of the number of samples correctly judged by the classifier as a certain fault category to the total number of texts belonging to this category. The calculation formula is as follows:
[0169]
[0170] 4) F1 value
[0171] The F1 value is a performance indicator after the balance between comprehensive precision and recall rate. The calculation formula is as follows:
[0172]
[0173] Each of these three performance indicators has its own micro, macro, and weight indicators. Micro is used to statistically analyze each example in the data set regardless of category to establish a global confusion matrix, and then calculate the corresponding indicators. Macro is used to count whether the classification of the overall data is correct or not, and calculate the corresponding evaluation indicators. Weight is used to count the proportion of the number of samples in each category to the total number of samples in all categories as a weight, and calculate the corresponding evaluation indicators.
[0174] In a third aspect, an embodiment of the present invention further provides a distribution network fault diagnosis device.
[0175] In one embodiment, referring to Fig.11 , Fig.11 FIG. 1 is a functional module diagram of an embodiment of a distribution network fault diagnosis device according to the present invention. Fig.11 As shown, the distribution network fault diagnosis device includes:
[0176] Building module 10, used to build a basic diagnosis network, the basic diagnosis network includes a convolution layer, a pooling layer, a fully connected layer, an activation function, a neural network hyperparameter and a softmax layer;
[0177] An optimization module 20 is used to add a residual structure module, a batch normalization layer, a ShuffleNet module, and an attention module to the basic diagnosis network to obtain a diagnosis network to be trained;
[0178] A data set building module 30 is used to pre-process the fault current information collected by the fault recorder to obtain a sample data set;
[0179] A training module 40 is used to train the diagnosis network to be trained using a sample data set to obtain a distribution network fault diagnosis network. During the training process, Focal Loss is used as an objective function for supervised training.
[0180] The diagnosis module 50 is used to perform distribution network fault diagnosis based on the distribution network fault diagnosis network.
[0181] Furthermore, in one embodiment, the data set construction module 30 is used to:
[0182] The fault current information collected by the fault recorder is imported into the MATLAB software, and the sample data set is obtained using the max function and for loop, where the fault current information is expressed as follows:
[0183] x=[Time I a I b I c FT FR FIA LV FL]
[0184] Among them, I a Indicates the A phase current, I b Indicates the B phase current, I c represents the C phase current, FT represents the fault type, FR represents the fault resistance, FIA represents the fault initial phase angle, LV represents the load size, and FL represents the fault location;
[0185] The sample dataset is represented as follows:
[0186]
[0187] Wherein, 1 to n are the labels of the fault current information 1 to n.
[0188] Furthermore, in one embodiment, the residual structure module is simplified based on the number of convolutional layers.
[0189] Furthermore, in one embodiment, the batch normalization layer is used to normalize the input value distribution of any neuron into a standard normal distribution.
[0190] Furthermore, in one embodiment, the ShuffleNet module is ShuffleNet_V2, which splits the input features into two branches in the channel dimension, one of which remains unchanged and performs the same mapping, while the other branch performs three consecutive convolutions with the same output and input channels.
[0191] Furthermore, in one embodiment, the attention module includes a channel attention module, which first performs a maximum pooling operation to obtain a pooling result M c , and perform average pooling on each channel to obtain the pooling result A c , assuming that the number of channels of the input feature is given by c Indicates that Mc and Ac are input into the fully connected layer respectively, and the output is M c ' and A c ', after summing, it is input into the sigmoid function for normalization, and the output of the sigmoid function is the channel attention.
[0192] Furthermore, in one embodiment, the attention module further includes a spatial attention module, which first performs a maximum pooling operation on each channel to obtain a pooling result M s , and perform average pooling on each channel to obtain the pooling result A s, the length of the input feature is represented by s, and the concatenated pooling result [M s ,A s ], yes [M s ,A s ] performs a convolution operation with a convolution kernel size of [1,7,2] and a convolution kernel number of 1. The convolution result is input into the sigmoid function for normalization. The output result of the sigmoid function is the spatial attention.
[0193] Among them, the functional implementation of each module in the above-mentioned distribution network fault diagnosis device corresponds to the various steps in the above-mentioned distribution network fault diagnosis method embodiment, and its functions and implementation processes will not be repeated here one by one.
[0194] In a fourth aspect, an embodiment of the present invention further provides a readable storage medium.
[0195] The readable storage medium of the present invention stores a distribution network fault diagnosis program, wherein when the distribution network fault diagnosis program is executed by a processor, the steps of the distribution network fault diagnosis method as described above are implemented.
[0196] Among them, the method implemented when the distribution network fault diagnosis program is executed can refer to the various embodiments of the distribution network fault diagnosis method of the present invention, and will not be repeated here.
[0197] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0198] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0199] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present invention.
[0200] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A distribution network fault diagnosis method, characterized in that: The distribution network fault diagnosis method comprises: Construct a basic diagnostic network, which includes convolutional layers, pooling layers, fully connected layers, activation functions, neural network hyperparameters, and softmax layers; A residual structure module, a batch normalization layer, a ShuffleNet module and an attention module are added to the basic diagnostic network to obtain a diagnostic network to be trained, wherein the ShuffleNet module and the attention module are located between the input and connection layers of the basic diagnostic network; the ShuffleNet module is ShuffleNet_V2, which divides the input features into two branches in the channel dimension, one of which remains unchanged and performs the same mapping, while the other branch performs three consecutive convolutions with the same output and input channels; the attention module includes a channel attention module, which first performs a maximum pooling operation to obtain a pooling result , and perform average pooling on each channel to obtain the pooling result , assuming that the number of channels of the input feature is given by Indicates that and Input the fully connected layer and output and , after summing, the sigmoid function is input for normalization, and the output result of the sigmoid function is the channel attention; the attention module also includes a spatial attention module, which first performs a maximum pooling operation on each channel to obtain a pooling result M s , and perform average pooling on each channel to obtain the pooling result A s , the length of the input feature is given by Indicates that the splicing pooling result ,right The convolution kernel size is , a convolution operation with 1 convolution kernel is performed, and the convolution result is input into the sigmoid function for normalization. The output of the sigmoid function is the spatial attention. Preprocessing the fault current information collected by the fault recorder to obtain a sample data set; The sample data set is used to train the diagnosis network to obtain the distribution network fault diagnosis network. During the training process, Focal Loss is used as the objective function for supervised training. Distribution network fault diagnosis is performed based on the distribution network fault diagnosis network.
2. The distribution network fault diagnosis method according to claim 1, characterized in that: The step of preprocessing the fault current information collected by the fault recorder to obtain a sample data set includes: The fault current information collected by the fault recorder is imported into the MATLAB software, and the sample data set is obtained using the max function and for loop, where the fault current information is expressed as follows: in, Indicates the A phase current, represents the B phase current, represents the C phase current, FT represents the fault type, FR represents the fault resistance, FIA represents the fault initial phase angle, LV represents the load size, and FL represents the fault location; The sample dataset is represented as follows: Wherein, 1 to n are the labels of the fault current information 1 to n.
3. The distribution network fault diagnosis method according to claim 1, characterized in that: The residual structure module is simplified based on the number of convolutional layers.
4. The method for diagnosing a fault in a power distribution network according to claim 1, wherein: The batch normalization layer is used to normalize the input value distribution of any neuron into a standard normal distribution.
5. A distribution network fault diagnosis device, characterized in that: The distribution network fault diagnosis device comprises: The construction module is used to build a basic diagnostic network, which includes convolutional layers, pooling layers, fully connected layers, activation functions, neural network hyperparameters, and softmax layers; An optimization module is used to add a residual structure module, a batch normalization layer, a ShuffleNet module and an attention module to the basic diagnostic network to obtain a diagnostic network to be trained, wherein the ShuffleNet module and the attention module are located between the input and connection layers of the basic diagnostic network; the ShuffleNet module is ShuffleNet_V2, which divides the input features into two branches in the channel dimension, one of which remains unchanged and performs the same mapping, while the other branch performs three consecutive convolutions with the same output and input channels; the attention module includes a channel attention module, which first performs a maximum pooling operation to obtain a pooling result , and perform average pooling on each channel to obtain the pooling result , assuming that the number of channels of the input feature is given by Indicates that and Input the fully connected layer and output and , after summing, the sigmoid function is input for normalization, and the output result of the sigmoid function is the channel attention; the attention module also includes a spatial attention module, which first performs a maximum pooling operation on each channel to obtain a pooling result M s , and perform average pooling on each channel to obtain the pooling result A s , the length of the input feature is given by Indicates that the splicing pooling result ,right The convolution kernel size is , a convolution operation with 1 convolution kernel is performed, and the convolution result is input into the sigmoid function for normalization. The output of the sigmoid function is the spatial attention. A data set construction module is used to pre-process the fault current information collected by the fault recorder to obtain a sample data set; A training module is used to train the diagnosis network to be trained using a sample data set to obtain a distribution network fault diagnosis network. During the training process, Focal Loss is used as an objective function for supervised training. A diagnosis module is used to perform distribution network fault diagnosis based on the distribution network fault diagnosis network.
6. A distribution network fault diagnosis device, characterized in that: The distribution network fault diagnosis device includes a processor, a memory, and a distribution network fault diagnosis program stored in the memory and executable by the processor, wherein when the distribution network fault diagnosis program is executed by the processor, the steps of the distribution network fault diagnosis method as described in any one of claims 1 to 4 are implemented.
7. A readable storage medium, characterized in that: The readable storage medium stores a distribution network fault diagnosis program, wherein when the distribution network fault diagnosis program is executed by a processor, the steps of the distribution network fault diagnosis method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Image classification method, system and device based on convolutional neural network, and medium
CN112906808A
Convolutional neural network micro-seismic monitoring waveform recognition method based on whole-process visualization
CN113297929A