Acti-DM1: Monitoring the Activity Level of People With Myotonic Dystrophy Type 1 Through Activity and Exercise Recognition

Myotonic dystrophy type 1 (DM1) is a rare disease where the highest prevalence is found in the small geographical region of Saguenay-Lac-St-Jean in Quebec, Canada. This disease impacts the quality of life and the ability of the affected people to pursue their normal day to day activities. To attenuate the impact of DM1, one could suggest that physiotherapists or other health professionals prescribe adapted physical exercise programs to carry out at home. It is, however, unpractical for the professionals to monitor every patient during their program and prohibitive in terms of cost. One alternative solution is to rely on the use of ambient technologies. To do so, in this research, our team developed an assistive system able to recognize simple mobility related activities (MA) and monitor each exercise performed during training sessions. The system can help the person by providing guidance and motivation throughout the training. The system was tested on 10 persons affected by the disease in their home for 10 weeks. The results obtained are encouraging and we discuss them in comparison with our previous work conducted in lab settings. Finally, to help further advances the research, the datasets are openly available online to the community.


I. INTRODUCTION
Myotonic dystrophy type 1 (DM1) is the most frequent adultonset neuromuscular disorder that affects approximately 8.26 in 100,000 people worldwide [1]. However, its highest prevalence (189 per 100,000 population) is found in the Saguenay-Lac-Saint-Jean region of Quebec, Canada. It is a multisystemic disorder with various system impairments including cataracts, executive functions impairments, cardiac conduction disorder and restricted pulmonary functions. One of the cardinal feature of DM1 is muscle weakness. It has been shown to be declining by 25-53 %, depending of the muscle groups evaluated, over a 9-year period [2]. Moreover, lower limbs muscle weakness causes important limitations in The associate editor coordinating the review of this manuscript and approving it for publication was Zijian Zhang . activities, mainly related to functional mobility [3], increases the risk of falling [4] and is a strong predictor of disrupted social participation [5].
Since no curative treatment exists for DM1, researchers and clinicians all across the world are trying to develop interventions aimed, among other things, at reducing the impact of muscle weakness. For example, strength training programs, i.e. a type of physical exercises aiming to increase muscle strength through the use of resistances, have been shown to be safe in DM1 population [6]. Our research group has recently demonstrated that supervised strength training program induces maximal isometric muscle strength and functional improvements in DM1 [7]. However, many barriers such as lack of access to transportation, costs and availability, limit the participation of DM1 population to such training programs that are carried out in research settings, in a supervised rehabilitation context or that take place in structured sport/fitness centers.
To tackle these barriers, researchers have focused on developing home-based strength training program. Developing a home-based training program generate many challenges. Indeed, one previous study highlighted that strategies involving a research or rehabilitation team seem necessary to ensure participants' adherence in DM1 population [8]. However, strategies such as phone calls or training supervision are respectively sub-optimal and unpractical for health professionals in clinical settings. Moreover, the fact that the patients would perform their strength training program at home greatly complicates the assessment of quality and efficacy by therapists.
One promising solution to this lies in the exploitation of ambient technologies, through the development of an assistive system at home combining artificial intelligence and wearable sensing technologies [9]. To be effective, this assistive system should be able to recognize each exercise performed during the training session, to guide and motivate the patient throughout the training, to quantify the level of physical activity realized on a daily basis and to automatically provide reports to the therapists. Furthermore, the system should be easy to install at home, affordable and allowing near real time monitoring.
In this regard, such a system should be based on the use of a wearable device equipped with an Inertial Measurement Unit (IMU) collecting data related to the movements of the patient. Researchers have already investigated various wearable technologies, such as smartwatches, to recognize postures [10] or gestures [11], [12] in real-time. In a similar context, many studies have used a triaxial accelerometer to quantify the level of physical activity realized by people suffering from different diseases or not [13]- [16]. However, almost all of these studies performed a posteriori analysis of the accelerometry since the technology used did not allow researchers to receive the data in near real time for continuous monitoring. Indeed most devices implied that the data cannot be access until the patient brings back the technologies.
In this paper, we propose an assistive system, called Acti-DM1, satisfying all the previously mentioned requirements. More precisely, the Acti-DM1 system is composed of a Raspberry Pi 3 as the main computation unit, a small USB speaker to provide vocal guidance during the exercise training program and reminders, and a custom wristband including an IMU inspired by our previous work [17]. The proposed Acti-DM1 system has been tested on people with DM1 over a period of 10 weeks. Moreover, the dataset related to the realization of the exercises will be shared on our GitHub 1 as well as all implementation details to allow replication of our proposed system. A complete system such as the one proposed in this paper is probably the first one in the field of neuromuscular diseases and one of the first in the domain of ambient intelligence. 1 Upon acceptance of the paper The remainder of the paper is organized as follows. Section II reviews the literature about activity recognition, as well as any wearable use to recognize basic and advanced activities. Moreover, it will cover the commercial solutions and explain why any of them were actually suitable in our context. Section III will detail both hardware and software components of the Acti-DM1 system. The Section IV is devoted to the explanation of the exercises and mobility related activities recognition process. Section V will present the 10-week experiment that has been conducted and Section VI will show and discuss the results obtained. Finally, the conclusion of our work will be drawn in Section VII.

II. RELATED WORKS
Recent advances in technologies allow us to consider many possible options in order to perform activity and exercise recognition at home. Many of them are smart home related [18] but in our particular context, the most promising are those based on the use of wearable devices equipped with an accelerometer and a gyroscope [17], [19]- [21]. In the last years, several research teams worked on mobility related activity (MA) recognition such as walking, sitting, standing, running, etc., [22], [23]. With the help of classical machine learning or deep learning algorithms they reached impressive recognition rate for those MAs (sometimes even over 99%).
Additionally, wearable devices revealed to be efficient in other more complex recognition tasks. Chambers et al. [24] were able to recognize Kung Fu movements with a great accuracy of 0.96. Cheng et al. [20] obtained an accuracy of 0.959 in the recognition of specific gym exercises such as bench dips using both accelerometer and gyroscope. More recently, the team of Hendry et al. [25] proposed an activity recognition system using 6 sensors to detect simple key movements (jumping and leg lifting) in ballet with the help of a convolutional neural network (CNN) achieving an accuracy of 0.982. Another research team [26] investigated the recognition 10 cross-fit specific exercises based on a deep learning approach (CNN) and reached an impressive recognition rate of more than 99.9 %. Data was collected from 54 healthy participants using two commercial smartwatches, one worn on the wrist and one on the ankle. The main drawbacks of these studies are that they are either based on the use of several portable sensors, which is not realistic in our context, or that they require collecting a lot of data from a large number of participants to train deep learning models. Since DM1 is a rare disease, very few people can participate in data collection and the number of repetitions of each exercise is restricted per day due to their physical limitations.
Moreover, a complete assistive system able to monitor MAs and physical exercises, providing guidance, reminders and reports to therapists should be affordable for adoption by the healthcare system. Indeed, most of the commercial wristbands that could potentially be adopted for the purpose of collecting and processing inertial data have missing features, or are too expensive. For example, data loggers, such as VOLUME 9, 2021 the Axivity, 2 do not have wireless communication capability, which does not meet our needs. Also, several commercial wristbands do not allow access to the raw data required for more advanced processing tasks.
Restricted evidences are available for DM1 but one large study of 255 participants recently showed that patients who followed cognitive behavioral therapy increased their level of physical activity [13]. In that study, accelerometry was used as an outcome measure to validate the effect of the cognitive behavioral therapy on the level of activity performed by the participants. More explicitly, a triaxial accelerometer was worn on the non-dominant ankle for 14 consecutive days at each visit of the therapist at home (one visit per month) and the average magnitude of ankle acceleration was calculated via the Euclidean Norm Minus One metric [27]. They then computed mean 24 hours activity levels, and levels of activity during the five most active and five least active hours of the day. As a conclusion, the physical activity as measured with accelerometry were significantly improved with cognitive behavioural therapy compared with standard care alone. This study shows the potential of accelerometry to capture important outcomes in intervention studies. In this study, the data collected was stored on the device's memory card and then extracted during the therapist's next visit for a posteriori analysis. Therefore, it was unfortunately impossible to perform continuous online monitoring of MAs and exercises. There were no possible interactions with the technology from the users.
In our previous work [17] on the recognition of both MAs and exercises, we created our own wearable devices (custom wristband equipped with an IMU) in order to satisfy the technological requirement mentioned previously. In addition, we have achieved, based on simple machine learning algorithms (k-NN and Random Forest), recognition rates of 95 % and 97 % for MAs and exercises, respectively. Experiments were conducted in a laboratory setting with healthy participants. Hence, our results are comparable to those found in the literature. This validated prototype served as a basis for conceiving the Acti-DM1 system proposed in this paper.

III. THE ACTI-DM1 SYSTEM
The main requirements that the proposed Acti-DM1 system had to meet were the following: 1) automatically recognizes three specific exercises performed at patient's home; 2) continuously recognizes MA (running, sit to stand, stand to sit, inactive, walking) realized inside or outside the home by the patient; 3) guides the patient step-by-step through the strength-training program and reminds him to start the exercise program if the patient has not done so on the scheduled date and time (the exercise program must be executed three times a week); and 4) provides a visualization tool summarizing the activities (MA and exercise) performed by the patient throughout the day to the therapist. The proposed assistive system is composed of two main parts: the hardware and the software. The hardware part refers to the different devices we used in order to create the Acti-DM1 system while the software part dedicated to manage the communications between all devices and to perform the different tasks of activity recognition. The activity recognition algorithms are precisely detailed in Section IV. This section is devoted to the presentation of the two main parts of the proposed Acti-DM1 system.
In order to ease the reading and the understanding of the development of the proposed Acti-DM1 systems as well as its testing through a 10-week experiment, Figure 1 shows an overview of all the steps that were necessary and the tasks that were accomplished during these steps to complete this ambitious study. As the reader can see, the study consisted in 4 main steps: Prior studies, Preparation, Data collection (10-week experiment), and Analysis & Results. The duration of each step is also indicated. The blue boxes and grey boxes represent tasks/actions that have been realized through each step. When indicated, the authors will refer to this figure in the different sections of the paper.

A. HARDWARE
This work is greatly inspired by some of our previous work [17] in which we combined a Raspberry Pi 3 as a main computation unit and a custom wristband equipped with an IMU specially designed by our team. Its numerous available communication protocols and its powerful CPU make the Raspberry Pi 3 a very reliable and powerful device to use when developing a proof of concept.
As we need to monitor every activities performed by the participants, a new version of our wristband was designed in order to fix some issues that appeared in the prototype version. The most important one was its size. Asking participants to wear a device all day every day requires that the device be comfortable and of reasonable size. Accordingly, we decided to use the BLE Nano V1.5 as the main computation unit of our wristband instead of the Adafruit Feather nRF52 Bluefruit LE development board. Also, both wristbands were using a LSM9DS0 as IMU and a 400mAh battery. We also added a LED and a button to be able to easily switch from a mode to another. Typically, we used it to switch the activity recognition mode. From the mode where the data are analyzed directly on the wristband to the mode where the data are streamed to the Raspberry Pi 3 for data analysis (see Section IV). To finalize the wristband, we printed an electronic board on which we soldered every component to reduce the size and we designed a new casing. The fully-assembled device is shown in Figure 2 where we also included a view of the electronics.
As already mentioned, this wristband is an upgraded version of our previous one [17]. This task was necessary in order to fit all the requirements that the system has to meet, and appears in a grey box in the Prior studies step of Figure 1. Finally, a single USB speaker that can be plugged directly in the Raspberry Pi 3 was chosen to provide the vocal guidance to the participants.

B. SOFTWARE
In order to satisfy the different requirements (MA recognition, exercise recognition, guidance and visualization tool), many algorithmic modules were implemented. First, the wristband had to permanently recognize MAs throughout the day. Therefore, we selected a low computational cost algorithm to reduce the power consumption. This algorithm analyses, at each second, one second of data collected along three axis by the accelerometer and the gyroscope at a sampling rate of 50 Hz (more details are given in Section IV). In return, it has already been demonstrated that the recognition of the exercises could be achieved by using machine learning algorithm taking as inputs more complicated features [17], thus requiring a more powerful device to perform the computations. Consequently, data collected from the wristband when realizing the training program had to be streamed to the Raspberry Pi 3, having greater CPU capability, to accomplish the recognition. We opted for the Bluetooth Low Energy (BLE) communication protocol to send the data since it has a very low power consumption and a transmission range up to 100 meters.
Two additional issues needed to be addressed. On one hand, MAs performed outside the home also had to be recognized and quantified daily. On the other hand, how to switch from an MA recognition mode to an exercise recognition mode easily at the moment desired by the participant. For the first issue, a small software was developed to store in an array each recognized activity (two bytes per activity were allowed, granting a maximum number of instances for a single activity of up to 65536) while the participant is outside. The software, then, can transmit via BLE the stored information to the Raspberry Pi 3 when the participant reenters his home. The second issue was solved by adding a simple button and a LED to the wristband. The button allows to switch from a mode to the other and the LED indicates the current mode. Indeed, if the button is pressed and held for a few seconds, the streaming mode will start. To do so, our team applied the same compression method as presented on page 7 of [17]. This results in all the characteristics being represented as one buffer of 15 bytes. This enables the whole data to be streamed in one short BLE message.
Most of the time, the Raspberry Pi 3 will be quite passive. It will only store the activities collected by the wristband. However, when the wristband enters in its streaming mode, a complete step-by-step guidance of the training program starts. Additionally, the voice of a team member was recorded to provide voice guidance for training and reminders since we thought more suitable that participants hear instructions coming from the voice of someone they know instead of a synthesized voice. At the end of the guided training program, the Acti-DM1 system waits for the user to switch the wristband back to its original mode and reminds him if needed. The whole training program is detailed in Section V-C. The development of the required functionalities of the software and of the personalized voice assistant was two of the three VOLUME 9, 2021 main tasks to accomplish as seen in the Prior studies step of Figure 1.
Finally, a visualization tool was developed in the form of a web interface in order to facilitate the analysis of the activities and exercises carried out by the participants during the 10-week experiment. This tool is intended for physiotherapists to ensure remote monitoring of their patients in the future. Even if the web interface was completed after the experiment, it can easily be used as a near real-time application now. This web interface consists of four pages. The first page lists every participants. The second and third ones allow to access information related to MAs and exercises performed a specific week or a specific day for a given participant. An example of the third page is given in Figure 5). The last page regroups a summary of the daily activities and the performance on the prescribed exercises. There is another panel on this same page to visualize a timeline, minute by minute, rendering the activity level throughout the day.

IV. ACTIVITY RECOGNITION
There are two different sets of activities that need to be recognized in the assistive system. The first set comprises the following rather classical five MAs [18], [28]- [30]: Inactive, SitToStand, StandToSit, Walking and Running. Notice here that we regrouped the MAs Standing and Sitting into the same MA called Inactive. The recognition of those MAs has to be possible even if the participant is outside the home. The second set is the exercises prescribed by the physiotherapist. The previous version of our work [17] was considered at first. However, since the assistive system must also recognize MAs performed outside, the wristband cannot be always connected to a powerful device, namely the (Raspberry Pi 3).
Consequently, MAs performed outside should be detected via an algorithm running on the wristband only. A low computational cost algorithm has been selected to achieve this task to minimize the battery power usage. The Acti-DM1 system has been designed to manage recognition of MAs performed inside or outside as well as the physical exercises of the prescribed training program. Recall that for the latter case, the recognition is realized directly on the Raspberry Pi 3 which is powerful enough to complete the task.

A. MA RECOGNITION
In order to correctly recognize MAs, we had to take into consideration that the computation unit, namely the wristband, was way less powerful than in our previous work where the computations were done by a Raspberry Pi 3. Hence, the total number of statistical and frequency-domain features used previously (105 features for a 9-DoF IMU) to train the machine learning algorithm classifying the MAs needed to be reduced.
First, we did a first sorting of the features so that the wristband can compute them properly. We eliminated every FFT-based features, leaving us only with the temporal features. The wristband was still too slow to compute every value over time. Next, we carried out some experiments with the data and we observed that the features related to the magnetometer of the 9-DOF IMU were not discriminant in our case. We thus deactivated it. Finally, we applied a feature selection algorithm to find the most discriminant features in our dataset. It was found that the mean and standard deviation of the data collected from each axis including an additional axis called total axis which consists in the sum of the values of the three axes were the most important in performing the classification (16 features were considered). This observation is in agreement with several previous works [9], [21].
We collected data from 7 healthy student members of our lab who were asked to perform each MA 10 times. They could wear the wristband on the wrist of their choice. These data were used to train the decision tree that was used for the MA recognition of the participants. Using 10-fold crossvalidation with the C4.5 decision tree algorithm, we obtained an accuracy of 0.8543 and a F-Score of 0.8540. The confusion matrix is given in Table 1. The choice of the C4.5 decision tree algorithm as the classifier to be implemented on the wristband to perform MA recognition was motivated by two very important limitations of that one: the very limited available memory for the recognition algorithm (4 KB) and the battery has to last at least 16 hours before being recharged. To validate this choice, we compared some of the most common machine learning algorithm, namely, Random Forest (RF), Decision Tree (DT), Support Vector Machine (SVM), K-nearest neighbors (kNN), Naïve Bayes (NB) and Multilayer Perceptron (MLP). Each algorithm was evaluated on our dataset in terms of accuracy, time taken to predict one instance, and most importantly, the memory size required to store the model learned. We used the WEKA machine learning framework [31] to perform these tests on a laptop computer equipped with a i5-6200U 2.3 GHz processor. Obviously, since the wristband is equipped with a 16 MHz ARM Cortex M0 processor, it does not have the same computing power. In addition, the laptop computer does not have memory restriction. However, this allowed us to establish which algorithm reached the best accuracy, required the least memory and was the fastest to classify a new instance. The results obtained are presented in Table 2. Accuracy was computed by performing 10-folds cross-validation. The prediction time for a new instance was computed by performing a percentage split (66 % training and 33 % testing) for each algorithm and by dividing the total time taken by the model to carry out the testing part by the number of instances included in the testing dataset.  Finally, the memory size required by each model learned was estimated by considering the size of the file required to store it on the laptop computer as a WEKA model to obtain an order of magnitude allowing them to be compared. Table 2 clearly shows that C4.5 decision tree (DT) algorithm was the best candidate as it offers the best compromise between accuracy, memory size and predicting time.
It has been possible to develop the MA recognition algorithm as Prior Studies (see Figure 1) since that specific recognition task needed not to be personalized. The information provided by the MA recognition algorithm is used as an indicator of the level of activity performed by a person in a day.

B. EXERCISE RECOGNITION
The computation task for the recognition of exercises was left to the Raspberry Pi 3. By doing so, it allows for more precise exercise recognition as well as voice guidance throughout the training program. Before processing the data collected by the wristband, the data has to be compressed and then streamed Raspberry Pi 3. The compression technique we used was the same than in previous work [17] but with 15 bytes instead of 20 since we deactivated the magnetometer. Next, we implemented a fully guided training program for the participant on the Raspberry Pi 3 acting practically like a personal trainer at home. More precisely, the assistive system has to explain to the participant the exercises to execute, the number of sets and the number of repetitions for each exercise. In addition, the assistive system had to count the number of repetitions and ensure that the resting time between each set and each exercise was respected. Throughout the training, the wristband streams continuously the data collected by the IMU while the Raspberry Pi 3 manage the guidance and the exercise recognition. During the guidance, the assistive system also indicates to the user exactly when to perform a repetition and for how long; two distinct beeps are emitted, one for the start and one for the end.
The first time the Acti-DM1 system was deployed in the participant's home, the three exercises (squat, sit-stand and alternated front lunges) were performed under the supervision of the physiotherapist to make sure each participant was properly executing it. During this evaluation, we took the opportunity to calibrate the length of the time window that were to be used to recognize each exercise. As people with DM1 have a high risk of falls (10 times more often than the general healthy population [4]), all exercises are expected to be done slowly. In average, the duration needed to perform each exercise were 6.6 seconds, 6.6 seconds and 7.1 seconds, respectively. Considering that the severity of muscle impairment varies greatly from patient to patient, it was decided to use a personalized time window based on the measured individual performance. Thus, for each exercise and for each patient, the length of the time window was defined with values in the following ranges: [5,10], [6,8], and [5,10], respectively. In addition, while a participant was performing the repetition of each exercise under the supervision of the physiotherapist, inertial data streamed from the wristband were collected to build personalized dataset to help in the training of machine learning algorithms. The data collection is further explained in Section V-B. Notice here that the deployment of the Acti-DM1 system at participant's home, the evaluation of the execution of the exercises, the calibration of the time window's length, and the personalized exercise recognition algorithm as shown in the Preparation step of Figure 1 were performed in the same day.

1) FEATURE EXTRACTION
Prior to the classification, a feature extraction step must be performed. The most common time domain and frequency domain features used in the literature were selected [21], [28]. On the first hand, the time domain features are the mean, the standard deviation, the skewness, the kurtosis, the zero crossing rate and the correlation [28]. The first five were computed for every axis as well as for another axis called total axis which consists in the sum of the values of the three axes. This is done for the accelerometer and the gyroscope resulting in 40 additional features. The correlation was calculated for each combination of pairs of axes, including the total axis of the accelerometer, as well as for each combination of pairs of axes of the gyroscope (12 features). On the other hand, the following three frequency domain features were also considered: the DC component, the entropy and the energy [32]. Similarly to the time domain features, the frequency domain ones were also computed for every axis as well as for the total axis of the accelerometer and the gyroscope (24 features). This resulted in a total number of 76 additional features.

2) CLASSIFICATION
Multiple classical machine learning algorithms were available to perform the classification of the exercises from the 76 features: decision tree (C4.5), k-NN, Random Forest, Support Vector Machine, etc. However, our previous work showed that the most accurate were Random Forest and k-NN for our specific case. According to the creator of Random Forest, Breiman [33], RF combines tree predictors, where each tree samples a random vector based on the main dataset and with the same distribution for every tree in the forest. The classification occurs by combining the decision for every tree and taking the majority vote as the resulting class. In comparison, k-NN uses distances between two samples of data to classify it as a class A or B. Its most important parameter is obviously the value of k, since it is the number of neighbors that the new data is compared with. Similarly to Random Forest, the majority of neighbors from a single class will imply the resulting class. VOLUME 9, 2021

V. EXPERIMENT
The proposed Acti-DM1 system has been designed to help DM1 patients to perform a strength training program at home (with guidance and reminders), to monitor their MAs as well as to provide a visualization tool (dashboard) allowing the physiotherapist to follow their patients remotely. In order to evaluate the proposed system, we conducted an experiment which have been approved by the Ethics Review Board of the CIUSSS-SLSJ (Centre Intégré Universitaire de Santé et de Services Sociaux du Saguenay-Lac-St-Jean, Saguenay, Québec, Canada), with file number 2020-7.

A. PARTICIPANTS
The participants were recruited from a registry of 404 patients followed at the Neuromuscular Clinic of the CIUSSS-SLSJ. We performed this pilot study on men only to limit the heterogeneity related to sex. They had to have a DM1 diagnosis confirmed, be at least 18 years old and live in the Saguenay-Lac-Saint-Jean region of Quebec, Canada. An authorization with their neurologist was also required to allow them to participate. In addition, they had to have an Internet access at home and give their written consent. We thus recruited 20 participants divided into two equal groups. One group had the Acti-DM1 system at home and the other did not. The participants were randomly assigned to each group. Of the 10 participants of interest in our study (those with technology) only 5 completed the experiment and one left at the early beginning so we did not include him in the study. However, no participant left the study based on the exercise program or the technology. The causes were linked to changes in family responsibilities, surgery and death in the family. For more details, the interested reader can read the following paper [34] recently published by our research team on the clinical results obtained for both groups.

B. PROCEDURE
Once recruited, the participant had to come to three appointments with the physiotherapist to perform standardized clinical tests. The last evaluation was carried out at the participant's home at the beginning of the experiment by a physiotherapist and a member of the research team who took the opportunity to install and configure the Acti-DM1 system. This evaluation was one of the most important steps from a technological perspective. As mentioned earlier, during this evaluation, the time taken to perform one repetition of each exercise was measured to set the different time window lengths that were to be used for the exercise recognition, but more importantly, inertial data was collected to create a personalized training dataset to feed the machine learning algorithms. In particular, the participant had to perform each exercise between 10 and 15 times to build the training dataset (total of 30-45 instances). These latter tasks are summarized in Figure 1 (see the Preparation step). Obviously, this number of learning instances may seem very low, which is indeed the case. However, this is one of the biggest challenges we faced in this study, since it is not possible to ask participants to perform more repetitions of each exercise in the same day due to their limited physical condition. In addition, it is not realistic to send people to each patient's home for several days to collect data in order to build larger datasets in a context of clinical practice.
During the 10-week long experiment, the participant had to wear the wristband continuously for the whole day and recharge it at night, or at sleep. The participant also had to press the button on the bracelet to start the physical training program at the desired time. Once the button was pressed for a few seconds, the wristband would begin streaming its data to the Raspberry Pi 3, which in turn initiated the guidance of the training program. Finally, at the end of the training program, the guidance asked the participant to put the wristband back into the MAs recognition mode, by pressing the button again for a few seconds.

C. EXERCISE PROGRAM
The training program was defined by the physiotherapist for each participant. The number of sets and reps for each exercise was determined based on the physical capacity of the participant. Each participant had to perform their training program three times a week. They themselves had to choose when to perform them but they had to schedule it in advance. Most of them chose to do them every Monday, Wednesday and Friday, but the hours depended on their daily activities (work, family, etc.). Once the training program schedule has been determined by the participant and implemented, the Acti-DM1 system was to encourage him to start his training program at these specifically chosen times, if he has not already done so.
Every week, the physiotherapist called each participant for feedback. This feedback would be useful if anything was going wrong with the technology. Also, this feedback allowed the physiotherapist to ensure safety and adapt progression of the training program (add or remove sets and/or reps). If the physiotherapist decided to adapt it, the parameters of the Acti-DM1 system could be remotely modified so that the guidance would always be accurate. The reader can find in the Data collection step of Figure 1, a summary of the key actions/tasks that had to be performed throughout the 10-week experiment.

VI. RESULTS AND DISCUSSION
Many research teams present classification results using only accuracy. Indeed, even if it is the most dominant measure, it cannot be used alone. In fact, a high accuracy does not necessarily reflect a high classification performance: this is known as the accuracy paradox [35]. In that sense, it is recommended to provide more classification performance metrics, such as the F-Score, being based on the Precision and Recall. So, in this study, most of the classification statistics will be given by accuracy and F-Score. Note that all the results that will be presented in Section V-B have been obtained with the help of the open source machine learning software Weka [31].
In this study, two types of classification were involved. One for the recognition of MAs and another one for exercise recognition. This section is thus divided into two parts. The first part is dedicated to the presentation of the results related to the MA recognition. The second part focus on the results concerning the recognition of the exercises. Let us recall that the main objectives of the study were to quantify the daily level of MAs carried out by the participants, to remind the participants to carry out their training programs and to guide them in the realization of those and, finally, to recognize the exercises carried out in each training by the Acti-DM1 system. Therefore, we decided to proceed to the analysis of the data collected at the end of training program. The size of the data collected is estimated to 22.6 GB. However, it would have been possible to perform the analysis on a daily basis since each Acti-DM1 system deployed at the participants' homes was sending continuously the data collected to a server.

A. RESULTS RELATED TO THE MA RECOGNITION
The first analysis presents the MA recognition. Classification algorithms are limited by the number of classes used in the training. In other words, whatever the participant does, the classification algorithms assign one of the classes included in the training set, even if it is a completely new activity [36]. Thus, the algorithms will assign to this new activity the class corresponding to closest activity.
In order to have representative information about MAs performed during the day, we decided to create three categories corresponding to the intensity of the MA. We thus defined the following categories: Inactive, low activity, and moderate activity. They are composed with every MA previously mentioned, respectively [Inactive], [SitToStand, StandToSit] and [Walking, Running]. Once the MA recognition results are compiled on a daily basis, the activity level of a participant for each day of the 10-week experiment could be observed. For example, we could easily know how active a participant was during the day or if the participant had left their home, how many times and for how long, and the level of activity performed outside. Figure 3 demonstrates how a participant has been more active some days (Day 59) more than others (Days 14, 53, etc.). This information is of great help for the physiotherapist to remotely monitor the evolution of the participant's physical condition or at least it provides interesting clues about the patient's routine if the participant had left their home.

B. RESULTS RELATED TO THE EXERCISE RECOGNITION
The recognition of the physical exercises was the most challenging part of that study. As was pointed out in Section V-B, the number of instances of each exercise for each participant to train the algorithms was very low due their limited physical conditions. In addition, the severity of the disease being very variable according to the participants, we therefore decided to train, for each participant, two algorithms, namely k-NN and Random Forest, using only data collected during the evaluation at their home by the physiotherapist. We easily see in Table 3 that for both algorithms, the accuracy is very high for each participant. However, since the number of training instances per participant is very low (between 30 and 45 in total for the three exercises), we also built a dataset regrouping the training instances of all participants (total of 520 instances) and we evaluated some machine learning algorithms using 10-fold cross-validation on it. As it can be seen in Table 4, all algorithms obtained great performances, except Naive Bayes. We also looked at the potential of the exercise recognition algorithm to generalize to other DM1 patients. To do so, for each participant, we combined all the training instances of the other participants to build a training set, the remaining training instances were used for testing the machine learning algorithms. This technique is called LOO (Leave-One-Out). We only tested with k-NN and Random Forest as they are the best performing algorithms in Table 4. As it can be seen in Table 5, the results are mitigated. The classification results were particularly bad for Participant 1 with both algorithms. One exercise has never been correctly recognized (no F-Score). One possible explanation for this is that he was the participant with the highest degree of disease severity. The accuracy obtained for Participant 5 and 8 was also very low with Random Forest. That obtained by k-NN for Participant 1, 2, 4, 8 and 9 was also very low.
Next, one of the main goals of the Acti-DM1 system is to recognize exercises performed at home by the patient to provide remote information that could help the physiotherapist VOLUME 9, 2021  to monitor compliance with the prescribed training program. Therefore, we tested, for each participant, the performance of the exercise recognition algorithms on the data collected during the realization of the home training program during the 10-week experiment (total of 7167 instances for all participants). The ground truth of each repetition of an exercise was based on self reported information. It is important to note that some participants were excluded from the results at this point because they did not complete the 10-week experiment for medical or family reasons. Participant 1, 2, 3, 4, 5 and 7 completed the 10-week experiment, which is actually still great considering the paucity of people with DM1. Also, among the participants who completed the experiment, some missed a few training sessions when they were ill. This explains why each participant does not have the same number of training sessions in Figure 4. The evaluation of the accuracy of the recognition of exercises performed at home by each participant was carried out in two ways. The first was to use, for each participant, the trained models (Random Forest and k-NN) from his individualized dataset and test them with the data collected throughout the 10-week experiment when he was doing his physical training program (see Table 6). The second was to use the trained models (Random Forest and k-NN) from the training data of all participants combined and to test them on the data collected throughout the experiment for each participant (see Table 7). Looking at the results given in Tables 6 and 7, we notice that the best strategy to adopt for exercise recognition is when the machine learning models were trained from the data of only one participant. We also remark that the two algorithms achieve very similar classification performance in terms of accuracy and F-score.
Furthermore, we also applied a feature selection technique, called AttributeSelection, already implemented in the Weka software. The number of features has decreased by almost 75%. Then, we tested again with k-NN and we observed that the accuracy was, in average, better of 0.0681. The results obtained are shown in Table 8. Comparing with those obtained in Table 6, we find that the best exercise recognition performance is obtained with this latter method, increasing the precision of 0.0412 to reach 0.7548 and the F-Score of 0.0567 to reach 0.7242.
The real living conditions without any supervision in a context of variability in the severity of DM1 for each participant greatly complicates the task of recognizing physical exercises in term of accuracy since the limited size of the training dataset. In order to evaluate the evolution of the performance of the exercise recognition during the whole experiment, we computed, for each participant, the rate of correctly classified exercises per training. Figure 4 shows very surprising results. In particular, we can see that the accuracy of the exercise recognition of Participant 1 is almost always perfect without significant variation. On the contrary, we observe that for Participant 7, the recognition accuracy is sometimes close to 0.9 but fluctuates greatly from one training session to another, sometimes even reaching 0.45 and 0.18. A similar phenomenon occurs with Participant 4. This could perhaps indicate that the participants were less motivated to perform their exercises during these training sessions or that they performed their exercises in an unusual way. Another interesting result is given by examining the curve of Participant 2. For this one, the accuracy is always lower than 0.6 even if the accuracy on the training dataset is almost perfect. A possible explanation is that the participant began to perform their exercises poorly immediately after the home assessment meeting that served to demonstrate the exercises to be performed and to collect data to build the training dataset to feed the machine learning algorithms responsible for subsequent automatic recognition of exercises.
Likewise, as we mentioned at the end of Section III-B, we also developed a web interface to help the physiotherapist to monitor remotely different parameters related to the level of activity performed by the patient. The web interface was designed as a real-time application, but in the case of this study, we compiled the results at the end of the 10-week experiment and provided them to the web interface. Here are some examples of parameters monitored daily: time wristband worn (in percent), time active (in percent), time outside the home (in percent), time inactive (in percent), time with a moderate or a low level of activity (in percent), time outside with a moderate or a low level of activity (in percent), number  of exercises prescribed a specific day, number of exercises performed according to the technology and how many of each type, time of day when the participant carried out his training session, does a reminder to perform the training session has been sent by the system, etc. One screenshot of the web interface is shown in Figure 5. The information provided by the web interface have been selected with the assistance of clinical therapists working in the field of neuromuscular diseases.
Finally, participants were asked to give their feedbacks about the Acti-DM1 system. They said adding the assistive system to their home training program was empowering. They also liked that the system guided them through the training session. The Acti-DM1 system has been wellaccepted by the all participants. The participants raised two points for improvement. The first is linked to the size of our custom wristband which must be reduced in the future. The second is the location of the button on the wristband which should be changed to avoid involuntarily initiating the guided training program when it is not desired. As shown in Figure 1, the analysis of the results, the presentation of the web interface to the clinicians and the post-mortem meeting were parts of the Analysis & Results step.

VII. CONCLUSION AND FUTURE WORKS
In this paper, we proposed a complete assistive system called Acti-DM1 that meets the following requirements: 1) automatically recognizes three specific exercises performed at patient's home; 2) continuously recognizes MA (running, sit to stand, stand to sit, inactive, walking) realized inside or outside the home by the patient; 3) guides the patient stepby-step through a strength-training program and reminds him to start the training session if the patient has not done so on the scheduled date and time, and 4) provides a visualization tool helping the physiotherapist to monitor remotely different parameters related to the level of physical activity (MAs and exercises) performed by the patient throughout the day. As expected, we were faced with much more difficult conditions than in our previous work where the experiments were carried out in a controlled environment. Despite this, the Acti-DM1 system proves to be a promising solution for the continuous remote monitoring of the level of physical activity achieved by patients suffering from DM1 as well as to encourage and guide them in carrying out a personalized home training program.
For 5 out of 6 participants, exercise recognition achieved an accuracy of over 0.7048 on the data collected during the 10-week experiment. The precision even reached 0.9932 for one of the participants. Only one participant showed an accuracy of less than 0.7048 (0.4560). The best results were obtained when each participant has their personalized exercise recognition algorithm trained only with the data collected at their home on the day of the installation of the Acti-DM1 system. These results are very encouraging and satisfactory considering the very small number of learning instances for each participant, which is explained by the fact that patients with DM1 cannot perform more exercises when deploying the technology in their homes due to their physical condition. Incorrect or unusual performance of the exercises immediately after the initial home assessment that was used to build the exercise recognition algorithm for the 10-week experiment or a lack of motivation at certain training sessions could explain the poor accuracy achieved for some participant. Moreover, looking at the evolution of the exercise recognition accuracy per training session throughout the experiment provides some additional information very interesting for the physiotherapist. It is also very important to note that participants really appreciated to be guided throughout their training sessions and to be reminded if they forgot to perform them by the Acti-DM1 system.
Next, the proposed system provides information about MAs performed each day inside and outside the home. The intensity of the MA has been divided into three categories: Inactive, low activity and moderate activity. These categories were adopted for two reasons. The first is the need to go for a lightweight recognition algorithm capable of working on our custom wristband. Our recognition method reached an accuracy of 0.8543. The second is that people with DM1 are usually not very active. Thus, a somewhat rough quantification of the level of activity is sufficient for the physiotherapist. The Acti-DM1 system allows therapists to get many information such as how active a participant was during the day or if the participant had left their home, how many times and for how long.
However, some improvements can be made to increase the accuracy of exercise recognition. First of all, despite the human resources that would be necessary to achieve it, a second supervised training session at home after the first week could be carried out in order to create more instances to train the algorithm. Another possible alternative is to use the data collected when the participant was performing its first training sessions without supervision and combined it with those collected the day the Acti-DM1 system was deployed to train a new algorithm for the exercise recognition for the future training sessions. This alternative implies that the selfdeclared information about the realization of the training program is correct.
As future work, we want to miniaturize our custom wristband in order to make it more discreet and pretty. However, as the market for wearable devices evolves very rapidly, it is not impossible that an affordable commercial wearable device with all the flexibility that our wristband gives us will soon be available. Next, we plan to conduct further data collections involving more participants over a longer period of time by integrating other types of sensors into their homes to more accurately monitor their routine and health status. Also, as one of our hypotheses explaining the variation in the recognition rate obtained for the exercises is that it would be linked to the quality of the execution of the exercises, it would be interesting to measure whether there is a correlation between the evaluation of a therapist and the recognition rate obtained by the system. Finally, we would also like to include participants suffering from other rare neuromuscular diseases and to test, with physiotherapists, the real-time version of our web interface for the monitoring of the participants. He also works on creating sensors to monitor digital health in order to minimize the delay between an accident and its treatment. While he was a student, he founded a startup in order to help most of the elderly people live a more serene life in this country. His research interest includes the development of a sensors kit to enhance any habitation, making it a smart home. She is also a Postdoctoral Fellow with the Université du Québec à Chicoutimi, Canada. She conducts research on neuromuscular diseases and is mainly interested in the development of therapeutic interventions and the development and validation of measurement tools. He received funding from several research agencies and companies. He has authored more than 70 publications. His research interests include ambient intelligence, smart homes, assistive technologies, applied AI, and applied machine learning. He has been a member of the ACM since 2011 and the EAI since 2017. He received the Best Presentation Award and the Best Paper Award from two IEEE conferences.

PATRICK LAPOINTE
CYNTHIA GAGNON received the Ph.D. degree.
She is currently a Full Professor with the Faculty of Medicine and Health Sciences, University of Sherbrooke, Canada, and the Scientific Director of the Groupe de recherche interdisciplinaire sur les maladies neuromusculaires (GRIMN). She is also an Occupational Therapist and a full-time Career Award Researcher. She is also involved in several international research projects in relation to myotonic dystrophy type 1 (DM1), oculopharyngeal muscular dystrophy (OPMD), and autosomal recessive spastic ataxia of Charlevoix-Saguenay (ARSACS).
MÉLISSA LAVOIE received the Ph.D. degree in clinical sciences from the University of Sherbrooke, QC, Canada, in 2020, with the focus on nursing sciences.
She is currently a Professor in the module des sciences infirmières with the Université du Québec à Chicoutimi and a Researcher with the Groupe de recherche interdisciplinaire sur les maladies neuromusculaires, Centre intégré universitaire de santé et de services sociaux du Saguenay-Lac-Saint-Jean. Her research interest includes development of therapeutic education interventions adapted to people with neuromuscular diseases in order to better support them in self-management of their health.
ELISE DUCHESNE received the B.Sc. degree in physical therapy and the Ph.D. degree in physiology-endocrinology from Laval University, QC, Canada, in 2006 and 2013, respectively. She is currently an Associate Professor with the Université du Québec à Chicoutimi, Canada. As an independent researcher, she used her expertise to study muscle plasticity in highly prevalent neuromuscular diseases. Her contributions to the field of neuromuscular diseases include the study of strength training effects on skeletal muscle impairments in neuromuscular diseases, the support of trial readiness by reaching international consensus on outcome measures, and the documentation of metrological properties. He is currently a Full Professor and the Canada Research Chair in ambient intelligence and wearable devices for technology support in health with the Université du Québec à Chicoutimi, Canada. He is also the Head of the Ambient Intelligence Laboratory for the Recognition of Activities. His research is sponsored by the Canada Research Chair, the Natural Sciences and Engineering Research Council of Canada, the Quebec Research Fund on Nature and Technologies, and the Canadian Foundation for Innovation. His current research interest includes assistive technologies for elders and cognitively impaired people. VOLUME 9, 2021