Abstract / Summary
Atrial fibrillation (AF) detection from short single-lead electrocardiogram (ECG) recordings is challenging because short windows contain few R-R intervals, making heart rate variability (HRV) descriptors less stable and more sensitive to noise and inter-record variability. Existing HRV-based machine-learning methods often classify all ECG windows using a fixed feature space, which may not adequately represent the distinct rhythm behaviour of AF and Non-AF segments. This paper proposes a Rhythm-Adaptive Subspace k -nearest neighbours (RASK) framework for reliable AF detection from short single-lead ECG recordings. ECG signals are preprocessed, R-peaks are detected, and R-R interval sequences are generated. Conventional HRV features and RR return-map geometry descriptors are extracted and standardized using training-data statistics. A lightweight Bayesian rhythm gate estimates AF and Non-AF posterior probabilities for each ECG window. These probabilities are used to construct a dynamic posterior-conditioned rhythm-adaptive embedding, in which AF-conditioned and Non-AF-conditioned feature representations are adjusted for each window according to its estimated rhythm posterior before classification. The resulting representations are classified using a distance-weighted ensemble subspace k -NN model with AF-aware voting to improve sensitivity under class imbalance. The framework is evaluated using record-grouped five-fold cross-validation on the MIT–BIH Atrial Fibrillation Database with 5-s, 10-s, 20-s, 30-s, and 60-s windows. It achieves up to 99.1% accuracy, 99.6% sensitivity, and 98.4% specificity for 30-s recordings. Multi-database and cross-database evaluations further examine performance under varying acquisition conditions. Results indicate that RASK provides an interpretable, rhythm-aware method with demonstrated classifier-level feasibility for AF monitoring in wearable and remote healthcare applications.