Distribution line fault classification method and device, storage medium and electronic equipment
By using a CNN+Transformer fusion model, which leverages the complementary advantages of convolutional neural networks and Transformer coding layer networks, the problems of insufficient feature extraction and model generalization ability in power distribution line fault identification are solved, and high-accuracy fault classification is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies for power distribution line fault identification suffer from problems such as reliance on expert experience for feature extraction, weak model generalization ability, and insufficient ability to analyze non-stationary signals, especially in the identification of high-resistance and arc faults.
A CNN+Transformer fusion model is adopted. The local temporal features of current and voltage signals are extracted through convolutional neural networks, and the multi-head self-attention mechanism of the Transformer coding layer network is used to mine long-distance dependencies and global information between features. The model is trained by combining cross-entropy loss function and gradient clipping strategy.
It achieves strong capture capability for weak features such as high-resistance faults, has strong model generalization ability, and achieves 100% classification accuracy in both simulation and measured data, making it suitable for complex power distribution networks.
Smart Images

Figure CN121765597A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of circuit fault classification technology, and more specifically, to a method, apparatus, storage medium, and electronic device for classifying power distribution line faults. Background Technology
[0002] Power distribution line faults are frequent and diverse, and traditional methods based on causal reasoning or Fourier transforms are significantly insufficient in identifying faults such as high resistance and arcing. While existing machine learning-based methods such as CNNs and LSTMs have shown some effectiveness, they still suffer from limitations such as reliance on expert experience for feature extraction, weak model generalization ability, and insufficient ability to analyze non-stationary signals. In recent years, the Transformer architecture has achieved breakthroughs in several fields due to its powerful temporal modeling capabilities, but its deep integration with CNNs has not yet been fully utilized in power fault diagnosis. Summary of the Invention
[0003] Embodiments of this application provide a method, apparatus, storage medium, and electronic device for classifying power distribution line faults to solve the technical problems in the prior art.
[0004] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.
[0005] According to a first aspect of the embodiments of this application, a method for classifying power distribution line faults is provided, including: Three-phase current and voltage time series under various fault and normal states of the power distribution network are collected to obtain a labeled dataset, which is divided into a training set and a validation set. A CNN+Transformer fusion model is trained based on the training set. The CNN+Transformer fusion model includes: a convolutional neural network, a Transformer coding layer network, and an object classification network. The convolutional neural network extracts local temporal features of current and voltage signals based on three-phase current and voltage time series, and the Transformer coding layer network uses a multi-head self-attention mechanism to mine long-distance dependencies and global information between features based on the local temporal features. Based on the validation set, fault classification is performed using the trained CNN+Transformer fusion model.
[0006] In some embodiments of this application, based on the aforementioned scheme, the acquisition of three-phase current and voltage time series under various fault and normal states of the distribution network to obtain a labeled dataset includes: Using PSCAD simulation software, a comprehensive simulation of different faults at different locations on the set line is performed to obtain three-phase current and voltage signals, and the signals are classified and labeled as normal state and fault state.
[0007] In some embodiments of this application, based on the aforementioned scheme, during the training of the CNN+Transformer fusion model, the cross-entropy loss function is used to dynamically adjust the network parameters during the backpropagation process, and a gradient pruning strategy is used to prevent overfitting. The cross-entropy loss function is as follows: ; Where m represents the number of sample data points passed to the model each time. This represents the true label of the current batch of sample data. This represents the corresponding probability.
[0008] In some embodiments of this application, based on the foregoing scheme, the convolutional neural network includes: a one-dimensional convolutional layer, a batch normalization layer, and a one-dimensional max pooling layer; The formula for calculating one-dimensional convolution used in the one-dimensional convolutional layer is as follows: ; In the formula, represents the output of a one-dimensional convolution, and j represents the output of the j-th neuron in the neural network; Indicates the activation function; Indicates the input data item, subscript t + i Indicates the position in the input sequence; Indicates learnable weights; This represents the learnable bias term for the convolution operation.
[0009] In some embodiments of this application, based on the aforementioned scheme, the Transformer coding layer network is obtained by stacking multiple sub-layers of the same level, and each sub-layer is connected to a normalization layer; Each sub-layer includes a multi-head self-attention mechanism module and a feedforward neural network.
[0010] In some embodiments of this application, based on the foregoing scheme, the multi-head self-attention mechanism module utilizes the multi-head self-attention mechanism to calculate long-distance dependencies and global information between features; The multi-head self-attention mechanism is designed from the single-head self-attention mechanism, which is calculated as follows: The query matrix is generated by performing a cubic linear transformation on the input sequence. Q Key matrix K Value matrix VThe mapping is used to calculate the long-distance dependencies between features in the input sequence. The calculation formula is as follows: ; in This represents the square root of the dimension of the key vector.
[0011] In some embodiments of this application, based on the foregoing scheme, the step of performing fault classification using the trained CNN+Transformer fusion model based on the validation set includes: The performance metrics of the trained CNN+Transformer fusion model are evaluated based on the validation set, including: accuracy, recall, precision, and F1 score. A CNN+Transformer fusion model that meets the performance requirements was selected for fault classification.
[0012] According to a second aspect of the embodiments of this application, a power distribution line fault classification device is provided, comprising: The acquisition unit is used to acquire the three-phase current and voltage time series under various fault states and normal states of the distribution network to obtain a labeled dataset, which is divided into a training set and a validation set. The training unit is used to train a CNN+Transformer fusion model based on the training set. The CNN+Transformer fusion model includes a convolutional neural network, a Transformer coding layer network, and an object classification network. The convolutional neural network extracts local temporal features of current and voltage signals based on three-phase current and voltage time series, and the Transformer coding layer network uses a multi-head self-attention mechanism to mine long-distance dependencies and global information between features based on the local temporal features. A classification unit is used to classify faults based on the validation set using the trained CNN+Transformer fusion model.
[0013] According to a third aspect of the embodiments of this application, a computer-readable storage medium is provided, the storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the method as described in the first aspect.
[0014] According to a fourth aspect of the embodiments of this application, an electronic device is provided, including: a memory and a processor; The memory is used to store computer instructions; The processor is configured to invoke computer instructions stored in the memory, causing the electronic device to execute the method described in the first aspect.
[0015] The technical solution of this application has the following beneficial effects: 1. It achieves the complementary advantages of CNN local feature extraction and Transformer global modeling; 2. It has a strong ability to detect subtle features such as high-resistance faults; 3. Achieved 100% classification accuracy in both simulation and actual test data; 4. The model has strong generalization ability and is suitable for complex power distribution networks.
[0016] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings: Figure 1 A flowchart illustrating a method for classifying power distribution line faults according to an embodiment of this application is shown. Figure 2 A schematic diagram of a 10kV power distribution line structure according to an embodiment of this application is shown; Figure 3 A schematic diagram of a Transformer encoder structure according to an embodiment of this application is shown; Figure 4 A block diagram of a power distribution line fault classification device according to one embodiment of this application is shown; Figure 5 A block diagram of an electronic device according to one embodiment of this application is shown; Figure 6 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown. Detailed Implementation
[0018] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.
[0019] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.
[0020] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0021] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0023] The following detailed description of some embodiments of this application will be provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0024] See Figure 1 The diagram shows a flowchart of a power distribution line fault classification method according to an embodiment of this application.
[0025] like Figure 1 As shown, a method for classifying power distribution line faults is illustrated, specifically including steps S100 to S300.
[0026] refer to Figure 1 In step S100, the three-phase current and voltage time series under various fault states and normal states of the distribution network are collected to obtain a labeled dataset, which is divided into a training set and a validation set.
[0027] It should be noted that in this implementation, the dataset is divided into a training set and a validation set in a 7:3 ratio. The training set is augmented through feature space mapping, while the validation set retains the original characteristics of the data to evaluate the model's generalization ability.
[0028] In some feasible embodiments, based on the aforementioned scheme, the collection of three-phase current and voltage time series under various fault and normal states of the distribution network yields a labeled dataset, including: Using PSCAD simulation software, a comprehensive simulation of different faults at different locations on the set line is performed to obtain three-phase current and voltage signals, and the signals are classified and labeled as normal state and fault state.
[0029] For example, see Figure 2 The diagram shows a schematic of a 10kV power distribution line.
[0030] like Figure 2 As shown, the system power supply is 10.5kV, with an internal impedance of (0.0584 + j0.6537)Ω and a frequency of 50Hz. The line parameters are: positive-sequence impedance (0.0627 + j0.3382)Ω / km, positive-sequence susceptance 40.866µS / km, zero-sequence impedance (0.2127 + j1.1838)Ω / km, and zero-sequence susceptance 23.658µS / km. The line length is 10km. Each branch line has a load at its end, with a load resistance R = 188Ω and an inductance L = 0.188H.
[0031] The dataset was constructed using PSCAD simulation software, with node 801 as the measurement point, measuring the three-phase current and node voltage signals of the line. The sampling rate was 100kHz, and the sampling depth was one power frequency cycle. The simulation content is shown in Table 1, including normal operation and fault conditions. Table 2 lists the total number of labeled samples in each type, with 240 samples per type, for a total of 2400 samples. The dataset was divided in a 7:3 ratio, with 1680 samples in the training set and 720 samples in the test set.
[0032] Table 1 Fault Simulation Configuration
[0033] Table 2 Number of different types of faults
[0034] It should be noted that PSCAD simulation software can clearly identify the fault characteristics of the circuit, thus improving the identification efficiency.
[0035] Continue to refer to Figure 1Step S200: Train a CNN+Transformer fusion model based on the training set. The CNN+Transformer fusion model includes: a convolutional neural network, a Transformer coding layer network, and an object classification network. The convolutional neural network extracts local temporal features of current and voltage signals based on three-phase current and voltage time series, and the Transformer coding layer network uses a multi-head self-attention mechanism to mine long-distance dependencies and global information between features based on the local temporal features.
[0036] In some feasible implementations, based on the aforementioned scheme, during the training of the CNN+Transformer fusion model, the cross-entropy loss function is used to dynamically adjust the network parameters during the backpropagation process, and a gradient pruning strategy is used to prevent overfitting. The cross-entropy loss function is as follows: ; Where m represents the number of sample data points passed to the model each time. This represents the true label of the current batch of sample data. This represents the corresponding probability.
[0037] It is understandable that this embodiment uses the cross-entropy loss function for dynamic adjustment to avoid the problem of reduced learning rate of the mean squared error loss function when using the sigmoid function during gradient descent.
[0038] In some feasible embodiments, based on the foregoing scheme, the convolutional neural network includes: a one-dimensional convolutional layer, a batch normalization layer, and a one-dimensional max pooling layer; The formula for calculating one-dimensional convolution used in the one-dimensional convolutional layer is as follows: ; In the formula, represents the output of a one-dimensional convolution, and j represents the output of the j-th neuron in the neural network; This represents the activation function; in this embodiment, the tanh function is used as the activation function. Indicates the input data item, subscript t + i Indicates the position in the input sequence; Indicates learnable weights; This represents the learnable bias term for the convolution operation.
[0039] It is understandable that designing a convolutional neural network as a structure of one-dimensional convolutional layer + batch normalization layer + one-dimensional max pooling layer can shorten the length of the original dataset and facilitate the extraction of temporal features by the subsequent Transformer encoding layer network.
[0040] In some feasible embodiments, based on the aforementioned scheme, the Transformer coding layer network is obtained by stacking multiple sub-layers of the same level, and each sub-layer is connected to a normalization layer; Each sub-layer includes a multi-head self-attention mechanism module and a feedforward neural network.
[0041] Understandably, in the architecture of the CNN+Transformer fusion model, the Transformer encoder, as the core component, primarily processes the input sequence layer by layer to generate high-value sequence representations. Compared to traditional sequence-to-sequence models such as RNN and LSTM, the Transformer encoder abandons the recursive structure and adopts a multi-head self-attention mechanism to construct dynamic relationships between sequence elements.
[0042] like Figure 3 As shown, the encoder's structure consists of multiple identical stacked layers. Each layer has two key modules: a multi-head self-attention mechanism and a feed-forward neural network (FFNN). Furthermore, a normalization layer is connected after each sub-layer. The normalization layer standardizes the data, making the training process more stable and effectively avoiding the gradient explosion or vanishing gradient problems that often occur during deep network training.
[0043] It's worth mentioning that the multi-head self-attention mechanism has a unique working method. It doesn't rely on a single, fixed weight parameter, but rather generates different attention weight matrices by capturing the dynamic interactions of multi-dimensional features in the input sequence. This unique design gives the Transformer encoder powerful capabilities, enabling it to accurately extract fault features from complex inputs, providing a high-quality feature representation foundation for subsequent classification tasks. In this embodiment, a 4-layer Transformer is chosen because it achieves a good balance between model capability and computational efficiency when handling small-to-medium-scale tasks, possessing basic context modeling capabilities while avoiding overfitting and high computational overhead.
[0044] In some feasible embodiments, based on the aforementioned scheme, the multi-head self-attention mechanism module utilizes the multi-head self-attention mechanism to calculate long-distance dependencies and global information between features; The multi-head self-attention mechanism is designed from the single-head self-attention mechanism, which is calculated as follows: The query matrix is generated by performing a cubic linear transformation on the input sequence. Q Key matrixK Value matrix V The mapping is used to calculate the long-distance dependencies between features in the input sequence. The calculation formula is as follows: ; in This represents the square root of the dimension of the key vector.
[0045] Continue to refer to Figure 1 Step S300: Based on the validation set, fault classification is performed using the trained CNN+Transformer fusion model.
[0046] In some feasible embodiments, based on the foregoing scheme, the step of performing fault classification using the trained CNN+Transformer fusion model based on the validation set includes: The performance metrics of the trained CNN+Transformer fusion model are evaluated based on the validation set, including: accuracy, recall, precision, and F1 score. A CNN+Transformer fusion model that meets the performance requirements was selected for fault classification.
[0047] For example, the calculation formulas for the evaluation indicators are shown in Table 3.
[0048] Table 3 Calculation method of evaluation indicators
[0049] In the formula, TP represents true positive, TN represents true negative, FP represents false positive, and FN represents false negative.
[0050] Experiments were conducted using the CNN+Transformer fusion model provided in this application. The results show that when using the CNN model alone, the training accuracy is 93.3% and the test accuracy is 96.7%; when using the Transformer network alone, the training accuracy reaches 94.7% and the test accuracy is 95.6%. The combined CNN and Transformer architecture demonstrates superior performance in power distribution line fault detection, achieving 100% accuracy. The CNN model excels at extracting local features from data through convolutional operations, giving it an advantage in processing local patterns in power distribution line fault detection data. It can quickly capture the basic features of fault signals, thus achieving a higher test accuracy than training accuracy, demonstrating a certain generalization ability. The Transformer network, with its self-attention mechanism, effectively models the global dependencies of data, performing well in mining long-distance correlation information of fault signals. Its training accuracy is slightly higher than its test accuracy, indicating a better fit on the training set. The fusion of CNN and Transformer architectures significantly improves performance due to their complementary strengths. CNN first extracts local features from power distribution line fault data, providing foundational features for subsequent processing. Transformer, based on the features extracted by CNN, utilizes a self-attention mechanism to further uncover long-range dependencies and global information between features, compensating for CNN's shortcomings in capturing global features. This collaborative work allows the model to fully utilize the detailed information of local features while grasping the overall structure of the data, thus more accurately identifying power distribution line fault modes and significantly improving fault detection accuracy. This result fundamentally benefits from the complementary strengths and deep integration of the CNN and Transformer architectures. In complex scenarios such as high-resistance faults, where features are weak, susceptible to noise interference, and demanding high precision in feature extraction and information integration, the CNN+Transformer fusion network algorithm stands out, significantly improving fault classification accuracy and providing a more reliable and efficient solution for high-resistance fault detection in power distribution networks.
[0051] The following describes an embodiment of the apparatus described in this application, which can be used to execute a power distribution line fault classification method as described in the above embodiments of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0052] Reference Figure 4 As shown, a power distribution line fault classification device 400 according to one embodiment of this application includes: The acquisition unit 401 is used to acquire the three-phase current and voltage time series under various fault states and normal states of the distribution network to obtain a labeled dataset, which is divided into a training set and a validation set. Training unit 402 is used to train a CNN+Transformer fusion model based on the training set. The CNN+Transformer fusion model includes a convolutional neural network, a Transformer coding layer network, and an object classification network. The convolutional neural network extracts local temporal features of current and voltage signals based on three-phase current and voltage time series, and the Transformer coding layer network uses a multi-head self-attention mechanism to mine long-distance dependencies and global information between features based on the local temporal features. Classification unit 403 is used to classify faults based on the validation set using the trained CNN+Transformer fusion model.
[0053] like Figure 5As shown, this application embodiment also provides an electronic device 500, including a memory 510, a processor 520, and a computer program 511 stored in the memory 510 and executable on the processor. When the processor 520 executes the computer program 511, it implements the steps of the above-mentioned power distribution line fault classification method.
[0054] Since the electronic device described in this embodiment is the device used to implement a power distribution line fault classification device in the embodiments of this application, those skilled in the art can understand the specific implementation method and various variations of the electronic device in this embodiment based on the method described in the embodiments of this application. Therefore, how the electronic device implements the method in the embodiments of this application will not be described in detail here. Any device used by those skilled in the art to implement the method in the embodiments of this application is within the scope of protection of this application.
[0055] In practice, when the computer program 511 is executed by the processor, it can implement any of the embodiments corresponding to the first aspect.
[0056] Figure 6 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown.
[0057] It should be noted that, Figure 6 The computer system 600 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0058] like Figure 6 As shown, the computer system 600 includes a Central Processing Unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 602 or programs loaded from Storage Unit 608 into Random Access Memory (RAM) 603, such as performing the methods described in the above embodiments. The RAM 603 also stores various programs and data required for system operation. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An Input / Output (I / O) interface 605 is also connected to the bus 604.
[0059] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.
[0060] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs various functions defined in the system of this application.
[0061] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0062] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0063] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.
[0064] In another aspect, this application also provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the power distribution line fault classification method described in the above embodiments.
[0065] In another aspect, this application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to implement the power distribution line fault classification method described in the above embodiments.
[0066] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0067] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the methods according to the embodiments of this application.
[0068] Other embodiments of this application will readily conceive of by those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. It should be understood that this application is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A power distribution line fault classification method characterized by, The method comprises the following steps: Collecting three-phase current and voltage time series of power distribution network in various fault states and normal states to obtain a labeled data set, which is divided into a training set and a validation set; Training a CNN+Transformer fusion model based on the training set, wherein the CNN+Transformer fusion model comprises a convolutional neural network, a Transformer encoding layer network, and a target classification network; The convolutional neural network extracts local time sequence features of current and voltage signals based on the three-phase current and voltage time series, and the Transformer encoding layer network uses a multi-head self-attention mechanism to mine long-distance dependency relationships and global information among features based on the local time sequence features; Based on the validation set, the trained CNN+Transformer fusion model is used for fault classification.
2. The method of claim 1, wherein, The method of collecting three-phase current and voltage time series of power distribution network in various fault states and normal states to obtain a labeled data set comprises the following steps: Using PSCAD simulation software to simulate different faults at different positions of the set line, obtaining three-phase current and voltage signals, and classifying and labeling the signals as normal state and fault state.
3. The method of claim 1, wherein, During the training of the CNN+Transformer fusion model, the cross-entropy loss function is used to dynamically adjust the network parameters in the backpropagation process, and the gradient clipping strategy is used to prevent overfitting. The cross-entropy loss function is as follows: ; where m represents the number of sample data per time of passing into the model, represents the true label of the sample data of the current batch, represents the corresponding probability.
4. The method of claim 1, wherein, The convolutional neural network comprises a one-dimensional convolutional layer, a batch normalization layer, and a one-dimensional maximum pooling layer; The one-dimensional convolutional layer uses a one-dimensional convolution formula as follows: ; wherein denotes the output of a one-dimensional convolution, j denotes the output of the jth neuron in the neural network; denotes an activation function; denotes an input data item, the index t + i denotes a position in the input sequence; denotes a learnable weight; denotes a learnable bias term for the convolution operation.
5. The method of claim 1, wherein, The Transformer encoding layer network is obtained by stacking multiple identical sublayers, and each sublayer is connected to a normalization layer; Each sublayer comprises a multi-head self-attention mechanism module and a feedforward neural network.
6. The method of claim 5, wherein, The multi-head self-attention mechanism module uses a multi-head self-attention mechanism to calculate long-distance dependency relationships and global information among features; The multi-head self-attention mechanism is designed based on a single-head self-attention mechanism, and the single-head self-attention mechanism is calculated as follows: The query matrix is generated by performing three linear transformations on the input sequence Q , the key matrix K , and the value matrix V to calculate the long-distance dependency between the features of the input sequence, and the calculation formula is: ; wherein denotes the square root of the dimension of the bond vector.
7. The method of claim 1, wherein, Based on the validation set, the trained CNN+Transformer fusion model is used for fault classification, which comprises the following steps: Evaluating the performance indicators of the trained CNN+Transformer fusion model based on the validation set, including accuracy, recall rate, precision, and f1 score; Selecting a CNN+Transformer fusion model that meets the performance requirements for fault classification.
8. A power distribution line fault classification apparatus, characterized by, The method comprises the following steps: A collection unit is configured to collect three-phase current and voltage time series of power distribution network in various fault states and normal states to obtain a labeled data set, which is divided into a training set and a validation set; A training unit is configured to train a CNN+Transformer fusion model based on the training set, wherein the CNN+Transformer fusion model comprises a convolutional neural network, a Transformer encoding layer network, and a target classification network; The convolutional neural network extracts local time sequence features of current and voltage signals based on three-phase current and voltage time series, and the Transformer encoding layer network uses a multi-head self-attention mechanism to mine long-distance dependency relationships and global information among features based on the local time sequence features. The classification unit is configured to perform fault classification by using the trained CNN+Transformer fusion model based on the verification set.
9. A computer-readable storage medium, characterized in that, The storage medium stores computer instructions, and the computer instructions make the computer execute the method in any one of claims 1-7 when the computer instructions run on the computer.
10. An electronic device, comprising: Comprise: A memory and a processor; The memory is configured to store computer instructions; The processor is configured to call the computer instructions stored in the memory, so that the electronic device executes the method in any one of claims 1-7.