Atrial fibrillation (AF) is a life-threatening heart condition, and its early detection and treatment have garnered significant attention from physicians in recent years. Traditional methods of detecting AF heavily rely on doctor’s diagnosis based on electrocardiograms (ECGs), but prolonged analysis of ECG signals is very time-consuming. This paper designs an AF detection model based on the Inception module, constructing multi-branch detection channels to process raw ECG signals, gradient signals, and frequency signals during AF. The model efficiently extracted QRS complex and RR interval features using gradient signals, extracted P-wave and f-wave features using frequency signals, and used raw signals to supplement missing information. The multi-scale convolutional kernels in the Inception module provided various receptive fields and performed comprehensive analysis of the multi-branch results, enabling early AF detection. Compared to current machine learning algorithms that use only RR interval and heart rate variability features, the proposed algorithm additionally employed frequency features, making fuller use of the information within the signals. For deep learning methods using raw and frequency signals, this paper introduced an enhanced method for the QRS complex, allowing the network to extract features more effectively. By using a multi-branch input mode, the model comprehensively considered irregular RR intervals and P-wave and f-wave features in AF. Testing on the MIT-BIH AF database showed that the inter-patient detection accuracy was 96.89%, sensitivity was 97.72%, and specificity was 95.88%. The proposed model demonstrates excellent performance and can achieve automatic AF detection.
Aiming at the deficiencies of insufficient cross-domain generalization and poor rhythm sensitivity in atrial fibrillation (AF) detection from multi-lead electrocardiogram (ECG) signals, this paper proposes a novel AF detection algorithm based on multi-scale patch attention fusion. The method segmented ECG signals into overlapping temporal fragments of different scales to capture local waveform details and long-range rhythm patterns respectively; it fused cross-scale feature information through a multi-scale attention mechanism to strengthen the model’s ability to perceive local and global rhythm features, and introduced the self-attention mechanism of Transformer to capture long-range rhythm correlations among fragments, thus realizing in-depth mining of ECG features. The algorithm was validated on the public CinC2021 dataset and the self-constructed clinical Clin-ECG dataset. Experimental results showed that the algorithm achieved an accuracy of 94.6% and 92.7% on the two datasets, with F1 scores reaching 0.945 and 0.923, respectively. Compared with baseline models such as ECG-ResNet and CNN-BiLSTM, the proposed algorithm exhibited higher accuracy and better cross-dataset generalization ability, providing an effective method for the automatic detection of AF from multi-lead ECG signals.