Introduction

Activity patterns and circadian rhythm are often disrupted in patients with serious mental illness (SMI)1,2,3,4,5, and thus, characterizing related behaviors could provide useful behavioral markers that enable better understanding and assessment of patientsā€™ disease state. Wearable sensor data, such as accelerometer-derived step count and electrocardiogram- (ECG-) measured heart rate, have been used to quantify this activity markers6,7,8,9.

Additionally, insufficient medication adherence is a significant concern for patients with serious mental illness10,11 and can lead to poor outcomes, such as the increased risk of relapse and diminished quality of life12,13, as well as increased utilization of the healthcare system10,14. Traditional methods of inferring medication adherence are typically subjective or only track proxy markers of ingestion15,16. This limitation presents a clear opportunity for digital medicine, which refers to the combination of an active pharmaceutical with an ingestible sensor that enables the objective recording of medication ingestion via a mobile application17, providing more direct insight into patientsā€™ medication ingestion patterns18,19 than other common proxy measures of adherence.

The digital medicine system (DMS) utilized here17 also non-invasively records complementary information, such as step count and heart rate, that can provide further insight into patient behavior (Fig. 1). The combination of this behavioral data with objective ingestion data provides a unique opportunity to explore relationships between patterns of patient activity and medication ingestion behavior, which could both contextualize the behaviors that are associated with good or poor adherence and lead to the development of behavioral markers of adherence that could be more broadly applied.

Fig. 1: Schematic of the digital medicine system (DMS).
figure 1

The DMS consists of an ingestible sensor embedded within a tablet of aripiprazole. The sensor logs an ingestion by communicating with a torso-worn patch. In addition to recording ingestion events, the patch also contains an accelerometer and ECG. Data are sent from the patch to a smartphone app and stored on a cloud server where it can be accessed by patients or designated caregivers.

Here, we present a retrospective analysis of the activity cycles of patients with serious mental illness using the DMS. First, we analyzed the consistency of subjectsā€™ step count patterns by comparing the most prominent spectral feature in each subjectā€™s step count oscillations across their treatment regimens. We also explored subjectsā€™ heart rates during active intervals compared to their mean daily heart rates as a potential marker of activity intensity. In order to explore whether these behavioral markers were related to differences in patient ingestion patterns, the activity metrics were compared to medication ingestion at both a patient-level and a daily level. Highly consistent activity patterns were linked to higher rates of medication ingestion.

Results

DMS data

In this analysis, accelerometer-based step counts, measured at 1-min intervals, and ECG-derived mean heart rates, measured at 5-min intervals, were used to characterize patient activity patterns. These data were then partitioned into 15-min intervals, with the total step count and mean heart rate calculated across each interval. Additionally, time-stamped ingestion records were recorded when a patient wearing the DMS patch ingested a pill.

Activity rhythm feature

In order to characterize the consistency of activity patterns, the time-series of the 15-min resolution step count data for a given day and the two preceding days was analyzed using the Lombā€“Scargle periodogram20,21,22, which produced a power spectral density (P) and characteristic frequency (fc) for each day that had a sufficient amount of data (see ā€œMethodsā€ section). Because we were interested in the consistency of a patientā€™s step count relative to previous daysā€™ patterns, we then defined an activity rhythm score (AR), such that

$$AR_m = \frac{{P_m\left( {\left\langle f \right\rangle } \right)}}{{P_m\left( {f_{\mathrm{c}}^m} \right)}},$$
(1)

where ARm is the activity rhythm score on the mth day, \(f_{\mathrm{c}}^m\) is the characteristic frequency on the mth day, Pm is the Lombā€“Scargle periodogram amplitude calculated using the 3-day window of step count data ending on the mth day, and 怈f怉 is the mean of the characteristic frequencies of all previous days for that patient (Fig. 2). By this definition, larger values of ARm indicate that the mth day step count pattern is more consistent with previous daysā€™ activity rhythms.

Fig. 2: Activity rhythm (AR) score calculation example.
figure 2

In order to calculate AR for a given day, the Lombā€“Scargle periodogram is applied to a 3-day of window of step-count data leading up to and including that day, and a characteristic frequency fc is calculated for the time-series. AR is then defined as the amplitude of that Lombā€“Scargle periodogram at the mean of all characteristic frequencies from earlier days divided by the amplitude of the periodogram at fc. Thus, AR is a measure of how consistent the step count pattern is, relative to the pattern of earlier days.

Active heart-rate feature

In order to characterize the intensity of activity undertaken by patients, we also identified active 15-min intervals for each patient-day, by classifying as ā€œactiveā€ any interval in which at least one-third of the available accelerometer records within the 15-min interval reported a vertical posture angle, i.e., an angle greater than or equal to 30Ā° above horizontal, and a step count greater than 0 (Fig. 3a). We then calculated an active-interval relative heart rate rHRA, such that

$$rHR_m = \frac{{\left\langle {Active\,HR} \right\rangle _m}}{{\left\langle {HR} \right\rangle _m}},$$
(2)

where rHRm is the patientā€™s active-interval relative heart rate on the mth day, 怈Active HR怉m is the average heart rate within all active intervals on the mth day, and 怈HR怉m is the patientā€™s average heart rate across the entirety of the mth day (Fig. 3b).

Fig. 3: Active-interval relative heart rate calculation example.
figure 3

a For each patient-day, active intervals are defined as those 15-min intervals in which at least one-third of the intervalā€™s accelerometer records contained a posture angle greater than or equal to 30Ā° and a step count greater than 0. b The mean heart rate was then calculated within the active intervals and normalized to the overall mean heart rate for that day to calculate the active-interval relative heart rate rHRm.

Study population

The population analyzed here included 113 subjects with SMI across two separately conducted clinical trials23,24. Table 1 contains a summary of the clinical and demographic features of the subjects in these trials. Of the available population, 95 patients had data that was analyzable per the criteria discussed in the ā€œMethodsā€ section, resulting in a total of 2525 analyzable days, i.e., days on which the AR score could be calculated, of a possible 4231 days for which this metric could have been calculated across the full 113-subject data set. The median number of days per patient was 29 with an interquartile range (IQR) of 23.5.

Table 1 Demographic and clinical characteristics of sample.

Comparison of activity features and ingestion

We first explored the relationship between daily AR and rHR and next-day ingestion by using all 2525 analyzable days, irrespective of the patient. Of these days, 83% had recorded ingestions on the following day. A summary of the daily activity features can be found in Table 2. Figure 4a, b contains histograms of the activity features, as well as the fraction of days within each histogram bin that was followed by an ingestion on the next day. Higher daily AR values are associated with an increased likelihood of an ingestion on the following day. The same relationship seems to hold for next-day ingestion and daily rHR. Figure 4c demonstrates this finding across both dimensions with a heatmap for the next-day ingestion as a function of both AR and rHR.

Table 2 Feature summary.
Fig. 4: Daily AR and rHR Features vs next-day ingestion.
figure 4

a Histogram of AR values for all analyzable days. The red dots represent the fraction of days within each bin that are followed by successful ingestion on the next day. Note that the next-day ingestion rate seems to be higher for days with higher AR values. b Histogram of rHR values for all analyzable days. The red dots represent the fraction of days within each bin that are followed by successful ingestion on the next day. Note that the next-day ingestion rate seems to be higher for days with higher rHR values. c Heatmap of next-day ingestion rates as a function of both AR and rHR. The analyzable days are sorted into bins based on their AR quintile (x axis) and rHR quintile (y axis), and the color of the heatmap represents the fraction of days in each bin that are followed by successful ingestions on the next day. Note that the values on the x and y axes represent the limits of each quintile for the features. Higher values of both AR and rHR seem to be associated with higher next-day ingestion rates.

For the comparison of activity metrics to ingestion on a treatment-regimen timescale, 46 subjects, with a median overall ingestion rate of 0.88 (IQR = 0.16), had at least 5 weeks of analyzable days, and thus met the previously described data quality criteria. We calculated the mean and standard deviation of both AR, i.e., 怈AR怉 and Ļƒ[AR], and rHR, i.e., 怈rHR怉 and Ļƒ[rHR], across all daily values for each patient. Table 2 contains a summary of these mean and standard deviation features. Of these four patient-level features, a relationship to the overall ingestion rate was only seen in 怈AR怉. Patients with high 怈AR怉 values tended to have high overall ingestion rates; however, patients with lower 怈AR怉 values did not necessarily exhibit lower ingestion rates. Figure 5 provides an example of this trend when the patient sample was divided at the median value of 怈AR怉ā€‰=ā€‰0.75. At this cutoff, the subjects with higher 怈AR怉 scores had a median ingestion rate of 0.91 (IQR = 0.09) while the subjects with lower 怈AR怉 scores had a median ingestion rate of 0.78 (IQR = 0.13), and the Mannā€“Whitney U test indicated that the groups were significantly different (p = 0.004). Note that this trend holds and is significant, as determined by the p-value of the Mannā€“Whitney U test, for all 怈AR怉 cutoff values between 0.58 and 0.86 (see ā€œDiscussionā€ section).

Fig. 5: Patient-level AR versus overall ingestion rate.
figure 5

Boxplot of the overall ingestion rate for these patients divided at the median 怈AR怉 value of 0.75 into high- and low-怈AR怉 groups. Here, the center lines of the boxplots represent the median value, the box limits represent the upper and lower quartiles, the whiskers extend to 1.5 times the interquartile range, and outliers are represented by open circles. Note that only patients with at least 5 weeks of analyzable data were included in this sample. The high-怈AR怉 group has high overall ingestion rates while the low-怈AR怉 group has a much wider distribution of ingestion rates. The Mannā€“Whitney U test p-value between these groups is 0.004. Note that there is significant differentiation between the groups for a range of 怈AR怉 threshold values (see ā€œDiscussionā€ section).

No calculated features other than AR and rHR (see ā€œMethodsā€ section) were significantly correlated with ingestion on either a regimen-level or daily level.

Discussion

The DMS utilized in this work provides both objective ingestion records and markers of activity, such as step count and heart rate, in patients with SMI, enabling unique exploration of the relationship between patient behavior and adherence to a treatment regimen. Here, two specific features were developed to characterize patient activity: an activity rhythm score AR, which is a measure of the degree to which daily step count patterns are consistent with past behavior, and the relative active-interval heart rate rHR, which could be related to the intensity of activity.

At the daily level, we see a direct relationship between daily AR and rHR and the likelihood of an ingestion on the next day. If these relationships are able to be validated in the future, they would serve as valuable behavioral markers that help to predict and improve ingestion behavior in SMI patients that exhibit poor medication adherence. This improved understanding of a patientā€™s behavioral state and its link to medication ingestion could provide valuable information to inform clinical decision-making regarding therapy. For example, a disruption in a patientā€™s activity pattern, particularly when coupled with poor medication adherence, maybe a leading indicator of a worsening clinical state; thus, these metrics could provide early warnings to clinicians prior to more serious outcomes, such as relapse or hospitalization. Although the validated interpretation of the causality of these relationships is beyond the scope of this work, the link between higher daily AR and next-day ingestion may suggest that patients with consistent behavioral patterns are more likely to also successfully adhere to a medication regimen. We note that the interpretation of the link between rHR and ingestion is somewhat difficult because rHR is not a direct measure of activity intensity; it is also dependent on the mean heart rate across the entire day. Thus, a high rHR value could be indicative of either a relatively intense active-interval or a day where the patient had a low baseline heart rate. Conversely, a low rHR value may not only indicate low-intensity activity but could also be representative of a day in which a patient has an elevated heart rate during inactive periods. Thus, interpreting a causal link would require a more controlled study.

On a patient-regimen level, we found that patients with relatively high mean AR values (怈AR怉), indicating very consistent activity patterns, were likely to have high overall ingestion rates. The logical inverse, however, was not necessarily true. Patients with lower 怈AR怉 had a wide range of overall ingestion rates. We found that 怈AR怉 thresholds from 0.58 to 0.86 produced significant differences in the ingestion rate distributions between the relatively high- and low-怈AR怉 groups, as measured by the Mannā€“Whitney U test. Cutoff values of 怈AR怉 greater than 0.86 did not uniformly produce a significant contrast in ingestion rate because the limited sample size (Nā€‰=ā€‰46) led to a small group of relatively high-怈AR怉 patients at these cutoffs. The inability of threshold values in 怈AR怉 below 0.58 to produce significant contrast is likely due to a lack of correlation between low 怈AR怉 values and ingestion rate. While patients with higher 怈AR怉 scores all exhibit consistent activity patterns across most of their regimens, patients with low 怈AR怉 scores seem to be more behaviorally heterogeneous, which could explain the less robust relationship between low 怈AR怉 and ingestion rate.

The uniqueness of the objective ingestion data from this DMS and the activity features developed here represent important evidence of the potential link between patient activity behavior and medication ingestion. However, this work does have several limitations which could be ameliorated by further exploration. First, the ingestion behavior in this data set is skewed towards high ingestion rates, potentially due to a more well-controlled clinical trial setting. Thus, it is difficult to truly determine whether there is a link between any of the activity features and very poor adherence. Future work is needed to apply these algorithms to a larger patient population in a more natural care setting. Some of the data quality requirements for calculating the AR feature also further exacerbate the bias of the ingestion data by limiting the data set to patients that had more robust patchwear and thus were inherently more likely to have successfully recorded ingestion events. The utilized criteria for data quality seem to be reasonable, based on our previous work; however, in future work, it would be important to explore the tradeoffs between feature quality and data set bias by tuning the various quality criteria. Additionally, the current activity rhythm methodology is essentially quantifying the similarity of a daily activity pattern to a historical mean pattern that is assumed to be unimodal. The SMI patient population could be prone to a more bimodal distribution of step count patterns; thus, with larger data sets, it could be interesting to characterize the similarity of daily activity to multiple representative patterns. From a data quality standpoint, the use of a 14-s sample of accelerometer data every minute could lead to underestimated step counts if subjects engage in very short bursts of activity. Because this limitation is consistent across all measurements in the data set, and because the algorithm utilizes a temporal resolution of 15ā€‰min, it is likely that missed short-duration activity will not significantly affect the 15-min step count values nor the relative patterns of step counts; however, validation with continuous accelerometer data could provide more robust evidence. Finally, this was a retrospective analysis of an available data set, and the study was designed to engineer activity features from the available DMS data. Thus, it will be vital to validate both the observed relationship between these activity metrics and ingestion and the activity rhythm methodology itself using independent data sets. For example, the AR score could be compared to markers of circadian rhythm or other techniques for characterizing activity patterns that use different methods for calculating the frequency power spectrum. However, to the best of our knowledge, the publicly available data sets did not have sufficient longitudinal data, i.e., more than 7 days, to validate our methodology. This validation will be a focus of future work.

However, with this data set, we were able to calculate other commonly used non-parametric metrics of rest-activity patterns including interdaily stability (IS), intradaily variability (IV), and relative activity (RA) amplitude calculated using the ten most active daily hours (M10) and five least active daily hours (L5)25,26,27. The IV and RA metrics showed modest correlation with the subject-level 怈AR怉 metric, with Spearman correlation coefficients of 0.30 and 0.32, respectively; however, none of these rest-activity markers, i.e., IS, IV, RA, M10, or L5, demonstrated any significant correlation with overall ingestion rates. Thus, the AR metric, which is dependent only on relative periodicities of the step count pattern and does capture the relationship between activity patterns and medication ingestion, could serve as a valuable new tool to assess the activity behavior of SMI patients. This work represents an important step in leveraging sensor data and the objective ingestion information provided by digital medicine to better characterize patient activity patterns and to explore the behavioral context surrounding medication ingestion.

Methods

Digital medicine system (DMS)

The DMS employed here has been fully described in a previous publication18. Briefly, the DMS consists of an ingestible sensor embedded in an active pharmaceutical, in this case, the atypical antipsychotic aripiprazole, and a patch attached to the torso that both records ingestion events and contains a three-axis accelerometer and single-lead electrocardiogram (ECG). All collected data is uploaded and placed in cloud storage via a mobile phone application (Fig. 1).

Each measured ingestion is recorded with a timestamp. A recorded ingestion is a robust indicator that an ingestion occurred; however, the lack of an ingestion record could result either from the patient truly not ingesting the medication or from a connectivity issue, e.g., the patient not wearing the patch.

A 14-s sample of the accelerometer data is measured every minute, and an on-board algorithm converts this raw data to a step count, mean acceleration along all three axes, and a mean body orientation angle. The ECG data is collected over a 14-s sample every 5 min, which is concurrent with one of the 14-s accelerometer samples in that period. A mean heart rate is then calculated using the mean of the R-R peak intervals within the 14-s sample.

Study population

The population analyzed here included 113 subjects across two separately conducted clinical trials23,24. All subjects had been diagnosed with schizophrenia, bipolar disorder, or major depressive disorder and were receiving a stable daily dose of aripiprazole prior to the studies. During the trials, patients received the digital version of their aripiprazole regimen for an 8-week period. The studies were reviewed and approved by an appropriate institutional review board (Copernicus Group IRB, Research Triangle Park, NC) and patients were all deemed capable of using the DMS and provided written informed consent. Table 1 contains a demographic and clinical summary of these patients.

Activity rhythm feature

Our primary aim in this analysis was to probe changes in patient activity patterns across treatment regimens. We chose to use step count as the input data for this analysis, as it should be expected to oscillate approximately daily, with few recorded steps during sleep and a higher step count during waking hours.

To perform this analysis, we first partitioned all patient data into non-overlapping, 15-min intervals and calculated the mean step count within each interval. These 15-min intervals reduced the number of zero-step data points and enabled the use of data quality criteria (see below) based on the availability of both the accelerometer data and the relatively sparse ECG data. For each day, time-series data with a 15-min temporal resolution for that day and the two preceding days were analyzed using a Lombā€“Scargle periodogram to determine the characteristic frequency. This three-day window was the shortest timeframe that enabled the robust fitting of the approximately one-day periodicity of the time-series data. The Lombā€“Scargle periodogram is an algorithm for performing power spectrum analysis for unevenly sampled time-series data20,21,22. It is thus ideally suited to the current application, in which missing accelerometer data is common due to imperfect patchwear28. Indeed, the Lombā€“Scargle periodogram has been previously applied for identifying frequencies in other biological time-series29,30,31. The equation for the Lombā€“Scargle periodogram, which was implemented in Python via the scipy package32, can be written as follows:

$$P\left( f \right) = \frac{1}{2}\left[ {\frac{{\left( {\mathop {\sum}\nolimits_n {s_n{\mathrm{cos}}\left( {2\pi f\left[ {t_n - \tau } \right]} \right)} } \right)^2}}{{\mathop {\sum}\nolimits_n {{\mathrm{cos}}^2\left( {2\pi f\left[ {t_n - \tau } \right]} \right)} }} + \frac{{\left( {\mathop {\sum}\nolimits_n {s_n{\mathrm{sin}}\left( {2\pi f\left[ {t_n - \tau } \right]} \right)} } \right)^2}}{{\mathop {\sum}\nolimits_n {{\mathrm{sin}}^2\left( {2\pi f\left[ {t_n - \tau } \right]} \right)} }}} \right],$$
(3)

where

$$\tau = \frac{1}{{4\pi f}}{\mathrm{tan}}^{ - 1}\left( {\frac{{\mathop {\sum }\nolimits_n {\mathrm{sin}}\left( {4\pi ft_n} \right)}}{{\mathop {\sum }\nolimits_n {\mathrm{cos}}\left( {4\pi ft_n} \right)}}} \right).$$
(4)

Here, tn is the nth measurement time-point, sn is the step count at the nth time-point, and f is the frequency for which the periodogram amplitude P is being calculated. The characteristic frequency fc for a given day is then defined as the frequency which maximizes the Lombā€“Scargle periodogram for the three-day window leading up to and including that day. For instance, if the step-count pattern repeated in a perfect daily rhythm, fc would be equal to 1ā„(1 day). Here, we are interested in determining if a patientā€™s step count pattern on a given day is consistent with that patientā€™s previous activity rhythm. As such, we compare each dayā€™s fc to the mean frequency across all previous days for that patient in order to define the activity rhythm score AR, such that

$$AR_m = \frac{{P_m\left( {\left\langle f \right\rangle } \right)}}{{P_m\left( {f_c^m} \right)}},$$
(5)

where ARm is the activity rhythm score on the mth day, \(f_{\mathrm{c}}^m\) is the characteristic frequency on the mth day, Pm is the Lombā€“Scargle periodogram amplitude calculated using the 3-day window of step count data ending on the mth day, and 怈f怉 is the mean of the characteristic frequencies of all previous days for that patient (Fig. 2). Since \(P_m\left( {f_{\mathrm{c}}^m} \right)\) is, by definition, the maximum value of Pm, ARm exists on the range (0,1]. A value of ARmā€‰=ā€‰1 indicates that \(f_{\mathrm{c}}^m = \left\langle f \right\rangle\) while a value of ARm approaching 0 indicates that oscillation at the historic mean frequency 怈f怉 is not present in the 3-day window ending on the mth day. Thus, larger values of ARm indicate that the mth day step count pattern is more consistent with previous daysā€™ activity rhythms.

To ensure data quality, 15-min intervals with fewer than 10 accelerometer records or fewer than 2 ECG records were excluded, and periodogram spectra were not calculated for 3-day windows with fewer than two-thirds of the expected 15-min-interval time-points, i.e., 192 time-points (96 windows/day). Other data quality criteria, e.g., requiring one-half or three-fourths of the expected time-points, were explored and did not significantly alter any findings. Additionally, we required that there be at least 5 baseline power spectra in order to calculate 怈f怉 to ensure a reasonably stable baseline value for 怈f怉; thus, the eighth day of a treatment regimen is the first day for which a patient could receive an AR score.

Active heart-rate feature

In order to glean insight into the intensity of activity undertaken by patients, we first identified active intervals for each patient-day. This active-interval designation was again performed with a minimum temporal resolution of 15-min. Here, a 15-min interval was identified as ā€œactiveā€ if at least one-third of the available accelerometer records within the 15-min interval reported a vertical posture angle, i.e., an angle greater than or equal to 30Ā° above horizontal, and a step count greater than 0 (Fig. 3a). We then calculated an active-interval relative heart rate rHRA, such that

$$rHR_m = \frac{{\left\langle {Active\,HR} \right\rangle _m}}{{\left\langle {HR} \right\rangle _m}},$$
(6)

where rHRm is the patientā€™s active-interval relative heart rate on the mth day, \(\left\langle {Active\,HR} \right\rangle _m\) is the average heart rate within all active intervals on the mth day, and 怈HR怉m is the patientā€™s average heart rate across the entirety of the mth day (Fig. 3b). Thus, if the patient has a higher than average heart rate during his or her active intervals, rHRm would be >1 for that day.

We also calculated daily mean step count, daily mean heart rate, daily heart rate standard deviation, daily number of active intervals, and a heart rate analog of the activity rhythm score.

Comparison of activity features and ingestion

We then compared these activity features to medication ingestion on both a daily basis and on a treatment-regimen timescale. To explore the relationship between daily activity and ingestion and investigate the feasibility of predicting ingestions based on behavioral patterns, we compared a patientā€™s mth-day activity, i.e., ARm and rHRm, to that patientā€™s medication ingestion on day mā€‰+ā€‰1. For this daily ingestion, the presence of recorded ingestion on day mā€‰+ā€‰1 was considered a dosing success, and the lack of ingestion on day mā€‰+ā€‰1 was considered a dosing failure, provided that day mā€‰+ā€‰1 contained at least two-thirds of the expected accelerometer records for that day. Days that contained fewer than this number of accelerometer records were excluded from the daily analysis. This was done to increase our confidence that a lack of a recorded ingestion was actually indicative of a missed ingestion and not just a result of a lack of patchwear or other connectivity issues. We chose two-thirds as the threshold for required accelerometer records as a compromise between maximizing the number of analyzable days and maximizing our confidence in the day representing a truly missed ingestion. Other threshold values were explored and did not significantly alter our results.

For the regimen-level analysis, we compared the mean and standard deviation of each patientā€™s AR and rHR values across all days to that patientā€™s overall ingestion rate, defined as the number of days during which an ingested dose was recorded divided by the expected number of ingested doses across the entire regimen, which is defined as the time period between the first and last recorded patch records. Only subjects that had at least five weeks of analyzable data, including the baseline period, were included in this analysis. This cutoff was chosen to ensure that patient-level ingestion rates were not overly sensitive to single data points. This comparison provides insight into whether patientsā€™ overall ingestion patterns are associated with the consistency of their activity patterns over the full treatment regimen. The significance of the difference in the ingestion rates between patients with high and low 怈AR怉 was determined using the Mannā€“Whitney U test.

All analysis was performed in Python 3.7.

Reporting summary

Further information on research design is available in the Nature Research Reporting Summary linked to this article.