Power distribution network fault detection method and system based on fault identification feature optimization

By improving the sparse autoencoder and particle swarm optimization algorithm, the problems of low efficiency and high false positive rate in power distribution network fault detection are solved, achieving higher accuracy in fault identification and improved power supply reliability.

CN122238765APending Publication Date: 2026-06-19SHANDONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANDONG UNIV
Filing Date
2026-01-26
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing fault detection methods for power distribution networks are inefficient, have a high false alarm rate, and are difficult to accurately identify single-phase grounding faults. Furthermore, the complex network structure increases the difficulty of fault location, leading to a decrease in power supply reliability.

Method used

An improved sparse autoencoder is used for feature optimization. By constructing a loss function that includes reconstruction error, sparsity penalty term, intra-class divergence correction term, and inter-class divergence correction term, and combining it with particle swarm optimization algorithm to optimize hyperparameters, the accuracy of feature extraction and classification is improved.

Benefits of technology

It improves the accuracy and efficiency of fault detection in power distribution networks, reduces the false alarm rate, and enhances power supply reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122238765A_ABST
    Figure CN122238765A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for distribution network fault detection based on fault identification feature optimization. The method includes: constructing a dataset; the dataset includes: distribution network phase current waveform data with known fault detection results; training a sparse autoencoder using the dataset to obtain a trained sparse autoencoder; during training, the loss function of the sparse autoencoder includes: reconstruction error, sparsity penalty term, intra-class divergence correction term, and inter-class divergence correction term; acquiring the distribution network phase current waveform data to be detected, extracting features from the phase current waveform data to obtain original data features; inputting the original data features into the trained sparse autoencoder to obtain optimized data features; and inputting the optimized data features into a trained classifier to obtain the detection result of whether a distribution network fault exists. This invention can improve fault detection accuracy through feature optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distribution network fault detection technology, and in particular to a distribution network fault detection method and system based on fault identification feature optimization. Background Technology

[0002] The power distribution network is complex, covers a wide area, and is exposed to variable environments, leading to frequent faults that can cause power outages and affect the user experience. Traditional fault detection methods rely on manual inspections, which are inefficient and prone to missed faults. For example, in low-current grounding systems, fault signals are weak, and conventional electrical monitoring methods struggle to accurately identify single-phase grounding faults, resulting in a high false alarm rate. Furthermore, the complex network structure further complicates fault location, requiring manual inspections to be conducted section by section, delaying repairs and reducing power supply reliability.

[0003] Existing methods for fault detection in distribution networks mainly rely on threshold-based judgment to identify faults, but these methods have poor reliability. While some existing technologies apply deep learning to distribution network fault identification, they lack feature optimization of the mined features, resulting in low fault detection accuracy. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a method and system for fault detection in power distribution networks based on fault identification feature optimization. This invention can improve fault detection accuracy through feature optimization.

[0005] On the one hand, a distribution network fault detection method based on fault identification feature optimization is provided, including: Construct a dataset; the dataset includes: distribution network phase current waveform data with known fault detection results; use the dataset to train an improved sparse autoencoder to obtain a trained improved sparse autoencoder; during the training process, the loss function of the improved sparse autoencoder includes: reconstruction error, sparsity penalty term, intra-class divergence correction term, and inter-class divergence correction term; Acquire the phase current waveform data of the distribution network to be detected, extract features from the phase current waveform data of the distribution network to be detected, and obtain the original data features; The original data features are input into the trained improved sparse autoencoder to obtain optimized data features; The optimized data features are input into the trained classifier to obtain the detection results of whether there is a fault in the distribution network.

[0006] On the other hand, a distribution network fault detection system based on fault identification features optimization is provided; A distribution network fault detection system based on fault identification feature optimization includes: The construction module is configured to: construct a dataset; the dataset includes: distribution network phase current waveform data with known fault detection results; train the improved sparse autoencoder using the dataset to obtain the trained improved sparse autoencoder; during the training process, the loss function of the improved sparse autoencoder includes: reconstruction error, sparsity penalty term, intra-class divergence correction term and inter-class divergence correction term; The acquisition module is configured to: acquire the phase current waveform data of the distribution network to be detected, extract features from the phase current waveform data of the distribution network to be detected, and obtain the original data features; The optimization module is configured to input the original data features into the trained improved sparse autoencoder to obtain optimized data features. The classification module is configured to input optimized data features into the trained classifier to obtain the detection results of whether there is a fault in the distribution network.

[0007] Furthermore, an electronic device is also provided, including: Memory, used for non-transitory storage of computer-readable instructions; and Processor, for executing the computer-readable instructions, When the computer-readable instructions are executed by the processor, they perform the method described in the first aspect above.

[0008] In another aspect, a storage medium is also provided for non-transitory storage of computer-readable instructions, wherein when the non-transitory computer-readable instructions are executed by a computer, the method described in the first aspect is performed.

[0009] In another aspect, a computer program product is also provided, including a computer program that, when run on one or more processors, is used to implement the method described in the first aspect above.

[0010] The above technical solution has the following advantages or beneficial effects: To address the difficulty of current widely used feature optimization methods in simultaneously achieving feature mining, feature simplification, and class-specific targeting, this disclosure proposes a feature optimization method based on an improved sparse autoencoder. First, the sparse autoencoder is modified based on intra-class and inter-class divergence, constructing an improved sparse autoencoder loss function encompassing reconstruction error, sparsity penalty, intra-class divergence correction, and inter-class divergence correction. Second, the iterative gradients of the improved sparse autoencoder weights and biases are calculated based on the backpropagation principle to complete the training of the improved sparse autoencoder. Finally, the particle swarm optimization algorithm is used to optimize the three hyperparameters of the improved sparse autoencoder, and the feature optimization effect is verified based on a high-resistivity fault detection scenario in a power distribution network. This invention can improve the accuracy of power distribution network fault detection by classifying the optimized features. Attached Figure Description

[0011] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0012] Figure 1 This is the improved sparse autoencoder architecture in Embodiment 1 of this disclosure; Figure 2 This is the optimal individual fitness curve of the particle swarm optimization algorithm in Embodiment 1 of this disclosure; Figure 3 This is a flowchart of the improved sparse autoencoder feature optimization process in Embodiment 1 of this disclosure; Figure 4 These are the curves showing the changes of the four losses of the improved sparse autoencoder in Embodiment 1 of this disclosure as a function of the iteration process; Figure 5 This is the loss ratio curve of inter-class divergence to intra-class divergence of the improved sparse autoencoder in Embodiment 1 of this disclosure. Detailed Implementation

[0013] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0014] In the fields of pattern recognition and machine learning, feature extraction serves as a crucial bridge connecting raw data with classification and identification tasks. Its core objective is to extract highly discriminative low-dimensional representations from high-dimensional, redundant raw data. Based on their implementation concepts and technological development, existing methods can be broadly categorized into linear feature extraction and nonlinear feature extraction, both based on traditional designs.

[0015] Principal Component Analysis (PCA), a classic linear dimensionality reduction technique, maps the original features to a set of orthogonal directions with the largest variance through orthogonal transformation. It effectively removes linear correlations between features while retaining the most significant variation information in the data, offering significant advantages in data compression, denoising, and visualization. However, as an unsupervised method, PCA's variance maximization criterion may not be directly related to class discrimination, and its ability to handle nonlinear data structures is limited.

[0016] In contrast, Linear Discriminant Analysis (LDA) is a supervised method that aims to find the projection direction that maximizes inter-class distance and minimizes intra-class distance. It exhibits good performance in classification tasks, especially when the feature dimension is high. However, LDA makes fundamental assumptions about the data distribution, and the number of extractable features is limited when the number of classes is large.

[0017] To handle nonlinear structures, autoencoders (AEs) compress input data into low-dimensional codes through an encoder and then reconstruct the data through a decoder. The bottleneck layer representation learned in this process can be used as effective features, and relevant features can be extracted through the nonlinear links in its encoding and decoding processes.

[0018] Of the three methods mentioned above, PCA, LDA, and AE, PCA and AE lack class label orientation in feature reconstruction, making it difficult to remove redundant features with high variance distribution and no class difference; PCA and LDA can only reconstruct linearly, making it difficult to mine deep fault features. The above three methods are difficult to achieve a balance between feature mining, feature simplification, and class discrimination orientation.

[0019] Example 1 This embodiment provides a distribution network fault detection method based on fault identification feature optimization; The distribution network fault detection method based on fault identification feature optimization includes: S101: Construct a dataset; the dataset includes: distribution network phase current waveform data with known fault detection results; the dataset is used to train the improved sparse autoencoder to obtain the trained improved sparse autoencoder; during the training process, the loss function of the improved sparse autoencoder includes: reconstruction error, sparsity penalty term, intra-class divergence correction term and inter-class divergence correction term; S102: Obtain the phase current waveform data of the distribution network to be detected, extract features from the phase current waveform data of the distribution network to be detected, and obtain the original data features; S103: Input the original data features into the trained improved sparse autoencoder to obtain optimized data features; S104: Input the optimized data features into the trained classifier to obtain the detection results of whether there is a fault in the distribution network.

[0020] It should be understood that the improved sparse autoencoder is an improvement on the loss function of the sparse autoencoder, while the network structure of the sparse autoencoder still adopts the original network structure of the sparse autoencoders.

[0021] To introduce improved sparse autoencoders, we first introduce principal component analysis (PCA), linear discriminant analysis (LDA), autoencoders (AE), and sparse autoencoders (SAE).

[0022] Principal Components Analysis (PCA) is an unsupervised feature dimensionality reduction method, suitable for decentralized samples. X ={ x 1, x 2, …,x n Its sample covariance matrix can be expressed as: (1) Through vectors w For the sample X Projection is performed, and the variance of the projected feature distribution is used to measure the amount of information. To retain the maximum amount of information, an objective function can be set: (2) Due to the linear transformation vector With a modulus of 1, a Lagrange function can be introduced: (3) By taking the derivative and solving, we can obtain: (4) The maximum variance of the feature distribution after projection is The largest eigenvalue, and the corresponding projection direction is the eigenvalue. The corresponding eigenvectors, by orthogonally decomposing the covariance matrix, arrange the eigenvalues ​​in descending order, corresponding to the first... Row feature vectors for samples X Projection is performed to reduce the original sample features to... dimension.

[0023] Compared to PCA, Linear Discriminant Analysis (LDA) essentially modifies the objective function in equation (2) to: (5) in, The inter-class scatter matrix, Let be the intra-class scatter matrix. This function aims to maximize the ratio of inter-class scatter to intra-class scatter after projection, and can select the projection direction with the best classification performance. Following the same solution approach, equation (6) can be obtained from equation (4). The subsequent content is consistent with PCA and will not be discussed further here.

[0024] (6) An autoencoder (AE) is a multilayer perceptron that implements self-mapping. The process from the input layer to the hidden layer can be viewed as an encoding process, with the output of the hidden layer nodes representing the encoding of the input. The objective function for training an autoencoder can be set as the minimum sum of squared errors between the output and the input. (7) in, For loss function, Indicates the reconstruction error. For the input feature vector, This is used to predict the output of the autoencoder. By reasonably setting the hidden layer nodes, the autoencoder is trained through an objective function. The hidden layer nodes then form a new representation of the input data. In tasks such as fault detection, this can realize the mining of deep fault features and the dimensionality reduction optimization of high-dimensional data, forming a more effective representation than the original features.

[0025] An autoencoder without nonlinear components, using mean squared error as the loss function, and with fewer hidden layer neurons than the input dimension, ideally has the same training objective as PCA, both aiming to minimize reconstruction error and effectively achieve feature optimization and dimensionality reduction. The two are highly similar.

[0026] The Sparse Autoencoder (SAE) builds upon the autoencoder by implementing sparsity constraints through L1 regularization. SAE modifies the autoencoder loss function by introducing a sparsity penalty term, as shown in equation (8): (8) in, Indicates the encoded output. This is the number of hidden layer encodings. This additional sparsity penalty term tends to reduce the outputs of unimportant neurons to 0 during training, resulting in sparse representations. This helps the model capture more critical features from the sample data and improves the model's generalization ability.

[0027] In summary, of the three methods mentioned above, PCA can effectively eliminate correlations between original features, but PCA measures information content based on the variance of the entire data feature distribution. For many invalid features with large overall distribution variance and insignificant class differences, which are useless for classification tasks, PCA cannot remove them, and AE has a similar problem. LDA, by introducing sample class labels and modifying the objective function, can effectively remove these invalid features. By introducing the idea of ​​minimizing intra-class divergence and maximizing inter-class divergence into SAE, a unified approach to feature mining, feature simplification, and class discrimination can be achieved on the basis of SAE nonlinear feature mining.

[0028] Therefore, an improved sparse autoencoder (ISAE) is proposed, whose loss function introduces intra-class and inter-class divergence of samples to filter directional features based on SAE.

[0029] The objective function of LDA (5) can be equivalently expressed as: (9) in, Indicates the within-class divergence. Represents the inter-class divergence. , All are positive coefficients. As an improvement to the intra-class divergence correction of ISAE encoding output, this method is used to address the issue of sparse autoencoder output. As an improvement to correct the inter-class divergence of the ISAE encoded output, combining equations (7), (8), and (9), the following improved ISAE loss function is proposed: (10) parameter , , The effects of various hyperparameter adjustments on the loss function.

[0030] Furthermore, the loss function of the improved sparse autoencoder includes:

[0031] in, To improve the loss function of sparse autoencoders, For reconstruction error, For sparse penalty terms, This is the intra-class divergence correction term. For the inter-class divergence correction term, the parameter , , The effects of various hyperparameter adjustments on the loss function.

[0032] Furthermore, the reconstruction error refers to:

[0033] in, Indicates the reconstruction error. For the input feature vector, To improve the prediction output of the sparse autoencoder, This represents the total number of input feature vectors.

[0034] Furthermore, the sparsity penalty term refers to:

[0035] in, Indicates a sparse penalty term. Indicates the encoded output. This represents the number of hidden layer codes.

[0036] Furthermore, the intra-class divergence correction term refers to: For a given set of M class labels and L original feature samples, ISAE encoded output has a total of nEach node, after a single training iteration, for category( ) One sample ( ,in ), its coding layer nodes ( The output of (=1,2,…,n) is denoted as ,but Category in node k The encoded output intra-class scatter is:

[0037] in, express Category in node The encoding outputs the intra-class divergence. Indicates belonging to a category All samples are at the node The average value of the encoded output. Indicates belonging to a category The total number of samples.

[0038] Then the intra-class divergence correction term as follows:

[0039] in, The total number of sample categories, This represents the number of nodes in the coding layer. Indicates belonging to a category The total number of samples.

[0040] Furthermore, the inter-class divergence correction term refers to: Node k encoding outputs inter-class divergence for:

[0041] in, This indicates that all samples of all categories are in the node. The average value of the encoded output. This represents the total number of samples across all categories.

[0042] Then the inter-class divergence correction term as follows:

[0043] Furthermore, the improved sparse autoencoder has the following network structure: Figure 1 As shown, it includes: The diagram consists of an input layer, an encoding layer, and a decoding layer, with the input layer connected to the encoding layer and the encoding layer connected to the decoding layer. In the diagram, L represents the total number of nodes in the input and output layers, consistent with the dimension of the sample features. Referring to a specific node, For the number of nodes in the coding layer, use Refers to a specific node. Represents the input layer node The feature values ​​are calculated using the following formula for the output of the coding layer nodes:

[0044] in, Represents coding layer node The output includes annotations for sample categories and serial numbers. Category 1 (samples) and These represent the input layer nodes respectively. To the coding layer node The encoding weights and biases, This represents the activation function; in this case, the sigmoid function is used.

[0045] The calculation formula for the output of the decoding layer node is as follows:

[0046] in, Represents the decoding layer node The predicted output, and These represent the decoding weights and biases between the corresponding nodes, respectively.

[0047] Furthermore, the training of the improved sparse autoencoder is based on the principle of error backpropagation.

[0048] Among them, those trained based on the principle of error backpropagation include: Based on the principle of backpropagation of errors, and taking into account the L1 regularization sparsity penalty term, intra-class divergence, and inter-class divergence correction, the error term of the decoder... for: (14) in, For loss function, This represents the activation function. Indicates the decoder output. Represents the input layer feature vector. This represents the decoder output before nonlinear activation.

[0049] The error terms output by the encoder are shown below: (15) in, For reconstruction error, For sparse penalty terms, For decoder weights, To optimize hyperparameters, Represents a node Encoded output.

[0050] The overall error term of the encoding output for intra-class and inter-class divergence corrections is 0, but for a single class sample, the inter-class divergence correction... Category Sample coding The partial derivatives are: (16) in, This indicates that all samples of all categories are in the node. The average value of the encoded output.

[0051] For a single sample of a single class, intra-class divergence correction To belong to category samples coding The partial derivatives are: (17) in, Indicates belonging to a category All samples are at the node The average value of the encoded output.

[0052] The gradient of the loss function according to the chain rule with respect to the encoder weights and biases is: (18) (19) in, This represents the encoder output before nonlinear activation. This is the error term of the decoder. and These represent the input layer nodes respectively. To the coding layer node The encoding weights and biases, Indicates the decoding weights. This represents the activation function. Represents a node The encoded output includes inter-class divergence correction and intra-class divergence correction, which are affected by sample labels during training and will belong to the class... Sample code is denoted as , belongs to category samples The encoding is denoted as ,category sample The encoder output before nonlinear activation is denoted as , Indicates belonging to a category All samples are at the node The average value of the encoded output. This indicates that all samples of all categories are in the node. The average value of the encoded output.

[0053] Therefore, the effectiveness of the obtained features can be significantly improved while reducing redundancy. Based on this, a feature optimization model is established, given the existence of the ISAE loss function. , , The three hyperparameters, the accumulated intra-class divergence and inter-class divergence, need to be tuned appropriately to play an effective role. Here, the particle swarm optimization algorithm is used for tuning to achieve the best results.

[0054] Furthermore, the improved sparse autoencoder is trained using a particle swarm optimization algorithm to optimize the hyperparameters of the loss function.

[0055] Furthermore, the training of the improved sparse autoencoder, employing a particle swarm optimization algorithm to optimize the hyperparameters of the loss function, includes: Using the particle swarm optimization algorithm to optimize hyperparameters , , After optimization, the particle swarm optimization algorithm process is as follows: (1) Initialize the particle swarm: randomly generate a set number of hyperparameters. , , Initial values ​​are set by treating the value of each parameter as the particle position and assigning each a random initial velocity. (2) Evaluate particle performance: Calculate the fitness of each particle at its current position, specifically by assigning hyperparameters to the particle positions. , , Feature optimization and identification are performed, and the identification accuracy is used as a fitness evaluation parameter to adjust particle positions. At the same time, the historical best position of each particle is tracked and stored. And the best position currently found by the entire particle swarm. .

[0056] (3) Iterative optimization: The motion speed and spatial coordinates of each particle are dynamically adjusted according to formulas (20) and (21). After each update, its fitness is re-evaluated and compared with the historical best fitness, thereby updating the records of individual best solutions and global best solutions.

[0057] (20) (twenty one) in, express Particle position after the next iteration express The speed of the next iteration, parameters , , These are used to measure the particle velocity of the previous iteration and the historical best position, respectively. and the current optimal position of the particle swarm The weight.

[0058] The fitness function depends on the recognition accuracy and needs to be combined with the recognition algorithm. When no recognition algorithm is specified, considering that the support vector machine is sensitive to feature quality, it can be combined with the support vector machine to support training and verify features.

[0059] Furthermore, the distribution network phase current waveform data with known fault detection results include five operating conditions: distribution network arc grounding fault, constant impedance grounding fault, load change, capacitor switching, and normal operation.

[0060] Further, S102: Acquire the phase current waveform data of the distribution network to be detected, and extract features from the phase current waveform data of the distribution network to be detected to obtain the original data features; the features include 12 time-domain features, specifically including mean, absolute mean, root mean square value, variance, standard deviation, range, skewness, kurtosis, peak factor, impulse factor, waveform factor, and number of zero crossings; 10 frequency-domain features, specifically including the frequency domain amplitude average, centroid frequency, mean square frequency, root mean square frequency, and frequency variance of the spectrum features, and the average frequency, median frequency, total power, average power, and peak frequency of the power spectrum features; 60 time-frequency domain features, which are obtained by decomposing the fault current in 50Hz bands from 0-3kHz using db4 wavelet transform, and the mean of the amplitude of each band is used to construct a 60-dimensional feature vector.

[0061] Further, S103: Input the original data features into the trained ISAE, such as... Figure 1 As shown, the original feature data is encoded through an input layer-encoding layer process, specifically by using the optimal encoding weights obtained during training. and bias The original features are mapped and then activated by a nonlinear activation function. Optimized data features are obtained after activation. h .

[0062] Further, S104: Input the optimized data features into the trained classifier to obtain the detection result of whether the distribution network is faulty or not. The trained classifier is implemented using a support vector machine.

[0063] The verification was conducted based on a high-resistance fault detection scenario in a distribution network, including the following steps: Step S01: Use Simulink to build a 10kV distribution system simulation model, and batch acquire 2500 sets of phase current waveform data for five operating conditions: arc grounding fault, constant impedance grounding fault, load change, capacitor switching, and normal operation. Use time-frequency domain transformation to process the transient waveform data of the first two cycles after the fault occurs, and extract 82-dimensional waveform data in a non-directional manner to build an original feature library, including 12 time-domain features, 10 frequency-domain features, and 60 time-frequency-domain features. Randomly select 60% of the samples from the five types of samples as the training set, 20% as the validation set, and 20% as the test set.

[0064] Step S02: Configure the improved sparse autoencoder (ISAE) training environment. The initial values ​​of the weights in both the encoding and decoding processes are set to standard normal distribution random numbers, and the biases are all set to 0. The ISAE loss function is constructed using equation (10), which consists of four parts: reconstruction error. sparse penalty items Intra-class divergence correction term Inter-class divergence correction term The values ​​are calculated using equations (7)-(8) and (13), respectively. The reconstruction error is used to control the encoding and decoding process to retain the original information; the sparsity penalty term is used to constrain the sparsity of the hidden layer encoding; the intra-class divergence correction is used to concentrate the distribution of fault features of the same class; and the inter-class divergence correction is used to amplify the differences in the distribution of fault features of different classes. There may be some conflict between the four loss function correction terms, so hyperparameters are used here. , , right , , To control the impact, an ISAE loss function is established.

[0065] Step S03: Use the particle swarm optimization algorithm to adjust the hyperparameters. , , To optimize the particle swarm optimization (PSO) algorithm, the fitness was determined by the accuracy of the support vector machine (SVM). The training set was used to train an improved sparse autoencoder (ISAE) with optimized weights and biases. The validation set was used for SVM identification to obtain the fitness, which was then tuned using the PSO algorithm. The ISAE training iterations were set to 500 iterations per optimization cycle with a learning rate of 0.05. The PSO algorithm optimization was performed with 5 populations iterating 100 times. The optimal individual fitness curve is shown below. Figure 2 As shown. After optimization using the particle swarm optimization algorithm, the hyperparameters are... =0.04, =0.01, The training effect is optimal when the value is 0.01.

[0066] Step S04: Identification process as follows Figure 3 As shown, the test set feature data is processed by the improved sparse autoencoder (ISAE), and the changes in the four loss terms during the iteration process are as follows: Figure 4 As shown, although the loss values ​​caused by intra-class divergence and inter-class divergence gradually increase in the later stages of iteration, the loss ratio of inter-class divergence to intra-class divergence remains as follows: Figure 5 As shown, it gradually increases and shows a saturation trend, indicating that ISAE plays a role in enhancing the directional nature of category discrimination.

[0067] Step S05: The test set data is optimized to different degrees by ISAE, AE, SAE, and PCA respectively, and then identified by support vector machine. The identification results are shown in the table below.

[0068] Table 1. Support Vector Machine Identification Accuracy After Dimensionality Reduction by Different Methods

[0069] Due to the small size of the training and validation sets, the identification accuracy fluctuates within a limited range. As shown in the table, the features reduced by the improved sparse autoencoder (ISAE) can be effectively applied to fault identification. The identification accuracy is above 95% for all feature dimensions. When the reduced feature dimensions are consistent, the features reduced by the improved sparse autoencoder (ISAE) have the highest identification accuracy, far exceeding AE and SAE. Guided by feature labels, ISAE can more effectively extract fault features that are helpful for identification. When the feature dimension is 4 to 3, the identification accuracy decreases significantly, showing a loss of effective features. However, the identification accuracy is still the highest among all methods, indicating that the improved sparse autoencoder (ISAE) retains effective features to a great extent during the feature reduction process.

[0070] The sparse autoencoder (ISAE) was modified based on intra-class and inter-class divergence, and an improved ISAE loss function was constructed, encompassing reconstruction error, sparsity penalty, intra-class divergence correction, and inter-class divergence correction. Iterative gradients of the ISAE weights and biases were calculated based on the backpropagation principle to complete ISAE training. The three hyperparameters of the ISAE were optimized using a particle swarm optimization algorithm. Based on these theoretical methods, the feature optimization effect of the improved sparse autoencoder was verified using a high-resistivity fault detection scenario in a power distribution network.

[0071] Example 2 This embodiment provides a distribution network fault detection system based on fault identification features optimization; A distribution network fault detection system based on fault identification feature optimization includes: The construction module is configured to: construct a dataset; the dataset includes: distribution network phase current waveform data with known fault detection results; train the improved sparse autoencoder using the dataset to obtain the trained sparse autoencoder; during the training process, the loss function of the improved sparse autoencoder includes: reconstruction error, sparsity penalty term, intra-class divergence correction term and inter-class divergence correction term; The acquisition module is configured to: acquire the phase current waveform data of the distribution network to be detected, extract features from the phase current waveform data of the distribution network to be detected, and obtain the original data features; The optimization module is configured to input the original data features into the trained improved sparse autoencoder to obtain optimized data features. The classification module is configured to input optimized data features into the trained classifier to obtain the detection results of whether there is a fault in the distribution network.

[0072] It should be noted that the aforementioned construction module, acquisition module, optimization module, and classification module correspond to steps S101 to S104 in Embodiment 1. The examples and application scenarios implemented by these modules and their corresponding steps are the same, but they are not limited to the content disclosed in Embodiment 1. It should also be noted that these modules, as part of the system, can be executed in a computer system, such as a set of computer-executable instructions.

[0073] The descriptions of each embodiment in the above embodiments have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0074] The proposed system can be implemented in other ways. For example, the system embodiments described above are merely illustrative, and the division of modules described above is only a logical functional division. In actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed.

[0075] Example 3 This embodiment also provides an electronic device, including: one or more processors, one or more memories, and one or more computer programs; wherein, the processor is connected to the memory, and the one or more computer programs are stored in the memory. When the electronic device is running, the processor executes the one or more computer programs stored in the memory to cause the electronic device to perform the method described in Embodiment 1.

[0076] It should be understood that in this embodiment, the processor can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0077] Memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of memory may also include non-volatile random access memory. For example, memory may also store information about the device type.

[0078] In the implementation process, each step of the above method can be completed by the integrated logic circuits in the processor hardware or by software instructions.

[0079] The method in Embodiment 1 can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The software modules can reside in readily available storage media in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, a detailed description is not provided here.

[0080] Those skilled in the art will recognize that the units and algorithm steps described in connection with the various examples of this embodiment can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention.

[0081] Example 4 This embodiment also provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, complete the method described in Embodiment 1.

[0082] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A power distribution network fault detection method based on failure identification feature optimization, characterized in that, include: Build the dataset; The dataset includes: distribution network phase current waveform data with known fault detection results; the improved sparse autoencoder is trained using the dataset to obtain the trained improved sparse autoencoder; during the training process, the loss function of the improved sparse autoencoder includes: reconstruction error, sparsity penalty term, intra-class divergence correction term and inter-class divergence correction term. Acquire the phase current waveform data of the distribution network to be detected, extract features from the phase current waveform data of the distribution network to be detected, and obtain the original data features; The original data features are input into the trained improved sparse autoencoder to obtain optimized data features; The optimized data features are input into the trained classifier to obtain the detection results of whether there is a fault in the distribution network.

2. The power distribution network fault detection method based on failure identification feature optimization of claim 1, characterized in that, The loss function of the improved sparse autoencoder includes: ; wherein, To improve the loss function of sparse autoencoder, is the reconstruction error, is the sparse penalty term, is the intra-class dispersion correction term, is the inter-class dispersion correction term, and the parameter , , adjusts the influence of each correction term on the loss function as a hyperparameter.

3. The power distribution network fault detection method based on failure identification feature optimization of claim 2, characterized in that, The reconstruction error refers to: ; wherein, denotes the reconstruction error, is the input feature vector, is the improved sparse autoencoder predicted output, is the total number of input feature vectors; The sparsity penalty term refers to: ; wherein, denotes a sparsity penalty term, denotes an encoding output, is the number of hidden layer encodings.

4. The power distribution network fault detection method based on failure identification feature optimization of claim 2, characterized in that, The intra-class divergence correction term refers to: For the common M-class sample label, the original feature sample with the feature number L , the ISAE encoding outputs a total of nodes, after single training, for the th sample of the th category, the output of the th node of the encoding layer is recorded as , then the intra-class dispersion of the encoding output of the th category at the node is ; ; wherein, denotes classes at nodes encoding output intra-class variance, denotes samples belonging to class all samples at nodes encoding output mean, denotes samples belonging to class total number of samples. Then the intra-class divergence correction term as follows: ; in, The total number of sample categories, This represents the number of nodes in the coding layer. Indicates belonging to a category The total number of samples.

5. The distribution network fault detection method based on fault identification feature optimization as described in claim 2, characterized in that, The inter-class divergence correction term refers to: node Encode output inter-class divergence for: ; ; in, This indicates that all samples of all categories are in the node. The average value of the encoded output. The total number of all samples in all categories; Then the inter-class divergence correction term as follows: 。 6. The distribution network fault detection method based on fault identification feature optimization as described in claim 1, characterized in that, The training of the improved sparse autoencoder is based on the principle of error backpropagation; wherein, the training based on the principle of error backpropagation includes: Based on the principle of backpropagation of errors, and taking into account the L1 regularization sparsity penalty term, intra-class divergence, and inter-class divergence correction, the error term of the decoder... for: (14); in, For loss function, This represents the activation function. Indicates the decoder output. Represents the input layer feature vector. This represents the decoder output before nonlinear activation; The error terms output by the encoder are shown below: (15); in, For reconstruction error, For sparse penalty terms, For decoder weights, To optimize hyperparameters, Represents a node Encoded output; The overall error term of the encoding output for intra-class and inter-class divergence corrections is 0, but for a single class sample, the inter-class divergence correction... Category Sample coding The partial derivatives are: (16); in, This indicates that all samples of all categories are in the node. The average value of the encoded output; For a single sample of a single class, intra-class divergence correction To belong to category samples coding The partial derivatives are: (17); in, Indicates belonging to a category All samples are at the node The average value of the encoded output; The gradient of the loss function according to the chain rule with respect to the encoder weights and biases is: (18) (19); in, This represents the encoder output before nonlinear activation. This is the error term of the decoder. and Representing the input layer nodes respectively To the coding layer node The encoding weights and biases, Indicates the decoding weights. This represents the activation function. Represents a node The encoded output, where the inter-class divergence correction and intra-class divergence correction are affected by the sample labels during training, will belong to the class... Sample code is denoted as , belongs to category samples The encoding is denoted as ,category sample The encoder output before nonlinear activation is denoted as , Indicates belonging to a category All samples are at the node The average value of the encoded output. This indicates that all samples of all categories are in the node. k The average value of the encoded output.

7. The distribution network fault detection method based on fault identification feature optimization as described in claim 1, characterized in that, The training of the improved sparse autoencoder, employing a particle swarm optimization algorithm to optimize the hyperparameters of the loss function, includes: Using the particle swarm optimization algorithm to optimize hyperparameters , , After optimization, the particle swarm optimization algorithm process is as follows: (1) Initialize the particle swarm: randomly generate a set number of hyperparameters. , , Initial values ​​are set by treating the value of each parameter as the particle position and assigning each a random initial velocity. (2) Evaluate particle performance: Calculate the fitness of each particle at its current position, specifically by assigning hyperparameters to the particle positions. , , Feature optimization and identification are performed, and the identification accuracy is used as a fitness evaluation parameter to adjust particle positions. At the same time, the historical best position of each particle is tracked and stored. And the best position currently found by the entire particle swarm. ; (3) Iterative optimization: The motion speed and spatial coordinates of each particle are dynamically adjusted according to formulas (20) and (21); after each update, its fitness is re-evaluated and compared with the historical best fitness, thereby updating the records of individual best solutions and global best solutions; (20); (21); in, express Particle position after the next iteration express The speed of the next iteration, parameters , , These are used to measure the particle velocity of the previous iteration and the historical best position, respectively. and the current optimal position of the particle swarm The weight.

8. A distribution network fault detection system based on fault identification feature optimization, characterized in that, include: The building module is configured to build the dataset; The dataset includes: distribution network phase current waveform data with known fault detection results; the improved sparse autoencoder is trained using the dataset to obtain the trained improved sparse autoencoder; during the training process, the loss function of the improved sparse autoencoder includes: reconstruction error, sparsity penalty term, intra-class divergence correction term and inter-class divergence correction term. The acquisition module is configured to: acquire the phase current waveform data of the distribution network to be detected, extract features from the phase current waveform data of the distribution network to be detected, and obtain the original data features; The optimization module is configured to input the original data features into the trained improved sparse autoencoder to obtain optimized data features. The classification module is configured to input optimized data features into the trained classifier to obtain the detection results of whether there is a fault in the distribution network.

9. An electronic device, characterized in that it comprises: Memory is used to store computer-readable instructions in a non-transitory manner. as well as Processor, for executing the computer-readable instructions, When the computer-readable instructions are executed by the processor, they perform the method described in any one of claims 1-7.

10. A storage medium, characterized in that, Non-transitory storage of computer-readable instructions, wherein when the non-transitory computer-readable instructions are executed by a computer, the method of any one of claims 1-7 is performed.