Evaluating the Impact of Windowing Techniques on Fourier Transform-Preprocessed Signals for Deep Learning-Based ECG Classification
Abstract
:1. Introduction
2. Materials and Methods
2.1. Dataset Description
2.2. Signal Preprocessing
2.2.1. Standardization for Signal Normalization
2.2.2. Noise Reduction Using Moving Average Filters
2.3. Feature Extraction and Windowing Techniques
- is the Fourier Transform of ;
- f is the frequency in Hertz;
- t is time;
- j is the imaginary unit.
- N is the total number of samples;
- is the signal value at sample n;
- represents the frequency component at frequency k.
2.3.1. Hann Window
2.3.2. Hamming Window
2.3.3. Blackman Window
2.3.4. Data Balancing Using SMOTE
- For each minority class sample, a set of its k-nearest neighbors is identified.
- A new synthetic sample is generated by randomly selecting one of these neighbors and creating a sample along the line segment connecting the original sample and the neighbor.
2.4. 1D-CNN Model Architecture
- Three convolutional layers with filter sizes of 32, 64, and 64, respectively, and a kernel size of 3. Each convolutional layer is followed by a max pooling layer with a pool size of 2 to reduce the spatial dimensions of the data.
- Flattening layer, which transforms the 1D convoluted data into a flat vector for the fully connected layers.
- Two dense layers: the first dense layer has 64 units, followed by another dense layer with 32 units, both using the ReLU activation function.
- Dropout layer (with a dropout rate of 0.5) is added after the first dense layer to prevent overfitting by randomly deactivating neurons during training.
- The final output layer uses a softmax activation function to predict the probability of each class, with five output units corresponding to the five heartbeat categories.
3. Results
3.1. Effectiveness of FIR Window Functions in Signal Preprocessing
Quantitative Analysis
3.2. Performance of Deep Learning Models on Preprocessed Signals
3.2.1. Confusion Matrix Analysis
3.2.2. Overall Performance
- Precision: the ratio of correctly predicted positive observations to the total predicted positive observations.
- Recall: the ratio of correctly predicted positive observations to all observations in the actual class.
- F1-Score: the harmonic mean of precision and recall, providing a balance between the two.
4. Conclusions
4.1. Window Function Performance
- Hamming Window: Best Overall BalanceThe Hamming window achieved high F1-scores and recall, especially for smaller classes (S and V) in both training and test datasets. This suggests that the Hamming window’s narrow main lobe helped the CNN distinguish subtle ECG features, such as T-wave variations and atrial fibrillation events. It also showed the best generalization performance, with consistent results across training and test sets, indicating that it effectively balances frequency resolution and leakage suppression.
- Hann Window: Consistent General Purpose WindowThe Hann window provided a balanced trade-off between precision and recall for most classes, particularly in identifying normal beats (F-class), while not excelling in any one metric, the Hann window demonstrated stable performance across all classes, making it a practical choice for general ECG analysis tasks where both time and frequency information are critical.
- Blackman Window: Superior Noise Suppression but Limited GeneralizationThe Blackman window, known for its excellent side-lobe suppression, performed well in training but showed lower recall and F1-scores on the test data, particularly for rarer classes like V and Q.
- No Window: Moderate Performance Across MetricsThe absence of a window function resulted in lower F1-scores and recall, particularly for smaller classes (Q and V). This outcome highlights the importance of preconditioning ECG signals with window functions to reduce spectral leakage and enhance classification performance.
4.2. Class-Specific Observations
4.3. Implications
4.4. Limitations and Future Work
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Antzelevitch, C.; Burashnikov, A. Overview of Basic Mechanisms of Cardiac Arrhythmia. Card. Electrophysiol. Clin. 2011, 3, 23–45. [Google Scholar] [CrossRef] [PubMed]
- Bhattacharyya, S.; Munshi, N.V. Development of the Cardiac Conduction System. Cold Spring Harb. Perspect. Biol. 2020, 12, a037408. [Google Scholar] [CrossRef]
- Varalakshmi, P.; Sankaran, A.P. An improved hybrid AI model for prediction of arrhythmia using ECG signals. Biomed. Signal Process. Control 2023, 80. [Google Scholar] [CrossRef]
- Xiao, Q.; Lee, K.; Mokhtar, S.A.; Ismail, I.; bin Md Pauzi, A.L.; Zhang, Q.; Lim, P.Y. Deep Learning-Based ECG Arrhythmia Classification: A Systematic Review. Appl. Sci. 2023, 13, 4964. [Google Scholar] [CrossRef]
- Ahmed, A.A.; Ali, W.; Abdullah, T.A.; Malebary, S.J. Classifying Cardiac Arrhythmia from ECG Signal Using 1D CNN Deep Learning Model. Mathematics 2023, 11, 562. [Google Scholar] [CrossRef]
- Eleyan, A.; Alboghbaish, E. Multi-Classifier Deep Learning Based System for ECG Classification Using Fourier Transform; Institute of Electrical and Electronics Engineers Inc.: Piscataway, NJ, USA, 2023. [Google Scholar] [CrossRef]
- Ullah, H.; Heyat, M.B.B.; Akhtar, F.; Sumbul; Muaad, A.Y.; Islam, M.S.; Abbas, Z.; Pan, T.; Gao, M.; Lin, Y.; et al. An End-to-End Cardiac Arrhythmia Recognition Method with an Effective DenseNet Model on Imbalanced Datasets Using ECG Signal. Comput. Intell. Neurosci. 2022, 2022, 9475162. [Google Scholar] [CrossRef]
- Zhang, H.; Liu, C.; Zhang, Z.; Xing, Y.; Liu, X.; Dong, R.; He, Y.; Xia, L.; Liu, F. Recurrence Plot-Based Approach for Cardiac Arrhythmia Classification Using Inception-ResNet-v2. Front. Physiol. 2021, 12, 648950. [Google Scholar] [CrossRef]
- Yeh, Y.C.; Chiou, C.W.; Lin, H.J. Analyzing ECG for cardiac arrhythmia using cluster analysis. Expert Syst. Appl. 2012, 39, 1000–1010. [Google Scholar] [CrossRef]
- Dhyani, S.; Kumar, A.; Choudhury, S. Analysis of ECG-based arrhythmia detection system using machine learning. MethodsX 2023, 10, 102195. [Google Scholar] [CrossRef]
- Śmigiel, S.; Pałczyński, K.; Ledziński, D. ECG signal classification using deep learning techniques based on the PTB-XL dataset. Entropy 2021, 23, 1121. [Google Scholar] [CrossRef]
- Ansari, Y.; Mourad, O.; Qaraqe, K.; Serpedin, E. Deep learning for ECG Arrhythmia detection and classification: An overview of progress for period 2017–2023. Front. Physiol. 2023, 14, 1246746. [Google Scholar] [CrossRef] [PubMed]
- Aziz, S.; Ahmed, S.; Alouini, M.S. ECG-based machine-learning algorithms for heartbeat classification. Sci. Rep. 2021, 11, 18738. [Google Scholar] [CrossRef]
- Biran, A.; Jeremic, A. ECG Based Human Identification Using Short Time Fourier Transform and Histograms of Fiducial QRS Features; SciTePress: Setúbal, Portugal, 2020; pp. 324–329. [Google Scholar] [CrossRef]
- Kumar, M.A.; Chakrapani, A. Classification of ECG signal using FFT based improved Alexnet classifier. PLoS ONE 2022, 17, e0274225. [Google Scholar] [CrossRef] [PubMed]
- Moody, G.B.; Mark, R.G. MIT-BIH Arrhythmia Database. 1992. Available online: https://physionet.org/content/mitdb/1.0.0/ (accessed on 29 September 2024).
- Yang, M.; Liu, W.; Zhang, H. A robust multiple heartbeats classification with weight-based loss based on convolutional neural network and bidirectional long short-term memory. Front. Physiol. 2022, 13, 982537. [Google Scholar] [CrossRef] [PubMed]
- Bracewell, R.N.; Bracewell, R.N. The Fourier Transform and Its Applications; McGraw-Hill New York: New York, NY, USA, 1986; Volume 31999. [Google Scholar]
- Oppenheim, A.V. Discrete-Time Signal Processing; Pearson Education India: Bengaluru, India, 1999. [Google Scholar]
- Podder, P.; Khan, T.Z.; Khan, M.H.; Rahman, M.M. Comparative Performance Analysis of Hamming, Hanning and Blackman Window. 2014. Available online: https://www.ijcaonline.org/archives/volume96/number18/16891-6927/ (accessed on 29 September 2024).
- Gharaibeh, K. Assessment of various window functions in spectral identification of passive intermodulation. Electronics 2021, 10, 1034. [Google Scholar] [CrossRef]
- Prabhu, K.M. Window Functions and Their Applications in Signal Processing; Taylor & Francis: Abingdon, UK, 2014. [Google Scholar]
- Zhang, M. Multi-resolution short-time Fourier transform providing deep features for 3D CNN to classify rolling bearing fault vibration signals. Eng. Res. Express 2024, 6, 035201. [Google Scholar] [CrossRef]
- Kaur, M.; Kaur, S.P. High Frequency Noise Removal From Electrocardiogram Using Fir Low Pass Filter Bassed On Window Technique. Procedia Technol. 2018, 8, 27–32. [Google Scholar] [CrossRef]
- Berryman, F.; Pynsent, P.; Cubillo, J. The effect of windowing in Fourier transform profilometry applied to noisy images. Opt. Lasers Eng. 2004, 41, 815–825. [Google Scholar] [CrossRef]
- Chawla, N.V.; Bowyer, K.W.; Hall, L.O.; Kegelmeyer, W.P. SMOTE: Synthetic minority over-sampling technique. J. Artif. Intell. Res. 2002, 16, 321–357. [Google Scholar] [CrossRef]
- Kiranyaz, S.; Avci, O.; Abdeljaber, O.; Ince, T.; Gabbouj, M.; Inman, D.J. 1D convolutional neural networks and applications: A survey. Mech. Syst. Signal Process. 2021, 151, 107398. [Google Scholar] [CrossRef]
- Kiranyaz, S.; Ince, T.; Gabbouj, M. Real-Time Patient-Specific ECG Classification by 1-D Convolutional Neural Networks. IEEE Trans. Biomed. Eng. 2016, 63, 664–675. [Google Scholar] [CrossRef] [PubMed]
- Ige, A.O.; Sibiya, M. State-of-the-Art in 1D Convolutional Neural Networks: A Survey. IEEE Access 2024, 12, 144082–144105. [Google Scholar] [CrossRef]
- Czanner, G.; Sarma, S.V.; Ba, D.; Eden, U.T.; Wu, W.; Eskandar, E.; Lim, H.H.; Temereanca, S.; Suzuki, W.A.; Brown, E.N. Measuring the signal-to-noise ratio of a neuron. Proc. Natl. Acad. Sci. USA 2015, 112, 7141–7146. [Google Scholar] [CrossRef] [PubMed]
Parameter | Value |
---|---|
Pooling Type | Max Pooling |
Pooling Size | 2 |
Units in First Dense Layer | 64 |
Units in Second Dense Layer | 32 |
Activation Function | ReLU |
Dropout Rate | 0.5 |
Output Layer Activation | Softmax |
Number of Output Units | 5 |
Optimizer | Adam |
Window Type | Class | Training | Test | |||||||
---|---|---|---|---|---|---|---|---|---|---|
Precision | Recall | F1-Score | Samples | Precision | Recall | F1-Score | Samples | |||
None | F | 0.9784 | 0.9944 | 0.9863 | 51,722 | 0.9761 | 0.9927 | 0.9843 | 34,474 | |
N | 0.9493 | 0.6967 | 0.8036 | 1612 | 0.9192 | 0.7024 | 0.7963 | 1102 | ||
S | 0.9265 | 0.8768 | 0.9010 | 4171 | 0.9098 | 0.8468 | 0.8772 | 2775 | ||
V | 0.8533 | 0.5289 | 0.6531 | 484 | 0.8516 | 0.4952 | 0.6263 | 313 | ||
Q | 1.0000 | 0.0909 | 0.1667 | 11 | 0.0000 | 0.0000 | 0.0000 | 4 | ||
Hamming | F | 0.9855 | 0.9975 | 0.9915 | 51,722 | 0.9822 | 0.9964 | 0.9892 | 34,474 | |
N | 0.9782 | 0.7525 | 0.8506 | 1612 | 0.9599 | 0.7377 | 0.8343 | 1102 | ||
S | 0.9574 | 0.9439 | 0.9506 | 4171 | 0.9476 | 0.9128 | 0.9299 | 2775 | ||
V | 0.9394 | 0.5764 | 0.7145 | 484 | 0.9209 | 0.5208 | 0.6653 | 313 | ||
Q | 1.0000 | 0.1818 | 0.3077 | 11 | 0.0000 | 0.0000 | 0.0000 | 4 | ||
Hann | F | 0.9818 | 0.9975 | 0.9896 | 51,722 | 0.9803 | 0.9966 | 0.9884 | 34,474 | |
N | 0.9559 | 0.7401 | 0.8343 | 1612 | 0.9263 | 0.7296 | 0.8162 | 1102 | ||
S | 0.9617 | 0.9019 | 0.9308 | 4171 | 0.9576 | 0.8865 | 0.9207 | 2775 | ||
V | 0.9338 | 0.5537 | 0.6952 | 484 | 0.9011 | 0.5240 | 0.6626 | 313 | ||
Q | 1.0000 | 0.1818 | 0.3077 | 11 | 0.0000 | 0.0000 | 0.0000 | 4 | ||
Blackman | F | 0.9828 | 0.9973 | 0.9900 | 51,722 | 0.9812 | 0.9964 | 0.9887 | 34,474 | |
N | 0.9424 | 0.7208 | 0.8169 | 1612 | 0.9336 | 0.7142 | 0.8093 | 1102 | ||
S | 0.9578 | 0.9295 | 0.9434 | 4171 | 0.9469 | 0.9128 | 0.9295 | 2775 | ||
V | 0.9829 | 0.4752 | 0.6407 | 484 | 0.9650 | 0.4409 | 0.6053 | 313 | ||
Q | 1.0000 | 0.1818 | 0.3077 | 11 | 0.0000 | 0.0000 | 0.0000 | 4 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Martono, N.P.; Ohwada, H. Evaluating the Impact of Windowing Techniques on Fourier Transform-Preprocessed Signals for Deep Learning-Based ECG Classification. Hearts 2024, 5, 501-515. https://doi.org/10.3390/hearts5040037
Martono NP, Ohwada H. Evaluating the Impact of Windowing Techniques on Fourier Transform-Preprocessed Signals for Deep Learning-Based ECG Classification. Hearts. 2024; 5(4):501-515. https://doi.org/10.3390/hearts5040037
Chicago/Turabian StyleMartono, Niken Prasasti, and Hayato Ohwada. 2024. "Evaluating the Impact of Windowing Techniques on Fourier Transform-Preprocessed Signals for Deep Learning-Based ECG Classification" Hearts 5, no. 4: 501-515. https://doi.org/10.3390/hearts5040037
APA StyleMartono, N. P., & Ohwada, H. (2024). Evaluating the Impact of Windowing Techniques on Fourier Transform-Preprocessed Signals for Deep Learning-Based ECG Classification. Hearts, 5(4), 501-515. https://doi.org/10.3390/hearts5040037