Attention in Fetal Peak R Detection and FECG Reconstruction

Gustavo Raspante Faria1, Vinicius Carvalho Rispoli2, Gilmar Silva Beserra3
1University of Brasi­lia, 2University of Brasília, 3University of Brasilia


Abstract

Introduction: The study aims to evaluate machine learning models for fetal ECG (fECG) reconstruction and R-peak detection from abdominal ECG (aECG) signals, focusing on the impact of input channel quantity on model accuracy. The dataset used is the Abdominal and Direct Fetal ECG Database from PhysioNet, consisting of five sets of five-minute signals from different pregnant women, each with four aECG channels and one direct fECG channel.

Methods: The preprocessing pipeline involved filtering, downsampling, and segmenting signals into 1-second windows. To evaluate fetal R-peak detection, metrics such as Accuracy, F1-score, Positive Predictive Value, and Sensitivity were used. For fECG reconstruction, Mean Squared Error and Mean Absolute Error were considered. Three models were developed: Model I, a CNN-based AutoEncoder with 128 LSTM units and a self-attention module; Model II, a CNN-based AutoEncoder with 128 LSTM units and Bahdanau Attention; and Model III, a Transformer encoder with a CNN-based decoder.

Results: Using all four aECG input channels, Model I achieved an F1-score of 93.39%, Model II 96.71%, and Model III 96.06%. Model III had the lowest error rates (MSE: 0.0181, MAE: 0.0960). With a single aECG input channel, Model I's F1-score dropped to 88.86%, Model II to 90.04%, and Model III to 92.84%, with Model III again showing the lowest error rates. These results indicate that using four aECG channels enhances fetal R-peak detection accuracy.

Conclusion: Model I showed a significant performance drop with a single channel but excelled in signal reconstruction. Model II, despite the highest F1-score with all channels, struggled with reduced input. Model III consistently performed well in both reconstruction and detection tasks across input configurations, making it the most robust and comprehensive solution. This suggests that Model III is better suited for fECG reconstruction and fetal R-peak detection, regardless of input channel quantity.