Abstract / Summary
Background: Obstructive sleep apnea (OSA) is a highly prevalent chronic respiratory disorder with important consequences for cardiovascular health and quality of life. Its often non-specific clinical presentation contributes to substantial underdiagnosis, while the logistical, technical, and economic complexity of conventional diagnostic procedures can lead to significant delays in diagnosis. Methods: We propose a convolutional neural network (CNN)-based intelligent system for the automatic detection of OSA events from single-lead electrocardiogram (ECG) signals. Using the PhysioNet Apnea-ECG dataset, each ECG time segment was converted into a two-dimensional time–frequency representation through the Continuous Wavelet Transform (CWT), enabling OSA detection to be formulated as an image-classification problem. Three widely used CNN architectures—AlexNet, ResNet-18, and MobileNetV2—were trained using a transfer learning strategy and subsequently integrated through a soft-voting ensemble. The classification threshold was optimized using the Matthews Correlation Coefficient (MCC). Based on the resulting event classifications, the system estimates the patient’s Apnea–Hypopnea Index and assigns the corresponding OSA severity level. Results: The CNN ensemble achieved an AUC of 0.95, an F1-score of 0.87, a sensitivity of 89.17%, and a specificity of 87.06%. Conclusions: Transforming single-lead ECG signals into time–frequency images and combining general-purpose CNN architectures provides an effective, simple, and reproducible approach for automatic OSA detection. The proposed system has been integrated into a graphical clinical decision support interface, providing a basis for future deployment-oriented developments, although external validation will be required before its application in real-world clinical settings.