Predicting Depression and Anxiety Moodby Wrist-Worn Sleep Sensor
Shuichi Fukuda∗ , Yuki Matsuda∗ Yuri Tani∗ , Yutaka Arakawa§¶ , Keiichi Yasumoto∗∗ Nara Institute of Science and Technology, Nara, Japan,

Email: {fukuda.shuichi.fs5, tani.yuri.tu3, yukimat, yasumoto}@is.nasit.jp.
§ Kyushu University, Fukuoka, Japan, Email: arakawa@ait.kyushu-u.ac.jp.
¶ JST Presto, Tokyo, Japan.

Abstract—In recent years, researches on recognizing daily
behavior and psychological / physiological states have been
actively conducted to change the behavior of workers working
in companies. In this paper, we analyzed Occupational Healthquestionnaire named DAMS for waking-up time and daily sleep
data that are acquired from wearable devices in 2–3 weeks experiment of 60 office workers working in five general companies. By
using a machine learning method, our binary Balanced Random
Forest model predicts depression, positive, and anxiety moods in
two levels, high and low. As a result of Leave One Person Out
cross validation, it was confirmed that our model estimated with
the F1 values of depression mood: 0.776, positive mood: 0.610,
anxiety mood: 0.756. Moreover, we evaluated the variance of thethree estimations among subjects by referencing the box chart.
As a result, it was confirmed that there is variance in estimation
accuracy for each subject.
Keywords—Wrist Sensor, Life log, Machine learning, Wearable
computing, Occupational HealthI. I NTRODUCTION
Psychological and physiological conditions and environmental conditions have various effects on human behavior
and activity. Researchers make efforts to use these data to
improve worker’s performance and comfort in workplaces. In
particular, it is an urgent issue for companies around the world
to create workplaces where employees can work actively bygrasping and supporting the mental and physical status. To
meet those demands, questionnaires are commonly used tograsp the psychological state in the work environment.
In Japan, the revision of the Occupational Safety and Health
Act in June 2014 requires that all companies with 50 or more
employees have regular stress health checks, which spreads
severe management of working hours and stress checks.
In such a background, many studies have been conducted toinvestigate how the environmental conditions, and psychological and physiological conditions surrounding workers affectworker’s performance and comfort.
For example, Annina et al. analyzed questionnaire responsesof 154 subjects covering four days each. The questionnaire
responses of Pittsburgh Sleep Diary questionnaire [1], whichmeasures sleep quality, and Recovery Experience Questionnaire (REQ) [2], were collected.
As a result of logistic regression analysis, they reported
a correlation among a length of working hours per day, adeterioration of sleep quality and REQ recovery status when
waking up.

On the other hand, Adam et al. surveyed about work-lifebalance of 260 people of Long-Haul Truck Driving (LHTD)
occupation, an occupation with the greatest health hazard in
the United States [3]. A relationship between work-life balance and other factors was investigated by logistic regression
analysis and structured analysis. As a result, they report thatoccupational stress is effective as a predictor of work-lifebalance decline. The analysis results also show that a decreasein sleep quality and long time of work lead to an increase inoccupational stress. From these facts, Adam et al. suggested
that managing a good quality of sleep and time will lead toan improvement in the work-life balance of LHTD.
However, Adam et al.’s study has only statistically analyzed
the relationship between the work hours answered by thequestionnaires. They reported only the correlation acquired
from statistical analysis. It is not possible to monitor the“daily” mental and physical condition of each worker, toprovide individual support, and to promote behavior change.
On the other hand, there are many studies aimed to improve worker’s performance, comfort and promoting behavioral change [4], [5]. In order to build a system that leads tobetter behavior, it is essential that the system automaticallyrecognizes daily behavior patterns, mental and physical states.
For instance, Amemori et al. proposed an estimation methodfor HRQOL (Health-Related Quality of Life) using smart
devices [6]. In their method, life logs and QOL questionnaires
from a wearable device and a smartphone were collected forone subject for 150 days. Next, HRQOL is estimated bymachine learning model with features of wearable devices.
However, their method uses dataset obtained from only one
student subject, the generality between subjects has not beenverified, and there is a problem that it lacks versatility. Besides,
they use the Empatica E4 wristband as a wearable device,although it costs about $2,000 and raises the cost per person.
From these backgrounds, the purpose of our study is toautomatically grasp the mental and physical status of office
workers working in companies. Moreover, we aim to support them to prompt behavioral transformation and improve
worker’s performance and comfort. By collecting daily life-log
data of 60 workers, which are an occupational health questionnaire (named DAMS) and daily sleep data that can be acquired
from wearable devices and smartphones, we built a binary
machine learning model to predict a depression, positive andanxiety moods calculated from DAMS questionnaire.
As a result of Leave One Person Out cross validation, we
confirmed that the occupational health index can be estimatedwith F1 value of depression mood: 0.776, positive mood:0.610, anxiety mood: 0.756. Also, each confusion matrix
showed that depression and anxiety moods were generally wellestimated. But, the low level of positive mood could not be
estimated well.
As a result of three box diagrams that show a variance in theestimation of each mood between subjects, it was confirmedthat the variance in depression estimation was small and awidth of the first and third quartiles was 0.24. It means that,
according to the variance among subjects with a figure of 0.24,
some subjects may be estimated with high accuracy, but insome cases, some other subjects may be estimated with low
accuracy.
By creating a general-purpose model among 60 subjects,
it will be possible for office workers in the future to automatically recognize their daily mental and physical states by
wearing a wearable device, and to support them accordingly.
II. R ELATED W ORK
A. Statistical Analysis Research on Sleep
Annina et al. analyzed a relation between sleep, recovery
experience and working hours for 154 subjects for four days
each by using logistic regression [2]. Their questionnaires
are Pittsburgh Sleep Diary questionnaire, which measures
the quality of sleep and Recovery Experience Questionnaire(REQ). As a result of logistic regression analysis, they reported
a correlation between daily work hours, poor sleep quality andworsening REQ experience during awake.
Adam et al. surveyed with questionnaires about occupational stress, sleep quality, and work-life balance in 260 people
in an occupation of Long-Haul Truck Driving (LHTD), theoccupation with the highest health hazards in the UnitedStates [3]. As a result of logistic regression analysis andstructured analysis, it has been reported that occupational
stress is effective as a predictor of a decline in work-lifebalance. Their analyses also show that decreases in sleep
quality and time lead to an increase in occupational stress.
From these facts, Adam et al. suggested that securing a goodquality of sleep and time will lead to an improvement in thework-life balance of LHTD.
Hülsheger et al. conducted a fatigue assessment four times
a day over five working days for 133 employees, and investigated a relationship between changes in fatigue level and sleep
quality [7]. As a result of growth curve analysis, fatigue wasfound to decrease on average in the morning, reach the lowest
point around noon, and then increase until bedtime. As a resultof analyzing a relationship between daily fatigue patterns andsleep quality, it was confirmed that when the quality of sleep islow, next day’s fatigue will be high at waking up and decreaseat noon and then increase until going to bed. When sleep
quality is high, fatigue will be low and stable until noon andincrease between the end of work and bedtime.

Hülsheger suggested that the transition of the fatigue level ina day depends on the quality of sleep. If the fatigue transition
pattern can be predicted, it is thought that employees can gain
support and better behavioral change based on the predictedtransition of it.
B. Questionnaire Analysis by Machine Learning
Sano et al. suggested a machine learning method which
estimates student’s academic ability (GPA), sleep quality index(Pittsburgh Sleep Quality Index), and mental health composite
score obtained from a questionnaire [8]. Using the questionnaires responses for total 1980 days (for 30 days for each of 66
student subjects), they extracted 700 features that are acquired
from the smartphones and wearable sensors. Then they built
a binary SVM model. As a result of Leave One Person Out
cross validation, it has been reported they achieve an accuracy
exceeding 80%.
In Sano et al.’s study, targeted subjects are only students,
so it is impossible to grasp the mental and physical status of
office workers working in company.
Amemori et al. proposed a simple estimation method of
HRQOL using smart devices [6]. In this method, life logs fromsmartphones and wearable devices, and ground truth data from
HRQOL questionnaires are collected for 150 days. Then they
extracted features from wearable sensor data. Furthermore,they constructed a HRQOL estimation model by using amachine learning method. In the initial stage of learning, theestimation model is constructed using all the features, but themodel is reconstructed every day by using newer measured
data. In addition, the model is optimized for each individual.
it was confirmed that the ground truth could be followedwith a correlation coefficient of 0.646. Since this method uses
only smartphones and wristband type wearable devices for
estimation, it is possible to easily evaluate HRQOL without
restricting the movement of subjects in daily life.
However, their method uses only data obtained from a single
student subject. Its generality has not been verified, and there
is a problem that it lacks versatility. Besides, the Empatica E4
wristband which unit price is about $2,000 is used. Therefore,
it raises the cost per person.
C. Novelty of Our Research
In the above-mentioned statistical analysis, only the statistical correlation and the relationship are reported by analyzing
sleep quality, recovery experience, fatigue and stress obtained
from the questionnaires. Therefore, it is impossible to recognize the mental and physical daily condition of each worker
working for a company. In a machine learning questionnaire
analysis, it is pointed out that it is not targeted at office workers
working in companies, and there are few subjects and poor
generalization.
In this paper, in order to grasp the mental and physical stateof office workers, we proposed an occupational health index
estimation method using a reasonable wearable wristband. We
collected occupational health questions (named DAMS [9]) responses of waking-up time in 2–3 weeks experiment including

60 office workers working in five Japanese companies. Next,
we built a machine learning model which estimates two levelof occupational health index (depression, positive, and anxiety
moods). Finally, we evaluated its F1 values and variance of
accuracy among 60 subjects.
III. P ROPOSED M ETHOD
A. Data Collection
The dataset to construct the machine learning model wascollected from 2–3 week experiment including 60 office workers working in five Japanese companies.
For appropriate data collection, a six days practice period
was set up before the data measurement period. The preliminary questionnaire on static characteristics such as gender andage of the subjects was answered too. During the experiment,
subjects lived with a Fitbit wearable sensor for acquiring sleep
status [10] throughout the weeks, and at the same time, theyanswered questionnaires about occupational health on theirsmartphones.
B. Data Cleaning of Questionnaire Responses
DAMS (Depression and Anxiety Mood Scale) [9] was used
as a occupational health index in this study. DAMS is aquestionnaire to measure three degrees of depression, positive,
and anxiety moods. In order to measure those moods, thewords in questions expressing mood such as lively, dark, andworried, can be selected from seven levels of how well you
feel. The method of calculating the depression mood scoreis the sum of a seven-point evaluation of dark, sunk, anddisgusting question items. Thus the score can take a value inthe range of 0–18. Similarly, positive mood scores are fund,joyful, and lively. Also, anxiety mood are uneasy, disturbing
and worried.
A labeling method of ground truth for machine learning is
the same as Sano et al., whose research estimated the mental
index obtained from the questionnaires [8]. Their method ofcreating ground truth rates the upper 20% and lower 20% of
the mental index score as high and low, respectively. Middle
60% data are discarded because it contains a lot of ambiguityof questionnaire responses.
In this study, similarly, the upper 20% and lower 20% of
the depression, positive, and anxiety scores obtained from theDAMS questionnaire were set to two values, high and low.
The score distribution and the range of upper and lower 20%
for depression, positive, and anxiety mood scores are shownin Figs. 1, 2, and 3.
The upper and lower 20% of depression, positive, andanxiety scores are as follows: Depression mood (Top 20%
score is nine points, Bottom 20% score is zero points), Positivemood (Top 20% score is nine points , Bottom 20% score isthree points), anxiety feeling (Top 20% score is twelve points,
Bottom 20% score is three points).
The total number of DAMS questionnaire responses was840, and it was decreased to 685 in a process of removement
such as forgetting to wear the fitbit and being disable to concat

TABLE I: List of Features
1
2
3
4
5
6
7
8
9
10
11
12
13

Feature Names
Total Sleep Minutes
Total Wake Minutes
Light Sleep Minutes
Rem Sleep Minutes
Deep Sleep Minutes
Total Wake Time Ratio
Light Sleep Time Ratio
Rem Sleep Time Ratio
Deep Sleep Time Ratio
Number of Wake
Number of Light Sleep
Number of Rem Sleep
Number of Deep Sleep

to questionnaires dataset. Lastly, the total number of groundtruth data after labeling was 274.
C. Features Extraction
Table I shows a list of features related to sleep, which is an
input to the model for estimating occupational health indices.
In this study, the sleep status of the subjects was obtained
from Fitbit Charge 3 [11]. Fitbit Charge 3 can measure not
only wake-up time and bedtime detected automatically, butalso four levels of sleep, such as REM sleep, and deep sleep
during one night. Also, these four levels of sleep time andtheir ratio were added into features.
The sleep features are extracted from the sleep of the day
immediately before answering the DAMS questionnaire when
waking up. There are 13 features in total.
D. Model building
We built a BRF (Balanced Random Forest) model for
estimating occupational health indices [12], [13]. Table IIshows the parameters of the BRF model for the estimationof depression, positive, and anxiety moods that were adjusted
by a grid search method.
IV. R ESULTS & D ISCUSSION
A. Evaluation Method
By using sleep features and two levels of the depression,
positive, and anxiety scores as ground truth, we evaluatedour BRF model with Leave One Person Out cross validation
method.
The Leave One Person Out cross validation method divides
the dataset to each subject data. Next, the method chooses toevaluate data for only one subject from the dataset, and builds
a model by using all other subjects’ data as a learning data
set. It is a method to evaluate a generalization performance
among subjects in the model by repeating it for each subject.
Accuracy, Precision, Recall, and F1 Value were used as
evaluation metrics.

Fig. 2: Distribution of Positive Score

Fig. 1: Distribution of Depression Score

TABLE III: Results of Leave One Person Out Cross Validation

TABLE II: Parameters of BRF
bootstrapclass weight
criterion
max depth
max features
max leaf nodes
min samples leaf
min samples split
min weightfraction leaf
n estimatorsn jobsoob scorerandom state
sampling strategy
verboseFig. 3: Distribution of Anxiety Score

Depression
Truebalanced
gini
None
3
1
2
2

PositiveTruebalanced
gini
3
3
1
2
2

AnxietyTruebalanced
gini
3
5
1
2
2

0

0

0

100
-1
False
1
all
0

100
-1
False
1
all
0

30
-1
False
1
all
0

B. Results of Leave One Person Out Cross Validation
Table III shows the results of the cross validation among
subjects. The F1 Value of the depression mood was 0.732, thehighest among three. In addition, the variance of Accuracy,
Precision, Recall, and F1 Value among subjects are shown in
Figs. 4, 5, and 6.
In the labeling method proposed by Sano et al., when only
the top/bottom 20% response results were extracted, the datafor 60 people and two weeks decreased to 40%. Moreover,the number of data samples of each subject included in theextracted data varies. As a result, the average value of F1
Value in Leave One Person Out cross validation includes theresults of subjects with small number of data samples.
Therefore, Table IV shows the results of recalculating
Accuracy, Precision, Recall, and F1 Value, excluding dataof subjects whose number of data is less than one week.
After the data labeling, there were 42, 44, and 42 subjects
in the depression, positive, and anxiety moods responses
respectively. Then, the number of subjects after excluding
subjects with less than 1 week of data was 20, 19, and 21.
From Table IV, F1 value of depression was the highest, which

Accuracy
Precision
RecallF1 Value

Depression
0.639
0.917
0.639
0.732

Positive
0.640
0.902
0.640
0.696

Anxiety
0.565
0.704
0.565
0.600

TABLE IV: Accuracy of Subjects with Data for one week or
more
F1 Value

Depression
0.776

Positive
0.610

Anxiety
0.756

was 0.776. Whereas, F1 value of positive mood was poor withthe value of 0.610.
Regarding a variance in three estimations among subjects,
it can be confirmed that there is a variance between subjects
from Figs. 4, 5, and 6.
The variance in depression among the subjects was thesmallest, and the width of the first and third quartiles was 0.24
with F1 value. On the contrary, the variance in estimation of
positive and anxiety was 0.53 and 0.57 with the first and third
quartiles.
Thus, according to the variance among subjects of 0.24,
some subjects’ moods may be estimated with high accuracy,
but in some cases, some other subjects’ moods may be estimated with low accuracy. It is considered that the estimation
accuracy may be improved by giving learning data to eachuser based on our model and personalizing it.
C. Overview of Estimation
Confusion matrices of three estimation results for depression mood, positive mood, and anxiety mood are shown in
Figs. 7, 8, and 9.
From those results by referring confusion matrixes, we wereable to estimate depression and anxiety moods well in two
categories. However, our model mispredicted in the positivemood estimation with Fig. 8. This is considered that it wasdifficult to answer the positive word question items such as
fun, joyful, and lively when people are awake.
Tables V, VI, and VII show importance of the overall
features in depression mood, positive mood, and anxiety moodFig. 4: Box plot of Depression Mood

Fig. 7: Confusion Matrix of Depression Mood

Fig. 5: Box plot of Positive Mood

Fig. 6: Box plot of Anxiety Mood

Fig. 8: Confusion Matrix of Positive
Mood

Fig. 9: Confusion Matrix of Anxiety
Mood

TABLE V: Features Importance of Depression Mood Estimation
1
2
3
4
5
6
7
8
9
10
11
12
13

Features
Light Sleep Time Ratio
Rem Sleep Minutes
Rem Sleep Time Ratio
Number of Rem Sleep
Total Wake Minutes
Deep Sleep Time Ratio
Deep Sleep Minutes
Light Sleep Minutes
Total Sleep Minutes
Total Wake Time Ratio
Number of Wake
Number of Light Sleep
Number of Deep Sleep

Importance
0.146339
0.117653
0.117653
0.098994
0.071501
0.070383
0.068154
0.066242
0.065598
0.063514
0.049613
0.044701
0.026987

TABLE VI: Features Importance of Positive Mood Estimation
1
2
3
4
5
6
7
8
9
10
11
12
13

Features
Light Sleep Time Ratio
Rem Sleep Time Ratio
Rem Sleep Minutes
Total Sleep Minutes
Deep Sleep Minutes
Light Sleep Minutes
Number of Rem Sleep
Total Wake time Ratio
Total Wake Minutes
Deep Sleep time Ratio
Number of Wake
Number of Deep Sleep
Number of Light Sleep

Importance
0.125438
0.124797
0.116199
0.098601
0.088327
0.084920
0.065996
0.064743
0.056930
0.053145
0.046709
0.040319
0.033874

V. C ONCLUSION
estimation. In each estimation, it was confirmed that the top
five items of the importance include a characteristic related to
REM sleep. Similarly, a feature of the light sleep time ratio isalso in the top five. Based on these facts, it is considered thatthe features of the time ratio of REM sleep and light sleep
are effective in estimating depression, positive, and anxiety
moods.

In this paper, by collecting DAMS questionnaire responses
at waking-up time and daily sleep data that are acquired fromwearable devices in the course of 2–3 weeks experiment of
60 office workers working in five general companies, We
constructed a Balanced Random Forest model that predicts
depression, positive, and anxiety moods in two categories,
which are high and low. As a result of Leave One Person Out

TABLE VII: Features Importance of Anxiety Mood Estimation
1
2
3
4
5
6
7
8
9
10
11
12
13

Features
Rem Sleep Time Ratio
Rem Sleep Minutes
Light Sleep Time Ratio
Deep Sleep Time Ratio
Total Wake Time Ratio
Total Sleep Minutes
Light Sleep Minutes
Number of Wake
Deep Sleep Minutes
Number of Rem Sleep
Number of Light Sleep
Total Wake Minutes
Number of Deep Sleep

Importance
0.109272
0.100533
0.094728
0.083043
0.082017
0.077754
0.077330
0.074166
0.067463
0.066891
0.062715
0.062314
0.041775

cross validation, it was confirmed that our model can estimate
with F1 value of depression mood: 0.776, positive mood:0.610, anxiety mood: 0.756. The confusion matrixes showedthat the low level of positive mood could not be estimatedwell, but the depression and anxiety moods could be estimatedwell overall. As a result of three box diagrams that show thevariance in the estimation of each mood between subjects,
it was confirmed that the variance in depression estimation
was small and the width of the first and third quartiles was
0.24 with F1 value. It means that, according to the varianceamong the subjects with a figure of 0.24, some subjects may
be estimated with a high accuracy, but in some cases, someother subjects may be estimated with a low accuracy.
Future tasks include adding features such as age and gender.
Also, we will compare the accuracy of other machine learningmodels to improve the accuracy. In addition, for practical use,when personalizing to subject based on this model, we will
confirm how much accuracy will be improved by giving the
subject’s data.
ACKNOWLEDGMENTS
This research is partially supported by JST PRESTO, and
IoT-NA group, the research community of CAN (Consortium
for Applied Neuroscience).
R EFERENCES[1] T. H. Monk, C. F. REYNOLDS III, D. J. Kupfer, D. J. Buysse, P. A.
Coble, A. J. Hayes, M. A. Machen, S. R. Petrie, and A. M. Ritenour,“The pittsburgh sleep diary,” Journal of sleep research, vol. 3, no. 2,
pp. 111–120, 1994.
[2] A. Ropponen, M. Härmä, B. Bergbom, J. Nätti, and M. Sallinen, “Thevicious circle of working hours, sleep, and recovery in expert work,”
International journal of environmental research and public health,vol. 15, no. 7, p. 1361, 2018.
[3] A. Hege, M. K. Lemke, Y. Apostolopoulos, B. Whitaker, and S. Sönmez,“Work-life conflict among us long-haul truck drivers: Influences of workorganization, perceived job stress, sleep, and organizational support,”
International journal of environmental research and public health,vol. 16, no. 6, p. 984, 2019.
[4] Y. Arakawa, “[invited paper] sensing and changing human behavior for
workplace wellness,” Journal of Information Processing, vol. 27, pp.
614–623, 2019. [Online]. Available: https://www.jstage.jst.go.jp/article/
ipsjjip/27/0/27 614/ article/-char/en[5] Z. Zhang, Y. Takahashi, M. Fujimoto, Y. Arakawa, and K. Yasumoto,“Investigating effects of interactive signage–based stimulation for
promoting behavior change,” Computational Intelligence, vol. 35, no. 3,
pp. 643–668, 2019. [Online]. Available: https://onlinelibrary.wiley.com/
doi/abs/10.1111/coin.12234[6] C. Amenomori, T. Mizumoto, H. Suwa, Y. Arakawa, and K. Yasumoto,“A method for simplified hrqol measurement by smart devices,” in
Wireless Mobile Communication and Healthcare, 2018.
[7] U. R. Hülsheger, “From dawn till dusk: Shedding light on the recovery
process by investigating daily change patterns in fatigue.” Journal ofApplied Psychology, vol. 101, no. 6, p. 905, 2016.
[8] A. Sano, A. J. Phillips, Z. Y. Amy, A. W. McHill, S. Taylor, N. Jaques,
C. A. Czeisler, E. B. Klerman, and R. W. Picard, “Recognizing academic
performance, sleep quality, stress level, and mental health using personality traits, wearable sensors and mobile phones,” in 2015 IEEE 12th
International Conference on Wearable and Implantable Body Sensor
Networks (BSN). IEEE, 2015, pp. 1–6.
[9] L. A. Clark, “The anxiety and depressive disorders: Descriptive psychopathology and differential diagnosis.” 1989.
[10] M. de Zambotti, A. Goldstone, S. Claudatos, I. M. Colrain, andF. C. Baker, “A validation study of fitbit charge 2TM compared with
polysomnography in adults,” Chronobiology international, vol. 35, no. 4,
pp. 465–476, 2018.
[11] “Fitbit Inc. : Fitbit charge 3,” available from https://www.fitbit.com/jp/
charge3 (accessed 2019-10-20).
[12] M. Khalilia, S. Chakraborty, and M. Popescu, “Predicting diseaserisks from highly imbalanced data using random forest,” BMC medical
informatics and decision making, vol. 11, no. 1, p. 51, 2011.
[13] Y. Xie, X. Li, E. Ngai, and W. Ying, “Customer churn prediction using
improved balanced random forests,” Expert Systems with Applications,vol. 36, no. 3, pp. 5445–5449, 2009.