23 24 25 2 26 ABSTRACT 27 Current practice of assessing mood episodes in affective disorders largely depends on 28 subjective observations combined with semi-structured clinical rating scales. Motor activity is 29 an objective observation of the inner physiological state expressed in behavior patterns. 30 Alterations of motor activity are essential features of bipolar and unipolar depression. The aim 31 was to investigate if objective measures of motor activity can aid existing diagnostic practice, 32 by applying machine-learning techniques to analyze activity patterns in depressed patients and 33 healthy controls. Random Forrest, Deep Neural Network and Convolutional Neural Network34 algorithms were used to analyze 14 days of actigraph recorded motor activity from 23 35 depressed patients and 32 healthy controls. Statistical features analyzed in the dataset were 36 mean activity, standard deviation of mean activity and proportion of zero activity. Various 37 techniques to handle data imbalance were applied, and to ensure generalizability and avoid 38 overfitting a Leave-One-User-Out validation strategy was utilized. All outcomes reports as 39 measures of accuracy for binary tests. A Deep Neural Network combined with random 40 oversampling class balancing technique performed a cut above the rest with a true positive 41 rate of 0.82 (sensitivity) and a true negative rate of 0.84 (specificity). Accuracy was 0.84 and 42 the Matthews Correlation Coefficient 0.65. Misclassifications appear related to data 43 overlapping among the classes, so an appropriate future approach will be to compare mood 44 states intra-individualistic. In summary, machine-learning techniques present promising 45 abilities in discriminating between depressed patients and healthy controls in motor activity 46 time series. 47 48 49 50 3 51 Introduction 52 The current practice of assessing mood episodes in affective disorders are subjective 53 observations combined with semi-structured clinical rating scales. Objective methods for 54 assessing affective symptoms are desired (1). Motor activity is an objective observation of the 55 inner physiological state expressed in behavior patterns, and alterations in activation are 56 essential symptoms of bipolar and unipolar depression (2, 3). The depressive state is typically 57 associated with reduced daytime motor-activity, increased variability in activity levels and 58 less complexity in activity patterns compared to healthy controls (2). However, in some 59 bipolar and unipolar depressed patients contradictory motor activity patterns have been 60 observed, characterized by increased mean activity levels, reduced variability and an 61 augmented complexity in activity patterns more similar to that observed in manic patients (4). 62 Such depressions are commonly associated with irritability, restlessness, and aroused inner 63 tension, in contrast to the general loss of initiative and interest characterizing psychomotor 64 retarded depressions (5). 65 It has been suggested by Sabelli et al. (6) that moo...