Brain-like classification model construction method for BCG

Through the ECG-BCG mapping model and brain-like classification model, the problems of insufficient samples and low classification accuracy of the BCG data set are solved, and BCG sample expansion and improvement of heart-pitch classification accuracy are achieved, which is suitable for clinical diagnosis and personalized treatment.

CN119167192AActive Publication Date: 2024-12-20JIAXING UNIV +2
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411226542.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-12-20
Estimated Expiration
2044-09-03

AI Technical Summary

Technical Problem

The insufficient number of samples and the low accuracy of heart-shooting classification make it difficult to meet the needs of deep learning analysis.

Method used

A brain-like classification model for BCG is constructed, the number of BCG samples is expanded through the ECG-BCG mapping model, and the U-shaped convolution network and pulsed neural network are used to improve the accuracy of heart-shoot classification.

Benefits of technology

The number of BCG samples has been effectively expanded, the model's ability to extract ECG and BCG signal characteristics has been improved, the accuracy of heart shot classification has been improved, and a high-quality training data set is provided, suitable for clinical diagnosis and personalized treatment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119167192A_ABST
    Figure CN119167192A_ABST
Patent Text Reader

Abstract

The invention relates to a BCG-oriented brain-like classification model construction method, belongs to the technical field of medical signal intelligent processing, and solves the technical problems of insufficient sample quantity of a BCG data set and low BCG signal classification accuracy. Comprising the following steps: constructing a first training data set comprising a preprocessed ECG and a corresponding BCG; training an ECG-BCG mapping model by using the first training data set until a loss function is converged to obtain a trained ECG-BCG mapping model; based on the trained ECG-BCG mapping model, constructing a second training data set of the brain-like classification model; wherein the second training data set comprises a BCG and a heart beat type corresponding to the ECG; and training a brain-like classification model by using the second training data set, and obtaining a trained brain-like classification model after the maximum iteration round is reached. The number of BCG samples is increased, and the accuracy of BCG signal classification is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical signal intelligent processing, and in particular to a method for constructing a brain-like classification model for BCG (Ballistocardiogram, cardiac shock signal). Background Art

[0002] ECG (Electrocardiogram) is an electrical conduction signal that records the electrical activity of the heart. By placing electrodes on the surface of the skin, the voltage changes of the heart at different time points can be measured. ECG is widely used to diagnose heart diseases such as arrhythmia, myocardial infarction, myocardial ischemia, etc. Doctors can evaluate the health of the heart by analyzing the shape and interval of the ECG signal waveform to help diagnose diseases, develop treatment plans and monitor the efficacy. ECG can also be used to screen high-risk groups, detect potential heart problems early, and prevent the occurrence of cardiovascular diseases.

[0003] In contrast, BCG is a mechanical signal that records the mechanical movement of the heart, reflecting the contraction and relaxation of the heart by measuring the chest vibrations generated when the heart beats. BCG can provide information about the heart's contractility, heart rate, heart volume, etc., which is of great significance for evaluating the impact of heart function and heart disease. By using BCG, doctors can understand the patient's heart condition in more detail, develop targeted and personalized treatment plans, improve treatment effects, and reduce the risk of heart attacks and complications.

[0004] Unlike ECG, which must be obtained through contact between electrodes and conductive media (such as gel) and the skin, BCG measures the mechanical signals generated by chest vibration when the heart beats. BCG detection does not require direct contact with human skin and can be monitored for a long time without disturbing the subject. This non-invasive feature is particularly suitable for long-term monitoring and sleep monitoring. The contactless wearable BCG detection equipment has experienced rapid development and can be maturely applied in daily environments. It reduces the cost of detection and significantly improves the detection efficiency, making abnormal heart rate detection more convenient and efficient, and the measurement accuracy has also been improved. BCG detection technology is not only used for heart rate detection, sleep structure analysis, cardiac function monitoring and evaluation, but also shows potential in the diagnosis of cardiovascular diseases and postoperative recovery evaluation.

[0005] However, compared with the abundant ECG datasets, the number of BCG datasets publicly available by medical institutions is relatively insufficient to meet the huge demand for various types of analysis and deep learning of BCG. At the same time, the accuracy of BCG in classifying abnormal heart beats is also low. Summary of the invention

[0006] In view of the above analysis, an embodiment of the present invention aims to provide a method for constructing a brain-like classification model for BCG, so as to solve the technical problems of insufficient number of BCG data set samples and low accuracy of BCG heart beat classification in existing methods.

[0007] The present invention provides a method for constructing a brain-like classification model for BCG, comprising the following steps:

[0008] Constructing a first training data set including preprocessed ECG and corresponding BCG;

[0009] Using the first training data set to train the ECG-BCG mapping model until the loss function converges to obtain a trained ECG-BCG mapping model;

[0010] Based on the trained ECG-BCG mapping model, construct a second training data set for the brain-like classification model; wherein the second training data set includes the heartbeat types of BCG and corresponding ECG;

[0011] The brain-like classification model is trained using the second training data set, and a trained brain-like classification model is obtained after reaching a maximum number of iteration rounds.

[0012] Furthermore, an ECG-BCG mapping model is constructed based on the encoding-decoding structure of the U-shaped convolutional network, including an encoder module and a decoder module;

[0013] The encoder module is used to downsample the received pre-processed ECG to extract local features and output a feature map matrix representing the local features;

[0014] The decoder module restores the spatial dimension through the transposed convolution layer, and fuses the local features extracted by the encoder module with the global features sampled by the decoder module through skip connections, restores them to the original dimensional space, and outputs the BCG corresponding to the preprocessed ECG;

[0015] Among them, the feature map matrix is ​​represented as a three-dimensional tensor, and the three dimensions are batch size, number of channels, and sequence length.

[0016] Furthermore, the encoder module is a downsampling structure, comprising five downsampling layers, wherein:

[0017] The first downsampling layer includes a convolution layer with a stride of 1, layer normalization, and PReLU activation. The convolution layer increases the number of channels of the input feature map from 1 to 32 and outputs it to the second downsampling layer.

[0018] The second to fifth downsampling layers include two convolutional layers with a stride of 1 and a maximum pooling layer. Each convolutional layer is followed by layer normalization and PReLU activation. The first convolutional layer doubles the number of channels of the feature map input to the current layer. The second convolutional layer keeps the number of channels unchanged and halves the sequence length dimension of the feature map input to the current layer through the maximum pooling layer, thus outputting the feature map with the changed number of channels and sequence length dimensions.

[0019] Among them, layer normalization is used to accelerate convergence, and PReLU activation introduces nonlinearity to enhance the sensitivity of the encoder module to subtle changes in local features.

[0020] Furthermore, the decoder module is an upsampling structure, including six upsampling layers, as follows:

[0021] The first upsampling layer includes two convolutional layers with a stride of 1 and a transposed convolutional layer. Each convolutional layer with a stride of 1 is followed by layer normalization and PReLU activation. The two convolutional operations with a stride of 1 keep the number of channels unchanged. The transposed convolutional layer is used to halve the number of channels and double the sequence length to achieve spatial expansion and upsampling of features.

[0022] The second to fourth upsampling layers include two convolution layers with a step size of 1 and a transposed convolution layer in sequence. Each convolution layer with a step size of 1 is followed by layer normalization and PReLU activation. The first convolution layer with a step size of 1 first halves the number of channels of the feature map input to the current layer, the second convolution layer with a step size of 1 keeps the number of channels unchanged, and then uses a transposed convolution layer to halve the number of channels and double the sequence length; the input of the second upsampling layer and the output of the fourth downsampling layer, the input of the third upsampling layer and the output of the third downsampling layer, and the input of the fourth upsampling layer and the output of the second downsampling layer are sequentially skip-connected to fuse the downsampled local features and the upsampled global features; the second to fourth upsampling layers respectively output the feature maps with changed channel numbers and sequence lengths to the next layer for upsampling;

[0023] The fifth upsampling layer includes two convolutional layers with a stride of 1 and a transposed convolutional layer. Each convolutional layer with a stride of 1 is followed by layer normalization and PReLU activation. The first convolutional layer with a stride of 1 reduces the number of channels by half to refine the feature representation. The second convolutional layer with a stride of 1 keeps the number of channels unchanged to further extract and fuse the downsampled and upsampled features.

[0024] The sixth upsampling layer uses a single convolutional layer to reduce the number of channels from 16 to 1, maps the decoded feature map back to the dimension of the feature map input to the encoder module, and outputs the BCG mapped by the ECG.

[0025] Further, the original signal sequences of ECG and corresponding BCG data are obtained from the first public data set and preprocessed to obtain the first training data set, the steps comprising:

[0026] Taking the first R peak of the original signal sequence of the ECG as the starting point, and the J peak corresponding to the timestamp of the first R peak in the original signal sequence of the BCG as the starting point, non-overlapping segmentation is performed with preset sequence lengths respectively;

[0027] The data points before the first R peak in ECG and the first J peak corresponding to BCG, as well as the data points that are less than the preset sequence length after segmentation, are discarded;

[0028] Normalize the amplitudes of the segmented ECG and BCG;

[0029] The normalized ECG and the corresponding BCG constitute each sample in the first training data set.

[0030] Further, loading the first training data set into the ECG-BCG mapping model for training;

[0031] A fixed learning rate is adopted, an MSE mean square error loss function is used for forward propagation, and an Adam optimizer is used for back propagation, and the ECG-BCG mapping model parameters are continuously adjusted to minimize the loss function until the loss function converges to obtain a trained ECG-BCG mapping model.

[0032] Furthermore, the brain-like classification model is constructed based on a spiking neural network, which includes a static convolutional layer, a channel attention layer, and a fully connected classification module in sequence;

[0033] The static convolution layer includes a one-dimensional convolution layer Conv1d, a LIFNode brain-like activation layer and a pooling layer; the one-dimensional convolution layer Conv1d is used for channel expansion and feature extraction. After the input feature map is convolved by Conv1d and activated by LIFNode brain-like, the number of channels is expanded from 1 to 4, and the sequence length is reduced from 304 to 284; then the pooling layer downsamples the feature map with expanded channels and reduced sequence length and outputs it, which is set to X;

[0034] The channel attention layer includes a channel weight branch and a transfer input branch;

[0035] The channel weight branch is combined with the AdaptiveMaxPool1d function and the custom convolution to output the attention values ​​of different channels, which are set to A;

[0036] The transfer input branch first performs a multiplication operation of X and A, then passes through a convolution layer and a pooling layer for downsampling, and then outputs a feature map of a three-dimensional tensor to the fully connected classification module for classification;

[0037] The fully connected classification module includes a Flatten layer and a linear layer. The feature map of the input three-dimensional tensor is expanded into a two-dimensional tensor through the Flatten function, and then passes through the linear layer to obtain the classification prediction probability of the heartbeat type; the heartbeat classification result is obtained based on the classification prediction probability.

[0038] Further, ECG data is obtained from the second public data set and preprocessed, and the trained ECG-BCG mapping model is input to obtain corresponding BCG data, and the heartbeat type of the corresponding ECG in the second public data set is used as a label to form the second training data set;

[0039] The second training data set is loaded into the brain-like classification model for training until a maximum number of iterations is reached.

[0040] Furthermore, the calculation mechanism of the LIFNode brain-like activation layer is:

[0041]

[0042] Where T is the preset brain-like time step, V[T] and V[T-1] are the brain-like neuron membrane potentials at brain-like time steps T and T-1, respectively, Y[T] is the feature map output by Conv1d convolution, τ m is the preset membrane time constant, V reset is the reset potential;

[0043] If V[T] reaches the preset discharge threshold V threshold , the membrane potential is reset to zero, and V[T] is input into the substitute function of the step function for back propagation; the substitute function is as follows:

[0044]

[0045] Otherwise, if V[T] does not reach the preset discharge threshold V threshold , the membrane potential of brain-like neurons remains V[T].

[0047] Furthermore, the first public data set is the BED-BASED BALLISTOCARDIOGRAPHYDATASET published by NIH; wherein ECG and BCG correspond one to one based on timestamps;

[0048] The second public data set is an electrocardiogram data set published by MIT-BIH, including ECG signals and corresponding heart beat types.

[0049] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:

[0050] 1. Through the ECG-BCG mapping model, the number of BCG samples is effectively expanded, the problem of insufficient number of BCG data set samples is solved, and the utilization rate of BCG samples is improved;

[0051] 2. The ECG-BCG mapping model is established using the encoding-decoding structure of the U-shaped convolutional network, which improves the model's ability to extract local and global features of ECG and BCG signals and enhances the richness of feature expression;

[0052] 3. The brain-like classification model built based on the spiking neural network improves the accuracy of heartbeat classification through the LIFNode brain-like activation module and channel attention mechanism;

[0053] 4. By integrating NIH's BED-BASED BALLISTOCARDIOGRAPHY DATASET and MIT-BIH's ECG dataset, a comprehensive and accurately labeled training dataset was constructed, providing high-quality data support for brain-like classification model training and achieving effective integration of public datasets;

[0054] 5. Compared with the existing abnormal heartbeat detection methods, the present invention makes better use of the mechanical information contained in BCG and can more effectively detect the mechanical movement of the heart. The heart-brain classification model has broad application prospects in clinical diagnosis, long-term monitoring and personalized treatment.

[0055] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.

[0057] Figure 1 A flowchart of a method for building a brain-like classification model for BCG;

[0058] Figure 2 The RR peak of ECG and the JJ peak of BCG collected simultaneously have a fixed time delay;

[0059] Figure 3The structure diagram of the ECG-BCG mapping model based on the encoding-encoding structure of the U-shaped convolutional network;

[0060] Figure 4 This is a structural diagram of the brain-like classification model based on pulse neural network. DETAILED DESCRIPTION

[0061] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0062] The sample size of the existing BCG dataset is relatively insufficient. In order to give full play to the advantages of BCG signals in detecting abnormal heart rate, BCG signals contain more information such as cardiac contractility than ECG signals. A lightweight intelligent algorithm that can be deployed on BCG devices is designed to achieve fast and effective disease detection.

[0063] BCG signals provide direct measurements of cardiac mechanical activity, including cardiac contractility and load, which ECG cannot provide; BCG is non-invasive and wearable, so it is best to deploy lightweight diagnostic algorithms on the chip; Brain-like Neural Networks have the advantage of being lightweight compared to traditional convolutional networks. The combination of brain-like neural networks and BCG is a cutting-edge innovation.

[0064] In order to solve the above-mentioned technical problems that the existing cardiac impact signal data set is relatively insufficient and the heart beat classification accuracy based on cardiac impact signals is not high, the present invention proposes a method for constructing a brain-like classification model for BCG.

[0065] First, in view of the relatively insufficient existing cardiac shock signal data set, based on the iso-periodicity of ECG and cardiac shock signals, such as Figure 2 As shown in the diagram of ECG and BCG data collected simultaneously, the RR interval between ECGR-R peaks and the JJ interval between JJ peaks of cardiac shock signals have the characteristic of fixed time delay. The present invention proposes an ECG-BCG mapping model based on an encoding-decoding structure of a U-shaped convolutional network; the function of the model is to accurately perform ECG-BCG mapping, effectively expand BCG sample data, and solve the problem of insufficient number of samples in existing cardiac shock signal data sets.

[0066] Secondly, in view of the excellent characteristics of low detection cost and rich details of BCG, the present invention uses BCG to detect and classify abnormal heartbeats, and proposes a brain-like classification model based on brain-like neural networks. The brain-like classification model can conveniently achieve more accurate heartbeat classification and identify disease types.

[0067] To achieve the above objectives, a specific embodiment of the present invention discloses a method for constructing a brain-like classification model for BCG, such as Figure 1 As shown, the following steps are included:

[0068] Step S1, constructing a first training data set including preprocessed ECG and corresponding BCG;

[0069] Step S2, training the ECG-BCG mapping model using the first training data set until the loss function converges to obtain a trained ECG-BCG mapping model;

[0070] Step S3, constructing a second training data set for the brain-like classification model based on the trained ECG-BCG mapping model; wherein the second training data set includes BCG and the heartbeat types corresponding to ECG;

[0071] Step S4: Use the second training data set to train a brain-like classification model, and obtain a trained brain-like classification model after reaching a maximum number of iterations.

[0072] Step S1 includes steps S11-S12.

[0073] The steps of obtaining the original signal sequences of ECG and corresponding BCG data from the first public data set and preprocessing them to obtain the first training data set include:

[0074] Taking the first R peak of the original signal sequence of the ECG as the starting point, and the J peak corresponding to the timestamp of the first R peak in the original signal sequence of the BCG as the starting point, non-overlapping segmentation is performed with preset sequence lengths respectively;

[0075] The data points before the first R peak in ECG and the first J peak corresponding to BCG, as well as the data points that are less than the preset sequence length after segmentation, are discarded;

[0076] Normalize the amplitudes of the segmented ECG and BCG;

[0077] The normalized ECG and the corresponding BCG constitute each sample in the first training data set.

[0078] For the ECG original signal sequence, find the first R peak of the signal from the beginning of the signal in sequence as the starting point.

[0079] Step S11 : acquiring an original signal sequence including ECG and BCG synchronized therewith from a first public data set.

[0080] Acquire an original signal sequence from the first public data set, the original signal sequence including ECG and BCG corresponding thereto synchronously, and perform data preprocessing;

[0081] like Figure 2 As shown, the BCG and ECG signals are collected simultaneously.

[0082] Reading the original signal sequence from the first public data set, including ECG and corresponding BCG, the two are synchronized by time stamps;

[0083] Exemplarily, the original signal sequence is ECG and the corresponding BCG in mat format.

[0084] In the present invention, the first public data set is the BED-BASEDBALLISTOCARDIOGRAPHY DATASET published by NIH; wherein ECG and BCG correspond one to one based on timestamps;

[0085] The first public data set used in the present invention comes from NIH (National Library of Medicine, National Center for Biotechnology Information). The name of the public signal data set is: BED-BASED BALLISTOCARDIOGRAPHY DATASET. The length of the public original signal sequence, ECG and BCG, is 107616 data points.

[0086] In the public signal dataset, the ECG and BCG original signal sequences correspond one to one, one ECG corresponds to one BCG. There are 354 groups of samples, with a total of 708 original signal sequence data.

[0087] Step S12: pre-process the ECG and the corresponding BCG of the original signal sequence to construct a first training data set.

[0088] (1) Perform non-overlapping segmentation on the ECG and corresponding BCG original signal sequences.

[0089] Use a loop function to split the ECG and the corresponding BCG in the original signal sequence without overlapping, starting from the first R peak of ECG and the J peak of BCG corresponding to the first R peak of ECG, with every 304 data points as the interval length, and save it in a two-dimensional tensor format, expressed as [number of samples, sequence length].

[0090] The length of ECG and BCG in the original signal sequence is 107616 data points, and 354 data are obtained by non-overlapping segmentation at intervals of 304 data points. Each data segment after segmentation contains 304 data points.

[0091] For example, the loop function uses a for loop; it is saved in a numpy tensor format based on Python 3.8, with a size of [354, 304];

[0092] According to matrix storage, BCG and ECG are both stored as 354 signals with a length of 304 data points, represented as [354,304].

[0093] For the same patient, ECG and BCG are collected at the same time and correspond one to one based on the timestamp.

[0094] (2) The BCG and ECG signal data after non-overlapping segmentation are normalized to remove the original bias of the data values:

[0095] Normalization subtracts the mean (i.e., the mean amplitude of the signal) from each data point and then divides by the standard deviation, thereby converting the data into a format with mean and unit variance. This facilitates subsequent data processing and analysis.

[0096]

[0097] Among them, the current value is the amplitude of the signal tensor after non-overlapping segmentation; the average value is the sum of the amplitudes of all data points in the 304-point signal data set divided by the number of data points; and the standard deviation is also the standard deviation of the values ​​of the 304 points.

[0098] from Figure 2 It can be seen that if normalization is not performed, the vertical axis amplitudes of BCG and ECG are different, which makes it difficult to calculate in the subsequent steps. After normalization, all ECGs and corresponding BCGs after non-overlapping segmentation are between [0, 1], which simplifies the subsequent steps.

[0099] (3) Add a channel to the normalized two-dimensional signal tensor to expand it into a three-dimensional tensor and construct the first training data set.

[0100] Exemplarily, the processed two-dimensional signal tensor is shaped as [number of samples, sequence length] using the reshape function based on Python 3.8, and is expanded into a three-dimensional tensor, expressed as [number of samples, number of channels, sequence length], that is, expanded from [354, 304] to [354, 1, 304], adding a channel to prepare for the subsequent ECG-BCG mapping function and the channel dimension transformation of the brain-like classification model, to adapt to and cooperate with the subsequent ECG-ECG network structure, and to be compatible with the subsequent ECG-BCG mapping model;

[0101] After preprocessing, each signal sample data is a preprocessed ECG, and the corresponding preprocessed BCG is used as a sample to form a first training data set, which has a total of 354 samples.

[0102] (4) randomly sampling the first training data set and dividing it into a training set, a validation set, and a test set according to a preset ratio;

[0103] Exemplarily, for the sample data set obtained, 354 samples are randomly divided according to a preset ratio of 8:1:1, so that 283 samples form a training set, 36 samples form a validation set, and 35 samples form a test set;

[0104] Step S2 includes steps S21-S22.

[0105] Step S21, constructing an ECG-BCG mapping model.

[0106] (1) Construct an ECG-BCG mapping model based on the encoding-decoding structure of a U-shaped convolutional network. The model structure diagram is as follows: Figure 3 shown.

[0107] An ECG-BCG mapping model is constructed based on the encoding-decoding structure of a U-shaped convolutional network, including an encoder module and a decoder module;

[0108] The encoder module is used to downsample the received pre-processed ECG to extract local features and output a feature map matrix representing the local features;

[0109] The decoder module restores the spatial dimension through the transposed convolution layer, and fuses the local features extracted by the encoder module with the global features sampled by the decoder module through skip connections, restores them to the original dimensional space, and outputs the BCG corresponding to the preprocessed ECG;

[0110] Among them, the feature map matrix is ​​represented as a three-dimensional tensor, and the three dimensions are batch size, number of channels, and sequence length.

[0111] The encoder module is used to extract local features of the input feature map, and the decoder module is used to fuse the local features extracted by the encoder module downsampling with the global features extracted by its own upsampling. The specific parameters of each layer of the ECG-BCG mapping model are shown in Table 1.

[0112] Table 1: ECG-BCG mapping model structure parameter table

[0113]

[0114]

[0115]

[0116] like Figure 3 As shown:

[0117] The encoder module includes the first to fifth downsampling layers:

[0118] In each layer, the dimension of the number of samples remains unchanged.

[0119] (1) The first downsampling layer: the input feature map dimension is [16, 1, 304], and the output feature map dimension is [16, 32, 304];

[0120] The first downsampling layer is a single convolutional layer. The sample number dimension and sequence length dimension do not change. The number of channels defined in the convolution changes from 1 to 32.

[0121] (2) Second downsampling layer: The input is the output feature map dimension of the first downsampling layer [16, 32, 304], and the output feature map dimension is [16, 64, 152];

[0122] The channel number dimension is multiplied by 2 to get 64 channels;

[0123] After convolution, the sequence length S l The change of dimension is shown in formula (2):

[0124]

[0125] Among them, input_shape is the sequence length of the input feature map of this layer, kernel_size is the convolution kernel size, p is the padding, and strikes is the step size.

[0126] The sequence length of the second downsampling layer input is 304. After convolution, the sequence length dimension is calculated using formula (2) as follows:

[0127]

[0128] In the maximum pooling layer, the sequence length dimension is ÷2; the final sequence length dimension is 304÷2=152;

[0129] The final output feature map dimension of the second downsampling layer is [16, 64, 152].

[0130] (3) The third downsampling layer: The input is the output feature map dimension of the second downsampling layer [16, 64, 152], and the output feature map dimension is [16, 128, 76];

[0131] The channel number dimension is multiplied by 2 to get 128 channels;

[0132] The sequence length dimension is calculated using formula (2) to get 152, and then the maximum pooling layer sequence length dimension is divided by 2; the final sequence length dimension is 152 ÷ 2 = 76;

[0133] The final output feature map dimension of the third downsampling layer is [16, 128, 76].

[0134] (4) The fourth downsampling layer: the input is the output feature map dimension of the third downsampling layer [16, 128, 76], and the output feature map dimension is [16, 256, 38];

[0135] The channel number dimension is multiplied by 2 to get the number of channels to be 256;

[0136] The sequence length dimension is calculated using formula (2) to get 76, and then the maximum pooling layer sequence length dimension is divided by 2; the final sequence length dimension is 76÷2=38;

[0137] The final output feature map dimension of the fourth downsampling layer is [16, 256, 38].

[0138] (5) Fifth downsampling layer: The input feature map dimension of the fourth downsampling layer is [16, 256, 38], and the output feature map dimension is [16, 512, 19].

[0139] The channel number dimension is multiplied by 2 to get 512 channels;

[0140] The sequence length dimension is calculated using formula (2) to get 38, and then the maximum pooling layer sequence length dimension is divided by 2; the final sequence length dimension is 38÷2=19;

[0141] The final output feature map dimension of the fifth downsampling layer is [16,512,19].

[0142] The decoder module includes the first to sixth upsampling layers:

[0143] (1) First upsampling layer: The input feature map dimension is [16, 512, 19], and the output feature map dimension is [16, 256, 38].

[0144] The channel number dimension is divided by 2 when it is transferred to the convolutional layer to get 256 channels;

[0145] The sequence length dimension is calculated using formula (2) to get 19, and then the sequence length of the transposed convolution layer is multiplied by 2, and the final sequence length dimension is 38;

[0146] The final output feature map dimension of the first upsampling layer is [16, 256, 38].

[0147] (2) The second upsampling layer: The input is the output feature map dimension of the fourth downsampling layer [16, 256, 38] and the output feature map dimension of the first upsampling layer [16, 256, 38]. The jump cascade is performed to obtain the feature map dimension [16, 512, 38], and the output feature map dimension is [16, 128, 76].

[0148] [16,256,38] and [16,256,38] are skipped and cascaded to obtain [16,512,38], which is used as the input of the second upsampling layer;

[0149] After the convolution channel number is divided by 2, the transposed convolution layer divides the channel number by 2 again, resulting in a channel number of 128;

[0150] The sequence length dimension is calculated using formula (2) to be 38, and then the sequence length dimension of the transposed convolution layer is multiplied by 2 to obtain 76;

[0151] The final output feature map dimension of the second upsampling layer is [16, 128, 76].

[0152] (3) The third upsampling layer: The input is the output feature map dimension of the third downsampling layer [16, 128, 76] and the output feature map dimension of the second upsampling layer [16, 128, 76]. The feature map dimension is [16, 256, 76] after skip concatenation. The output feature map dimension is [16, 64, 152].

[0153] [16,128,76] and [16,128,76] are skipped and cascaded to obtain [16,256,76], which is used as the input of the third upsampling layer;

[0154] After the convolution channel number is divided by 2, the transposed convolution layer divides the channel number by 2 again, resulting in 64 channels;

[0155] The sequence length dimension is calculated using formula (2) to be 76, and then the sequence length dimension of the transposed convolution layer is multiplied by 2 to obtain 152;

[0156] The final output feature map dimension of the third upsampling layer is [16, 64, 152].

[0157] (4) The fourth upsampling layer: The input is the output feature map dimension of the second downsampling layer [16, 64, 152] and the output feature map dimension of the third upsampling layer [16, 64, 152]. The feature map dimension is [16, 128, 152] after skip concatenation. The output feature map dimension is [16, 32, 304].

[0158] [16, 64, 152] and [16, 64, 152] are skipped and cascaded to obtain [16, 128, 152], which is used as the input of the third upsampling layer;

[0159] After the convolution channel number is divided by 2, the transposed convolution layer divides the channel number by 2 again, resulting in a channel number of 32;

[0160] The sequence length dimension is calculated using formula (2) to be 152, and then the sequence length dimension of the transposed convolution layer is multiplied by 2 to obtain 304;

[0161] The final output feature map dimension of the fourth upsampling layer is [16, 32, 304].

[0162] (5) Fifth upsampling layer: The input is the output feature map dimension of the fourth upsampling layer [16, 32, 304], and the output feature map dimension is [16, 16, 304];

[0163] After the number of convolution channels is divided by 2, we get 16;

[0164] The final output feature map dimension of the fifth upsampling layer is [16, 16, 304].

[0165] (6) Sixth upsampling layer: The input is the output feature map dimension of the fifth upsampling layer [16, 16, 304], and the output feature map dimension is [16, 1, 304].

[0166] The sixth upsampling layer is a single convolutional layer, and the number of channels is reduced from 16 to 1.

[0167] In the present invention, convolution can change the number of channels. There are multiple changes in the number of channel dimensions in the present invention, namely: 1 dimension is increased to 32, the number of channels remains unchanged, the number of channels is multiplied by 2, the number of channels is divided by 2, and 16 is reduced to 1.

[0168] (2) Construct an encoder module for extracting local features, which stacks 5 layers of convolutional neural network layers.

[0169] The encoder module is a downsampling structure, including five downsampling layers, where:

[0170] The first downsampling layer includes a convolution layer with a stride of 1, layer normalization, and PReLU activation. The convolution layer increases the number of channels of the input feature map from 1 to 32 and outputs it to the second downsampling layer.

[0171] The second to fifth downsampling layers include two convolutional layers with a stride of 1 and a maximum pooling layer. Each convolutional layer is followed by layer normalization and PReLU activation. The first convolutional layer doubles the number of channels of the feature map input to the current layer. The second convolutional layer keeps the number of channels unchanged and halves the sequence length dimension of the feature map input to the current layer through the maximum pooling layer, thus outputting the feature map with the changed number of channels and sequence length dimensions.

[0172] Among them, layer normalization is used to accelerate convergence, and PReLU activation introduces nonlinearity to enhance the sensitivity of the encoder module to subtle changes in local features.

[0173] As shown in Table 1, the first downsampling layer includes a convolution combination, which includes a convolution layer, layer normalization, and PReLU activation. The input sample feature map dimension [16, 1, 304] undergoes one convolution operation, one layer normalization, and one PReLU activation operation, and the output feature map dimension is [16, 32, 304], which is used as the input of the second downsampling layer.

[0174] The second downsampling layer includes two convolution combinations and a maximum pooling layer in sequence. The convolution kernel size is 31×1 (the step size is 1 and the padding is 15). The dimension of the output signal feature map of the second downsampling layer is [16, 64, 152].

[0175] From the second to the fifth downsampling layers, the input feature map first undergoes two one-dimensional convolution combination operations to extract features, and the convolution kernel size is 31×1 (step size is 1, padding is 15), and then it is input to the maximum pooling layer (pooling window size is 2×2) for downsampling;

[0176] Exemplarily, the data batch size of the input ECG-BCG mapping model is 16, that is, B=16, the sequence length is 304 data points, that is, L=304, the input feature map dimensions of the first to fifth downsampling layers of the encoder module are [16, 1, 304], [16, 32, 304], [16, 64, 152], [16, 128, 76], [16, 256, 38], and the dimension of the output feature map of the fifth layer of the final encoding is [16, 512, 19];

[0177] In [16,1,304], 16 is the batch size, 1 is the number of channels, and 304 is the signal sequence length, which is the number of data points.

[0178] In this step, the first to fifth downsampling layers extract the local features of the signal more accurately, mainly using convolution operations to extract the local features of the ECG and the corresponding BCG.

[0179] The first to fifth downsampling layers extract local features of the signal, mainly through the following aspects:

[0180] ① Convolution kernel size: The convolution kernel size used by the encoder module is 31×1, which means that the convolution operation is only performed within a very small local window of ECG or BCG, which can capture local signal changes and features;

[0181] ② Convolutional layer stacking: The encoder is composed of multiple convolutional layers, each layer further refines the feature extraction based on the previous layer; each convolutional layer focuses on extracting the features of a local area of ​​the input signal;

[0182] ③ Step size and padding: The step size in the convolution operation is 1 and the padding is 15, which means that the convolution kernel only slides one unit on the input signal. At the same time, padding ensures that the convolution operation can cover the boundary area of ​​the input signal, enhancing the ability to extract local features;

[0183] ④ Downsampling: Downsampling through the maximum pooling layer reduces the dimension of the feature map while increasing the number of channels; this operation helps reduce the spatial redundancy of the data while retaining important local features;

[0184] ⑤ Change in feature map dimension: The dimension of the encoder's output feature map gradually decreases, indicating that the model gradually refines from large-scale local features to smaller-scale local features in the process of feature extraction;

[0185] ⑥PReLU activation function: The use of PReLU activation function provides nonlinear transformation for the extraction of local features and enhances the model's ability to express local features;

[0186] The encoder module can effectively extract local features from the cardiac impact signal and the corresponding ECG, providing a basis for subsequent ECG-BCG mapping and abnormal heart beat classification, which is crucial for understanding the mechanical activity of the heart and diagnosing cardiac pathology.

[0187] (3) Construct a decoder module that integrates local features and global features, and stack 6 layers of convolutional neural network layers in sequence.

[0188] The decoder module is an upsampling structure, including six upsampling layers, as follows:

[0189] The first upsampling layer includes two convolutional layers with a stride of 1 and a transposed convolutional layer. Each convolutional layer with a stride of 1 is followed by layer normalization and PReLU activation. The two convolutional operations with a stride of 1 keep the number of channels unchanged. The transposed convolutional layer is used to halve the number of channels and double the sequence length to achieve spatial expansion and upsampling of features.

[0190] The second to fourth upsampling layers include two convolution layers with a step size of 1 and a transposed convolution layer in sequence. Each convolution layer with a step size of 1 is followed by layer normalization and PReLU activation. The first convolution layer with a step size of 1 first halves the number of channels of the feature map input to the current layer, the second convolution layer with a step size of 1 keeps the number of channels unchanged, and then uses a transposed convolution layer to halve the number of channels and double the sequence length; the input of the second upsampling layer and the output of the fourth downsampling layer, the input of the third upsampling layer and the output of the third downsampling layer, and the input of the fourth upsampling layer and the output of the second downsampling layer are sequentially skip-connected to fuse the downsampled local features and the upsampled global features; the second to fourth upsampling layers respectively output the feature maps with changed channel numbers and sequence lengths to the next layer for upsampling;

[0191] The fifth upsampling layer includes two convolutional layers with a stride of 1 and a transposed convolutional layer. Each convolutional layer with a stride of 1 is followed by layer normalization and PReLU activation. The first convolutional layer with a stride of 1 reduces the number of channels by half to refine the feature representation. The second convolutional layer with a stride of 1 keeps the number of channels unchanged to further extract and fuse the downsampled and upsampled features.

[0192] The sixth upsampling layer uses a single convolutional layer to reduce the number of channels from 16 to 1, maps the decoded feature map back to the dimension of the feature map input to the encoder module, and outputs the BCG mapped by the ECG.

[0193] The first upsampling layer is a deconvolution layer, which includes two convolution combinations and a transposed convolution layer in sequence. The output feature map of the fifth encoding layer is used as the input feature map of the first decoding layer. After two one-dimensional convolution combination operations, the convolution kernel size is 31×1 (the step size is 1 and the padding is 15), and then the transposed convolution layer operation is performed to obtain the first upsampling result.

[0194] The local feature map dimension [16,512,19] output by the fifth downsampling layer is input to the first upsampling layer. The first upsampling layer outputs the feature map dimension [16,256,38] of the first upsampling result as the input of the second upsampling layer.

[0195] The second to fourth upsampling layers are feature fusion deconvolution layers;

[0196] The second to fourth upsampling layers include two convolution combinations and one transposed convolution layer respectively; the convolution kernel of the first convolution combination is 31×1, the step size is 1, the padding is 15, and the channel is ÷ 2 (the number of channels is half of the first decoding layer); the convolution layer of the second convolution combination is consistent with the first convolution combination; the number of channels of the transposed convolution layer is half of the number of channels of the convolution combination, and the dimension is 2 times.

[0197] The fifth upsampling layer is composed of two convolution combinations. The output feature map of the fourth upsampling layer is used as the input of the fifth upsampling layer. The convolution kernel of the first convolution combination is 31×1, the step size is 1, the padding is 15, and the number of channels is half of the number of channels of the fourth upsampling layer. The convolution parameters of the second convolution combination are exactly the same as those of the first convolution combination.

[0198] The sixth upsampling layer is a single convolutional layer with a convolution kernel size of 31×1 (step size of 1, padding of 15), and the number of channels is changed from 16 to 1. The multi-dimensional features are restored to a feature map sequence output with the same length as the encoder module input. The output feature map sequence is the preprocessed BCG corresponding to the ECG mapping;

[0199] The dimensions of the input feature maps of each of the six upsampling layers of the decoder module are [16,512,19], [16,256,38], [16,128,76], [16,64,152], [16,32,304], [16,16,304], respectively. After a single convolution in the last upsampling layer, the dimensions of the feature maps of the final output ECG are [16,1,304].

[0200] Through the layer-by-layer upsampling and transposed convolution operations of the decoder module, the local features extracted in the encoder are directly fused with the global features in the decoder using skip connections. Finally, the decoder maps the local features of the encoder back to the original signal space dimensions and outputs the preprocessed BCG corresponding to the ECG.

[0201] Step S22: Use the first training data set to train the ECG-BCG mapping model until the loss function converges to obtain a trained ECG-BCG mapping model.

[0202] Loading the first training data set into the ECG-BCG mapping model for training;

[0203] A fixed learning rate is adopted, an MSE mean square error loss function is used for forward propagation, and an Adam optimizer is used for back propagation, and the ECG-BCG mapping model parameters are continuously adjusted to minimize the loss function until the loss function converges to obtain a trained ECG-BCG mapping model.

[0204] (1) Construct the loss function, determine the optimizer and hyperparameters, input the training set and validation set, and train the ECG-BCG model parameters;

[0205] (2) Use the MSE mean square error loss function for forward propagation, as shown in formula (3)

[0206]

[0207] N is the total number of points contained in each heart beat signal sequence after non-overlapping segmentation, that is, the length of the signal sequence, which is 304 in this embodiment. i is the amplitude-normalized cardiac impulse signal value, It is the heart attack signal value obtained after ECG-BCG mapping.

[0208] (3) The Adam optimizer is used for back propagation, and the initial learning rate is set to 1e -4 , that is, 0.0001, a fixed learning rate is used, the batch size is set to 16, and the weight decay is set to 1e -5 , that is, 0.00001, and the preset maximum training round is 150;

[0209] Exemplarily, the software framework used in the present invention to train the ECG-BCG mapping model is PyTorch 1.7.1 based on Python 3.8 language, the operating system is Ubuntu 20.0.4, the CUDA version is 11.3, and the hardware computing platform is a server equipped with an Nvidia RTXA40 graphics card;

[0210] (4) Train the network model and optimize the hyperparameters using the back propagation algorithm on the training set and validation set until the loss function converges and the training is completed;

[0211] First, use the training set to train for 10 rounds, and then use the validation set to verify for 1 round; then use the training set to train for 10 rounds, and then use the validation set to verify for 1 round;

[0212] Until the loss function converges, the validation set is used for validation to obtain the trained ECG-BCG mapping model, and the model weight parameters are saved. The weight parameters of the trained mapping model are loaded into the constructed ECG-BCG mapping model.

[0213] Step S3, specifically.

[0214] Acquire ECG data from a second public data set and perform preprocessing, input the trained ECG-BCG mapping model, obtain corresponding BCG data, and use the corresponding ECG heartbeat type in the second public data set as a label to form the second training data set;

[0215] ECG signals and corresponding heart beat types are obtained from a second public dataset.

[0216] The second public data set is an electrocardiogram data set published by MIT-BIH, including ECG signals and corresponding heart beat types.

[0217] (1) Obtain ECG in raw format and corresponding labels (i.e., heartbeat type) and perform data preprocessing;

[0218] Exemplarily, an ECG in .dat format and its corresponding heartbeat type are obtained, where the heartbeat type is the type of abnormal heart rate disease.

[0219] In this embodiment, the second public data set comes from the ECG signal data set published by MIT-BIH, and the length of the initial signal sequence is 650,000;

[0220] Each ECG sequence data in the public dataset corresponds to the type of abnormal heart rate disease.

[0221] The heartbeat types corresponding to the ECG data in the public dataset are annotated by doctors.

[0222] Using a loop function, the ECG is segmented into a sequence set of 304 data points in length without overlap based on the position of the first R peak of the ECG.

[0223] Exemplarily, the ECG segments after non-overlapping segmentation are saved in the numpy two-dimensional tensor format based on Python 3.8, and the feature map size is [2138, 304].

[0224] The ECG data after non-overlapping segmentation are normalized.

[0225] (2) After normalizing the ECGs after non-overlapping segmentation, the ECGs are input into the trained ECG-BCG mapping model to obtain BCGs of the same scale, and the heartbeat types of the mapped BCGs and corresponding ECGs are used as samples of the second training data set to form the second training data set; the second training data set is divided into a training set, a validation set, and a test set according to a preset ratio.

[0226] This step effectively expanded the number of BCG samples.

[0227] Step S4 includes steps S41-S42.

[0228] Step S41, constructing a brain-like classification model based on a spiking neural network.

[0229] The brain-like classification model is built based on a spiking neural network, which includes a static convolution layer, a channel attention layer, and a fully connected classification module in sequence;

[0230] The static convolution layer includes a one-dimensional convolution layer Conv1d, a LIFNode brain-like activation layer and a pooling layer; the one-dimensional convolution layer Conv1d is used for channel expansion and feature extraction. After the input feature map is convolved by Conv1d and activated by LIFNode brain-like, the number of channels is expanded from 1 to 4, and the sequence length is reduced from 304 to 284; then the pooling layer downsamples the feature map with expanded channels and reduced sequence length and outputs it, which is set to X;

[0231] The channel attention layer includes a channel weight branch and a transfer input branch;

[0232] The channel weight branch is combined with the AdaptiveMaxPool1d function and the custom convolution to output the attention values ​​of different channels, which are set to A;

[0233] The transfer input branch first performs a multiplication operation X×A, then passes through a convolution layer and a pooling layer for downsampling, and then outputs a feature map of a three-dimensional tensor to the fully connected classification module for classification;

[0234] The fully connected classification module includes a Flatten layer and a linear layer. The feature map of the input three-dimensional tensor is expanded into a two-dimensional tensor through the Flatten function, and then passes through the linear layer to obtain the classification prediction probability of the heartbeat type; the heartbeat classification result is obtained based on the classification prediction probability.

[0235] After the linear layer, the output result is the classification prediction probability result at a certain moment, and the entire brain-like classification model network runs the brain-like classification model training process from 0 to T at the preset brain-like time step T (T is an integer);

[0236] From 0 to T-1 times; each linear layer outputs a classification prediction probability result;

[0237] Then, the average of the classification prediction probabilities of T brain-like time steps is taken, and this average is used as the classification prediction probability of the heartbeat type.

[0238] Table 2: Structural parameters of brain-like classification model

[0239]

[0240]

[0241] like Figure 4 As shown:

[0242] (1) The first static convolutional layer is a one-dimensional convolutional layer Conv1d. The input data is the output feature map [16, 1, 304] of the sixth upsampling layer. The input data is channel-expanded after convolution. The convolution kernel size is 21 × 1, the step size is 1, and the padding is 10. It is expanded from 1 to 4, and the sequence length dimension is reduced from 304 to 284. The output feature map dimension is [16, 4, 284].

[0243] After passing through the LIFNode brain-like activation function layer, it is downsampled through a one-dimensional pooling layer with a pooling window size of 2×1 and a sequence length dimension divided by 2; the final output feature map dimension of the static convolution layer is [16, 4, 142].

[0244] For example, assuming that the data batch size of the input model is 16, that is, B=16, and the sequence length is 300, that is, L=300, the input feature map dimensions of each static convolution layer are [16, 1, 304], [2, 4, 284], and the final output feature map dimensions after the pooling layer are [16, 4, 142];

[0245] The LIFNode brain-like activation layer, also known as the brain-like activation module, has a calculation mechanism as shown in formula (4):

[0246]

[0247] Where T is the preset brain-like time step, V[T] and V[T-1] are the brain-like neuron membrane potentials at brain-like time steps T and T-1, respectively, Y[T] is the feature map output by Conv1d convolution, τ m is the preset membrane time constant, V reset is the reset potential;

[0248] If V[T] reaches the preset discharge threshold V threshold , the membrane potential is reset to zero, and V[T] is input into the substitute function of the step function for back propagation; the substitute function is shown in formula (5):

[0249]

[0250] Otherwise, if V[T] does not reach the preset discharge threshold V threshold , the membrane potential of brain-like neurons remains V[T].

[0252] When T = 0, brain-like neurons do not discharge but only charge;

[0253] When T>0, brain-like neurons both discharge and charge.

[0254] Exemplarily, the membrane time constant τ m The preset value is 2, which resets the potential V reset The preset value is 0, the discharge threshold V threshold The default is 1.0.

[0255] For the membrane potential V[T], the actual discharge process can be expressed as a discrete step function, as shown in formula (6):

[0256] H(V(T)-V threshold )Formula (6)

[0257] Among them, H is the Heavidide step function. The step function is not differentiable. In order to calculate the back-propagation gradient, an alternative function σ(V[T]) is introduced;

[0258] The arctan function in the substitution function σ(V[T]) provides a smooth approximation when V[T] is close to the preset discharge threshold V threshold , the output of the substitution function is close to 1 or 0, and the substitution function is differentiable near the preset discharge threshold.

[0259] During the calculation of the LIFNode brain-like activation layer, the dimension of the input feature map remains unchanged.

[0260] LIFNode is the size of the brain-like activation layer output.

[0261] LIFNode is a computational model that simulates the firing and resting mechanisms of biological neurons. It reflects the working mechanism of real neurons to a certain extent and has brain-like characteristics.

[0262] The LIFNode activation function module is used to increase the model's sensitivity to the temporal dynamics of ECG signals and improve the model's ability to recognize cardiac activity patterns. The design of the LIFNode brain-like activation layer can avoid the neuron saturation problem that may occur in traditional activation functions (such as Sigmoid or Tanh), thereby maintaining the activity of the network during training. Using the inverse tangent function as a substitute for the step function provides a derivable path for backpropagation, allowing the network to be trained using optimization algorithms such as gradient descent.

[0263] (2) The channel attention layer contains two branches: the channel weight branch and the transfer input branch.

[0264] (2.1) The first branch is the channel weight branch. The input data is the output of the static convolution layer. It is first combined with the AdaptiveMaxPool1d function and the convolution to obtain a feature map with a dimension of [16, 4, 142], which is set to A.

[0265] Among them, the convolution combination is a custom convolution combination structure, which includes convolution (channel number 4→1) + ReLU activation function + convolution (channel number 1→4) + Sigmoid activation, a total of four layers. The custom convolution combination does not change the number of channels, and the final number is still [16,4,142].

[0266] The custom convolution combination can be seen as an implementation of an attention mechanism. Through this structure, the network can learn the importance or weight of different channels, thereby focusing on features that are more important to the current task;

[0267] Convolution (channel number 4 → 1): compress the 4-channel information of each position into 1 channel, which can be regarded as a selection process, and the network autonomously learns which channels are important;

[0268] Use formula (2) to calculate the sequence length dimension

[0269] ReLU activation function: introduces nonlinearity, enabling the model to learn and simulate more complex feature transformations;

[0270] Convolution (channel number 1→4): The compressed information is expanded back to 4 channels, but the weight of each channel has been adjusted at this time;

[0271] Sigmoid activation: ensures that the output is between 0 and 1, which can be regarded as a normalization of the channel weight;

[0272] The custom convolution combination does not change the data dimension. The number of output channels is the same as the number of input channels, which maintains the channel number dimension of the original data and facilitates fusion with the original data or the output of other branches.

[0273] The final output feature map dimension of the channel weight branch is [16, 4, 142].

[0274] (2.2) The second branch is the input transfer branch, which includes weight multiplication, convolution layer and pooling layer in sequence.

[0275] The original input and the extracted weights are multiplied by X×A;

[0276] The result of the operation is then passed through a convolution layer with a convolution kernel size of 21×1 (step size of 1, padding of 10) and a pooling layer for downsampling (pooling window size of 2×1), and the output is [16, 8, 61], which is input to the fully connected classification module for classification;

[0277] The output feature map dimension of the channel weight branch is [16, 4, 142], which is passed as input to the input branch.

[0278] The dimension of the output feature map of the first layer of the input branch remains unchanged, which is still [16, 4, 142];

[0279] In the second layer Conv1d, the number of channels is multiplied by 2, the sequence length dimension is reduced to 122, and the output feature map dimension is [16, 8, 122];

[0280] In the third pooling layer, the number of channels remains unchanged, the sequence length dimension is halved, and the output feature map dimension is [16, 8, 61].

[0281] (3) The fully connected classification module includes a Flatten layer function and a linear layer. The input [16, 8, 61] is first flattened into one dimension [16, 488] by the Flatten function, and then enters the linear layer to obtain [16, 5] to obtain the heartbeat classification probability. The heartbeat classification result is obtained based on the heartbeat classification probability.

[0282] Step S42: training a brain-like classification model using the second training data set.

[0283] The second training data set is loaded into the brain-like classification model for training until a maximum number of iterations is reached.

[0284] Construct loss function, determine optimizer and hyperparameters, input training set and validation set, and train network model parameters;

[0285] Use the MSE mean square error loss function for forward propagation:

[0286] The Adam optimizer is used for back propagation, and the initial learning rate is set to 1e -4 , i.e. 0.0001, a fixed learning rate is used, the batch size is set to 16, the time step of the spiking neural network is 7, the time constant is 2, the pulse voltage threshold is 1, the reset potential after discharge is 0, and the total maximum training iteration round is set to 150;

[0287] The training is performed until the maximum iteration round to obtain a trained brain-like classification model, and the parameters of the brain-like classification model when the classification category accuracy in the verification set is the highest are saved as the parameters of the trained brain-like classification model.

[0288] Exemplarily, the software framework used for the experimental training network of the present invention is PyTorch1.7.1 based on Python3.6 language, the operating system is Ubuntu 20.0.4, the CUDA version is 11.3, and the hardware computing platform is a server equipped with an NvidiaRTXA40 graphics card;

[0289] The constructed brain-like classification model is loaded with the trained weight parameters, and the pre-processed BCG signal to be tested is input to obtain 5 types of predicted heart rate diseases.

[0290] The heartbeat type is the type of abnormal heart rate disease, which has 5 categories and is encoded in one-hot format (0-00001, 1-00010, 2-00100, 3-01000, 4-10000), as follows:

[0291] 0-Normal;

[0292] 1-S disease (atrial premature beats, abnormal atrial premature beats, junctional premature beats, supraventricular premature beats);

[0293] 2-V disease (ventricular premature beats, ventricular escape beats);

[0294] Class 3-F disease (ventricular fusion beat);

[0295] 4-Q disease (paced beats, paced fusion beats, unclassified beats).

[0296] In summary, the method for constructing a BCG-oriented brain-like classification model according to an embodiment of the present invention has the following beneficial effects:

[0297] 1. Through the ECG-BCG mapping model, the number of BCG samples is effectively expanded, the problem of insufficient number of BCG data set samples is solved, and the utilization rate of BCG samples is improved;

[0298] 2. The ECG-BCG mapping model is established using the encoding-decoding structure of the U-shaped convolutional network, which improves the model's ability to extract local and global features of ECG and BCG signals and enhances the richness of feature expression;

[0299] 3. The brain-like classification model built based on the spiking neural network improves the accuracy of heartbeat classification through the LIFNode brain-like activation module and channel attention mechanism;

[0300] 4. By integrating NIH's BED-BASED BALLISTOCARDIOGRAPHY DATASET and MIT-BIH's ECG dataset, a comprehensive and accurately labeled training dataset was constructed, providing high-quality data support for brain-like classification model training and achieving effective integration of public datasets;

[0301] 5. Compared with the existing abnormal heartbeat detection methods, the present invention makes better use of the mechanical information contained in BCG and can more effectively detect the mechanical movement of the heart. The heart-brain classification model has broad application prospects in clinical diagnosis, long-term monitoring and personalized treatment.

[0302] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A method for constructing a brain-like classification model for BCG. It is characterized in that The steps include: Constructing a first training data set including preprocessed ECG and corresponding BCG; Using the first training data set to train the ECG-BCG mapping model until the loss function converges to obtain a trained ECG-BCG mapping model; Based on the trained ECG-BCG mapping model, construct a second training data set for the brain-like classification model; wherein the second training data set includes the heartbeat types of BCG and corresponding ECG; The brain-like classification model is trained using the second training data set, and a trained brain-like classification model is obtained after reaching a maximum number of iteration rounds.

2. The method according to claim 1, It is characterized in that An ECG-BCG mapping model is constructed based on the encoding-decoding structure of a U-shaped convolutional network, including an encoder module and a decoder module; The encoder module is used to downsample the received pre-processed ECG to extract local features and output a feature map matrix representing the local features; The decoder module restores the spatial dimension through the transposed convolution layer, and fuses the local features extracted by the encoder module with the global features sampled by the decoder module through skip connections, restores them to the original dimensional space, and outputs the BCG corresponding to the preprocessed ECG; Among them, the feature map matrix is ​​represented as a three-dimensional tensor, and the three dimensions are batch size, number of channels, and sequence length.

3. The method according to claim 2, It is characterized in that The encoder module is a downsampling structure, including five downsampling layers, where: The first downsampling layer includes a convolutional layer with a stride of 1, layer normalization, and PReLU activation. The convolutional layer increases the number of channels of the input feature map from 1 to 32 and outputs it to the second downsampling layer. The second to fifth downsampling layers include two convolutional layers with a stride of 1 and a maximum pooling layer. Each convolutional layer is followed by layer normalization and PReLU activation. The first convolutional layer doubles the number of channels of the feature map input to the current layer. The second convolutional layer keeps the number of channels unchanged and halves the sequence length dimension of the feature map input to the current layer through the maximum pooling layer, thus outputting the feature map with the changed number of channels and sequence length dimensions. Among them, layer normalization is used to accelerate convergence, and PReLU activation introduces nonlinearity to enhance the sensitivity of the encoder module to subtle changes in local features.

4. The method according to claim 3, It is characterized in that The decoder module is an upsampling structure, including six upsampling layers, as follows: The first upsampling layer includes two convolutional layers with a stride of 1 and a transposed convolutional layer. Each convolutional layer with a stride of 1 is followed by layer normalization and PReLU activation. The two convolutional operations with a stride of 1 keep the number of channels unchanged. The transposed convolutional layer is used to halve the number of channels and double the sequence length to achieve spatial expansion and upsampling of features. The second to fourth upsampling layers include two convolution layers with a stride of 1 and a transposed convolution layer in sequence. Each convolution layer with a stride of 1 is followed by layer normalization and PReLU activation. The first convolution layer with a stride of 1 first halves the number of channels of the feature map of the current layer input, the second convolution layer with a stride of 1 keeps the number of channels unchanged, and then uses a transposed convolution layer to halve the number of channels and double the sequence length; the input of the second upsampling layer and the output of the fourth downsampling layer, the input of the third upsampling layer and the output of the third downsampling layer, and the input of the fourth upsampling layer and the output of the second downsampling layer are sequentially skip-connected to fuse the downsampled local features and the upsampled global features; The second to fourth upsampling layers output the feature maps with changed channel numbers and sequence lengths to the next layer for upsampling; The fifth upsampling layer includes two convolutional layers with a stride of 1 and a transposed convolutional layer. Each convolutional layer with a stride of 1 is followed by layer normalization and PReLU activation. The first convolutional layer with a stride of 1 reduces the number of channels by half to refine the feature representation. The second convolutional layer with a stride of 1 keeps the number of channels unchanged to further extract and fuse the downsampled and upsampled features. The sixth upsampling layer uses a single convolutional layer to reduce the number of channels from 16 to 1, maps the decoded feature map back to the dimension of the feature map input to the encoder module, and outputs the BCG mapped by the ECG.

5. The method according to claim 1, It is characterized in that The steps of obtaining the original signal sequences of ECG and corresponding BCG data from the first public data set and preprocessing them to obtain the first training data set include: Taking the first R peak of the original signal sequence of the ECG as the starting point, and the J peak corresponding to the timestamp of the first R peak in the original signal sequence of the BCG as the starting point, non-overlapping segmentation is performed with preset sequence lengths respectively; The data points before the first R peak in ECG and the first J peak corresponding to BCG, as well as the data points that are less than the preset sequence length after segmentation, are discarded; Normalize the amplitudes of the segmented ECG and BCG; The normalized ECG and the corresponding BCG constitute each sample in the first training data set.

6. The method according to claim 5, It is characterized in that Loading the first training data set into the ECG-BCG mapping model for training; A fixed learning rate is adopted, an MSE mean square error loss function is used for forward propagation, and an Adam optimizer is used for back propagation, and the ECG-BCG mapping model parameters are continuously adjusted to minimize the loss function until the loss function converges to obtain a trained ECG-BCG mapping model.

7. The method according to claim 1, It is characterized in that The brain-like classification model is built based on a spiking neural network, which includes a static convolution layer, a channel attention layer, and a fully connected classification module in sequence; The static convolution layer includes a one-dimensional convolution layer Conv1d, a LIFNode brain-like activation layer and a pooling layer; the one-dimensional convolution layer Conv1d is used for channel expansion and feature extraction. After the input feature map is convolved by Conv1d and activated by LIFNode brain-like, the number of channels is expanded from 1 to 4, and the sequence length is reduced from 304 to 284; then the pooling layer downsamples the feature map with expanded channels and reduced sequence length and outputs it, which is set to X; The channel attention layer includes a channel weight branch and a transfer input branch; The channel weight branch is combined with the AdaptiveMaxPool1d function and the custom convolution to output the attention values ​​of different channels, which are set to A; The transfer input branch first performs a multiplication operation of X and A, then passes through a convolution layer and a pooling layer for downsampling, and then outputs a feature map of a three-dimensional tensor to the fully connected classification module for classification; The fully connected classification module includes a Flatten layer and a linear layer. The feature map of the input three-dimensional tensor is expanded into a two-dimensional tensor through the Flatten function, and then passes through the linear layer to obtain the classification prediction probability of the heartbeat type; the heartbeat classification result is obtained based on the classification prediction probability.

8. The method according to claim 7, It is characterized in that Acquire ECG data from a second public data set and perform preprocessing, input the trained ECG-BCG mapping model, obtain corresponding BCG data, and use the corresponding ECG heartbeat type in the second public data set as a label to form the second training data set; The second training data set is loaded into the brain-like classification model for training until a maximum number of iterations is reached.

9. The method according to claim 7, It is characterized in that The calculation mechanism of the LIFNode brain-like activation layer is: Where T is the preset brain-like time step, V[T] and V[T-1] are the brain-like neuron membrane potentials at brain-like time steps T and T-1, respectively, Y[T] is the feature map output by Conv1d convolution, τ m is the preset membrane time constant, V reset is the reset potential; If V[T] reaches the preset discharge threshold V threshold , the membrane potential is reset to zero, and V[T] is input into the substitute function of the step function for back propagation; the substitute function is as follows: Otherwise, if V[T] does not reach the preset discharge threshold V threshold , the membrane potential of brain-like neurons remains V[T].

10. The method according to claim 5 or 8, It is characterized in that The first public data set is the BED-BASED BALLISTOCARDIOGRAPHY DATASET published by NIH; wherein ECG and BCG correspond one to one based on timestamps; The second public data set is an electrocardiogram data set published by MIT-BIH, including ECG signals and corresponding heart beat types.

Citation Information

Patent Citations

  • LSTM-based automatic multi-classification identification method for ballistocardiogram signals

    CN110427924A

  • Intelligent electrocardiosignal generation method based on multi-scale feature fusion of ballistocardiogram signals

    CN115935295A

  • Improved attention mechanism and CV model combined segmentation method and system

    CN117422880A

  • Method of preparing training data for use in training a health event identification machine-learning model

    GB202105697D0

  • Methods and systems for cross-domain few-shot classification

    US20220300823A1