An abnormal heart rate diagnosis system based on a lightweight pulse neural network

By designing a lightweight spiking neural network and combining multi-branch feature extraction and temporal features, the low-power requirement for automatic identification of central rhythm abnormalities in wearable devices was solved, achieving efficient classification and accurate diagnosis of electrocardiogram signals.

CN116849637BActive Publication Date: 2026-04-07XIDIAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-09
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing wearable embedded devices lack sufficient resources to effectively deploy high-accuracy deep learning models, resulting in the inability to automatically identify arrhythmias. Furthermore, traditional machine learning algorithms are computationally expensive and cannot meet the requirements for low power consumption.

Method used

An abnormal heart rate diagnostic system based on a lightweight spiking neural network was designed, including data denoising, segmentation, feature extraction, and classification networks. The system utilizes a lightweight spiking neural network composed of wavelet decomposition, IFR module, and SGRU module to reduce computational load through multi-branch feature extraction and temporal feature combination.

Benefits of technology

It enables low-power ECG signal classification on wearable devices, improves the accuracy and stability of ECG signal classification, reduces computing costs, and is suitable for deployment in wearable devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116849637B_ABST
    Figure CN116849637B_ABST
Patent Text Reader

Abstract

This invention discloses an abnormal heart rate diagnostic system based on a lightweight spiking neural network, comprising: a data denoising module for denoising the input electrocardiogram (ECG) signal; a data segmentation module for segmenting the denoised ECG signal; a network construction module for constructing a lightweight spiking neural network consisting of a feature extraction network and a classification network connected sequentially; wherein the feature extraction network includes multiple branches of feature extraction modules, each branch including several sequentially connected IFR modules; the classification network includes first and second layer SGRU modules connected sequentially; a network training module for training the constructed lightweight spiking neural network using the segmented ECG signal to obtain a trained lightweight spiking neural network; and a data diagnosis module for inputting the ECG signal to be diagnosed into the trained lightweight spiking neural network to obtain a diagnostic result. This invention improves the accuracy of ECG signal classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of biosignal processing technology, specifically relating to an abnormal heart rate diagnostic system based on a lightweight spiking neural network. Background Technology

[0002] With the development of technology, wearable embedded devices are gradually entering the market, allowing people to monitor their health anytime, anywhere, and the high mortality rate caused by cardiovascular diseases will gradually decrease. However, wearable embedded devices are susceptible to signal quality issues due to their inherent limitations. Furthermore, current network models are too cumbersome to be deployed in these devices. Therefore, research on lightweight network models suitable for wearable embedded devices has significant practical value and far-reaching real-world implications.

[0003] Biosignal recognition algorithms and corresponding hardware designs are the core of wearable embedded devices. With the rapid promotion of artificial intelligence and embedded devices, automatic detection devices for cardiac arrhythmias have played a significant role in assisting medical personnel. Similarly, automatic identification of abnormal heart rates is of great importance for the early prevention and treatment of cardiovascular diseases. In the past few decades, automatic identification of cardiac arrhythmias has mainly been divided into traditional machine learning methods and deep learning methods. With the increase in data volume, traditional machine learning often performs poorly, and therefore, traditional methods are gradually becoming unsuitable for wearable embedded devices. Compared with traditional machine learning, deep learning has the following two advantages: First, with social development, we are bombarded with massive amounts of data. Faced with massive datasets, deep learning can better utilize the characteristics of the data and achieve better results than machine learning. Second, deep learning often does not require manual feature engineering of the data. It extracts corresponding features based on the characteristics of the data, and as the network deepens, deep learning automatically identifies higher-level features of different dimensions. Methods based on deep learning algorithms can significantly reduce the workload caused by manual feature extraction in traditional classification algorithms. Moreover, deep learning naturally has a noise tolerance, and when the prior knowledge of classification is known, neural network classification technology is the optimal choice. Current intelligent extraction and analysis algorithms, due to the computational characteristics of Convolutional Neural Networks (CNNs), have higher hardware resource requirements and higher computational and time costs, making them unsuitable for wearable embedded devices.

[0004] Therefore, making models more suitable for deployment on hardware devices and wearable embedded devices has gradually become a research focus. While deep learning has shown advantages over traditional machine learning in the medical field, high-accuracy models inevitably come with high computational costs, leading to excessive overall model energy consumption. Currently, due to insufficient resources in wearable embedded devices, neural network models cannot be embedded into hardware devices, and traditional machine learning is still used for deployment in the market. This shows that wearable embedded devices often lack corresponding low-power network models to match them. Therefore, low-power network models have gradually become a research focus in the entire medical field, and their design has significant research and application value. Summary of the Invention

[0005] To address the aforementioned problems in the existing technology, this invention provides an abnormal heart rate diagnosis system based on a lightweight spiking neural network. The technical problem to be solved by this invention is achieved through the following technical solution:

[0006] This invention provides an abnormal heart rate diagnostic system based on a lightweight spiking neural network, comprising:

[0007] The data denoising module is used to denoise the input electrocardiogram signal;

[0008] The data segmentation module is used to segment the denoised electrocardiogram signal.

[0009] A network construction module is used to build a lightweight spiking neural network consisting of a feature extraction network and a classification network connected sequentially. The feature extraction network extracts local features at different time points and concatenates these features in sequence. Specifically, the feature extraction network includes multiple branch feature extraction modules, each of which includes several sequentially connected IFR modules. The outputs of all branch feature extraction modules are connected to a concatenation layer. The classification network further extracts temporal features from the concatenated local features and converts these temporal features into pulse signals for classification. Specifically, the classification network includes a first-layer SGRU module, a second-layer SGRU module, a first fully connected layer, and a second fully connected layer connected sequentially. Both the first-layer and second-layer SGRU modules include several sequentially connected SGRU neurons. The input of each SGRU neuron in the first-layer SGRU module is the output of the feature extraction network, and the input of each SGRU neuron in the second-layer SGRU module is the corresponding output of the first-layer SGRU module.

[0010] The network training module is used to train the constructed lightweight spiking neural network using the segmented electrocardiogram signals to obtain a trained lightweight spiking neural network.

[0011] The data diagnostic module is used to input the ECG signal to be diagnosed into a trained lightweight spiking neural network to obtain diagnostic results.

[0012] In one embodiment of the present invention, the data denoising module performs denoising processing on the input electrocardiogram signal, including:

[0013] The wavelet decomposition method is used to denoise the input electrocardiogram signal.

[0014] In one embodiment of the present invention, the data segmentation module performs segmentation processing on the denoised electrocardiogram signal, including:

[0015] The denoised ECG signal is divided into equal segments using a preset number of segments.

[0016] In one embodiment of the present invention, the data segmentation module performs segmentation processing on the denoised electrocardiogram signal, including:

[0017] When it is impossible to equally segment the denoised ECG signal using the preset number of segments, the denoised ECG signal is then segmented by overlap using the preset number of segments; the formula for the overlap length is as follows:

[0018]

[0019] Among them, H ol The overlapping length during overlapping segmentation is represented by m, the preset number of segmentation segments is represented by s, the duration of a single segment is represented by S, and the total duration of the denoised ECG signal is represented by f. s This represents the sampling rate of the denoised ECG signal, and int(·) represents the rounding function.

[0020] In one embodiment of the present invention, each IFR module includes an excitation layer, a dimension-expanded convolutional layer, an attention mechanism module, a channel convolutional layer, and a pointwise convolutional layer connected in sequence, and the outputs of the excitation layer and the pointwise convolutional layer are both connected to an adder; the implementation process of the IFR module in the network construction module includes:

[0021] The segmented electrocardiogram signal is input into the excitation layer;

[0022] The data output from the excitation layer undergoes a dimension expansion operation through the dimension-expanding convolutional layer.

[0023] The expanded-dimensional data is input into the attention mechanism module;

[0024] The data output by the attention mechanism module is subjected to channel convolution operation through the channel convolution layer;

[0025] The data after the channel convolution operation is then subjected to a point-by-point convolution operation through the point-by-point convolution layer.

[0026] The data output from the excitation layer and the data after the pointwise convolution operation are added together to obtain the output of the IFR module.

[0027] In one embodiment of the present invention, the attention mechanism module includes a channel attention mechanism module and a spatial attention mechanism module. The channel attention mechanism module includes a max pooling layer, an average pooling layer, a multilayer perceptron network, and a sigmoid layer. The spatial attention mechanism module includes a max pooling layer, an average pooling layer, a convolutional layer, and a sigmoid layer. The process of inputting the dimension-expanded data into the attention mechanism module in the network construction module includes:

[0028] The expanded data is then input into the max pooling layer and average pooling layer in the channel attention mechanism module to obtain the first pooling result and the second pooling result.

[0029] The first pooling result and the second pooling result are respectively input into the multilayer perceptron network to obtain the corresponding first feature extraction data and second feature extraction data;

[0030] The first feature extraction data and the second feature extraction data are added together, and the result is passed through the Sigmoid layer in the channel attention mechanism module to obtain the first weight of each channel.

[0031] The expanded data is multiplied by the first weight of each channel as the output of the channel attention mechanism module;

[0032] The data output from the channel attention mechanism module is input into the max pooling layer and average pooling layer in the spatial attention mechanism module to obtain the third pooling result and the fourth pooling result;

[0033] The third pooling result and the fourth pooling result are respectively input into the convolutional layer to obtain the corresponding third feature extraction data and fourth feature extraction data;

[0034] The third feature extraction data and the fourth feature extraction data are concatenated, and the concatenation result is passed through the Sigmoid layer in the spatial attention mechanism module to obtain the final second weight of each channel.

[0035] The output of the spatial attention mechanism module is obtained by multiplying the data output by the channel attention mechanism module with the final second weight of each channel.

[0036] In one embodiment of the present invention, the extended-dimensional convolutional layer, the channel convolutional layer, and the pointwise convolutional layer in the IFR module are respectively connected to a batch normalization layer and a Leaky ReLU activation layer.

[0037] In one embodiment of the present invention, each SGRU neuron in the network construction module consists of a basic GRU network and a pulse conversion layer; wherein,

[0038] The basic GRU network is used to calculate the candidate membrane voltage and hidden membrane voltage corresponding to the reset gate and update gate in the basic GRU network at the current time.

[0039] The pulse conversion layer is used to convert the hidden membrane voltage output by the GRU network into a pulse signal, which is the output of the corresponding SGRU neuron.

[0040] In one embodiment of the present invention, the pulse conversion layer implements pulse conversion through a Θ function.

[0041] In one embodiment of the present invention, a Dropout layer is connected after the last IFR module in the feature extraction module of each branch; and a Dropout layer is connected after the second fully connected layer in the classification network.

[0042] The beneficial effects of this invention are:

[0043] This invention proposes a lightweight spiking neural network-based abnormal heart rate diagnosis system. This system is a lightweight algorithm combining multi-branch local features and temporal features, effectively addressing the classification problem of electrocardiogram (ECG) signals. Specifically, the system includes: a data denoising module for denoising the input ECG signal; a data segmentation module for segmenting the denoised ECG signal; and a network construction module for building a lightweight spiking neural network consisting of a feature extraction network and a classification network connected sequentially. The feature extraction network extracts local features at different times and concatenates them sequentially. Specifically, the feature extraction network includes multiple branch feature extraction modules, each branch comprising several sequentially connected IFR modules. The outputs of all branch feature extraction modules are connected to a concatenation layer. The classification network is used to classify the concatenated local features. The system further extracts temporal features and converts them into pulse signals for classification. The classification network consists of a first-layer SGRU module, a second-layer SGRU module, a first fully connected layer, and a second fully connected layer, all connected sequentially. Each of the first and second SGRU modules includes several sequentially connected SGRU neurons. The input to each SGRU neuron in the first layer is the output of the feature extraction network, and the input to each SGRU neuron in the second layer is the corresponding output of the first layer. A network training module trains the constructed lightweight spiking neural network using the segmented ECG signals. A data diagnosis module inputs the ECG signal to be diagnosed into the trained lightweight spiking neural network to obtain the diagnostic result. As can be seen, the lightweight spiking neural network constructed in this invention includes a multi-branch feature extraction network and a classification network. Each branch of the multi-branch feature extraction network extracts local features, and then the local features extracted from different branches are concatenated sequentially. The classification network further extracts temporal features based on the local features, maintaining the temporal characteristics of the ECG signal. Furthermore, by introducing pulse signals, the computational load can be reduced, achieving the goal of lightweight design. This invention improves the accuracy of ECG signal classification by combining temporal features with local features; moreover, the constructed lightweight spiking neural network exhibits good stability and convergence speed, and the introduction of pulse signals achieves the expected reduction in computational load.

[0044] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0045] Figure 1 This is a schematic diagram of the structure of an abnormal heart rate diagnosis system based on a lightweight spiking neural network provided in an embodiment of the present invention;

[0046] Figure 2This is a schematic diagram of the lightweight spiking neural network provided in an embodiment of the present invention;

[0047] Figure 3 This is a schematic diagram of the structure of the IFR module provided in an embodiment of the present invention;

[0048] Figure 4 This is a schematic diagram of the attention mechanism module provided in an embodiment of the present invention;

[0049] Figure 5 This is a schematic diagram of the structure of the SGRU neuron in the SGRU module provided in this embodiment of the invention;

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

[0051] The present invention will be further described in detail below with reference to specific embodiments, but the implementation of the present invention is not limited thereto.

[0052] To implement low-power network models in wearable embedded devices, please refer to [link / reference]. Figure 1 This invention provides an abnormal heart rate diagnosis system based on a lightweight spiking neural network, comprising:

[0053] The data denoising module is used to denoise the input electrocardiogram signal;

[0054] The data segmentation module is used to segment the denoised electrocardiogram signal.

[0055] The network construction module is used to build a lightweight spiking neural network consisting of a feature extraction network and a classification network connected sequentially. The feature extraction network extracts local features at different time points and concatenates these features in sequence. Specifically, the feature extraction network includes multiple branches, each containing several sequentially connected IFR (Inverted Fired Residual) modules. The outputs of all branches are connected to a concatenation layer. The classification network further extracts temporal features from the concatenated local features and converts these features into pulse signals for classification. Specifically, the classification network includes a first-layer SGRU (Spike Gated Recurrent Unit) module, a second-layer SGRU module, a first fully connected layer, and a second fully connected layer, all connected sequentially. Both the first and second SGRU modules contain several sequentially connected SGRU neurons. The input to each SGRU neuron in the first layer is the output of the feature extraction network, and the input to each SGRU neuron in the second layer is the corresponding output of the first layer.

[0056] The network training module is used to train the constructed lightweight spiking neural network using the segmented electrocardiogram signals to obtain a trained lightweight spiking neural network.

[0057] The data diagnostic module is used to input the ECG signal to be diagnosed into a trained lightweight spiking neural network to obtain diagnostic results.

[0058] Next, each module will be introduced in detail.

[0059] In one embodiment of the present invention, the data denoising module performs denoising processing on the input electrocardiogram (ECG) signal, including: denoising the input ECG signal using a wavelet decomposition method. Taking the Haar wavelet basis as an example, the specific steps for denoising the input ECG signal are as follows:

[0060] A1. Select the Haar wavelet basis function to perform a 6-level wavelet decomposition on the input ECG signal, dividing it into high-frequency and low-frequency components.

[0061] A2. Select the layer number corresponding to 0.5Hz, remove the signal of that layer, and achieve noise filtering;

[0062] A3. After filtering out the noise, the remaining signal is reconstructed using Haar wavelets to obtain the restored clean ECG signal.

[0063] Furthermore, this embodiment of the invention provides an optional solution in which the data segmentation module performs segmentation processing on the denoised electrocardiogram signal, including: performing equal segmentation processing on the denoised electrocardiogram signal using a preset number of segmentation segments.

[0064] Taking the CPSC2018 database as an example, the duration of the ECG signals in the CPSC2018 database varies from 6 to 60 seconds, and its sampling rate is 500Hz. This embodiment of the invention uniformly specifies the total duration of the ECG signals in the CPSC2018 database as 60 seconds. These ECG signals are then segmented according to a preset number of segments, for example, 10 segments. The ECG signals are divided into 10 segments in chronological order, each segment being a 6-second ECG signal. When the input ECG signal length is equal to 60 seconds, it is divided into 10 equal 6-second segments, achieving complete segmentation. It should be noted that each ECG signal in the CPSC2018 database here is a denoised ECG signal.

[0065] This invention provides another optional solution, in which the data segmentation module performs segmentation processing on the denoised electrocardiogram signal, including:

[0066] Taking the CPSC2018 database as an example, when the duration of the input ECG signal is less than 60 seconds, it is impossible to equally segment the denoised ECG signal using a preset number of segments. In this case, this embodiment of the invention proposes to perform overlapping segmentation processing on the denoised ECG signal using a preset number of segments; wherein, the formula for the overlap length is expressed as:

[0067]

[0068] Among them, H ol The overlapping length during overlapping segmentation is represented by m, the preset number of segmentation segments is represented by s, the duration of a single segment is represented by S, and the total duration of the denoised ECG signal is represented by f. s This represents the sampling rate of the denoised ECG signal, and `int(·)` represents the floor function. This overlapping data segmentation method effectively solves the problem of ECG signals being unusable as input into the network model due to varying total durations. More importantly, this overlapping data segmentation method does not introduce additional padding data, thus preserving as much of the original ECG signal information as possible.

[0069] Furthermore, since embedding existing neural network models into hardware devices is relatively difficult, there is a need to design more lightweight and low-power network models. To address this need, this invention proposes a lightweight spiking neural network. Since electrocardiogram (ECG) signals are one-dimensional time-series signals, one-dimensional convolutional layers are used to build the model. (See [link to relevant documentation]). Figure 2Specifically, the lightweight spiking neural network includes a feature extraction network and a classification network connected in sequence, wherein,

[0070] A feature extraction network is used to extract local features at different time points and concatenate the extracted local features in sequence. Specifically, the feature extraction network constructed in this embodiment of the invention includes feature extraction modules with multiple branches. Each branch feature extraction module includes several IFR modules connected in sequence, such as... Figure 2 The diagram illustrates N sequentially connected IFR modules. For example, if N is 7, it includes 7 sequentially connected IFR modules. The outputs of all feature extraction modules are connected to a concatenation layer. Here, the number of feature extraction module branches in the feature extraction network is related to the preset number of segmentation segments m. For example, if the preset number of segmentation segments m is 10, the feature extraction network includes 10 branch feature extraction modules. Each branch's feature extraction module includes 7 IFR modules. The outputs of all feature extraction modules are connected to a concatenation layer, and the output of the concatenation layer serves as the final output of the feature extraction network.

[0071] For the IFR module in the feature extraction module, this embodiment of the invention provides an optional solution, please refer to [link to relevant documentation]. Figure 3 Each IFR module includes a sequentially connected activation layer, dimension-expanded convolutional layer, attention mechanism module, channel convolutional layer, and pointwise convolutional layer, with the outputs of the activation layer and the pointwise convolutional layer both connected to an adder; the implementation process of the IFR module in the corresponding network construction module includes:

[0072] B1. Input the segmented ECG signal into the excitation layer; the formula for the excitation layer is as follows:

[0073]

[0074] Where Y(t) represents the output of the activation layer at time t, X(t) represents the segmented ECG signal input to the activation layer at time t, and thr represents the adaptive threshold at time t. If X(t) input to the activation layer at time t is greater than the adaptive threshold thr, the output of the activation layer is 1; otherwise, the output of the activation layer is 0. It can be seen that the output data of the activation layer is 1 only when X(t) input to the activation layer at time t is greater than the adaptive threshold thr. After successfully outputting a signal, there is a refractory period, meaning that after the current activation layer is excited by the input data X(t) once, it cannot be excited by inputting the same data again within a certain period of time.

[0075] B2. The data output from the activation layer is expanded in dimension through the expansion convolutional layer. The data output from the activation layer is input into the expansion convolutional layer, where the input data is expanded in dimension by arranging the elements, thus expanding the data to a higher dimension. Then, convolution is performed on the data, so that the model can learn higher-level features.

[0076] B3. Input the dimension-expanded data into the attention mechanism module; the data output from the dimension-expanded convolutional layer is then input into the attention mechanism module. Please refer to [link to relevant documentation]. Figure 4 The attention mechanism module in this embodiment of the invention includes a channel attention mechanism module and a spatial attention mechanism module. The channel attention mechanism module includes a max pooling layer, an average pooling layer, an MLP (Multilayer Perceptron) network, and a sigmoid layer. The spatial attention mechanism module includes a max pooling layer, an average pooling layer, a convolutional layer, and a sigmoid layer. The process of inputting the expanded-dimensional data into the attention mechanism module in the corresponding network construction module includes:

[0077] B31. Input the expanded data into the max pooling layer and average pooling layer in the channel attention mechanism module respectively, reduce their spatial dimension to 1, and obtain the first pooling result Vec1 and the second pooling result Vec2.

[0078] B32. Input the first pooling result Vec1 and the second pooling result Vec2 into the multilayer perceptron network to obtain the corresponding first feature extraction data M1 and second feature extraction data M2;

[0079] B33. Add the first feature extraction data M1 and the second feature extraction data M2 together. The result of the addition is passed through the Sigmoid layer (not shown in the figure) in the channel attention mechanism module to obtain the first weight W1 of each channel.

[0080] B34. Multiply the expanded data by the first weight W1 of each channel to obtain the output of the channel attention mechanism module; the output formula of the corresponding channel attention mechanism module is expressed as: Y 1 (t)=Y(t)×W1.

[0081] B35. The data Y output by the channel attention mechanism module 1 (t) Input the maximum pooling layer and the average pooling layer in the spatial attention mechanism module respectively to obtain the third pooling result Vec3 and the fourth pooling result Vec4;

[0082] B36. Input the third pooling result Vec3 and the fourth pooling result Vec4 into the convolutional layer to obtain the corresponding third feature extraction data M3 and fourth feature extraction data M4, respectively.

[0083] B37. The third feature extraction data M3 and the fourth feature extraction data M4 are concatenated. The concatenation result is passed through the Sigmoid layer (not shown in the figure) in the spatial attention mechanism module to obtain the final second weight W2 of each channel.

[0084] B38. The data Y output by the channel attention mechanism module 1 The product of (t) and the second weight W2 of each channel is used as the output of the spatial attention mechanism module; the corresponding output formula of the spatial attention mechanism module is expressed as: Y 2 (t)=Y 1 (t)×W2.

[0085] B4. Perform channel convolution operation on the data output by the attention mechanism module through the channel convolution layer; in the channel convolution layer, perform convolution operation with a kernel length of 7 on the data output by the attention mechanism module to realize channel-by-channel convolution operation on the data of different channels.

[0086] B5. Perform pointwise convolution on the data after channel convolution; in the pointwise convolution layer, perform pointwise convolution on the data output from the channel convolution layer.

[0087] B6. Add the data output from the excitation layer and the data after the pointwise convolution operation as the output of the IFR module.

[0088] In an optional embodiment of the present invention, the IFR module is followed by a batch normalization layer and a Leaky ReLU activation layer, respectively, after the dimension-expanding convolutional layer, the channel convolutional layer, and the pointwise convolutional layer. That is, the output data after each convolutional operation will pass through the batch normalization layer to normalize the data. Considering the problem that ReLU activation functions can easily generate dead neurons in deep networks, the activation layer used in the model of this embodiment is implemented using the Leaky ReLU activation function. The Leaky ReLU activation function is added after the batch normalization layer to provide a non-linear expression of the data. The formula for the Leaky ReLU activation function is as follows:

[0089] y=max(0,x)+leaky*min(0,x);

[0090] Where y represents the output of the current Leaky ReLU activation function, and x represents the input of the current Leaky ReLU activation function. For example, if the Leaky ReLU activation layer is the activation layer connected after the batch normalization layer corresponding to the dimension-expanded convolutional layer, then x represents the output of the batch normalization layer corresponding to the dimension-expanded convolutional layer. Leaky is a very small constant, so that data less than 0 will not be completely lost.

[0091] To mitigate model overfitting, this embodiment of the invention adds a Dropout layer after the last IFR module in the feature extraction module of each branch, randomly dropping some neuron data through the added Dropout layer.

[0092] Compared with traditional convolutional neural networks, the feature extraction network designed in this embodiment of the invention reduces both the number of parameters and the amount of computation, thereby reducing the energy consumption of the entire feature extraction network.

[0093] Furthermore, for classification networks, this embodiment of the invention provides a novel classification network model (see also 2). This classification network is used to further extract temporal features from the spliced ​​local features and convert the extracted temporal features into pulse signals. The pulse signals are then used for classification. Specifically, this classification network includes a first-layer SGRU module, a second-layer SGRU module, a first fully connected layer, and a second fully connected layer connected in sequence. Both the first-layer and second-layer SGRU modules include several SGRU neurons connected in sequence. The input to each SGRU neuron in the first-layer SGRU module is the output of the feature extraction network, and the input to each SGRU neuron in the second-layer SGRU module is the corresponding output of the first-layer SGRU module. (See also...) Figure 5 In the network construction module, each SGRU neuron consists of a basic GRU (Gated Recurrent Unit) network and a pulse conversion layer. The basic GRU network calculates the candidate membrane voltage and hidden membrane voltage corresponding to the reset and update gates in the basic GRU network at the current time. The pulse conversion layer converts the hidden membrane voltage output by the GRU network into a pulse signal, which is the output of the corresponding SGRU neuron. In one embodiment of the invention, the pulse conversion layer implements pulse conversion using a Θ function.

[0094] Figure 5 In the diagram, M represents the candidate membrane voltage at the current moment. This represents the hidden membrane voltage of the i-th layer SGRU module at time t, where i takes values ​​of 1 and 2. It is converted into a pulse signal via the Θ function. At this time, the pulse signal is... This represents the neuron pulse information of the i-th layer SGRU module at time t. The input of the first layer SGRU module is the output of the feature extraction network at the current time, and the input of the second layer SGRU module is the pulse information output by the SGRU neurons in the first layer SGRU module. In the entire classification network, each SGRU neuron calculates the candidate membrane voltage of the current SGRU neuron by setting a reset gate (r in the figure) and comparing the output of the feature extraction network at the current time with the pulse signal output of the corresponding SGRU neuron at the previous time. Finally, the update gate (Z in the figure) selects the time to excite the current pulse signal through the adaptive threshold design in the SGRU neuron, thereby updating the hidden membrane voltage of the current SGRU neuron. The hidden membrane voltage of the current SGRU neuron is converted into a pulse signal using the Θ function, and the pulse signal of the current SGRU neuron is used as the input of the next SGRU neuron. The formula for Θ is as follows:

[0095]

[0096] Among them, Spk thr This represents the adaptive threshold in the SGRU neuron, which is set according to actual needs.

[0097] For example, the processing of the first and second SGRU modules at time t is analyzed as follows: The input of the SGRU neuron corresponding to the first SGRU module includes the output X of the feature extraction network at time t. t Output of SGRU neurons at time t-1 in the same layer The inputs of the SGRU neurons in the second-layer SGRU module include the outputs of the SGRU neurons in the first-layer SGRU module. Output of SGRU neurons at time t-1 in the same layer The SGRU neurons corresponding to the first-layer SGRU module adjust the output X of the feature extraction network at time t by setting a reset gate (r in the diagram). t Output of SGRU neurons at time t-1 in the same layer The calculation is performed to obtain the candidate membrane voltage M of the SGRU neuron corresponding to the first-layer SGRU module at time t. Finally, the gate (represented by Z in the figure) is updated by adaptively setting the hidden membrane voltage of the SGRU neuron corresponding to the first-layer SGRU module at time t. The hidden membrane voltage of the SGRU neuron corresponding to the first layer of SGRU module at time t is obtained using the Θ function. Converted to pulse signal and pulse signal This serves as the input to the next SGRU neuron corresponding to the second-layer SGRU module. The processing of the second-layer SGRU module is similar to that of the first-layer SGRU module, except for the different input data, which will not be elaborated here.

[0098] In an optional embodiment of the present invention, the classification network further includes a Dropout layer; the Dropout layer is connected after the second fully connected layer, for example, by connecting a Dropout layer with a dropout probability of 0.5 for subsequent discrimination.

[0099] Furthermore, during the training process, the network training module employs existing training methods, such as the Adam method, to train the entire network model, which will not be elaborated upon here.

[0100] Furthermore, the data diagnosis module utilizes a trained lightweight spiking neural network to re-input the ECG signal to be diagnosed for disease diagnosis verification. Finally, the lightweight spiking neural network outputs diagnostic results for different types of heart rate abnormalities.

[0101] This invention utilizes the publicly available database from the 2018 Chinese Physiological Signal Challenge (CPSC2018) for verification. Lightweight spiking neural networks are trained, validated, and tested using electrocardiogram (ECG) signals from this database. The CPSC2018 database uses 12-lead ECGs, including one normal type and eight abnormal types of ECG signals. The entire database comes from 11 hospitals, and the training set contains ECG signals from 6877 patients, including 3178 women and 3699 men. The ECG signal sampling frequency is 500Hz, and the duration of the ECG signals ranges from 6 to 60 seconds. Most ECG signals have only one label (represented as the first label), while some data have up to three labels (represented as the first, second, and third labels, respectively). For example, the A1487 ECG signal has two labels, the first being 6 and the second being 5, indicating that this ECG signal is identified as PAC (atrial premature contraction) and RBBB (right bundle branch block).

[0102] During the verification process, the adaptive threshold Spk of each SGRU neuron in the first-layer SGRU module and the second-layer SGRU module was... thrThe F1 value was set to 0.2, the number of SGRU neurons in the first SGRU module was set to 128, and the number of SGRU neurons in the second SGRU module was set to 256. The corresponding outputs of each part of the network model are shown in Table 1. Finally, the final diagnostic results on the CPSC2018 database are shown in Table 2. As can be seen from Table 2, the F1 score of this embodiment of the invention reached 0.8018, and its overall model computation reached 46.45 MMACs. Compared with the model constructed by the fully convolutional neural network (Multi-Branch ALL Conv+GRU), the overall model (Multi-Branch IFR+SGRU) of this invention has reduced the computational cost by approximately 84.6%. It can be seen that this embodiment of the invention can further reduce the computational cost of the model while ensuring the F1 score. This advantage effectively reduces the model's computation time and computational cost, improves the model's practical application effect, and makes a significant contribution to the subsequent deployment of lightweight algorithms that are compatible with embedded devices.

[0103] Table 1. Output of each part of the network model

[0104]

[0105] Table 2. Model Comparison Results

[0106]

[0107] Among them, F in Table 2 AF This indicates the F1 score, which corresponds to atrial fibrillation. Block This indicates the F1 score, which represents a heart conduction block. PC This indicates the F1 score, which represents premature contraction. ST This represents the F1 score of an anomaly belonging to segment ST, where F represents the overall predicted F1 score; F AF F Block F PC F ST Both F and F can be calculated using existing methods.

[0108] In summary, the abnormal heart rate diagnosis system based on a lightweight spiking neural network provided in this invention is a lightweight algorithm combining multi-branch local features and temporal features, which can be effectively used to handle the classification problem of electrocardiogram (ECG) signals. Specifically, the system includes: a data denoising module for denoising the input ECG signal; a data segmentation module for segmenting the denoised ECG signal; and a network construction module for constructing a lightweight spiking neural network composed of a feature extraction network and a classification network connected sequentially. The feature extraction network extracts local features at different times and concatenates the extracted local features in sequence. Specifically, the feature extraction network includes multiple branch feature extraction modules, each branch including several sequentially connected IFR modules, and the outputs of all branch feature extraction modules are connected to a concatenation layer. The classification network is used to classify the concatenated features. The local features are further extracted for temporal features, and the extracted temporal features are converted into pulse signals. The pulse signals are then used for classification. The specific classification network includes a first-layer SGRU module, a second-layer SGRU module, a first fully connected layer, and a second fully connected layer connected in sequence. The first-layer SGRU module and the second-layer SGRU module each include several SGRU neurons connected in sequence. The input of each SGRU neuron in the first-layer SGRU module is the output of the feature extraction network, and the input of each SGRU neuron in the second-layer SGRU module is the output of the corresponding first-layer SGRU module. A network training module is used to train the constructed lightweight spiking neural network using the segmented ECG signals to obtain a trained lightweight spiking neural network. A data diagnosis module is used to input the ECG signal to be diagnosed into the trained lightweight spiking neural network to obtain the diagnostic result. As can be seen, the lightweight spiking neural network constructed in this embodiment of the invention includes a multi-branch feature extraction network and a classification network. Each branch of the multi-branch feature extraction network extracts local features, and then the local features extracted from different branches are concatenated sequentially. The classification network further extracts temporal features based on the local features, maintaining the temporal characteristics of the ECG signal. Furthermore, by introducing pulse signals, the computational load can be reduced, achieving the goal of lightweight design. This embodiment of the invention improves the accuracy of ECG signal classification by combining temporal features with local features; and the constructed lightweight spiking neural network exhibits good stability and convergence speed. Introducing pulse signals achieves the expected reduction in computational load.

[0109] Please see Figure 6 This invention provides an electronic device, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.

[0110] Memory 603 is used to store computer programs;

[0111] When the processor 601 executes the program stored in the memory 603, it implements the steps of the above-described abnormal heart rate diagnosis system based on a lightweight spiking neural network.

[0112] This invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described abnormal heart rate diagnosis system based on a lightweight spiking neural network.

[0113] For the electronic device / storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be referred to in the description of the method embodiment.

[0114] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0115] Although the invention has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the specification and accompanying drawings, will understand and implement other variations of the disclosed embodiments in carrying out the claimed invention. In the specification, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality. While certain measures are described in different embodiments, this does not mean that these measures cannot be combined to produce good results.

[0116] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.

Claims

1. An abnormal heart rate diagnostic system based on a lightweight spiking neural network, characterized in that, include: The data denoising module is used to denoise the input electrocardiogram signal; The data segmentation module is used to segment the denoised electrocardiogram signal. The data segmentation module performs segmentation processing on the denoised ECG signal, including: equally segmenting the denoised ECG signal using a preset number of segmentation segments; when it is not possible to equally segment the denoised ECG signal using the preset number of segmentation segments, then overlapping segmentation processing is performed on the denoised ECG signal using the preset number of segmentation segments; wherein, the overlap length formula is expressed as: ; in, This indicates the overlap length during overlapping segmentation. Indicates the preset number of segments. Indicates the duration of a single segment. This represents the total duration of the denoised ECG signal. This represents the sampling rate of the denoised ECG signal. Represents the floor function; A network construction module is used to build a lightweight spiking neural network consisting of a feature extraction network and a classification network connected sequentially. The feature extraction network extracts local features at different times and concatenates these features in sequence. Specifically, the feature extraction network includes multiple branch feature extraction modules, each branch comprising several sequentially connected IFR modules. The outputs of all branch feature extraction modules are connected to a concatenation layer. The classification network further extracts temporal features from the concatenated local features and converts these temporal features into pulse signals for classification. Specifically, the classification network includes a first-layer SGRU module, a second-layer SGRU module, a first fully connected layer, and a second fully connected layer connected sequentially. Both the first-layer and second-layer SGRU modules include several sequentially connected SGRU neurons. The input of each SGRU neuron in the first-layer SGRU module is the output of the feature extraction network, and the input of each SGRU neuron in the second-layer SGRU module is the corresponding output of the first-layer SGRU module. The network training module is used to train the constructed lightweight spiking neural network using the segmented electrocardiogram signals to obtain a trained lightweight spiking neural network. The data diagnostic module is used to input the ECG signal to be diagnosed into a trained lightweight spiking neural network to obtain diagnostic results.

2. The abnormal heart rate diagnosis system based on a lightweight spiking neural network according to claim 1, characterized in that, The data denoising module performs denoising processing on the input electrocardiogram signal, including: The wavelet decomposition method is used to denoise the input electrocardiogram signal.

3. The abnormal heart rate diagnosis system based on a lightweight spiking neural network according to claim 1, characterized in that, Each of the IFR modules includes an activation layer, an extended-dimensional convolutional layer, an attention mechanism module, a channel convolutional layer, and a pointwise convolutional layer connected in sequence, and the outputs of the activation layer and the pointwise convolutional layer are both connected to an adder; The implementation process of the IFR module in the network construction module includes: The segmented electrocardiogram signal is input into the excitation layer; The data output from the excitation layer undergoes a dimension expansion operation through the dimension-expanding convolutional layer. The expanded-dimensional data is input into the attention mechanism module; The data output by the attention mechanism module is subjected to channel convolution operation through the channel convolution layer; The data after the channel convolution operation is then subjected to a point-by-point convolution operation through the point-by-point convolution layer. The data output from the excitation layer and the data after the pointwise convolution operation are added together to obtain the output of the IFR module.

4. The abnormal heart rate diagnosis system based on a lightweight spiking neural network according to claim 3, characterized in that, The attention mechanism module includes a channel attention mechanism module and a spatial attention mechanism module. The channel attention mechanism module includes a max pooling layer, an average pooling layer, a multilayer perceptron network, and a sigmoid layer. The spatial attention mechanism module includes a max pooling layer, an average pooling layer, a convolutional layer, and a sigmoid layer. The process of inputting the dimensionality-expanded data into the attention mechanism module, corresponding to the network construction module, includes: The expanded data is then input into the max pooling layer and average pooling layer in the channel attention mechanism module to obtain the first pooling result and the second pooling result. The first pooling result and the second pooling result are respectively input into the multilayer perceptron network to obtain the corresponding first feature extraction data and second feature extraction data; The first feature extraction data and the second feature extraction data are added together, and the result is passed through the Sigmoid layer in the channel attention mechanism module to obtain the first weight of each channel. The expanded data is multiplied by the first weight of each channel as the output of the channel attention mechanism module; The data output from the channel attention mechanism module is input into the max pooling layer and average pooling layer in the spatial attention mechanism module to obtain the third pooling result and the fourth pooling result; The third pooling result and the fourth pooling result are respectively input into the convolutional layer to obtain the corresponding third feature extraction data and fourth feature extraction data; The third feature extraction data and the fourth feature extraction data are concatenated, and the concatenation result is passed through the Sigmoid layer in the spatial attention mechanism module to obtain the final second weight of each channel. The output of the spatial attention mechanism module is obtained by multiplying the data output by the channel attention mechanism module with the final second weight of each channel.

5. The abnormal heart rate diagnosis system based on a lightweight spiking neural network according to claim 3, characterized in that, In the IFR module, the extended-dimensional convolutional layer, the channel convolutional layer, and the pointwise convolutional layer are each followed by a batch normalization layer and a Leaky ReLU activation layer, respectively.

6. The abnormal heart rate diagnosis system based on a lightweight spiking neural network according to claim 1, characterized in that, Each SGRU neuron in the network construction module consists of a basic GRU network and a pulse conversion layer; wherein... The basic GRU network is used to calculate the candidate membrane voltage and hidden membrane voltage corresponding to the reset gate and update gate in the basic GRU network at the current time. The pulse conversion layer is used to convert the hidden membrane voltage output by the basic GRU network into a pulse signal, which is the output of the corresponding SGRU neuron.

7. The abnormal heart rate diagnosis system based on a lightweight spiking neural network according to claim 6, characterized in that, The pulse conversion layer passes through a The function implements pulse conversion.

8. The abnormal heart rate diagnosis system based on a lightweight spiking neural network according to claim 1, characterized in that, Each branch's feature extraction module is followed by a Dropout layer after the last IFR module; the classification network is also followed by a Dropout layer after the second fully connected layer.

Citation Information

Patent Citations

  • Radar target recognition method based on attention mechanism and bidirectional stacked recurrent neural network

    CN111736125A

  • Electrocardiosignal classification method based on pulse neural network

    CN114052744A