Digital Phenotyping Research Platform
Harvard T. H. Chan School of Public Health: Beiwe
Sample accelerometer data collected by Beiwe. Image from Torous, John & Kiang, Mathew & Lorme, Jeanette & Onnela, Jukka-Pekka. (2016). New Tools for New Research in Psychiatry: A Scalable and Customizable Platform to Empower Data Driven Smartphone Research. JMIR Mental Health. 3. e16. 10.2196/mental.5165.
Overview
Beiwe is a HIPAA-compliant digital phenotyping app used in medical and academic research studies. It runs in the background on a participant’s smartphone, collects data on their movement and activity, and gives them surveys. Zagaran built most of the Android version of the app, part of the iOS version, and most of the server infrastructure for collecting data. Data analysis is mostly handled by the Onnela Lab at Harvard’s T. H. Chan School of Public Health.
Originally funded by a 2013 NIH Director’s New Innovator Award to Dr. Jukka-Pekka Onnela, Beiwe started when Zagaran began work on it in 2014. It was originally designed for a single academic study, but interest from other researchers led to Beiwe being turned into a customizable platform for running studies with different parameters, and in 2017, made open source. Beiwe has now been used to study different conditions including depression, schizophrenia, and ALS, and has collected participant data for clinical trials. While activity tracking has since been built into apps like Apple’s Health app on iOS, Beiwe provides unique value because it gives researchers access to the raw data and methods used to process that data, making the data more usable and reliable than what’s collected by Apple Health.
Challenging requirements
Developing Beiwe presented many challenges. Beiwe collects a lot of passive sensor data from phones, primarily from the accelerometer, gyroscope, and GPS, all of which consume significant energy and reduce battery life. Apple and Google also periodically change the iOS and Android operating systems to restrict the behavior of apps running in the background, which means that every year, Beiwe needs to be updated to run using different APIs and system/user permissions, and sometimes the fundamental data collection framework needs to be overhauled to keep it working.
Architectural evolution
Originally, Beiwe was optimized to download surveys at study enrollment and run logic on the phone for when to display those surveys. That architecture enabled participants to complete surveys even if they were offline. Over time, however, fewer and fewer participants lacked mobile data plans, while more and more researchers wanted to be able to customize surveys during the study, and even run custom logic for when to send survey notifications. To enable the more complex survey logic, Zagaran overhauled the architecture to move surveys from prescheduled on the phone, to push notifications sent from the Beiwe server.
Zagaran also added features to make many parameters of the app customizable, depending on what research study the participant is enrolled in. Researchers on the study can change the types of data collected and the frequencies on which they’re collected, wording throughout the app, and some of the security requirements. Surveys in the app are richly customizable as well: there are audio recording prompts and on-screen surveys; the latter include several question types (including multiple choice, open response, and slider questions), branching logic, and randomization.
DevOps support for open source Beiwe deployments is an unusual practice. Because Beiwe is designed to be a fully transparent and reproducible platform for data collection and analysis, it’s possible for anyone to run their own Beiwe deployment. Zagaran has built and maintained public architecture, tools, and documentation for running your own Beiwe instance on Amazon Web Services.
Zagaran's role and Beiwe's impact
In addition to building, operating, and maintaining the Beiwe apps and primary Beiwe server deployments (run by the Onnela Lab) Zagaran has built Beiwe customizations and run Beiwe deployments for other research organizations, including a large pharmaceutical company.
Beiwe has been used to run hundreds of research studies around the world, including predicting relapses in schizophrenia patients, measuring depression over time, and tracking heart health.