New tool fuses expert knowledge and deep learning features to detect sleep apnea

New tool fuses expert knowledge and deep learning features to detect sleep apnea
This is a depiction of a Sleep Apnea patient using a Continuous Positive Airway Pressure (CPAP) machine while sleeping. Credit: CC BY-SA 4.0

Individuals who suspect they have sleep apnea—and the doctors who diagnose them—could soon have more effective way to automatically detect the condition at home, thanks to a new method developed by researchers at the Penn State College of Information Sciences and Technology.

The new tool, which according to the researchers outperforms all existing baseline methods, combines deep learning technology with expert knowledge. It automatically learns patterns from electrocardiograph (ECG) data collected by at-home devices, making it a faster and more ideal solution than other diagnostics.

"The current standard approach to detect sleep apnea is for a patient to stay in a hospital overnight to record a polysomnography (sleep study) under the supervision of a clinical practitioner," said Guanjie Huang, doctoral candidate of information sciences and technology and lead author on the paper. "The process is time-consuming, tedious, intrusive and belated."

Huang explained that after a patient's data is collected through a sleep study, which measures brain waves, blood oxygen levels, heart rate, respiration and body movements, clinicians then need to devote further time and resources to analyze it.

"It is essential to design an to automatically analyze the data and help doctors detect sleep apnea quickly," said Huang.

Other tools to automatically detect sleep apnea through at-home devices exist using computer models built either through traditional machine learning methods, which rely on knowledge from human experts to design hand-creafted features that can identify sleep apnea conditions in a data set, or through deep learning methods, which eliminate the need for such experts due to immense amounts of data. But, according to Huang, there are limitations to these standalone approaches.

"The traditional machine learning method usually only needs a small amount of data to learn a robust classifier, but it requires a careful feature extraction and selection process," Huang explained. "The deep learning method usually achieves better performance but requires a large dataset."

Huang's model, called ConCAD (Contrastive Learning-based Cross Attention for Sleep Apnea Detection), simultaneously leverages the features of deep learning and traditional machine learning's expert knowledge to better detect sleep apnea. The model specifically draws on expert knowledge of RR interval and R peak envelope—existing methods for detecting sleep apnea by measuring the intervals between and peak of the R wave, which measure cardiac rhythm in a patient's ventricular walls, in a standard ECG. ConCAD utilizes a cross-attention mechanism—a deep learning module that assigns weights to parts of each based on their importance—to fuse the deep learning features with the expert knowledge features, emphasizing the useful ones and ignoring irrelevant ones automatically.

ConCAD works by first passing original raw ECG data through feature extractors to automatically learn patterns from both the expert knowledge and the deep learning methods that could indicate sleep apnea. These patterns, or features, are then automatically and synergistically fused and assigned a weight based on the important parts of each. Then, through a contrastive learning process, similar features are matched closely together. Finally, the data is classified based on the final features of ECG and corresponding expert knowledge, indicating the probability that the patient has sleep apnea.

To test their model, the researchers used two publicly-available ECG datasets containing more than 26,000 segments annotated by experts, each identifying apnea or normal sleep events. These segments consisted of 30-second and two-and-a-half minute inputs. Compared against six existing state-of-the-art sleep apnea detection methods, ConCAD outperformed them all. Their model accurately identified sleep apnea events 88.75% of the time in one-minute segments and 91.22% of the time in the five-minute segments of the first dataset; and 82.5% and 83.47% respectively in the second dataset.

"Our results show the possibility of using ECG data for automated sleep apnea detection, which should significantly benefit patients suffering from sleep apnea since they may use a personal ECG device at home to monitor their sleep apnea conditions," said Fenglong Ma, assistant professor of information sciences and technology and principal investigator. "Moreover, the designed model can help doctors simplify the diagnostic process of sleep apnea."

Ma added, "This is a new attempt to incorporate expert knowledge into deep learning models for sleep detection. We will continue to investage how to use expert knowledge to guide the learning of deep models."

The researchers presented ConCAD at the European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases (ECML-PKDD), held virtually Sept. 13–17.

Citation: New tool fuses expert knowledge and deep learning features to detect sleep apnea (2021, October 1) retrieved 13 April 2024 from
This document is subject to copyright. Apart from any fair dealing for the purpose of private study or research, no part may be reproduced without the written permission. The content is provided for information purposes only.

Explore further

Study finds no link between sleep apnea and joint pain


Feedback to editors