A method for classifying electrocardiogram signals based on multi-threshold spiking neural networks
By constructing a spiking neural network with multi-threshold integral firing neurons, the problems of high energy consumption and low classification performance in ECG signal monitoring are solved, achieving high accuracy and low energy consumption classification results, which are suitable for portable devices.
Patent Information
- Application Number
- CN202510539150.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2045-04-27
AI Technical Summary
Existing machine learning technologies have high energy consumption and high computational requirements in ECG signal monitoring, making them difficult to deploy on resource-constrained wearable devices. They also lack the ability to personalize user data in real time and have low classification performance.
A multi-threshold spiking neural network was constructed using multi-threshold integral firing neurons. Wavelet transform was used for denoising, heartbeat segments were extracted, and multi-threshold integral firing neurons and multi-threshold spiking neural networks were constructed. Gradient surrogate method was used to adjust synaptic weights and bias terms to achieve ECG signal classification.
It achieves high accuracy and robustness in ECG signal classification, reduces computational load and energy consumption, and is suitable for operation in resource-constrained embedded systems, especially for portable ECG monitoring devices and mobile health devices.
Smart Images

Figure CN120436654B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electrocardiogram (ECG) signal classification technology, and specifically to an ECG signal classification method based on a multi-threshold pulse neural network. Background Technology
[0002] Cardiovascular disease is a leading cause of morbidity and mortality worldwide. Arrhythmias are a group of disorders involving abnormal electrical activity of the heart, which may manifest as a rapid, slow, or irregular heartbeat. Their severity depends on the type of arrhythmia, its duration, and its impact on other organs. Early diagnosis and treatment are crucial for reducing the risk of complications and death. Traditionally, the diagnosis of arrhythmias has relied on physicians' experience in interpreting electrocardiograms (ECGs), but manual examination is time-consuming and labor-intensive. Therefore, the classification and testing of ECG signals can help reduce the burden on physicians and significantly improve the efficiency of disease diagnosis.
[0003] However, in the field of electrocardiogram (ECG) signal monitoring, especially in applications requiring fast response, low power consumption, and embedded systems, existing machine learning technologies face several challenges: First, traditional deep learning techniques, due to their high power consumption and computational requirements, are difficult to implement on resource-constrained wearable devices used for long-term ECG monitoring; second, these methods cannot fully extract the temporal features of ECG signals, lack the ability to personalize adjustments to real-time user data, and their classification performance is not high. Spiking neural networks (SNNs) are computational models inspired by the biological brain, constructing neural networks by more accurately mimicking the behavior of real neurons and synapses. Unlike traditional artificial neural networks, neurons in SNNs are not continuously activated but transmit information through discrete time-point pulses. This characteristic makes SNNs highly advantageous in processing spatiotemporal data and more energy-efficient than traditional artificial neural networks. Summary of the Invention
[0004] To address the aforementioned problems, this invention proposes a multi-threshold spiking neural network method for ECG signal classification. A high-performance, directly trainable spiking neural network is implemented using multi-threshold integral firing neurons, solving the problems of low classification accuracy and difficulty in deploying spiking neural networks on portable and mobile devices.
[0005] To address the problems existing in the prior art, this invention proposes a multi-threshold pulse neural network method for electrocardiogram signal classification, which includes the following steps:
[0006] S1. Acquire the raw single-channel electrocardiogram signal and use wavelet transform to remove noise;
[0007] S2. Extract multiple heartbeat segments from the denoised ECG signal based on the R-wave peak position to form an ECG signal dataset; and divide the ECG signal dataset into a training set and a test set.
[0008] S3. Based on the firing characteristics of biological neurons, construct a multi-threshold integral firing neuron MTIF;
[0009] S4. Construct a multi-threshold spiking neural network based on MTIF, and train and test the neural network using heartbeat segments as input;
[0010] S5. During the training process, construct the loss function of the multi-threshold spiking neural network and use the gradient surrogate method to adjust the synaptic weights between neurons and the bias terms of neurons in the multi-threshold spiking neural network.
[0011] S6. A multi-threshold pulse neural network with optimal parameter configuration is obtained through training and testing to achieve ECG signal classification.
[0012] Furthermore, step S2 specifically includes:
[0013] The annotation information of the electrocardiogram (ECG) signal is read to obtain the position of the R-wave peak and its corresponding label. For the input denoised ECG signal, L sampling points are selected forward and 2L sampling points are selected backward, centered on each R-wave peak position, to extract a heartbeat segment with a length of 3L sampling points, including the R-wave peak. The ECG signal dataset is composed of multiple independent heartbeat segments, denoted as M = {(X... n ,Y n ),n=1,2,…,N};where,X n For the nth heartbeat segment, Y n The label is the nth heartbeat segment, and N is the number of heartbeat segments. The first N′ heartbeat segments in the ECG signal dataset are used as the training set, and the remaining NN′ segments are used as the test set.
[0014] Furthermore, step S3 specifically includes:
[0015] A multi-threshold integral firing neuron MTIF is formed by combining λ integral firing neurons (IFs). Each IF neuron serves as a sub-neuron, corresponding to λ different firing thresholds θ1, θ2, ..., θ3. λ And by sharing the input current, pulse responses at different thresholds are achieved; the dynamic equation of a multi-threshold integral firing neuron MTIF is expressed as:
[0016]
[0017] Among them, v i (t), v i (t-1) represent the membrane potentials of the i-th integral firing neuron IF at time steps t and t-1, respectively, and x(t) represents the input current at time step t; v j(t) represents the membrane potential of the j-th IF neuron after receiving input at time step t; Θ(.) represents the step function, when v j (t) is 1 when it exceeds the threshold, and 0 otherwise; It is the threshold of level j, V th The maximum firing threshold is set, where λ is the number of IF neurons and also represents the level of different thresholds set in MTIF.
[0018] Furthermore, step S4 specifically includes:
[0019] A multi-threshold spiking neural network (SNN) is constructed based on multi-threshold integral-fired neurons. The constructed SNN consists of 3 convolutional layers, 3 neuron layers, and 3 pooling layers, connected sequentially in the order of one convolutional layer, one neuron layer, and one pooling layer. Finally, a linear layer outputs the final classification result. The convolutional layers use one-dimensional convolution, the neuron layers use multi-threshold integral-fired neurons, and the pooling layers use max pooling. At each time step, the convolutional layer extracts local temporal features and outputs a continuous current as the input current of the neuron layer. The pooling layer processes the output pulses of the neuron layer. The input amount between each layer is controlled by weight parameters.
[0020] More specifically, the expression for the input current of a neuron layer in a multi-threshold spiking neural network is:
[0021]
[0022] Where, x l (t) represents the input current of the l-th layer; This represents the synaptic weight connecting the p-th neuron in the (l-1)-th layer to the q-th neuron in the current l-th layer; This represents the firing pulse of the p-th neuron in the (l-1)-th layer at time t; This represents the bias term for the q-th neuron in the current l-th layer.
[0023] More specifically, the linear layer in a multi-threshold spiking neural network consists of a Flatten layer and two fully connected layers.
[0024] Furthermore, step S5 specifically includes:
[0025] Construct the loss function for a multi-threshold spiking neural network, namely:
[0026]
[0027] Where λ is the threshold level; y is the neuron firing rate at the j threshold levels; n It represents the target output of the nth sample; N represents the total number of samples.
[0028] Then, the gradient surrogate method is used to adjust the synaptic weights between neurons in the multi-threshold spiking neural network, where the synaptic weights w pq and bias term b q The expression for updating the value is:
[0029]
[0030] Where η is the learning rate; The loss function represents the impulse S fired by the neuron. n The derivative; Indicates the neuron firing pulse S q Regarding the membrane potential V q The derivative; Represents membrane potential V q Synaptic weight w pq The derivative; Represents membrane potential V q For the bias term b q The derivative of .
[0031] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0032] This invention utilizes a spiking neural network constructed with multi-threshold integral firing neurons to achieve high accuracy in ECG signal classification comparable to traditional neural networks, while exhibiting stronger robustness. The spiking neural network employs a bio-inspired pulse signal calculation method, significantly reducing computational load and energy consumption, making it suitable for operation in resource-constrained embedded systems. The multi-threshold spiking neural network constructed in this invention not only achieves high accuracy and excellent robustness in ECG signal classification but also effectively handles complex and noisy ECG signals. Furthermore, it is suitable for portable ECG monitoring devices and mobile health devices, meeting the dual requirements of low power consumption and high efficiency. Attached Figure Description
[0033] Figure 1 This is a flowchart of the electrocardiogram signal classification method proposed in this invention;
[0034] Figure 2 This is a schematic diagram of the internal structure of the multi-threshold spiking neural network designed in this invention;
[0035] Figure 3 This is a schematic diagram of the linear layer in the multi-threshold spiking neural network designed in this invention;
[0036] Figure 4 This is a schematic diagram of the multi-threshold integral firing neuron used in the multi-threshold spiking neural network of the present invention;
[0037] Figure 5 This is a graph showing the change in accuracy of the ECG signal classification method proposed in this invention with epoch training.
[0038] Figure 6 This is a comparison chart of the results of the electrocardiogram signal classification method proposed in this invention and existing methods. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of this invention clearer, the following description is provided in conjunction with the appendix. Figure 1-6 The present invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0040] Although the steps in this invention are arranged by reference numerals, this is not intended to limit the order of the steps. Unless the order of the steps is explicitly stated or the execution of a step requires other steps as a basis, the relative order of the steps can be adjusted. It is understood that the term "and / or" as used herein refers to and covers any and all possible combinations of one or more of the associated listed items.
[0041] like Figure 1 As shown, this invention proposes a multi-threshold spiking neural network method for ECG signal classification, which specifically includes the following steps:
[0042] S1. Acquire the raw single-channel electrocardiogram signal and use wavelet transform to remove noise;
[0043] In this embodiment, the dataset of the original ECG signal contains 48 dual-channel (12-bit per channel, 12-bit sampling precision) ECG signal records, each record lasting 30 minutes, with a sampling frequency of 360Hz (i.e., 360 samples per second). The first and second channels record different leads of the two ECG signals, respectively, obtaining the MLII channel signal of the original ECG signal. The original ECG signal is often affected by various noises and interferences; therefore, wavelet transform is performed to decompose it into sub-signals of different frequencies, allowing for better analysis of the signal's time-frequency characteristics. This embodiment uses Discrete Wavelet Transform (DWT), which decomposes the signal into multiple sub-signals (i.e., wavelet coefficients) through multi-scale decomposition. Then, threshold denoising is applied, setting the portion of the wavelet detail coefficients below a certain threshold to zero, thereby removing high-frequency noise. Finally, inverse wavelet transform is performed to recombine the processed wavelet coefficients into a denoised signal. The denoised signal is obtained by performing inverse wavelet transform on the adjusted coefficients.
[0044] S2. Extract multiple heartbeat segments from the denoised ECG signal based on the R-wave peak position to form an ECG signal dataset; and divide the ECG signal dataset into a training set and a test set.
[0045] In a preferred embodiment, step S2 specifically includes:
[0046] The annotation information of the electrocardiogram (ECG) signal is read to obtain the position of the R-wave peak and its corresponding label. For the input denoised ECG signal, L sampling points are selected forward and 2L sampling points are selected backward, centered on each R-wave peak position, to extract a heartbeat segment with a length of 3L sampling points, including the R-wave peak. The ECG signal dataset is composed of multiple independent heartbeat segments, denoted as M = {(X... n ,Y n ),n=1,2,…,N};where,X n For the nth heartbeat segment, Y n The label is the nth heartbeat segment, and N is the number of heartbeat segments. The first N′ heartbeat segments in the ECG signal dataset are used as the training set, and the remaining NN′ segments are used as the test set.
[0047] In this embodiment, L=100, with the R wave peak as the center, 99 sampling points are obtained forward and 200 sampling points are obtained backward, and an ECG signal segment with a length of 300 is cut out.
[0048] S3. Based on the firing characteristics of biological neurons, construct a multi-threshold integral firing neuron MTIF;
[0049] In a preferred embodiment, step S3 specifically includes:
[0050] A multi-threshold integral firing neuron MTIF is formed by combining λ integral firing neurons (IFs). Each IF neuron serves as a sub-neuron, corresponding to λ different firing thresholds θ1, θ2, ..., θ3. λ And by sharing the input current, pulse responses at different thresholds can be achieved, such as Figure 4 As shown; for a single MTIF neuron, multiple threshold determinations share a unified membrane potential. After each time step, all sub-neurons in the MTIF will determine whether their corresponding threshold has been reached based on the current membrane potential and trigger the corresponding level of pulse output; each threshold level will be determined one by one, and if the current membrane potential exceeds θ... j The count is 1 if it is not exceeded and 0 if it is not exceeded; the final output will be calculated based on whether each sub-neuron triggers a pulse. That is, for an MTIF neuron, the decrease in membrane potential at a certain time step is: (number of sub-neurons exceeding the threshold / total number of neurons) * maximum threshold.
[0051] The dynamic equation of a multi-threshold integral firing neuron MTIF is expressed as:
[0052]
[0053] Among them, vi (t), v i (t-1) represent the membrane potentials of the i-th integral firing neuron IF at time steps t and t-1, respectively, and x(t) represents the input current at time step t; v j (t) represents the membrane potential of the j-th IF neuron after receiving input at time step t; Θ(.) represents the step function, when v j (t) is 1 when it exceeds the threshold, and 0 otherwise; It is the threshold of level j, V th The maximum firing threshold is set, where λ is the number of IF neurons and also represents the level of different thresholds set in MTIF.
[0054] Traditional integral firing neuron models typically employ a single fixed threshold mechanism. When the membrane potential exceeds this threshold, a pulse is triggered, resetting or reducing the membrane potential to a set value. This fixed threshold design tends to overlook differences in input current intensity and subtle dynamic characteristics when processing signals with complex dynamic variations. Its responsiveness to signals of varying amplitudes is limited, thus restricting the model's performance in feature extraction.
[0055] The multi-threshold integral firing neuron designed in this invention introduces multiple firing thresholds and achieves impulse responses of different intensities through a shared input current mechanism. Each sub-neuron generates a pulse after being triggered by its specific threshold and differentially attenuates the membrane potential according to the intensity of the received input signal, rather than using a uniform membrane potential reset strategy, thus preserving more dynamic information about the changes in the intensity of the input signal. This multi-threshold mechanism significantly improves the model's ability to perceive multi-scale features and recognize weak signals without significantly increasing network depth or structural complexity, achieving a finer-grained representation of the input ECG signal. It effectively overcomes the performance bottlenecks of traditional single-threshold neurons in terms of information representation granularity, dynamic modeling ability, and complex signal recognition.
[0056] Furthermore, this embodiment also calculates the membrane potential output and changes of MTIF neurons throughout the entire time interval to reflect the average response rate of neurons within that time interval, characterizing their overall activity and information transmission intensity; specifically, by summing and dividing by T over time steps t=1 to T, under the multi-threshold integral firing mechanism, the relationship between neuronal membrane potential and time is as follows:
[0057]
[0058] in, W represents the average rate of change of the membrane potential of a neural network neuron over time. l x represents the weight of the l-th layer; l-1 (t) represents the input current from the previous layer to the current layer at the current time step; This represents the total firing rate of neurons across all threshold layers between time 1 and T, normalized to a unit time.
[0059] S4. Construct a multi-threshold spiking neural network based on MTIF, and train and test the neural network using heartbeat segments as input;
[0060] In a preferred embodiment, step S4 specifically involves:
[0061] A multi-threshold spiking neural network was constructed based on multi-threshold integral spiking neurons. The constructed spiking neural network includes 3 convolutional layers, 3 neuron layers, and 3 pooling layers, connected sequentially in the order of one convolutional layer - one neuron layer - one pooling layer; the specific structure is as follows. Figure 2 As shown, the first layer is a one-dimensional convolutional layer with a dimension of 4, a kernel size of 21, and a stride of 1; the second layer uses MTIF neurons; the third layer is a one-dimensional pooling layer with a dimension of 4, a kernel size of 3, and a stride of 2; the fourth layer is a one-dimensional convolutional layer with a dimension of 16, a kernel size of 23, and a stride of 1; the fifth layer uses MTIF neurons; the sixth layer is a one-dimensional pooling layer with a dimension of 16, a kernel size of 3, and a stride of 2; the seventh layer is a one-dimensional convolutional layer with a dimension of 32, a kernel size of 25, and a stride of 1; the eighth layer uses MTIF neurons; and the ninth layer is a one-dimensional pooling layer with a dimension of 32, a kernel size of 3, and a stride of 2.
[0062] Finally, the linear layer outputs the final classification result; the convolutional layer uses one-dimensional convolution, the neuron layer uses multi-threshold integral firing of neurons, and the pooling layer uses max pooling; at each time step, the convolutional layer extracts local temporal features and outputs continuous-value current as the input current of the neuron layer, and the pooling layer processes the output pulses of the neuron layer; the input amount between each layer is controlled by weight parameters. In this embodiment, the convolutional layer processes spatial information and extracts local temporal features through convolution operations; the pooling operation simplifies downstream information processing by selecting the neuron with the highest pulse frequency or merging multiple pulse signals, thereby compressing the spatial or temporal dimensions of pulse data, preserving key pulse features, enhancing the expressive power of sparse pulse signals, and improving the model's abstraction ability.
[0063] More specifically, the expression for the input current of a neuron layer in a multi-threshold spiking neural network is:
[0064]
[0065] Where, x l (t) represents the input current of the l-th layer; This represents the synaptic weight connecting the p-th neuron in the (l-1)-th layer to the q-th neuron in the current l-th layer; This represents the firing pulse of the p-th neuron in the (l-1)-th layer at time t; This represents the bias term for the q-th neuron in the current l-th layer.
[0066] It should be noted that in this embodiment, current signals or pulse signals are transmitted between the layers of the neural network, and the input amount is controlled by weight parameters. If the focus is on the information transmission between neurons, it can also be regarded as each neuron in two neuron layers transmitting pulse signals through synapses under the control of synaptic weights; the synaptic weights are calculated based on the weight parameters between layers.
[0067] More specifically, such as Figure 3 As shown, the linear layer in a multi-threshold spiking neural network consists of a Flatten layer and two fully connected layers. The Flatten layer flattens the final output to 1216 dimensions, and then the two fully connected layers reduce the dimension to 16 and 5 dimensions respectively for feature extraction. Finally, the output is mapped to a 5-dimensional output space to obtain the classification result for the corresponding classification task.
[0068] S5. During the training process, construct the loss function of the multi-threshold spiking neural network and use the gradient surrogate method to adjust the synaptic weights between neurons and the bias terms of neurons in the multi-threshold spiking neural network.
[0069] In a preferred embodiment, step S5 specifically includes:
[0070] Construct the loss function for a multi-threshold spiking neural network, namely:
[0071]
[0072] Where λ is the threshold level; N represents the total number of samples;
[0073] It is the neuron firing rate at j threshold levels. Neuron firing rate = total number of firing pulses / timestep. For example, if timestep = 10, the pulse firing pattern is [0,1,1,0,0,1,1,0,1,1], and the pulse firing rate is 6 / 10 = 0.6.
[0074] y n This is the target output of the nth sample. The more times the output neuron fires a spurt, the higher the confidence level in a certain class. For example, if the output layer has 10 neurons (corresponding to the numbers 0-9), the neuron with the highest firing rate is determined to be the class represented by the corresponding number.
[0075] In this embodiment, the loss function is a weighted sum based on multiple threshold levels λ. That is, each threshold level has its corresponding loss component. The threshold level λ is introduced to refine the sources of error in the network and optimize the network performance based on the neuron behavior at different threshold levels.
[0076] Then, the gradient surrogate method is used to adjust the synaptic weights between neurons in the multi-threshold spiking neural network, where the synaptic weights w pq and bias term b q The expression for updating the value is:
[0077]
[0078] Where η is the learning rate; The loss function represents the impulse S fired by the neuron. n The derivative; Indicates the neuron firing pulse S q Regarding the membrane potential V q The derivative; Represents membrane potential V q Synaptic weight w pq The derivative; Represents membrane potential V q For the bias term b q The derivative of .
[0079] S6. A multi-threshold pulse neural network with optimal parameter configuration is obtained through training and testing to achieve ECG signal classification.
[0080] This embodiment provides specific training and testing results, such as... Figure 5 As shown in the figure, the recognition accuracy of the ECG signal classification method proposed in this invention on the test set is demonstrated. It can be seen from the figure that the neural network model involved in the proposed method can achieve fast convergence and a classification accuracy of 99.41%, achieving high accuracy with relatively few network layers.
[0081] For example Figure 6 As shown, it can be seen that compared with traditional convolutional neural networks, the present invention has superior classification performance compared with existing neural networks even with fewer network layers.
[0082] In summary, this invention, through the construction of a spiking neural network using multi-threshold integral firing neurons, achieves high accuracy comparable to traditional neural networks in ECG signal classification while exhibiting excellent robustness, effectively handling complex and noisy signals. Furthermore, the spiking neural network utilizes pulse signal computation, significantly reducing computational load and energy consumption, making it suitable for operation in resource-constrained embedded systems, particularly portable ECG monitoring devices and mobile health devices, meeting the dual requirements of low power consumption and high efficiency.
[0083] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.
[0084] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0085] The above embodiments provide a detailed description of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for electrocardiosignal classification based on a multi-threshold spiking neural network, characterized in that, Specifically comprising the following steps: S1, acquiring a single-channel original electrocardiosignal and denoising using a wavelet transform method; S2, cutting a plurality of heartbeat segments from the denoised electrocardiosignal according to the position of the R wave peak to form an electrocardiosignal dataset; and dividing the electrocardiosignal dataset into a training set and a test set; S3, constructing a multi-threshold integral firing neuron (MTIF) based on the discharge characteristics of biological neurons; Use A group of integrate-and-fire neurons IF is combined into a multi-threshold integrate-and-fire neuron MTIF, each IF neuron as a sub-neuron, respectively corresponding to A different firing threshold And the pulse response under different thresholds is realized through shared input current; The dynamic equation of a multi-threshold integrate-and-fire neuron MTIF is represented as: ; where, , denote the membrane potential of the i th MTIF at time step t , t -1, denote the input current at time step t ; denote the membrane potential of the j th IF neuron after receiving input at time step t ; denote the step function, which is 1 when exceeds the threshold value, and 0 otherwise; is the jth threshold value, is the maximum discharge threshold value set, is the number of IF neurons, also indicating the number of levels of different thresholds set in the MTIF; S4, constructing a multi-threshold pulse neural network based on the MTIF, taking the heartbeat segment as the input, and training and testing the neural network; step S4 is specifically: A multi-threshold pulse neural network is constructed based on a multi-threshold integral pulse firing neuron. The constructed pulse neural network includes three convolutional layers, three neuron layers, and three pooling layers; and is sequentially connected in the order of one convolutional layer-one neuron layer-one pooling layer, and finally outputs the final classification result through a linear layer; the convolutional layer uses one-dimensional convolution, the neuron layer uses a multi-threshold integral firing neuron, and the pooling layer uses maximum pooling; At each time step, the convolutional layer extracts local time sequence features, outputs a continuous value current as the input current of the neuron layer, and the pooling layer processes the output pulse of the neuron layer; the input quantity between layers is controlled through weight parameters; S5, in the training process, a loss function of the multi-threshold pulse neural network is constructed, and a gradient proxy method is used to adjust the synaptic weights between neurons and the bias term of the neurons in the multi-threshold pulse neural network; S6, after training and testing, a multi-threshold pulse neural network with optimal parameter configuration is obtained, and electrocardiosignal classification is realized.
2. The ECG signal classification method based on multi-threshold pulse neural network according to claim 1, characterized in that, Step S2 is specifically: Read the annotation information of the electrocardiogram signal, obtain the position of the R-wave peak and the corresponding label, and for the input denoised electrocardiogram signal, select L sampling points forward and 2L sampling points backward as the center of each R-wave peak position, and cut out a heart beat segment including the R-wave peak point with a length of 3L sampling points; the electrocardiogram signal dataset is composed of multiple independent heart beat segments, denoted as ; wherein, is the nth heart beat segment, is the label of the nth heart beat segment, is the number of heart beat segments; the first heart beat segments in the electrocardiogram signal dataset are used as the training set, and the remaining heart beat segments are used as the test set.
3. The ECG signal classification method based on multi-threshold pulse neural network according to claim 1, characterized in that, The expression of the input current of the neuron layer of the multi-threshold pulse neural network is: ; wherein, represents the input current of the l layer; represents the synaptic weight connecting the l -1 layer p th neuron to the current l layer q th neuron; represents the firing pulse of the l -1 layer p th neuron at time t t; represents the bias term of the current l layer q th neuron.
4. The ECG signal classification method based on multi-threshold pulse neural network according to claim 1, characterized in that, The linear layer in the multi-threshold pulse neural network is specifically composed of a Flatten layer and two fully connected layers.
5. The electrocardiosignal classification method based on a multi-threshold pulse neural network according to claim 1, wherein step S5 is specifically: The loss function of the multi-threshold pulse neural network is constructed, that is: ; wherein λ is the threshold level; is j is the firing rate of neurons at the threshold level; is the target output of the n sample; N denotes the total number of samples; The gradient-based method is used to adjust the synaptic weights between neurons in the multi-threshold pulse neural network, and the expression of the updated value of the synaptic weights and the bias term is ; ; wherein, is the learning rate; denotes the derivative of the loss function with respect to the neuron spike ; denotes the derivative of the neuron spike with respect to the membrane potential ; denotes the derivative of the membrane potential with respect to the synaptic weight ; denotes the derivative of the membrane potential with respect to the bias term .
Citation Information
Patent Citations
Electrocardiosignal abnormity prediction method and device based on SNN network
CN114732415A
Long-time-history electrocardiogram classification method and system based on pulse neural network
CN116548980A