Abstract
Acceleration sensor is extensively used in the field of human activity recognition, since it provides better recognition rate of human activity. Based on the principle of molecular attribute, a simple and adaptive activity recognition method is proposed using the acceleration data flow, which constitutes a serial activity, when the acceleration data are treated as the material flow with certain molecular structure. Then five molecular attributes including relative molecular mass, density, internal forces in a molecule, molecule stability, and attraction between molecules are introduced to recognize six human activities, since the closer molecular attribute means the more similar activity. Based on the calculated molecular attributes, a reliability-based voting method for human activity recognition is developed. Since each activity has respective motion cycle, a sliding window with variable sizes is put forward to enhance the recognition rate. Furthermore, adaptive incremental learning is designed to adapt to the different users. The long-time experimental results show that the proposed method is rather accurate and robust for different crowds. The average recognition rate achieves 97.2% for six human activities including walking, jogging, running, going upstairs, going downstairs, and sitting down.
Keywords
Introduction
Recently, wearable devices have been widely used in human activity monitoring, such as the monitoring of falls for the elderly, real-time patient monitoring, and the recording of motion data.1–6 To detect human activities, all kinds of sensors like accelerometers, gyroscopes or magnetometers, barometer are equipped to wearable devices. Then the devices are placed on human body at different positions so that human activities can be comprehensively judged based on data collected by these sensors.7–9 For convenience, it is also common that the sensors are also attached to a certain key position on human body.10–12
Among various sensors, accelerometry has proved itself as a practical, inexpensive, and reliable choice for human activity recognition.13,14 To enhance the recognition rate, feature extraction and pattern recognition are key techniques using the acceleration data. Feature extraction method can be categorized into statistical and structural features. Statistical features mainly include mean, median, time domain, frequency domain, standard deviation, and so on. Statistical features extract quantitative properties of sensor data, while structural features use the relationship among the mobile sensor data. Some pattern recognition techniques including classifiers, 15 incremental learning, and deep learning are introduced for the activity recognition. The common classifiers include decision tree, 16 support vector machine (SVM),17–19 Bayesian classifier,11,20 neural network, 21 artificial neural network,22,23 K-nearest neighbor (KNN), hidden Markov model, and so on. On the other hand, some mixed classifiers are also put forward to pursuit the recognition performance. In Gillette and Silverman, 24 to recognize the different activities including walking, going upstairs, and going downstairs for both old and young people, Muscillo et al. put forward the combined Kalman filter and Bayesian classifier which achieves favorable recognition performance.
The traditional batch learning methods recognize activities with fixed models, which are unable to adapt to the dynamic changes of human activity. Therefore, the sliding window 25 and incremental learning methods have been proposed to address these problems. Banos et al. 26 investigated the effect of sliding window size on the recognition rate and determined the optimal window size. Abdallah et al. 27 proposed a novel man–machine cooperative incremental learning method. When the classifier fails to identify the fuzzy activity, the program automatically starts incremental learning. Above proposed methods often heavily rely on heuristic hand-crafted feature extraction, which could hinder their generalization performance. However, the deep learning28–30 reduces the dependency on feature extraction and achieves better performance by automatically learning high-level representations of the sensor data.
When the acceleration data in
The molecular attributes are designed to recognize the human activities using the accelerometer data. The acceleration data flow is considered as a material flow with certain molecular structure. All kinds of features of the molecular attributes are used as classification basis.
By analyzing the credibility of various features and combining the principle of material similarity and compatibility, a voting mechanism-based activity classification method is proposed to improve the recognition performance.
In order to make the proposed activity recognition method adapt to different users, an incremental learning method is put forward. In the method, the samples are adjusted gradually according to the weight of the individual activity data, so that the algorithm can adapt to the different users.
This article mainly presents the human activity recognition method based on the molecular attributes. The rest of this article is structured as follows. Section “Data acquisition” introduces the device for data acquisition. Section “Definition of molecular attributes” describes the definition of the molecular attribute. Section “Voting-based classification” presents the voting-based classification. Then section “Incremental learning” derives the incremental learning method. Section “Experimental analysis” analyzes the experimental results. The conclusion is presented in section “Conclusion.”
Data acquisition
As shown in Figure 1, the data acquisition system consists of four modules which are power supply, accelerometer sensor, bluetooth, and main control module. Among them, the capacity and rated voltage of the supply battery are 250 mAh and 3.3 V, respectively. Bluetooth module realizes communication based on bluetooth version 4.0 and uses low power chip cc2541 which can reach communication range of 20 m. The main control unit is control chip MSP430. To identify basic activities like walking, running, or standing, an accelerometer sensor is attached to a specific limb like the waist. Since accelerometer measures the change of velocity over time in a three-dimensional space, so it is used to recognize the different activities. The main control chip drives the acceleration sensor by the serial peripheral interface (SPI) bus. Then the acquired accelerometer data are sent to a central server where the activity recognition takes place by the bluetooth module. The size of whole hardware device powered by the power supply module is only 3.1 cm × 3.1 cm × 2.2 cm. The size of the device is enough smaller to reduce the interference by external factors.

Illustration of data acquisition device.
Sampling frequency of the sensors has an impact on the activity recognition results during the data acquisition. The higher sampling frequency produces more data per second, which might be necessary to detect short-term events. However, the higher sampling frequency requires more communication overhead and leads the increasing in communication delay. Typical sampling frequency is varied from 20 to 100 Hz. In our system, the sampling frequency is set at 60 Hz for recognizing six kinds of activities including walking, jogging, running, going upstairs, going downstairs, and sitting down. In the following experiments, 20 subjects in good health are participated. Five hundred cycles of accelerometer data are collected for each activity, while the sensors are placed at the abdomen of each subject in the same orientation.
Definition of molecular attributes
Effective feature extraction is crucial for the subsequent activity classification using the acceleration data. However, invalid feature is useless for the activity recognition and would increase the amount of computation. In our proposed method, the three-dimensional acceleration data are directly used to constitute the molecular attributes. Figure 2 shows the data distribution of similar activities including walking, jogging, and running in three-dimensional space. It can be observed that the data of each activity are grouped within a certain region. The data of similar activities are located in adjacent regions with partial overlapping. Each activity has different accelerometer data distribution density.

Distribution of acceleration data in three-dimensional space.
In our proposed scheme, the acceleration data flows representing different activities in three-dimensional space are regarded as the material flows with different molecular structures. When each acceleration data point is considered as an atom, the data series representing a full activity cycle constitute a molecule, which is referred to as an activity molecule. Each molecule represents a cycle of a kind of activity such as a step in walking. Then the various molecule attributes such as relative molecular mass, density, attraction between molecules, internal forces in a molecule, and molecular stability are all defined and used to depict the feature of activity recognition. Assuming that
where
where
2.
where
where
3.
where
4.
where
5.
where

Illustration of an attraction-based voting.
Voting-based classification
In this section, a voting-based classification method based on the molecule attribute is proposed. First, vote assignment of feature is designed according to eigenvalue variance. Then the voting classification process is proposed to recognize the different activities using variable sliding window.
Vote assignment
Classifier is very important for activity recognition, since excellent classifier can greatly improve the recognition rate. In our scheme, a reasonable RBV classification method is designed to recognize the human activity. The molecular attributes include relative molecular mass (

Mean square errors of different attribute features.
It is unreasonable to assign the same votes to each feature because each feature has different reliability and contribution to activity classification. Therefore, the vote allocation method is designed based on the MSE of the attribute feature from 20 subjects in our scheme. Considering the walking activity as an example, the MSEs of the four features with respect to relative molecular mass, density, internal force, and stability are denoted by
where
Classification of activities
Using the extracted activity feature of the acceleration data, the eigenvalue of the recognition is obtained and used to vote and classify the activities. Figure 5 illustrates the whole voting process with the real-time acceleration data. The five features are first extracted from the real-time acceleration data and compared with the sample eigenvalue for voting. Then the activities are recognized using the voting results. Figure 5 shows the acceleration waveform calculated by the quadratic sum of the data for walking activity. It can be seen that the acceleration waveform of each activity cycle is regular, since each waveform period represents a complete activity. In the whole cycle of walking activity, 41 acceleration data are produced, but the number of acceleration data for a complete cycle of different activities is not the same. The average data volumes in a cycle (i.e. the average number of atoms in a molecule) of different activities are analyzed and listed in Table 1.

Illustration of the voting and classification procedure.
Average volume of acceleration data for different activities.
In order to effectively use acceleration data to improve the recognition rate, the design of sliding window is particularly crucial. It can also seen from Table 1 that the number of acceleration data in a complete activity period is quite different. When the size of sliding window is invariable, the recognition rate would degrade. Accordingly, a sliding window method with variable size is proposed to improve the recognition performance. The specific procedure of the proposed recognition method is described as follows:
Step 1: Different activity molecules are ranked with the number of atoms (
Step 2: Assuming that the activity order is identified as
Step 3: Using the voting-based classification, the activity is recognized with the extracted feature from acceleration data. When the recognition is completed, the vote
Step 4: Set
Using the walking activity as the example, the features of real-time data are compared with those of standard sample. If the relative error
where
Voting results.
Incremental learning
The goal of incremental learning is to increase the adaptive ability of the proposed method. The main idea of the incremental learning method is to gradually integrate new samples into old samples in proportion and adjust the samples. When the users use the samples for a long time, the samples would tend to be personalized users. Therefore, the incremental learning can effectively solve the problem of low recognition rate caused by the individual differences of users. It can be seen that the incremental learning is required when the voting interval is in [0.6NV, 0.8NV). The incremental learning is mainly realized by adjusting the sample feature in our scheme. When there is a difference between the real-time feature and the sample, it may be that different users perform the same activity. However, due to the activity difference of different users, the feature of the samples is required to be adjusted gradually to adapt to the new users. The features that require incremental learning include relative molecular mass, density, internal force in a molecule, and stability, while the attraction does not require incremental learning. The incremental learning is described as follows:
2.
where
The molecular mass can be recalculated according to the updated relative molecular mass
3.
where
Experimental analysis
In our experiments, the recognition rate of the proposed method is calculated using the acceleration sensors fixed on the abdomen of human. Sample data of 20 subjects were obtained at the early stage of the experiment. By analyzing the reliability of the feature of the sample data, votes assigned to each feature are listed as Table 3. In Table 3, the total votes
Assigned votes using RBV.
RBV: reliability-based voting; VDW: van der Waals.
When the sample data from 20 subjects were acquired in the first stage, another 15 healthy subjects were selected to validate the proposed method. Each of the subjects installing the acceleration sensors on their abdomen would perform six activities including walking, jogging, running, go upstairs, go downstairs, and sitting down in their own individual natural way. Each subject finished 500 cycles for each activity; then the acceleration data were collected at a frequency of 60 Hz in the experiments.
Effects of voting
The reliability of different features is different, so each feature has different contributions to activity classification. In the recognition method, RBV method is proposed. Other than the RBV method, the votes could also be evenly allocated on each feature (referred to as average voting, AV). In the AV method, each vote assigned to the five features is always fixed at
Average recognition rates with two different voting methods (RBV and AV).
RBV: reliability-based voting; AV: average voting.
Variable sliding window
The influence of sliding window on performance is also evaluated. The traditional sliding window is fixed, so its sliding window size is generally determined by the number of acceleration data of a complete activity. It can be seen from Table 1 that the fixed sliding window size is set to 45, while the variable sliding window size always changes according to the steps introduced in section ‘Classification of activities.’ We conducted tests on 15 subjects for over 5 h. When the relative error between the sample and real-time data feature is set to 16%, the experiment results are shown in Figure 6. It is shown that the proposed method can effectively improve the recognition rate using variable sliding window, since the variable sliding window can automatically adjust the size of sliding windows based on the each activity. Therefore, the extracting of activity feature and the following voting classification would be more accurate. However, the feature extracting and voting classification are not enough accurate for the fixed sliding window size, when the number of acceleration data in one activity cycle is different from the sliding window size.

Recognition performances using fixed sliding widow and variable sliding window: (a) walking, (b) jogging, (c) running, (d) going upstairs, (e) going downstairs, and (f) sitting down.
Incremental learning
On the other hand, the recognition rate is increased with the time accumulation due to the using of incremental learning. As can be seen from Figure 6 that the recognition rate of walking is about 91.5% with the variable sliding window at the beginning. However, the recognition rate of walking is almost increased 100% when the incremental learning improves the recognition rate using the 5-h acceleration data. Since the activity of the subjects at the beginning is different from that of the sample, it leads to the low recognition rate. The incremental learning method continually changes the sample feature, so the method can adapt to new users. But the recognition rate does not always increase to 100% and would be stable in a certain recognition rate. Sometimes, the recognition rate would descend after the peak. As shown in Figure 6(f), the activity misjudgments happen for sitting down recognition, so it leads to the wrong incremental learning.
Effects of relative error
Relative error measures the difference between the standard sample feature and the real-time data. When the relative error is smaller, the sample feature is closer to the real-time data, and vice versa. In feature-matching phase, if the relative error is equal to or smaller than the threshold value re, the feature will be voted. The performance of recognition rate is also investigated with different threshold value re. Then the experimental results are the average of 15 subjects and plotted in Figure 7.

Comparison of recognition rate under different relative errors.
It can be seen that the performance recognition ratio becomes better, when the threshold value re of relative error is increased from 0% to 16%. When
Recognition rate using different classification algorithms
We also performed recognition experiments using some other classification algorithms commonly used for activity recognition, which are, namely, Bayesian network, decision tree, and naive Bayesian (NB) tree. At the same time, the waveform features (including mean, variance, standard deviation, entropy, peak, valley, the correlation among the acceleration data along three axes, the phase difference of the acceleration data along three axes) are extracted for the training and learning of Bayesian network, decision tree, and NB tree classifiers. In the experiment, each activity has 500 complete cycles of data, and the relative error range is set to
Activity classification results using Bayesian network.
Activity classification results using decision tree.
Activity classification results using NB tree.
NB: naive Bayesian.
Table 5 shows the recognition results using Bayesian network. As can be seen that the recognition rate of sitting down activity is 96.6%, which is highest among all activities. The poorest recognition rate is 92.2% for the going upstairs activity. It can be obtained that the average recognition rate using Bayesian network is 94.1%.
When the decision tree is used to classify the activity, the results are listed in Table 6. The recognition rates for six activities including walking, jogging, running, going upstairs, going downstairs, and sitting down are 98.4%, 95.0%, 96.2%, 94.0%, 93.6%, and 97.8%, respectively. The average recognition rate achieves 95.8%. The recognition rate for walking is highest, while the recognition rate for going downstairs is lowest among six different activities.
As can be seen from Table 7 that the recognition rates of NB tree for six activities are 95.0%, 94.2%, 95.8%, 93.2%, 91.6%, and 97.2%, respectively. The average recognition rate for six activities is 94.5%. NB tree has the highest recognition rate for sitting and the lowest recognition rate for downstairs.
Table 8 shows the recognition results of six activities using traditional eigenvalues in the deep learning model deep neural network (DNN). In the DNN model, there are four layers, eight nodes in the input layer (corresponding to eight eigenvalues), sixteen nodes in the hidden layer, eight nodes in the hidden layer, and six nodes in the output layer. The network structure of DNN model is plotted in Figure 8. As can be seen from Table 8 that the recognition rate of DNN model for walking, go downstairs, and sitting down is higher than 95%, and the recognition rate for sitting down is 100%. The average recognition rate of six activities is 95.6%.
Activity classification results using DNN.
DNN: deep neural network.

Network structure of DNN model.
Table 9 shows the recognition result of SVM classifier using traditional eigenvalues to classify six activities. SVM is a robust binary classification algorithm, which supports both linear and non-linear classification. The model structure of SVM is shown in Figure 9. There are eight nodes in the input layer (corresponding to the eight types of features), sixteen nodes in the middle layer, and one node in the output layer. The kernels of SVM classifier are Gauss kernels. As can be seen from Table 9 that the recognition rate of SVM classifier for sitting down and running is higher than 95%. The recognition rate of going upstairs is low, only 89.6%. The average recognition rate of six activities is only 93.7%.
Activity classification results using SVM.
SVM: support vector machine.

Model structure of SVM classifier.
The recognition rates of our proposed method for six activities are 99.0%, 95.2%, 98.6%, 94.2%, 96.4%, and 99.6%, respectively. Among six activities, the recognition performance of sitting down is best, while the recognition performance of go upstairs is poorest. The recognition rate for similar activities (walking, jogging, running) is high using our proposed method, which can effectively solve the recognition difficulty of similar activities. The average recognition rate of the proposed method achieves 97.2%, which is always higher than the average recognition rates of Bayesian network, decision tree, NB tree, DNN, and SVM classifier.
Run time of the proposed method
In the field of human activity recognition, a large number of algorithms are mainly applied to mobile terminals with low power consumption and weak processing ability. If the run time of the algorithm is too high, it will lead to a long delay of the mobile terminal processing chip and cannot adapt to the scene of real-time recognition. When MSP430 microcontroller unit (MCU) is used as the experimental hardware environment to analyze the average time consumed by various algorithms for identifying a complete action, the experimental results are shown in Figure 10.

Average consumption time.
The average time in the experiment was obtained by classifying and calculating the average value with 50,000 complete action actions. The results show that the biggest average consumption time is DNN classifier, about 183 ms. The time consumed by SVM classifier is slightly lower than that of DNN classifier, but higher than that of other methods. The average run time of our proposed method is only 86 ms and always less than that of the other methods. The computational overhead of our proposed method is mainly concentrated on the feature extraction stage and does not involve a large number of parameters, so the average run time of our proposed method is the smallest.
Conclusion
Although activity recognition is of great significance to life and health, the difficulty of activity recognition lies in the real-time recognition of dynamic data flow. In this article, a wearable device for activity recognition is developed, which is used to collect acceleration data for activity recognition. A simple and adaptive activity recognition method based on the molecular attribute is proposed. In the proposed method, the acceleration space containing the information of a certain activity is considered as the material flow with a certain molecular structure. The statistical and structural features are extracted using the molecular attributes. Accordingly, a RBV mechanism is designed on basis of molecular feature for human activity recognition. Finally, the recognition performances of the proposed method are experimentally verified with an average recognition rate as high as 97.2%, which is higher than that of the Bayesian network, decision tree, NB tree, DNN, and SVM classifier. Our following work will be focused on the human activity recognition using the convolutional neural network (CNN), recurrent neural network (RNN), and other networks.
Footnotes
Handling Editor: Francesc Pozo
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This study is supported by National Natural Science Foundation of China Programs (grant no. 60970082) and Zhejiang Key R&D Plan (grant no. 2017C03047).
