Multi-domain electrocardio intelligent analysis method of mixed Fourier and wavelet convolutional neural network
The multi-domain intelligent ECG analysis method using hybrid Fourier transform and wavelet convolutional neural networks solves the limitations of single-domain representation and task specificity in ECG analysis, achieving multi-task adaptability and robustness improvement. It is applicable to arrhythmia classification, ECG biometrics, and sleep apnea detection, and has high accuracy and cross-scenario adaptability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANTONG UNIV
- Filing Date
- 2025-11-18
- Publication Date
- 2026-05-05
AI Technical Summary
Existing ECG analysis methods suffer from single-domain representation defects, task-specific limitations, and insufficient robustness and generalization, making it difficult to achieve high accuracy, multi-scenario adaptability, and high reliability in multi-task scenarios.
A multi-domain intelligent ECG analysis method using hybrid Fourier and wavelet convolutional neural networks is proposed. It captures morphological features through time domain branching, extracts global spectral patterns through Fourier domain branching, and locates local transient anomalies through wavelet domain branching. It also optimizes the classification head to achieve multi-task adaptation by dynamically weighting and fusing features through attention and combining the characteristics of multi-source datasets.
It achieves complementary fusion of multi-dimensional features, improving the accuracy, robustness and generalization ability of ECG analysis. It can simultaneously adapt to arrhythmia classification, electrocardiogram biometrics and sleep apnea detection, reduce hardware costs, and has high reliability and cross-scenario adaptability.
Smart Images

Figure CN121971101A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of interdisciplinary technology of artificial intelligence and medical health, and in particular to a multi-domain intelligent electrocardiogram analysis method that combines Fourier transform and wavelet convolutional neural networks. Background Technology
[0002] Cardiovascular disease is the leading cause of death worldwide, and sleep apnea, a common sleep disorder, can also induce cardiovascular complications. Early screening and intervention for both are crucial for reducing disability and mortality rates. Meanwhile, electrocardiograms (ECGs), containing individual-specific physiological characteristics, have become a core carrier of highly secure biometric identification. As a non-invasive, low-cost, and real-time technology, ECGs are widely used in clinical arrhythmia diagnosis, sleep apnea detection, and biometric identification scenarios. Especially with the widespread adoption of wearable devices and telemedicine, the demand for high-precision, multi-scenario intelligent analysis of ECG signals has increased dramatically.
[0003] Traditional ECG analysis methods heavily rely on the experience of medical experts or rely on manually designed features, such as RR interval and QRS width, combined with rule-based algorithms for detection. However, these methods have significant limitations: First, ECG signals are inherently weak, susceptible to electromyographic interference, power line noise, and baseline drift. Furthermore, the waveforms vary greatly between individuals and are complex in shape, resulting in poor robustness and weak generalization ability of manual feature extraction, making it difficult to adapt to large-scale automated analysis. Second, these methods can only capture single-dimensional information and cannot take into account the morphological characteristics of ECG signals, global spectral patterns, and local transient abnormalities. Consequently, their accuracy in identifying complex conditions, such as rare arrhythmias and sleep apnea-related signal disturbances, is insufficient.
[0004] In recent years, deep learning technology has provided new directions for ECG analysis. Convolutional Neural Networks (CNNs) excel at extracting local morphological features, Long Short-Term Memory (LSTM) networks can model temporal dependencies, and attention mechanisms can focus on key bands. However, existing methods still suffer from three major bottlenecks: First, the limitation of single-domain representation: most models rely only on a single signal domain. While Fourier transforms can capture global periodicity, they lack temporal localization capabilities; wavelet transforms can identify local time-frequency anomalies but lose global spectral context; and time-domain analysis focuses only on waveform morphology while ignoring frequency-domain information, resulting in an inability to comprehensively characterize the multi-dimensional features of ECG signals. Second, the limitation of task specificity: Existing models are mostly designed for single tasks, such as only achieving arrhythmia classification or single biometrics. They cannot simultaneously adapt to three scenarios: arrhythmia classification, ECG biometrics, and sleep apnea detection. Clinical deployment requires multiple models to run in parallel, resulting in high hardware costs and poor compatibility. Thirdly, they lack robustness and generalization: they have low tolerance for noise and individual differences, and are mostly validated on a single dataset, failing to cover multiple disease types and biometric scenarios. In practical applications, their performance fluctuates greatly, making it difficult to meet the high reliability requirements of clinical and biometric applications.
[0005] How to overcome the limitations of single-domain analysis, achieve multi-task adaptation, and improve the robustness and generalization ability of ECG intelligent analysis has become the technical problem that this invention urgently needs to solve. Summary of the Invention
[0006] The purpose of this invention is to provide a multi-domain intelligent ECG analysis method that combines Fourier transform and wavelet convolutional neural networks. This method can overcome the limitations of single-domain analysis and the bottleneck of single-task adaptation, and simultaneously achieve arrhythmia classification, ECG biometrics, and sleep apnea detection, thereby improving the accuracy, robustness, and generalization ability of ECG analysis in multiple scenarios.
[0007] The core idea of this invention is as follows: This invention proposes an HFW-CNN architecture of "three-branch parallel feature extraction and attention-guided fusion," which addresses the "non-stationary, multi-dimensional, and noise-sensitive" nature of ECG signals and the requirements of multiple tasks. It also incorporates technical solutions designed based on the characteristics of multi-source datasets.
[0008] Preprocessing stage: Bandpass filtering and data augmentation are used to solve the technical problems of high noise in ECG signals and insufficient sample diversity;
[0009] Model architecture: The model captures morphological features through time domain branching, extracts global spectral patterns through Fourier domain branching, and locates local transient anomalies through wavelet domain branching. The three types of features are dynamically weighted and fused through attention to simulate the multi-dimensional interpretation logic of clinical practice.
[0010] Task adaptation: For the MIT-BIH arrhythmia dataset, ECG-ID biometric dataset, and Apnea-ECG (sleep apnea dataset), the classification head design was optimized to achieve "single model, multiple tasks";
[0011] Training optimization: Combining early stopping and regularization strategies to avoid overfitting and ensure stable model performance across different datasets and scenarios.
[0012] This invention is achieved through the following measures: a multi-domain intelligent ECG analysis method using hybrid Fourier and wavelet convolutional neural networks, comprising the following steps:
[0013] 1.1: Preprocessing of multi-source ECG datasets to improve signal quality and feature stability.
[0014] 1.1.1: Dataset Scope: Includes the MIT-BIH arrhythmia dataset (47 subjects, 48 half-hour recordings, sampling rate 360Hz, approximately 22,516 labeled heartbeats), the ECG-ID biometric dataset (90 subjects, 310 records, sampling rate 500Hz, 20 heartbeat segments per subject), and the Apnea-ECG sleep apnea dataset (35 subjects, nighttime recordings, sampling rate 100Hz);
[0015] 1.1.2: Preprocessing operations: Signal optimization is achieved through four steps: wavelet denoising, bandpass filtering, normalization, and data augmentation.
[0016] 1.2: A stratified sampling method is adopted to divide the dataset into training, validation, and test sets.
[0017] 1.2.1: Split ratio: The MIT-BIH arrhythmia dataset and the Apnea-ECG sleep apnea dataset were split into training, validation, and test sets at a ratio of 70%:15%:15% respectively;
[0018] 1.2.2: Special adaptation: The ECG-ID biometric dataset is divided into “15 training segments and 5 test segments per subject” to ensure that the data of the same subject does not cross the training, validation and test sets, and to avoid the leakage of biometric features that leads to inflated performance.
[0019] 1.3: Construct a three-branch HFW-CNN model for different datasets to achieve multi-dimensional feature extraction.
[0020] 1.3.1: Model branch design: Time domain branch extracts morphological features, Fourier domain branch captures the global spectrum, wavelet domain branch locates local transient anomalies, and the branch function is optimized for different datasets;
[0021] 1.3.2: Branch adaptation: The MIT-BIH arrhythmia dataset focuses on the time domain branch, the ECG-ID biometric dataset focuses on the fusion of "Fourier + time domain", and the Apnea-ECG sleep apnea dataset focuses on the wavelet domain branch.
[0022] 1.4: Design an attention-guided feature fusion module to integrate three-branch features.
[0023] 1.4.1: Feature Concatenation: The time-domain branch output feature F time Fourier domain branch output features F Fourier Wavelet domain branch output features are concatenated dimensionally F wavelet , to obtain F concat =[F time ||F Fourier ||F wavelet ];
[0024] 1.4.2: Dynamic weighting: Adaptive weights are calculated through an attention mechanism to highlight key features of the task;
[0025] 1.4.3: Feature Fusion: Generates unified multi-domain fusion features for downstream multi-task classification.
[0026] 1.5: Adaptive optimization strategies are used to train the model, avoiding overfitting and improving generalization ability.
[0027] 1.5.1: Optimizer and Learning Rate: Using the Adam optimizer with an initial learning rate of 0.001, we verified that the learning rate was reduced by a factor of 10 when the loss remained stagnant.
[0028] 1.5.2: Regularization measures: combining He normal initialization, L2 weight decay, and Dropout;
[0029] 1.5.3: Early stopping strategy: Monitor the performance of the validation set and stop training if there is no improvement after several consecutive rounds.
[0030] 1.6: Input the test set data into the trained HFW-CNN, output the multi-task results and visualize them.
[0031] 1.6.1: Output results: Includes abnormal ECG location, arrhythmia type, ECG biometric results, and sleep apnea detection label;
[0032] 1.6.2: Visualization: Key information is presented through the front-end interface to assist clinical judgment and biometric verification.
[0033] Furthermore, step 1.1 specifically includes the following steps:
[0034] 2.1: Wavelet Denoising: Three-level wavelet decomposition was performed on all datasets using the Daubechies wavelet basis to remove high-frequency electromyography interference and baseline drift. An adaptive threshold was set. σ is the noise standard deviation, and N is the signal length;
[0035] 2.2: Bandpass filtering: Butterworth bandpass filter is used with a passband of 0.5-40Hz to eliminate low-frequency baseline drift and 50 or 60Hz power line noise, while preserving the core ECG features of P wave, QRS wave, and T wave;
[0036] 2.3: Normalization: Z-score normalization was used for the MIT-BIH arrhythmia dataset, ECG-ID biometric dataset, and Apnea-ECG sleep apnea dataset. x is the original signal, μ is the signal mean, and σ is the signal standard deviation;
[0037] 2.4: Data Augmentation: The MIT-BIH arrhythmia dataset and ECG-ID biometric dataset are augmented with “synthetic heartbeat perturbation (stretch and compression heartbeat interval ≤10%) + Gaussian noise injection (amplitude 0.01-0.05)”.
[0038] Furthermore, step 1.2 specifically includes the following steps:
[0039] 2.1: Sampling principle: The "subject stratification" strategy is adopted, that is, the subjects are first grouped, and then the corresponding proportion of data is extracted from each group to ensure that the data distribution is consistent with the real clinical population;
[0040] 2.2: Validation Guarantee: The class distribution of each dataset after splitting deviates from that of the original dataset by ≤5%, ensuring fairness in training and testing.
[0041] Furthermore, step 1.3 specifically includes the following steps:
[0042] 3.1: Processing of the MIT-BIH arrhythmia dataset (lead 2):
[0043] 3.1.1: Data cropping: R waves are detected using the Pan-Tompkins algorithm to extract fixed-length segments containing the complete cardiac cycle;
[0044] 3.1.2: Temporal Branch: A 1D-CNN structure is adopted, with convolutional layers of kernel sizes of 7, 5, and 3, corresponding to 64, 128, and 256 filters. Each convolutional layer is followed by a BatchNorm layer and a Dropout layer with a dropout rate of 0.3-0.5 to extract features such as QRS wave morphology and P-wave width.
[0045] 3.2: Processing of ECG-ID biometric dataset (single lead):
[0046] 3.2.1: Fourier domain branch: First, perform a fast Fourier transform on the heartbeat segment to obtain the amplitude spectrum, and then input it into a 1D-CNN with convolution kernel sizes of 5 and 3, and filters of 64 and 128 to capture individual-specific spectral features;
[0047] 3.2.2: Feature Fusion: Fourier domain features are combined with time domain branch features and wavelet domain branch features to enhance the discriminative power of biometrics;
[0048] 3.3: Apnea-ECG Sleep Apnea Dataset Processing (Single Lead):
[0049] 3.3.1: Data Segmentation: The signal was segmented into 60-second non-overlapping epochs, conforming to the clinical sleep apnea scoring criteria.
[0050] 3.3.2: Wavelet Domain Branching: Perform a continuous wavelet transform on each epoch, as shown in the formula. W(a,b) represents the continuous wavelet transform coefficients, t represents the time variable of the original continuous time domain signal, x(t) represents the original continuous time domain signal, a represents the scaling parameter, and b represents the translation parameter. A 2D time-frequency scalogram is generated and input into a 2D-CNN with filters 64 and 128 to locate the pause of the APNEA-related transient signal.
[0051] Furthermore, step 1.4 specifically includes the following steps:
[0052] 4.1: Weight Calculation: For the concatenated feature F concat Perform a linear transformation Z = W a F concat +b a W a For linear transformation matrix, b a The biases are all learnable parameters, and the weights are obtained by normalization using the softmax function, which ensures that the sum of the weights is 1.
[0053] 4.2: Fusion Operation: Press formula F hybrid =α⊙F concat (⊙ represents element-wise multiplication) Fusion features, such as the emphasis on F in arrhythmia tasks. time Biometric identification focuses on F Fourier Sleep apnea detection focuses on F wavelet ;
[0054] 4.3: Post-processing: For F hybrid Execute the BatchNorm operation. μ FBatch mean, σ F The batch standard deviation is ∈ = 1e-5, which improves training stability.
[0055] Furthermore, step 1.5 specifically includes the following steps:
[0056] 5.1: Early stopping trigger condition: After each round of training, calculate the combined index of "accuracy + macro F1-score" on the validation set. When the index does not improve for 15 consecutive rounds, i.e. the improvement is ≤0.1%, training is terminated and the optimal model parameters are retained.
[0057] 5.2: Loss Function Adaptation:
[0058] 5.2.1: Arrhythmia Classification MIT-BIH: The weighted cross-entropy loss function is used to set a 5-fold weight for rare arrhythmia categories (sample size <500) to alleviate class imbalance;
[0059] 5.2.2: ECG-ID: The standard cross-entropy loss function is used because the subject sample distribution is balanced;
[0060] 5.2.3: Apnea-ECG detection: The binary cross-entropy loss function is used, with the formula Loss=-ylog(p)-(1-y)log(1-p), where y is the true label and p is the predicted probability of "apnea";
[0061] 5.3: Training Configuration: Based on the PyTorch 2.0 framework, accelerated by an NVIDIA RTX 4090 GPU (24GB VRAM). The batch size for the arrhythmia and sleep apnea detection tasks is set to 64, and the batch size for the biometrics task is set to 32. The maximum number of training epochs is 100.
[0062] Furthermore, step 1.6 specifically includes the following steps:
[0063] 6.1: Generation of Multi-task Results:
[0064] 6.1.1: Abnormal location: Combine wavelet domain branch feature map to output the time coordinates of abnormal heartbeats. With the R wave as the reference, the location error is ≤10ms. The format is "abnormal at XX ms after R wave", such as "ST segment depression at 80ms after R wave".
[0065] 6.1.2: Classification results: Arrhythmia output 5 categories: normal sinus rhythm (N), ventricular premature beats (V), supraventricular premature beats (S), fusion wave (F or O), rare arrhythmia; Biometrics output 90 categories, corresponding to subjects in the ECG-ID biometric dataset; Sleep apnea output "apnea" and "normal" binary classification.
[0066] 6.2: Backend data processing: Receives 12-lead ECG signals uploaded from the frontend and automatically matches the corresponding branch model, such as the second lead data input time domain branch and the full lead data input fusion branch;
[0067] 6.3: Front-end visualization: The ECG waveform, diagnostic labels, biometric matching score, and prediction confidence score are displayed using ECharts tools to ensure that the results are intuitive and easy to interpret.
[0068] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0069] 1. This invention overcomes the limitations of single-domain analysis by employing a three-branch parallel architecture of "time domain - Fourier domain - wavelet domain," achieving complementary fusion of multi-dimensional features. The time domain 1D-CNN captures P, QRS, and T wave morphologies; the Fourier domain FFT extracts the global spectrum, such as heart rate variability; and the wavelet domain CWT locates local transient abnormalities, such as premature ventricular contractions and apseudo-ventricular pauses. After dynamic attention-based weighting of these three types of features, the formula α = softmax(W a F concat +b a ), F fusion =α⊙F concat This architecture can comprehensively characterize the non-stationary characteristics of ECG signals. Experiments show that the architecture achieves an accuracy of 98.0% and a weighted F1-score of 0.98 on the MIT-BIH arrhythmia classification task, which is significantly better than single-domain wavelet-CNN and traditional CNN-LSTM, and can simultaneously cover three key types of information: morphology, spectrum, and transient.
[0070] 2. This invention achieves "single-model multi-task adaptation," eliminating the need for parallel deployment of multiple models and significantly reducing hardware costs in clinical and biometric scenarios. For three core tasks—MIT-BIH (arrhythmia), ECG-ID (electrocardiographic biometrics), and Apnea-ECG (sleep apnea detection)—adaptation is achieved simply by optimizing branch weights and classification head design: On the ECG-ID dataset, biometric accuracy reaches 97.1% with an F1-score of 0.97, and the minimum subject recognition accuracy is ≥90%; on the Apnea-ECG dataset, sleep apnea detection accuracy is 95.0% with an ROC-AUC of 0.98, sensitivity is 94.0%, and specificity is 95.6%, adapting to the "one-stop" analysis needs of telemedicine.
[0071] 3. This invention possesses high robustness and cross-scenario generalization ability, capable of handling ECG signal noise interference and individual differences. The preprocessing stage employs 0.5-40Hz bandpass filtering, combined with data augmentation using "synthetic heartbeat perturbation + Gaussian noise injection"; the training stage utilizes He normal initialization, L2 weight decay, and Dropout to suppress overfitting. Experiments show that adding EMG noise reduces model accuracy by ≤3%, significantly outperforming single-domain models; it maintains stable performance on the MIT-BIH arrhythmia dataset, ECG-ID biometric dataset, and Apnea-ECG sleep apnea dataset, demonstrating a 15% improvement in generalization ability compared to existing methods.
[0072] 4. This invention effectively solves the "class imbalance" problem in ECG data, improving minority class recognition performance and training efficiency. For the rare arrhythmia MIT-BIH, data augmentation using "synthetic heartbeat perturbation + Gaussian noise injection" and weighted cross-entropy loss achieves a macro F1-score of 0.65 for MIT-BIH rare arrhythmias, avoiding the model's bias towards the majority class. Simultaneously, the three-branch architecture focuses on core features—time-domain morphology, Fourier-domain spectrum, and wavelet-domain transients—reducing redundant information interference and improving training efficiency.
[0073] 5. This invention balances clinical applicability with engineering feasibility, adapting to wearable devices and clinical auxiliary diagnostic scenarios. On one hand, the attention mechanism highlights key features, such as QRS waves in arrhythmia tasks and low-frequency patterns in apsnea detection, outputting classification results including arrhythmia category, biometric ID, apsnea and normal labels, and prediction confidence, meeting clinical diagnostic reference requirements and improving model interpretability and clinical trust. On the other hand, implemented based on the PyTorch 2.0 framework, it can be efficiently trained and inferred under NVIDIA RTX 4090 GPU acceleration, adapting to real-time analysis on wearable devices. The front end supports ECG waveform visualization, diagnostic label and biometric matching degree display, and users can upload files to complete the entire analysis process, demonstrating strong engineering feasibility. Attached Figure Description
[0074] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0075] Figure 1 This is a schematic diagram of the Hybrid Fourier-Wavelet Convolutional Neural Network (HFW-CNN) architecture used in this invention.
[0076] Figure 2 This is a performance comparison chart of the present invention and existing methods on the MIT-BIH arrhythmia dataset. Detailed Implementation
[0077] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. Of course, the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0078] Example 1
[0079] (1) See Figure 1 As shown, this embodiment provides a multi-domain intelligent ECG analysis method that combines Fourier transform and wavelet convolutional neural networks, including the following:
[0080] (1-1): Preprocessing of multi-source ECG datasets to improve signal quality and feature stability: covering the MIT-BIH arrhythmia dataset (47 subjects, 48 half-hour recordings, sampling rate 360Hz, approximately 22,516 labeled heartbeats), the ECG-ID biometric dataset (90 subjects, 310 recordings, sampling rate 500Hz, 20 heartbeat segments per subject), and the Apnea-ECG sleep apnea dataset (35 subjects, nighttime recordings, sampling rate 100Hz).
[0081] (1-2): A stratified sampling method was adopted to divide the training set, validation set and test set: the MIT-BIH arrhythmia dataset and the Apnea-ECG sleep apnea dataset were divided according to the ratio of 70% training set: 15% validation set: 15% test set; the ECG-ID biometric dataset was divided according to 15 training segments and 5 test segments per subject to ensure that the data of the same subject does not cross the training, validation and test sets.
[0082] (1-3): Construct HFW-CNN three-branch models for different datasets and extract multi-dimensional features: capture morphological features through the time domain branch, extract the global spectrum through the Fourier domain branch, and locate local transient anomalies through the wavelet domain branch. Optimize the branch functions for different datasets.
[0083] (1-4): Design an attention-guided feature fusion module to integrate three-branch features: splicing time-domain F time Fourier domain F Fourier , wavelet domain F wavelet Features are used to calculate adaptive weights through an attention mechanism to highlight key features of the task.
[0084] (1-5): Adaptive optimization strategies are used to train the model to avoid overfitting and improve generalization ability: the model training process is optimized by combining early stopping, regularization and dynamic learning rate strategies.
[0085] (1-6): Input the test set data into the trained HFW-CNN, output multi-task results and visualize them: arrhythmia category, biometrics and matching confidence, sleep apnea detection, and display them through the front-end interface.
[0086] Furthermore, step (1-1) specifically includes the following steps:
[0087] (2-1): Bandpass filtering: Butterworth bandpass filter is used with a passband of 0.5-40Hz to eliminate low-frequency baseline drift and 50 or 60Hz power line noise, while preserving core ECG features such as P wave, QRS wave, and T wave.
[0088] (2-2): Normalization: Z-score normalization was used for the MIT-BIH arrhythmia dataset, ECG-ID biometric dataset, and Apnea-ECG sleep apnea dataset. x is the original signal, μ is the signal mean, and σ is the signal standard deviation;
[0089] (2-3): Data augmentation: The MIT-BIH arrhythmia dataset and the ECG-ID biometric dataset were augmented with synthetic heartbeat perturbations (stretch and compression time intervals ≤10%) and Gaussian noise injection (amplitude 0.01-0.05).
[0090] Furthermore, step (1-2) specifically includes the following steps:
[0091] (3-1): Sampling principle: The “subject stratification” strategy is adopted. First, the subjects are grouped, and then the corresponding proportion of data is extracted from each group to ensure that the data distribution is consistent with the real clinical population.
[0092] (3-2): Validation guarantee: The class distribution of each dataset after splitting deviates from that of the original dataset by ≤5%, ensuring the fairness of training and testing.
[0093] Furthermore, steps (1-3) specifically include the following steps:
[0094] (4-1): Processing of the MIT-BIH arrhythmia dataset (lead 2): Data cropping: R waves were detected using the Pan-Tompkins algorithm, and fixed-length segments containing R waves and the complete cardiac cycle were extracted to ensure coverage of P waves, QRS waves, and T waves; Temporal branching: A 1D-CNN structure was adopted, with convolutional layers of kernel sizes of 7, 5, and 3, corresponding to 64, 128, and 256 filters, respectively. Each convolutional layer was followed by a BatchNorm layer and a Dropout layer with a dropout rate of 0.3-0.5, and features such as QRS wave morphology and P wave width were extracted;
[0095] (4-2): ECG-ID biometric dataset (single lead) processing: Fourier domain branch: First, perform a fast Fourier transform on the heartbeat segment, formula X[K] is the result of the discrete Fourier transform, where K and k are both frequency indexes, x[n] is the original time-domain discrete sampling sequence, j is the imaginary unit, and N is the signal length. After obtaining the amplitude spectrum, the formula... Input a 1D-CNN with kernel sizes of 5 and 3, and filters of 64 and 128 to capture individual-specific spectral features;
[0096] Feature fusion: Fourier domain features are concatenated with time domain branch features and wavelet domain branch features according to their dimensions to form F. concat =[F t ||F f ||F w The adaptive weights α = softmax(W) are calculated using an attention mechanism. a F concat +b a Press F fusion =α⊙F concat Integration enhances the distinguishability of biometrics;
[0097] (4-3): Apnea-ECG sleep apnea dataset (single lead) processing: Data segmentation: The signal is segmented into 60-second non-overlapping epochs, conforming to the clinical sleep apnea scoring criteria; Wavelet domain branching: Continuous wavelet transform formula is applied to each epoch. Generate a 2D time-frequency scalogram, input it into a 2D-CNN, with a 3×3 kernel size and 64 and 128 filters, and locate the paused APNEA-related transient signals.
[0098] Furthermore, steps (1-4) specifically include the following steps:
[0099] (5-1): Weight calculation: For the concatenated feature F concat =[F Fourier ||F Fourier ||F wavelet Perform a linear transformation, Z = W a F concat +b a W a For linear transformation matrix, b a The biases are all learnable parameters, and the weights α = softmax(Z) are obtained by normalization using the softmax function.
[0100] (5-2): Fusion operation: Press formula F hybrid =α⊙F concatBy fusing features, the model automatically learns the weights of key features for the task through training. For example, the weight of QRS morphological features is increased in the arrhythmia task, and the weight of transient features is increased in the Apnea detection, without the need for manual preset of branch emphasis.
[0101] (5-3): Post-processing: For F hybrid Execute the BatchNorm operation. μ F Batch mean, σ F For batch standard deviation, ∈ = 1e-5, scaling and translation. γ and β are learnable parameters. This operation improves training stability and avoids feature distribution shift.
[0102] Furthermore, steps (1-5) specifically include the following steps:
[0103] (6-1): Optimizer and learning rate: Using the Adam optimizer with an initial learning rate of 0.001, we verified that the learning rate was reduced by a factor of 10 when the loss remained stagnant.
[0104] (6-2): Regularization measures: combining He normal initialization, L2 weight decay, and Dropout;
[0105] (6-3): Early arrest triggering condition: The model automatically learns the weights of key features of the task through training (such as the increased weight of QRS morphological features in the arrhythmia task and the increased weight of transient features in the aponeurosis detection), without the need for manual preset of branch emphasis;
[0106] (6-4): Loss function adaptation: Arrhythmia classification MIT-BIH: uses a weighted cross-entropy loss function, assigning higher weights to rare arrhythmia categories; ECG-ID: uses a standard cross-entropy loss function; Apnea-ECG: uses a binary cross-entropy loss function, with the formula Loss=-ylog(p)-(1-y)log(1-p), where y is the true label and p is the predicted probability of "apnea".
[0107] Furthermore, steps (1-6) specifically include the following steps:
[0108] (7-1): Generation of multi-task results:
[0109] Classification results: Arrhythmia output 5 categories: normal sinus rhythm (N), ventricular premature beats (V), supraventricular premature beats (S), fusion waves (F or O), rare arrhythmias; Biometrics output 90 categories, corresponding to ECG-ID subjects; Sleep apnea outputs "apnea" and "normal" binary categories.
[0110] (7-2): Backend data processing: Receive the single-lead ECG signal uploaded from the frontend, input it into the HFW-CNN three-branch parallel model, and simultaneously perform feature extraction and attention fusion on the single-lead signal in the time domain, Fourier domain, and wavelet domain.
[0111] (7-3): Front-end visualization: Visualization tools are used to display ECG waveforms, diagnostic labels, biometric matching degree and prediction confidence, ensuring that the results are intuitive and interpretable.
[0112] See Figure 2 As shown in the figure, this embodiment provides a schematic diagram of the HFW-CNN architecture, which intuitively demonstrates the core process of parallel feature extraction, attention fusion, and multi-task output through three branches: the time domain branch extracts the electrocardiogram morphology, the Fourier domain branch captures the global spectrum, and the wavelet domain branch locates the local transients. After dynamic weighting by the attention fusion module, the data is input into the multi-task classification head to achieve task outputs such as arrhythmia, biometrics, and sleep apnea.
[0113] (8): Performance comparison on the MIT-BIH arrhythmia dataset: On the MIT-BIH dataset, the performance of the method in this embodiment is compared with existing models. The four indicators of accuracy, precision, recall and F1-score are used for evaluation. The results are shown in Table 1:
[0114] Table 1. Comparison of results between the method of this embodiment and the control method on the MIT-BIH dataset.
[0115]
[0116] (9) On the ECG-ID dataset, the performance of the method (HFW-CNN) in this embodiment is compared with that of existing single-domain methods. The results are shown in Table 2:
[0117] Table 2 Comparison of results between the method of this embodiment and the control method on the ECG-ID dataset.
[0118]
[0119] Experimental results demonstrate that the multi-domain ECG intelligent analysis method based on the parallel fusion of the "time domain-Fourier domain-wavelet domain" proposed in this embodiment improves upon existing single-domain / dual-domain benchmark methods in several performance metrics of multi-source single-lead datasets: the MIT-BIH arrhythmia classification accuracy reaches 98.0%, which is 0.8% higher than single-domain wavelet-CNN (97.2%) and 1.2% higher than traditional CNN-LSTM (96.8%); the ECG-ID biometric recognition accuracy reaches 97.1%, which is significantly improved compared to existing single-domain methods. This showcases the advantages of the multi-domain feature complementary fusion architecture in single-lead ECG intelligent analysis and has application potential in clinical diagnosis and biometric recognition scenarios.
[0120] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0121] Example 2
[0122] The proposed method and existing sleep apnea detection methods were evaluated on the Apnea-ECG noisy dataset using five performance metrics: Accuracy, Macro Precision, Macro Recall, Macro F1, and Weighted F1. The robustness of the model under different noise intensities (0.05, 0.10, and 0.15 amplitude noise) was also examined.
[0123] Table 3 Comparison of results between the method of this invention and other methods under 0.10 amplitude noise.
[0124]
[0125] Experiments show that the multi-domain noise-resistant fusion network (HFW-CNN) proposed in this embodiment can achieve more reliable sleep apnea detection in noisy scenarios through multi-dimensional feature complementarity in the time domain, wavelet domain, and Fourier domain and noise adaptive filtering mechanism. Specifically, the method in this embodiment utilizes a framework of "multi-domain noise filtering + feature-enhanced attention + robust classifier" to combat common clinical noises such as electromyography (EMG), power frequency, and baseline drift. Taking a 0.10 amplitude noise scenario as an example, for Acc, the method in this embodiment improves performance by 6.74% compared to the best traditional method (Transformer, 85.31%); for Macro Prec, the method in this embodiment improves performance by 38.10% compared to the best traditional method (Transformer, 55.28%); for Macro Rec, the method in this embodiment improves performance by 31.57% compared to the best traditional method (Transformer, 62.47%); for Macro F1 score, the method in this embodiment improves performance by 34.90% compared to the best traditional method (Transformer, 58.69%); and for Weighted F1, the method in this embodiment improves performance by 7.02% compared to the best traditional method (Transformer, 82.15%). These results demonstrate the practicality and competitiveness of the proposed method in noisy clinical scenarios.
Claims
1. A multi-domain intelligent ECG analysis method using hybrid Fourier and wavelet convolutional neural networks, characterized in that, Includes the following steps: S1: Collect and preprocess multi-source ECG datasets: The datasets include the arrhythmia dataset MIT-BIH, the biometric dataset ECG-ID, and the sleep apnea dataset Apnea-ECG; S2: Dataset partitioning: The MIT-BIH arrhythmia dataset and the Apnea-ECG sleep apnea dataset are divided into training, validation, and test sets at 70%:15%:15% respectively; the ECG-ID biometric dataset is divided into 15 training and 5 test segments per subject, and data from the same subject does not cross between the training, validation, and test sets. S3: Construct the HFW-CNN three-branch model, including the time domain branch, the Fourier domain branch, and the wavelet domain branch; S4: Attention-guided feature fusion; S5: Configure multi-task classification header; S6: Training the model: The Adam optimizer demonstrates that the learning rate decreases by a factor of 10 when the loss stalls. Early stop: If the performance verification shows no improvement for 15 consecutive rounds, the process is terminated, and the optimal parameters are retained; Regularization measures: Combining He normal initialization, L2 weight decay, and Dropout to suppress overfitting; Implementation configuration: Based on the PyTorch 2.0 framework, using an NVIDIA RTX 4090 GPU to accelerate training and inference; S7: Output multi-task results: Output arrhythmia category and confidence level, biometric subject ID and matching degree, sleep apnea detection label and probability, and support front-end visualization display.
2. The multi-domain intelligent ECG analysis method based on hybrid Fourier and wavelet convolutional neural networks according to claim 1, characterized in that, The S1 preprocessing also includes the following steps: S11: Apnea-ECG Dataset Processing: Data was parsed and formatted, hierarchical filtering was performed for noise reduction and correction, associated signals were identified and labeled, unqualified segments were removed for quality control, and after sample balancing, the data was divided into 70%:15%:15% sets, with segments from the same nighttime not crossing sets, to provide reliable data for subsequent training. S12: Segmented into 60-second non-overlapping epochs: Based on a 100Hz sampling rate, each 60 seconds corresponds to 6000 sampling points; starting from the beginning of the nighttime recording, continuous transcriptions are taken along the time axis without overlap; each epoch is precisely aligned with minute-level respiratory event annotations; fragments of less than 60 seconds at the end are directly removed to ensure the integrity of each epoch signal and adapt to the feature extraction requirements of subsequent sleep apnea detection; S13: Labeling "apnea" and "normal": First, extract the expert annotation files accompanying the Apnea-ECG dataset, which contain minute-level respiratory event labels, and filter out the valid "apnea" and "normal" annotations, removing "missing annotations" and "invalid" items; then, precisely align each minute annotation with the corresponding 60-second non-overlapping epoch according to the time axis, binding one annotation to one epoch; finally, convert the annotations to the model adaptation format, A = "apnea" and N = "normal", ensuring that the annotations correspond one-to-one with the signal segments, meeting the clinical diagnostic criteria for sleep apnea.
3. The multi-domain intelligent ECG analysis method based on hybrid Fourier and wavelet convolutional neural networks according to claim 1, characterized in that, S3 further includes the following steps: S31: Fourier domain branch: Calculating the amplitude spectrum For the real part, It is the imaginary part; S32: Amplitude spectrum input to 1D-CNN, pre-determining global spectral features; S33: Wavelet domain branch: Perform continuous wavelet transform (CWT) on each epoch to generate a 2D time-frequency wavelet scaling graph S(a,b)=|W x (a,b)| 2 W x (a,b) represents the CWT result, W x (a,b) are the coefficients of the continuous wavelet transform, where a is the scaling factor and b is the translation factor; the scalogram is input into a 2D-CNN to extract local transient anomaly features.
4. The multi-domain intelligent ECG analysis method based on hybrid Fourier and wavelet convolutional neural networks according to claim 1, characterized in that, S4 further includes the following steps: S41: For splicing feature F concat =[F time ||F Fourier ||F wavelet Perform a linear transformation Z = W a F concat +b a F time For time-domain features, F Fourier For Fourier domain features, F wavelet For wavelet domain features, W a The weight matrix is a learnable matrix with dimension d. concat ×d concat d concat For F concat Feature dimensions; S42: The dimension of attention weight α = softmax(Z) and F concat Consistent; S43: Batch Normalization of Fusion Features: Normalization of Fusion Features F fusion =α⊙F concat The steps to perform the BatchNorm operation are as follows: Let μ be the normalized feature tensor, ∈ = 1e-5. F Let σ be the batch mean and σ be the batch standard deviation. Then, through... Complete scaling and translation, F bn The features are the final output of BatchNorm, and γ and β are learnable parameters.
5. The multi-domain intelligent ECG analysis method based on hybrid Fourier and wavelet convolutional neural networks according to claim 1, characterized in that, S6 further includes the following steps: S61: Loss Functions: Arrhythmia Classification MIT-BIH: Weights are assigned based on the inverse of the percentage of samples in each category. The lower the percentage of a category, the higher the weight. Biometric ECG-ID uses the ordinary cross-entropy loss function. Sleep Apnea-ECG Detection: Uses the binary cross-entropy loss function: The formula is Loss = -ylog(p) - (1-y)log(1-p), where y is the true label and p is the predicted probability of "apnea". S62: Monitoring strategy: After each round of training, calculate the core performance metrics of the validation set: weighted F1-score for arrhythmia and ROC-AUC for Apnea detection. When the metrics do not improve for 15 consecutive rounds, terminate training and save the model parameters with the best overall metrics.
6. The multi-domain intelligent ECG analysis method based on hybrid Fourier and wavelet convolutional neural networks according to claim 1, characterized in that, S7 further includes the following steps: S71: Performance: Arrhythmia accuracy ≥98.0%, F1 ≥0.65; Biometric accuracy ≥97.1%, F1 ≥0.97; Apnea detection accuracy ≥95.0%, AUC ≥0.98; S72: Visualization: The front end displays waveform graphs, and associates classification results with annotations of key cardiac epoch segments, diagnostic labels, biometric matching degrees, and auxiliary result interpretation.
7. The multi-domain intelligent ECG analysis method based on hybrid Fourier and wavelet convolutional neural networks according to claim 1, characterized in that, In S3, constructing the HFW-CNN three-branch model includes: Temporal branch: 1D-CNN is used with convolutional kernel sizes of 7, 5, and 3, and the number of filters are 64, 128, and 256 respectively. It includes BatchNorm and Dropout with a dropout rate of 0.3-0.5, and is used to extract morphological features of P wave, QRS wave, and T wave. Fourier domain branch: First, perform a fast Fourier transform on the signal to obtain the frequency domain spectrum, and then connect it to a 1D-CNN with convolution kernel sizes of 5 and 3, and the number of filters of 64 and 128, in order to capture global spectral features. Wavelet domain branch: Perform continuous wavelet transform on each epoch, input the resulting scalogram into 2D-CNN, with 64 and 128 filters, to locate ventricular premature beats and local transient abnormalities related to apsnea.
8. The multi-domain intelligent ECG analysis method based on hybrid Fourier and wavelet convolutional neural networks according to claim 1, characterized in that, The attention-guided feature fusion of S4 specifically involves: first concatenating time-domain features, Fourier-domain features, and wavelet-domain features; The weights are then calculated using learnable parameters, activated by softmax, and fused with the concatenated features through element-wise multiplication. After fusion, the BatchNorm operation is performed to normalize the mean and variance of the fused features, and learnable scaling and translation parameters are introduced to obtain the final fused features.
9. The multi-domain intelligent ECG analysis method based on hybrid Fourier and wavelet convolutional neural networks according to claim 1, characterized in that, The S5 configuration multi-task classification head includes: Arrhythmia Classification MIT-BIH: using the Softmax classification head, outputting 5 types of labels: normal sinus rhythm N, ventricular premature beats V, supraventricular premature beats S, fusion wave F or O, rare arrhythmias and corresponding prediction confidence; Biometric ECG-ID: Employs a Softmax classification head to output 90 categories of subject IDs and matching confidence scores; Apnea-ECG sleep apnea detection: uses a sigmoid classification head to output binary labels "apnea" and "normal" and predicted probabilities.