Activity Classification Using Backpropagation Neural Networks for the Daily Lives of the Elderly

Activity Analysis Systems or Activity Recognition Systems for the elderly is recently a part of the smart home systems design. This assisted system normally helps the senior people to live alone in a house, safely and improve a quality of life. Therefore, learning to recognize which activities are safe is necessary for classifying the activities of the elderly. This information will give the researchers in the assistive technology some insights to understand the basic daily lives of the elderly. Moreover, it is also help the caregivers to monitor activities of the senior people while they live alone in the house. In this paper, the novel method for detecting and recognizing the activities using Backpropagation Neural Networks has been proposed. The proposed model was tested on a set of basic daily activities (lie, stand, sit, walk and dine). The proposed model was trained to construct the Backpropagation Neural Networks model and used the trained model to classify basic daily activities of the elderly. The proposed model gives the results of 0.78, 0.72 and 0.74 of precision, recall and F1 score, respectively. The discussion and future extension are also given in this paper.


I. INTRODUCTION
Over the past decade, the world is entering into an elders' society. As a result, the growth rate of the reproductive population is lower and the range of older people is getting longer. As a consequence of lower birth rates and medical evolvement, simply helps people live longer [1]. In 2015, the world population aged 60 and over accounted for 901 million people or 12 % of the population [1]. The population aged 60 and over is expected to grow at a rate of 3.26 % per year [1]. In Thailand, 32.1 % of the population is aged 60 and over [2]. In 2019, the CIA world fact book shows an elderly dependency ratio is about to reach more than 15.0 % [3]. The increasing of the elderly impacts Thailand in many dimensions, such as public policy and law; especially in the health service policy and research on smart home system.
The analysis of the activities in the daily living (ADLs: Activities of Daily Livings) of the elderly is an important step before designing a smart home system [4]. The basic information of the elderly's activities should be included in the design specification, and the designer should pay the attention that how the seniors would live safely alone in Manuscript  their house while their children are working in town.
This paper introduces the use of affordable, small devices that do not interfere with the daily use of the elderly. The smart watch or sports sensors, worn on the wrist (sports wrist worn smart device) were used to detect the movement of the elderly (accelerometer and gyroscope) [4]. The commercial products e.g., a TI sensor tag from Texas Instrument, Fitbit Versa, Samsung Gear, Garmin Fenix and Apple watch can be used to collect the movement data. The novel method for detecting and recognizing the activities using Backpropagation Neural Networks has been proposed in this paper. The model was trained using the data sets from the Opportunity Lab (these works collected the data of the activities of everyday life) [5], [6]. The popular technique used for training and testing model for classifying the activities is Backpropagation Neural Networks; that has already been proposed in the previous work [7] (the original source code was written by James McCaffrey [8], [9]). This technique can use raw data in time format (Time Domain) and it is not necessary to convert data to other data type before learning and classifying. The paper consists of 7 parts: introduction, a review of literature, human activity classification, system framework, implementation, results, and future works.

II. A REVIEW OF LITERATURE
As mentioned earlier in the previous work [4], the wrist worn device is the most popular assistive technology in the smart home systems (the seven selected smart home technologies can be classified as video monitoring, fall detection, use of robotics, shade and climate control system, lighting control system, smart watch, and video door entry system) ( Fig. 1 shows the seven assistive technologies in the smart home).
Therefore, in this work, the sensor tag from Texas Instruments Incorporated (TI) model CC2650STK has been selected to use as the wearable device for the elderly. The main function of this device is used for gathering 2 signals (accelerometer and gyroscope) as the features for training the model (offline mode) and classification task (online mode). Fig. 2 shows TI wearable device and the elderly wears the smart watch while doing a basic activity.
In this paper, the algorithm used for training and testing model for classifying the activities is Backpropagation Neural Networks. Neural network models is the artificial software created based on the biological neurons and synapses to create a system that can be used in forecasting tasks e.g. forecasting the rainfall in the harvesting period of fruits and predicting stock market prices. The basic idea is to use a set of training data (with known inputs and outputs) to fine tune the neural network, in order to solve the set of numeric constants (weights and biases) that result in the best fit of the training data. Therefore, the trained neural network model, using the best fitting constants, can make predictions on new data inputs with unknown outputs [8], [9]. Backpropagation uses mathematics to determine the direction and magnitude of neural network errors on the training data, and then modifies the weights and biases; the calculation is repeated until some stopping condition is reached. Fig. 3 shows a generic model of backpropagation neural networks; x1xn are nodes in an input layer (initial data for the neural network), this model has 1 hidden layer: node 1m (intermediate layer between input and output layers and place where all the computation is done), and an output layer: y1yl (produce the result for given inputs). Fig. 1. The survey paper has been introduced that the smart watch is the most popular technology in the smart home system [4].  Everyday activities (ADLs: Activities of Daily Livings) can be defined as the human actions in various ways of living. There are two basic types of activities: 1) Basic ADLs (BADLs) are activities that can be done every day without using any devices; such as walking, standing up, walking up and down the stairs and etc., 2) Instrumental ADLs (IADLs) are activities that can be done by using instruments; such as ironing, watching TV, and etc. Currently, the analysis and classification of human activities have a various forms of receiving information and patterns of data, e.g. CCTV streaming data will receive information in the form sequence of motion pictures (video sequence) [10]. The major drawbacks of this method are 1) the privacy; most of the senior persons are not willing to be monitoring all the time [4] (Fig. 4 shows the video monitoring screen captured the daily activity of the elderly), and 2) CCTV data does not provide the location based data. Therefore, the concept of using internal smartphone sensors were introduced [11], [12]. These methods were used mobile sensors to detect movement of the body, and then the gathered data was used in the pattern recognition step.

A. The Opportunity Dataset
The Opportunity Dataset was used for training the model [13]. This data consists of 72 body regions and 12 special motion sensory data that was captured in 25 hours, at a sample rate of 30 Hz. [5], [6]. This information can be used to analyze a set of activities based on the following 5 activities: lie, stand, sit, walk and dine, as seen in Table I.

B. Preprocessing
The signals captured from the device were separated by using the window. The window size used in this method is 10 seconds or 300 samples data; and the overlapping of each window was set to 50%. Therefore, the data was shifted to 5 seconds or 150 data samples. Normally, the layout and the pattern of the data are easy to observe, since the high frequency information is mostly combined in the low frequency region. Because of the high energy value (magnitude) is in the frequency range 0 to cut off frequency. The rest of the spectrum will have less energy in residue. From the data set used in this work, the sampling rate is 30 Hz, therefore the data is cut at 3.75 Hz. The higher frequency of 3.75 Hz and the reduced energy consumption is shown in Fig. 6.

V. IMPLEMENTATION
The backpropagation algorithm used in this study was coding in C# for training neural networks; the modified source code was developed by [7]. The implementation can be divided to 4 steps:

1) The signals capturing and the converting of the signals data to CSV file
In this step, the system created the data.csv file for storing the signals captured from the sensory device.

2) The NN settings
In this step, the system created the input columns (inputColumn) to fit the data in the csv file. It set the input nodes = the length of the input columns. It also set the number of hidden layers = 50 and the number of outputs = 5, respectively. 3) The data normalization The system computed the mean of the collected data. All data in each row will be subtracted by the mean value and the result will be squared. This normalization is used in order to eliminate those data that are extremely high or low.

4) The NN weight computing in CSV file (for the classifier training)
The model will be constructed as the results of this step; the input CSV, output CSV, and weight CSV are shown in appendix A (Table III-Table V). The class diagrams of model building (Offline mode) and testing (Online mode) are also shown in the appendix B.
International Journal of Machine Learning and Computing, Vol. 11, No. 3, May 2021 VI. RESULTS The classifying results of the proposed model are based on precision, recall, and F1 score as shown in Table II. The accurate result and the model loss from the proposed model are illustrated in Fig. 7 and Fig. 8, respectively.
where; TP is True Positive is defined as the correct classified type of activities. TN is True Negative. FP is False Positive. FN is False Negative.  Table II shows classifying results based on the proposed model, the evaluation results (precision, recall and F1 score) are also shown. The proposed model can classify all 5 classes of basic activities. It gives 0.78 and 0.72 of average precision and recall, respectively and it gives 0.74 of average F1 score. It can be concluded that Backpropagation Neural Networks model can classify class of basic activities with high accuracy.

VII. FUTURE WORKS
This paper presents the novel method for analyzing the activities of the elderly, by taking the raw data from sensors in smart watch; Backpropagation Neural Networks was used as the classifier in this work. The model was trained (offline mode) based on the characteristics of Backpropagation Neural Networks until all weights and biases reached the stopping criteria. And the model was tested in the online mode to classify the daily activities of the elderly. The future works for improving this method are listed here:  Reducing frequency (energy) using low pass filter technique; this method aims to remove unwanted frequencies of the signals by making the data smoothing.
 Improving the classification method by using Convolutional Neural Networks (CNNs) -Deep Learning. The LSTM (Long-Short Term Memory) script will be embedded to the wearable device in order to improve the performance of the system.

CONFLICT OF INTEREST
The author declares no conflict of interest.

AUTHOR CONTRIBUTIONS
Porawat Visutsak conducted the research and wrote the paper, he had also approved the final version.