Electric shock diagnosis method, system, device, medium and product
By using a dual-channel CNN-LSTM-KAN deep neural network and an MFIEN denoising model, the problem of insufficient sensitivity of leakage protection devices in DC systems is solved, achieving high accuracy and reliability in electric shock diagnosis and ensuring early identification and classification of electric shock events.
Patent Information
- Application Number
- CN202511670575.9
- 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
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.
A dual-channel CNN-LSTM-KAN deep neural network is used to acquire electric shock signal data, extract signal features, construct a training dataset, and train the model using the deep neural network to build an electric shock diagnosis and prediction model. The model is then combined with the MFIEN denoising model and principal component analysis method using non-dominated sorting genetic algorithm to improve the model's recognition accuracy and reliability.
It improves the accuracy and reliability of electric shock diagnosis, enhances the model's generalization ability, and enables real-time monitoring and early warning of electric shock conditions.
Smart Images

Figure CN121456443A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power systems, and in particular to a shock diagnosis method, system, device, medium and product. BACKGROUND
[0002] With the rapid development of direct current power supply technology, low-voltage direct current distribution systems have been widely used in intelligent buildings, rail transit, data centers, and new energy power distribution due to their energy-saving and efficient, easy to control, and other advantages. However, compared with the traditional alternating current system, the direct current system has no current zero point, long shock duration, and significant changes in human body impedance over time, making it more hidden and dangerous in terms of shock risk, especially when the grounding method is not clear or the insulation level is low, which can easily lead to serious accidents.
[0003] The widely used leakage protection device in the direct current system faces problems such as insufficient sensitivity, slow response, high false alarm rate, and poor adaptability, making it difficult to meet the early identification and accurate classification needs of shock events under complex conditions. SUMMARY
[0004] Therefore, in order to solve the above technical problems, the present application provides a shock diagnosis method, system, device, medium and product.
[0005] The first aspect of the present application provides a shock diagnosis method, comprising:
[0006] Obtaining a plurality of shock signal data of a shock object in a shock simulation test, and labeling whether the shock signal data is shocked or not;
[0007] Extracting shock signal features of the shock signal data;
[0008] Using the shock signal data, the shock signal features, and the label of whether the shock is or not, a training data set is constructed;
[0009] Using the training data set to train a double-channel CNN-LSTM-KAN deep neural network to obtain a shock diagnosis prediction model; wherein the double-channel CNN-LSTM-KAN deep neural network is used to input the shock signal data and the shock signal features into a 1D-CNN network and a fully connected network respectively for feature processing, and the feature vectors output by the 1D-CNN network and the fully connected network are fused, and the fused feature vectors and the label of whether the shock is or not are used to train the LSTM-KAN deep neural network;
[0010] Using the trained shock diagnosis prediction model to diagnose and predict the shock signal data of the current calculation period to obtain the shock diagnosis result of the shock object.
[0011] Preferably, the method further comprises: denoising the electric shock signal data by using the MFIEN denoising model.
[0012] Preferably, the electric shock signal features comprise time domain signal features, frequency domain signal features and image modal features.
[0013] The extracting the electric shock signal features of the electric shock signal data comprises:
[0014] The time domain signal features of the electric shock signal data are extracted by using a time domain analysis method.
[0015] The frequency domain signal features of the electric shock signal data are extracted by using a fast Fourier transform.
[0016] The time sequence waveform of the electric shock signal data is mapped into a Markov transition matrix image, and texture information of the Markov transition matrix image is extracted by a convolutional neural network as the image modal features.
[0017] Preferably, the method further comprises: reducing the dimension of the electric shock signal features based on a non-dominated sorting genetic algorithm principal component analysis method.
[0018] Preferably, the method further comprises: optimizing hyperparameters in the double-channel CNN-LSTM-KAN deep neural network by using a Bayesian optimization.
[0019] Preferably, the double-channel CNN-LSTM-KAN deep neural network comprises an input module, a double-channel convolution module, a feature fusion layer, an LSTM time modeling module, a KAN nonlinear mapping and gating module, a residual connection module and an output classification layer.
[0020] The input module is configured to input the electric shock signal data and the electric shock signal features, and output the electric shock signal data and the electric shock signal features to the double-channel convolution module.
[0021] The double-channel convolution module comprises a 1D-CNN network and a fully connected network.
[0022] The 1D-CNN network is configured to input the electric shock signal data and extract convolutional features of the electric shock signal data to obtain a first feature vector; and the fully connected network is configured to input the electric shock signal features and perform feature mapping on the electric shock signal features to obtain a second feature vector.
[0023] The feature fusion layer is configured to receive the first feature vector and the second feature vector, and perform fusion processing on the first feature vector and the second feature vector to obtain a fusion feature vector.
[0024] The LSTM time modeling module is configured to receive the fusion feature vector and perform time series modeling on the fusion feature vector to capture time sequence dependency in the electric shock signal data, and obtain time sequence dependent features.
[0025] The KAN nonlinear mapping and gating module is configured to perform nonlinear mapping and gating processing on the time sequence dependent features output by the LSTM time modeling module, and obtain enhanced features.
[0026] The residual connection module is configured to perform residual connection between the enhanced features and the fusion feature vector, and obtain residual connection features.
[0027] The output classification layer is configured to receive the residual connection features and output an electric shock diagnosis binary classification result through an activation function, where the electric shock diagnosis binary classification result is used to represent a label indicating whether the electric shock object is electrically shocked.
[0028] In a second aspect, the present application further provides an electric shock diagnosis system, comprising:
[0029] A data acquisition module is configured to acquire a plurality of electric shock signal data of an electric shock object in an electric shock simulation test, and label whether the electric shock object is electrically shocked for each of the electric shock signal data.
[0030] A feature extraction module is configured to extract electric shock signal features of the electric shock signal data.
[0031] A data set construction module is configured to construct a training data set by using the electric shock signal data, the electric shock signal features, and the label of whether the electric shock object is electrically shocked.
[0032] A model training module is configured to train a double-channel CNN-LSTM-KAN deep neural network by using the training data set, and obtain an electric shock diagnosis prediction model, where the double-channel CNN-LSTM-KAN deep neural network is configured to input the electric shock signal data and the electric shock signal features into a 1D-CNN network and a fully connected network respectively for feature processing, fuse feature vectors output by the 1D-CNN network and the fully connected network respectively, and train an LSTM-KAN deep neural network by using the fused feature vectors and the label of whether the electric shock object is electrically shocked.
[0033] An electric shock diagnosis prediction module is configured to perform electric shock diagnosis prediction on electric shock signal data of a current calculation period by using the trained electric shock diagnosis prediction model, and obtain an electric shock diagnosis result of the electric shock object.
[0034] In a third aspect, the present application further provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the computer program is executed by the processor to enable the processor to perform the steps of the electric shock diagnosis method according to the first aspect.
[0035] In a fourth aspect, the present application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed to implement the steps of the electric shock diagnosis method according to the first aspect.
[0036] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program stored in a non-transitory computer readable storage medium, and the computer program comprises program instructions, wherein the program instructions are executed by a computer to enable the computer to perform the steps of the electric shock diagnosis method according to the first aspect.
[0037] As can be seen from the above technical solutions, the present application obtains multiple electric shock signal data of an electric shock object in an electric shock simulation test, labels whether the electric shock signal data is electric shock or not, extracts electric shock signal features of the electric shock signal data, constructs a training data set by using the electric shock signal data, the electric shock signal features and the label of whether the electric shock signal data is electric shock or not, and trains a double-channel CNN-LSTM-KAN deep neural network by using the training data set, so as to fully utilize the electric shock signal data and its feature information by using a double-input structure, effectively improve the recognition accuracy of the model to the electric shock state, ensure the accuracy and reliability of the electric shock diagnosis result, and improve the generalization ability of the model to the electric shock diagnosis. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without any creative labor.
[0039] Figure 1 An application environment diagram of the electric shock diagnosis method provided by the embodiments of the present application;
[0040] Figure 2 A flowchart of the electric shock diagnosis method provided by the embodiments of the present application;
[0041] Figure 3 A structural schematic diagram of a convolutional neural network;
[0042] Figure 4 An LSTM structural schematic diagram;
[0043] Figure 5 is a KAN network architecture diagram;
[0044] Figure 6 is a structural schematic diagram of a touch diagnosis system provided by an embodiment of the present application;
[0045] Figure 7 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative labor fall within the scope of protection of the present application.
[0047] The touch diagnosis method provided by the embodiments of the present application can be applied in an application environment as shown in Figure 1 The terminal 101 communicates with the server 102 through a network. The data storage system can store data required to be processed by the server 102. The data storage system can be integrated on the server 102, or placed on a cloud or other network server. The terminal 101 or the server 102 acquires a plurality of touch signal data of a touch object in a touch simulation test, and labels whether each touch signal data is touched or not; extracts touch signal features of the touch signal data; constructs a training data set by using the touch signal data, the touch signal features and the label of whether the touch signal data is touched or not; trains a double-channel CNN-LSTM-KAN deep neural network by using the training data set, to obtain a touch diagnosis prediction model; wherein the double-channel CNN-LSTM-KAN deep neural network is used to input the touch signal data and the touch signal features into a 1D-CNN network and a full connection network respectively for feature processing, and fuse the feature vectors output by the 1D-CNN network and the full connection network respectively, and train an LSTM-KAN deep neural network by using the fused feature vectors and the label of whether the touch signal data is touched or not; and the trained touch diagnosis prediction model is used to perform touch diagnosis prediction on touch signal data of a current calculation period, to obtain a touch diagnosis result of the touch object.
[0048] The terminal 101 can be, but is not limited to, various personal computers, notebook computers, smart phones and tablet computers, etc.
[0049] The server 102 can be a stand-alone physical server, a server cluster composed of multiple physical servers or a distributed system, or a cloud server providing cloud computing services.
[0050] As shown in Figure 2 The embodiment of the present application provides a method for diagnosing electric shock, which is applied to the terminal 101 or the server 102 in Figure 1 for example, and includes the following steps S1 to S5. Wherein:
[0051] Step S1, obtaining a plurality of electric shock signal data of an electric shock object in an electric shock simulation test, and labeling whether the electric shock signal data is electric shock or not.
[0052] Wherein, the electric shock signal data includes current signal, and the electric shock object is an entity used for electric shock simulation test, which can be a specific device simulating electric shock scene. When obtaining the electric shock signal data, the safety of the test environment and the accuracy of the data acquisition need to be ensured, and the current signal change is recorded in real time by a high-precision sensor. The electric shock signal data includes electric shock signal data when electric shock occurs and electric shock signal data when electric shock does not occur, and the electric shock signal data is labeled whether it is electric shock or not. Wherein, the electric shock signal data when electric shock occurs is labeled as 1, and the electric shock signal data when electric shock does not occur is labeled as 0.
[0053] Step S2, extracting electric shock signal features of the electric shock signal data.
[0054] Wherein, important attributes representing the electric shock state are extracted from the original electric shock signal data, which are used for efficient training and classification of the model.
[0055] Step S3, constructing a training data set by using the electric shock signal data, the electric shock signal features and the label of whether the electric shock occurs or not.
[0056] Wherein, by mapping and combining the electric shock signal data, the electric shock signal features and the label of whether the electric shock occurs or not, a complete and accurately labeled data set is formed.
[0057] Step S4, training a double-channel CNN-LSTM-KAN deep neural network by using the training data set to obtain an electric shock diagnosis prediction model; wherein the double-channel CNN-LSTM-KAN deep neural network is used to input the electric shock signal data and the electric shock signal features into the 1D-CNN network and the full connection network respectively for feature processing, and the feature vectors output by the 1D-CNN network and the full connection network are fused, and the fused feature vectors and the label of whether the electric shock occurs or not are used to train the LSTM-KAN deep neural network.
[0058] The dual-channel CNN-LSTM-KAN (Convolutional Neural Network-Long Short-Term Memory-KAN attention mechanism) deep neural network combines the advantages of a convolutional neural network in feature extraction, the ability of a long short-term memory network in time series data processing, and the characteristics of a KAN module in nonlinear mapping and gating processing, and collectively builds an efficient and accurate electric shock diagnosis prediction model.
[0059] Specifically, the 1D-CNN network is responsible for capturing the spatial features in the electric shock signal data, and the fully connected network performs deep mapping on the extracted electric shock signal features. The feature vectors output by the two are organically combined in the feature fusion layer to form more representative fusion feature vectors. Subsequently, the LSTM-KAN deep neural network trains using these fusion feature vectors and the labels of whether the electric shock occurs or not, thereby constructing an efficient and accurate electric shock diagnosis prediction model.
[0060] Step S5, 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 to obtain the electric shock diagnosis result of the electric shock object.
[0061] Among them, by inputting the electric shock signal data of the current calculation period and the electric shock signal features corresponding to the electric shock signal data into the trained electric shock diagnosis prediction model, the model can quickly analyze and output the electric shock diagnosis result, which clearly indicates whether the electric shock object is currently in an electric shock state. This process realizes real-time monitoring and early warning of electric shock.
[0062] It should be noted that the embodiments of the present application obtain a plurality of electric shock signal data of the electric shock object in the electric shock simulation test, and label the electric shock or not of each electric shock signal data. The electric shock signal features of the electric shock signal data are extracted, and the electric shock signal data, the electric shock signal features, and the labels of whether the electric shock occurs or not are used to construct a training data set. The dual-channel CNN-LSTM-KAN deep neural network is trained using the training data set, thereby fully utilizing the electric shock signal data and its feature information through the dual-input structure, effectively improving the recognition accuracy of the model for the electric shock state, ensuring the accuracy and reliability of the electric shock diagnosis result, and improving the generalization ability of the model for electric shock diagnosis.
[0063] The signals collected in the electric shock experiment are often mixed with different degrees of noise interference, which will affect the recognition of the essential characteristics of the signal by the diagnostic model, thereby interfering with the subsequent state analysis and fault judgment. If these noisy data are not properly processed, the diagnostic results may be biased, or even lead to incorrect judgments. Therefore, it is necessary to perform noise reduction operation on the electric shock current in a strong noise environment to minimize the interference of invalid components while maximizing the preservation of key information in the original signal that is valuable for electric shock behavior discrimination. In some embodiments, the MFIEN denoising model is used to denoise the electric shock signal data.
[0064] wherein MFIEN (Multi-scale Feature Integration Enhanced Noise Reduction Model) is capable of effectively separating the noise components and effective features in the electric shock signal through a multi-scale feature extraction and fusion mechanism.
[0065] Specifically, the MFIEN denoising model includes a multi-scale feature interaction module (MFIM) and a fusion feature enhancement module (FFEM). The initially input electric shock data is first processed by means of 3x3 convolution, and the obtained preliminary features are used as the input of the MFIM. In addition, a bypass link is connected to the 3x3 convolution block after the MFIM model to capture the potential features contained in the electric shock current data of different resolutions. The FFEM uses a hollow convolution to obtain multi-scale features, and with these multi-scale features, the denoising performance can be effectively improved even in the presence of strong electric shock noise.
[0066] Generally, the collected electric shock current data X is always contaminated by noise, which can be represented as follows:
[0067] (1)
[0068] In the formula, n represents random noise, and s represents effective signal.
[0069] Since the background noise and the effective signal of the electric shock signal data are in a similar frequency range, the effect of traditional denoising methods is limited. The MFIM model associates the noise n with the noisy data X, and through this mapping, the clean signal is reconstructed and the strong noise is effectively separated. By predicting the noise and making it highly consistent with the true noise data characteristics, the reconstruction of the noise is achieved, and then the noise components are removed to restore the signal. The training process of the MFIM model can be represented by the following equation:
[0070] (2)
[0071] (3)
[0072] where RES represents residual learning, and θ denotes the hyperparameters of the network, denotes the predicted noise from the noisy record, X denotes the contact current data, n denotes the random noise, and argmin denotes the parameter value that achieves the minimum. The optimization process is shown in equation (3), which calculates the prediction bias using the L2 loss function and updates the network weights of MFIEN based on gradient backpropagation.
[0073] (4)
[0074] where B denotes the batch normalization size, and denote the effective signal and noise patches, respectively, denotes the Frobenius norm. Finally, the predicted noise is subtracted from the original contact data to obtain the desired clean data :
[0075] (5)
[0076] In some embodiments, the contact signal features include time domain signal features, frequency domain signal features, and image modal features; in this case, the contact signal features of the contact signal data are extracted, including:
[0077] Step S201, extracting time domain signal features of the contact signal data using a time domain analysis method.
[0078] where the time series data of the contact signal data is subjected to time domain feature extraction using a time domain analysis method, and the main calculation indicators include mean, variance, range, kurtosis, skewness, kurtosis, root mean square value, signal energy, etc., which are used to represent the volatility, concentration, symmetry, and intensity characteristics of the current signal.
[0079] Step S202, extracting frequency domain signal features of the contact signal data using fast Fourier transform.
[0080] where fast Fourier transform (FFT) is applied in the frequency domain to extract frequency domain signal features, including main frequency components, spectral entropy, harmonic energy ratio, frequency shift rate, etc., which depict the energy distribution and periodic changes of the contact waveform in the frequency domain, and can identify hidden patterns such as power harmonic interference and periodic signal fluctuations caused by insulation defects.
[0081] In step S203, the time sequence waveform of the electric shock signal data is mapped into a Markov transition matrix image, and texture information of the Markov transition matrix image is extracted by a convolutional neural network as image modal features.
[0082] In the embodiment, the time sequence waveform of the electric shock signal data is mapped into a Markov transition matrix image, which can intuitively show the transition probability of the electric shock signal between different states and provide rich image modal information for subsequent feature extraction.
[0083] In the embodiment, the convolutional neural network is used to extract deep features of the Markov transition matrix image, which can effectively capture subtle changes and patterns in the image, thereby obtaining image modal features with discriminability. These features are combined with the previously extracted time domain signal features and frequency domain signal features to form a comprehensive feature representation of the electric shock signal data, which provides more rich and accurate information input for subsequent electric shock diagnosis and prediction models.
[0084] In some embodiments, to enhance the discriminability of the electric shock signal features and improve the efficiency of model training, the electric shock signal features are processed by dimension reduction based on a principal component analysis method of a non-dominated sorting genetic algorithm.
[0085] In the embodiment, the non-dominated sorting genetic algorithm II (NSGA) is combined with the principal component analysis method (PCA) to form a PCA-NSGA-II algorithm for data dimension reduction.
[0086] In the embodiment, the PCA processing process is as follows: the original data is mapped into a new coordinate system by linear transformation, so that the new coordinate axis (principal component) retains as much variance information in the original data as possible, thereby realizing data dimension reduction. The specific steps are as follows:
[0087] 1) The mean value of each feature is zeroed and the standard deviation is normalized to ensure that each feature is in the same dimension:
[0088] (6)
[0089] Wherein, μ is the mean value of the feature, and σ is the standard deviation of the feature.
[0090] 2) For the standardized data, the covariance matrix of the data matrix is calculated:
[0091] (7)
[0092] Wherein, n is the number of samples, X std is the standardized sample matrix.
[0093] 3) Perform eigen decomposition on the covariance matrix C to get eigenvalues and eigenvectors:
[0094] (8)
[0095] where λ i is the eigenvalue and v i is the eigenvector.
[0096] 4) Select the top k eigenvectors (principal components) corresponding to the top k eigenvalues based on their size. These principal components represent the directions with the largest variance in the data. The matrix composed of the top k principal components is the matrix of the top k principal components.
[0097] 5) Project the standardized data onto the selected principal components to get the reduced dimension data:
[0098] (9)
[0099] NSGA-II processing process:
[0100] Non-dominated Sorting Genetic Algorithm II is an improved algorithm of traditional genetic algorithm. This algorithm uses elite strategy to eliminate and retain the population, and proposes a fast non-dominated sorting method, which repeatedly promotes the evolution process of the external elite population, reduces the sensitivity of the algorithm to initial values, improves the efficiency of the algorithm and is more suitable for handling multi-objective optimization problems.
[0101] The algorithm flow is as follows:
[0102] First, encode the solution of the PCA parameter optimization problem as a chromosome, usually the top k principal components extracted by PCA and other hyperparameters. Then, randomly generate an initial population, and each individual represents a PCA parameter configuration. Evaluate the pros and cons of each individual through the fitness function, which includes but is not limited to reconstruction error, dimension k size, and possible downstream task performance. In NSGA-II, fast non-dominated sorting is used to stratify individuals, and according to the dominance relationship, they are divided into different front levels, and the crowding distance (measuring the distance between each individual and adjacent solutions) is used to maintain the diversity of the population.
[0103] In the selection operation, prefer to retain individuals with low order values (i.e. better in the dominance relationship), and combine the crowding degree to select solutions with sparse distribution, so as to avoid the population falling into local optimal solution. Through crossover operation, the global search ability is enhanced, and a wider solution space is explored; mutation operation is used to enhance the local search ability, and to refine some areas of the solution space, so as to find better solutions. The elite strategy ensures that excellent individuals are retained in each generation, thereby preventing the loss of high-quality solutions during optimization.
[0104] The algorithm updates the population in each iteration until the convergence condition is met (e.g., reaching the maximum number of iterations, the fitness is stable, or the quality of the solution is high enough). Through multi-objective collaborative optimization, NSGA-II can efficiently search the solution space in dimension reduction tasks and finally output a uniformly distributed Pareto optimal solution set. This solution set can provide different PCA parameter configurations that achieve the best balance between reconstruction error, dimensionality k, and downstream task performance.
[0105] In the application of PCA-NSGA-II combination, NSGA-II optimizes the related hyperparameters of PCA (such as dimension k, kernel type, etc.) to achieve the best trade-off between multiple objectives for the data after dimension reduction.
[0106] In some embodiments, the method also utilizes Bayesian optimization of hyperparameters in the two-channel CNN-LSTM-KAN deep neural network.
[0107] The hyperparameters include learning rate, batch size, network layer number, neuron number, and regularization coefficient, etc.
[0108] Bayesian optimization is to express the posterior distribution of the objective function under the current known information by constructing an iteratively updated probability model. Considering the uncertainty of the objective function itself and the high evaluation cost, this method can effectively predict the region of the optimal parameters with only a small number of experiments, gradually guide the search process, and finally obtain the combination of hyperparameters with the best performance.
[0109] The process of Bayesian optimization is as follows:
[0110] Suppose there is a function that needs to be found in , and the calculation formula is shown in equation (10):
[0111] (10)
[0112] Where X represents the search space of x, x* represents the best parameter set, is the objective function.
[0113] Bayesian optimization algorithms consist of two core components: a probabilistic surrogate model and a sampling function. The surrogate model approximates the unknown objective function by progressively acquiring sample information and updating the prior distribution to improve the model's accuracy in approximating the objective function. As the optimization process progresses, this model more accurately reflects the shape of the true function. The sampling function relies on the posterior probability distribution generated by the surrogate model. It weighs the performance of "known regions" against the "potential of unknown regions" in the search space to determine the next most promising sampling point, aiming to maximize the optimization process. In Bayesian optimization, the most common surrogate model is the Gaussian Process (GP), which constructs the posterior distribution of the objective function based on existing sampling points and assumes that the hyperparameters follow a Gaussian distribution. This distribution allows estimation of the predicted mean and uncertainty (i.e., standard deviation) of each candidate point. Locations with higher means are considered "exploitation" regions, indicating that the model predicts better performance at those points; while locations with larger standard deviations belong to "exploration" regions, meaning that the value of those points is unknown but has greater potential. The acquisition function dynamically balances these two strategies to achieve efficient optimization of the global optimum.
[0114] The core task of the acquisition function is to balance "utilizing known information" and "exploring unknown regions," providing a strategic basis for selecting sample points in the next step by assessing the probability that the current point may be better than the historical optimal solution. In the Bayesian optimization process, the design of the acquisition function has a decisive impact on the algorithm performance and is one of the key factors affecting the optimization speed and accuracy. This application adopts Expected Improvement (EI) as the acquisition strategy, and its mathematical expression is shown in equations (11) and (12):
[0115] (11)
[0116] (12)
[0117] in, c is the current maximum value, and c is the scalar tradeoff between exploration and development. It is the mean function. It is a variance function. and These represent the standard normal cumulative distribution and the standard normal distribution, respectively.
[0118] Before building the model, the objective function to be optimized needs to be determined first. This function takes the model's hyperparameters as input and outputs an indicator of the model's performance, such as the root mean square error or the mean absolute error. In this step, the evaluation criterion chosen is the loss value of the model, and the goal is to minimize this loss function to achieve the optimal performance of the model.
[0119] Subsequently, the set of hyperparameters to be optimized and their corresponding value intervals need to be set, forming a complete hyperparameter search space.
[0120] Next, the Bayesian optimization algorithm is introduced, and a surrogate model is constructed through Gaussian process regression to explore the entire hyperparameter space. In each iteration, Bayesian optimization selects the most promising set of hyperparameters based on the output of the acquisition function (such as the expected improvement function EI) for subsequent experiments.
[0121] For each selected combination of hyperparameters, the model needs to be trained on the training set and evaluated on the validation set. Finally, according to the feedback of the objective function, the set of hyperparameters that minimizes the loss is selected as the optimal configuration of the model.
[0122] In some embodiments, the dual-channel CNN-LSTM-KAN deep neural network includes an input module, a dual-channel convolution module, a feature fusion layer, an LSTM time modeling module, a KAN nonlinear mapping and gating module, a residual connection module, and an output classification layer.
[0123] The input module is used to input the electric shock signal data and electric shock signal features, and outputs the electric shock signal data and electric shock signal features to the dual-channel convolution module.
[0124] The dual-channel convolution module includes a 1D-CNN network and a fully connected network.
[0125] The 1D-CNN network is used to input the electric shock signal data and extract convolutional features from the electric shock signal data to obtain a first feature vector; the fully connected network is used to input the electric shock signal features and map the features to obtain a second feature vector.
[0126] The 1D-CNN network is responsible for processing the original time series data. The typical architecture of 1D-CNN includes the following core components: input layer, convolutional layer, pooling layer, fully connected layer, and output layer, with detailed structure as shown in Figure 3 The input layer receives the original one-dimensional sequence data; the convolutional layer extracts local features of the input sequence by sliding one-dimensional convolutional kernels on the sequence; the pooling layer reduces the dimension of the feature data through max-pooling or average-pooling operations to reduce the risk of overfitting; the fully connected layer maps the extracted features to the output space; and the output layer generates the final output according to the task type.
[0127] 1D-CNN network contains two layers of convolutional structure, respectively configured with 16 3x1 and 32 5x1 convolutional kernels, for extracting local structural features from current waveform, such as spike response, transient disturbance, edge jump, etc. After each layer of convolution operation, ReLU activation and max pooling operation are connected, and the output is flattened after the operation.
[0128] The fully connected network receives the standardized electric shock signal features. The channel is configured with two layers of dimension-increasing FC layers (such as 64→128 dimensions), so that the low-dimensional numerical features are mapped to a high-dimensional semantic space, facilitating alignment with the CNN channel output vector when feature fusion is performed.
[0129] The feature fusion layer is used to receive the first feature vector and the second feature vector, and fuse the first feature vector and the second feature vector to obtain a fused feature vector.
[0130] Among them, the vectors output by the two channels are spliced in the feature fusion layer to construct a fused high-dimensional representation vector. This representation has both local detail perception and global statistical perspective, and has a more comprehensive description capability, providing a rich information foundation for subsequent modeling.
[0131] The LSTM time modeling module is used to receive the fused feature vector and perform time series modeling on the fused feature vector to capture the time sequence dependence relationship in the electric shock signal data, and obtain a time sequence dependent feature.
[0132] Among them, the fused vector is input into the LSTM network in a time sequence manner. LSTM has the ability to model long-term dependencies in time series, and can extract current evolution trends, reaction lags, periodic responses, and other dynamic changes in multi-frame waveform data, further enhancing the understanding of the evolution of electric shock signals. The structure of LSTM is shown in Figure 4 The key mechanisms include the forgetting gate, the input gate, the output gate, and the memory cell state update, which gradually filter and pass time sequence information. The last time step hidden state output is used as a compressed representation of the time sequence feature.
[0133] The working process of LSTM includes:
[0134] 1) Initialization phase
[0135] Initialize memory cell state C and hidden state h o The memory cell is the core of LSTM, which is used to store long-term information and pass it through time steps.
[0136] 2) Forgetting phase
[0137] The forgetting gate determines which information needs to be discarded from the memory cell. The output of the forgetting gate is a value between 0 and 1 generated by the sigmoid function, where 0 represents complete discard and 1 represents complete retention. Its expression is:
[0138] (13)
[0139] In the formula, W f It is the weight matrix of the forget gate, h t-1 It is the hidden state of the previous time step, xt is the input of the current time step, and b is the hidden state of the previous time step. f σ is the bias term of the forget gate, and σ is the sigmoid activation function with an output value between 0 and 1.
[0140] 3) Selective memory update
[0141] The input gate works in conjunction with the candidate memory unit through an activation function. The former regulates the intensity of information updates, while the latter generates new features to be stored, jointly determining the information increment of the memory unit. Its expression is:
[0142] (14)
[0143] (15)
[0144] 4) Memory unit update
[0145] The state of a memory cell is passed through time steps, and at each time step, the state of the memory cell is updated by combining information from the forget gate and the input gate. Its expression is:
[0146] (16)
[0147] 5) Output stage
[0148] Output gate o t This determines which information from the memory unit will be output to the hidden state, thus affecting the output at the current time step. Its expression is:
[0149] (17)
[0150] 6) Update hidden status
[0151] After obtaining the updated memory state, the hidden state for this time step can be calculated by combining it with the current activation value of the output gate. The expression is as follows:
[0152] (18)
[0153] At each time step, LSTM updates the memory cells through six internal mechanisms and outputs new hidden states to enable the continuous transmission of information in the sequence.
[0154] The KAN nonlinear mapping and gating module is configured to perform nonlinear mapping and gating processing on the time-dependent features output by the LSTM time modeling module, to obtain enhanced features.
[0155] To enhance the separability and interpretability of the decision boundary, a KAN layer is introduced between the LSTM output and the classification layer. The KAN performs high-dimensional nonlinear mapping on the fused time-dependent features using piecewise spline basis functions, and adopts a learning knots + sparsity and smoothing regularization manner, which not only improves the fitting ability of the model to complex boundaries, but also suppresses overfitting and facilitates visual interpretation. Meanwhile, the KAN gate generates channel-by-channel weights using statistical features as input, which realizes dynamic re-scaling of the CNN / LSTM representation, strengthens the response to key transients such as rising edges and spikes, and suppresses power / harmonic interference.
[0156] The construction steps of the KAN are as follows:
[0157] 1) The multi-dimensional input data is decomposed into several one-dimensional subspaces through linear transformation to ensure the separability of the input control;
[0158] 2) A plurality of one-dimensional functions (such as simple nonlinear activation functions ReLU, sigmoid, etc.) are used to map the decomposed subspaces;
[0159] 3) The mapping results are weighted and summed to restore the original multi-dimensional input representation;
[0160] 4) The weighted sum result is input into the final output layer to generate the prediction result of the input data. The network architecture of the KAN is shown in Figure 5 .
[0161] The residual connection module is configured to perform residual connection between the enhanced features and the fused feature vector, to obtain residual connection features.
[0162] To enhance the deep feature transmission capability and avoid gradient disappearance, a residual connection is established between the enhanced features and the fused feature vector of the previous stage, which is complementary to the KAN output, effectively preserving the multi-scale information that contributes to discrimination.
[0163] The output classification layer is configured to receive the residual connection features and output the electric shock diagnosis binary classification result through an activation function. The electric shock diagnosis binary classification result is used to represent the label of whether the object is electrically shocked.
[0164] The representation after KAN mapping and residual compensation is input into the classification head to complete the binary classification task. The “whether electrically shocked” is set as the output target and the output dimension, and the Softmax or Sigmoid is used as the activation function. The loss function can be cross-entropy or focal loss, and the KAN sparsity / smoothing regularization and missed detection penalty can be stacked to meet the safety constraints and generalization requirements.
[0165] The entire CNN-LSTM-KAN network ensures complete retention of data features through a double-channel structure: the CNN focuses on modeling short-term changes in the current waveform, the statistical feature channel provides stability and interpretability, the LSTM introduces time dependence to improve the extraction capability of time-varying features, and the KAN enhances the separability and interpretability of the decision boundary through nonlinear mapping and gated rescaling of the piecewise spline, suppresses overfitting, and weights key transients, ultimately building a set of high-precision, strong generalization, real-time, and highly reliable electric shock diagnosis and prediction model.
[0166] Based on the same inventive concept, the embodiments of the present application also provide an electric shock diagnosis system for implementing the above-mentioned electric shock diagnosis method.
[0167] The implementation scheme for solving the problem provided by the system is similar to the implementation scheme described in the above method, so the specific limitations in one or more electric shock diagnosis system embodiments provided below can refer to the limitations of the electric shock diagnosis method in the foregoing, which will not be described here.
[0168] As Figure 6 shown, the embodiments of the present application also provide an electric shock diagnosis system, comprising:
[0169] A data acquisition module 100 is configured to acquire a plurality of electric shock signal data of an electric shock object in an electric shock simulation test, and label whether each electric shock signal data is electric shock or not;
[0170] A feature extraction module 200 is configured to extract electric shock signal features of the electric shock signal data;
[0171] A data set construction module 300 is configured to construct a training data set using the electric shock signal data, the electric shock signal features, and the label of whether the electric shock is or not;
[0172] A model training module 400 is configured to train a double-channel CNN-LSTM-KAN deep neural network using the training data set to obtain an electric shock diagnosis and prediction model; wherein the double-channel CNN-LSTM-KAN deep neural network is configured to input the electric shock signal data and the electric shock signal features into a 1D-CNN network and a fully connected network respectively for feature processing, fuse the feature vectors output by the 1D-CNN network and the fully connected network respectively, and train an LSTM-KAN deep neural network using the fused feature vectors and the label of whether the electric shock is or not;
[0173] An electric shock diagnosis and prediction module 500 is configured to use the trained electric shock diagnosis and prediction model to perform electric shock diagnosis and prediction on the electric shock signal data of the current calculation period to obtain an electric shock diagnosis result of the electric shock object.
[0174] In some embodiments, the system further comprises a denoising module configured to denoise the electroshock signal data using a MFIEN denoising model.
[0175] In some embodiments, the electroshock signal features comprise time domain signal features, frequency domain signal features, and image modality features.
[0176] The feature extraction module 200 is configured to:
[0177] extract time domain signal features of the electroshock signal data using a time domain analysis method;
[0178] extract frequency domain signal features of the electroshock signal data using a fast Fourier transform;
[0179] map a time series waveform of the electroshock signal data into a Markov transition matrix image, and extract texture information of the Markov transition matrix image as image modality features through a convolutional neural network.
[0180] In some embodiments, the system further comprises a dimension reduction module configured to reduce dimensions of the electroshock signal features based on a non-dominated sorting genetic algorithm principal component analysis method.
[0181] In some embodiments, the system further comprises a hyperparameter optimization module configured to optimize hyperparameters in a Bayesian optimization two-channel CNN-LSTM-KAN deep neural network.
[0182] In some embodiments, the two-channel CNN-LSTM-KAN deep neural network comprises an input module, a two-channel convolution module, a feature fusion layer, an LSTM time modeling module, a KAN nonlinear mapping and gating module, a residual connection module, and an output classification layer.
[0183] The input module is configured to input the electroshock signal data and the electroshock signal features, and output the electroshock signal data and the electroshock signal features to the two-channel convolution module.
[0184] The two-channel convolution module comprises a 1D-CNN network and a fully connected network.
[0185] The 1D-CNN network is configured to input the electroshock signal data and extract convolutional features of the electroshock signal data to obtain a first feature vector; and the fully connected network is configured to input the electroshock signal features and map features of the electroshock signal features to obtain a second feature vector.
[0186] The feature fusion layer is configured to receive the first feature vector and the second feature vector, and perform fusion processing on the first feature vector and the second feature vector to obtain a fusion feature vector.
[0187] The LSTM time modeling module is configured to receive the fusion feature vector and perform time series modeling on the fusion feature vector to capture time sequence dependency in the electric shock signal data, and obtain time sequence dependent features.
[0188] The KAN nonlinear mapping and gating module is configured to perform nonlinear mapping and gating processing on the time sequence dependent features output by the LSTM time modeling module, and obtain enhanced features.
[0189] The residual connection module is configured to perform residual connection between the enhanced features and the fusion feature vector, and obtain residual connection features.
[0190] The output classification layer is configured to receive the residual connection features and output an electric shock diagnosis binary classification result through an activation function, where the electric shock diagnosis binary classification result is used to represent a label indicating whether the electric shock object is electrically shocked.
[0191] As shown in Figure 7 The electronic device 10 includes a memory 20 and a processor 30, the memory 20 stores a computer program, and the computer program is executed by the processor 30 to make the processor 30 perform the steps of the electric shock diagnosis method in the above-described embodiments.
[0192] The embodiments of the present application provide a computer readable storage medium, which stores a computer program, and the computer program is executed to implement the steps of the electric shock diagnosis method in the above-described embodiments.
[0193] The embodiments of the present application provide a computer program product, which includes a computer program stored on a non-transitory computer readable storage medium, and the computer program includes program instructions, wherein when the program instructions are executed by a computer, the computer performs the steps of the electric shock diagnosis method in the above-described embodiments.
[0194] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, electronic device, computer storage medium and computer program product can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
[0195] It should be noted that the terms "first", "second", and the like in the description and in the claims of the application and the above-described drawings are used to distinguish between similar objects and are not necessarily used to describe a particular sequential or chronological order. It should be understood that the terms used herein are interchangeable under appropriate circumstances and that the embodiments of the application described herein are capable of operating in other sequences than the one illustrated or other sequences than the one described herein. Moreover, the terms "comprise", "have" and any variations thereof are intended to cover a non-exclusive inclusion, for example, a process, method, article, or apparatus that comprises a list of steps or units not necessarily limited to those specifically listed, but can include additional steps or units not expressly listed or inherent to such process, method, article, or apparatus.
[0196] It should be understood that, although the steps in the flowcharts involved in the embodiments described above are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least some of the steps in the flowcharts involved in the embodiments described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least some of the other steps or steps or stages in other steps.
[0197] In several embodiments provided by the present application, it should be understood that the disclosed system, electronic device, computer storage medium, computer program product and method can be implemented in other ways. For example, the above-described device embodiments are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0198] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0199] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.
[0200] When the integrated unit is realized in the form of a software function 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 solutions of the present application or the entire or part of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for executing all or part of the steps of the method described in each embodiment of the present application by a computer device (which can be a personal computer, a server, or a network device, etc.). The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (English full name: Read-Only Memory, English abbreviation: ROM), a random access memory (English full name: Random Access Memory, English abbreviation: RAM), a magnetic disk or an optical disk, and various program code storage media.
[0201] The above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of each embodiment of the present application.
Claims
1. A method for diagnosing electric shock, characterized in that, include: Acquire multiple electric shock signal data of the electric shock object in the electric shock simulation test, and label the electric shock status of each electric shock signal data; Extract the electric shock signal features from the electric shock signal data; A training dataset is constructed using the electric shock signal data, the electric shock signal features, and the labels indicating whether an electric shock occurred. The dual-channel CNN-LSTM-KAN deep neural network is trained using the training dataset to obtain an electric shock diagnosis prediction model. The dual-channel CNN-LSTM-KAN deep neural network is used to input the electric shock signal data and the electric shock signal features into a 1D-CNN network and a fully connected network for feature processing, respectively. The feature vectors output by the 1D-CNN network and the fully connected network are then fused. The fused feature vector and the label indicating whether an electric shock has occurred are used to train the LSTM-KAN deep neural network. The trained electric shock diagnosis prediction model is used to perform electric shock diagnosis prediction on the electric shock signal data of the current calculation period to obtain the electric shock diagnosis result of the electric shock object.
2. The electric shock diagnosis method according to claim 1, characterized in that, Also includes: The electric shock signal data was denoised using the MFIEN denoising model.
3. The electric shock diagnosis method according to claim 1, characterized in that, The electric shock signal features include time-domain signal features, frequency-domain signal features, and image modal features; The electric shock signal features extracted from the electric shock signal data include: The time-domain signal features of the electric shock signal data are extracted using time-domain analysis methods. The frequency domain signal features of the electric shock signal data are extracted using Fast Fourier Transform; The time-series waveform of the electric shock signal data is mapped to a Markov transformation matrix image, and the texture information of the Markov transformation matrix image is extracted by a convolutional neural network as the image modal feature.
4. The electric shock diagnosis method according to claim 1, characterized in that, Also includes: Principal component analysis based on non-dominated sorting genetic algorithm is used to reduce the dimensionality of the electric shock signal features.
5. The electric shock diagnosis method according to claim 1, characterized in that, Also includes: The hyperparameters in the dual-channel CNN-LSTM-KAN deep neural network are optimized using Bayesian methods.
6. The electric shock diagnosis method according to claim 1, characterized in that, The dual-channel CNN-LSTM-KAN deep neural network includes an input module, a dual-channel convolution module, a feature fusion layer, an LSTM temporal modeling module, a KAN nonlinear mapping and gating module, a residual connection module, and an output classification layer. The input module is used to input the electric shock signal data and the electric shock signal features, and output the electric shock signal data and the electric shock signal features to the dual-channel convolution module; The dual-channel convolutional module includes a 1D-CNN network and a fully connected network; The 1D-CNN network is used to input the electric shock signal data and perform convolutional feature extraction on the electric shock signal data to obtain a first feature vector; the fully connected network is used to input the electric shock signal features and perform feature mapping on the electric shock signal features to obtain a second feature vector. The feature fusion layer is used to receive the first feature vector and the second feature vector, and to fuse the first feature vector and the second feature vector to obtain a fused feature vector; The LSTM time modeling module is used to receive the fused feature vector and perform time series modeling on the fused feature vector to capture the temporal dependencies in the electric shock signal data and obtain temporal dependency features. The KAN nonlinear mapping and gating module is used to perform nonlinear mapping and gating processing on the time-dependent features output by the LSTM time modeling module to obtain enhanced features; The residual connection module is used to perform a residual connection between the enhanced feature and the fused feature vector to obtain a residual connection feature; The output classification layer is used to receive the residual connection features and output the electric shock diagnosis binary classification result through the activation function. The electric shock diagnosis binary classification result is used to indicate whether the electric shock object has been shocked.
7. An electric shock diagnostic system, characterized in that, include: The data acquisition module is used to acquire multiple electric shock signal data of the electric shock object in the electric shock simulation test, and to label whether each electric shock signal data is in an electric shock state. The feature extraction module is used to extract the electric shock signal features from the electric shock signal data; The dataset construction module is used to construct a training dataset using the electric shock signal data, the electric shock signal features, and the label of whether or not an electric shock occurred; The model training module is used to train a dual-channel CNN-LSTM-KAN deep neural network using the training dataset to obtain an electric shock diagnosis prediction model. The dual-channel CNN-LSTM-KAN deep neural network is used to input the electric shock signal data and the electric shock signal features into a 1D-CNN network and a fully connected network for feature processing, respectively. The feature vectors output by the 1D-CNN network and the fully connected network are then fused. The fused feature vector and the label indicating whether an electric shock has occurred are then used to train the LSTM-KAN deep neural network. 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 a trained electric shock diagnosis and prediction model, so as to obtain the electric shock diagnosis result of the electric shock object.
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 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 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 electric shock diagnosis method as described in any one of claims 1-6.