Sleep/Wake Detection Using Actiwatch 2 and Vivosmart 4

Sleep/Wake Detection Using Actiwatch 2 and Vivosmart 4

With Philips discontinuing its wrist-worn wearables for clinicians and researchers —including its popular Actiwatch devices—many researchers have been scrambling for alternatives. To see whether consumer-grade smartwatches can effectively replace medical-grade actigraphic devices, we reverse-engineered the algorithm for the Actiwatch 2 and found that we could replicate its results with affordable consumer wearables, such as the Garmin Vivosmart 4.

Nov 2, 2022
By Drs. Francis Hsu, Han-Ping Huang and Andrew Ahn
Actiwatch 2 vs Vivosmart 4

Abstract

Actiwatch 2 (Phillips-Respironics, Bend, Oregon) is a popular actigraphic device that can detect nighttime sleep/wake patterns and derive sleep parameters based on acceleration (ACC) signals. However, in October 2022, Philips announced that it is “discontinuing offering wrist-worn products in the clinician and research markets”, making all Actiware, Actiwatch 2, Actiwatch PRO, and Actiwatch Plus products unavailable for purchase after Dec. 29, 2022.

To evaluate whether an affordable consumer smartwatch, Vivosmart 4(Garmin, Olathe, Kansas), can effectively replace Actiwatch 2, we reverse-engineered the algorithm for Actiwatch 2 and applied the same algorithm to the raw-ACC data obtained from Vivosmart 4. The Vivosmart 4 does not routinely provide raw ACC data, but through our partnership with Garmin, a customized SDK was created to extract raw ACC signal from Vivosmart 4 and used to reproduce the sleep analysis obtained from Actiwatch 2.

This post introduces the signal processing method of detecting nighttime sleep/wake patterns based on the acceleration signal. As described here, we found the sleep/wake patterns derived from Vivosmart 4 consistent with that of Actiwatch 2. In the following two posts, we will explore how Actiwatch 2 derives sleep parameters from sleep/wake patterns, and compare the performance between Actiwatch 2 and Vivosmart 4 with more sleep data.

1. Experiment Setup

Our experiment setup is shown in Figure 1. Actiwatch 2 and Vivosmart 4 were worn simultaneously during sleep for comparison. Actiwatch 2 is a piezoelectric accelerometer with a sampling rate of 32 Hz. Vivosmart 4 is a 3-axis MEMS accelerometer with a sampling rate of 25 Hz.

Actiwatch 2 and Vivosmart 4 on the participant's right wrist during sleep
Figure 1. Actiwatch 2 and Vivosmart 4 on the participant's right wrist during sleep.

2. From Acceleration Signal to Sleep/Wake Detection

2.1 Signal Processing

Figure 2 illustrates the signal processing method for deriving sleep/wake patterns. The general idea of the method can be referred to the reference [1-2].

Acceleration Signal to Sleep/Wake Detection
Figure 2. Acceleration Signal to Sleep/Wake Detection

Figure 2(a) illustrates the acceleration signal from Vivosmart 4 in terms of a't=ax'2t+ay'2t+az'2t. In the equation, ax'(t) is the raw x-axis acceleration subtracting its moving average of window length 9 to eliminate the low-frequency variation. And  ay'(t), az'(t) are derived the same way.

Figure 2(b) illustrates the activity count time series labeled as AC(n), where n is the epoch index with an epoch length of 30 sec. The process of deriving AC(n) consists of three steps. First, the max 𝑎’ (t) in every second is extracted. Then, the values in 𝑎’ (t) below 50 mG (noise threshold) are set to 0. Finally, a’ (t) in every 30s epoch is summed up and then divided by 35 to represent the activity count in the epoch.

Figure 2(c) illustrates the total activity count labeled as TAC(t), which is derived from AC(n) as TACn=0.04∙ACn-4+0.04∙ACn-3+0.2∙ACn-2+0.2∙ACn-1+2∙ACn++0.2∙AC(n+1)+0.2∙AC(n+2)+0.04∙AC(n+3)+0.04∙AC(n+4) [3]. 

Finally, the epochs with TAC(t) below and above 40 are detected as sleep and awake period, respectively. The value 40 is the default sleep/wake threshold set in the Actiwatch software, which can also be set as 20 or 80. Accordingly, Figure 2(d) illustrates the sleep/wake patterns.

2.2 Comparison between Actiwatch 2 and Vivosmart 4

As can be seen in Figure 2(d), the sleep onset to offset time is 2:02 to 10:08 with an interval of 488 mins. Table 1 lists the consistent and inconsistent results between Actiwatch 2 and Vivosmart 4. Treating the result from Actiwatch 2 as a standard, the sensitivity (to detect sleep) of Vivosmart 4 is near 1.00, and the specificity is 0.87.

Table 1. Confusion matrices of sleep/wake detection
     Table 1. Confusion matrices of sleep/wake detection                             

3. Conclusion

We reverse-engineered the full algorithm utilized in the Actiwatch 2 to derive nighttime sleep/wake patterns from the raw acceleration signal. The sleep/wake patterns derived from Vivosmart 4 are consistent with that of Actiwatch 2. In the following two posts, we will explore how Actiwatch 2 derives sleep parameters from sleep/wake patterns, and compare the performance between Actiwatch 2 and Vivosmart 4 with more sleep data.

4. References

[1] K. Y. Chen and D. R. Bassett, “The technology of accelerometry-based activity monitors: current and future,” Med. Sci. Sports Exer., vol. 37, pp. S490–S500, Nov. 2005.

[2] CamNtech, “The MotionWatch 8 and MotionWare User Guide,” Available at http://www.medicoimpianti.it/files/The- MotionWatch-User-Guide.pdf, 2018.

[3] Respironics, “Instruction manual of Actiwatch Communication and Sleep Analysis Software. Instruction manual. “Available at https://johnawinegarden.files.wordpress.com/2015/03/actiwatchsoftware.pdf, 2018

Last medically reviewed on
Dr. Francis Hsu, PhD
Dr. Francis Hsu, PhD
Research Lead

Francis is a research Lead at Labfront, responsible for data validation and analysis. He is interested in applying physics or math to medical research.

Dr. Han-Ping Huang, PhD
Dr. Han-Ping Huang, PhD
Research Lead

Research Lead (and Designated Plant Caretaker) at Labfront. Han-Ping is a researcher who seeks interesting phenomena, especially the interdisciplinary ones. His dream is to make all the riveting research be easily explored.

Dr. Andrew Ahn
Dr. Andrew Ahn
Chief Medical/Science Officer

Dr. Ahn is an internal medicine physician with a background in physics/engineering and physiological signal analyses. He is the Chief Medical Officer at Labfront and an Assistant Professor in Medicine & Radiology at Harvard Medical School. Dr. Ahn is passionate about democratizing health sciences and exploring health from an anti-disciplinary perspective.

Quotations Icon
Hardvard University Logo Image
“Now, more than ever, we need tools like Labfront that can help researchers take their research and data collection virtual.”
Dr. Gloria Yeh
Dr. Gloria Yeh, MD
Associate Professor of Medicine, Harvard Medical School
Hardvard University Logo Image
Quotations Icon
Bar Ilan University logo image
“The Labfront team was extremely responsive to our requests and made every effort to accommodate our unique needs.”
Yogev Kivity image
Yogev Kivity, Ph.D.
Senior Lecturer of Psychology, Bar Ilan University
Bar Ilan University logo image
Quotations Icon
Oklahoma State University logo
"Labfront's analysts understood our needs as researchers and saved us weeks of work when they prepared our datasets for analysis."
Bryan Edwards headshot
Bryan Edwards, Professor, Joe Synar Chair
Management Department, Oklahoma State University
Oklahoma State University logo
Quotations Icon
Clemson University Logo Image
“The physiological data really helped provide deeper insights.  We recommend Labfront and will definitely be using it again!”
Dr. Kristin Scott image
Dr. Kristin Scott, PhD
Professor of Business, Clemson University
Clemson University Logo Image
arrow icon