Integrated feature self-selection lightweight AC arc fault detection method
By integrating a lightweight AC arc fault detection method with self-selected features, the method uses a sliding time window and dynamic time warping algorithm to determine the type of electrical appliance, combines the mRMR-relief algorithm to screen key features, and performs diagnosis through a deep separable convolutional neural network. This solves the problem of identifying series arc faults in low-voltage lines and achieves fast and accurate fault detection.
Patent Information
- Application Number
- CN202511074847.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-01
- Publication Date
- 2025-11-18
AI Technical Summary
Existing technologies are difficult to effectively identify series arc faults in low-voltage lines, especially due to the aliasing of normal and arc state characteristics caused by different types of electrical loads, which leads to poor detection model performance. At the same time, deep learning algorithms are computationally expensive and difficult to execute on resource-constrained devices.
A lightweight AC arc fault detection method with integrated feature self-selection is adopted. Electrical transients are extracted by a sliding time window detection algorithm, the electrical type is determined by a dynamic time warping algorithm, key features are screened by the mRMR-relief algorithm, and diagnosis is performed by a deep separable convolutional neural network, thereby reducing computational complexity.
It enables rapid and accurate identification of series arc faults in low-voltage lines on resource-constrained equipment, reduces computational costs, improves the performance of the detection model, and has high feasibility.
Smart Images

Figure CN120974307A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of low-voltage user fault arc detection technology, and more specifically, to a lightweight AC arc fault detection method with integrated feature self-selection. Background Technology
[0002] With the increasing number of household appliances and the aging of indoor wiring, electrical fires have become the leading cause of fires in residential buildings. When an arc fault occurs in a circuit, the arc instantly generates temperatures of thousands of degrees Celsius, easily igniting flammable materials around the circuit and causing a fire. Arc faults can be divided into parallel arc faults and series arc faults. When a parallel arc fault occurs, its current amplitude is generally greater than the normal operating current and can be detected by traditional protection devices. However, series arc faults are highly concealed and random; their current and voltage fluctuations may not significantly exceed the range of normal operating conditions, making them difficult to identify by traditional protection devices. Therefore, the detection of series arc faults in indoor low-voltage circuits has become a hot topic in the field of electrical faults. Researching how to quickly and effectively identify series arc faults in low-voltage circuits is of great practical significance for ensuring electricity use and personal safety, and reducing economic losses.
[0003] In recent years, AC arc fault detection has been widely addressed, with various methods developed based on different features and detection algorithms. However, the characteristics of arc faults vary depending on the load type, and the characteristics of normal and arc states are severely mixed across different electrical appliances, leading to poor performance of arc detection models. Furthermore, although numerous arc features and algorithms have been studied, all these features are manually selected by researchers based on their experience, making it impossible to determine which features are best suited for arc fault detection. Deep learning has proven to have good performance in arc fault detection, but due to limitations in computing power and cost, deep learning-based detection algorithms are difficult to implement in industrial chips. Therefore, this paper proposes a lightweight AC arc fault detection method that integrates feature self-selection. Summary of the Invention
[0004] The purpose of this invention is to provide a lightweight AC arc fault detection method with integrated feature self-selection, in order to solve the problem mentioned in the background art of poor arc detection model performance caused by the aliasing of normal and arc state features due to different electrical load types. At the same time, by integrating a feature self-selection mechanism and a lightweight deep learning algorithm, the computational cost is reduced, and the ability to quickly and effectively identify series arc faults in low-voltage lines on resource-constrained equipment is improved.
[0005] To achieve the above objectives, the present invention aims to provide a lightweight AC arc fault detection method with integrated feature self-selection, comprising the following steps: S1. Use a sliding time window detection algorithm to perform event detection on the measured electrical data and extract the electrical transients when load events occur; S2. Use the dynamic time warping algorithm to compare the similarity with typical templates of each load category to obtain the appliance type of the newly connected load; S3. Extract key features from electrical quantities after electrical events, and extract key features specific to different electrical loads; S4. Input the extracted key features specific to different electrical loads into the trained DS-CNN model to obtain the corresponding cycle-level diagnostic results; S5. Judge and respond to the cycle-level diagnostic results.
[0006] As a further improvement to this technical solution, in step S1, a sliding time window detection algorithm is used to perform event detection on the measured electrical data and extract the electrical transient quantities when load events occur, including the following steps: S1.1, Collect electrical data; S1.2 Apply a sliding time window with a length of 1 second to the collected data; S1.3 For each sliding window, divide its signal into two parts, calculate the log-likelihood ratio of the mean change in each sliding window, and detect transient events based on the log-likelihood ratio. S1.4 Obtain the maximum likelihood value by using the maximum value of the sliding window signal; S1.5. Determine whether a transient event exists based on the calculated maximum likelihood value. If an electrical transient event exists within a window, perform a detailed analysis of the electrical data within that window and extract the electrical transient quantity features related to the electrical transient event.
[0007] As a further improvement to this technical solution, in S1.3, the log-likelihood ratio of the mean change in each sliding window is calculated as follows: ; ; ; ; In the formula, Indicates at a point in time Likelihood ratio at the location, Indicates a point in time. This represents half the number of samples in the sliding time window. This represents the average value of the latter half of the sliding window. This represents the average value of the first half of the sliding window. This represents the variance of the transient power in the sliding window. Indicates at a point in time The power value at that location, This represents the threshold for shielding against the effects of noise. Indicates transient voltage. This represents transient current.
[0008] As a further improvement to this technical solution, in S2, the electrical appliance types are: resistive, inductive, and switching power supply loads.
[0009] As a further improvement to this technical solution, in step S2, the similarity comparison is performed between the dynamic time warping algorithm and typical templates of each load category, including the following steps: S2.1 Calculate the distance between every two sampling points based on the transient current waveform and the typical waveforms of each load category; S2.2 Construct a distance matrix for the electrical transient signals of newly connected loads and typical templates for each load category; S2.3, Create a cumulative distance matrix Each element This represents the minimum cumulative distance from the starting point to the current point; S2.4 Recursively fill the cumulative distance matrix, when the cumulative distance matrix... After filling, the path backtracks from Begin by gradually selecting a precursor point until you return to the starting point. ; S2.5 Repeat the above operation to calculate the minimum alignment distance between the transient waveform and each template. The template type corresponding to the minimum distance is the load type of the event appliance.
[0010] As a further improvement to this technical solution, in step S3, key features are extracted from the electrical quantities following an electrical event, including the following steps: S3.1 Construct a preliminary feature factor library for arc faults containing various types of features, and calculate feature weights for the preliminary feature factor library for arc faults using the relief method. S3.2 Set a weight threshold. Compare the average weight of the initial selected feature factors with the weight threshold. If the average weight is greater than the weight threshold, the initial selected feature factors are included in the filter feature set. If the average weight is less than the weight threshold, the initial selected feature factors are discarded. The filter feature set is the feature set after filtering all the initial selected feature factors. S3.3. The features of the selected feature set are reduced in dimensionality using the mRMR method. In the selected feature set selected by the relief method, mutual information is used to measure the correlation between features and faults, and between features, in the feature subset, and to select N feature variables.
[0011] As a further improvement to this technical solution, in step S4, the extracted specific key features of different electrical loads are input into the trained DS-CNN model to obtain the corresponding cycle-level diagnostic results, including the following steps: S4.1 Preprocess the extracted key features; S4.2 Receive preprocessed key feature data; S4.3. Train the DS-CNN model weights using stochastic gradient descent and backpropagation algorithm. Input the preprocessed key feature data into the DS-CNN network and perform forward propagation calculations until the final output is obtained. S4.4. Use the SoftMax function in the output layer of the DS-CNN model to convert the output of the last layer into a probability distribution, indicating the probability that the input belongs to each category.
[0012] As a further improvement to this technical solution, in S4.3, the weights of the DS-CNN model are trained using stochastic gradient descent and backpropagation, including the following steps: S4.31. Initialize model parameters and set hyperparameters; S4.32. Divide the key feature data into training set, validation set and test set; S4.33. Randomly select a small batch of data samples from the training set for training in the current iteration; S4.34. Input the selected mini-batch of samples into the DS-CNN model, passing them through each layer in turn until the output layer is reached; S4.35. Use cross-entropy as the loss function to measure the difference between the model's predicted values and the true labels; S4.36. Calculate the gradient of the loss function with respect to each parameter according to the chain rule, and update the network parameters using stochastic gradient descent.
[0013] As a further improvement to this technical solution, in S4.4, the SoftMax function is used to convert the output of the last layer into a probability distribution as follows: ; Optimize the SoftMax function by introducing a temperature parameter: ; In the formula, Indicates the first The sample belongs to the first The predicted probability value of the class. This represents the optimized predicted probability value. Indicates the first The sample at the th Scores on the class Indicates the sample index. Indicates category index, This represents the temperature parameter.
[0014] As a further improvement to this technical solution, step S5, which involves judging and responding to the cycle-level diagnostic results, includes the following steps: S5.1 Obtain the diagnostic results for each cycle from a lightweight deep separable convolutional neural network; S5.2 Determine the threshold used to distinguish between normal conditions and arc faults; S5.3 For each time window, count the number of cycles diagnosed as arc faults; S5.4 If the number of cycles diagnosed as arc faults reaches 7 within any given 1 second, an arc fault is determined to have occurred. If this standard is not met, the data of the next time window will continue to be monitored. S5.5 If an arc fault is detected, the corresponding protection device will be triggered and an alarm message will be sent to the user.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: This integrated feature-based lightweight AC arc fault detection method integrates event detection with the DTW template matching algorithm to determine the load type of operating electrical appliances. The mRMR-relief algorithm is used for offline analysis to automatically filter specific key features of different load types, reducing the overlap between normal and arc state features of different electrical appliances, thus enabling online extraction of key features of operating electrical appliances. A depthwise separable convolution is constructed using a combination of depthwise convolution and pointwise convolution, resulting in a lightweight neural network. This reduces the computational complexity of the arc fault detection model, making it suitable for edge computing devices with limited computing and storage resources. This enables rapid and accurate identification of series-fault arcs, demonstrating high feasibility. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating the overall method of the present invention; Figure 2 shows the current waveforms under normal and arc states for different types of loads in this embodiment. Figure 2-1a This is a waveform diagram of the current under normal and arcing states for a resistive load in this embodiment; Figure 2-1b This is a waveform diagram of the current under normal and arcing states for an inductive load in this embodiment; Figure 2-1c This is a waveform diagram of the current under normal and arcing states of the switching power supply type load in this embodiment; Figure 3This is a flowchart of feature self-selection based on offline analysis using the mRMR-relief algorithm; Figure 4 This is a flowchart of the training process for a depthwise separable convolutional lightweight neural network. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0018] Example: Please refer to Figure 1 As shown, this embodiment provides a lightweight AC arc fault detection method with integrated feature self-selection, including the following steps: S1. Use a sliding time window (1 second in length) detection algorithm to perform event detection on the measured electrical data (including high-frequency current and voltage data, with a sampling frequency of 50kHz), and extract the electrical transient quantities when load events occur; In this embodiment, a sliding time window (1 second in length) detection algorithm is used to perform event detection on the measured electrical data (including high-frequency current and voltage data, with a sampling frequency of 50kHz), and to extract the electrical transient quantities when load events occur, including the following steps: S1.1 Acquire electrical data, including high-frequency current and voltage data. The sampling frequency of these data is 50kHz to ensure that transient changes in the electrical system can be captured. S1.2 Apply a sliding time window of 1 second in length to the acquired data. This means that a new window will start every second, and each window will cover the most recent 50,000 sample points (considering a sampling rate of 50 kHz). S1.3 For each sliding window, divide its signal into two parts, and calculate the log-likelihood ratio of the mean change in each sliding window (for a sliding window with a length of 2n samples, divide the signal into the first n samples and the last n samples, then calculate the mean change of these two parts, and calculate the log-likelihood ratio based on this). Detect transient events based on the log-likelihood ratio. The log-likelihood ratio of the change in mean within each sliding window is calculated as follows: ; ; ; ; In the formula, Indicates at a point in time The likelihood ratio at a given time point is used to determine whether there is a significant change at that time point. Indicates a point in time. This represents half the number of samples in the sliding time window. This represents the average value of the latter half of the sliding window. This represents the average value of the first half of the sliding window. This represents the variance of transient power within the sliding window, used to standardize differences and ensure that data at different scales can be compared. Indicates at a point in time The power value at that location, This represents the threshold for masking the effects of noise, used to determine whether the difference between the means of the two parts is considered significant enough to constitute an event. Indicates transient voltage. Indicates transient current; S1.4 Obtain the maximum likelihood value through the maximum value of the sliding window signal. This step is to identify whether a significant change has occurred within a specific window, which may indicate the occurrence of an electrical transient event. Obtain the maximum likelihood value by using the maximum value of the sliding window signal. The formula is: ; when The amplitude exceeds the threshold When the event occurs, it is detected as an event; S1.5. Determine whether a transient event exists based on the calculated maximum likelihood value. If the likelihood value of a certain window exceeds the set threshold... If an electrical transient event occurs within a window, further analysis of the electrical data within that window is required. If an electrical transient event exists within a window, a detailed analysis of the electrical data within that window is performed to extract electrical transient quantity features related to the event (using the concept of mean variation to develop a rule-based event detector to avoid using any complex mathematical techniques that could lead to high computational costs). The current waveforms of different types of normal loads (including normal resistive loads, normal inductive loads, and normal switching power supply loads) and arc state are shown in Figure 2 (including...). Figure 2-1a , Figure 2-1b , Figure 2-1c ).
[0019] S2. Use the Dynamic Time Warping (DTW) algorithm to compare the similarity with typical templates of each load category to obtain the appliance type of the newly connected load; In this embodiment, the electrical appliance types are: resistive, inductive, and switching power supply loads.
[0020] The process of comparing the similarity of the Dynamic Time Warping (DTW) algorithm with typical templates for each load category includes the following steps: The DTW algorithm is an algorithm used to measure the similarity between two time series data. It can compare time series data of different lengths without requiring data alignment. S2.1, Based on the transient current waveform Typical waveforms for each load category Calculate the distance between every two sampling points; The distance between any two sampling points is: ; In the formula, Represents current waveform The One sampling point, Indicates the first Template The One sampling point; S2.2. For the electrical transient signal of the newly connected load and a typical template for each load category, construct a distance matrix. Each element of this matrix represents the distance between corresponding points in two sequences (usually using Euclidean distance). If the signal length of the newly connected load is... The template length for a certain type of load is Then the size of the distance matrix is ; S2.3, Create a cumulative distance matrix (Each element in the cumulative distance matrix represents the minimum cumulative distance from the starting point to that position), and its size is also [missing information]. Each element This represents the minimum cumulative distance from the starting point to the current point; During initialization, set ; The recursive formula is as follows: ; In the formula, This indicates a transition from the point above to the current point. This indicates a transition from the point on the left to the current point. This indicates a move from the top-left corner to the current point; S2.4 Recursively fill the cumulative distance matrix, when the cumulative distance matrix... After filling, the path backtracks from Begin by gradually selecting a precursor point until you return to the starting point. ; The backtracking rule is: each time, choose the smallest predecessor point, and the path follows: ; By backtracking, an optimal alignment path can be obtained, representing the best match between two time series data. This indicates the transient current waveform and the first... Minimum alignment distance between templates; S2.5 Repeat the above operation to calculate the minimum alignment distance between the transient waveform and each template. The template type corresponding to the smallest distance, i.e., the load type of the event appliance; S3. Extract key features from electrical quantities after electrical events, and extract key features specific to different electrical loads; In this embodiment, the mRMR-relief algorithm uses offline analysis to screen key feature names with low redundancy and strong correlation to arc faults in the initial feature factor library of the arc fault event. The relief algorithm is used to calculate the weights of the arc features, and a certain threshold is set. After threshold screening, the mRMR technique is used to select the feature subset with the highest correlation to the target category and the lowest redundancy as the input variables of the arc fault detection model. The feature self-screening process based on the offline analysis of the mRMR-relief algorithm is as follows: Figure 3 As shown; Key features of electrical quantities following electrical events are extracted, including the following steps: S3.1 Construct a preliminary feature factor library for arc faults containing various types of features (features include time-domain features, frequency-domain features, and time-frequency-domain features), and calculate feature weights for the preliminary feature factor library for arc faults using the relief method; In this embodiment, the initial selection feature factor library for arc faults includes time-domain features, frequency-domain features, and time-frequency-domain features, totaling 30 features. Specifically, the time-domain features used are in cycles, including arc current shoulder width, rate of change of effective value of current between adjacent cycles, kurtosis, skewness, waveform factor, peak factor, impulse factor, margin factor, gap factor, and entropy. Arc current shoulder width The calculation formula is: ; In the formula, It refers to the number of points where the absolute value of the current is less than 0.05 times the effective value of the period within one cycle. This is the total number of points within the period, which is 1000 in this example; Rate of change of effective value of current between adjacent cycles The calculation formula is: ; In the formula, For the first The effective value of the current in each cycle, For the first The effective value of the current in each cycle; cliff The calculation formula is: ; In the formula, This represents the expected value (i.e., the mean). For current data points, This is the average value of the current; Skewness The calculation formula is: ; Waveform factor The calculation formula is: ; In the formula, The effective value of the current signal. This represents the average value of the current signal; Peak factor The calculation formula is: ; In the formula, This represents the maximum value of the current waveform; Pulse factor The calculation formula is: ; margin factor The calculation formula is: ; gap factor The calculation formula is: ; entropy The calculation formula is: ; In the formula, Represents current data points The probability distribution, This is the total number of points within the period, which is 1000 in this example; Specifically, the frequency domain characteristics used are measured in cycles, including harmonic distortion, centroid frequency, root mean square frequency, frequency standard deviation, and the relative quantities of the 1st to 15th odd harmonics, i.e., the fundamental frequency content. Third harmonic content Fifth harmonic content 7th harmonic content 9th harmonic content Eleventh harmonic content Thirteenth harmonic content 15th harmonic content ; Harmonic distortion The intensity of harmonic components in a signal relative to the fundamental frequency is represented by the following formula: ; In the formula, It is the amplitude of the fundamental frequency. It is the amplitude of the corresponding frequency component. Indicates frequency; Center of gravity frequency This refers to the centroid of the signal's spectrum, which indicates the signal's frequency distribution. The calculation formula is: ; In the formula, It is the first Second frequency, Indicates the total number of frequencies; Root mean square frequency The average energy value representing the frequency is calculated using the following formula: ; Frequency standard deviation The formula describing the dispersion of a signal's frequency distribution is as follows: ; In the formula, It is the center of gravity frequency. It is the first Secondary frequency; Harmonic content That is, the proportion of the amplitude of each harmonic component to the total signal amplitude, calculated using the following formula: , ; In the formula, Indicates the first The amplitude of the second frequency component. Indicates the first The amplitude of the secondary frequency component; Specifically, the time-frequency domain features used are measured in cycles, including the relative energy content of the eight frequency bands after wavelet packet decomposition. ; In time-frequency analysis, wavelet packet decomposition can be used to decompose a signal into multiple frequency bands. The relative energy content of each frequency band can be represented by the ratio of its energy to the total energy. If current signal After wavelet packet decomposition, eight frequency bands were obtained, which are as follows: , of which each For each component of a frequency band, the energy of that band can be calculated by integrating the square of that component: ; In the formula, It is frequency band energy, Indicates time, Represents the time variable in the differential; Total Energy The total energy of the signal can be calculated by integrating the square of the entire signal: ; Then, a certain frequency band relative energy content The calculation formula is: ; Furthermore, the specific steps for calculating the feature weights are as follows: Randomly select a sample point A from n actual sample points; Assuming that the randomly selected sample point A is a normal sample, we search for two nearest neighbor samples around sample point A: one is the nearest neighbor normal sample H, and the other is the nearest neighbor electric arc sample M.
[0021] Here, if the randomly selected sample point A is an electric arc sample, the same logic applies in reverse. Assuming the randomly selected sample point A is an electric arc sample, we find the nearest neighbor electric arc sample H around sample point A. The difference between the initially selected feature factors between sample point A and the nearest neighbor electric arc sample H is... Find the nearest normal sample M around sample point A. The difference between the initially selected feature factors between sample point A and the nearest normal sample M is _____. .
[0022] Calculate the difference between the initially selected feature factors between sample point A and its nearest neighbor normal sample H. ; Calculate the difference between the initially selected feature factors between sample point A and its nearest neighbor arc sample M. ; like This indicates that the initial selection of feature factors... It helps to distinguish the nearest neighbors of the same class from those of different classes, thus increasing the number of initial feature factors. The weights; like If the value is less than 0, it means that the feature has little effect on distinguishing samples, and the current weight should be maintained. like This indicates that the initial selection of feature factors... It is not conducive to distinguishing the nearest neighbors of the same class from those of different classes, thus reducing the number of initial feature factors. The weight.
[0023] Through such comparison, the magnitude of their correlation is evaluated by assessing the ability of the features to distinguish between nearby samples; If the distance between sample A and sample H on this feature Less than the distance of this feature between samples A and M. If the distance between samples A and H is large, it indicates that the feature is helpful in distinguishing nearest neighbors of the same and different classes, and the weight of the feature should be increased; conversely, if the distance between samples A and H of this feature is large, the weight of the feature should be increased. The distance between sample A and sample M on this feature If the weight of a feature is negatively affected in distinguishing nearest neighbors of the same or different classes, then the weight of that feature should be reduced. A larger weight indicates a stronger classification ability, while a smaller weight indicates a weaker classification ability.
[0024] Repeat step A (randomly selecting a sample point A from n actual sample points) m times, and calculate the weights of the m initially selected feature factors. The average value.
[0025] S3.2 Set weight thresholds for the initially selected feature factors. The average weight is compared with a weight threshold; if it is greater than the weight threshold, the initially selected feature factor is... Included in the selection feature set; if it is less than the weight threshold, the initial selection feature factor is removed. Discard and filter the feature set to include all initially selected feature factors. The filtered feature set is used to select features with high influence and high relevance. S3.3. The features of the selected feature set are reduced in dimensionality using the mRMR method. In the selected feature set selected by the relief method, mutual information is used to measure the correlation between features and faults and between features in the feature subset, and to select N feature variables. The mRMR method is a typical feature dimensionality reduction algorithm based on information theory. It uses the mRMR method to find the n features that have the greatest correlation with the category of electric arc appliances and have the least redundancy among them from the features filtered by relief technology. The specific steps are as follows: S3.31, Given two random variables and Its probability density function corresponding to a continuous variable is , , ,but and The mutual information between them is represented as: ; S3.32 Utilizing mutual information to calculate and filter feature sets In the middle of the electric arc Maximum correlation between Its expression is as follows: ; S3.33, Using mutual information to calculate and filter feature sets Chinese characteristics and Redundancy between Its calculation expression is as follows: ; S3.34. Using the mutual information difference criterion, select the feature with the largest difference to obtain the feature with the minimum redundancy and the maximum correlation, and include this feature in the preferred feature set required for modeling. S3.35. Repeat step S4.32 in the remaining sample set (using mutual information to calculate and filter the feature set). Category of electric arc appliances (The maximum correlation between them) is calculated p times, and finally p preferred features required for modeling are obtained.
[0026] Here, the relief algorithm is highly efficient by calculating feature weights and assigning higher weights to features with strong classification capabilities. However, the relief algorithm does not consider the correlation between features, so it cannot remove feature redundancy. The mRMR algorithm can obtain a feature subset with minimal redundancy and maximum correlation between features and the target, but it cannot calculate the weights. Therefore, by combining the relief and mRMR algorithms for feature dimensionality reduction, and by setting a certain threshold to increase the weights of features with good discriminative power, the optimal feature subset is obtained.
[0027] S4. Input the extracted key features specific to different electrical loads into the trained DS-CNN model to obtain the corresponding cycle-level diagnostic results; In this embodiment, the extracted key features specific to different electrical loads are input into the trained DS-CNN model to obtain the corresponding cycle-level diagnostic results, including the following steps: S4.1 Preprocess the extracted key features, including normalization and resizing, to convert the extracted key features into a format suitable for the input of the DS-CNN model. This usually means adjusting the data to a specific dimension and shape. S4.2 Receive preprocessed key feature data; S4.3. Train the DS-CNN model weights using stochastic gradient descent and backpropagation. Input the preprocessed key feature data into the DS-CNN network and perform forward propagation calculations, passing through all convolutional layers, pooling layers, Dropout layers, etc., until the final output is obtained. In this embodiment, the network structure of the DS-CNN (Deep Separable Convolutional Neural Network) model is as follows: [Input]→2×[64dwC3,64C1]→[MP3]→2×[128dwC3,128C1]→[Dropout]→[256dwC3,256C1]→[GAP]→[2SoftMax]; Where 64dwC3 represents 64 3×3 depthwise separable convolutions, 64C1 represents 64 standard point convolutions (1x1 convolutions), MP3 represents a max pooling layer, GAP represents a global average pooling layer, and the parameters of other layers follow the same logic. It should be noted that each standard convolutional layer and depthwise separable convolutional layer uses the ReLU activation function and batch normalization, and the parameters of the Dropout layer are set to 0.5 to prevent overfitting. The weights of the DS-CNN model are trained using stochastic gradient descent and backpropagation, including the following steps: S4.31. Initialize model parameters (initialize the weights for each convolutional layer, fully connected layer, etc. in DS-CNN, usually using small random values, including those drawn from a normal or uniform distribution) and set hyperparameters (including learning rate (initially set to 0.1), batch size, number of iterations (maximum number of iterations set to 100), and reducing the learning rate by a factor of 10 after every 20 iterations, etc.). S4.32. Divide the key feature data into training set, validation set and test set; S4.33. Randomly select a small batch of data samples from the training set for training in the current iteration; S4.34. Input the selected mini-batch samples into the DS-CNN model, passing them through each layer in sequence (including depthwise separable convolutional layers, ReLU activation function, batch normalization, Dropout layers, etc.) until the output layer is reached. S4.35. Use cross-entropy as the loss function to measure the difference between the model's predicted values and the true labels; The loss function formula is as follows: ; In the formula, This represents the value of the cross-entropy loss. This represents the total number of samples. The model predicts the first Each sample belongs to its true category. The probability of; Stochastic gradient descent is an algorithm based on mini-batch sample data. According to the definition of gradient descent, the gradient based on a mini-batch sample is expressed as: ; In the formula, It is a loss function Regarding parameters The estimated gradient is used to update the parameters during gradient descent; This is the number of samples used for gradient calculation, often referred to as the batch size, which is 64 in this example; These are model parameters, which are optimized during training to minimize the loss function. It's about parameters. gradient operator, It is the first Input features of each sample It is the first The true label of each sample The loss function mentioned above measures the model parameters. Given input and real labels Prediction error at that time; The above stochastic gradient descent method is used for training. The initial learning rate is set to 0.1, the test interval is set to 5 training times, and the network model parameters are saved. The maximum number of iterations is set to 100. The learning rate is reduced by 10 times every 20 iterations. When the network model converges, training can be stopped early, and the model with the highest verification accuracy is saved as the final model. Training process for depthwise separable convolutional lightweight neural networks is as follows: Figure 4 As shown; S4.36. Calculate the gradient of the loss function with respect to each parameter according to the chain rule. This process starts from the output layer, propagates the error gradient forward step by step, updates the weights of each layer, and updates the network parameters using stochastic gradient descent. S4.4. Use the SoftMax function in the output layer of the DS-CNN model to convert the output of the last layer into a probability distribution, indicating the probability of the input belonging to each category (including normal state or arc fault). The SoftMax function is used to convert the output of the last layer into a probability distribution: ; To address the issue of overconfidence in the DS-CNN model's output, a temperature parameter is introduced into the SoftMax function for optimization. (The original SoftMax pushes the probability close to 1 when outputting the maximum logit, causing the model to be overconfident even in incorrect predictions. By adding a temperature parameter, the SoftMax output becomes smoother, allowing the probability value to more realistically reflect the model's uncertainty, which is beneficial for probability calibration. Temperature adjustment also prevents the model output from being extremely biased towards a particular class, which is helpful for analyzing the model's judgment criteria. For safety-sensitive scenarios such as arc fault diagnosis, the model must output a credible level of confidence to avoid low-quality but high-probability false alarms.) ; In the formula, Indicates the first The sample belongs to the first The predicted probability value of the class. This represents the optimized predicted probability value. Indicates the first The sample at the th Scores on the class Indicates the sample index. Indicates category index, This represents the temperature parameter.
[0028] S5. Judge and respond to the cycle-level diagnostic results; In this embodiment, the judgment and response to the cycle-level diagnostic results include the following steps: S5.1 Obtain the diagnostic results for each cycle from a lightweight deep separable convolutional neural network (DS-CNN); S5.2 Determine the threshold for distinguishing between normal state and arc fault. If a waveform with more than or equal to 7 cycles is diagnosed as an arc within 1 second, it is judged that an arc has occurred. S5.3 For each time window (1 second), count the number of cycles diagnosed as arc faults. Since one cycle of AC power is approximately 20ms (50Hz system), each second contains approximately 50 cycles. S5.4 If the number of cycles diagnosed as arc faults reaches or exceeds 7 within any given 1 second, an arc fault is determined to have occurred. If this standard is not met, the data of the next time window will continue to be monitored. S5.5 If an arc fault is detected, the corresponding protection device shall be triggered immediately. This may include, but is not limited to, cutting off the power supply and issuing an alarm to ensure the safety of the user and sending alarm information to the user through sound, light or other forms of notification to ensure that the user can be aware of the potential danger in a timely manner and take action.
[0029] This embodiment, on the one hand, combines event detection with dynamic time warping (DTW) algorithms to accurately analyze the transient load characteristics of electrical appliances under different start-stop states. By comparing and matching these features, the load type of the electrical appliance is determined, providing a basis for subsequent self-selection of key features for different types of appliances. Furthermore, in the second stage, an arc feature library containing various complex features is constructed. A feature selection method combining maximum correlation minimum redundancy (mRMR) and feature weighting (Relief) is used to filter key arc features for different types of loads, enabling self-selection of specific key features for different electrical appliance loads. Additionally, a depthwise separable convolution (DS-Conv) is constructed by combining depthwise convolution (DW-Conv) and pointwise convolution (PW-Conv) to reduce the computational cost of fault identification. A convolutional neural network model with small model capacity and low computational complexity is designed for arc fault detection, making it suitable for computing devices with limited computing and storage resources, achieving rapid and accurate identification of series fault arcs.
[0030] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention.
Claims
1. A lightweight AC arc fault detection method with integrated feature self-selection, characterized in that, Includes the following steps: S1. Use a sliding time window detection algorithm to perform event detection on the measured electrical data and extract the electrical transients when load events occur; S2. Use the dynamic time warping algorithm to compare the similarity with typical templates of each load category to obtain the appliance type of the newly connected load; S3. Extract key features from electrical quantities after electrical events, and extract key features specific to different electrical loads; S4. Input the extracted key features specific to different electrical loads into the trained DS-CNN model to obtain the corresponding cycle-level diagnostic results; S5. Judge and respond to the cycle-level diagnostic results.
2. The lightweight AC arc fault detection method with integrated feature self-selection according to claim 1, characterized in that: In step S1, a sliding time window detection algorithm is used to detect events in the measured electrical data and extract electrical transient quantities when load events occur, including the following steps: S1.1, Collect electrical data; S1.2 Apply a sliding time window with a length of 1 second to the collected data; S1.3 For each sliding window, divide its signal into two parts, calculate the log-likelihood ratio of the mean change in each sliding window, and detect transient events based on the log-likelihood ratio. S1.4 Obtain the maximum likelihood value by using the maximum value of the sliding window signal; S1.
5. Determine whether a transient event exists based on the calculated maximum likelihood value. If an electrical transient event exists within a window, perform a detailed analysis of the electrical data within that window and extract the electrical transient quantity features related to the electrical transient event.
3. The lightweight AC arc fault detection method with integrated feature self-selection according to claim 2, characterized in that: In step S1.3, the log-likelihood ratio of the mean change in each sliding window is calculated as follows: ; ; ; ; In the formula, Indicates a point in time Likelihood ratio at the location, Indicates a point in time. This represents half the number of samples in the sliding time window. This represents the average value of the latter half of the sliding window. This represents the average value of the first half of the sliding window. This represents the variance of the transient power in the sliding window. Indicates a point in time The power value at that location, This represents the threshold for shielding against the effects of noise. Indicates transient voltage. This represents transient current.
4. The lightweight AC arc fault detection method with integrated feature self-selection according to claim 1, characterized in that: In S2, the electrical appliance types are: resistive, inductive, and switching power supply loads.
5. The lightweight AC arc fault detection method with integrated feature self-selection according to claim 1, characterized in that: In step S2, the similarity comparison is performed between the dynamic time warping algorithm and typical templates of each load category, including the following steps: S2.1 Calculate the distance between every two sampling points based on the transient current waveform and the typical waveforms of each load category; S2.2 Construct a distance matrix for the electrical transient signals of newly connected loads and typical templates for each load category; S2.3, Create a cumulative distance matrix Each element This represents the minimum cumulative distance from the starting point to the current point; S2.4 Recursively fill the cumulative distance matrix, when the cumulative distance matrix... After filling, the path backtracks from Begin by gradually selecting a precursor point until you return to the starting point. ; S2.5 Repeat the above operation to calculate the minimum alignment distance between the transient waveform and each template. The template type corresponding to the minimum distance is the load type of the event appliance.
6. The lightweight AC arc fault detection method with integrated feature self-selection according to claim 1, characterized in that: In step S3, key features are extracted from electrical quantities following electrical events, including the following steps: S3.1 Construct a preliminary feature factor library for arc faults containing various types of features, and calculate feature weights for the preliminary feature factor library for arc faults using the relief method. S3.2 Set a weight threshold. Compare the average weight of the initial selected feature factors with the weight threshold. If the average weight is greater than the weight threshold, the initial selected feature factors are included in the filter feature set. If the average weight is less than the weight threshold, the initial selected feature factors are discarded. The filter feature set is the feature set after filtering all the initial selected feature factors. S3.
3. The features of the selected feature set are reduced in dimensionality using the mRMR method. In the selected feature set selected by the relief method, mutual information is used to measure the correlation between features and faults, and between features, in the feature subset, and to select N feature variables.
7. The lightweight AC arc fault detection method with integrated feature self-selection according to claim 1, characterized in that: In step S4, the extracted key features specific to different electrical loads are input into the trained DS-CNN model to obtain the corresponding cycle-level diagnostic results, including the following steps: S4.1 Preprocess the extracted key features; S4.2 Receive preprocessed key feature data; S4.
3. Train the DS-CNN model weights using stochastic gradient descent and backpropagation algorithm. Input the preprocessed key feature data into the DS-CNN network and perform forward propagation calculations until the final output is obtained. S4.
4. Use the SoftMax function in the output layer of the DS-CNN model to convert the output of the last layer into a probability distribution, indicating the probability that the input belongs to each category.
8. The lightweight AC arc fault detection method with integrated feature self-selection according to claim 7, characterized in that: In step S4.3, the weights of the DS-CNN model are trained using stochastic gradient descent and backpropagation, including the following steps: S4.
31. Initialize model parameters and set hyperparameters; S4.
32. Divide the key feature data into training set, validation set and test set; S4.
33. Randomly select a small batch of data samples from the training set for training in the current iteration; S4.
34. Input the selected mini-batch of samples into the DS-CNN model, passing them through each layer in turn until the output layer is reached; S4.
35. Use cross-entropy as the loss function to measure the difference between the model's predicted values and the true labels; S4.
36. Calculate the gradient of the loss function with respect to each parameter according to the chain rule, and update the network parameters using stochastic gradient descent.
9. The lightweight AC arc fault detection method with integrated feature self-selection according to claim 7, characterized in that: In S4.4, the SoftMax function is used to convert the output of the last layer into a probability distribution as follows: ; Optimize the SoftMax function by introducing a temperature parameter: ; In the formula, Indicates the first The sample belongs to the first The predicted probability value of the class. This represents the optimized predicted probability value. Indicates the first The sample at the th Scores on the class Indicates the sample index. Indicates category index, This represents the temperature parameter.
10. The lightweight AC arc fault detection method with integrated feature self-selection according to claim 1, characterized in that: In step S5, the judgment and response to the cycle-level diagnostic results include the following steps: S5.1 Obtain the diagnostic results for each cycle from a lightweight deep separable convolutional neural network; S5.2 Determine the threshold used to distinguish between normal conditions and arc faults; S5.3 For each time window, count the number of cycles diagnosed as arc faults; S5.4 If the number of cycles diagnosed as arc faults reaches 7 within any given 1 second, an arc fault is determined to have occurred. If this standard is not met, the data of the next time window will continue to be monitored. S5.5 If an arc fault is detected, the corresponding protection device will be triggered and an alarm message will be sent to the user.