Electrocardiogram data identification method, device, equipment and medium
By building a lightweight ECG recognition neural network and quantitatively deploying it on wearable devices, the problems of large calculations and large parameters in the prior art are solved, and efficient and real-time ECG detection on low-power devices are achieved.
Patent Information
- Application Number
- CN202510800298.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-09-02
AI Technical Summary
The existing deep learning-based electrocardiogram detection method has complex neural network structure, large calculation amount and parameters, making it difficult to deploy on small wearable devices to achieve long-term real-time electrocardiogram detection.
Build a lightweight electrocardiogram recognition neural network, including adaptive pooling layer, convolutional layer and fully connected layer, and quantitatively deploy it on wearable devices to reduce storage and computing resource consumption through quantization and improve inference speed.
It realizes efficient identification of ECG signals on low-power wearable devices, reduces power consumption, improves recognition accuracy, and is suitable for long-term real-time detection.
Smart Images

Figure CN120579006A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning technology, and in particular to an electrocardiogram data recognition method, device, equipment and medium. Background Art
[0002] Electrocardiograms (ECGs) are essential tools for diagnosing various heart diseases. Traditional diagnostic methods rely on manual analysis of ECG signals and clinical experience to diagnose conditions. However, when faced with large and complex ECG data sets, manual diagnosis is often subject to subjective factors, leading to misdiagnosis. Furthermore, manual diagnosis lacks real-time performance, delaying the best opportunity for treatment. Intelligent ECG recognition not only reduces the workload of medical personnel but also effectively improves the accuracy and efficiency of diagnosis. Therefore, automatic ECG signal recognition has important application implications.
[0003] Currently, there are two approaches for automatic ECG signal recognition. One is the traditional method, which primarily relies on the inherent characteristics of ECG signals (such as band characteristics). This method is relatively complex and requires professional knowledge and experience. The other is a deep learning-based approach that can achieve end-to-end detection. However, most deep learning-based ECG signal detection methods have complex neural network structures, large computational complexity, and large number of parameters, making them difficult to deploy on small wearable devices to achieve long-term real-time ECG signal detection.
[0004] It can be seen that how to reduce the computational complexity and parameters of the neural network to reduce power consumption and reduce the demand for hardware resources, and realize the deployment and application of the ECG signal intelligent detection network on low-power hardware is a problem that technical personnel in this field need to solve. Summary of the Invention
[0005] The purpose of the embodiments of the present invention is to provide an electrocardiogram (ECG) data recognition method, apparatus, device, and medium that can reduce the computational complexity and parameter requirements of a neural network to reduce power consumption and hardware resource requirements while maintaining high recognition accuracy, thereby enabling the deployment and application of an intelligent ECG signal detection network on low-power wearable hardware. The specific solution is as follows:
[0006] In a first aspect, the present invention provides an electrocardiogram data recognition method, comprising:
[0007] Collecting electrocardiogram signal data, and determining target electrocardiogram data based on the electrocardiogram signal data;
[0008] The target ECG data is recognized using a quantized ECG recognition neural network deployed on a wearable device to determine whether the target ECG data is normal based on the corresponding recognition results. The ECG recognition neural network includes an adaptive pooling layer, three convolutional layers, and two fully connected layers.
[0009] Optionally, collecting electrocardiogram signal data and determining target electrocardiogram data based on the electrocardiogram signal data includes:
[0010] Collecting ECG signal data based on a preset sampling frequency through a target sensor, eliminating noise interference from the ECG signal data using bandpass filtering and adaptive baseline correction, and obtaining eliminated data;
[0011] The time domain features and frequency domain features of the eliminated data are extracted by wavelet transform;
[0012] The ResNet-18 neural network is used to classify heart beat types based on time domain features and frequency domain features, and the target electrocardiogram data is determined based on the corresponding classification results.
[0013] Optionally, before using the quantized electrocardiogram recognition neural network deployed on the wearable device to recognize the target electrocardiogram data, the following steps may be further included:
[0014] The initial ECG recognition neural network is constructed based on an adaptive pooling layer, three convolutional layers, and two fully connected layers. Each convolutional layer is followed by a linear rectification function.
[0015] Acquire several sets of electrocardiogram data, perform data enhancement on each set of electrocardiogram data using a target method, and obtain enhanced data so as to train an initial electrocardiogram recognition neural network using the enhanced data; the target method includes any one or a combination of horizontal flipping, vertical flipping, adding noise, cropping, and scaling.
[0016] Optionally, before using the quantized electrocardiogram recognition neural network deployed on the wearable device to recognize the target electrocardiogram data, the following steps may be further included:
[0017] The initial electrocardiogram recognition neural network is trained based on the enhanced data on a deep learning server using a back propagation algorithm to obtain an electrocardiogram recognition neural network.
[0018] Optionally, after the initial electrocardiogram recognition neural network is trained on the deep learning server based on the enhanced data using a back propagation algorithm to obtain the electrocardiogram recognition neural network, the method further includes:
[0019] quantizing the electrocardiogram recognition neural network to obtain a quantized neural network;
[0020] The corresponding quantized neural network is deployed on wearable devices.
[0021] Optionally, the target electrocardiogram data is recognized using a quantized electrocardiogram recognition neural network deployed on the wearable device to determine whether the target electrocardiogram data is normal based on the corresponding recognition result, including:
[0022] The adaptive pooling layer in the electrocardiogram recognition neural network is used to obtain a feature map of the target size based on the target electrocardiogram data;
[0023] Sending the feature map of the target size to a first convolutional layer of the electrocardiogram recognition neural network, so that the first convolutional layer reorders the feature map of the target size, quantizing the corresponding first reordered feature map into a first quantized feature map in a 16-bit integer format, converting a first weight of the electrocardiogram recognition neural network into a 16-bit integer format, performing matrix multiplication on the first converted weight and the first quantized feature map to obtain a first feature map in a 32-bit floating point format, and sending the first feature map to a second convolutional layer of the electrocardiogram recognition neural network;
[0024] Rearranging the first feature map using the second convolutional layer, quantizing the corresponding second rearranged feature map into a second quantized feature map in a 16-bit integer format, converting the second weight of the electrocardiogram recognition neural network into a 16-bit integer format, performing matrix multiplication on the second converted weight and the second quantized feature map to obtain a second feature map in a 32-bit floating point format, and sending the second feature map to the third convolutional layer of the electrocardiogram recognition neural network;
[0025] Rearranging the second feature map using a third convolutional layer, quantizing the corresponding third rearranged feature map into a third quantized feature map in a 16-bit integer format, converting a third weight of the electrocardiogram recognition neural network into a 16-bit integer format, performing matrix multiplication on the third converted weight and the third quantized feature map to obtain a third feature map in a 32-bit floating point format, flattening the third feature map into a one-dimensional vector, and sending the one-dimensional vector to a fully connected layer of the electrocardiogram recognition neural network;
[0026] The target ECG data is identified based on the one-dimensional vector using a fully connected layer to determine whether the target ECG data is normal according to the corresponding recognition results.
[0027] Optionally, the target electrocardiogram data is identified based on the one-dimensional vector using a fully connected layer to determine whether the target electrocardiogram data is normal according to the corresponding identification result, including:
[0028] Inputting the one-dimensional vector into the first fully connected layer of the electrocardiogram recognition neural network so that the first fully connected layer performs dimensionality reduction processing on the one-dimensional vector and sends the corresponding dimensionality-reduced vector to the second fully connected layer;
[0029] The second fully connected layer is used to classify the reduced dimension vector, and whether the target ECG data is normal is determined based on the corresponding target component results.
[0030] In a second aspect, the present invention provides an electrocardiogram data recognition device, comprising:
[0031] an electrocardiogram data determination module, configured to collect electrocardiogram signal data and determine target electrocardiogram data based on the electrocardiogram signal data;
[0032] The ECG data recognition module is used to identify the target ECG data using a quantized ECG recognition neural network deployed on the wearable device to determine whether the target ECG data is normal based on the corresponding recognition results; the ECG recognition neural network includes an adaptive pooling layer, three convolutional layers, and two fully connected layers.
[0033] In a third aspect, the present invention provides an electronic device, comprising:
[0034] memory for storing computer programs;
[0035] A processor is used to execute a computer program to implement the aforementioned electrocardiogram data recognition method.
[0036] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the aforementioned electrocardiogram data recognition method when executed by a processor.
[0037] In the present invention, electrocardiogram signal data is first collected, and target electrocardiogram data is determined based on the electrocardiogram signal data; the target electrocardiogram data is identified using a quantized electrocardiogram recognition neural network deployed on a wearable device to determine whether the target electrocardiogram data is normal based on the corresponding recognition results; the electrocardiogram recognition neural network includes an adaptive pooling layer, three convolutional layers, and two fully connected layers.
[0038] Beneficial Effects: The present invention first collects ECG signal data and constructs a lightweight neural network consisting of an adaptive pooling layer, a convolutional layer, and a fully connected layer. The trained neural network is then quantized and deployed to a wearable device to perform heart rate data recognition. Quantization further reduces storage and computing resource consumption, improves inference speed, reduces power consumption, and enables real-time heart rate detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0040] Figure 1 A flow chart of an electrocardiogram data recognition method provided by an embodiment of the present invention;
[0041] Figure 2A schematic diagram of an electrocardiogram image provided by an embodiment of the present invention;
[0042] Figure 3 A schematic diagram of a neural network structure provided by an embodiment of the present invention;
[0043] Figure 4 A schematic diagram of a specific electrocardiogram data recognition method provided by an embodiment of the present invention;
[0044] Figure 5 A schematic diagram of a convolution calculation process after quantization deployment of a neural network provided by an embodiment of the present invention;
[0045] Figure 6 A schematic structural diagram of an electrocardiogram data recognition device provided by an embodiment of the present invention;
[0046] Figure 7 A structural diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0048] The terms "including" and "having," as used in the present description and accompanying drawings, and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements and may include steps or elements that are not listed.
[0049] In order to enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0050] There are two methods for automatic ECG signal recognition. One is the traditional method, which mainly makes judgments based on the inherent characteristics of ECG signals (such as band characteristics, etc.). This method is relatively complex and requires professional knowledge and experience. The other is a method based on deep learning, which can achieve end-to-end detection. However, most ECG signal detection methods based on deep learning have complex neural network structures, large computational complexity and parameter requirements, and are difficult to deploy on small wearable devices to achieve long-term real-time ECG signal detection. In order to solve the above technical problems, the present invention discloses an ECG data recognition method, device, equipment and medium, which can reduce the computational complexity and parameter requirements of the neural network to reduce power consumption and reduce the demand for hardware resources, while maintaining a high recognition accuracy, and realize the deployment and application of ECG signal intelligent detection networks on low-power wearable hardware.
[0051] See also Figure 1 As shown, an embodiment of the present invention provides an electrocardiogram data recognition method, comprising:
[0052] Step S11: Collect ECG signal data, and determine target ECG data based on the ECG signal data.
[0053] The present invention first collects ECG data and then determines ECG data based on the ECG data. In this process, ECG data can be collected by a target sensor based on a preset sampling frequency, and noise interference in the ECG signal data can be eliminated by bandpass filtering and adaptive baseline correction to obtain the eliminated data; the time domain features and frequency domain features of the eliminated data are extracted by wavelet transform; the ResNet-18 (Residual Network) neural network is used to classify heartbeat types based on the time domain features and frequency domain features, and the target ECG data is determined based on the corresponding classification results.
[0054] Step S12: using the quantized ECG recognition neural network deployed on the wearable device to identify the target ECG data, so as to determine whether the target ECG data is normal according to the corresponding recognition result; the ECG recognition neural network includes an adaptive pooling layer, three convolutional layers, and two fully connected layers.
[0055] In an embodiment of the present invention, before using the quantized ECG recognition neural network deployed on the wearable device to recognize the target ECG data, an initial ECG recognition neural network is first constructed based on an adaptive pooling layer, three convolutional layers, and two fully connected layers; wherein, each convolutional layer is followed by a linear rectification function; a number of ECG data are obtained, and each ECG data is enhanced by a target method to obtain enhanced data so as to train the initial ECG recognition neural network using the enhanced data; the target method includes any one or a combination of horizontal flipping, vertical flipping, adding noise, cropping, and scaling. Specifically, a typical ECG image such as Figure 2 As shown in Figure 1, in order to improve data diversity and the robustness of training neural networks, data enhancement is first performed on the data. The data enhancement methods used include horizontal flipping, vertical flipping, adding noise, cropping, scaling, etc. The lightweight and high-quality electrocardiogram recognition neural network structure constructed by the present invention is shown in Figure 1. Figure 3 As shown, the network as a whole includes an adaptive pooling part, a convolutional feature extraction part, and a fully connected classification part. Since different sampling frequencies will result in different amounts of ECG data in the same period of time, such as the data points collected at a sampling frequency of 256Hz are twice that of 128Hz, in order to enable the neural network to process ECG signals of various sampling frequencies and reduce the amount of computation of the network, the neural network of the present invention first designs an adaptive pooling layer, which converts ECG data of various sizes into 625 sampling points through adaptive pooling, which is convenient for subsequent convolution and fully connected operations. Since 1D convolution is used, Figure 3 In the example, the data size after adaptive pooling is expressed as 1×625, where 1 represents 1 channel and 625 represents 625 data points per channel. This means that the length of raw ECG data varies due to differences in sampling rate and recording duration (e.g., a 10-second recording may contain 1000-5000 points), while neural networks (especially fully connected layers) require fixed-size inputs. Therefore, the present invention automatically adjusts the pooling window size to force the output to the target size (here, 625 points) regardless of the input length. The final output of the adaptive pooling layer is a fixed-size feature map of 1×625. It should be noted that adaptive pooling automatically calculates the pooling window size (kernel_size) and stride to meet the target size: the window size is approximately equal to the input size divided by the target size. Pooling modes include adaptive average pooling (which takes the average value within the window and is suitable for smoothing features (such as ECG signals)) and adaptive max pooling (which takes the maximum value within the window and is suitable for preserving salient features (such as image edges)).
[0056] In one aspect, the lightweight, high-quality ECG recognition neural network of the present invention employs three convolutional layers for feature extraction, each followed by a Reinforced Luminance (ReLU) activation function. The convolution kernel size of the first convolutional layer is (1, 2, 10), where 1 represents the number of input channels (1), 2 represents the number of output channels (2), and 10 represents the convolution kernel size (10), with a stride of 6. After the first convolution layer, the ECG data size becomes 2×10³. The convolution kernel size of the second convolutional layer is (2, 4, 9), where 2 represents the number of input channels (2), 4 represents the number of output channels (4), and 9 represents the convolution kernel size (9), with a stride of 5. After the second convolution layer, the ECG data size becomes 4×20. The convolution kernel size of the third convolutional layer is (4, 8, 8), where 4 represents the number of input channels (4), the first 8 represents the number of output channels (8), and the second 8 represents the convolution kernel size (8), with a stride of 4. After the third convolution layer, the ECG data size becomes 8×4. These three convolutional layers use large kernels to fully extract features and ensure recognition accuracy. Two fully connected layers are used after the convolutional layers. The output of the third convolutional layer (4×8 data points) is first stretched to 32 data points. Then, a fully connected layer reduces the number of data points by half, to 16. Finally, another fully connected layer performs the final classification to determine whether the input ECG data is normal. Specifically, the third convolutional layer outputs a two-dimensional feature map with dimensions of 4×8 (32 data points in total). This 4×8 matrix is flattened row by row into a one-dimensional vector (stretched to 32 data points). This converts the spatial features into a vector format that can be processed by the fully connected layers. Finally, a linear transformation is performed using the weight matrix W and the bias vector b: output = ReLU(W×input vector + b). This achieves dimensionality reduction, reducing the 32-dimensional input to a 16-dimensional output (reduced to 16 data points). In this way, the convolution layer captures the waveform features - flattens - and the fully connected layer selects key rhythm points, reduces the dimension by 50% and improves the inference speed.
[0057] It is important to note that to further improve the robustness of ECG data recognition, a dilated structure can be introduced into the convolutional layer to expand the receptive field without increasing parameters or sacrificing resolution. For example, adding a dilated convolutional layer with a dilation ratio of 2 after the third convolution layer can capture longer-period ECG waveform features (such as ST segment variations) and improve sensitivity to arrhythmias. A lightweight channel attention module (such as Squeeze-and-Excitation) can be embedded after the convolutional layer to dynamically adjust the feature weights of each channel. For example, channel recalibration of the 8×4 feature map can enhance the response to key pathology-related waveforms (such as the QRS complex), thereby enhancing feature extraction. Traditional convolution can also be split into depthwise convolution (channel-by-channel spatial filtering) and pointwise convolution (channel fusion). For example, using a depthwise separable structure in the second convolutional layer can reduce computational effort by over 50% while maintaining similar feature extraction capabilities, adaptively generating convolution kernel weights based on the input signal characteristics. For example, the size of the first-layer convolution kernel is dynamically adjusted based on the RR interval (the time interval between two R waves on an ECG) of the ECG signal to optimize adaptability to tachycardia / bradycardia. This improves computational efficiency. Finally, adaptive pooling branches of different scales (e.g., 625 points and 313 points) can be set in parallel before the pooling layer to concatenate or weightedly fuse multi-resolution features. This avoids the loss of high-frequency information caused by a single resolution. To address the issue of blurred ECG waveform boundaries, an edge constraint loss based on the first-order derivative of the waveform is introduced in the classification layer, forcing the network to focus on the start and end points of the P / QRS / T waves. This strengthens the final decision logic, significantly improving the robustness of recognition for complex heart rhythms.
[0058] In this embodiment of the present invention, after network construction is complete, it needs to be trained. Only a trained and learned network can perform the corresponding function. Therefore, a backpropagation algorithm is used to train the initial ECG recognition neural network on the augmented data on a deep learning server to obtain the ECG recognition neural network. During the training process, the network's performance on the test set is continuously tested. Once the target performance is achieved, training is stopped and the weights are saved.
[0059] In addition, the backpropagation algorithm is used to train the initial ECG recognition neural network on the enhanced data on a deep learning server to obtain the ECG recognition neural network. This neural network is then quantized to obtain a quantized neural network. The quantized neural network is then deployed on the wearable device. Quantization further reduces storage and computing resource consumption, improves inference speed, and reduces power consumption, making it suitable for deployment on wearable devices with limited computing resources and power consumption, such as MCUs (microcontroller units).
[0060] Afterwards, the target ECG data is identified using the quantized ECG recognition neural network deployed on the wearable device to determine whether the target ECG data is normal based on the corresponding recognition results.
[0061] Beneficial Effects: The present invention first collects ECG signal data and constructs a lightweight neural network consisting of an adaptive pooling layer, a convolutional layer, and a fully connected layer. The trained neural network is then quantized and deployed to a wearable device to perform heart rate data recognition. Quantization further reduces storage and computing resource consumption, improves inference speed, reduces power consumption, and enables real-time heart rate detection.
[0062] Based on the above embodiment, the present invention discloses a lightweight and high-quality automatic recognition method for electrocardiogram data for low-power wearable devices, such as Figure 4 As shown. Since the ECG signal recognition of the present invention is realized by a deep neural network, it is first necessary to collect ECG signal data and mark the data as normal or abnormal. Then, the ECG data is enhanced to generate more data. Then, a lightweight neural network is constructed and the network is trained on the server side using the data until the recognition accuracy meets the requirements. Finally, the trained neural network is quantified and deployed to edge devices such as MCU to realize ECG signal recognition. Next, the process of quantizing the trained neural network, deploying the trained network to the edge device, and realizing ECG data recognition will be described in detail according to the specific quantization.
[0063] In the embodiment of the present invention, 32-bit floating-point numbers are used to train the neural network on the server. When deployed on edge devices, quantizing the neural network can reduce the storage space occupied and reduce the demand for computing resources. Therefore, the weights are quantized to INT8 data, that is, 8-bit integers, which can greatly reduce the memory space occupied by storing weight data. The intermediate data points of the network are quantized to INT16, that is, 16-bit integers during calculation, and there is almost no loss in network accuracy. Figure 5 This diagram illustrates the convolution computation process after neural network quantization. First, the 32-bit floating-point numbers are reordered and quantized to 16-bit integers. The weights are stored as INT8 and converted to INT16 before being input and used for computation. The quantized input is then matrix-multiplied with the weights to generate a 32-bit floating-point output for storage. During the next convolution, the 32-bit floating-point numbers are again reordered and quantized to 16-bit integers for computation.
[0064] Specifically, after quantizing the neural network, the trained network is deployed to the edge device to realize the recognition of electrocardiogram data. The present invention uses the adaptive pooling layer in the electrocardiogram recognition neural network to obtain a feature map of the target size according to the target electrocardiogram data; the feature map of the target size is sent to the first convolutional layer of the electrocardiogram recognition neural network, so that the first convolutional layer rearranges the feature map of the target size, quantizes the corresponding first rearranged feature map into a first quantized feature map in a 16-bit integer format, and converts the first weight of the electrocardiogram recognition neural network into a 16-bit integer format, performs matrix multiplication on the first converted weight and the first quantized feature map to obtain a first feature map in a 32-bit floating point format, and sends the first feature map to the second convolutional layer of the electrocardiogram recognition neural network; uses the second convolutional layer to rearrange the first feature map, and quantizes the corresponding second rearranged feature map into a second quantized feature map in a 16-bit integer format. The method comprises the following steps: a first convolutional layer for recognizing the electrocardiogram (ECG) neural network, a second convolutional layer for recognizing the electrocardiogram (ECG) neural network, a first convolutional layer for recognizing the electrocardiogram (ECG) neural network, a second weight for recognizing the electrocardiogram (ECG) neural network, a second weight for recognizing the electrocardiogram (ECG) neural network, a matrix multiplication of the second converted weight and the second quantized feature map, to obtain a second feature map in a 32-bit floating point format, and sending the second feature map to the third convolutional layer of the ECG recognition neural network; a third convolutional layer for recognizing the second feature map, a third reordered feature map, a third quantized feature map in a 16-bit integer format, and a third weight for recognizing the ECG neural network, a 16-bit integer format, a matrix multiplication of the third converted weight and the third quantized feature map, to obtain a third feature map in a 32-bit floating point format, and flattening the third feature map into a one-dimensional vector, and sending the one-dimensional vector to the fully connected layer of the ECG recognition neural network; and a fully connected layer for recognizing the target ECG data based on the one-dimensional vector to determine whether the target ECG data is normal according to the corresponding recognition result.
[0065] Finally, the one-dimensional vector is fed into the first fully connected layer of the ECG recognition neural network, which performs dimensionality reduction on the one-dimensional vector and sends the resulting vector to the second fully connected layer. The second fully connected layer then classifies the reduced vector and determines whether the target ECG data is normal based on the corresponding target component results. A fully connected layer reduces the number of data points by half, to 16, before passing through another fully connected layer for final classification to determine whether the input ECG data is normal.
[0066] In general, the present invention first proposes a lightweight deep neural network for automatic ECG data recognition based on 1D convolution. The network is divided into three stages. In the first stage, the ECG data of various sampling frequencies are unified into 625 data points through adaptive pooling. In the second stage, a large-size convolution kernel is used for feature extraction to ensure that all features are extracted. In the third stage, a fully connected layer is used for classification. The network has a small scale, small amount of calculation, and high accuracy, which is suitable for deployment on wearable devices with limited computing resources and power consumption. During the deployment process, a quantized convolution calculation method is proposed, which further reduces the consumption of storage resources and computing resources through quantization, improves the inference speed, reduces power consumption, and realizes real-time heart rate detection.
[0067] Beneficial Effects: The present invention first collects ECG signal data and constructs a lightweight neural network consisting of an adaptive pooling layer, a convolutional layer, and a fully connected layer. The trained neural network is then quantized and deployed to a wearable device to perform heart rate data recognition. Quantization further reduces storage and computing resource consumption, improves inference speed, reduces power consumption, and enables real-time heart rate detection.
[0068] See also Figure 6 As shown, an embodiment of the present invention provides an electrocardiogram data recognition device, comprising:
[0069] an electrocardiogram data determination module 11, configured to collect electrocardiogram signal data and determine target electrocardiogram data based on the electrocardiogram signal data;
[0070] The ECG data recognition module 12 is used to use the quantized ECG recognition neural network deployed on the wearable device to recognize the target ECG data, so as to determine whether the target ECG data is normal based on the corresponding recognition results; the ECG recognition neural network includes an adaptive pooling layer, three convolutional layers and two fully connected layers.
[0071] Since the embodiments of the device part correspond to the above embodiments, the embodiments of the device part please refer to the description of the embodiments of the method part, and will not be repeated here.
[0072] Beneficial Effects: The present invention first collects ECG signal data and constructs a lightweight neural network consisting of an adaptive pooling layer, a convolutional layer, and a fully connected layer. The trained neural network is then quantized and deployed to a wearable device to perform heart rate data recognition. Quantization further reduces storage and computing resource consumption, improves inference speed, reduces power consumption, and enables real-time heart rate detection.
[0073] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 7This is a structural diagram of an electronic device according to an exemplary embodiment. The content in the diagram should not be considered as any limitation on the scope of use of this application. The electronic device may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the electrocardiogram data recognition method disclosed in any of the aforementioned embodiments. In addition, the electronic device in this embodiment may specifically be an electronic computer.
[0074] In this embodiment, the power supply 23 is used to provide operating voltage for various hardware devices on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0075] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0076] The operating system 221 is used to manage and control the hardware devices on the electronic device and the computer program 222, and can be Windows Server, NetWare, Unix, Linux, etc. In addition to including a computer program capable of implementing the electrocardiogram data recognition method performed by the electronic device disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs capable of performing other specific tasks.
[0077] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when executed by a processor, the computer program implements the aforementioned electrocardiogram data recognition method. The specific steps of this method can be referred to the corresponding contents disclosed in the aforementioned embodiments and will not be repeated here.
[0078] Furthermore, the present application discloses a computer program product comprising a computer program / instructions; wherein, when executed by a processor, the computer program / instructions implement the aforementioned electrocardiogram data recognition method. The specific steps of this method can be found in the corresponding contents disclosed in the aforementioned embodiments and will not be further described here.
[0079] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.
[0080] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0081] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0082] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0083] The above is a detailed introduction to the technical solution provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for recognizing electrocardiogram data, characterized in that: include: collecting electrocardiogram (ECG) data, and determining target ECG data based on the ECG signal data; The target electrocardiogram data is identified using a quantized electrocardiogram recognition neural network deployed on a wearable device to determine whether the target electrocardiogram data is normal based on the corresponding recognition result; the electrocardiogram recognition neural network includes an adaptive pooling layer, three convolutional layers, and two fully connected layers.
2. The electrocardiogram data recognition method according to claim 1, characterized in that: The collecting of electrocardiogram signal data and determining target electrocardiogram data based on the electrocardiogram signal data includes: Collecting electrocardiographic signal data based on a preset sampling frequency through a target sensor, eliminating noise interference from the electrocardiographic signal data through bandpass filtering and adaptive baseline correction, and obtaining eliminated data; Extracting the time domain features and frequency domain features of the eliminated data by wavelet transform; A ResNet-18 neural network is used to classify heartbeat types based on the time domain features and frequency domain features, and target electrocardiogram data is determined based on the corresponding classification results.
3. The electrocardiogram data recognition method according to claim 1, characterized in that: Before the target electrocardiogram data is recognized by the quantized electrocardiogram recognition neural network deployed on the wearable device, the method further includes: Constructing an initial electrocardiogram recognition neural network based on an adaptive pooling layer, three convolutional layers, and two fully connected layers; wherein each of the convolutional layers is followed by a linear rectification function; Acquire multiple sets of electrocardiogram data, perform data enhancement on each of the electrocardiogram data using a target method, and obtain enhanced data so as to train the initial electrocardiogram recognition neural network using the enhanced data; the target method includes any one or a combination of horizontal flipping, vertical flipping, adding noise, cropping, and scaling.
4. The electrocardiogram data recognition method according to claim 3, characterized in that: Before the target electrocardiogram data is recognized by the quantized electrocardiogram recognition neural network deployed on the wearable device, the method further includes: The initial electrocardiogram recognition neural network is trained based on the enhanced data on a deep learning server using a back propagation algorithm to obtain the electrocardiogram recognition neural network.
5. The electrocardiogram data recognition method according to claim 4, characterized in that: After the initial electrocardiogram recognition neural network is trained based on the enhanced data using a back propagation algorithm on a deep learning server to obtain the electrocardiogram recognition neural network, the method further includes: quantizing the electrocardiogram recognition neural network to obtain a quantized neural network; The corresponding quantized neural network is deployed on the wearable device.
6. The electrocardiogram data recognition method according to any one of claims 1 to 5, characterized in that: The method of identifying the target electrocardiogram data using the quantized electrocardiogram recognition neural network deployed on the wearable device to determine whether the target electrocardiogram data is normal according to the corresponding recognition result includes: Obtaining a feature map of a target size based on the target electrocardiogram data using an adaptive pooling layer in the electrocardiogram recognition neural network; Sending the feature map of the target size to the first convolutional layer of the electrocardiogram recognition neural network, so that the first convolutional layer reorders the feature map of the target size, quantizes the corresponding first reordered feature map into a first quantized feature map in a 16-bit integer format, converts a first weight of the electrocardiogram recognition neural network into a 16-bit integer format, performs matrix multiplication on the first converted weight and the first quantized feature map to obtain a first feature map in a 32-bit floating point format, and sends the first feature map to the second convolutional layer of the electrocardiogram recognition neural network; Rearranging the first feature map using the second convolutional layer, quantizing the corresponding second rearranged feature map into a second quantized feature map in a 16-bit integer format, converting the second weight of the electrocardiogram recognition neural network into a 16-bit integer format, performing matrix multiplication on the second converted weight and the second quantized feature map to obtain a second feature map in a 32-bit floating point format, and sending the second feature map to the third convolutional layer of the electrocardiogram recognition neural network; Rearranging the second feature map using the third convolutional layer, quantizing the corresponding third rearranged feature map into a third quantized feature map in a 16-bit integer format, converting the third weight of the electrocardiogram recognition neural network into a 16-bit integer format, performing matrix multiplication on the third converted weight and the third quantized feature map to obtain a third feature map in a 32-bit floating point format, flattening the third feature map into a one-dimensional vector, and sending the one-dimensional vector to the fully connected layer of the electrocardiogram recognition neural network; The target electrocardiogram data is identified based on the one-dimensional vector using the fully connected layer to determine whether the target electrocardiogram data is normal according to a corresponding identification result.
7. The electrocardiogram data recognition method according to claim 6, characterized in that: The using the fully connected layer to identify the target electrocardiogram data based on the one-dimensional vector to determine whether the target electrocardiogram data is normal according to the corresponding identification result includes: Inputting the one-dimensional vector into a first fully connected layer of the electrocardiogram recognition neural network, so that the first fully connected layer performs dimensionality reduction processing on the one-dimensional vector and sends the corresponding reduced-dimensional vector to a second fully connected layer; The second fully connected layer is used to classify the dimension-reduced vector, and whether the target electrocardiogram data is normal is determined according to the corresponding target component results.
8. An electrocardiogram data recognition device, characterized in that: include: an electrocardiogram data determination module, configured to collect electrocardiogram signal data and determine target electrocardiogram data based on the electrocardiogram signal data; an electrocardiogram data recognition module, configured to recognize the target electrocardiogram data using a quantized electrocardiogram recognition neural network deployed on the wearable device, so as to determine whether the target electrocardiogram data is normal based on a corresponding recognition result; The electrocardiogram recognition neural network includes an adaptive pooling layer, three convolutional layers and two fully connected layers.
9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the electrocardiogram data recognition method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the electrocardiogram data recognition method according to any one of claims 1 to 7.