Electric shock diagnosis method, system and equipment based on neural network, medium and product

The electric shock diagnosis method based on the GRU-ATT-Transformer neural network model solves the problem of insufficient sensitivity of leakage protection devices in DC systems, realizes early and accurate identification and classification of electric shock events, and improves the accuracy of diagnosis and the adaptability of the model.

CN121456429APending Publication Date: 2026-02-03ZHUHAI POWER SUPPLY BUREAU GUANGDONG POWER GIRD CO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511670567.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-14
Publication Date
2026-02-03

AI Technical Summary

Technical Problem

Existing leakage current protection devices are insufficiently sensitive in DC systems, have slow response, and have a high false alarm rate, making it difficult to meet the needs for early identification and accurate classification of electric shock incidents under complex working conditions.

Method used

A GRU-ATT-Transformer neural network model is adopted. By collecting electric shock signal data, feature extraction and optimization are performed to construct a training dataset and train an electric shock diagnosis and prediction model. This model is then used to diagnose and predict electric shock signals. The model's generalization ability and accuracy are improved by combining fully integrated empirical mode decomposition and variational mode decomposition algorithms to remove noise.

Benefits of technology

It improves the accuracy of electric shock diagnosis and the generalization ability of the model, enabling earlier and more accurate identification of electric shock events and reducing the false alarm rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121456429A_ABST
    Figure CN121456429A_ABST
Patent Text Reader

Abstract

The invention discloses an electric shock diagnosis method, system, equipment, medium and product based on a neural network, and the method comprises the steps: collecting a plurality of electric shock signal data in an electric shock experiment process, carrying out the classification of electric shock and non-electric shock types of the electric shock signal data, carrying out the electric shock condition labeling of the classified electric shock signal data, and carrying out the recognition of the electric shock condition. Extracting signal features of the electric shock signal data, performing feature optimization on the signal features by using a package type feature selection method, taking the signal optimization features and electric shock condition labels of the corresponding electric shock signal data as mapping samples, training an initial GRU-ATT-Transformer neural network model, and obtaining a GRU-ATT-Transformer neural network model; and the trained electric shock diagnosis and prediction model is utilized to perform electric shock diagnosis and prediction on the electric shock signal data in the current calculation period, so that the model generalization ability and the accuracy of electric shock diagnosis and prediction are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system technology, and in particular to a method, system, device, medium and product for electric shock diagnosis based on neural networks. Background Technology

[0002] With the rapid development of DC power supply technology, low-voltage DC power distribution systems have been widely used in intelligent buildings, rail transit, data centers, and new energy power distribution due to their advantages such as energy efficiency, high efficiency, and ease of control. However, compared with traditional AC systems, DC systems have characteristics such as no current zero-crossing point, longer duration of electric shock, and significant changes in human body impedance over time, making them more insidious and dangerous in terms of electric shock risk. This is especially true when the grounding method is unclear or the insulation level is degraded, which can easily lead to serious accidents.

[0003] Currently widely used leakage current protection devices face problems such as insufficient sensitivity, slow response, high false alarm rate, and poor adaptability in DC systems, making it difficult to meet the needs for early identification and accurate classification of electric shock events under complex working conditions. Summary of the Invention

[0004] In view of this, in order to solve the above-mentioned technical problems, the present invention provides a method, system, device, medium and product for electric shock diagnosis based on neural networks.

[0005] The first aspect of this invention provides a neural network-based method for diagnosing electric shock, comprising:

[0006] Multiple electric shock signal data were collected during the electric shock experiment, and the electric shock signal data were classified into categories of electric shock and non-electric shock, and the electric shock status was labeled on the classified electric shock signal data.

[0007] The signal features of the electric shock signal data are extracted, and the signal features are optimized using a wrap-around feature selection method to obtain optimized signal features.

[0008] The signal optimization features and their corresponding electric shock condition labels from the electric shock signal data are used as mapping samples to construct a training dataset.

[0009] The initial GRU-ATT-Transformer neural network model was trained using the training dataset to obtain a trained electric shock diagnosis prediction model.

[0010] The trained electric shock diagnosis and prediction model is used to perform electric shock diagnosis and prediction on the electric shock signal data of the current calculation period to obtain the electric shock situation prediction result of the current calculation period.

[0011] Preferably, the method further includes:

[0012] The electric shock signal data is subjected to fully integrated empirical mode decomposition to obtain several intrinsic mode function components;

[0013] Multiple intrinsic mode function components with frequencies greater than a preset frequency threshold are selected from a plurality of intrinsic mode function components and used as high-frequency intrinsic mode function components.

[0014] The high-frequency intrinsic mode function components are decomposed into several sub-modes using a variational mode decomposition algorithm; wherein the hyperparameters of the variational mode decomposition algorithm are optimized using the White Shark optimization algorithm.

[0015] The signal is reconstructed using several of the sub-modes to obtain the reconstructed electric shock signal data.

[0016] Preferably, the signal features include time-domain signal features and frequency-domain signal features;

[0017] The signal features extracted from the electric shock signal data include:

[0018] The electric shock signal data is subjected to time-domain statistical analysis to obtain the time-domain signal characteristics; the time-domain signal characteristics include mean, standard deviation, maximum value, minimum value, skewness, kurtosis, root mean square value, and signal amplitude range;

[0019] Perform a Fast Fourier Transform on the electric shock signal data to obtain the frequency domain data of the electric shock signal;

[0020] Extract frequency domain signal features from the frequency domain data of the electric shock signal; wherein, the frequency domain signal features include the amplitude features and spectral entropy of the dominant frequency component.

[0021] Preferably, the signal features are optimized using a wrap-around feature selection method to obtain optimized signal features, including:

[0022] The recursive feature elimination method is used to sort the signal features according to their relative importance, and the signal features with the lowest relative importance are eliminated in turn.

[0023] After each removal of signal features, the remaining signal features are evaluated using a pre-defined classifier.

[0024] Based on the classification performance evaluation results, the combination of signal features corresponding to the optimal classification performance is determined as the optimized signal features.

[0025] Preferably, the initial GRU-ATT-Transformer neural network model includes a GRU-ATT model and a Transformer model;

[0026] The GRU-ATT model is used to input the optimized features of the signal for feature extraction and output the local features after feature extraction.

[0027] The Transformer model receives the local features output by the GRU-ATT model and performs global feature extraction on the local features based on a multi-head attention mechanism, outputting a fused feature that combines the local and global features. The fused feature is used to construct a mapping relationship with its corresponding electric shock condition label, and the parameters of the Transformer model are adjusted through a backpropagation algorithm until a preset convergence condition is met, thus obtaining a trained electric shock diagnosis and prediction model.

[0028] Preferably, the step of using the trained electric shock diagnosis prediction model to perform electric shock diagnosis prediction on the electric shock signal data of the current calculation period, and obtaining the electric shock situation prediction result for the current calculation period, includes:

[0029] Feature extraction is performed on the electric shock signal data of the current calculation period to obtain the signal features of the electric shock signal data of the current calculation period. Then, the signal features of the current calculation period are optimized using the wrap-around feature selection method to obtain the optimized signal features of the current calculation period.

[0030] The optimized signal features of the current calculation period are input into the trained electric shock diagnosis prediction model, and the electric shock situation prediction result is output.

[0031] Secondly, the present invention also provides a neural network-based electric shock diagnosis system, comprising:

[0032] The data acquisition and processing module is used to acquire multiple electric shock signal data during the electric shock experiment, classify the electric shock signal data into categories of electric shock and non-electric shock, and label the classified electric shock signal data with electric shock status.

[0033] The feature optimization module is used to extract the signal features of the electric shock signal data and optimize the signal features using a wrap-around feature selection method to obtain optimized signal features.

[0034] The dataset construction module is used to construct a training dataset by using the signal optimization features and their corresponding electric shock signal data electric shock condition labels as mapping samples.

[0035] The model training module is used to train the initial GRU-ATT-Transformer neural network model using the training dataset to obtain a trained electric shock diagnosis prediction model.

[0036] The electric shock diagnosis and prediction module is used to perform electric shock diagnosis and prediction on the electric shock signal data of the current calculation period using the trained electric shock diagnosis and prediction model, and to obtain the electric shock situation prediction result of the current calculation period.

[0037] Thirdly, the present invention also provides an electronic device, the electronic device including a memory and a processor, the memory storing a computer program, which, when executed by the processor, causes the processor to perform the steps of the neural network-based electric shock diagnosis method as described in the first aspect.

[0038] Fourthly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements the steps of the neural network-based electric shock diagnosis method as described in the first aspect.

[0039] Fifthly, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein, when the program instructions are executed by a computer, the computer performs the steps of the neural network-based electric shock diagnosis method as described in the first aspect.

[0040] As can be seen from the above technical solution, this invention collects multiple electric shock signal data during the electric shock experiment, classifies the electric shock signal data into categories of electric shock and non-electric shock, labels the classified electric shock signal data with electric shock status, extracts the signal features of the electric shock signal data, and uses a wrapper feature selection method to optimize the signal features, thereby removing redundant features. The optimized signal features and their corresponding electric shock status labels are used as mapping samples to construct a training dataset. The initial GRU-ATT-Transformer neural network model is trained using the training dataset. The trained electric shock diagnosis and prediction model is then used to perform electric shock diagnosis and prediction on the electric shock signal data for the current calculation period, obtaining the electric shock status prediction result for the current calculation period. Thus, by using the GRU-ATT-Transformer neural network, it avoids focusing only on local features while ignoring the overall pattern, improving the model's generalization ability and the accuracy of electric shock diagnosis and prediction. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 An application environment diagram of a neural network-based electric shock diagnosis method provided in an embodiment of the present invention;

[0043] Figure 2 A flowchart illustrating a neural network-based electric shock diagnosis method provided in an embodiment of the present invention;

[0044] Figure 3 This is a schematic diagram of the basic unit structure of the GRU model provided in an embodiment of the present invention;

[0045] Figure 4 A diagram of the GRU-ATT neural network structure provided in an embodiment of the present invention;

[0046] Figure 5 A schematic diagram of the structure of an electric shock diagnosis system based on a neural network provided in an embodiment of the present invention;

[0047] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0048] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. 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 skilled in the art without creative effort are within the scope of protection of the present invention.

[0049] The neural network-based electric shock diagnosis method provided in this application can be applied to, for example... Figure 1In the application environment shown, terminal 101 communicates with server 102 via a network. A data storage system can store the data that server 102 needs to process. The data storage system can be integrated onto server 102 or placed in the cloud or on another network server. Terminal 101 or server 102 collects multiple electric shock signal data during the electric shock experiment, classifies the electric shock signal data into categories of electric shock and non-electric shock, and labels the classified electric shock signal data with electric shock status. It extracts the signal features of the electric shock signal data and optimizes these features using a wrapper feature selection method to obtain optimized signal features. It uses the optimized signal features and their corresponding electric shock status labels as mapping samples to construct a training dataset. It trains the initial GRU-ATT-Transformer neural network model using the training dataset to obtain a trained electric shock diagnosis and prediction model. Finally, it uses the trained electric shock diagnosis and prediction model to perform electric shock diagnosis and prediction on the electric shock signal data for the current calculation period, obtaining the electric shock status prediction result for the current calculation period.

[0050] Terminal 101 can be, but is not limited to, various personal computers, laptops, smartphones, and tablets.

[0051] Server 102 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud computing services.

[0052] like Figure 2 As shown in the embodiments of this application, a neural network-based method for diagnosing electric shock is provided, which is applied to... Figure 1 Taking terminal 101 or server 102 as an example, the explanation includes the following steps S1 to S5. Wherein:

[0053] Step S1: Collect multiple electric shock signal data during the electric shock experiment, classify the electric shock signal data into categories of electric shock and non-electric shock, and label the classified electric shock signal data with electric shock status.

[0054] During the electric shock experiment, high-precision sensors were used to collect electric shock signal data by simulating signal changes under electric shock and non-electric shock conditions. The electric shock signal data included voltage, current waveforms, and other related signals. After collection, the electric shock signal data under electric shock and non-electric shock conditions were clearly distinguished, and each data sample was labeled with a detailed electric shock condition label, including the category of electric shock or non-electric shock.

[0055] Step S2: Extract the signal features of the electric shock signal data, and use the wrap-around feature selection method to optimize the signal features to obtain optimized signal features.

[0056] By performing time-domain and frequency-domain analysis on electric shock signal data, key features reflecting the state of electric shock can be extracted. Time-domain analysis mainly focuses on statistical quantities such as the signal's mean, standard deviation, maximum value, and minimum value, which reflect the signal's variation characteristics over time. Frequency-domain analysis uses Fast Fourier Transform to convert the signal from the time domain to the frequency domain, extracting features such as the amplitude characteristics and spectral entropy of the dominant frequency component.

[0057] Meanwhile, directly inputting features into a deep model after multi-domain feature extraction can lead to problems such as excessive redundant features, high computational cost, and model overfitting. Therefore, this application also utilizes a wrapper-style feature selection method to optimize signal features and remove redundant features.

[0058] Step S3: Use the signal optimization features and their corresponding electric shock signal data electric shock condition labels as mapping samples to construct a training dataset.

[0059] In this process, the optimized signal features, after feature optimization, are paired with corresponding electric shock condition labels to form mapping samples. These mapping samples together constitute the training dataset.

[0060] Step S4: Use the training dataset to train the initial GRU-ATT-Transformer neural network model to obtain a trained electric shock diagnosis prediction model.

[0061] Among them, GRU-ATT (Gated Recurrent Unit with Attention Mechanism) combines the advantages of GRU in processing sequential data with the ability of attention mechanism in capturing key information. GRU can effectively handle long-term dependencies in sequential data through its unique gating structure, while the attention mechanism can automatically assign different weights to different parts of the sequence, thereby highlighting information that is more important to the current task.

[0062] To address the shortcomings of GRU-ATT and enable the model to see both local key aspects and grasp global dependencies and overall trends, this application adds a Transformer global encoder to the above model. This allows the model to introduce a global perspective of the signal into the GRU-ATT framework, avoiding focusing only on the local while ignoring the overall picture. The Transformer structure is also composed of an encoder and a decoder.

[0063] Step S5: Use the trained electric shock diagnosis prediction model to perform electric shock diagnosis prediction on the electric shock signal data of the current calculation period, and obtain the electric shock situation prediction result of the current calculation period.

[0064] Specifically, by performing the same feature extraction and optimization processing on the electric shock signal data for the current calculation period as in step S2, optimized signal features for the current calculation period are obtained. These optimized signal features are then input into a pre-trained electric shock diagnosis and prediction model. Based on its internally learned complex mapping relationships, the model comprehensively analyzes and processes these input features, automatically capturing key information closely related to the electric shock state, and providing a prediction result of the electric shock situation for the current calculation period based on this information.

[0065] It should be noted that, in this embodiment, multiple electric shock signal data are collected during the electric shock experiment, and the electric shock signal data are classified into electric shock and non-electric shock categories. The classified electric shock signal data are labeled with electric shock status, and signal features of the electric shock signal data are extracted. The feature selection method is used to optimize the signal features, thereby removing redundant features. The optimized signal features and their corresponding electric shock status labels are used as mapping samples to construct a training dataset. The initial GRU-ATT-Transformer neural network model is trained using the training dataset. The trained electric shock diagnosis and prediction model is used to perform electric shock diagnosis and prediction on the electric shock signal data of the current calculation period to obtain the electric shock status prediction result of the current calculation period. Thus, by using the GRU-ATT-Transformer neural network, the focus on local features is avoided while ignoring the overall pattern, thereby improving the model's generalization ability and the accuracy of electric shock diagnosis and prediction.

[0066] During electric shock experiments, the acquired signals are often subject to noise interference, which can affect the accuracy of state analysis and fault diagnosis. Failure to process the noisy signals may lead to misdiagnosis. Therefore, noise reduction processing is essential, aiming to preserve as many effective features as possible in the signal while suppressing noise components. To this end, in some embodiments, this method further includes:

[0067] Step S11: Perform fully integrated empirical mode decomposition on the electric shock signal data to obtain several intrinsic mode function components.

[0068] Among them, Complete Ensemble Empirical Mode Decomposition with Adaptive Noise (CEEMDAN) reduces mode aliasing by adding adaptive white noise to the signal and using multiple decompositions to obtain averaged Intrinsic Mode Function (IMF) components, thereby extracting features from the signal more accurately.

[0069] In practice, the steps for fully integrating empirical mode decomposition are as follows:

[0070] 1) Adding noise: Add white noise to the electric shock current signal x(t), where, It is the i-th white noise sequence. :

[0071] (1)

[0072] (2) EMD decomposition: Perform EMD (Empirical Mode Decomposition) on x(t) and extract its first fundamental mode function (IMF):

[0073] (2)

[0074] (3) Calculate the average IMF: Calculate the average IMF of the first IMF of all noise. mean,1 (t):

[0075] (3)

[0076] Subtract the average IMF: To obtain the residual signal, the average value of the first intrinsic mode function (IMF) is removed from the original signal. :

[0077] (4)

[0078] Perform the above procedure for each stage of the residual signal until all IMFi and residual terms are obtained. Finally, x(t) is decomposed into several intrinsic mode function components (IMFs) and residual terms.

[0079] Step S12: Select multiple intrinsic mode function components with frequencies greater than a preset frequency threshold from a number of intrinsic mode function components, and use them as high-frequency intrinsic mode function components.

[0080] This process involves setting a frequency threshold to perform frequency analysis on several intrinsic mode function components obtained from the decomposition. Several components with frequencies exceeding the preset threshold are then selected. These high-frequency components often contain noise components and some high-frequency characteristic information from the signal. Since noise typically exhibits high-frequency oscillations, this selection step allows for a preliminary distinction between noise-related components and valid signal characteristic components.

[0081] Step S13: Decompose multiple high-frequency intrinsic mode function components into several sub-modes using the variational mode decomposition algorithm; wherein, the hyperparameters of the variational mode decomposition algorithm are optimized using the White Shark optimization algorithm.

[0082] First, we assume a high-frequency IMF, IMF i (t) is decomposed into K sub-modes u k (t), and each submode has a finite bandwidth. The center frequency of each mode is defined as w. k Construct a variational problem:

[0083] (5)

[0084] Where δ(t) is the Dirac function; t is the independent variable describing the signal change; ∂t describes the rate of change of the signal or function over time. Next, a Lagrange function Γ is established, and the Lagrange multiplier λ(t) is introduced to transform the constrained optimization problem into an unconstrained optimization problem:

[0085] (6)

[0086] The Lagrangian function is solved iteratively using the alternating direction multiplier method, and each mode u is updated. k (t) and the center frequency wk, until convergence. Finally, the high-frequency IMF is decomposed into several sub-modes u. k (t):

[0087] (7)

[0088] Next, the White Shark Optimizer (WSO) algorithm was used to optimize the parameters (number of modes and penalty factor, etc.) of the Variational Mode Decomposition (VMD) algorithm. The specific optimization process is as follows:

[0089] 1) First, a certain number of white shark individuals are randomly generated to form the initial population. The initialization parameters and the fitness function of the objective function are set, and the positions and movement speeds are randomly generated in the solution space.

[0090] 2) According to each white shark P i The parameters are the fitness values ​​of each great white shark, calculated using a fitness function, which serve as the selection criteria for individual superiority or inferiority.

[0091] 3) During the prey-chasing phase, update the movement speed Vi for each great white shark using the following formula:

[0092] (8)

[0093] In the formula: P Gbest The current globally optimal position; P ibest The optimal implementation position; c1 and c2 are random numbers in the range of 0 to 1; It is a constant.

[0094] 4) Update the position P of each great white shark. i The formula is as follows:

[0095] (9)

[0096] In the formula: r1, r2, and r3 are random numbers in the range [0,1]; D is the distance between the prey and the great white shark; S s This represents the olfactory and visual perception intensity coefficients of the great white shark when tracking and approaching its optimal prey. The upper and lower limits of the maximum number of iterations or fitness value are set as the algorithm's termination conditions. If the termination condition is met, proceed to step 5; otherwise, return to step 2 to continue the optimization process.

[0097] 5) Output the global optimal solution.

[0098] Step S14: Reconstruct the signal using several sub-modes to obtain the reconstructed electric shock signal data.

[0099] This process combines several sub-modes obtained from decomposition. These sub-modes contain the effective signal features retained after optimization, enabling a more accurate reflection of the true state of the electric shock signal. The sub-modes are then reconstructed according to specific rules and algorithms to obtain the reconstructed electric shock signal data. The reconstructed electric shock signal data retains the features closely related to the electric shock state in the original signal while effectively suppressing noise components.

[0100] In some embodiments, the signal characteristics include time-domain signal characteristics and frequency-domain signal characteristics;

[0101] The signal features extracted from electric shock signal data include:

[0102] Step S201: Perform time-domain statistical analysis on the electric shock signal data to obtain time-domain signal characteristics; the time-domain signal characteristics include mean, standard deviation, maximum value, minimum value, skewness, kurtosis, root mean square value, and signal amplitude range.

[0103] Time-domain analysis has received considerable attention in online detection or fault diagnosis systems for various signals because of its simplicity in direct analysis. It utilizes the simple statistical characteristics of signals to represent different types of signals using the most appropriate features.

[0104] In the time-domain feature extraction stage, key data columns are selected from the preprocessed signal. After removing missing and outlier values, a series of classic statistical indicators are calculated. These indicators include: mean, standard deviation, maximum value, minimum value, skewness, kurtosis, root mean square (RMS), and signal amplitude range.

[0105] The mean and standard deviation reflect the concentration and volatility of a signal, respectively; the maximum and minimum values ​​are used to capture extreme response behavior and are often used to detect abrupt changes or abnormal transients; skewness and kurtosis can reflect the symmetry and sharpness of the signal distribution, which are crucial for identifying non-Gaussian features and anomalous impulse responses; the RMS value provides a stability measure from an energy perspective and is widely used to represent the overall strength of a signal; the signal amplitude range reflects the overall amplitude of signal changes and has a certain ability to distinguish signals with drastic dynamic changes.

[0106] Step S202: Perform a fast Fourier transform on the electric shock signal data to obtain the frequency domain data of the electric shock signal.

[0107] Step S203: Extract frequency domain signal features from the frequency domain data of the electric shock signal; wherein, the frequency domain signal features include the amplitude features of the main frequency component and the spectral entropy.

[0108] To further explore the frequency characteristics of the signal, the project introduced the Fast Fourier Transform (FFT) algorithm to map the signal from the time domain to the frequency domain and obtain its spectral structure. By analyzing the spectral amplitude sequence, the amplitude characteristics of the first five dominant frequency components were extracted to capture the main energy distribution of the signal within a specific frequency range. These frequency components are valuable for revealing high-frequency noise, periodic disturbances, or harmonic components. Furthermore, the dominant frequency, i.e., the frequency position with the strongest energy, was calculated as an indicator of the signal's "frequency domain center," providing a basis for identifying anomaly types or load types.

[0109] To further enhance the expressive power of frequency domain features, spectral entropy is used as a measure of frequency domain complexity. Spectral entropy is calculated by applying information entropy to the probability distribution of the normalized spectrum, reflecting the uniformity and uncertainty of the signal's energy distribution in the frequency domain. When signal energy is concentrated in a few frequency points, the spectral entropy is low, indicating a simple structure and strong periodicity; while when energy is widely distributed across multiple frequency bands, the spectral entropy is high, suggesting potential multi-source interference or complex dynamic processes. This indicator demonstrates good sensitivity in scenarios such as monitoring system anomalies and identifying multimodal interference.

[0110] In some embodiments, a wrap-around feature selection method is used to optimize signal features to obtain optimized signal features, including:

[0111] Step S301: Using the recursive feature elimination method, sort the signal features according to their relative importance, and remove the signal features with the lowest relative importance in turn.

[0112] The calculation of the relative importance of signal features involves constructing an initial prediction model based on the selected signal features. This model can be a GRU-ATT-Transformer neural network model or other machine learning models suitable for electric shock diagnosis. Next, the relative importance of each signal feature is quantified by calculating its contribution or influence within the model. This contribution can be measured by the feature's weight in the model's decision-making process and the degree to which changes in the feature affect the model's output.

[0113] After obtaining the relative importance of each signal feature, the signal features are sorted in ascending order. Then, the signal features with the lowest relative importance are removed sequentially from the sorted feature list.

[0114] Step S302: After each removal of signal features, the remaining signal features are evaluated using a preset classifier.

[0115] The preset classifier is a key tool for evaluating the classification performance of the remaining signal features, and its selection should comprehensively consider the characteristics and requirements of the electric shock diagnosis task. In practical applications, classification algorithms such as Support Vector Machine, Random Forest, or Gradient Boosting Trees can be selected as the preset classifier.

[0116] In practice, the remaining signal features are used as input, and a pre-defined classifier is used for training and testing. Classification performance is quantified using metrics such as accuracy, recall, and F1 score. By comparing the changes in classification performance before and after removing different features, the impact of the removed features on the classification results can be intuitively determined. If the classification performance significantly decreases after removing a feature, it indicates that the feature makes a significant contribution to electric shock diagnosis and should be retained. Conversely, if the classification performance changes little or even improves, it suggests that the feature may contain redundant information or noise, and removing it helps improve the model's generalization ability.

[0117] Step S303: Based on the classification performance evaluation results, determine the signal feature combination corresponding to the optimal classification performance, and use it as the signal optimization feature.

[0118] In the recursive feature elimination process, by continuously removing the signal features with the lowest relative importance and using a pre-defined classifier to evaluate the classification performance of the remaining features, a sequence of correspondences between feature combinations and classification performance can be formed. This sequence records the classification performance indicators, such as accuracy, recall, and F1 score, corresponding to the remaining feature combinations after each feature removal.

[0119] By analyzing this sequence, we can find the combination of signal features that corresponds to the optimal classification performance.

[0120] In some embodiments, the initial GRU-ATT-Transformer neural network model includes a GRU-ATT model and a Transformer model;

[0121] The GRU-ATT model is used to optimize the features of the input signal for feature extraction and output the extracted local features.

[0122] The GRU model introduces a reset gate r. t and update gate z t It is used to flexibly control the transmission and forgetting of information, thereby more effectively capturing long-term dependencies in time series. Its basic unit structure is as follows: Figure 3 As shown.

[0123] Throughout the computation process, the gating mechanism plays a crucial role, adjusting the state to realize the hidden state h from the previous time step. t-1 With the current input x t The mechanism involves a detailed interaction between the two. This mechanism essentially involves judging the importance of the electric shock current, in which the sigmoid activation function σ plays a central role in evaluating information retention and updating. The relevant calculation formulas are shown in (10) and (11).

[0124] (10)

[0125] (11)

[0126] The candidate hidden state h is calculated by introducing a reset gate mechanism, which also incorporates the hidden state from the previous time. Its mathematical expression is shown in Equation (12).

[0127] (12)

[0128] Generate hidden state h at the current time step t At that time, the model will extract the hidden state h from the previous time step. t-1The important information in the current candidate state is integrated with the valid content in the current candidate state. This integration process relies on the forgetting mechanism and selective memory ability of the update gate, which work together to determine the output hidden state. The specific mathematical expression of this process can be found in formula (13).

[0129] (13)

[0130] Furthermore, incorporating an attention mechanism into the GRU model helps improve the stability of model training. This mechanism primarily utilizes the encoder-decoder pattern in machine translation, defining the input as:

[0131] (14)

[0132] Meanwhile, the attention mechanism uses a decoder to weight all outputs, aiming to integrate more contextual information and thus improve the model's diagnostic performance. In tasks such as machine translation, the model's output is no longer a single probability value, but an ordered sequence of outputs. Because human language has a strong sequential dependency characteristic—that is, subsequent expressions often depend on preceding content—the model needs to utilize preceding contextual information to predict the current word or fragment, denoted as the output y to be diagnosed during translation.

[0133] (15)

[0134] (16)

[0135] Where g is a nonlinear latent multilevel function used to output y i probability, s i When context information is added to the hidden state of an RNN, the calculation formula becomes:

[0136] (17)

[0137] This demonstrates that the current diagnostic results are correlated with the previous hidden states. In traditional RNN models, the context vector c is typically computed using a stepwise propagation approach from front to back, combined with a gated GRU mechanism to mitigate information loss. However, this chain-like propagation structure inevitably leads to the loss of some information when processing long sequences, limiting the model's ability to remember long-distance dependencies. To overcome this problem, the attention mechanism introduces a comprehensive weighted integration of the entire preceding sequence information when computing c, as shown below:

[0138] (18)

[0139] Among them, a ij It is each hj The weights are calculated as follows:

[0140] (19)

[0141] The GRU-ATT model utilizes an attention mechanism to further establish the mapping relationship between features and power load, strengthening its focus on important information and thus improving the discriminative power and accuracy of prediction results. The overall structure of the GRU-ATT model is as follows: Figure 4 As shown in the figure, the attention mechanism is usually placed before the fully connected layer. Its role is to perform weighted integration of the features extracted by GRU to generate a new representation as the input of the fully connected layer.

[0142] The Transformer model receives local features from the GRU-ATT model and performs global feature extraction on the local features based on a multi-head attention mechanism, outputting a fused feature that combines local and global features. The fused feature is used to construct a mapping relationship with its corresponding electric shock condition label, and the parameters of the Transformer model are adjusted through the backpropagation algorithm until the preset convergence condition is met, thus obtaining a trained electric shock diagnosis and prediction model.

[0143] The Transformer architecture includes an encoder and a decoder. The encoder consists of multiple stacked encoding layers with the same structure. The first layer uses the model's input sequence as input, while subsequent layers use the output of the previous layer as input. Each encoding layer consists of two sub-layers: a multi-head attention mechanism and a fully connected feedforward network. Residual connections are added to each sub-layer, and normalization is performed. The output of the sub-layer is represented as follows: , where x represents the input of the sublayer, and SubLayerx() represents the function representation of the sublayer itself.

[0144] The decoder also consists of multiple stacked decoding layers with the same structure. In addition to the multi-head attention mechanism and fully connected feedforward network sub-layers in the encoding layer, another multi-head attention layer is added to perform multi-head attention operations on the output of the encoder module and the input of the decoder module. Residual connections are also added to each sub-layer and normalized. The multi-head self-attention mechanism is modified to a masked multi-head attention mechanism, using a mask matrix. This allows the decoder to only pay attention to words before the current word, while setting words after the current word as the mask, thus ensuring consistency between training and inference.

[0145] Through the above design, the Transformer module can establish long-range dependencies between electric shock signal segments on a global scale, capture the overall evolution law of complex time-series signals, and use its output as a global feature to fuse with the local features of GRU-ATT, ultimately improving the accuracy and robustness of electric shock signal diagnosis.

[0146] In some embodiments, a trained electric shock diagnosis prediction model is used to perform electric shock diagnosis prediction on the electric shock signal data for the current calculation period to obtain the electric shock situation prediction result for the current calculation period, including:

[0147] Step S501: Extract features from the electric shock signal data of the current calculation period to obtain the signal features of the electric shock signal data of the current calculation period, and use the wrap-around feature selection method to optimize the signal features of the current calculation period to obtain the optimized signal features of the current calculation period.

[0148] Step S502: Input the optimized signal features of the current calculation period into the trained electric shock diagnosis prediction model, and output the electric shock situation prediction result.

[0149] Based on the same inventive concept, this application also provides a neural network-based electric shock diagnosis system for implementing the above-mentioned neural network-based electric shock diagnosis method.

[0150] The solution provided by this system is similar to the solution described in the above method. Therefore, the specific limitations of one or more embodiments of the neural network-based electric shock diagnosis system provided below can be found in the limitations of the neural network-based electric shock diagnosis method described above, and will not be repeated here.

[0151] like Figure 5 As shown, this application also provides a neural network-based electric shock diagnosis system, comprising:

[0152] The data acquisition and processing module 100 is used to acquire multiple electric shock signal data during the electric shock experiment, classify the electric shock signal data into categories of electric shock and non-electric shock, and label the classified electric shock signal data with electric shock status.

[0153] The feature optimization module 200 is used to extract the signal features of the electric shock signal data and optimize the signal features using the wrap-around feature selection method to obtain optimized signal features.

[0154] The dataset construction module 300 is used to construct a training dataset by using the signal optimization features and their corresponding electric shock signal data electric shock situation labels as mapping samples.

[0155] The model training module 400 is used to train the initial GRU-ATT-Transformer neural network model using the training dataset to obtain a trained electric shock diagnosis prediction model.

[0156] The electric shock diagnosis and prediction module 500 is used to perform electric shock diagnosis and prediction on the electric shock signal data of the current calculation period using a trained electric shock diagnosis and prediction model, and to obtain the electric shock situation prediction result of the current calculation period.

[0157] In some embodiments, the system further includes: a signal denoising module, used for:

[0158] A fully integrated empirical mode decomposition was performed on the electric shock signal data to obtain several intrinsic mode function components;

[0159] Multiple intrinsic mode function components with frequencies greater than a preset frequency threshold are selected from a number of intrinsic mode function components and used as high-frequency intrinsic mode function components.

[0160] The variational mode decomposition algorithm is used to decompose multiple high-frequency intrinsic mode function components into several sub-modes; among them, the hyperparameters of the variational mode decomposition algorithm are optimized by the White Shark optimization algorithm.

[0161] The signal is reconstructed using several sub-modes to obtain the reconstructed electric shock signal data.

[0162] In some embodiments, the signal characteristics include time-domain signal characteristics and frequency-domain signal characteristics;

[0163] Feature optimization module 200 is used for:

[0164] Time-domain statistical analysis was performed on the electric shock signal data to obtain time-domain signal characteristics. These characteristics include mean, standard deviation, maximum value, minimum value, skewness, kurtosis, root mean square value, and signal amplitude range.

[0165] Perform a fast Fourier transform on the electric shock signal data to obtain the frequency domain data of the electric shock signal;

[0166] Extract frequency domain signal features from the frequency domain data of electric shock signals; the frequency domain signal features include the amplitude features of the dominant frequency component and the spectral entropy.

[0167] In some embodiments, the feature optimization module 200 is used for:

[0168] The recursive feature elimination method is used to sort the signal features according to their relative importance and then remove the signal features with the lowest relative importance in turn.

[0169] After each removal of signal features, the remaining signal features are evaluated using a pre-defined classifier.

[0170] Based on the classification performance evaluation results, the combination of signal features corresponding to the optimal classification performance is determined as the signal optimization features.

[0171] In some embodiments, the initial GRU-ATT-Transformer neural network model includes a GRU-ATT model and a Transformer model;

[0172] The GRU-ATT model is used to optimize the features of the input signal for feature extraction and output the local features after feature extraction.

[0173] The Transformer model receives local features from the GRU-ATT model and performs global feature extraction on the local features based on a multi-head attention mechanism, outputting a fused feature that combines local and global features. The fused feature is used to construct a mapping relationship with its corresponding electric shock condition label, and the parameters of the Transformer model are adjusted through the backpropagation algorithm until the preset convergence condition is met, thus obtaining a trained electric shock diagnosis and prediction model.

[0174] In some embodiments, the electric shock diagnosis and prediction module 500 is used for:

[0175] Feature extraction is performed on the electric shock signal data of the current calculation period to obtain the signal features of the electric shock signal data of the current calculation period. Then, the feature optimization method of the wrap-around feature selection is used to optimize the signal features of the current calculation period to obtain the optimized signal features of the current calculation period.

[0176] The optimized signal features of the current calculation period are input into the trained electric shock diagnosis and prediction model, and the electric shock situation prediction result is output.

[0177] like Figure 6 As shown, this application provides an electronic device. The electronic device 10 includes a memory 20 and a processor 30. The memory 20 stores a computer program. When the computer program is executed by the processor 30, the processor 30 performs the steps of the neural network-based electric shock diagnosis method as described in the above embodiment.

[0178] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed, implements the steps of the neural network-based electric shock diagnosis method as described in the above embodiments.

[0179] This application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, wherein when the program instructions are executed by a computer, the computer performs the steps of the neural network-based electric shock diagnosis method as described in the above embodiments.

[0180] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, electronic devices, computer storage media, and computer program products described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0181] It should be noted that the terms "comprising" and "having" and any variations thereof in the specification, claims and accompanying drawings of this invention are intended to cover non-exclusive inclusion. 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 explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such processes, methods, products or devices.

[0182] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0183] In the several embodiments provided by this invention, it should be understood that the disclosed systems, electronic devices, computer storage media, computer program products, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.

[0184] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0185] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0186] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for executing all or part of the steps of the methods described in the various embodiments of the present invention through a computer device (which may be a personal computer, a server, or a network device, etc.). The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.

[0187] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A neural network-based method for diagnosing electric shock, characterized in that, include: Multiple electric shock signal data were collected during the electric shock experiment, and the electric shock signal data were classified into categories of electric shock and non-electric shock, and the electric shock status was labeled on the classified electric shock signal data. The signal features of the electric shock signal data are extracted, and the signal features are optimized using a wrap-around feature selection method to obtain optimized signal features. The signal optimization features and their corresponding electric shock condition labels from the electric shock signal data are used as mapping samples to construct a training dataset. The initial GRU-ATT-Transformer neural network model was trained using the training dataset to obtain a trained electric shock diagnosis prediction model. The trained electric shock diagnosis and prediction model is used to perform electric shock diagnosis and prediction on the electric shock signal data of the current calculation period to obtain the electric shock situation prediction result of the current calculation period.

2. The method for diagnosing electric shock based on a neural network according to claim 1, characterized in that, Also includes: The electric shock signal data is subjected to fully integrated empirical mode decomposition to obtain several intrinsic mode function components; Multiple intrinsic mode function components with frequencies greater than a preset frequency threshold are selected from a plurality of intrinsic mode function components and used as high-frequency intrinsic mode function components. The high-frequency intrinsic mode function components are decomposed into several sub-modes using a variational mode decomposition algorithm; wherein the hyperparameters of the variational mode decomposition algorithm are optimized using the White Shark optimization algorithm. The signal is reconstructed using several of the sub-modes to obtain the reconstructed electric shock signal data.

3. The neural network-based electric shock diagnosis method according to claim 1, characterized in that, The signal features include time-domain signal features and frequency-domain signal features; The signal features extracted from the electric shock signal data include: The electric shock signal data is subjected to time-domain statistical analysis to obtain the time-domain signal characteristics; the time-domain signal characteristics include mean, standard deviation, maximum value, minimum value, skewness, kurtosis, root mean square value, and signal amplitude range; Perform a Fast Fourier Transform on the electric shock signal data to obtain the frequency domain data of the electric shock signal; Extract frequency domain signal features from the frequency domain data of the electric shock signal; wherein, the frequency domain signal features include the amplitude features and spectral entropy of the dominant frequency component.

4. The neural network-based electric shock diagnosis method according to claim 1 or 3, characterized in that, The signal features are optimized using a wrapper feature selection method to obtain optimized signal features, including: The recursive feature elimination method is used to sort the signal features according to their relative importance, and the signal features with the lowest relative importance are eliminated in turn. After each removal of signal features, the remaining signal features are evaluated using a pre-defined classifier. Based on the classification performance evaluation results, the combination of signal features corresponding to the optimal classification performance is determined as the optimized signal features.

5. The neural network-based electric shock diagnosis method according to claim 1, characterized in that, The initial GRU-ATT-Transformer neural network model includes a GRU-ATT model and a Transformer model; The GRU-ATT model is used to input the optimized features of the signal for feature extraction and output the local features after feature extraction. The Transformer model receives the local features output by the GRU-ATT model and performs global feature extraction on the local features based on a multi-head attention mechanism, outputting a fused feature that combines the local and global features. The fused feature is used to construct a mapping relationship with its corresponding electric shock condition label, and the parameters of the Transformer model are adjusted through a backpropagation algorithm until a preset convergence condition is met, thus obtaining a trained electric shock diagnosis and prediction model.

6. The neural network-based electric shock diagnosis method according to claim 1 or 5, characterized in that, The step of using the trained electric shock diagnosis prediction model to perform electric shock diagnosis prediction on the electric shock signal data of the current calculation period, and obtaining the electric shock situation prediction result for the current calculation period, includes: Feature extraction is performed on the electric shock signal data of the current calculation period to obtain the signal features of the electric shock signal data of the current calculation period. Then, the signal features of the current calculation period are optimized using the wrap-around feature selection method to obtain the optimized signal features of the current calculation period. The optimized signal features of the current calculation period are input into the trained electric shock diagnosis prediction model, and the electric shock situation prediction result is output.

7. A neural network-based electric shock diagnostic system, characterized in that, include: The data acquisition and processing module is used to acquire multiple electric shock signal data during the electric shock experiment, classify the electric shock signal data into categories of electric shock and non-electric shock, and label the classified electric shock signal data with electric shock status. The feature optimization module is used to extract the signal features of the electric shock signal data and optimize the signal features using a wrap-around feature selection method to obtain optimized signal features. The dataset construction module is used to construct a training dataset by using the signal optimization features and their corresponding electric shock signal data electric shock condition labels as mapping samples. The model training module is used to train the initial GRU-ATT-Transformer neural network model using the training dataset to obtain a trained electric shock diagnosis prediction model. The electric shock diagnosis and prediction module is used to perform electric shock diagnosis and prediction on the electric shock signal data of the current calculation period using the trained electric shock diagnosis and prediction model, and to obtain the electric shock situation prediction result of the current calculation period.

8. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of the neural network-based electric shock diagnosis method as described in any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed, it implements the steps of the neural network-based electric shock diagnosis method as described in any one of claims 1-6.

10. A computer program product, characterized in that, The computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, wherein when the program instructions are executed by a computer, the computer performs the steps of the neural network-based electric shock diagnosis method as described in any one of claims 1-6.