Series arc fault detection method and computer readable storage medium
Through the dual-channel convolutional neural network and the sparrow search algorithm-support vector machine model, the one-dimensional and two-dimensional signal processing is integrated, and the problem of insufficient arc fault detection of single-channel convolutional neural network is solved, and the fault detection of electrical system is improved Accuracy and robustness improve the safety of the electrical system.
Patent Information
- Application Number
- CN202410991141.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-11-12
AI Technical Summary
A single-channel convolutional neural network has low detection accuracy when dealing with series arc discharge fault detection, making it difficult to capture complex nonlinear and non-stationary timing signal characteristics, and there are shortcomings in multi-scale and multi-dimensional feature extraction, which affects fault detection. accuracy.
Using a dual-channel convolutional neural network combined with a sparrow search algorithm and a support vector machine, the fused current characteristics are integrated through one-dimensional and two-dimensional signal processing, and the support vector machine parameters are optimized by using a sparrow search algorithm to build a network model to improve the accuracy and robustness of fault diagnosis. sex.
It significantly improves the accuracy and robustness of electrical system fault detection, and is suitable for industrial electrical systems, home electrical equipment and transportation, etc., and improves the safety and reliability of electrical systems.
Smart Images

Figure CN118940133A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electrical systems, and in particular to a detection method for a series arc fault and a computer-readable storage medium. Background Art
[0002] Series arc discharge fault is one of the common and dangerous fault types in electrical systems. When it occurs, it will generate high temperature and strong light, which can easily cause fire and equipment damage.
[0003] Traditional detection methods for series arc discharge faults mainly rely on manual experience and simple signal processing technology. It is difficult to effectively extract the current characteristic information of the arc and is easily interfered by noise, resulting in low detection accuracy of arc faults. In recent years, with the development of machine learning and deep learning technologies, data-driven fault detection methods have gradually attracted attention. Among them, Convolutional Neural Networks (CNN), as a deep learning model, has powerful feature extraction capabilities and has achieved remarkable results in image recognition, speech recognition and other fields.
[0004] However, single-channel convolutional neural networks still have certain limitations when dealing with the problem of series arc discharge fault detection. First, the timing signal of the arc discharge fault has strong nonlinearity and non-stationarity, and a single-channel convolutional neural network is difficult to fully capture its complex characteristics. Secondly, when faced with multi-scale and multi-dimensional features, the traditional convolutional neural network structure may have problems with insufficient feature extraction, affecting the accuracy of fault detection. Summary of the invention
[0005] The present invention provides a method for detecting a series arc fault and a computer-readable storage medium to solve the problem of low detection accuracy of a single-channel convolutional neural network model when processing the problem of series arc discharge fault detection.
[0006] In a first aspect, the present invention provides a method for detecting a series arc fault, wherein the method comprises:
[0007] Acquire the current timing signal in the electrical system and perform preprocessing;
[0008] Converting the current time series signal into a two-dimensional feature image data set;
[0009] The parameters of the support vector machine are optimized using the sparrow search algorithm, and a dual-channel convolutional neural network and a sparrow search algorithm-support vector machine network model are constructed;
[0010] The network model of convolutional neural network and sparrow search algorithm-support vector machine is trained based on the current time series signal and two-dimensional feature image data set;
[0011] The current timing signal and the two-dimensional feature image data set are input to the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, and the network model of the convolutional neural network and the sparrow search algorithm-support vector machine outputs the fault diagnosis result.
[0012] Optionally, a current timing signal in the electrical system is obtained and preprocessed, including:
[0013] The current time series signal in the electrical system is collected according to a preset sampling rate, the current time series signal is filtered by a low-pass filter, and the filtered current time series signal is scaled.
[0014] Optionally, the current time series signal is converted into a two-dimensional feature image data set, including:
[0015] The current time series signal is converted into a two-dimensional feature image data set through Gram angle and field encoding.
[0016] Optionally, the network model of the convolutional neural network and the sparrow search algorithm-support vector machine is trained based on the current time series signal and the two-dimensional feature image data set, including:
[0017] The two-dimensional feature image dataset and current timing signal are divided into training dataset, verification dataset and test dataset in the ratio of 7:2:1 respectively. The network models of convolutional neural network and sparrow search algorithm-support vector machine are trained based on the training dataset.
[0018] Optionally, after training the network models of the convolutional neural network and the sparrow search algorithm-support vector machine based on the training data set, the following steps are also included:
[0019] The network models of convolutional neural network and sparrow search algorithm-support vector machine were verified and performance evaluated based on the verification data set and test data set.
[0020] Optionally, the network model of the convolutional neural network and the sparrow search algorithm-support vector machine is trained based on the training data set, including:
[0021] Input the training data set to the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, and calculate the first prediction output of the network model;
[0022] Calculate a value of a loss function according to the first predicted output and the first true label, and measure the difference between the first predicted output and the first true label by the value of the loss function;
[0023] The gradient of the loss function is calculated based on the difference between the first predicted output and the first true label, and the parameters of the network model are updated based on the gradient.
[0024] Optionally, verify and evaluate the performance of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine based on the validation data set and the test data set, including:
[0025] Input the validation data set into the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, and calculate the second prediction output of the network model;
[0026] Calculate the value of the loss function and the performance indicator based on the second true label and the second predicted output;
[0027] The hyperparameters of the network models of the convolutional neural network and the sparrow search algorithm-support vector machine are adjusted according to the value of the loss function and the performance index; and the above hyperparameters are saved as the optimal model parameters.
[0028] Optionally, the hyperparameters of the network models of the convolutional neural network and the sparrow search algorithm-support vector machine are adjusted according to the value of the loss function and the performance index; and after the hyperparameters are saved as the optimal model parameters, the following steps are included:
[0029] Input the test data set to the network model of the convolutional neural network and the sparrow search algorithm-support vector machine; and calculate the third prediction output of the network model;
[0030] Calculate a value of a loss function and a performance indicator based on the third true label and the third predicted output;
[0031] The generalization ability of the network model is evaluated based on the value of the loss function and performance indicators.
[0032] Optionally, the loss function includes a cross entropy loss function or a mean square error loss function.
[0033] In a second aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute the method for detecting a series arc fault provided in the first aspect.
[0034] The technical solution of the present invention adopts a dual-channel convolutional neural network. The one-dimensional convolutional neural network processes the features of the original current time series signal, and the two-dimensional neural network receives a two-dimensional feature image data set and performs feature extraction. The current features extracted by the two channels are fused in the convergence layer, and the fused feature vector is input into the support vector machine classifier optimized by the sparrow search algorithm for fault mode classification. The technical solution of the embodiment of the present invention comprehensively utilizes information in different signal expression forms. And fully utilizes the image recognition capability of the deep learning model to improve the accuracy and robustness of fault diagnosis. This technical solution is applicable to a variety of scenarios such as industrial electrical systems, household electrical equipment, and transportation, and significantly improves the safety and reliability of electrical systems.
[0035] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0037] Figure 1 is a flow chart of a method for detecting a series arc fault provided by an embodiment of the present invention;
[0038] Figure 2 It is a schematic diagram of the architecture of a convolutional neural network model provided by an embodiment of the present invention;
[0039] Figure 3 Schematic diagram of an optimal classification hyperplane of a support vector machine provided by an embodiment of the present invention;
[0040] Figure 4 It is a flow chart of arc fault detection using a network model of a convolutional neural network and a sparrow search algorithm-support vector machine provided by an embodiment of the present invention;
[0041] Figure 5 is a flow chart of another method for detecting a series arc fault provided by an embodiment of the present invention;
[0042] Figure 6 is a flow chart of another method for detecting a series arc fault provided by an embodiment of the present invention;
[0043] Figure 7 is a flow chart of another method for detecting a series arc fault provided by an embodiment of the present invention;
[0044] Figure 8 is a flow chart of a method for detecting a series arc fault provided by an embodiment of the present invention;
[0045] Fig. 9 It is a flow chart of a network model training method of a convolutional neural network and a sparrow search algorithm-support vector machine provided by an embodiment of the present invention;
[0046] Fig.10 It is a flow chart of a network model verification method of a convolutional neural network and a sparrow search algorithm-support vector machine provided by an embodiment of the present invention;
[0047] Fig.11 It is a flow chart of a network model evaluation method of a convolutional neural network and a sparrow search algorithm-support vector machine provided by an embodiment of the present invention;
[0048] Fig.12 A schematic structural diagram of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0049] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0050] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0051] Figure 1 is a flow chart of a method for detecting a series arc fault provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes:
[0052] S100: Acquire the current timing signal in the electrical system and perform preprocessing.
[0053] Specifically, the current time series signal in the electrical system is collected in real time. For example, the current time series signal in the electrical system can be collected by connecting a current sensor to an external resistor. The acquired current time series signal is preprocessed. For example, the preprocessing operation can include removing noise and interference.
[0054] S110: Convert the current time series signal into a two-dimensional feature image data set.
[0055] Specifically, the current time series signal acquired in real time is converted into a two-dimensional feature image data set, and the two-dimensional feature image data set can contain rich current feature information.
[0056] S120: Optimize the parameters of the support vector machine using the sparrow search algorithm, and construct a network model of a dual-channel convolutional neural network and a sparrow search algorithm-support vector machine.
[0057] In the embodiment of the present invention, the support vector machine (SVM) is a supervised learning method for statistical classification and regression analysis in small samples, and an optimal classification hyperplane is found to segment the samples according to the principle of structural risk minimization.
[0058] Sparrow Search Algorithm (SSA) is a new swarm intelligence optimization algorithm inspired by the foraging and anti-predation behaviors of sparrows. There are two behavioral strategies in the foraging process of sparrows. One is the finder as the leader of the sparrows, which has a wide search range and high fitness, and guides other individuals in the sparrows to find food and the best location. The other is the joiner. In order to improve its own predation rate, the joiner will monitor the finder and compete with individuals with high predation rates for food to improve its own nutrition. The position update formula of the finder is as follows:
[0059]
[0060] Among them, t represents the current number of iterations, and M represents the maximum number of iterations; The location information of the i-th sparrow in the j-th dimension also represents the latest location information of the discoverer. represents the location information of the discoverer at the last moment; α represents a random number (0,1]; Q represents a random number with normal distribution; L represents a 1*D matrix whose elements are all 1. R2 represents the warning value, and ST represents the safety value. When R2<ST, it means that the group environment is in a safe state and no predator is found around. The discoverer can search in a wide range to obtain higher fitness. When R2>ST, it means that an individual in the group has discovered a predator and issued a warning. The population adjusts the search strategy, and the discoverer guides the joiner to move to a safe position. The position update formula of the joiner is as follows:
[0061]
[0062] Among them, t represents the current number of iterations, and M represents the maximum number of iterations; Indicates the latest location information of the discoverer. Indicates the location information of the discoverer at the last moment; α indicates a random number (0,1]; represents the current worst position; A represents a 1*D matrix whose elements are only 1 or -1, and A + =A T (AA T ) -1 Q represents a random number with normal distribution; L represents a 1*D matrix whose elements are all 1. represents the latest position of the pth sparrow. n represents the number of sparrows in the population. When , the i-th joiner does not get food and needs to fly elsewhere to search for food. When , the i-th joiner will search for food near the current best position.
[0063] When the participants realize the danger, the sparrow population will take anti-predator actions. The mathematical expression is as follows:
[0064]
[0065] in, Represents the current global optimal value; Indicates the current global worst value, Indicates the latest location information of the discoverer. represents the location information of the discoverer at the last moment; β represents the step size parameter, which is a random number with a mean and variance of 1 and a normal distribution of 0; K represents a random number, K∈(0,1]; f i and f g Respectively represent the best and worst fitness values in the current range; ε represents the smallest real number that prevents the denominator from being 0. i ≠f gWhen f , it means that the individuals at the population boundary of the sparrow population are aware of the danger and need to adjust their positions. i =f g , it indicates that individuals within the population are aware of the danger.
[0066] Figure 2 The following is a schematic diagram of the architecture of a convolutional neural network model provided by an embodiment of the present invention. The convolutional neural network is a deep learning architecture that extracts features of a target through multiple filters. The basic structure of a typical convolutional neural network is as follows: Figure 2 As shown in the figure, it is mainly composed of convolutional layers, pooling layers, fully connected layers and output layers. The convolutional layer uses many convolution kernels as local filters to slide over the input neurons of the previous layer for convolution, and then generates various feature maps. The main purpose of the pooling layer is to downsample, which can effectively prevent the risk of overfitting. Common pooling methods include maximum pooling, random pooling and average pooling. The fully connected layer further extracts features from the feature map after the convolution pooling operation, connects it into a one-dimensional vector and inputs it into the normalized exponential (Softmax) function for classification.
[0067] The sparrow search algorithm is used to optimize the parameters of the support vector machine to improve the classification accuracy of the model, thereby constructing a network model of a dual-channel convolutional neural network and a sparrow search algorithm-support vector machine. The network model of the dual-channel convolutional neural network and the sparrow search algorithm-support vector machine includes a one-dimensional neural network and a two-dimensional neural network. The one-dimensional neural network includes a one-dimensional channel, and the two-dimensional neural network includes a two-dimensional channel.
[0068] S130: Training the network model of the convolutional neural network and the sparrow search algorithm-support vector machine based on the current time series signal and the two-dimensional feature image data set.
[0069] Specifically, part of the data of the current time series signal is used as a one-dimensional training data set, and part of the data of the two-dimensional feature image data set is used as a two-dimensional training data set. The one-dimensional training data set is input into the one-dimensional channel of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, and the two-dimensional training data set is input into the two-dimensional channel to train the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, so as to improve the performance of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine on the training data.
[0070] Figure 3 is a schematic diagram of an optimal classification hyperplane of a support vector machine provided by an embodiment of the present invention, such as Figure 3 As shown, for the classification problem of support vector machine, for example, the training data set T = {(x1, y1), (x2, y2), ..., (x n ,y n )}, where the input feature vector x i∈R n , classification label y i ∈{-1,+1}, the support vector machine can determine an optimal classification hyperplane H according to the sample characteristics of each training data set T. The data expression can be expressed as:
[0071] ω T x+b=0
[0072] Among them, ω represents the normal vector of the hyperplane; represents the intercept. ω and b determine the distance between the origin and the hyperplane. The optimized classification hyperplane is obtained by maximizing the distance between different classes.
[0073] S140: Input the current timing signal and the two-dimensional feature image data set to the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, and the network model of the convolutional neural network and the sparrow search algorithm-support vector machine outputs the fault diagnosis result.
[0074] Specifically, the current time series signal collected in real time is input into the one-dimensional channel of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, and the two-dimensional feature image data set is input into the two-dimensional channel of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine. The convolutional neural network extracts current features based on the current time series signal and the two-dimensional feature image data set, and fuses the current features into the support vector machine classifier optimized by the sparrow search algorithm for fault mode classification, and judges the acquired suspected arc fault samples to identify whether there is an arc fault.
[0075] Figure 4 FIG. 1 is a flow chart of arc fault detection using a network model of a convolutional neural network and a sparrow search algorithm-support vector machine provided by an embodiment of the present invention, such as Figure 4 As shown in the figure, the current time series signal and the two-dimensional feature image data set are respectively input into the input layer of the convolutional neural network, and the current time series signal and the two-dimensional feature image data set are respectively passed through the convolution layer, the pooling layer and the fully connected layer. The fully connected layer further extracts features from the feature map after the convolution and pooling operation, and fuses the current feature information extracted from the dual channels in the pooling layer, and then passes through the random inactivation (Dropout) layer and the fully connected layer, and then output to the support vector machine classifier optimized by the sparrow search algorithm for fault mode classification, and the obtained suspected arc fault samples are judged to identify whether there is an arc fault.
[0076] The technical solution of the embodiment of the present invention adopts a dual-channel convolutional neural network. The one-dimensional convolutional neural network processes the features of the original current time series signal, and the two-dimensional neural network receives a two-dimensional feature image data set and performs feature extraction. The current features extracted by the two channels are fused in the convergence layer, and the fused feature vector is input into the support vector machine classifier optimized by the sparrow search algorithm for fault mode classification. The technical solution of the embodiment of the present invention comprehensively utilizes information in different signal expression forms. And fully utilizes the image recognition capability of the deep learning model to improve the accuracy and robustness of fault diagnosis. This technical solution is applicable to a variety of scenarios such as industrial electrical systems, household electrical equipment, and transportation, and significantly improves the safety and reliability of electrical systems.
[0077] Optionally, based on the above embodiment, Figure 5 is a flow chart of another method for detecting a series arc fault provided by an embodiment of the present invention, such as Figure 5 As shown, the method includes:
[0078] S200: collecting current time series signals in the electrical system at a preset sampling rate, filtering the current time series signals using a low-pass filter, and scaling the filtered current time series signals.
[0079] Specifically, the preset sampling rate is preset according to the actual situation. For example, the preset sampling rate can be set to 200Hz. The current time series signal of the electrical system is collected in real time according to the preset sampling rate, and the collected current time series signal is smoothed by a low-pass filter to remove high-frequency noise and retain the low-frequency components where the fault characteristics are located. According to the preset standardization method, the filtered signal is further scaled to ensure that all current time series signal data have consistent data distribution and range.
[0080] S210: Convert the current time series signal into a two-dimensional feature image data set.
[0081] S220: Use the sparrow search algorithm to optimize the parameters of the support vector machine and construct a network model of a dual-channel convolutional neural network and a sparrow search algorithm-support vector machine.
[0082] S230: Training the network model of the convolutional neural network and the sparrow search algorithm-support vector machine based on the current time series signal and the two-dimensional feature image data set.
[0083] S240: Input current timing signals and two-dimensional feature image data sets to the network model of convolutional neural network and sparrow search algorithm-support vector machine, and the network model of convolutional neural network and sparrow search algorithm-support vector machine outputs fault diagnosis results.
[0084] Optionally, based on the above embodiments, Figure 6 is a flow chart of another method for detecting a series arc fault provided by an embodiment of the present invention, such as Figure 6 As shown, the method includes:
[0085] S300: Acquire the current timing signal in the electrical system and perform preprocessing.
[0086] S310: Convert the current time series signal into a two-dimensional feature image data set through Gram angle and field coding.
[0087] In an embodiment of the present invention, Gramian Angular Summation Field (GASF) is a technology for converting time series data into image representation. By standardizing the time series data and constructing a Gramian matrix, the angle information therein is extracted and converted into sine and cosine values, and finally a two-dimensional feature image is generated. This image retains the time dependency and dynamic characteristics of the original data, is suitable for the input of a deep learning model, and is particularly suitable for tasks that require processing complex time structures.
[0088] Specifically, the collected one-dimensional current time series signal is converted into a two-dimensional feature image data set through Gram angle and field coding. The Gram angle and field coding method can effectively amplify the intrinsic characteristics of the arc fault, thereby forming a two-dimensional feature image data set containing rich information.
[0089] S320: Optimize the parameters of the support vector machine using the sparrow search algorithm, and construct a network model of a dual-channel convolutional neural network and a sparrow search algorithm-support vector machine.
[0090] S330: Training the network model of the convolutional neural network and the sparrow search algorithm-support vector machine based on the current timing signal and the two-dimensional feature image data set.
[0091] S340: Input current timing signals and two-dimensional feature image data sets to the network model of convolutional neural network and sparrow search algorithm-support vector machine, and the network model of convolutional neural network and sparrow search algorithm-support vector machine outputs fault diagnosis results.
[0092] Optionally, based on the above embodiments, Figure 7 is a flow chart of another method for detecting a series arc fault provided by an embodiment of the present invention, such as Figure 7 As shown, the method includes:
[0093] S400: Acquire the current timing signal in the electrical system and perform preprocessing.
[0094] S410: Convert the current time series signal into a two-dimensional feature image data set.
[0095] S420: Optimize the parameters of the support vector machine using the sparrow search algorithm, and construct a network model of a dual-channel convolutional neural network and a sparrow search algorithm-support vector machine.
[0096] S430: Divide the two-dimensional feature image data set and the current timing signal into a training data set, a verification data set and a test data set in a ratio of 7:2:1, and train the network model of the convolutional neural network and the sparrow search algorithm-support vector machine based on the training data set.
[0097] Specifically, the current timing signal is divided into a one-dimensional training data set, a one-dimensional verification data set and a one-dimensional test data set in a ratio of 7:2:1. The two-dimensional feature image data set is divided into a two-dimensional training data set, a two-dimensional verification data set and a two-dimensional test data set in a ratio of 7:2:1. The one-dimensional training data set is input into the one-dimensional channel of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, and the two-dimensional training data set is input into the two-dimensional channel to train the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, so as to improve the performance of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine on the training data.
[0098] S440: Input the current timing signal and the two-dimensional feature image data set to the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, and the network model of the convolutional neural network and the sparrow search algorithm-support vector machine outputs the fault diagnosis result.
[0099] Optionally, based on the above embodiments, Figure 8 is a flow chart of a method for detecting a series arc fault provided by an embodiment of the present invention, such as Figure 8 As shown, the method includes:
[0100] S500: Acquire the current timing signal in the electrical system and perform preprocessing.
[0101] S510: Convert the current time series signal into a two-dimensional feature image data set.
[0102] S520: Optimize the parameters of the support vector machine using the sparrow search algorithm, and construct a network model of a dual-channel convolutional neural network and a sparrow search algorithm-support vector machine.
[0103] S530: Training the network model of the convolutional neural network and the sparrow search algorithm-support vector machine based on the current time series signal and the two-dimensional feature image data set.
[0104] S540: Verify and evaluate the performance of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine based on the verification data set and the test data set.
[0105] Specifically, the trained convolutional neural network and sparrow search algorithm-support vector machine network models are evaluated based on the validation data set and the test data set to detect the accuracy and robustness of the model and ensure the effectiveness of the model in practical applications. The hyperparameters of the model are adjusted based on the validation data set to monitor the performance of the model and avoid overfitting. The generalization ability and performance of the model are finally evaluated based on the test data set.
[0106] S550: Input current timing signals and two-dimensional feature image data sets to the network model of convolutional neural network and sparrow search algorithm-support vector machine, and the network model of convolutional neural network and sparrow search algorithm-support vector machine outputs fault diagnosis results.
[0107] Optionally, based on the above embodiments, Fig. 9 : is a flow chart of a network model training method of a convolutional neural network and a sparrow search algorithm-support vector machine provided by an embodiment of the present invention, such as Fig. 9 As shown, the method includes:
[0108] S600: Input the training data set to the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, and calculate the first prediction output of the network model.
[0109] Specifically, the one-dimensional training data set is input into the one-dimensional channel of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, and the two-dimensional training data set is input into the two-dimensional channel. And the first prediction output is calculated based on the one-dimensional training data set and the two-dimensional training data set.
[0110] S610: Calculate a value of a loss function according to the first predicted output and the first true label, and measure the difference between the first predicted output and the first true label by the value of the loss function.
[0111] Specifically, a suitable loss function is selected, and for example, a cross entropy loss function can be selected. The loss function is calculated according to the first predicted output and the first true label to obtain the value of the loss function. The value of the loss function can directly reflect the difference between the first predicted output and the first true label.
[0112] S620: Calculate the gradient of the loss function according to the difference between the first predicted output and the first true label, and update the parameters of the network model according to the gradient.
[0113] Specifically, the gradient information of the loss function is calculated based on the difference between the first predicted output and the first true label, and the various parameters of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine are updated according to the gradient information. Exemplarily, the learning weights and biases of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine can be updated according to the gradient information.
[0114] Repeat the above training steps until the preset training end or convergence condition is reached. Convergence condition is a key point in the model training process, indicating that the model has reached sufficient training and no longer significantly improves its performance or loss function value.
[0115] Optionally, based on the above embodiments, Fig.10 : is a flow chart of a network model verification method of a convolutional neural network and a sparrow search algorithm-support vector machine provided by an embodiment of the present invention, such as Fig.10 As shown, the method includes:
[0116] S700: Input the validation data set into the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, and calculate the second prediction output of the network model.
[0117] Specifically, after each training cycle of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine is completed, the performance of the model is evaluated on the validation data set. The one-dimensional validation data set is input into the one-dimensional channel of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, and the two-dimensional validation data set is input into the two-dimensional channel. And the second prediction output is calculated based on the one-dimensional validation data set and the two-dimensional validation data set.
[0118] S710: Calculate the value of the loss function and the performance index according to the second true label and the second predicted output.
[0119] Specifically, a suitable loss function is selected, and for example, a cross entropy loss function can be selected. The loss function is calculated according to the second true label and the second predicted output to obtain the value of the loss function. The value of the loss function can directly reflect the difference between the second true label and the second predicted output. The performance index is calculated according to the second true label and the second predicted output. For example, the performance index may include accuracy, precision, and recall.
[0120] S720: Adjust the hyperparameters of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine according to the value of the loss function and the performance index; and save the above hyperparameters as the optimal model parameters.
[0121] Specifically, the hyperparameters of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine are adjusted based on the loss function and the performance index. For example, the hyperparameters may be the learning rate and the batch size, etc. The model parameters that perform best on the validation data set are recorded and saved, and the model parameters include weights and biases, etc.
[0122] In the process of model training and parameter tuning, the training data set is used to train the model and fit the parameters, while the validation data set is used to adjust the model's hyperparameters. The model learns the data features in the training data set and updates the parameters through forward propagation and back propagation to minimize the value of the loss function. At the same time, at the end of each training cycle, the model is evaluated on the validation data set to calculate the loss and other performance indicators, monitor the generalization ability of the model, and prevent overfitting or underfitting. According to the performance of the validation data set, adjust the hyperparameters such as learning rate, batch size, etc., and keep saving the best model parameters on the validation data set until the end of training. In the end, the model with the smallest loss on the validation data set is the optimal network model, and it is expected to achieve the best performance in the test data set or actual application.
[0123] Optionally, based on the above embodiments, Fig.11 : is a flow chart of a network model evaluation method of a convolutional neural network and a sparrow search algorithm-support vector machine provided by an embodiment of the present invention, such as Fig.11 As shown, the method includes:
[0124] S800: Input the test data set to the network model of the convolutional neural network and the sparrow search algorithm-support vector machine; and calculate the third prediction output of the network model.
[0125] Specifically, the loss function or other performance indicators on the validation data set are continuously monitored, and the network model of the convolutional neural network and the sparrow search algorithm-support vector machine that performs best on the validation data set is selected as the optimal network model. The optimal network model is evaluated using the test data set. The one-dimensional test data set is input into the one-dimensional channel of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, and the two-dimensional test data set is input into the two-dimensional channel. And the third prediction output is calculated based on the one-dimensional test data set and the two-dimensional test data set.
[0126] S810: Calculate a value of a loss function and a performance indicator according to the third true label and the third predicted output.
[0127] Specifically, a suitable loss function is selected, and for example, a cross entropy loss function can be selected. The loss function is calculated according to the third true label and the third predicted output to obtain the value of the loss function. The value of the loss function can directly reflect the difference between the third true label and the third predicted output. The performance index is calculated according to the third true label and the third predicted output. For example, the performance index may include accuracy, precision, and recall.
[0128] S820: Evaluate the generalization ability of the network model based on the value of the loss function and the performance index.
[0129] Specifically, the performance of the optimal network model on the test data set is analyzed based on the value of the loss function and the performance indicators, and its generalization ability and effect in practical applications are evaluated.
[0130] The loss and accuracy on the entire test dataset can be calculated. Accuracy measures the classification ability of the model, and loss measures the prediction error of the model. Conduct ten independent experiments, record the results of each experiment, and take the average as the final evaluation result to ensure the reliability and stability of the results. Use multiple evaluation indicators, including accuracy, precision, recall, and F1 score, to comprehensively evaluate the performance of the model. Analyze the performance of the model under different fault types and different working conditions to ensure the robustness and generalization ability of the model.
[0131] Optionally, based on the above embodiments, the loss function includes a cross entropy loss function or a mean square error loss function.
[0132] Specifically, when training the network model of the convolutional neural network and the sparrow search algorithm-support vector machine based on the training data set, the cross entropy loss function or the mean square error loss function can be used as the loss function. When verifying the network model of the convolutional neural network and the sparrow search algorithm-support vector machine based on the validation data set, the cross entropy loss function or the mean square error loss function can be used as the loss function. When evaluating the network model of the convolutional neural network and the sparrow search algorithm-support vector machine based on the test data set, the cross entropy loss function or the mean square error loss function can be used as the loss function.
[0133] An embodiment of the present invention provides an electronic device, Fig.12A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0134] like Fig.12 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0135] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0136] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a detection method for a series arc fault.
[0137] In some embodiments, the detection method of a series arc fault may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the detection method of a series arc fault described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the detection method of a series arc fault in any other appropriate manner (e.g., by means of firmware).
[0138] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0139] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0140] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0141] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0142] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0143] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0144] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0145] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting a series arc fault, characterized in that: include: Acquire the current timing signal in the electrical system and perform preprocessing; Converting the current time series signal into a two-dimensional feature image data set; The parameters of the support vector machine are optimized using the sparrow search algorithm, and a dual-channel convolutional neural network and a sparrow search algorithm-support vector machine network model are constructed; Training the network model of the convolutional neural network and the sparrow search algorithm-support vector machine based on the current time series signal and the two-dimensional feature image data set; The current timing signal and the two-dimensional feature image data set are input into the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, and the network model of the convolutional neural network and the sparrow search algorithm-support vector machine outputs a fault diagnosis result.
2. The method for detecting a series arc fault according to claim 1, characterized in that: The method of obtaining the current time sequence signal in the electrical system and performing preprocessing includes: The current time series signal in the electrical system is collected at a preset sampling rate, the current time series signal is filtered by a low-pass filter, and the filtered current time series signal is scaled.
3. The method for detecting a series arc fault according to claim 1, characterized in that: The step of converting the current time series signal into a two-dimensional feature image data set comprises: The current time series signal is converted into the two-dimensional feature image data set through Gram angle and field coding.
4. The method for detecting a series arc fault according to claim 1, characterized in that: The training of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine based on the current time series signal and the two-dimensional feature image data set includes: The two-dimensional feature image data set and the current timing signal are divided into a training data set, a verification data set and a test data set in a ratio of 7:2:1, respectively, and the network model of the convolutional neural network and the sparrow search algorithm-support vector machine is trained based on the training data set.
5. The method for detecting a series arc fault according to claim 4, characterized in that: After training the network model of the convolutional neural network and the sparrow search algorithm-support vector machine based on the training data set, the method further includes: The network model of the convolutional neural network and the sparrow search algorithm-support vector machine is verified and performance evaluated based on the verification data set and the test data set.
6. The method for detecting a series arc fault according to claim 4, characterized in that: The training of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine based on the training data set includes: Inputting the training data set into the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, and calculating the first prediction output of the network model; Calculate a value of a loss function according to the first predicted output and the first true label, and measure the difference between the first predicted output and the first true label by the value of the loss function; The gradient of the loss function is calculated according to the difference between the first predicted output and the first true label, and the parameters of the network model are updated according to the gradient.
7. The method for detecting a series arc fault according to claim 5, characterized in that: The verifying and performance evaluating the network model of the convolutional neural network and the sparrow search algorithm-support vector machine according to the verification data set and the test data set includes: Inputting the verification data set into the network model of the convolutional neural network and the sparrow search algorithm-support vector machine, and calculating the second prediction output of the network model; Calculate a value of a loss function and a performance indicator according to the second true label and the second predicted output; According to the value of the loss function and the performance index, the hyperparameters of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine are adjusted; and the above hyperparameters are saved as the optimal model parameters.
8. The method for detecting a series arc fault according to claim 7, characterized in that: The method further comprises: adjusting the hyperparameters of the network model of the convolutional neural network and the sparrow search algorithm-support vector machine according to the value of the loss function and the performance index; and saving the hyperparameters as the optimal model parameters, comprising: Inputting the test data set into the network model of the convolutional neural network and the sparrow search algorithm-support vector machine; and calculating the third prediction output of the network model; Calculate the value of the loss function and the performance indicator according to the third true label and the third predicted output; The generalization ability of the network model is evaluated according to the value of the loss function and the performance indicator.
9. The method for detecting a series arc fault according to any one of claims 6 to 8, characterized in that: The loss function includes a cross entropy loss function or a mean square error loss function.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute the method for detecting a series arc fault according to any one of claims 1 to 9.
Citation Information
Cited By
Series alternating current arc fault detection method and system based on difference matrix and self-attention mechanism
CN119719849A
Series ac arc fault detection method and system based on difference matrix and self-attention mechanism
CN119719849B
