Smartphone Mediated Tracking and Analysis of Sleep Patterns in Indian College Students

Sleep is one of the essential bio-makers for human health. Poor sleep is associated with reduced cognitive performance. With most smartphone users in India being college students, the focus is now on exploring smartphone usage’s impact on students’ sleep. Umpteen news articles in India have reported binge-watching, social media use during the night, and other mobile phone-related interruptions as causes of improper sleep and irregular sleep patterns. However, such studies may involve bias while self-reporting and are limited to a one-time exercise. To understand the reality, we need to accurately quantify the sleep duration, patterns, mobile usage before and after bedtime, number and duration of interruptions. In this first-of-its-kind study in India, we infer novel insights into the sleep patterns of a cohort of 40 college students. We implement a mobile sensing-based approach for the study by installing a custom-developed mobile app on all phones. We extract sleep activity and infer the sleep duration, bed-in and wake-up times, and interruption duration from the sensor data collected from the phone’s built-in sensors. The study brings about new insights into college student sleep patterns and, interestingly, shows that students have a regular sleep cycle and good sleep quality. Only one-fourth of the students revealed irregular sleep patterns, and we did not observe any mobile-related interruptions 30 min past bedtime.


Introduction
Sleep is one human activity easily changeable due to irregular lifestyles, leading to poor sleep cycles. How we feel is greatly influenced by the quality and quantity of our sleep. Existing research [1][2][3] has shown that poor sleep is associated with impairment in cognitive performance, mood fluctuations, and could affect mental health. The importance of sleep dates back almost 40 decades as a concept of sleep hygiene stated by Dr. Peter Hauri [4]. Sleep hygiene refers to the different factors such as diet, exercise (physical activity), and environmental factors (light, noise, and temperature) that may interfere with or promote better sleep. All these principles revolve around the fact that humans should give primary importance to sleep. However, most people's sleep gets interfered with either traditional (caffeine) or contemporary factors such as smartphones and their usage before bedtime.
Smartphones have penetrated not just into the technology market but also into human lives. Statistics on smartphone users in India shows that 55% of users belong to the age group of 18-24. 1 . Studies shows that college students check their phone 150 times a day and are unable to sleep without smartphones. Excessive smartphone usage have fuelled the need for understanding impact of these devices on student behaviour particularly their sleep patterns. Surveys 2 have been conducted across Indian students enquiring about their sleep duration, causes for irregular sleep, and so on. For instance, responses from a survey conducted by a private healthcare provider 3 reveals that students used their phones just before bedtime, slept after 11PM, used social media at night and so on. Academic studies conducted via survey based approaches also found high smartphone usage, irregular sleep routine and poor sleep quality [5][6][7][8][9]. Such findings which follow the traditional survey based responses although informative, do not quantify and reflect the sleep patterns, accurate duration of mobile usage before and after wake up, the duration of interruptions and the sleep quality. Alternate but accurate forms of data collection are required to compliment such studies.
Smartphones have a rich source of sensors such as the accelerometer, gyroscope, light, microphone, proximity, Wi-Fi, and Bluetooth built-inside them. This led to the mobile sensing method [10]. The past decade has seen a number of works on mobile sensing for human activity recognition and health [11][12][13][14]. An extension of mobile sensing is digital phenotyping, which involves understanding the human (phenotype) characteristics from data collected insitu passively through digital devices. Digital phenotyping has shown to provide an objective way of assessing human behavior, thus complementing traditional subjective methods [15,16].
In this work, we conduct a phenotype study on college students to quantify their sleep patterns primarily through interactions with their smartphones. We recruited 40 students across two college campuses and installed a custom developed mobile application in their phones, to infer their sleep duration, sleep onset (bed-in)time, and wake-up time. Through this study, we aim to answer a set of research questions listed below: 1. What is the overall distribution of sleep duration among the students? 2. Do bed-in(sleep on-set) and wake-up time impact the overall sleep duration and sleep quality? 3. Are there any patterns in students' bed-in and wake-up times? 4. Is there any association between bedtime, wake-up and sleep duration? 5. Is sleep affected by mobile usage?
Our contributions in this work include: • Revealing interesting insights into the sleep patterns of a cohort of Indian students. The work can be reproduced across any population. • Our work is significant in automatically inferring one's sleep patterns without any additional infrastructure and having a potential to provide personalized sleep schedules. • Our custom-developed mobile app, Usage Tracker, is open source and an all-in-one app. No digital well-being app built inside phones can record minute-by-minute continuous sleep data. Our app provides a fine granularity.
The work in this paper is organized as follows. We discuss some relevant work in literature in Sect. 2. This is followed by a detailed description of our study in Section 3. We describe the sleep inference algorithm in Sect. 4. In Sect. 5 we discuss our findings and analysis. In Sect. 6, we discuss the significance of our work. We finally conclude the work in Sect. 7.

Related Work
With an increasing number of digital devices offering healthtracking features, the interest in users has increased multifold. Sleep, in particular, has been getting a good amount of focus, resulting in the development of tools and technologies assisting users in tracking sleep patterns and duration, evaluating sleep quality, and so on. Below, we summarize state of the art in sleep data collection and detection, organizing related work into three sections based on the approach: survey-based, sensor and survey-based, and sensor, survey, and commercial products based.

Survey-Based Sleep Analysis
In the past decade in India, many researchers have tried to analyze sleep among college students. Shad et al. [5] collected responses for Pittsburg Sleep Quality Index (PSQI) 4 and Oldenburg burnout inventory 5 across medical college students and observed that 65% students reported poor sleep quality. Similarly work in [6] use the smartphone addiction scale and PSQI to report excessive of phones by students with high sleep disturbance. Authors in [7] conducted a study on physical and sleep quality of 617 college students and found that 51% reported having low physical activity levels and poor sleep quality. Mathew et al. [8] enrolled 657 students for a self reporting exercise to understand sleep time and schedule. Responses revealed that students had inadequate sleep duration, late bedtime, and early wake-up time. Kaur et al. [9] through the (PSQI) questionnaire concluded that sleep quality is significantly related to the general well-being of students.
We now discuss studies conducted on sample sets from the western population. Harari et al. [17] used smartphone addiction scale, PSQI and International Physical Activity Questionnaire-Short Form (IPAQSF) to report that excessive usage of smartphone could lead to poor sleep quality and low levels of physical activity. Pilcher et al. [18] considered self-reported logs and PSQI for sleep quality and sleep time duration for 45 students. Results show that poor sleep quality is significantly correlated with poor well-being, stress, and depressive symptoms. Another study conducted on 1871 Japanese students [19] revealed that female students have higher sleep quality issues than males. In [20], the authors examined sleep quality, and it's impact on the academic performance of undergrad students again using PSQI. The authors observed that low academic performance was related to low sleep quality and high stress. Work in [21], surveyed sleep quality using PSQI with 4318 undergrad students and concluded that poor sleep quality was significantly associated with skipping breakfast, tea drinking, a higher tendency toward internet addiction, and poor social support.
In [22], the authors surveyed over a thousand Australian adults to assess sleep-related difficulties. The average sleep time was 7 h. 16% of working adults worked just before bed and also had frequent sleep difficulties or daytime sleeprelated symptoms. Younger adults (18-34 years) slept around an hour longer on non-working days than on working days compared with 18 min in older age groups. Authors in [23] conducted a study across 400 subjects in Italy and observed that the bedtime hour, sleep latency, and wake-up time increased during the pandemic. In particular, during the lockdown, the impact of delays in bedtime and wake-up was more pronounced in students. Work in [24] designed a questionnaire to identify the relationship between sleep and smartphone usage. Analyses revealed that the unsatisfied sleep quality group tended to use their phone for 8 h or more. Similarly, work in [25] collected survey-based responses on smartphone addiction and sleep quality.

Phone and Survey data
Authors in [26], take a machine-learning approach to detect sleep and classify participants into good and poor sleepers. They collected smartphone sensor data and a sleep diary based on a PSQI standard questionnaire. The classification resulted in 93.06% accuracy. Authors in [11] build upon their sleep estimation algorithm in [27] and statistically identify a negative association between sleep and stress. The work involved collecting smartphone sensor data and survey responses for stress and depression based on Gold standards. Pletcher et al. [28], used PSQI questionnaires and mobile usage time and found that longer duration of screen time was associated with shorter sleep duration. The sleeping period was associated with poor sleep quality, decreased sleep efficiency, and a long delay in sleep onset. Work in [29] explored the impact of smartphone use on sleep quality before bedtime and during bedtime. They collected iPhone and Fitbit watch data for sleep estimation. Analyses show that mobile usage before bedtime and during bedtime leads to significantly low sleep quality.

Phone and Other Platforms
The earliest works looked at validating the efficacy of smartphones for estimating sleep in humans. Natale et al. [30] used a smartphone and an ActiWatch (an actigraphybased watch). The authors compared the total sleep time, wake after sleep onset, and sleep efficiency across the two devices. Results showed that smartphones underestimated the total sleep time compared to the actigraph.
Authors in [27] proposed a sleep estimation model using features from the accelerometer, light, microphone, phone lock, phone off, and charging during the night. They compared their model with commercial products like Jawbone. The accuracy of their estimation was ± 42 min. Authors in [31] designed an algorithm to identify sleep/ wake cycles by inferring the body's motion through the accelerometer sensor in the phone. The authors instructed users to place the phone near the pillow to capture movements. The authors compare the accuracy of three approaches: probabilistic, statistical, and hiddden markov models (HMM). Results showed that HMM gave 84% accuracy, 10%, and 15% more than the first and second approaches, respectively.
Borger et al. [13], used smartphone touch interactions and wrist-worn accelerometers to capture body movements. They extracted wakeful periods/interruptions during sleep. Using these measures, they estimated the putative sleep onset and wake-up times. Massar et al. [32] combined wearable data, phone use, and self-reports to infer sleep. According to the results, k-means clustering revealed three patterns, each consistently expressed within a given individual. The three corresponding groups that emerged differed systematically in age, sleep timing, time in bed, and peri-sleep phone usage. Table 1 presents an executive summary of works using the sensing based approach for sleep analysis. These works suggest that smartphone interactions can be leveraged to update the behavioral signatures of sleep with these peculiarities of modern digital behavior. However, what the Table 1 misses is there no such study on sleep using smartphones on Indian students. Moreover, none of the works in the table provide an open source app. Work in [33] develop a mobile app that collects only mobile usage data. In contrast, our app collects any kind of sensor data and is an open source. A detailed description of our app is provided in [34].

3 3 Methods
We illustrate the study procedure in Fig. 1.
A total of 52 students enrolled in the study. After the study, we end up getting productive data from 40 students. We conducted an online meeting with all students and explained the project goals, study parameters, the mobile application, and the data collection process.

Participants
Our data collection exercise focused on students of undergraduate and postgraduate programs. The population consisted of 25 men and 15 women students, of which 23 were in undergraduate and 17 were in postgraduate programs. After advertising the participation opportunity, we recruited only those who consented to provide app usage and sensor data from their phones.

Study Design and Procedure
We developed an in-house mobile application, "Usage tracker" that runs Android based phones. The app polls every five seconds to detect the opening of an application and records the name and usage duration of the app in the foreground. The app also records screen events such as unlocking/locking the device. We have beta-tested the app on many Android devices running various versions of Android (Android 6.0 Marshmallow to the latest Android 12.0). The app showed complete compatibility with all of the specified versions of Android. Since the app uses a continuous background service for polling data, measuring the battery impact of our app was also crucial. We found the battery usage of our app to be negligible on all the test devices by Android's built-in battery usage reporting feature. Figure 2 shows the interface of Usage tracker.

Data Logs
We received an average of 20 h/day of data from each of the 40 participants. We extracted 16,500 h of phone usage and 4,00,000 unlocks for 744 nights. Students answered a onetime demographic questionnaire along with daily inputs on sleep quality and quantity, bed-in and wake-up times.
In the next section, we discuss the method of collecting sensor data and the sleep inference algorithm.

Sleep Inference
Typically, polysomnography (PSG) is the method to measure sleep quantity. PSG uses data such as brain waves, eye movements, muscle contractions, blood oxygen levels, snoring, and restlessness to infer sleep quantity and quality. However, the method requires the patient to be at a hospital for weeks and is expensive, making it complex and impractical for large-scale, long-term (i.e., weeks, months) sleep monitoring. Existing work has shown that digital devices or actigraphy-based [39,40] and smartphone based [26] studies produce comparable results with PSG. We formally present our sleep detection algorithm below.
The algorithm makes use of multiple sensor data. Firstly, the accelerometer, a miniaturized electronic sensor vibrates when a force acts on the it. The force can either be a user moving the device or just the force of gravity if the device is kept idle. The sensor converts these vibrations into varying voltage levels, and further map them to gravity values in the scale (1 g, 2 g, 3 g where 1 g = 9.8 m∕s 2 ). Gravity value considered as idle state of the phone. So, the algorithm checks if the idle state holds true. Following which the phone lock state is checked. The the ambient light and sound are captured and checked to see if the room is lowly lit and there are no vocal sounds, indicating a quite room. the time duration for which all these conditions satisfy is summed up as sleep hours.
We describe this logic in Fig. 3 through a sample data of one night.

Algorithm Accuracy
We first compare our algorithm's sleep estimation with another algorithm in [41]. The authors use phone unlock and phone usage features to detect and identify longest duration as sleep from sensor data. The average sleep duration derived from our algorithm was 6.4 ± 0.7 h and the duration derived from their algorithm using our data 7 ± 0.8 h.

Fig. 2
The record activity toggle button will start the app and run in the background. Users can use the buttons to export data or upload a raw database (DB) file Next, we also compared our algorithm with commercial smartwatches. However, getting all 40 students to wear a smartwatch during the study period was cumbersome due to the unavailability of watches and the unwillingness to wear watches while sleeping. We conducted a poll and found that only 90% participants did not prefer wearing, citing discomfort. So, we identified five participants who agreed to wear the watch for 14 days. Two users wore a FitBit, one an OppoReno, and the other an iWatch. The sleep estimation algorithms in these watches are proprietary. So, we presume that these watches measure accelerometer data to detect arm movement and calculate the bed-in, wake-up, and total sleep.
In Fig. 4a we compare the average sleep duration across five users for 2 weeks between the measurement platforms and ground truth. In Fig. 4b we depict our algorithm's error relative to the smartwatch as reference with 95% confidence intervals.

Findings
In this section, we first discuss the total sleep duration computed from our algorithm. Following this, we present the analysis on bed-in, wake-up times and sleep interruptions.

Sleep Time Analysis
We validated our algorithm with smartwatch and ground truth data of five users. Here, we summarize the sleep duration computed across all students using our algorithm and the ground truth in Table 2.
In Fig. 5, we illustrate the distribution of students based on the sleep duration.

Bed-in and Wake-Up Time Analysis
We inferred the bed-in and wake-up times as the first and the last sample timestamps between the longest set of samples identified as uninterrupted sleep. The goal is to analyze how the bed-in and wake-up times are distributed, what is their spread or variation, does the spread indicate irregular sleep schedules in students and lastly does the  spread have any impact on the overall sleep duration and sleep quality. We illustrate the distribution of bed-in times across all students in Fig. 6.
Next, we show the distribution of wake-up times in Fig. 7.
As we can see, the bed-in time has a wider distribution when compared with wake-up time. To explore further and observe the spread of these two variables, we computed the median values of all students' bed-in and wake-up, and the quartile values. The box plots in Fig. 8 illustrate the findings. Note that Y axis, (time values) are indicated as number of hours post 11PM when students go to sleep).
Interestingly, we also observed that students were clustered into multiple groups according to the variations (standard deviation) of their bed-in and wake-up times. Fig. 9 shows the distribution of bed-in time variations.
Similarly, there were only five students who had irregular wake up schedules as seen in Fig. 10.
The sleep duration numbers highlight that most students maintained a sleep routine of 6-7 h on average barring a few who had erratic bed-in and wake-up times. Since the sleep    duration depends on when one goes to bed and wakes up, we fitted a linear regression line to check relation between wake-up on bed-in, shown in Fig. 11.
The wake-up times as expected are well correlated with the bed-in times. The regression model was significant with R 2 = 0.45 and prediction error of 1.07 h.
As secondary outcome, we collected data from ten working professionals for 2 weeks to observe their bed-in time patterns and compared it with ten randomly sampled students (Fig. 12).
The trend shows that students display an irregular trend when compared with the working professionals. This finding says that we can infer in general that working professionals need to maintain a regular sleep schedule in contrast to students who are constantly faced with academic workloads, late night college events, meetings and so on.

Sleep Quality
We asked students to rate their every night sleep quality. The ratings are based on the PSQI scale ranging from Very bad(1), Fairly bad(2), Fairly good(3) and Very good(4). The average sleep quality score was across all students was 3 ± 0.6. However, we observed that the ratings depended on the bed-in time variation as shown in Fig. 13.

Sleep Interruptions
Sleep interruptions in the context of this work mean the probability of using the phone via an app, or a simple action of unlocking the phone for a few secs such as checking the time, or a notification. We present the distribution of the time when the interruptions happened in Fig. 14.
We also compared the number of interruptions between the student and non-student population. This is shown in Fig. 15.    Interestingly, our unlock data revealed that most unlocks happened only 30-60 min before bed-in times and wake-up times of students. We resort to a violin plot Fig. 16 to depict this behavior.
Next, we discuss our findings on association between sleep and mobile usage.

Sleep and Mobile Usage
Our Usage tracker application records the usage of various application in the mobile. We identified three distinct clusters of students based on their mobile usage. The scatter plot in Fig. 17 illustrates the clusters.
We applied Pearson's correlation and obtained r = 0.0147 and p = 0.688 for sleep and mobile-usage. This shows poor significance between sleep and mobile usage.

Discussions
A majority of work in literature on sleep sensing and inference among college students report interesting findings pertaining to the target groups. Although not a comparison, we pick a recent work [42] on American students to see how their findings fare. Our students had a regular sleep routine of 6.4 ± 0.7 h, close to American students 6.99 ± 1.84 h. What is contrasting is that American students had a fairly early bed-in time of 23:43 ± 1.5 h, as against our students who slept around 01:47 ± 2.39 h. The standard deviation is also larger in Indian students.
The work holds significance in the sense that it can be extended into the exploring mental health or social psychology. This space is slowly being populated with studies that have shown that smartphone usage and interactions can be used to identify and map to mental health symptoms. For instance, authors in [36] tracked depressive symptoms by mapping sleep derived from sensor data with standard questionnaires such as PHQ-9. [37], explored the relationship between regularity in sleep timings and mental health. They used data from a wearable device, daily mood with a smartphone application and depression through a questionnaire.

Significance of Findings in this Work
• Despite having a wide variation in bed-in times, our students maintained a regular sleep schedule of 6.4 ± 0.7 h. The sleep quality across the cohort was 3 ± 0.6 which shows that students were happy with their sleep and did not feel fatigue the next day. This is a very important finding which goes against the common notion that students are sleep deprived. • One of the reasons cited for sleep deprivation is excessive mobile usage [43]. Our findings show that mobile usage had no correlation with sleep. • 616 nights were interruption less and 117 nights with 1-4 interruptions. The probability density function shows that the probability of no interruptions is as high as 80% . The chances reduce to 10% and 5 % for being interrupted once or more than one time respectively. This indicates that students take their sleep seriously. • Our findings resonate to the fact that with physiological differences, differences in genetic and environmental conditions, and other factors, each student maintained a sleep routine or circadian rhythm as described by authors in [41]. We discovered personalized sleep schedules or routines. • Lastly, our work presents a simple and effective methodology and platform to quantify a complex phenom- The non-student population hardly had one interrupted night as against three for the student population in 2 weeks ena such as sleep partly to a certain extent. Our sleep findings or behavior can be used to understand how a simple touch interaction on a phone helps in sleep detection.

Conclusion
This work proposed a sleep sensing framework using the built-in sensors of smartphone. The phenotype study is novel in the sense that this is a first of its kind study across Indian students. The study was conducted on two college campus with undergraduate and postgraduate students. Our sensing algorithm inferred sleep using the accelerometer, light, microphone and phone unlock/lock data. We found that the average sleep duration was 6.4 ± 0.7 h and an average sleep quality score of 3 ±0.6. Some of our significant findings include close to 90% of the students exhibiting regular bed-in and wake-up times, resulting in a balanced sleep routine. Also as against the common notion that students use smartphones overnight, we found that close to 80% of the 744 nights, students had interruption-free sleep. The results from this work are a precursor to exploring sleep and its impact on mental health of students.
Acknowledgements This work is part of the project titled Using mobile sensing mechanism to assess college student behaviour. We acknowledge the Indian Council for Social Science Research for funding this project. We also like to thank Drs. Alka Parikh, Mukesh Tiwari and Rekha Wagani for their valuable inputs. We thank all volunteering to participate in the experiment.
Author contributions All the authors have contributed in this work equally.

Funding
The DAIICT data which we have used is collected with funding help of ICSSR ( Indian Council of Social Science Research).

Availability of data and material
The data that we have collected is from DAIICT institute only and not available online.

Declarations
Conflict of interest The authors whose names are listed above certify that they have NO affiliations with or involvement in any organization or entity with any financial interest (such as honoraria; educational grants; participation in speakers' bureaus; membership, employment,  consultancies, stock ownership, or other equity interest; and expert testimony or patent-licensing arrangements), or non-financial interest (such as personal or professional relationships, affiliations, knowledge or beliefs) in the subject matter or materials discussed in this manuscript.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.