Fault arc detection model training method, fault arc detection method and device
Optimizing the hyperparameters of the fault arc detection model through genetic algorithms, combining one-dimensional convolutional neural network and cosine annealing learning rate scheduling function, solves the limitations of traditional detection technology under complex loads, and realizes high-precision detection at low sampling rates , suitable for embedded devices.
Patent Information
- Application Number
- CN202411765549.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-01-03
AI Technical Summary
Traditional fault arc detection technology shows limitations under complex loads and harmonic interference, making it difficult to achieve high detection accuracy in resource-constrained systems, and has high computational complexity, making it difficult to apply to embedded devices.
Genetic algorithms are used to optimize the hyperparameters of the fault arc detection model, build a fault arc detection model with low parameter quantity and low computational complexity, extract voltage data characteristics through a one-dimensional convolutional neural network, and promote model convergence using cosine annealing learning rate scheduling function .
The accuracy of fault arc detection is significantly improved at low sampling rates, the missed detection and missed detection are reduced, the parameter quantity and calculation complexity of the model are reduced, making the model suitable for embedded devices with resource-constrained.
Smart Images

Figure CN119250165A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power fault detection, and in particular to a fault arc detection model training method, a fault arc detection method and a device. Background Art
[0002] With the rapid development of smart grid and Internet of Things technologies, the power system has put forward higher requirements for safety, reliability and real-time performance. Smart grid aims to improve the energy conservation, emission reduction, compatibility, interaction and safety of the power system through the combination of modern information and communication technology and Internet of Things (IoT) technology, so as to achieve higher power quality and intelligence level. However, the power Internet of Things is still in its early stages of development and faces many challenges, especially in the fault monitoring of power equipment, which lacks a unified equipment identification system and a comprehensive perception network. The complex working environment of electrical equipment makes it difficult for traditional detection methods to cope with complex electrical interference, resulting in the inability to accurately monitor equipment failures in real time.
[0003] As the main hidden danger of electrical fires, series arc faults are highly random and nonlinear. Traditional arc fault detection technology is mainly based on the time-frequency characteristics of current and voltage, but traditional methods often show limitations when facing complex loads and harmonic interference. In recent years, with the rapid development of deep learning technology, neural network-based detection methods have gradually emerged, especially convolutional neural networks (CNNs), which have shown excellent performance in processing time series data. However, traditional CNN models have high computational complexity and large number of parameters, making them difficult to apply to resource-constrained systems such as embedded devices.
[0004] Therefore, there is an urgent need for a fault arc detection model training method, a fault arc detection method and a device to solve the above problems. Summary of the invention
[0005] The technical problem solved by the present invention is to provide a fault arc detection model training method, a fault arc detection method and a device, which optimizes the hyperparameters of the fault arc detection model through a genetic algorithm, so that the model can maintain high detection accuracy at a low sampling rate, while significantly reducing the parameter amount and computational complexity of the fault arc detection model.
[0006] The present invention solves the technical problem by adopting the following technical solutions: A method for training a fault arc detection model comprises: obtaining a voltage data set, the voltage data set comprising a training set, a validation set and a test set; obtaining an optimal hyperparameter combination of the fault arc detection model by a genetic algorithm, and constructing the fault arc detection model based on the optimal hyperparameter combination; training the fault arc detection model by the voltage data set to optimize model parameters, and evaluating the model performance of the fault arc detection model.
[0007] In a preferred embodiment of the present invention, before the step of obtaining the voltage data set, the method further includes: obtaining current signals using current transformers according to different load conditions, converting the current signals into voltage signals, and performing standardization processing on the voltage signals.
[0008] In a preferred embodiment of the present invention, after the step of normalizing the voltage signal, the method further comprises: splitting the voltage signal into one cycle as one data sample according to a preset alarm performance indicator to construct the voltage data set.
[0009] In a preferred embodiment of the present invention, the step of obtaining the optimal hyperparameter combination of the fault arc detection model through a genetic algorithm includes: iterating the hyperparameter combination of the fault arc detection model through the genetic algorithm, the hyperparameter combination including the number of convolutional layers, the number of filters, the expansion rate, the Dropout rate and the learning rate; obtaining the final hyperparameter combination of the fault arc detection model after satisfying the iteration termination condition, and using the final hyperparameter combination as the optimal hyperparameter combination, the iteration termination condition including reaching a preset maximum number of iterations and model convergence.
[0010] In a preferred embodiment of the present invention, after the above-mentioned step of iterating the hyperparameter combination of the fault arc detection model through the genetic algorithm, it also includes: using a cosine annealing learning rate scheduling function to dynamically adjust the learning rate in the hyperparameter combination to promote the convergence of the fault arc detection model.
[0011] In a preferred embodiment of the present invention, the above-mentioned fault arc detection model includes: multiple layers of one-dimensional convolutional layers, pooling layers, Dropout layers and fully connected layers.
[0012] In a preferred embodiment of the present invention, the above-mentioned step of training, optimizing and evaluating the fault arc detection model through the voltage data set to confirm the model performance of the fault arc detection model includes: training the fault arc detection model using the training set in the voltage data set, and adjusting the model parameters of the fault arc detection model through the validation set; evaluating the trained fault arc detection model on the test set to obtain the model performance of the fault arc detection model, wherein the model performance includes accuracy, precision, recall and F1 score.
[0013] In a preferred embodiment of the present invention, after the above-mentioned step of training, optimizing and evaluating the fault arc detection model through the voltage data set to confirm the model performance of the fault arc detection model, it includes: converting the fault arc detection model into a C array format .h file and deploying it to a microcontroller to perform real-time detection of fault arcs in the circuit.
[0014] A fault arc detection method comprises: obtaining a voltage signal to be detected; inputting the voltage signal to be detected into a fault arc detection model for detection to obtain a fault arc detection result; wherein the fault arc detection model is trained according to any one of the methods described above.
[0015] A fault arc detection device comprises: a memory and a processor, wherein the memory stores a fault arc detection program, and when the fault arc detection program is executed by the processor, it is used to implement the steps of the fault arc detection method as described above.
[0016] The technical effect achieved by the present invention using the above technical solution is: obtaining the optimal hyperparameter combination of the fault arc detection model through a genetic algorithm, and constructing the fault arc detection model based on the optimal hyperparameter combination; then training and optimizing the model parameters of the fault arc detection model through a voltage data set, and evaluating the model performance of the fault arc detection model. Through the above method, the trained fault arc detection model can extract complex voltage data features at a low sampling rate, significantly improve the detection accuracy of the fault arc, and effectively reduce the cases of missed detection and false detection.
[0017] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following specifically cites a preferred embodiment and describes it in detail with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1The present invention is a flowchart of a method for training a fault arc detection model.
[0019] Figure 2 This is an experimental data conversion diagram shown in the present invention.
[0020] Figure 3 This is a single load voltage data diagram shown in the present invention.
[0021] Figure 4 A dual-load voltage data diagram shown in the present invention.
[0022] Figure 5 A multi-load voltage data diagram shown in the present invention.
[0023] Figure 6 A graph showing the loss and accuracy change of a fault arc detection model according to the present invention.
[0024] Figure 7 A confusion matrix diagram of a fault arc detection model shown in the present invention.
[0025] Figure 8 The present invention is a flow chart of a fault arc detection method. DETAILED DESCRIPTION
[0026] In order to further explain the technical means and effects taken by the present invention to achieve the predetermined invention purpose, the embodiments of the present invention are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The embodiments described below are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present invention. Through the description of the specific implementation methods, the technical means and effects taken by the present invention to achieve the predetermined purpose can be more deeply and specifically understood, and the attached drawings are only for reference and explanation purposes, and are not used to limit the present invention.
[0027] See also Figure 1 , Figure 1 The present invention is a flowchart of a method for training a fault arc detection model.
[0028] like Figure 1 As shown, a fault arc detection model training method shown in an embodiment of the present invention includes the following steps: S11: Acquire a voltage dataset, where the voltage dataset includes a training set, a validation set, and a test set.
[0029] Optionally, voltage signals under different working conditions are collected in advance through experiments, and the voltage signals include: voltage signals under normal working conditions and voltage signals under fault arc conditions (i.e., when a fault arc occurs). The fault arc detection model is then trained using the collected voltage signals. The voltage signals are converted by current transformers.
[0030] Specifically, the voltage signal acquisition experimental platform is built according to the national standard GB14287.4 "General Requirements for Arc Fault Protection Devices", and mainly includes: a fault arc generation unit, a signal acquisition unit, and a data processing unit. The fault arc generation unit uses an arc generator to be connected in series to the circuit to simulate the generation of a series fault arc. The signal acquisition unit uses a current transformer HCS-ES5-10A to obtain the current signal, and then the current transformer converts the collected current signal into a voltage signal for output. Figure 2 As shown, the current signal data in the circuit can be visualized through the current probe and the oscilloscope. Channel 2 of the oscilloscope collects the voltage signal output by the current transformer at a sampling frequency of 12.5kHz, thereby ensuring the accuracy and stability of the signal sampling.
[0031] Specifically, in order to study the characteristics of AC series fault arcs under different load conditions, the acquisition experiment platform selected four typical household appliances, namely laptop computers, switching power supplies, kettles and hair dryers, as research objects, covering resistive, inductive and mixed load types, see Table 1. In order to fully simulate the fault arc conditions that may occur in the operation of actual household appliances, the experimental design is divided into three working conditions: single load, multiple loads and mixed loads, and arc fault data under different working conditions are collected respectively.
[0032] Table 1. Experimental load parameters
[0033] Optionally, before the step of acquiring the voltage data set, the step includes: acquiring current signals using current transformers according to different load conditions, converting the current signals into voltage signals, and performing standardization processing on the voltage signals.
[0034] Specifically, arc fault simulation and data collection were carried out for different load conditions, so as to obtain the signal characteristics of voltage signals under normal state and fault arc state under different load conditions. In order to capture the signal characteristics of voltage signals when fault arc occurs, the current signal in the circuit is first collected through the current transformer, and then the current signal is converted into a voltage signal for output, and finally the voltage signal output by the current transformer is collected at a sampling frequency of 12.5 kHz. The test plan is shown in Table 2. The data collection includes: arc fault data under single load conditions, arc fault data under multi-load conditions, and arc fault data under mixed load conditions (see Figure 3-Figure 5 ). Through the experimental design of various working conditions, the signal characteristics / features of the fault arc under different load combinations are comprehensively analyzed.
[0035] Table 2 Experimental plan
[0036] Specifically, all the collected data are transmitted to the database / computer PC through the data acquisition module for storage, which is used for subsequent data processing and arc fault detection model training. During the data acquisition process, not only the signal when the arc fault occurs is recorded, but also the signal under normal working state is collected at the same time, so as to analyze, compare and model the signal characteristics of normal state and arc fault state in the future.
[0037] Specifically, in order to ensure the accuracy and stability of data processing, the collected voltage signal needs to be standardized to eliminate the influence of different characteristic dimensions so that the obtained data is more consistent with the assumptions of the model, thereby improving the convergence speed and prediction accuracy of the model.
[0038] Standardized calculation formula:
[0039]
[0040]
[0041] in: is the standardized value; is the original voltage value; It is the voltage signal data The mean of It is the voltage signal data The standard deviation of It is The characteristic value of a sample.
[0042] Standardization processing can transform all collected voltage signal data according to a unified scale so that the data of each voltage signal feature has a similar distribution. Generally speaking, the mean of the standardized data is 0 and the standard deviation is 1.
[0043] like Figure 3 As shown in the figure, for the single load voltage signal data, in experiments 1 to 4 (representing the experimental numbers in the test plan, see Table 2), the voltage signal data output by the current transformer of the laptop computer, switching power supply, kettle and hair dryer show significant differences in normal state and fault arc state. In the normal state, the voltage signal data of the laptop computer and switching power supply have slight fluctuations and spikes, indicating their pulse modulation working mode and power supply stability; while the kettle and hair dryer show a more regular sine waveform, reflecting the stable current characteristics. However, in the fault arc state (also known as the arc fault state), the fluctuation amplitude of the voltage signal data of all devices increases significantly, accompanied by frequent spikes and irregular fluctuations, especially the voltage signal of the hair dryer and laptop computer fluctuates violently. This shows that the current stability of each device is significantly affected when an arc fault occurs, causing abnormal operation of the device. By analyzing and processing the differences between the signal characteristics of these voltage signals, a reliable basis can be provided for arc fault detection. Dual load and multi-load voltage signal analysis such as Figure 4 and 5 As shown in Figure 1, according to the data analysis of experiments 1 to 14, the characteristics of arc faults mainly include: spike signal increase type fault characteristics, waveform distortion type fault characteristics, fluctuation amplitude increase type fault characteristics and periodic destruction type fault characteristics (one arc fault characteristic corresponds to one arc fault). Spike signal increase type faults usually occur on nonlinear loads, such as laptops and switching power supplies, which are manifested by a significant increase in high-frequency spikes in the voltage signal and enhanced instantaneous current fluctuations during the fault. Waveform distortion type faults mainly occur in resistive and inductive loads, such as kettles and hair dryers. When the fault occurs, the original sinusoidal waveform is severely distorted. Fluctuation amplitude increase type faults are common in inductive loads and mixed load systems. When the fault occurs, the voltage fluctuation amplitude increases significantly, especially the performance of hair dryers during the fault. Periodic destruction type faults are concentrated on inductive loads, which are manifested by the periodic fluctuation of the load being broken during the fault, and the originally regular signal becomes chaotic.
[0044] In general, nonlinear loads are susceptible to interference from spike signals, while resistive and inductive loads are more likely to experience waveform distortion and increased fluctuations. When a hybrid load system fails, it exhibits a superposition of multiple fault characteristics, and the coupling effect between loads makes the impact of the fault more complex and significant. These fault characteristics can provide a basis for the design and training of subsequent arc fault detection models, helping to more accurately identify and classify different types of faults, thereby improving the reliability and response speed of the detection system.
[0045] Optionally, after the step of performing standardization processing on the collected voltage signals, the method further includes: splitting all collected voltage signals into one data sample per cycle according to a preset alarm performance indicator to construct the voltage data set.
[0046] Specifically, the collected voltage signal is split into one data sample per cycle according to the arc fault detector (AFD) alarm performance index of the national standard GB14287.4-2014 "Electrical Fire Monitoring System Part 4: Arc Fault Detector", and each data sample includes 250 voltage sampling points, thereby constructing a voltage data set containing normal working state and arc fault state. After the voltage data set is standardized, it is divided into a training set, a validation set, and a test set, wherein the training set accounts for 80%, the validation set accounts for 10%, and the test set accounts for 10%, see 3 and Table 4. The samples in the voltage data set include voltage signal data collected under various load operation conditions, so as to train and evaluate the performance of the arc fault detection model under various load conditions.
[0047] Table 3. Dataset 1
[0048] Table 4. Dataset 2
[0049] S12: Obtaining an optimal hyperparameter combination of the fault arc detection model through a genetic algorithm, and constructing the fault arc detection model based on the optimal hyperparameter combination.
[0050] The fault arc detection model is obtained by optimizing and training the one-dimensional convolutional neural network (1D-CNN) model using the voltage data set collected by the above experimental platform. First, the hyperparameter combination of the model is calculated by genetic algorithm to obtain the optimal hyperparameter combination; then, the hyperparameters of the one-dimensional convolutional neural network (1D-CNN) model are adjusted according to the obtained optimal hyperparameter combination to construct the fault arc detection model, and then the model parameters of the fault arc detection model are adjusted by combining the training set in the voltage data set with the verification set to obtain the final fault arc detection model.
[0051] Specifically, in fault arc detection, it is necessary to extract signal features from the voltage signal, and then identify abnormal arc phenomena based on the signal features. Fault arcs are usually accompanied by specific voltage waveform features / signal features, such as intermittent high-frequency signals or sudden changes in voltage waveforms. However, traditional signal processing methods have difficulty accurately identifying these complex patterns, while one-dimensional convolutional neural networks (1D-CNN) are very suitable for extracting features from these signals and using them for classification tasks.
[0052] The 1D convolution operation processes the input time series data through a sliding window, gradually scanning and extracting local time series features. Each convolution layer not only uses a convolution kernel, but also combines a dilation rate to expand the receptive field, allowing the model to capture a wider range of contextual information without increasing the number of parameters. It is very important for identifying sudden changes or high-frequency components in voltage signals, especially those related to fault arcs. The output of each convolution layer is processed by the ReLU activation function, which increases the nonlinear expression ability of the model and enables it to better capture complex signal patterns.
[0053] After the convolution layer, the model applies a max pooling operation to halve the size of the feature map. This process effectively reduces the dimensionality of the data and reduces the computational burden of subsequent layers, while retaining the most significant features and enhancing the robustness and generalization ability of the model. Through layer-by-layer convolution and pooling, the model gradually extracts and compresses key information in time series data.
[0054] Finally, these extracted features are integrated through the fully connected layer and processed by the Sigmoid activation function to compress the output value to between 0 and 1, generating a probability value indicating whether the input signal belongs to the fault arc classification result. The model output layer uses the Sigmoid activation function, and the calculation formula is:
[0055] Where W is the model weight matrix, is the input data, is the bias term; is the Sigmoid activation function, and the calculation formula is:
[0056]
[0057] In order to optimize the performance of the model, binary cross-entropy is used as the loss function, and the calculation formula is:
[0058] in, is the true label, is the model prediction value.
[0059] This loss function can measure the difference between the model prediction value and the actual label, and is particularly suitable for binary classification tasks. The model optimizer uses the Adam optimizer, and the calculation formula is:
[0060]
[0061]
[0062]
[0063]
[0064] in, :right Bias-corrected momentum estimation. :right Bias-corrected squared momentum estimation. : Parameters of the model (such as weights and bias ). is the gradient of the loss function, and They are the momentum estimate of the gradient and the momentum estimate of the squared gradient, is the learning rate, and is the exponential decay rate of the controlling momentum, is a small constant for numerical stability.
[0065] This is an adaptive learning rate optimization algorithm that can quickly and stably adjust the model weights, allowing the model to converge to the optimal solution faster.
[0066] In addition, in order to further improve the training effect, the cosine annealing learning rate scheduling strategy is adopted. The calculation formula is:
[0067] : The current learning rate, that is, the learning rate used in the tth training iteration.
[0068] in: is the initial learning rate, is the current epoch (training round), is the total number of training rounds.
[0069] During the training process, the learning rate gradually decreases as the number of training rounds increases, and the simulated annealing process enables the model to make more precise parameter adjustments in the later stages of training to avoid falling into the local optimal solution. Through this series of optimizations, the 1D convolutional neural network can effectively and accurately detect fault arcs, providing reliable protection for the safety of electrical systems.
[0070] Optionally, the step of obtaining the optimal hyperparameter combination of the fault arc detection model through a genetic algorithm includes: iterating the hyperparameter combination of the fault arc detection model through the genetic algorithm, the hyperparameter combination including the number of convolutional layers, the number of filters, the expansion rate, the Dropout rate and the learning rate; obtaining the final hyperparameter combination of the fault arc detection model after satisfying the iteration termination condition, and using the final hyperparameter combination as the optimal hyperparameter combination, the iteration termination condition including reaching a preset maximum number of iterations and model convergence.
[0071] Specifically, genetic algorithm is an optimization algorithm based on natural selection and genetic mechanism, which gradually finds the optimal solution to the problem by simulating the biological evolution process. In this paper, genetic algorithm is used to find the optimal 1D-CNN model structure and hyperparameter combination to maximize the accuracy and precision of the model on the validation set while minimizing the number of parameters of the model.
[0072] Population Initialization Each individual contains multiple decision variables (hyperparameters), and the formula is expressed as:
[0073] : Population, represents the set of initialized hyperparameter populations.
[0074] : The number of individuals in the population, indicating the size of the population. This value determines how many different hyperparameter combinations are generated during the population initialization phase.
[0075] Among them: Each individual Contains the following hyperparameters: number of filters (the number of filters in n convolutional layers); dilation rate (the dilation rate in n convolutional layers); dropout rate; learning rate; number of convolutional layers.
[0076] The fitness function is a function used in genetic algorithms to evaluate the quality of each individual (i.e., each solution or model configuration). It scores each individual and determines the adaptability of the individual in the current population. The higher the value of the fitness function, the better the individual is considered to be and the more likely it is to be selected for reproduction and generate the next generation of individuals. The calculation formula is:
[0077] : Fitness Function, which represents the individual Fitness in genetic algorithms. It evaluates the quality of individuals. The higher the fitness value, the more superior the individual is and the more likely it is to be selected for the next generation of reproduction.
[0078] in: is the weight of the validation set accuracy; is the weight of the validation set accuracy; is the weight of the number of model parameters, which is used to penalize the complexity of the model and prevent overly complex models from being preferred; Is an individual The highest accuracy of the corresponding model on the validation set; Is an individual The highest accuracy of the corresponding model on the validation set; is the total number of parameters of the model, indicating the complexity of the model.
[0079] The selection operation (Selection) uses the tournament selection method, each time selecting individuals with higher fitness for the next generation. The calculation formula is:
[0080] :individual The probability of being selected for the next generation, that is, the individual The probability of being selected by the selection operation (Selection).
[0081] : The sum of the fitness of all individuals in the current population. This value is used to standardize the fitness value of each individual to ensure that the sum of the selection probabilities of all individuals is 1.
[0082] : The total number of individuals in a population.
[0083] Crossover operation: two parent individuals cross to generate new offspring individuals. When implementing the operation, the genes of the two individuals are mixed in a certain ratio. The calculation formula is:
[0084] in, :Represents the first gene values; through the crossover operation, the gene values of the offspring are selected from the two parent individuals. : Parent individual No. Gene value. : Parent individual No. Gene value. : A randomly generated real number in the range [0,1] used to determine which parent individual to select the gene from. This random number is generated a new one each time and is used to control the inheritance of each gene.
[0085] Mutation operation introduces diversity because some gene values will be randomly disturbed. The calculation formula is:
[0086] :The first After the mutation operation, the gene value may remain unchanged or be replaced by a randomly generated new value.
[0087] : A randomly generated real number in the range [0,1] used to decide whether to A gene mutates.
[0088] : Mutation probability, which indicates the probability of each gene value mutating. Less than , a mutation occurs; otherwise, the gene remains unchanged.
[0089] Fitness Evaluation: In each generation of the genetic algorithm, the fitness of the newly generated individuals is evaluated, and the evaluation method is consistent with the initialized fitness function. Iteration: Genetic algorithms continuously iterate to generate a new generation of populations through operations such as selection, crossover, and mutation. The calculation formula is:
[0090] :Indicates the The population of the generation is the new generation population after the current iteration.
[0091] :Indicates the current Generation population.
[0092] : Selection operation (Selection), select the best individual from the current population according to the fitness function to reproduce the next generation.
[0093] : Mutation operation randomly perturbs individual genes in the population to introduce diversity and prevent the population from converging prematurely.
[0094] : Crossover operation, which performs genetic recombination on parent individuals to generate new offspring individuals The termination condition can be reaching the preset maximum number of iterations or when the model converges. After the genetic algorithm finds the optimal individual, it retrains the model using these hyperparameters and evaluates it on the test set.
[0095] Specifically, the optimization goal of the model needs to reduce the number of model parameters as much as possible while meeting the model accuracy requirements; the decision variables are the hyperparameters of the 1D-CNN model, and the constraints are to ensure the legality and rationality of the decision variables. The details are as follows: Objective function:
[0096] in: is the accuracy of the model on the validation set; is the accuracy of the model on the validation set; is the total number of parameters of the model; is the maximum number of parameters allowed; , and is a weight parameter used to balance the trade-off between accuracy, precision and the number of model parameters.
[0097] Decision variable: number of filters in the nth convolutional layer: , the dilation rate (also called expansion rate) of the nth convolutional layer: , Dropout rate: , learning rate: , number of convolutional layers: .
[0098] Decision variables have a direct impact on the accuracy, precision and number of model parameters. By adjusting decision variables, genetic algorithms can explore different model structures to maximize the accuracy and precision of the validation set and minimize the number of model parameters to meet the requirements of the objective function. These decision variables jointly determine the complexity, learning ability, generalization performance and resource consumption of the model, and are key parameters in the model optimization process.
[0099] Specifically, during the genetic algorithm optimization process, a group of initial individuals are first randomly generated, each of which represents a specific 1D-CNN hyperparameter combination. Then, crossover, mutation, and selection are performed iteratively to gradually optimize the model parameters so that the model can effectively detect fault arcs under different loads.
[0100] The genetic algorithm process is as follows: 1. Initialize the population , each individual Contains model hyperparameters.
[0101] 2. For each individual in the population Calculating fitness .
[0102] 3. According to fitness Select individuals from the population for crossover operation to generate new offspring.
[0103] 4. Perform mutation operations on the newly generated offspring.
[0104] 5. Calculate the fitness of the offspring and form the next generation population together with the parent generation.
[0105] 6. Repeat steps 3-5 until the number of iterations is reached or the convergence condition is met.
[0106] 7. Retrain the model using the hyperparameters of the optimal individual and evaluate it on the test set.
[0107] S13: The arc fault detection model is trained using the voltage data set to optimize the model parameters, and the model performance of the arc fault detection model is evaluated.
[0108] Optionally, the arc fault detection model includes: multiple layers of one-dimensional convolutional layers, pooling layers, dropout layers and fully connected layers.
[0109] Optionally, after the step of iterating the hyperparameter combination of the fault arc detection model through the genetic algorithm, it also includes: using a cosine annealing learning rate scheduling function to adjust the learning rate in the hyperparameter combination to reduce the learning rate of the fault arc detection model to complete model convergence.
[0110] Specifically, based on the optimal hyperparameter combination found by the genetic algorithm, the fault arc detection model (ie, 1D-CNN model) required by this embodiment is constructed. represents the number of filters, represents the expansion rate, represents the learning rate, Represents the Dropout rate. The model consists of multiple layers of one-dimensional convolutional layers (Conv1D), pooling layers (MaxPooling1D) and Dropout layers, and finally outputs the prediction results through the fully connected layer (Dense). The fault arc detection model contains a variable number of convolutional layers, each of which is configured with a different number of filters and expansion rates to extract multi-level features of the input data (i.e., the collected voltage signal data). The pooling layer is used for feature downsampling to reduce computational complexity and prevent overfitting; the Dropout layer further improves the generalization ability of the model by randomly discarding some neurons (model training data, voltage signal data). In order to further optimize the model training process, the cosine annealing learning rate scheduling function is used to gradually reduce the learning rate of the model during the training process, which promotes a more stable convergence of the model.
[0111] Optionally, the step of training, optimizing and evaluating the fault arc detection model through the voltage data set to confirm the model performance of the fault arc detection model includes: training the fault arc detection model using the training set in the voltage data set, and adjusting the model parameters of the fault arc detection model through the validation set; evaluating the trained fault arc detection model on the test set to obtain the model performance of the fault arc detection model, wherein the model performance includes accuracy, precision, recall rate and F1 score.
[0112] Specifically, the 1D-CNN model optimized by genetic algorithm is used to train the fault arc detection task. The model hyperparameters are optimized by genetic algorithm, with a population size of 10, an evolutionary generation of 30, a crossover probability of 0.5, and a mutation probability of 0.2. First, different combinations of model hyperparameters (the number of convolutional layers, the number of filters, the expansion rate, the dropout rate, and the learning rate) are generated, and then each hyperparameter combination is trained and evaluated, and the verification accuracy and precision are calculated using the validation set. The fitness value of each combination is calculated according to the objective function (calculated by formula 14), and the fitness value is used to guide the genetic algorithm to select a better hyperparameter combination.
[0113] It should be noted that the arc fault detection model is trained using the training set, and the model parameters are adjusted through the validation set to ensure its good performance on unseen data. Finally, the trained model is fully evaluated on the test set, and the accuracy, precision, recall and F1 score are calculated and reported to comprehensively measure the model performance; the closer the accuracy, precision, recall and F1 score are to 1, the better the model performance.
[0114] For the performance indicators of the 14 models corresponding to the above 14 experiments, please refer to Tables 5 and 6.
[0115] Table 5. Model performance index 1
[0116] Table 6. Model performance index 2
[0117] Specifically, all the data are integrated to obtain 16640 samples in the training set, 2256 samples in the validation set, and 2256 samples in the test set. This data set is used to train the fault arc detection model to obtain the final fault arc detection model (i.e., a comprehensive model, including single load, double load, and multiple loads, etc.).
[0118] The optimal individual combination obtained by genetic algorithm (the optimal hyperparameter combination obtained by genetic algorithm, that is, the best hyperparameter, which can obtain the fault arc detection model with the highest accuracy and the smallest model parameters) is: [21, 19, 18, 58, 57, 3, 3, 2, 5, 1, 0.048134441876729994,0.0017493494477751445, 3]. The number of filters in the convolutional layer gradually decreases from 21 in the first layer to 18 in the third layer, reflecting the hierarchical and complexity control when extracting features. The choice of expansion rate (3, 3, 2) further enhances the model's ability to capture features at different scales. The relatively low Dropout rate (0.0481) indicates that the model does not need strong regularization on the current dataset, and the learning rate of 0.00175 ensures the stability of the training process. The setting of three convolutional layers not only maintains the complexity of the model but also avoids over-complexity, showing a good balance between complexity and performance. Therefore, this combination is reasonable and effective. The parameters of the comprehensive model are shown in Table 7.
[0119] Table 7. Parameters of the comprehensive model
[0120] Note: “-” means no content.
[0121] The loss value and accuracy change curve are as follows Figure 6 As shown in the figure, the arc fault detection model constructed based on the optimal hyperparameter combination obtained by the genetic algorithm performs very consistently during the training and validation process. The training loss and validation loss gradually decrease with the increase in the number of training rounds, and tend to stabilize after 20 rounds, and the gap between the two is small, indicating that the arc fault detection model has no obvious overfitting phenomenon. The training accuracy and validation accuracy also increase rapidly, and tend to approach 1.0 after 20 rounds, further proving the high prediction accuracy and good generalization ability of the arc fault detection model. Overall, the model has been fully trained and achieved the ideal effect, and can be effectively generalized to unseen data.
[0122] This embodiment uses the 1D-CNN model optimized by genetic algorithm to train the fault arc detection task (that is, after obtaining the optimal hyperparameter combination of the model through genetic algorithm, the model is trained through the voltage data set, and finally a fault arc detection model capable of fault arc detection is obtained). In the model training process, the cosine annealing learning rate scheduling function is used to improve the training effect and generalization ability of the model. The training data comes from the voltage signal data collected by the experimental platform. The hyperparameters of the model are iteratively optimized through the genetic algorithm, so that the obtained fault arc detection model can show good detection effect at a low sampling rate.
[0123] The model has an accuracy of 0.9969, a precision of 0.9965, a recall of 0.9974, an F1 score of 0.9969, and a total number of parameters of 6371. Figure 7 As shown in the confusion matrix, it can be seen that the model performs very well in the fault identification task. Specifically, the model can accurately identify 1101 samples that are actually non-faulty, and only 5 non-faulty samples are misclassified as faulty, that is, the false alarm rate is extremely low. At the same time, the model can correctly detect 1136 samples that are actually faulty, and only 6 faulty samples are misclassified as non-faulty, that is, the false alarm rate is also very low. This shows that the model has extremely high precision and recall in the fault identification task, and can accurately distinguish between faulty and non-faulty samples in most cases.
[0124] From the model performance comparison in Table 8, it can be seen that GA-1DCNN has significant advantages over traditional 1D-CNN in all indicators. GA-1DCNN requires fewer parameters, 6371, which is only about 13% of 1D-CNN, greatly reducing the computational complexity and storage requirements. While reducing the number of parameters, the accuracy, precision, recall and F1-score are significantly improved. Specifically, the accuracy of GA-1DCNN reaches 99.69%, the precision and recall are 99.65% and 99.73% respectively, and the F1-score is 0.9969, all of which are better than traditional 1D-CNN. GA-1DCNN maintains high performance while reducing the number of parameters, showing better lightweight characteristics and excellent classification capabilities, making it particularly suitable for resource-constrained application scenarios.
[0125] Table 8. Calculation results of different models
[0126] Optionally, after the step of training, optimizing and evaluating the arc fault detection model through the voltage data set to confirm the model performance of the arc fault detection model, the method further includes: converting the arc fault detection model into a C array format .h file and deploying it to a microcontroller to perform real-time detection of arc faults.
[0127] Specifically, in order to verify the actual application effect of the fault arc detection model on embedded devices, the optimized model is deployed to the embedded controller for testing. Since the number of model parameters and computational complexity have been greatly reduced, the fault arc detection task can be run in real time on resource-constrained embedded platforms. For example, the trained fault arc detection model is first converted to TFlite format, then the .TFlite file is converted to a C array format .h file, and finally the model is deployed to the microcontroller to detect the fault arc.
[0128] like Figure 8 The present invention also provides a fault arc detection method, comprising: S21: Obtain the voltage signal to be detected.
[0129] In one embodiment, the voltage signal is converted by a current transformer to obtain a current signal in a circuit in real time; in other embodiments, a voltage signal acquisition device can be used to directly acquire the voltage signal in the circuit, which is not limited here.
[0130] S22: Inputting the voltage signal to be detected into a fault arc detection model for detection to obtain a fault arc detection result.
[0131] Specifically, after the voltage signal to be detected is input into the fault arc detection model, the model detects the voltage signal to be detected to confirm whether there is a fault feature (or fault arc feature) in the voltage signal to be detected. If there is a fault feature, the fault arc is confirmed according to the fault feature, and the fault arc information is output to inform the user that a fault arc occurs in the circuit; if there is no fault feature, normal information is output.
[0132] It should be noted that the arc fault detection model is trained according to any one of the methods described in the above embodiments.
[0133] The present invention also provides a fault arc detection device, which includes: a memory and a processor, wherein a fault arc detection program is stored in the memory, and when the fault arc detection program is executed by the processor, it is used to implement the steps of the fault arc detection method described above.
[0134] For example, a fault arc detection circuit is provided with a current transformer, a data acquisition card, a microcontroller, etc. The current transformer can obtain the current signal in the circuit in real time, and then convert the current signal into a voltage signal output; the data acquisition card performs voltage sampling at a sampling frequency of 12.5kHz (which can be adjusted according to actual needs), and transmits the collected voltage signal data to the microcontroller; the microcontroller is provided with a fault arc detection model, and after receiving the voltage signal data, the fault arc detection model is used to analyze and identify it to determine whether an arc fault occurs in the circuit.
[0135] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a portion of the steps in the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0136] The preferred embodiments of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the specific details in the above embodiments. The above embodiments and drawings are exemplary. The modules or processes in the drawings are not necessarily required to implement the embodiments of the present invention and cannot be understood as limitations on the present invention. Within the technical concept of the present invention, the technical scheme of the present invention can be subjected to a variety of simple modifications and combinations, and these simple modifications and combinations all belong to the protection scope of the present invention.
Claims
1. A method for training a fault arc detection model, characterized in that: include: Acquire a voltage data set, where the voltage data set includes a training set, a validation set, and a test set; Acquire the optimal hyperparameter combination of the fault arc detection model through a genetic algorithm, and construct the fault arc detection model based on the optimal hyperparameter combination; The arc fault detection model is trained using the voltage data set to optimize model parameters and evaluate model performance of the arc fault detection model.
2. The arc fault detection model training method according to claim 1, characterized in that: The steps to obtain the voltage dataset include: According to different load conditions, current transformers are used to obtain current signals, and the current signals are converted into voltage signals, and the voltage signals are standardized.
3. The arc fault detection model training method according to claim 2, characterized in that: After the step of normalizing the voltage signal, the method further comprises: The voltage signal is split into one cycle as one data sample according to a preset alarm performance indicator to construct the voltage data set.
4. The arc fault detection model training method according to claim 1, characterized in that: The steps of obtaining the optimal hyperparameter combination of the fault arc detection model by using the genetic algorithm include: Iterating a hyperparameter combination of the arc fault detection model by the genetic algorithm, wherein the hyperparameter combination includes the number of convolutional layers, the number of filters, a dilation rate, a dropout rate, and a learning rate; After satisfying the iteration termination condition, the final hyperparameter combination of the fault arc detection model is obtained, and the final hyperparameter combination is used as the optimal hyperparameter combination. The iteration termination condition includes reaching a preset maximum number of iterations and model convergence.
5. The arc fault detection model training method according to claim 1, characterized in that: After the step of iterating the hyperparameter combination of the arc fault detection model by the genetic algorithm, the method further includes: A cosine annealing learning rate scheduling function is used to dynamically adjust the learning rate in the hyperparameter combination to promote the arc fault detection model to complete model convergence.
6. The arc fault detection model training method according to claim 1 or 4, characterized in that: The fault arc detection model includes: multiple layers of one-dimensional convolutional layers, pooling layers, Dropout layers and fully connected layers.
7. The arc fault detection model training method according to claim 1, characterized in that: The step of training, optimizing and evaluating the arc fault detection model through the voltage data set to confirm the model performance of the arc fault detection model includes: Using the training set in the voltage data set to train the arc fault detection model, and adjusting the model parameters of the arc fault detection model through the validation set; The trained arc fault detection model is evaluated on the test set to obtain the model performance of the arc fault detection model, wherein the model performance includes accuracy, precision, recall rate and F1 score.
8. The arc fault detection model training method according to claim 1, characterized in that: After the step of training, optimizing and evaluating the arc fault detection model through the voltage data set to confirm the model performance of the arc fault detection model, the method further comprises: The arc fault detection model is converted into a C array format .h file and deployed in a microcontroller to perform real-time detection of arc faults in the circuit.
9. A fault arc detection method, characterized in that: include: Acquire a voltage signal to be detected; Inputting the voltage signal to be detected into a fault arc detection model for detection to obtain a fault arc detection result; Wherein, the arc fault detection model is trained according to the method described in any one of claims 1 to 8.
10. A fault arc detection device, characterized in that: The arc fault detection device comprises: a memory and a processor, wherein the memory stores an arc fault detection program, and the arc fault detection program is used to implement the steps of the arc fault detection method as claimed in claim 9 when executed by the processor.
Citation Information
Patent Citations
Arc detection method for optimizing residual network model based on genetic algorithm
CN114152844A
Fault arc detection method and system and storage medium
CN116298725A
Fault arc detection method based on one-dimensional dilated convolutional neural network
CN116990648A
Power distribution network fault detection method and device
CN118587528A
Hybrid power transmission line fault type identification method based on traveling wave diagnosis and machine vision detection
CN119064712A
Cited By
Photovoltaic abnormal DC arc detection method and system
CN120507615A
