Prioritizing open source and longevity
To make wearables more useful for research, Goldstein says it was important to create a way to track sleep that anyone could use, and one that won’t become outdated.
“Every time a device changes its hardware or software, you need a new validation study, and by the time you finish that validation study, there might be a new version of the device on the market,” says lead author Olivia Walch, Ph.D., a post-doctoral research fellow in neurology, who built the algorithm using machine learning.
Apple doesn’t offer a native sleep tracking feature on its smartwatch, but researchers picked the Apple watch in creating this algorithm because it’s possible to access raw data from your Apple device.
The Apple watch has an accelerometer and also tracks heart rate with an optical method (what most sleep trackers use). The researcher can source those measurements from whatever device is taking them, so the method doesn’t depend on the specific device, Walch says.
Walch’s algorithm is a research prototype, so it isn’t currently available for download on the app store. But Walch says anyone can use this open-source formula to reproduce and improve upon the work across different patient populations.
An activity of the worried well?
Sleep tracking may be the latest medical application for smart watches, but it follows some concern from medical experts about the implications of constant monitoring.
For example, cardiologists have questioned whether tracking every heartbeat with a smart device is helpful. For people without known risk factors, it could lead to unnecessary stress and medical tests – and an ECG on a smart watch isn’t a guarantee that someone’s heart rhythm condition will be detected, either.
“We’ve never had the capability to measure sleep from night to night, over the long term, so it’s hard to know what the relevance is in someone who’s feeling good,” Goldstein says.
And when you know every detail about your performance, you can become obsessed with getting that perfect night of sleep. For some, the obsession can harm instead of help the quality of their sleep.
“Some people have developed orthosomnia, where they became overly focused on the output of their devices,” Goldstein says. “These people develop more insomnia and more anxiety because of their hyperfocus on a measure that may not be accurate. It’s important to remember that everyone has bad nights of sleep once in a while.”
Interesting today; useful tomorrow
Goldstein says the main utility in sleep trackers today is the ability to look at trends over time, rather than diagnose a sleep disorder.
For example, she notes, people may notice how their wearable reports their sleep quality and duration as they lose weight, or on the nights after they consumed caffeine or alcohol.
“It’s helpful when someone notices sleep disruption on their device and it prompts them to seek care when they wouldn’t have otherwise,” Goldstein says. Then, the physician and patient can explore symptoms and make decisions together.
“In the future, we’ll use self-tracking as part of precision medicine; we just have to find the right ways to adopt it. We’re getting closer with advances like this validated sleep tracking algorithm that could be device agnostic, provided manufacturers let us access motion and heart rate data.”
Code to access the accelerometer and heart rate data in the Apple Watch available at https://github.com/ojwalch/sleep_accel. Code used to perform the analysis is available at https://github.com/ojwalch/sleep_classifiers.
Paper cited: “Sleep stage prediction with raw acceleration and photoplethysmography heart rate data derived from a consumer wearable device”, Sleep. DOI: 10.1093/sleep/zsz180
Additional authors on the paper include Yitong Huang, of Dartmouth College; Daniel Forger, of the University of Michigan.