Electrocardiogram classification system and method fused with multi-scale adaptive attention
By integrating a multi-scale adaptive attention mechanism and a liquid neural network, the problems of single-scale feature extraction and static weight allocation in electrocardiogram (ECG) classification are solved, achieving high-precision automatic ECG classification and improving the accuracy and efficiency of heart disease diagnosis.
Patent Information
- Application Number
- CN202511237821.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-01
- Publication Date
- 2025-10-17
AI Technical Summary
Existing ECG classification methods rely on attention mechanisms based on single-scale feature extraction and static weight allocation, which cannot fully utilize the multi-scale features and dynamic changes of ECG signals, resulting in low diagnostic accuracy.
By combining a multi-scale adaptive attention mechanism with a liquid neural network, and upgrading the entire process from data acquisition, preprocessing, feature extraction and model training, we can achieve multi-scale feature extraction and adaptive adjustment. This integrates wavelet filtering for denoising, baseline correction, standardization, sliding window segmentation, multi-scale convolutional feature extraction, liquid neural network dynamic modeling and adaptive attention mechanism.
It achieves high-precision automatic electrocardiogram classification, improves the accuracy and efficiency of heart disease diagnosis, solves the problems of incomplete information and insufficient flexibility in existing technologies, and fills the gap in related technical fields.
Smart Images

Figure CN120804857A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electrocardiogram classification, and in particular relates to an electrocardiogram classification system and method integrating multi-scale adaptive attention. Background Art
[0002] Heart disease has become one of the leading causes of death in the world. Electrocardiograms (ECGs), which visually display ECG signals, are one of the most important vital signs used in clinical medicine to characterize heart health. Therefore, electrocardiograms (ECGs), which can visually display ECG signals, have become an important routine examination item. Cardiovascular disease has become the leading cause of death worldwide, and its early and accurate diagnosis has significant clinical significance in reducing mortality. As the gold standard for recording cardiac electrical activity, the ECG (Electrocardiogram) can non-invasively reveal pathological conditions such as arrhythmias, myocardial ischemia, and ventricular hypertrophy. However, traditional ECG analysis relies heavily on the experience and judgment of cardiovascular specialists. This leads to low efficiency, significant subjective bias, and high rates of missed diagnoses when dealing with massive amounts of ECG data. The shortage of specialized physician resources is particularly prominent in primary healthcare settings and telemedicine. Therefore, developing highly accurate and efficient ECG classification methods is of great practical significance for improving the diagnosis and treatment of cardiovascular disease.
[0003] Because ECG signals are affected by baseline drift, myoelectric signals, and power frequency interference, denoising is necessary. Common denoising methods include maximum decimation filters, finite impulse response digital filters, nonlinear Bayesian filters, linear filter banks, and self-adaptive filtering. Using various filters to denoise raw ECG signal data is an important means of improving classification performance. Next, ECG signal classification features must be manually extracted from the denoised ECG signal. Common features include morphological and temporal features. The QRS segment encompasses the majority of morphological features in ECG signals. Temporal features, on the other hand, represent the distance between two adjacent heartbeats, i.e., the R wave. Finally, a classifier uses the defined feature set to classify heartbeats. Commonly used classifiers include fuzzy C-means, K-nearest neighbor algorithms, random forests, and support vector machines, all of which have been successfully applied in heartbeat classification.
[0004] While traditional machine learning methods have achieved a certain degree of automatic classification of ECG signals, they are no longer able to meet the classification requirements of large sample sizes as data volumes continue to increase. Furthermore, the need for manual feature extraction from the raw signals can limit the classification accuracy of these algorithms. Deep learning-based methods, however, address these issues by circumventing the drawbacks of manual feature design through end-to-end learning, resulting in significant progress in ECG classification.
[0005] Because of the good anti-noise ability, generalization ability under large sample data and high-precision classification performance of deep neural network method, the method has been widely applied to various fields including electrocardiogram classification. The current mainstream electrocardiogram classification algorithm is convolutional neural network (CNN) and recurrent neural network (RNN). CNN can effectively extract regional features by learning the spatial features of ECG signals and convolving the data within a certain range of samples, and can achieve good performance in ECG signal classification. ECG signal is essentially a one-dimensional time series, and RNN can well preserve the memory unit of sequence information, so there are also methods of combining ECG signal sequence information and using RNN network for ECG signal classification. There is also a network architecture combining CNN+LSTM, which can extract the spatial and temporal characteristics of ECG signals at the same time. In addition, there is a model combining convolutional neural network and recurrent neural network for ECG signal classification, which improves the classification accuracy with the help of the cyclic law of electrocardiogram, but faces the problems of long operation time and high model complexity, which seriously restricts its practical application. There is also a way to convert ECG signals into frequency spectrum images and use two-dimensional dense CNN for classification. These methods have improved the classification accuracy to some extent, but due to the increase in model complexity, they have brought problems such as rapid increase in model calculation amount and increase in model size, making it difficult to deploy in practice. Moreover, most models use single-size convolution kernels to extract features, which are limited by the receptive field and cannot fully utilize global features, resulting in low information utilization rate and insufficient mining of different scale features of electrocardiogram signals, which further affects the classification accuracy.
[0006] Liquid neural network, as a new neural network architecture, has the characteristics of dynamic memory and adaptive response, and can better process electrocardiogram signals with complex time sequence relationship. Multi-scale feature extraction technology can analyze electrocardiogram signals from different time and spatial dimensions, and fully capture the features of cardiac electrical activity; adaptive attention mechanism can automatically adjust the attention to different features according to the characteristics of input data, highlight key electrocardiogram features, and suppress noise and interference. However, the current research on the application of liquid neural network combined with multi-scale adaptive attention mechanism in electrocardiogram classification is still in the exploratory stage, and how to fully utilize the advantages of both and achieve high-precision automatic electrocardiogram classification is a problem to be solved.
[0007] The analysis process based on ECG data is the most common technical path. In the data acquisition stage, medical devices place electrodes accurately on the patient's chest, limbs, and other parts to obtain continuous cardiac electrical activity signals. These raw signals contain rich cardiac physiological information, but also contain various interference components. Therefore, the preprocessing step is a key step: using a high-pass filter with a cutoff frequency of 0.5-1 Hz to eliminate baseline drift and prevent slow-changing interference from masking the true signal characteristics; using a low-pass filter with a cutoff frequency of 40-100 Hz to suppress high-frequency noise; using a notch filter to specifically filter out 50Hz or 60Hz power frequency interference. After filtering, the signal amplitude is mapped to the [0, 1] or [-1, 1] interval through normalization, laying the foundation for subsequent analysis.
[0008] In terms of feature extraction, traditional techniques highly rely on hand-crafted features. Time-domain feature extraction focuses on the temporal relationship of cardiac activity, such as the calculation of RR interval directly reflecting cardiac rhythm, PR interval for assessing atrioventricular conduction time, and QRS complex width for determining ventricular depolarization duration. Frequency-domain feature extraction uses Fast Fourier Transform (FFT) to convert time-domain signals and analyze main frequency components and power spectral density, revealing the energy distribution of cardiac electrical activity at different frequencies. These hand-crafted features can reflect some cardiac states, but are limited by the limitations of human design and are difficult to fully capture complex pathological features.
[0009] Classification often uses traditional machine learning algorithms. Support Vector Machine (SVM) constructs an optimal hyperplane to classify samples in feature space, and its performance depends on the accurate selection of kernel function and penalty factor C; decision tree algorithm recursively divides data according to feature threshold to intuitively present classification logic in tree structure, such as preliminary judgment of arrhythmia according to RR interval, and further classification according to other features. This type of algorithm performs well when dealing with simple data, but when faced with high-dimensional and complex cardiac disease data, the classification accuracy and generalization ability significantly decrease.
[0010] At present, the prior art still has the following shortcomings: the traditional ECG classification system relies on the three-stage architecture of "preprocessing-feature extraction-classification decision", and this modular design has systematic defects. In the signal preprocessing link, although the existing noise reduction techniques such as maximum value filtering and finite impulse response (FIR) filtering can suppress power frequency interference, the elimination effect on baseline drift and electromyographic noise is limited. For example, the Butterworth filter based on zero-phase filtering is prone to cause distortion of the ST segment features when removing the 0.5-5Hz baseline drift; and the wavelet threshold denoising method may mistakenly delete the high-frequency components in the QRS complex when the decomposition layer number is not properly selected. In the feature engineering stage, the artificially designed feature set has the problems of dimension disaster and information redundancy: morphological parameters such as P-wave time limit and QT interval need to accurately detect waveform feature points, but the R-wave detection algorithm (such as Pan-Tompkins algorithm) has a high false detection rate of up to 8.3% when facing wide QRS complexes; although the time domain features such as RR interval variability can reflect the autonomic nervous activity, they cannot capture the subtle changes of the dynamic offset of the ST segment during myocardial ischemia. At the classifier level, the shallow models such as support vector machine (SVM) are prone to overfitting in high-dimensional feature space, and the sensitivity of the random forest algorithm to feature correlation leads to feature selection bias.
[0011] Although the end-to-end deep learning method significantly improves the classification performance, its model architecture still has three contradictions: 1) the contradiction between model depth and gradient disappearance: deep networks such as ResNet-34 face the problem of gradient disappearance in ECG signal processing, and when the sequence length exceeds 3000 sampling points, the gradient attenuation of backpropagation can reach the order of 10^-5; 2) the contradiction between the receptive field range and the computational efficiency: when 1D-CNN uses stacked convolutional layers to expand the receptive field, the parameter quantity of VGGNet-style architecture increases exponentially with the number of layers, resulting in an Inception-ECG model that takes up to 23ms for a single forward inference on GPU, which is difficult to meet the real-time requirements of emergency scenarios; 3) the contradiction between spatio-temporal feature fusion and model complexity: although the CNN-LSTM hybrid architecture can extract both spatial local features and temporal dependencies, the parameter quantity of the bidirectional LSTM layer accounts for more than 40%, making the model exceed the memory occupation standard when deployed on embedded devices. It is particularly worth noting that existing methods generally use a single scale convolution kernel (such as 16 / 32 sampling points), which leads to the feature extraction of P-wave low-frequency components (0.5-2Hz) and QRS complex high-frequency mutations (15-50Hz) being biased and incomplete, and this single scale makes the model's misdiagnosis rate of atrioventricular block increase by 12.6%.
[0012] There are three key defects in the current adaptive attention mechanism: First, the channel attention (SE Block) in the 12-lead ECG data processing is not balanced in the weight distribution of the limb leads (I, II, III) and the chest leads (V1-V6), resulting in the feature weight of the apical myocardial ischemia being incorrectly compressed; second, the time attention mechanism is not sensitive enough to the irregularity of the RR interval of atrial fibrillation when calculating the dot product similarity, with an attention weight variance of only 0.12 on the MIT-BIH atrial fibrillation database, which is significantly lower than the 0.35 of normal sinus rhythm; finally, the multi-head attention mechanism has a clinical blind area in parameter configuration: when setting 8 attention heads, the model's feature focusing efficiency for ventricular premature beats improves by 9.2%, but the recognition accuracy for left bundle branch block decreases by 5.8%, which is due to the heterogeneity of different arrhythmia types in the feature space distribution.
[0013] Although dynamic models such as liquid neural networks (LNN) have theoretical advantages, they face three major challenges in practical applications: 1) stability problem of numerical solution of differential equation: the fourth-order Runge-Kutta method has numerical oscillation when dealing with high-frequency noise, leading to divergence of the liquid layer state trajectory of the atrial flutter signal; 2) gradient problem of long-term dependence modeling: for a 60-second ECG record, the gradient backpropagation of neural ODE requires storage of intermediate state variables, increasing memory consumption by 3 times; 3) lack of biological interpretability: the mapping relationship between the hidden state of existing LNN models and ECG features (such as ST segment offset) is not clear, making it difficult for doctors to trace the diagnosis basis through the activation trajectory.
[0014] These technical defects form a complex coupling relationship: feature loss in the preprocessing stage will exacerbate the difficulty of feature learning in deep learning models; the lack of clinical adaptability of attention mechanisms limits the potential of dynamic models; and the real difficulties at the system engineering level in turn restrict the clinical verification of new algorithms. For example, incomplete baseline drift correction can distort the ST segment features, affecting the recognition of myocardial ischemia by the attention mechanism, and ultimately triggering incorrect state evolution in the liquid neural network. The superimposed effect of these multi-level defects makes the clinical practicality rate of existing ECG classification systems much lower than the expected level of medical AI applications. Therefore, breaking through these technical bottlenecks requires systematic innovation from multiple dimensions such as signal processing and model architecture. SUMMARY
[0015] The embodiment of the application provides a kind of electrocardiogram classification system and method of fusion multi-scale adaptive attention, solve the single scale feature extraction in prior art leads to information not comprehensive, the attention mechanism of static weight distribution adopted in most models, when processing electrocardiosignal, flexibility is insufficient, cannot be adaptively adjusted according to the dynamic change of signal characteristics under different pathological state, leading to the technical problem of low diagnostic accuracy, reaches through liquid neural network, multi-scale feature extraction technology, the organic fusion and synergistic work of three multi-scale adaptive attention mechanism, realizes the whole process technical upgrading of data acquisition, pre-processing, feature extraction to model training optimization, high-precision electrocardiogram automatic classification, provides strong technical support for accurate diagnosis of heart disease, fills the technical effect of blank in relevant technical field.
[0016] In a first aspect, the embodiment of the application provides an electrocardiogram classification system fusing multi-scale adaptive attention, comprising: a data acquisition module for acquiring electrocardiogram data and outputting a structured data set; a data preprocessing module for preprocessing the structured data set, wherein the data preprocessing module includes a wavelet filter denoising submodule, a baseline correction submodule and a standardization submodule, and outputs a standardized signal matrix after wavelet filter denoising, baseline correction and standardization processing by the wavelet filter denoising submodule, baseline correction submodule and standardization submodule; a window data segmentation module for segmenting long-time sequence electrocardiogram signals into overlapping segments using sliding window technology to obtain standardized windowed electrocardiogram signals; a feature extraction module for taking the standardized windowed electrocardiogram signals as input and sequentially performing multi-scale convolution feature extraction, liquid neural network dynamic modeling and adaptive attention mechanism reinforcement through a multi-scale feature extraction submodule, a liquid neural network submodule and an adaptive attention mechanism submodule to output diagnosis results of nine types of heart diseases; and a training and optimization module for optimizing the extraction and classification ability of the model for electrocardiogram signal features.
[0017] In a second aspect, the embodiments of the present application also provide an electrocardiogram classification method fusing multi-scale adaptive attention, which comprises: collecting electrocardiogram data through a data acquisition module and outputting a structured data set; a data preprocessing module performs data preprocessing on the structured data set, wherein the data preprocessing module comprises a wavelet filter denoising submodule, a baseline correction submodule and a standardization submodule, and outputs a standardized signal matrix after wavelet filter denoising, baseline correction and standardization processing through the wavelet filter denoising submodule, the baseline correction submodule and the standardization submodule in sequence; a window data segmentation module adopts a sliding window technology to segment a long-time sequence electrocardiogram signal into overlapping segments to obtain a standardized windowed electrocardiogram signal; a feature extraction module takes the standardized windowed electrocardiogram signal as input, and sequentially performs multi-scale convolution feature extraction, liquid neural network dynamic modeling and adaptive attention mechanism reinforcement through a multi-scale feature extraction submodule, a liquid neural network submodule and an adaptive attention mechanism submodule to output a diagnosis result of nine types of heart diseases; and a training and optimization module optimizes the model to improve the extraction and classification ability of electrocardiogram signal features.
[0018] In a third aspect, the embodiments of the present application also provide an electrocardiogram classification system fusing multi-scale adaptive attention, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the system of the first aspect when executing the program.
[0019] The one or more technical solutions in the embodiments of the present application have at least one or more of the following technical effects:
[0020] The embodiment of the present application provides a kind of electrocardiogram classification system and method of fusion multi-scale adaptive attention, pass through data acquisition module, the data acquisition module is used to collect electrocardiogram data, and output structured data set;Data preprocessing module, the data preprocessing module carries out data preprocessing to the structured data set, wherein, the data preprocessing module includes wavelet filter denoising submodule, baseline correction submodule, standardization submodule, and after wavelet filter denoising submodule, baseline correction submodule, standardization submodule are sequentially carried out wavelet filter denoising, baseline correction and standardization processing, output standardization signal matrix;Window data segmentation module, the window data segmentation module uses sliding window technique to divide long time sequence electrocardiogram signal into overlapping segment, obtains the windowed electrocardiogram signal after standardization;Feature extraction module, the feature extraction module takes the windowed electrocardiogram signal after standardization as input, sequentially through multi-scale feature extraction submodule, liquid neural network submodule, adaptive attention mechanism submodule carries out three stages of multi-scale convolution feature extraction, liquid neural network dynamic modeling, adaptive attention mechanism reinforcement, and outputs the diagnosis result of nine kinds of heart diseases;Training and optimization module, the training and optimization module is used to optimize the extraction and classification ability of model to electrocardiogram signal feature, so as to solve the technical problems that single scale feature extraction in the prior art leads to incomplete information, the attention mechanism of static weight distribution used in most models is not flexible enough when processing electrocardiogram signal, cannot adaptively adjust according to the dynamic change of signal feature under different pathological states, leads to low accuracy of diagnosis, reaches the organic fusion and collaborative work of liquid neural network, multi-scale feature extraction technology, multi-scale adaptive attention mechanism, realizes the whole process technical upgrading of data acquisition, preprocessing, feature extraction to model training optimization, high-precision electrocardiogram automatic classification, provides strong technical support for accurate diagnosis of heart disease, fills the gap in the related technical field.
[0021] The above description is only a summary of the technical scheme of the present application, in order to more clearly understand the technical means of the present application, which can be implemented according to the content of the specification, and in order to make the above and other purposes, characteristics and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application are described as follows. BRIEF DESCRIPTION OF DRAWINGS
[0022] Figure 1 It is a structure schematic diagram of a kind of electrocardiogram classification system of fusion multi-scale adaptive attention in the embodiment of the present application;
[0023] Figure 2 It is the general flow chart of a kind of electrocardiogram classification method of fusion multi-scale adaptive attention in the embodiment of the present application;
[0024] Figure 3A structural schematic diagram of another exemplary electronic device in an embodiment of the present application;
[0025] Figure 4 A working principle diagram of a liquid neural network of an electrocardiogram classification system fusing multi-scale adaptive attention in an embodiment of the present application.
[0026] Legend: receiver 301, processor 302, transmitter 303, memory 304, bus interface 305. DETAILED DESCRIPTION
[0027] The embodiment of the present application provides an electrocardiogram classification system and method fusing multi-scale adaptive attention, so as to solve the technical problems that single-scale feature extraction in the prior art leads to incomplete information, the attention mechanism of static weight distribution adopted by most models has insufficient flexibility when processing electrocardiogram signals, cannot adaptively adjust according to dynamic changes of signal characteristics in different pathological states, and leads to low accuracy of diagnosis.
[0028] The technical scheme in the embodiment of the present application has the following general idea:
[0029] The electrocardiogram classification system and method fusing multi-scale adaptive attention provided by the embodiment of the present application have the following technical effects: the data acquisition module is used for acquiring electrocardiogram data and outputting a structured data set; the data preprocessing module is used for performing data preprocessing on the structured data set, wherein the data preprocessing module comprises a wavelet filter denoising submodule, a baseline correction submodule and a standardization submodule, and outputs a standardized signal matrix after wavelet filter denoising, baseline correction and standardization processing performed by the wavelet filter denoising submodule, the baseline correction submodule and the standardization submodule in sequence; the window data segmentation module is used for segmenting long-time electrocardiogram signals into overlapping segments by using a sliding window technology, and obtaining a standardized windowed electrocardiogram signal; the feature extraction module is used for taking the standardized windowed electrocardiogram signal as input, and performing multi-scale convolution feature extraction, liquid neural network dynamic modeling and adaptive attention mechanism reinforcement in three stages by using a multi-scale feature extraction submodule, a liquid neural network submodule and an adaptive attention mechanism submodule in sequence, and outputting a diagnosis result of nine types of heart diseases; and the training and optimization module is used for optimizing the extraction and classification ability of the model on electrocardiogram signal characteristics, so that the technical effects of organic fusion and collaborative work of the liquid neural network, the multi-scale feature extraction technology and the multi-scale adaptive attention mechanism are achieved, the full-process technical upgrading of data acquisition, preprocessing, feature extraction to model training and optimization is achieved, high-precision electrocardiogram automatic classification is achieved, strong technical support is provided for accurate diagnosis of heart diseases, and the blank in the related technical field is filled.
[0030] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0031] Embodiment one
[0032] The embodiment provides a fusion multi-scale adaptive attention electrocardiogram classification system, which comprises:
[0033] A data acquisition module is configured to acquire electrocardiogram data and output a structured data set. Specifically, the electrocardiogram classification method provided by the present application takes the Chinese PhysioNet Challenge data set as the data basis, and constructs a complete technical chain from data acquisition to model training. The whole system adopts a five-layer progressive architecture design, and the modules are closely connected through strictly defined input and output interfaces.
[0034] The data acquisition module in the embodiment is configured to acquire electrocardiogram data. The Chinese PhysioNet Challenge data set contains 6,877 publicly available 12-lead electrocardiogram records, with a time length of 6 seconds to 60 seconds. The data contains one normal category and eight abnormal categories. There is also a test set containing 2,954 records. The electrocardiogram ECG record sampling frequency is 500Hz. All data is provided in MATLAB format (each record is a.mat file containing electrocardiogram data and patient gender and age information). The training data has a REFERENCE.csv file for providing labels for each record. Most recordings have only one unique label. The structured data set (ECG matrix [NxC], N = number of sampling points, C = 12 leads) output in this stage is directly used as the input of the preprocessing module. According to the distribution characteristics of 918 normal samples and 5959 abnormal samples in the data set, the system specially designs an intelligent oversampling mechanism, which preferentially uses the SMOTE algorithm to expand the minority class samples, and ensures the data balance of subsequent training. Table 1 below shows the distribution of the public data set in 9 categories:
[0035] Table 1. Distribution of data set in 9 categories
[0036]
[0037] The system further comprises a data preprocessing module configured to preprocess the structured data set, wherein the data preprocessing module comprises a wavelet filter denoising submodule, a baseline correction submodule, and a standardization submodule, and outputs a standardized signal matrix after wavelet filter denoising, baseline correction, and standardization processing by the wavelet filter denoising submodule, the baseline correction submodule, and the standardization submodule in sequence.
[0038] Specifically, the data preprocessing module comprises a wavelet filter denoising submodule, a baseline correction submodule, and a standardization submodule. In the data preprocessing module, the original electrocardio signal is first subjected to Db4 wavelet 5-layer decomposition denoising processing. The output of this process directly enters the second processing unit, i.e., the baseline correction submodule. The mean value is calculated and a corrected signal is output by using the mean value zero method, so as to eliminate the feature distortion caused by the direct current offset. Finally, the Z-score standardization is used to ensure that the signals of different leads are in a unified dimension. The standardized signal matrix output by the preprocessing module will be directly used for subsequent feature engineering. Specifically, the following is performed:
[0039] Wavelet filter denoising: as a multi-resolution analysis tool, wavelet transform can decompose a signal into different frequency components, wherein the low-frequency approximation component reflects the overall trend of the signal (such as baseline drift), and the high-frequency detail component corresponds to noise and mutation characteristics. Daubechies wavelet is a kind of wavelet basis function with compact support and good vanishing moment property.
[0040] The French mathematician Daubechies proposed a formula for the filter function of an orthogonal wavelet:
[0041]
[0042] wherein Q(z) is an (N-1)th order polynomial related to z=e -jω .
[0043] When N=2, the scale filter function of the Daubechies wavelet is directly written as:
[0044]
[0045] After expansion, four of the coefficients are:
[0046]
[0047] The corresponding four wavelet coefficients are:
[0048] g0=h3; g1=-h2; g2=h1; g3=-h0;
[0049] Often referred to as the Db4 wavelet, Db4 boasts smooth waveforms and efficient computation due to its four vanishing moments, making it particularly well-suited for processing baseline drift and high-frequency noise in biosignals such as ECGs. Specifically, a five-layer decomposition breaks the signal down layer by layer into an approximate component (A) and a detail component (D). This yields a fifth-layer approximate component, A5, representing the low-frequency baseline trend, and detail components, D1-D5 (D1 being the highest frequency), corresponding to different high-frequency components. During denoising, a threshold λ is applied to filter out outliers in high-frequency noise (such as power-frequency interference) present in D1-D3. At the same time, A5 is adjusted to correct baseline drift, achieving both noise suppression and baseline correction for the original signal.
[0050] Baseline correction: DC offset, also known as baseline drift, refers to the tendency of a biosignal (such as an electrocardiogram) to deviate from zero. This deviation can distort signal features, such as shifted peak positions, and increase errors in subsequent processing steps such as filtering and feature extraction. To address this issue, baseline correction is performed by calculating the signal mean μ and subtracting it from each sampling point:
[0051] x corrected (t) = x(t) - μ;
[0052] The above operation shifts the entire signal to be centered around zero, effectively eliminating the DC component. This allows subsequent analysis to more accurately focus on the true fluctuation characteristics of the signal.
[0053] Standardization: Different signals or features may have different dimensions (such as voltage mV and time ms). After standardization, all features are on the same scale (mean 0, standard deviation 1). For the signal x(t), calculate the mean μ and standard deviation σ. The normalized signal is:
[0054]
[0055] The system also includes a window data segmentation module, which uses a sliding window technology to segment the long time series ECG signal into overlapping segments to obtain a standardized windowed ECG signal.
[0056] As can be seen, the data preprocessing module utilizes the multiresolution characteristics of the Daubechies wavelet (Db4) for filtering and denoising. Through a five-layer wavelet decomposition, the ECG signal is separated into a low-frequency approximate component A5 reflecting the baseline trend and high-frequency detail components D1-D5 containing noise and mutation characteristics. A threshold λ is applied to filter the high-frequency noise in D1-D3, and A5 is adjusted to correct for baseline drift. Subsequently, baseline correction is performed by calculating the signal mean and performing a subtraction operation on each sampling point to eliminate DC offset. Finally, the signal is normalized to unify features of different dimensions to a scale with a mean of 0 and a standard deviation of 1, laying the foundation for subsequent processing.
[0057] Further, the window data segmentation module sets the window size to 10 seconds and the sliding step to 5 seconds, and divides the long-time signal into overlapping segments.
[0058] Specifically, the feature engineering stage includes two parts of sliding window segmentation and multi-scale convolution. The window data segmentation module uses sliding window technology to divide the long-time ECG signal into overlapping segments to obtain the standardized windowed ECG signal. Among them, for the long-time signal processing requirement, 10-second window (3600 sampling points) is used with 5-second step (1800 sampling points) for overlapping segmentation. Mirror padding is implemented for the boundary window with insufficient length, and SlidingCrop is used for truncation for the window with excessive length.
[0059] Therefore, for the problem that the original ECG signal is long-time and difficult to extract features directly, the window data segmentation module uses sliding window technology. The window size is set to 10 seconds (corresponding to 3600 sampling points at a sampling rate of 360Hz), and the sliding step is 5 seconds (1800 sampling points), which divides the long-time signal into a large number of overlapping segments, increases the number of samples, and captures dynamic change features. For the segmented window data, the length of the insufficient window is repeated splicing, and the length of the excessive window is truncated to ensure the consistency of the data length and adapt the model input.
[0060] The system further includes a feature extraction module, which takes the standardized windowed ECG signal as input, sequentially passes through a multi-scale feature extraction submodule, a liquid neural network submodule, and an adaptive attention mechanism submodule to perform multi-scale convolution feature extraction, liquid neural network dynamic modeling, and adaptive attention mechanism reinforcement three stages, and outputs the diagnosis results of nine types of heart diseases.
[0061] Specifically, the feature extraction module in the embodiment includes a multi-scale feature extraction submodule, a liquid neural network submodule, and an adaptive attention mechanism submodule. In the feature extraction stage, the standardized windowed electrocardiogram signal first enters a three-level convolutional network, and multi-scale feature extraction is performed through depthwise separable convolution kernels of different sizes. The first layer is configured with 16 convolution kernels of size K1=16, and the RR interval and other medium and long scale features in the electrocardiogram signal are captured through parallel calculation of 16 consecutive sampling points. The output feature map is dimensionally reduced by MaxPooling1D (pooling window = 4) and then transmitted to the secondary network. The secondary network uses K2=12 convolution kernels to focus on the QRS complex shape features, and further extracts local details with a pooling window = 2. The tertiary network uses K3=8 convolution kernels to analyze small-scale features such as P-wave slope changes. This design of gradually decreasing convolution kernel size layer by layer enables the network to form hierarchical feature representation from macro-rhythm features to micro-waveform details, and finally outputs a multi-scale feature map F_multi (shape [W / 8, 256]). This feature matrix contains both the overall trend of cardiac electrical activity (such as heart rate changes) and the fine structure of local waveforms (such as ST segment deviation), providing a rich feature basis for the dynamic modeling of the subsequent liquid neural network.
[0062] Further, the present application realizes feature extraction and classification of electrocardiogram signals through a deep neural network architecture. Through the deep integration of liquid neural networks, multi-scale feature pyramids, and adaptive attention mechanisms, an efficient cardiac electrical activity feature analysis engine is constructed. The entire processing flow takes the standardized electrocardiogram signal segmented by a sliding window as input, and sequentially passes through three core stages of multi-scale convolution feature extraction, liquid neural network dynamic modeling, and adaptive attention mechanism reinforcement, finally outputting the diagnosis results of nine types of cardiac diseases. The feature map output by the multi-scale convolution layer is directly used as the input to drive the neuron state evolution of the liquid neural network. The state sequence output by the liquid layer is weighted by the attention mechanism to generate the final feature vector, which contains both millisecond-level waveform mutation features (such as sudden changes in QRS morphology of ventricular premature beats) and long-term trend information (such as irregular fluctuations in RR interval of atrial fibrillation), forming a complete mapping chain from the original signal to the diagnosis conclusion.
[0063] The multi-scale feature extraction submodule is specifically: the electrocardiogram signal is a time series biological signal, and the cardiac electrical activity information contained therein has multi-scale characteristics. For example, a complete heartbeat period (RR interval) belongs to medium-scale features, which can reflect heart rate changes; while the subtle morphological changes of P-wave, QRS complex, and T-wave belong to small-scale features, which are closely related to arrhythmia, myocardial ischemia, and other diseases; from a longer time range, the trend changes in 24-hour electrocardiogram signals belong to large-scale features, which are helpful for the diagnosis of chronic cardiac diseases. Therefore, single-scale feature extraction cannot fully capture the complete information of the electrocardiogram signal, and multi-scale feature extraction is a necessary choice.
[0064] The core idea of multi-scale feature extraction is to process the signal through different scale operation units to obtain different levels of feature representation. The multi-scale feature extraction module, as the core technical component of the application, adopts a three-level progressive architecture design to build a complete feature analysis system from macro trends to micro details. Based on the depth separable convolution layer, the module forms a "feature extraction-scale adjustment" cycle mechanism by dynamically adjusting the convolution kernel size and the pooling window parameters, and finally outputs a multi-scale feature map F multi (shape [W / 8, 256]). The feature matrix contains both the overall trend of cardiac electrical activity (such as heart rate change) and the fine structure of local waveform (such as ST segment deviation), providing a rich feature basis for the dynamic modeling of the subsequent liquid neural network. The multi-scale feature extraction adopts a depth separable convolution layer to build a multi-scale feature extraction basis. Let the input ECG signal feature map be where N represents the number of samples, C is the number of channels, and L is the length of the time series. The convolution layer realizes multi-scale scanning through different size convolution kernels, and its mathematical expression is:
[0065]
[0066] where F out (i,j) is the value of the output feature map at position (i,j), W(m,n) is the convolution kernel weight, and b is the bias term. The first layer uses a convolution kernel k = 16, which captures the overall shape of the waveform, RR interval, and other medium and long scale features in the ECG signal through parallel calculation of 16 consecutive sampling points, effectively extracting the macro trend of cardiac electrical activity.
[0067] The secondary feature extraction unit uses a k = 12 convolution kernel to focus on the QRS complex shape feature. This layer captures the width variation of the QRS complex (such as the sudden change of QRS waveform in ventricular premature beat) through convolution operation of 12 consecutive sampling points. The specially designed depth separable convolution decomposes the standard convolution into two stages of depth convolution (extracting local features within the channel) and point-by-point convolution (1x1 convolution kernel realizes channel fusion), which reduces the network parameter quantity while still effectively extracting key features such as P wave slope change. After MaxPooling1D (pooling window = 2, step = 2) processing, the time dimension is further compressed to W / 8, forming a medium-scale feature representation.
[0068] The last feature extraction unit uses k = 8 convolution kernels to analyze the subtle turning points of P waves, T waves and other local waveforms. This layer is particularly designed for myocardial ischemia features such as ST segment deviation: by adjusting the convolution kernel weight initialization strategy (Henormal initialization), the response to 0.5-2Hz low frequency components is strengthened; at the same time, Swish activation function is used instead of traditional ReLU, which improves the nonlinear expression ability of small scale features. The final output of multi-scale feature map F multi contains both macro rhythm features (such as irregular fluctuations of RR interval in atrial fibrillation) and micro waveform details (such as QRS complex time extension of left bundle branch block), forming a multi-level feature representation.
[0069] The pooling layer adjusts the size of the convolution layer output feature by adjusting the size of the pooling window s and the step stride. The calculation process of the maximum pooling operation is as follows:
[0070] P out (i,j)=max m,n∈pooling window P in (i·stride+m,j·stride+n);
[0071] Where, P out (i,j) is the value of the output pooled feature map, P in is the input feature map. When setting a larger pooling window (such as s = 4) and step, the feature can be compressed on a larger time scale, integrating multiple feature cycles into macroscopic representation, highlighting large-scale features such as heart rate changes and overall rhythm. Smaller pooling window (such as s = 2) with short step can preserve local details such as QRS complex while reducing feature dimension, achieving efficient integration of small-scale features.
[0072] Through the alternating stacking of convolution layer and pooling layer, the "feature extraction-scale adjustment" cycle mechanism is formed, which constantly refines the expression of multi-scale features.
[0073] The F multi feature matrix output by the module directly drives the dynamic modeling of the liquid neural network, and the time dimension (W / 8) determines the time resolution of the evolution of the liquid layer state, and the channel dimension (256) constitutes the initial state space of the liquid layer neuron. This seamless feature transmission mechanism ensures that the liquid network can fully utilize multi-scale features: when an ST segment deviation is detected, 1-100 dimensional neurons are activated to enhance low-frequency component analysis; when facing a wide QRS complex, 101-200 dimensional feature channels are activated to improve high-frequency response. At the same time, the adaptive attention mechanism dynamically adjusts the importance evaluation of each feature channel through the attention weight matrix α generated by F multi (shape [W / 8, 256]), so that the model can automatically adjust the focus according to the characteristics of the input data (such as the duration of ST segment deviation during myocardial ischemia).
[0074] The liquid neural network sub-module is specifically: the core of the liquid neural network (LNN) is different from the traditional static network, which is based on neural differential equations (NDE) as the theoretical cornerstone, and a liquid layer (Liquid Layer) with continuous time dynamic characteristics is constructed. This differential equation-based dynamic architecture provides a revolutionary technical path for analyzing complex time sequence features in electrocardiogram signals.
[0075] The clinical diagnostic value of electrocardiogram signals is highly dependent on the accurate capture of time sequence features: the width variation of QRS complex may indicate arrhythmia, and the deviation trend of ST segment is an important diagnostic basis for myocardial ischemia. These features not only contain millisecond-level waveform instantaneous mutations (such as sudden changes in QRS waveform morphology during ventricular premature beats), but also involve continuous trend evolution for several seconds to tens of seconds (such as irregular fluctuations in RR interval during atrial fibrillation). Traditional static networks are limited by discrete processing mode and are difficult to simultaneously model instantaneous details and long-time dependencies, while LNN through the continuous time dynamic mechanism of neural differential equations can seamlessly adapt to the extraction requirements of such mixed features.
[0076] The unique advantage of LNN comes from the biomimetic simulation of the dynamic connection mechanism of biological neurons in the network. The neurons in the network are not connected by fixed weights, but can dynamically adjust the connection strength according to the time sequence characteristics of the input data and environmental changes, just like the real nervous system. Specifically, the neurons in the liquid layer interact with each other through the dynamic rules described by the neural differential equation: when the input layer transmits the windowed electrocardiogram signal into the liquid layer, the state of the neuron evolves continuously over time, and its trajectory is driven by the instantaneous input of the current waveform (such as capturing the morphological mutation of QRS complex), and is also affected by the time sequence dependence of the historical state through the recursive connection weight (such as remembering the abnormal rhythm trend of atrial fibrillation). This dynamic connection mechanism enables LNN to encode the millisecond-level waveform mutation and the second-level trend evolution into a unified feature representation while preserving the time continuity of the electrocardiogram signal, fundamentally solving the feature fragmentation problem of traditional networks in processing long-term biological signals.
[0077] Compared with traditional fixed connection neural networks, the dynamic weight adjustment mechanism of LNN gives it stronger time sequence feature generalization ability: when facing different types of arrhythmia signals, the network can autonomously optimize the connection strength between neurons, strengthen the response to key diagnostic features (such as ST segment offset amplitude, QRS complex time limit), and suppress noise interference such as baseline drift. This adaptive dynamic characteristic enables LNN to exhibit excellent analytical ability for complex time sequence patterns in electrocardiogram automatic diagnosis, providing a solid technical support for improving the accuracy of non-invasive diagnosis of heart disease.
[0078] This network breaks through the discretization processing limitation of traditional static networks by building a continuous-time dynamic model, and can capture the complex features of millisecond-level waveform mutation and second-level trend evolution in electrocardiogram signals. As shown in Figure 4 , its working principle can be further explained from three levels:
[0079] At the mathematical modeling level, the core mathematical expression of the liquid neural network is the neural differential equation:
[0080]
[0081] The input layer transmits the windowed electrocardiogram signal x(t) into the liquid layer, and a large number of neurons (which can be regarded as dynamic nodes) in the liquid layer form an interactive network through connection weights W in (input connection) and W rec (recursive connection). The state h(t) of each neuron evolves continuously over time, and its trajectory is driven by the current input x(t) and affected by the historical state of other neurons. The final output of the neuron state set is the complex time sequence feature that encodes "instantaneous waveform mutation + long-term trend evolution".
[0082] At the level of dynamic modeling process, the processing of LNN contains three progressive stages. In the initial state injection stage, the input multi-scale feature map F multi (shape [W / 8, 256]) is linearly projected to form the initial state h(0) = W in·F multi, at this time the network has established a spatial mapping relationship with ECG features. In the dynamic evolution stage, the improved Euler method (Δt = 0.01s, T sim = 10s) is used to solve the differential equation to generate a state sequence containing 512-dimensional hidden states. The update at each time step is driven by the current input feature and affected by the historical state. In the feature fusion stage, the final feature vector is generated by the GRU-MaxPooling hybrid decoder, where the GRU extracts the long-term dependence characteristics to preserve the RR interval fluctuations of atrial fibrillation, and the MaxPooling preserves the instantaneous peak value such as the ST segment offset amplitude. This dynamic evolution mechanism enables the network to capture the sudden change of QRS morphology of ventricular premature beat (milliseconds) and remember the irregular fluctuations of RR interval of atrial fibrillation (seconds), solving the problem of insufficient memory of long-term signals in traditional RNN.
[0083] At the level of feature encoding mechanism, LNN realizes the unified representation of composite features through dynamic neuron state. The input signal first enters the initial state space of the liquid layer, at this time the 512 neuron nodes correspond to the 256-channel multi-scale features, forming the initial activation map. With the numerical solution of the differential equation, the neuron state evolves continuously over time: when processing normal sinus rhythm signals, the 1-100 dimensional neurons remain stable activation, reflecting the smooth features of the baseline ST segment; when encountering ventricular premature beat events, the 101-200 dimensional neurons suddenly strengthen, encoding the instantaneous change of QRS wave group time limit extension; in the face of irregular fluctuations of RR interval of atrial fibrillation, the 301-400 dimensional neurons show irregular activation pattern. This dimensional division mechanism enables the liquid layer to establish a mapping table of hidden states and ECG features (such as 1-100 dimensions corresponding to ST segment offset, 101-200 dimensions associated with QRS width).
[0084] The LNN is closely connected with the front and back modules. The F multi output by the multi-scale feature extraction module directly drives the liquid layer state evolution, and the time dimension (W / 8) determines the time sequence resolution of the liquid layer, and the channel dimension (256) constitutes the initial state space of the liquid layer. The state sequence H output by the liquid layer contains both instantaneous waveform mutation characteristics (such as sudden changes in the QRS morphology of ventricular premature beats) and long-time trend information (such as RR interval fluctuations in atrial fibrillation), and these characteristics are dynamically weighted through an adaptive attention mechanism - the attention weight matrix a (shape [W / 8, 256]) reversely adjusts the liquid layer recursion weight W rec, forming a closed-loop optimization system. When a persistent ST segment deviation is detected, the connection strength of the relevant neurons is strengthened; when facing a transient QRS complex abnormality, the sensitivity of the transient response channel is enhanced. This dynamic feedback mechanism enables the network to automatically adjust the modeling strategy according to the characteristics of the input data, and finally the feature vector is output through a fully connected network to obtain the probability distribution of nine diseases.
[0085] The adaptive attention mechanism submodule is specifically: the design of the attention mechanism is derived from the attention allocation method of the human visual system. When people observe an image, they will instinctively focus their gaze on the area of interest, while paying less attention to other areas. In the context of deep learning processing of electrocardiogram signals, the attention mechanism also aims to enable the model to adaptively adjust the attention degree to different feature positions or channels according to the characteristics of the input data, thereby strengthening key features and weakening noise and interference information.
[0086] Essentially, the attention mechanism is a process of calculating attention weights and summing the input features. These weights reflect the model's evaluation of the importance of each feature position or channel, and the higher the weight, the greater the influence of that part of the feature in subsequent processing. In electrocardiogram signal processing, key features often manifest in waveform changes at specific time points, wave segment morphology, etc., and the attention mechanism can help the model capture these subtle but critical information.
[0087] First, the features output by the convolution layer are processed. Let the feature matrix output by the convolution layer be where N represents the number of samples, C is the number of channels, and L is the length of the time series. Then, a linear transformation is performed, and the calculation formula is:
[0088] A = tanh(W1X + b1);
[0089] After linear transformation and activation, the feature matrix A has a dimension of N x 1 x L, and then the multi-dimensional features are flattened into a one-dimensional vector, resulting in a vector dimension of N x (1 x L). Then, the flattened vector is normalized using the softmax function to generate the attention weight a. The calculation formula of the softmax function is:
[0090]
[0091] wherein A i represents the value of the i-th element in the flattened vector, n is the length of the vector, after softmax processing, each element in alpha is in the interval [0, 1], and the sum of all elements is 1, these elements reflect the attention degree of the model to different positions in the input features.
[0092] Finally, the generated attention weight alpha is weighted and multiplied with the original feature matrix X, that is:
[0093] Y = X O alpha;
[0094] wherein O represents element-wise multiplication. Through this operation, the position of the original feature with high attention weight is strengthened, and the position with low weight is relatively weakened, thereby realizing the strengthening of important features and the suppression of secondary features, noise and interference. The processed output feature matrix Y will be used as the input of the subsequent network layer for further feature extraction and classification.
[0095] The electrocardiogram classification method proposed by the application is based on multi-scale feature extraction, and a complete technical chain from feature analysis to dynamic modeling to feature enhancement is constructed. The mapping process from the original signal to the diagnostic conclusion of the whole process is a three-level progressive architecture: the first-level module realizes multi-level feature extraction from macro rhythm to micro waveform by alternately stacking depth separable convolution and pooling layer; the secondary module uses liquid neural network to dynamically model the multi-scale features in continuous time; the final module weights and enhances the dynamic features through the adaptive attention mechanism, and finally outputs the diagnosis results of nine types of heart diseases. This design breaks through the limitations of traditional static networks in processing long-term signals, and realizes the seamless connection from feature analysis to diagnosis decision.
[0096] During the feature extraction phase, the normalized ECG signal is first processed by a three-stage convolutional network. The first layer uses a convolution kernel with 16 consecutive sampling points to capture medium- and long-scale features such as the RR interval. After dimensionality reduction with a pooling window of 4, the output feature map is compressed to a quarter of its original length, preserving macro-trend information such as heart rate variations. The second layer uses a convolution kernel with 12 sampling points to focus on QRS complex morphology. Depthwise separable convolution is decomposed into a two-stage process: intra-channel local feature extraction and cross-channel feature fusion. This reduces the number of network parameters while still accurately capturing the sudden changes in QRS complex morphology associated with premature ventricular beats. The final layer uses a convolution kernel with 8 sampling points to analyze changes in P wave slope. By adjusting the weight initialization strategy to enhance the response to low-frequency components, the final multi-scale feature map output captures both macro-level features such as irregular RR interval fluctuations of atrial fibrillation and micro-level details such as the prolonged QRS complex duration of left bundle branch block. This descending design enables the network to establish temporal associations between multi-scale features: for example, variations in QRS complex width can be detected by a 12-sample-point convolution kernel, while its position in the RR interval is located by a 16-sample-point convolution kernel, and changes in P wave morphology are accurately captured by an 8-sample-point convolution kernel, solving the problem of one-sided information extraction in traditional single-scale features.
[0097] The liquid neural network module constructs a dynamic model based on neural differential equations, with its core focus on simulating the dynamic connectivity of biological neurons. After inputting a multi-scale feature map, the network solves the differential equations using a modified Euler method to generate a state sequence consisting of 512 hidden states. This dynamic modeling process consists of three key stages: the initial state injection stage maps multi-scale features into the liquid space to form the initial state; the dynamic evolution stage preserves historical state dependencies through recursive connection weights, and the neuronal state is continuously updated over time. Each time step is driven by both the current input and the historical state; the feature fusion stage integrates instantaneous waveform mutations with long-term trend information, such as the sudden QRS morphology changes in ventricular premature beats and the RR interval fluctuations in atrial fibrillation. This continuous-time dynamic mechanism enables the network to simultaneously capture millisecond-level waveform mutations and seconds-level trend evolution, addressing the problem of traditional RNNs' insufficient memory for long-term signals. A specially designed gating mechanism enables the network to dynamically adjust the strength of neuronal connections: when ST segment deviation is detected, the 1-100 dimension is activated to enhance low-frequency analysis; when faced with a wide QRS complex, the 101-200 dimension is activated to enhance high-frequency response. This bio-inspired connection pattern significantly improves the ability to analyze complex pathological features.
[0098] The adaptive attention mechanism dynamically enhances the features of the state sequence output by the liquid layer. The processing process includes four stages of linear transformation, activation, flattening and softmax normalization. By calculating the attention weight of the liquid layer hidden state, the model can automatically adjust the focus according to the characteristics of the input data: the weight of the hidden state dimension corresponding to the ST segment offset can reach more than 0.8, while the weight of irrelevant features such as electromyographic interference is compressed to less than 0.1. The weighted feature matrix is generated into a final feature vector by the GRU-MaxPooling hybrid decoder, where the GRU extracts the long-term dependence characteristics to retain the RR interval fluctuations of atrial fibrillation, and the MaxPooling retains the instantaneous peak value such as the ST segment offset amplitude. This dual-channel feature fusion mechanism enables the model to capture both the rhythm abnormalities of atrial fibrillation and the morphological changes of myocardial ischemia, and the final feature vector is output through a fully connected network to output a nine-class disease probability distribution. The attention weight also adjusts the recurrent weight of the liquid layer in the reverse direction, forming a dynamic feedback mechanism: when the ST segment offset is detected to exist continuously, the connection strength of the related neurons is strengthened; when facing transient QRS complex abnormalities, the sensitivity of the transient response channel is enhanced.
[0099] The entire processing flow forms a closed-loop optimization system, and the quality of the feature map output by the multi-scale feature extraction module determines the time resolution of the state evolution of the liquid network. The state sequence output by the liquid layer is dynamically weighted by the attention mechanism, and the attention weight is fed back to adjust the parameter update of the convolutional layer. It fills the technical gap of insufficient utilization of multi-scale features, difficulty in dynamic time series modeling, and poor clinical adaptability of attention mechanisms.
[0100] The system further comprises a training and optimization module for optimizing the model's ability to extract and classify electrocardiogram signal features.
[0101] Further, the training and optimization module uses a classification cross-entropy loss function and an Adam optimizer, and implements a multi-dimensional data augmentation strategy.
[0102] Further, the training and optimization module uses K-fold cross-validation to comprehensively evaluate the model performance, divides the data set into K subsets, selects K-1 subsets for training each time, and the remaining 1 subset as the validation set, and performs K times of training and validation process, obtains the performance index of the model under different data division conditions, wherein, in the model training process, the model hyperparameters are optimized through the cross-validation results, and the model structure is adjusted according to the model evaluation results.
[0103] Specifically, the training and optimization module in this embodiment is designed as follows: Loss function selection: categorical_crossentropy (categorical cross entropy) is used as the loss function. ECG classification is a multi-classification task, and data labels are represented in one-hot encoding. categorical_crossentropy is based on the cross entropy principle in information theory, and its mathematical expression is:
[0104]
[0105] Among them, N is the number of samples, C is the total number of categories, and y ij represents the true label of the i-th sample in the j-th category, P ij Represents the probability that the model predicts that the i-th sample belongs to the j-th category. This loss function can effectively punish incorrect predictions and guide the model to learn more discriminative features.
[0106] Optimizer: Select the Adam optimizer. During training, the Adam optimizer dynamically adjusts the learning rate by calculating the first-order and second-order moment estimates of the gradient. This allows the model to converge quickly in the early stages of training, avoids excessive oscillations when approaching the optimal solution, and improves overall model performance.
[0107] Data enhancement operation: In order to address the problems of limited and unbalanced original ECG data and insufficient model generalization, the present invention implements a multi-dimensional data enhancement strategy. In the time dimension, a sliding window segmentation is performed with a window of 10 seconds (3600 sampling points) and a step size of 5 seconds (1800 sampling points) to generate overlapping samples, retain the time characteristics of the ECG signal, and help the model learn the law of change. At the signal feature level, random Gaussian noise of 0.01 times the standard deviation of the signal is added to simulate real interference, enhance data diversity, and improve the model's noise resistance and diagnostic capabilities. In response to data imbalance, an intelligent oversampling mechanism is constructed, and the SMOTE algorithm is used to expand minority class samples first. When it fails, it automatically switches to ADASYN or random oversampling, and dynamically adjusts parameters to ensure stability, balance the number of samples, and improve the recognition accuracy of minority diseases.
[0108] Model evaluation and tuning: K-fold cross-validation is used to comprehensively evaluate the model performance. The dataset is divided into K subsets, and each time K-1 subsets are selected for training, and the remaining 1 subset is used as the validation set. The K training and validation processes are repeated K times, and the performance indicators (such as accuracy, recall, F1-score, and AUC) of the model under different data partitioning are obtained. During the model training process, the model hyperparameters are tuned based on the cross-validation results. Hyperparameters include the number of convolution kernels, size, pooling window parameters, learning rate, etc. Methods such as grid search, random search, or heuristic algorithms (such as genetic algorithm, particle swarm optimization algorithm) are used to systematically search the hyperparameter space, and the optimal combination of hyperparameters that make the model perform best on the validation set is found. At the same time, based on the model evaluation results, the model structure is adjusted, such as increasing or decreasing the convolution layer, adjusting the attention mechanism parameters, etc., to further optimize the model's ability to extract and classify the features of the electrocardiogram signal, until the model performance reaches the optimal.
[0109] As can be seen, the training and optimization module selects categorical_crossentropy classification cross-entropy as the loss function, which guides the model to learn discriminative features by penalizing incorrect predictions. The Adam optimizer is used to dynamically adjust the learning rate based on the first and second moment estimates of the gradient, achieving fast convergence in the early stages of training and avoiding oscillation in the later stages. Model evaluation uses K-fold cross-validation, which divides the dataset into K subsets. After K training and validation, multiple performance indicators are obtained. Based on the cross-validation results, the grid search, random search, or heuristic algorithm is used to optimize the number and size of convolution kernels, pooling window parameters, learning rate, and other hyperparameters. Based on the evaluation results, the model structure is adjusted to continuously improve the model's ability to extract and classify the features of the electrocardiogram signal.
[0110] Therefore, the present application selects Chinese physiological challenge dataset carefully, and combines a comprehensive data preprocessing process to ensure data quality from the source. The 6,877 12-lead electrocardiogram records covering various heart conditions, together with the 2,954 test sets, provide a rich sample for model training. Daubechies wavelet (Db4) filtering denoising, baseline correction, and standardization processing effectively remove baseline drift, high-frequency noise, and other interference, and unify the scale of different dimension features. This makes the data input into the model more pure and standardized, laying a foundation for subsequent accurate analysis. Compared with the problem of signal distortion and difficulty in feature extraction caused by insufficient data processing in traditional technology, the data usability is greatly improved, thereby ensuring the accuracy of diagnosis.
[0111] In the aspect of feature extraction, the prior art or relies on the limitation of manually designed features, or there is a problem of insufficient multi-scale feature extraction. The present application uses a sliding window technology to divide the long-time sequence electrocardiogram signal into overlapping segments, and combines a multi-scale feature extraction system based on a deep learning network to fundamentally solve this problem. The collaborative operation of the deep separable convolution layer and the pooling layer realizes multi-level feature extraction from macro heart rate changes, rhythm features to microscopic P-wave, QRS wave group subtle morphological changes through different size convolution kernels and pooling windows. Compared with the traditional single scale or simply spliced feature extraction method, the heart electrical activity information can be more comprehensively and deeply mined, the complex pathological features can be effectively captured, the diagnosis information loss can be avoided, and the integrity and effectiveness of feature extraction can be significantly improved.
[0112] For the problem that the attention mechanism in the existing model is not flexible enough and is difficult to focus on key information, the adaptive attention mechanism designed by the present application plays a key role. The mechanism generates dynamic attention weights by performing linear transformation, activation and flattening processing on the output features of the convolution layer. These weights can reflect the importance of different features in the input data in real time, strengthen key diagnostic information such as ST segment deviation during myocardial ischemia, and suppress noise interference. Compared with the traditional static weight distribution attention mechanism, the model can adaptively adjust the focus according to the dynamic changes of the electrocardiogram signal, effectively avoid the key information being ignored, greatly improve the model's ability to capture important diagnostic information, and thus improve the accuracy of diagnosis.
[0113] In the model architecture level, the existing liquid neural network fails to effectively combine multi-scale feature extraction and adaptive attention mechanism, limiting its advantages. The present application innovatively integrates the three, taking the liquid neural network as the core, and fully utilizes its modeling capability for complex time sequence dynamics of electrocardiogram signals. The liquid layer neuron based on the continuous evolution characteristics of the neural differential equation can capture both millisecond-level waveform mutations and second-level trend evolution, solving the problem of feature fragmentation of long-term signals in traditional networks. Combined with the deep mining of multi-level information by multi-scale feature extraction and the precise focusing of key features by adaptive attention mechanism, the limitations of traditional network architecture are broken through. This integrated architecture enables the model to more accurately analyze the electrocardiogram signal, realizes high-precision automatic classification and diagnosis of heart disease, meets the urgent needs of clinical high-precision and real-time diagnosis, and realizes a qualitative leap in diagnosis accuracy and efficiency compared with traditional technology.
[0114] In the training and optimization link, the application adopts a classification cross-entropy loss function, an Adam optimizer, a multi-dimensional data enhancement strategy and K-fold cross-validation, effectively solving the problems of low model training efficiency, poor generalization ability and difficult optimization of hyperparameters in traditional technologies. The classification cross-entropy loss function effectively punishes incorrect predictions and guides the model to learn discriminative features; the Adam optimizer dynamically adjusts the learning rate to achieve fast convergence and avoid oscillation; data enhancement expands data from multiple aspects such as time dimension, signal features and sample balance to improve model generalization ability; K-fold cross-validation combined with a hyperparameter optimization algorithm ensures that the model has good performance under different data divisions, realizes the optimal configuration of model structure and parameters, and finally makes the model perform more stably and accurately in the heart disease classification task.
[0115] Data preprocessing module alternative: In the signal denoising link, in addition to Daubechies wavelet transform, Symlets wavelet, Coiflets wavelet or Mallat algorithm can be used to realize multi-resolution analysis, and adaptive time-frequency analysis method based on empirical mode decomposition (EMD) can also be used. After the signal is decomposed into intrinsic mode function (IMF) through the screening process, threshold processing is performed. For baseline drift correction, in addition to the mean zero method, a baseline trend curve can be constructed using cubic spline interpolation and then subtracted for correction, or the baseline inflection point can be identified using the wavelet transform modulus maximum method and then linearly corrected in segments. In the standardization process, in addition to Z-score standardization, the signal amplitude can be mapped to the [0, 1] interval using the min-max scaling method, or the Robust Scaler can be used for standardization insensitive to outliers.
[0116] Feature extraction module alternative: A fixed period clipping method based on R-wave detection can be used, and the Pan-Tompkins algorithm is used to identify QRS complexes and clip heartbeat period segments based on R-R intervals. For the feature extraction unit, in addition to the combination of depth separable convolution and pooling, one-dimensional discrete cosine transform (DCT) can be used to extract frequency domain features, or the Hilbert-Huang transform can be used to obtain the instantaneous frequency features of the signal. In time-frequency analysis, short-time Fourier transform (STFT) can be used to generate a time-frequency graph and input a two-dimensional convolution network, or continuous wavelet transform (CWT) can be used to construct a multi-scale time-frequency feature matrix. For the alternative of liquid neural network, gated recurrent unit (GRU) or long short-term memory network (LSTM) can be used to construct a time series feature extraction module, or the self-attention mechanism in the Transformer architecture can be introduced to establish global dependency relationships.
[0117] Model architecture alternatives: A hybrid expert system (MoE) architecture can be used, which uses multiple heterogeneous neural networks as expert modules and dynamically selects the feature extraction path through a gating network. For alternative implementations of attention mechanisms, a channel attention module (SE Block) can be used to strengthen key lead features, or a dual-flow attention network can be constructed by combining spatial attention mechanisms. In the alternative of neural differential equations, an LSTM-enhanced liquid network can be selected, which adjusts the neuron state update by introducing a gating mechanism, or a hybrid dynamics model combining neural ODE and stochastic differential equation (SDE) can be used to improve robustness. In terms of feature dimension reduction, in addition to max pooling, dynamic convolution attention pooling (DCAP) technology can be used to dynamically adjust the pooling weight according to the feature importance, or graph neural network (GNN) can be used to model the spatial topological relationship between leads and then perform graph coarsening operation.
[0118] Training optimization module alternatives: In addition to the classification cross-entropy loss function, Focal Loss can be used to alleviate the class imbalance problem, or Dice Loss can be introduced to improve the recall rate of minority class samples. In addition to the Adam optimizer, the LAMB optimizer can be used to adapt to large batch training, or the SWA (stochastic weight averaging) technique can be combined to improve the model generalization ability. In terms of data augmentation, in addition to sliding window and Gaussian noise addition, GAN (Generative Adversarial Network) can be used to synthesize minority class samples, or Mixup / CutMix can be used for sample mixing enhancement. For oversampling techniques, in addition to the SMOTE algorithm, the boundary sample generation strategy of ADASYN can be used, or the lead feature perturbation can be performed by combining the data enhancement technology in the feature space (such as SpecAugment). In terms of validation strategy, in addition to K-fold cross-validation, nested cross-validation can be used for hyperparameter optimization, or the forward extension validation method of time series can be combined to evaluate the model's time series stability.
[0119] Furthermore, the present invention aims to overcome the core challenges of existing heart disease classification technology. By upgrading the entire process from data acquisition, preprocessing, feature extraction, to model training and optimization, it provides a new, efficient, and reliable technical solution for the precise clinical diagnosis of heart disease, filling the technological gap in related fields and propelling automated heart disease diagnosis technology to new heights. This addresses the following issues in the existing technology: First, existing technologies for multi-scale feature extraction mostly employ simple feature splicing or single-scale analysis, failing to deeply explore the hierarchical correlations between macrorhythm changes and microscopic waveform features in cardiac electrical activity. This makes it difficult to fully capture and analyze complex cardiac pathological features, such as the long-cycle rhythm disturbances of atrial fibrillation and the transient waveform abnormalities of premature beats, resulting in a lack of diagnostic information. To address this issue, the present invention proposes constructing a multi-scale feature extraction system using depthwise separable convolutional layers and pooling layers. By carefully designing convolution kernels and pooling windows of different sizes and making them work together, we can grasp the overall trend of cardiac electrical activity, such as heart rate changes and rhythm characteristics, from a macro perspective, and accurately capture subtle changes in local waveforms such as P waves and QRS complexes in micro details, achieving multi-level and comprehensive feature extraction, and effectively solving the technical problem of incomplete information in single-scale feature extraction.
[0120] Second, the static weight allocation attention mechanism adopted by most current models is not flexible enough when processing ECG signals and cannot be adaptively adjusted according to the dynamic changes of signal characteristics under different pathological conditions. This leads to the fact that in practical applications, key diagnostic information, such as subtle deviations of the ST segment during myocardial ischemia, is easily ignored by the model, while noise and interference information are difficult to be effectively suppressed, affecting the accuracy of the diagnosis. The adaptive attention mechanism designed in the present invention generates dynamic attention weights by linearly transforming, activating and flattening the features output by the convolutional layer. These weights can reflect the importance of different feature positions or channels in the input data in real time, strengthen key features, and weaken noise interference, so that the model can dynamically focus on important diagnostic information based on the actual situation of the input data, significantly improving the diagnostic performance of the model.
[0121] Third, although liquid neural networks have unique potential in processing time series signals, they have not been combined with multi-scale feature extraction technology and adaptive attention mechanisms in the field of heart disease diagnosis. This makes it difficult to fully utilize their advantages and meet the urgent need for high-precision and real-time diagnosis of heart disease in clinical practice. The present application innovatively combines liquid neural networks with multi-scale feature extraction and adaptive attention mechanisms. The liquid neural network is used as the core to fully utilize its modeling capabilities for complex time series dynamics of electrocardiogram signals. The multi-scale feature extraction technology is used to deeply mine multi-level information of electrocardiogram signals. The adaptive attention mechanism is used to accurately focus on key features. The three work together to break through the limitations of traditional network architectures and provide a new solution for electrocardiogram signal classification and diagnosis.
[0122] Embodiment Two
[0123] The present embodiment also provides an electrocardiogram classification method that combines multi-scale adaptive attention, as shown in Figure 2 The method comprises the following steps:
[0124] Step 1: Collect electrocardiogram data through a data acquisition module and output a structured data set.
[0125] Step 2: Perform data preprocessing on the structured data set using a data preprocessing module. The data preprocessing module includes a wavelet filter denoising submodule, a baseline correction submodule, and a standardization submodule. After wavelet filter denoising, baseline correction, and standardization processing through the wavelet filter denoising submodule, baseline correction submodule, and standardization submodule, output a standardized signal matrix.
[0126] Step 3: Divide long time series electrocardiogram signals into overlapping segments using a sliding window technique through a window data segmentation module to obtain standardized windowed electrocardiogram signals.
[0127] Step 4: Use the standardized windowed electrocardiogram signals as input through a feature extraction module. Perform multi-scale convolution feature extraction, liquid neural network dynamic modeling, and adaptive attention mechanism reinforcement through a multi-scale feature extraction submodule, a liquid neural network submodule, and an adaptive attention mechanism submodule, respectively. Output the diagnosis results of nine types of heart disease.
[0128] Step 5: Optimize the model's ability to extract and classify electrocardiogram signal features through a training and optimization module.
[0129] The ECG classification method of the embodiment fuses multi-scale adaptive attention, which innovatively combines liquid neural network and multi-scale adaptive attention mechanism. The liquid neural network can accurately capture the complex rules of the change of ECG signals over time due to its unique dynamic memory and adaptive response characteristics. The multi-scale feature extraction technology can analyze ECG signals from multiple time and spatial dimensions to fully mine the subtle features of cardiac electrical activity. The adaptive attention mechanism can intelligently adjust the attention to different features according to the characteristics of the input ECG data, effectively highlight the key ECG features, and suppress noise and interference. Through the organic integration and collaborative work of the three, high-precision automatic ECG classification is successfully realized, which provides strong technical support for accurate diagnosis of heart diseases and fills the gap in the related technical field.
[0130] The various variations and specific examples of the ECG classification system of the foregoing embodiment one also apply to the ECG classification method of the embodiment, and through the foregoing detailed description of the ECG classification system, those skilled in the art can clearly understand the implementation method of the ECG classification method of the embodiment, so as to avoid the description of the embodiment being too long and complicated. Therefore, for the sake of brevity of the description, the implementation method of the ECG classification method of the embodiment will not be described in detail here.
[0131] Embodiment three
[0132] Based on the same inventive concept as the ECG classification system of the foregoing embodiment, the present application also provides an exemplary electronic device, as shown in the accompanying drawings, which comprises a memory 304, a processor 302, and a computer program stored in the memory 304 and executable on the processor 302, wherein the processor 302 implements any step of the foregoing ECG classification system when executing the program. Figure 3
[0133] In the foregoing embodiments, the ECG classification system is described as an example, but the present application is not limited thereto. The ECG classification system can also be applied to other fields, such as the classification of other medical signals, the classification of other time series data, etc. Figure 3 In the exemplary architecture, a bus architecture (represented by bus 300) can include any number of interconnecting buses and bridges needed to link various circuitry comprising one or more processors represented by processor 302, and memory represented by memory 304. Bus 300 can also link various other circuitry, such as, for example, peripheral devices, voltage regulators, and power management circuitry, all of which are well known in the art, and therefore, not further described herein. Bus interface 305 provides an interface between bus 300 and receiver 301 and transmitter 303. Receiver 301 and transmitter 303 can be the same device, i.e., a transceiver, providing a unit for communicating with various other apparatus over a transmission medium. Processor 302 is responsible for managing bus 300 and general processing, while memory 304 can be used for storing data used by processor 302 in executing operations.
[0134] The one or more technical solutions in the embodiments of the present application have at least one or more of the following technical effects:
[0135] The embodiment of the present application provides a kind of electrocardiogram classification system and method of fusion multiscale adaptive attention, pass through data acquisition module, the data acquisition module is used to collect electrocardiogram data, and output structured data set;Data preprocessing module, the data preprocessing module carries out data preprocessing to the structured data set, wherein, the data preprocessing module includes wavelet filter denoising submodule, baseline correction submodule, standardization submodule, and after wavelet filter denoising submodule, baseline correction submodule, standardization submodule are sequentially carried out wavelet filter denoising, baseline correction and standardization processing, output standardization signal matrix;Window data segmentation module, the window data segmentation module uses sliding window technique to divide long time sequence electrocardiogram signal into overlapping segment, obtains the windowed electrocardiogram signal after standardization;Feature extraction module, the feature extraction module takes the windowed electrocardiogram signal after standardization as input, sequentially through multiscale feature extraction submodule, liquid neural network submodule, adaptive attention mechanism submodule carries out three stages of multiscale convolution feature extraction, liquid neural network dynamic modeling, adaptive attention mechanism reinforcement, and outputs the diagnosis result of nine kinds of heart diseases;Training and optimization module, the training and optimization module are used to optimize the extraction and classification ability of model to electrocardiogram signal feature, so as to solve the technical problems that single scale feature extraction in the prior art leads to incomplete information, the attention mechanism of static weight distribution used in most models is not flexible enough when processing electrocardiogram signal, cannot adaptively adjust according to the dynamic change of signal feature under different pathological states, leads to low accuracy of diagnosis, reaches the organic fusion and collaborative work of liquid neural network, multiscale feature extraction technology, multiscale adaptive attention mechanism, realizes the whole process technical upgrading of data acquisition, preprocessing, feature extraction to model training optimization, high-precision electrocardiogram automatic classification, provides strong technical support for accurate diagnosis of heart disease, fills the technical effect of blank in the related technical field.
[0136] Although the preferred embodiments of the present application have been described, those skilled in the art who, once aware of the basic inventive concept, can make additional changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0137] Obviously, those skilled in the art can make various modifications and variations to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application also intends to include these modifications and variations.
Claims
1. An electrocardiogram classification system integrating multi-scale adaptive attention, characterized by: The system comprises: A data acquisition module, which is used to collect ECG data and output a structured data set; A data preprocessing module, wherein the data preprocessing module performs data preprocessing on the structured data set, wherein the data preprocessing module includes a wavelet filtering denoising submodule, a baseline correction submodule, and a normalization submodule, and outputs a standardized signal matrix after performing wavelet filtering denoising, baseline correction, and normalization processing in sequence through the wavelet filtering denoising submodule, the baseline correction submodule, and the normalization submodule; A window data segmentation module, which uses a sliding window technique to segment long time-series ECG signals into overlapping segments to obtain standardized windowed ECG signals; A feature extraction module, which takes the standardized windowed ECG signal as input and sequentially performs multi-scale convolutional feature extraction, liquid neural network dynamic modeling, and adaptive attention mechanism reinforcement through a multi-scale feature extraction submodule, a liquid neural network submodule, and an adaptive attention mechanism submodule, outputting diagnostic results for nine types of heart disease; The training and optimization module is used to optimize the model's ability to extract and classify ECG signal features.
2. The electrocardiogram classification system integrating multi-scale adaptive attention according to claim 1, characterized in that: The wavelet filtering denoising submodule uses a five-layer wavelet decomposition to separate the ECG signal into a low-frequency approximate component A5 reflecting the baseline trend and high-frequency detail components D1-D5 containing noise and mutation characteristics. It applies a threshold λ to filter the high-frequency noise in D1-D3 and adjusts A5 to correct baseline drift. The baseline correction submodule calculates the signal mean and performs a subtraction operation on each sampling point to complete the baseline correction and eliminate the DC offset; The normalization submodule performs normalization processing on the signal, unifying the features of different dimensions to a scale with a mean of 0 and a standard deviation of 1.
3. The electrocardiogram classification system integrating multi-scale adaptive attention according to claim 1, characterized in that: The window data segmentation module sets the window size to 10 seconds and the sliding step size to 5 seconds to segment the long-term signal into overlapping segments.
4. The electrocardiogram classification system integrating multi-scale adaptive attention according to claim 1, characterized in that: The multi-scale feature extraction submodule adopts a three-level progressive architecture design. Assume that the first-level input ECG signal feature map is Where N is the number of samples, C is the number of channels, and L is the length of the time series. The convolution layer achieves multi-scale scanning through convolution kernels of different sizes. Its mathematical expression is: Among them, F out (i, j) is the value of the output feature map at position (i, j), W(m, n) is the convolution kernel weight, b is the bias term, and the first layer uses a convolution kernel of k = 16. Through parallel calculation of 16 consecutive sampling points, it captures the overall waveform shape, RR interval and other medium and long-scale features in the ECG signal, and extracts the macro trend of cardiac electrical activity; The secondary network uses a k=12 convolution kernel to focus on the QRS complex morphological features. Through the convolution operation of 12 consecutive sampling points, the width variation of the QRS complex is obtained. The standard convolution is decomposed into two stages of depthwise convolution and point-by-point convolution through depthwise separable convolution to extract key features. The final network uses k=8 convolution kernels, and by adjusting the convolution kernel weight initialization strategy, it strengthens the response to the 0.5-2Hz low-frequency components and outputs multi-scale feature maps.
5. The electrocardiogram classification system integrating multi-scale adaptive attention according to claim 4, characterized in that: The liquid neural network submodule constructs a dynamic model based on neural differential equations. The neurons in the liquid layer of the liquid neural network submodule interact with each other through dynamic rules described by neural differential equations. When the multi-scale feature map is input, the network solves the differential equations through the improved Euler method to generate a state sequence containing 512-dimensional hidden states. The dynamic modeling process of the liquid neural network submodule includes: in the initial state injection stage, multi-scale features are mapped to the liquid space to form the initial state; in the dynamic evolution stage, historical state dependencies are retained through recursive connection weights, and the neuron state is continuously updated over time. The update of each time step is driven by both the current input and the historical state; and in the feature fusion stage, instantaneous waveform mutations and long-term trend information are integrated.
6. The electrocardiogram classification system integrating multi-scale adaptive attention according to claim 5, characterized in that: The adaptive attention mechanism submodule performs dynamic feature enhancement on the state sequence output by the liquid layer, including linear transformation, activation, flattening and softmax normalization.
7. The electrocardiogram classification system integrating multi-scale adaptive attention according to claim 1, characterized in that: The training and optimization module uses the categorical cross entropy loss function and the Adam optimizer, and implements a multi-dimensional data enhancement strategy.
8. The electrocardiogram classification system integrating multi-scale adaptive attention according to claim 1, characterized in that: The training and optimization module uses K-fold cross-validation to comprehensively evaluate the model performance. The data set is divided into K subsets, and K-1 subsets are selected for training each time. The remaining subset is used as the validation set. The training and validation process is repeated K times to obtain the performance indicators of the model under different data partitioning conditions. During the model training process, the model hyperparameters are tuned through the cross-validation results, and the model structure is adjusted according to the model evaluation results.
9. An electrocardiogram classification method integrating multi-scale adaptive attention, characterized in that The method comprises: Collect ECG data through the data acquisition module and output structured data sets; The data preprocessing module performs data preprocessing on the structured data set, wherein the data preprocessing module includes a wavelet filtering denoising submodule, a baseline correction submodule, and a normalization submodule, and outputs a normalized signal matrix after performing wavelet filtering denoising, baseline correction, and normalization processing in sequence through the wavelet filtering denoising submodule, the baseline correction submodule, and the normalization submodule; The window data segmentation module uses sliding window technology to segment the long time series ECG signal into overlapping segments to obtain the standardized windowed ECG signal. The feature extraction module takes the standardized windowed ECG signal as input and sequentially passes through the multi-scale feature extraction sub-module, the liquid neural network sub-module, and the adaptive attention mechanism sub-module to perform multi-scale convolutional feature extraction, liquid neural network dynamic modeling, and adaptive attention mechanism reinforcement. It outputs the diagnosis results of nine types of heart diseases. The model's ability to extract and classify ECG signal features is optimized through training and optimization modules.
10. An electrocardiogram classification system integrating multi-scale adaptive attention, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the system according to any one of claims 1 to 8 are implemented.
Citation Information
Cited By
ECG arrhythmia classification method based on time-frequency attention enhancement and heterogeneous fusion driving
CN121080994A
Heart valve postoperative wearable sensing equipment feedback data management method
CN121191797A
Method for managing feedback data from wearable sensing devices after heart valve surgery
CN121191797B
Self-adaptive health threshold alarm method for wearable device based on millimeter wave radar
CN121439235A
Exciting transformer fault diagnosis method, system, equipment and medium
CN121561596A