# Feature Selections Using Minimal Redundancy Maximal Relevance Algorithm for Human Activity Recognition in Smart Home Environments

Authors: Hongqing Fang; Pei Tang; Hao Si
Journal: Journal of Healthcare Engineering
 (2020)

---

## Abstract

In this paper, maximal relevance measure and minimal redundancy maximal relevance (mRMR) algorithm (under D-R and D/R criteria) have been applied to select features and to compose different features subsets based on observed motion sensor events for human activity recognition in smart home environments. And then, the selected features subsets have been evaluated and the activity recognition accuracy rates have been compared with two probabilistic algorithms: naïve Bayes (NB) classifier and hidden Markov model (HMM). The experimental results show that not all features are beneficial to human activity recognition and different features subsets yield different human activity recognition accuracy rates. Furthermore, even the same features subset has different effect on human activity recognition accuracy rate for different activity classifiers. It is significant for researchers performing human activity recognition to consider both relevance between features and activities and redundancy among features. Generally, both maximal relevance measure and mRMR algorithm are feasible for feature selection and positive to activity recognition.


---

## Body

## 1. Introduction

The aging of population and the increasing number of the elderly who chooses to live on their own [1–3] is an indisputable social reality. To implement the goals, smart home technology can play an important role to detect and analyze health events [4] and to provide corresponding medical assistant and caregiver for frail elderly and disabled people who are unable to live independently for a long period of time and in their home far away from hospital or their families, e.g., to remind them of time to take medicine, to see the doctor, to assist them in cutting off the water, turning off the oven, etc.Actually, accurate assessment of human Activities of Daily Livings (ADLs) is the prerequisite for smart home to yield the correct service, whether it is for the elders or for the severe disabilities of health monitoring, or provide them with other relevant helps. Once the dangerous behavior is detected, smart home itself can cope with it and eliminate as much of the inhabitant’s risk as possible. Therefore, the accurate recognition of human activity in smart home is of great significance and gives a pattern for the realization of healthcare for solitary elderly or disabled as well, which is the most important process in incorporating ambient intelligence into smart environments [5–8].Recently, human activity discovery and recognition has gained a lot of interest due to its enormous potential in context aware computing systems, including smart home environments. The primary objective of human activity recognition in smart home environment is to find the interesting patterns of behavior from gathered sensor data and to recognize such patterns. Currently, one of the primary challenges of human activity recognition is the choosing of machine learning algorithms which perform better in the same sequence of sensor data collected by smart home environment during the activity. In the last years, several intelligent algorithms applied for human activity recognition in smart home have been reported. Singla, Crandall, and Cook et al. described the applications of some probability-based algorithms that include naïve Bayes (NB) classifier, Markov model (MM), and hidden Markov model (HMM) [9, 10] to train the partially labeled motion sensor events data to obtain the values of the prior parameters and then to validate the performances of the algorithms by testing the rest of labeled sensor data. Liu et al. presented a Bayesian network-based probabilistic generative framework based on Allen’s temporal relations over primitive events to characterize the structural variabilities of complex activities [11]. Gayathri et al. proposed a statistical relational learning approach which augments ontology based activity recognition with probabilistic reasoning through Markov Logic Network (MLN) [12]. Kim et al. proposed a discriminative and generative probabilistic model, conditional random field (CRF), as a more flexible alternative to HMM [13]. Zhu et al. presented a two-layer CRF model to represent the action segments and activities in a hierarchical manner, which allows the integration of both motion and various context features at different levels and automatically learns the statistics that capture the patterns of the features [14]. Chen et al. introduced a knowledge-driven approach to continuous activity recognition based on multisensor data streams in smart homes [15]. Fahim et al. introduced a novel Evolutionary Ensembles Model (EEM) that values both minor and major activities by processing each of them independently, which is based on a Genetic Algorithm (GA) to handle the nondeterministic nature of activities [16]. Fleury et al. proposed support vector machine- (SVM-)based multimodal classification of ADLs in health smart homes [17]. Wen and Wang combined Latent Dirichlet Allocation (LDA) and AdaBoost to jointly train a general activity recognition model with partially labeled data [18]. Hong et al. composed a hybrid model of Bayesian networks and support vector machines to accurately recognize human activity [19].Besides the suitable choosing of machine learning algorithms, another key point for human activity recognition in smart home is to select valid features from sensor events datasets collected in smart home environment. Usually, sensor events datasets include a large number of observed sensor events generated by various activities and any activity annotated in the dataset has various features, even redundant and irrelevant features [20]. However, these features are selected in one method in all tests, almost, and the influences of these features on the performance of classifiers are seldom addressed. Actually, the features which are irrelevant to activity recognition and redundant between initial features need to be removed prior to activity recognition. Furthermore, feature selection means to select the features subset which is the most favorable for activity recognition and compressing of data successfully.Recently, minimal redundancy maximal relevance (mRMR) feature selection algorithm has been widely applied in many researching fields, which aims to achieve the best classification performance by reducing redundancy among the selected features and maximizing their relevance to the target class. Mohamed et al. implemented the mRMR filter and a metaheuristic approach as a feature selection process for drug response microarray classification [21]. Che et al. presented a novel mutual information feature selection method based on the normalization of the maximum relevance and minimum common redundancy for nonlinear classification or regression problems [22]. Xu et al. proposed a new distributed monitoring scheme which integrates mRMR, Bayesian inference, and principal component analysis for plant-wide processes [23]. Li et al. provided a granular feature selection method with an mRMR criterion based on mutual information (MI) for multilabel learning [24]. Escalona-Vargas et al. proposed a method that uses mRMR as criteria to automatically select references for the frequency-dependent subtraction method to attenuate maternal and fetal magnetocardiograms of fetal magnetoencephalography recordings [25]. Mallik et al. developed a new framework of identifying statistically significant epigenetic biomarkers using mRMR criterion-based feature (gene) selection for multiomics dataset [26]. Tiwari calculated the weighted distance to improve the prediction performance of G-protein coupled receptors families and their subfamilies by using sequence derived properties, and the feature selection method based on fusion of mRMR and other supervised filter were provided [27]. Chen and Yan developed an optimized multilayer feedforward network by using mRMR-partial mutual information clustering integrated with least square regression to construct a soft sensor for controlling naphtha dry point [28]. Wang et al. presented a multiobjective evolutionary algorithm which employs the Pareto optimality to evaluate candidate feature subsets and finds compact feature subsets with both the maximal relevance and the minimal redundancy [29]. Morgado and Silveira proposed a multivariate procedure capable of selecting nonredundant subsets of features significantly faster than other similar methods to the diagnosis of Alzheimer’s disease and related disorders which is inspired in mRMR algorithm [30]. Kamandar and Ghassemian used a modified mRMR as a criterion for feature extraction for hyperspectral images classification based on information theoretic learning [31]. Kandaswamy et al. extracted the best features using mRMR feature selection algorithm and used the random forest algorithm to predict extracellular matrix proteins [32]. Jin et al. proposed a novel method for health monitoring and anomaly detection for cooling fans in electronic products based on Mahalanobis distance with mRMR features [33]. Unler et al. presented a hybrid filter-wrapper feature subset selection algorithm based on particle swarm optimization for support vector machine classification. The filter model is based on the mutual information and is a composite measure of feature relevance and redundancy with respect to the feature subset selected [34]. Zdravevski et al. proposed a generic feature engineering method for selecting robust features from a variety of sensors, which is from the originally recorded time series and some newly generated time series (i.e., magnitudes, first derivatives, delta series, and fast Fourier transformation- (FFT-) based series); a variety of time and frequency domain features are extracted [35, 36].Inspired by the ideas mentioned above, in this paper, maximal relevance measure and mRMR feature selection algorithm (under D-R and D/R criteria) have been applied to select features and to compose different features subsets based on the observed motion sensor events for human activity recognition in smart home environments. And then, the selected features subsets have been evaluated, and the activity recognition accuracy rates have been compared with two probabilistic algorithms: NB classifier and HMM.The rest of the paper is organized as follows: Section2 describes the smart apartment testbed, the data collection, and 13 features of observed sensor events for human activity recognition. Section 3 presents the concepts of information entropy, mutual information (MI), and minimal redundancy maximal relevance (mRMR) feature selection algorithm. Section 4 gives the training and testing activities, the features subsets selected through analyzing of maximal relevance measure, and mRMR feature selection algorithm. Finally, we present the comparison results of activity recognition accuracy rates with the selected features subsets and the performance measures of NB classifier as well as HMM. Section 5 summarizes the main contributions.


## 2. Smart Apartment Testbed and Data Collection for Human Activity Recognition

### 2.1. Smart Apartment Testbed and Data Collection

The smart apartment testbed for this research is located on Washington State University campus and is maintained as part of the Center for Advanced Studies in Adaptive Systems (CASAS) smart home project, which includes three bedrooms, one bathroom, a kitchen, and a living/dining room. The smart apartment is equipped with motion sensors distributed approximately 1 meter apart throughout the space on the ceilings, as shown in Figure1. In addition, other sensors installed provide ambient temperature readings and custom-built analog sensors provide readings for hot water, cold water, and stove burner use. Sensor data is captured using a sensor network that was designed in-house and is stored in a Structured-Query-Language (SQL) database. After collecting data from the smart apartment testbed, the sensor events are annotated for ADLs, which are used for training and testing the activity recognition algorithms [3, 4, 7, 9, 10].Figure 1
The smart apartment testbed and sensors in the apartment to monitor motion.The data gathered by CASAS smart home is represented by the following parameters, which specify the number of features that are used to describe the observed sensor events. The generalized syntax of the dataset (Cairo Dataset, 2009) isDate Time SensorID SensorValue <label>An example of the dataset of Night_wandering activity is:{2009-06-10 03 : 20 : 59.08 M006 ON Night_wandering begin2009-06-10 03 : 25 : 19.05 M012 ON2009-06-10 03 : 25 : 19.08 M011 ON2009-06-10 03 : 25 : 24.05 M011 OFF2009-06-10 03 : 25 : 24.07 M012 OFF Night_wandering end}This example shows that the observed sensor events correspond to the Night_wandering activity with concrete Date, Time, Sensor ID, Sensor Value, and activity label parameters.


### 2.2. Features of Observed Sensor Events

Considering the actual situation, each activity has 13 features of the observed sensor events:(1)
The means of logical values of Sensor IDs of each activity’s sensor events isf1.Considering that the place where each activity happens is relatively stable, therefore, selecting the average of Sensor IDs means the focus area where the activity occurs. The equation is(1)S¯i=1ni∑k=1niSik,whereS¯i is the means of Sensor IDs of activity i, ni is the number of sensors, and Sik is the kth Sensor ID of activity i.(2)
The variance of all Sensor IDs triggered by the current activity,f2, is(2)Si2=1ni∑k=1niSik−S¯i2.(3)
Day of the week, which is converted into a value in the range of 0 to 6, isf3.(4)
Previous activity, which represents the activity that occurred before the current activity, isf4.(5)
Activity length, which represents the length of the current activity measured in a number of sensor events, isf5.(6)
The logical value of the first Sensor ID triggered by the current activity isf6.(7)
The logical value of the last Sensor ID triggered by the current activity isf7.(8)
The duration of the current activity, which indicates the time interval between the last sensor and the first sensor triggered by the current activity, isf8.(9)
The beginning time of the current activity isf9.(10)
The ending time of the current activity isf10.(11)
Next activity, which represents the activity that occurred after the current activity, isf11.(12)
The mode value of the Sensor IDs triggered by the current activity isf12.(13)
The median value of the Sensor IDs triggered by the current activity isf13.Usually, the optimal features subset contains the least number of dimensions that contribute to higher recognition accuracy rate. Therefore, it is necessary to remove the remaining and unimportant features.


## 2.1. Smart Apartment Testbed and Data Collection

The smart apartment testbed for this research is located on Washington State University campus and is maintained as part of the Center for Advanced Studies in Adaptive Systems (CASAS) smart home project, which includes three bedrooms, one bathroom, a kitchen, and a living/dining room. The smart apartment is equipped with motion sensors distributed approximately 1 meter apart throughout the space on the ceilings, as shown in Figure1. In addition, other sensors installed provide ambient temperature readings and custom-built analog sensors provide readings for hot water, cold water, and stove burner use. Sensor data is captured using a sensor network that was designed in-house and is stored in a Structured-Query-Language (SQL) database. After collecting data from the smart apartment testbed, the sensor events are annotated for ADLs, which are used for training and testing the activity recognition algorithms [3, 4, 7, 9, 10].Figure 1
The smart apartment testbed and sensors in the apartment to monitor motion.The data gathered by CASAS smart home is represented by the following parameters, which specify the number of features that are used to describe the observed sensor events. The generalized syntax of the dataset (Cairo Dataset, 2009) isDate Time SensorID SensorValue <label>An example of the dataset of Night_wandering activity is:{2009-06-10 03 : 20 : 59.08 M006 ON Night_wandering begin2009-06-10 03 : 25 : 19.05 M012 ON2009-06-10 03 : 25 : 19.08 M011 ON2009-06-10 03 : 25 : 24.05 M011 OFF2009-06-10 03 : 25 : 24.07 M012 OFF Night_wandering end}This example shows that the observed sensor events correspond to the Night_wandering activity with concrete Date, Time, Sensor ID, Sensor Value, and activity label parameters.


## 2.2. Features of Observed Sensor Events

Considering the actual situation, each activity has 13 features of the observed sensor events:(1)
The means of logical values of Sensor IDs of each activity’s sensor events isf1.Considering that the place where each activity happens is relatively stable, therefore, selecting the average of Sensor IDs means the focus area where the activity occurs. The equation is(1)S¯i=1ni∑k=1niSik,whereS¯i is the means of Sensor IDs of activity i, ni is the number of sensors, and Sik is the kth Sensor ID of activity i.(2)
The variance of all Sensor IDs triggered by the current activity,f2, is(2)Si2=1ni∑k=1niSik−S¯i2.(3)
Day of the week, which is converted into a value in the range of 0 to 6, isf3.(4)
Previous activity, which represents the activity that occurred before the current activity, isf4.(5)
Activity length, which represents the length of the current activity measured in a number of sensor events, isf5.(6)
The logical value of the first Sensor ID triggered by the current activity isf6.(7)
The logical value of the last Sensor ID triggered by the current activity isf7.(8)
The duration of the current activity, which indicates the time interval between the last sensor and the first sensor triggered by the current activity, isf8.(9)
The beginning time of the current activity isf9.(10)
The ending time of the current activity isf10.(11)
Next activity, which represents the activity that occurred after the current activity, isf11.(12)
The mode value of the Sensor IDs triggered by the current activity isf12.(13)
The median value of the Sensor IDs triggered by the current activity isf13.Usually, the optimal features subset contains the least number of dimensions that contribute to higher recognition accuracy rate. Therefore, it is necessary to remove the remaining and unimportant features.


## 3. Minimal Redundancy Maximal Relevance Feature Selection Algorithm

### 3.1. Entropy

Information entropy is a more abstract mathematical concept which can be understood as the probability of the emergence of some specific information. Generally, the higher of the probability of a kind of information indicates that it is spread more widely or more highly cited. Therefore, information entropy is able to represent the value of information. The information source is the source of the message and the message sequence. For example, the simplest discrete information source isX=x1,x2,…,xn, and pxi is the probability of a given xi; then, the entropy of X can be defined as(3)HX=−∑i=1npxilogpxi.


### 3.2. Conditional Entropy, Joint Entropy, and Mutual Information

#### 3.2.1. Conditional Entropy

In information theory, the conditional entropy quantifies the amount of information needed to describe the outcome of a random variableX given that the value of another random variable Y is known. If X and Y are dependent on each other, then, in the condition of Y=y, the conditional entropy of X is(4)HX|Y=y=∑xpx|ylog1px|y.IfY is given, then the conditional entropy of X is(5)HX|Y=∑ypyHX|Y=y,=∑x,ypx,ylog1px|y,where p(x, y) is the joint probability of x and y.


#### 3.2.2. Joint Entropy

Joint entropy is a measure of the uncertainty associated with a set of random variables. Supposing two random variablesX and Y and each of them is given a limited value, then, the joint entropy is(6)HX,Y=−∑x,ypx,ylogpx,y.The joint entropy is a measure of the correlation ofX and Y. If X and Y are independent, then, the joint entropy is(7)HX,Y=HX+HY.


#### 3.2.3. Mutual Information

Mutual information (MI) is a quantity that measures the level of similarity as well as correlation of random variables [33, 37]. Supposing two random variables X and Y and Y contains some information of X, then MI between X and Y can be defined as(8)IX;Y=∑x,ypx,ylogpx,ypxpy.MI is typically defined as the measure of the mutual dependence of two random variables. A larger value of MI means a closer relationship between the two random variables which have larger correlation. If the value of MI is zero, it means that the two random variables are uncorrelated and independent. Therefore, in this paper, MI can be used to measure the similarity among features and the correlation between feature and activity.


### 3.3. Minimal Redundancy Maximal Relevance (mRMR) Algorithm

Although MI is widely applied in the feature selection fields, there still exist some deficiencies. Most of the feature selection algorithms only consider the relationship between features and classification categories but ignore the mutual influence among features. Instead, mRMR feature selection algorithm applied in this paper considers not only the amount of information provided by these features for categorical attributes but also the influence of interaction among features on classification [37].MI can weigh the quantity of information between feature variablesX and Y; furthermore, it can measure how much information quantity that X can provide to Y to classify activity as well. Therefore, MI can not only show the ability of each feature of identifying the activities, but also measure whether there is redundancy among features. According to the traits of MI, two different criteria can be extended to evaluate the features: redundancy and relevance.


#### 3.3.1. Redundancy Measure

Redundancy measure utilizes the quantity of MI between features. If the value of MI is large, it means that there is a large amount of information duplication between the two features; i.e., there are redundancies between the two features. A lower value of redundancy measure indicates a better feature selection criterion. Utilizing redundancy measure is to find the feature which has the minimal value of MI among all features.According to the idea that the smaller the value of redundancy of information between features is, the more beneficial it is to activity classification, which can be expressed by minimizing the MI among features, the minimal redundancy condition is(9)minRS,R=1s2∑xi,xj∈SIxi;xj,where s is the number of features in features subset S and Ixi;xj is MI between feature i and j.


#### 3.3.2. Relevance Measure

Relevance measure utilizes the value of MI between the feature and the target activity. If the value of MI is small, it indicates that there is a weak correlation between the feature and the target activity. On the contrary, the larger value of MI means that the feature has greater amount of information to classify the activity. Therefore, it is necessary to select the maximum value of MI between the features and the target activity, the maximal relevance criterion, which can be expressed as(10)maxDS,c,D=1S∑xi∈SIxi;c,where c is the target activity and Ixi;c is the MI between the feature i and the target activity c.Feature selection based on the maximum value of relevance measure is to compose the optimal features subset by selecting MI to target activity.


#### 3.3.3. Algorithm Designing

mRMR feature selection algorithm is based on the relevance measure and redundancy measure described above. It combines the relevance between the features and the target activity as well as the redundancy among the features [33, 37]. According to (9) and (10), the influences of relevance measure and redundancy measure have been taken consideration in feature selection, comprehensively. mRMR feature selection algorithm has two evaluation criteria, which optimizes D and R, simultaneously, as(11)maxΦ1S,c,Φ1=D−R,(12)ormaxΦ2S,c,Φ2=DR.Supposing that there is a features subsetSm which is composed of m features, the next step is to extract the optimal (m+1)th feature from the features subset S−Sm according to (11) or (12), through(13)maxxi∈S−SmIxi;c−1m∑xj∈SmIxi;xj,or(14)maxxi∈S−SmIxi;c1/m∑xj∈SmIxi;xj.The incremental procedures of mRMR feature selection algorithm are as follows:Step 1. In the original features setΩ, the optimal feature xi can be selected by Ixi;c and then put into the optimal features subset S;Step 2. In the features subsetΩS=Ω−S, the next optimal feature xj is selected which satisfies (11) or (12);Step 3. Repeat Step 2 to find the optimal features subsetS which meets the size requirement finally.


## 3.1. Entropy

Information entropy is a more abstract mathematical concept which can be understood as the probability of the emergence of some specific information. Generally, the higher of the probability of a kind of information indicates that it is spread more widely or more highly cited. Therefore, information entropy is able to represent the value of information. The information source is the source of the message and the message sequence. For example, the simplest discrete information source isX=x1,x2,…,xn, and pxi is the probability of a given xi; then, the entropy of X can be defined as(3)HX=−∑i=1npxilogpxi.


## 3.2. Conditional Entropy, Joint Entropy, and Mutual Information

### 3.2.1. Conditional Entropy

In information theory, the conditional entropy quantifies the amount of information needed to describe the outcome of a random variableX given that the value of another random variable Y is known. If X and Y are dependent on each other, then, in the condition of Y=y, the conditional entropy of X is(4)HX|Y=y=∑xpx|ylog1px|y.IfY is given, then the conditional entropy of X is(5)HX|Y=∑ypyHX|Y=y,=∑x,ypx,ylog1px|y,where p(x, y) is the joint probability of x and y.


### 3.2.2. Joint Entropy

Joint entropy is a measure of the uncertainty associated with a set of random variables. Supposing two random variablesX and Y and each of them is given a limited value, then, the joint entropy is(6)HX,Y=−∑x,ypx,ylogpx,y.The joint entropy is a measure of the correlation ofX and Y. If X and Y are independent, then, the joint entropy is(7)HX,Y=HX+HY.


### 3.2.3. Mutual Information

Mutual information (MI) is a quantity that measures the level of similarity as well as correlation of random variables [33, 37]. Supposing two random variables X and Y and Y contains some information of X, then MI between X and Y can be defined as(8)IX;Y=∑x,ypx,ylogpx,ypxpy.MI is typically defined as the measure of the mutual dependence of two random variables. A larger value of MI means a closer relationship between the two random variables which have larger correlation. If the value of MI is zero, it means that the two random variables are uncorrelated and independent. Therefore, in this paper, MI can be used to measure the similarity among features and the correlation between feature and activity.


## 3.2.1. Conditional Entropy

In information theory, the conditional entropy quantifies the amount of information needed to describe the outcome of a random variableX given that the value of another random variable Y is known. If X and Y are dependent on each other, then, in the condition of Y=y, the conditional entropy of X is(4)HX|Y=y=∑xpx|ylog1px|y.IfY is given, then the conditional entropy of X is(5)HX|Y=∑ypyHX|Y=y,=∑x,ypx,ylog1px|y,where p(x, y) is the joint probability of x and y.


## 3.2.2. Joint Entropy

Joint entropy is a measure of the uncertainty associated with a set of random variables. Supposing two random variablesX and Y and each of them is given a limited value, then, the joint entropy is(6)HX,Y=−∑x,ypx,ylogpx,y.The joint entropy is a measure of the correlation ofX and Y. If X and Y are independent, then, the joint entropy is(7)HX,Y=HX+HY.


## 3.2.3. Mutual Information

Mutual information (MI) is a quantity that measures the level of similarity as well as correlation of random variables [33, 37]. Supposing two random variables X and Y and Y contains some information of X, then MI between X and Y can be defined as(8)IX;Y=∑x,ypx,ylogpx,ypxpy.MI is typically defined as the measure of the mutual dependence of two random variables. A larger value of MI means a closer relationship between the two random variables which have larger correlation. If the value of MI is zero, it means that the two random variables are uncorrelated and independent. Therefore, in this paper, MI can be used to measure the similarity among features and the correlation between feature and activity.


## 3.3. Minimal Redundancy Maximal Relevance (mRMR) Algorithm

Although MI is widely applied in the feature selection fields, there still exist some deficiencies. Most of the feature selection algorithms only consider the relationship between features and classification categories but ignore the mutual influence among features. Instead, mRMR feature selection algorithm applied in this paper considers not only the amount of information provided by these features for categorical attributes but also the influence of interaction among features on classification [37].MI can weigh the quantity of information between feature variablesX and Y; furthermore, it can measure how much information quantity that X can provide to Y to classify activity as well. Therefore, MI can not only show the ability of each feature of identifying the activities, but also measure whether there is redundancy among features. According to the traits of MI, two different criteria can be extended to evaluate the features: redundancy and relevance.


### 3.3.1. Redundancy Measure

Redundancy measure utilizes the quantity of MI between features. If the value of MI is large, it means that there is a large amount of information duplication between the two features; i.e., there are redundancies between the two features. A lower value of redundancy measure indicates a better feature selection criterion. Utilizing redundancy measure is to find the feature which has the minimal value of MI among all features.According to the idea that the smaller the value of redundancy of information between features is, the more beneficial it is to activity classification, which can be expressed by minimizing the MI among features, the minimal redundancy condition is(9)minRS,R=1s2∑xi,xj∈SIxi;xj,where s is the number of features in features subset S and Ixi;xj is MI between feature i and j.


### 3.3.2. Relevance Measure

Relevance measure utilizes the value of MI between the feature and the target activity. If the value of MI is small, it indicates that there is a weak correlation between the feature and the target activity. On the contrary, the larger value of MI means that the feature has greater amount of information to classify the activity. Therefore, it is necessary to select the maximum value of MI between the features and the target activity, the maximal relevance criterion, which can be expressed as(10)maxDS,c,D=1S∑xi∈SIxi;c,where c is the target activity and Ixi;c is the MI between the feature i and the target activity c.Feature selection based on the maximum value of relevance measure is to compose the optimal features subset by selecting MI to target activity.


### 3.3.3. Algorithm Designing

mRMR feature selection algorithm is based on the relevance measure and redundancy measure described above. It combines the relevance between the features and the target activity as well as the redundancy among the features [33, 37]. According to (9) and (10), the influences of relevance measure and redundancy measure have been taken consideration in feature selection, comprehensively. mRMR feature selection algorithm has two evaluation criteria, which optimizes D and R, simultaneously, as(11)maxΦ1S,c,Φ1=D−R,(12)ormaxΦ2S,c,Φ2=DR.Supposing that there is a features subsetSm which is composed of m features, the next step is to extract the optimal (m+1)th feature from the features subset S−Sm according to (11) or (12), through(13)maxxi∈S−SmIxi;c−1m∑xj∈SmIxi;xj,or(14)maxxi∈S−SmIxi;c1/m∑xj∈SmIxi;xj.The incremental procedures of mRMR feature selection algorithm are as follows:Step 1. In the original features setΩ, the optimal feature xi can be selected by Ixi;c and then put into the optimal features subset S;Step 2. In the features subsetΩS=Ω−S, the next optimal feature xj is selected which satisfies (11) or (12);Step 3. Repeat Step 2 to find the optimal features subsetS which meets the size requirement finally.


## 3.3.1. Redundancy Measure

Redundancy measure utilizes the quantity of MI between features. If the value of MI is large, it means that there is a large amount of information duplication between the two features; i.e., there are redundancies between the two features. A lower value of redundancy measure indicates a better feature selection criterion. Utilizing redundancy measure is to find the feature which has the minimal value of MI among all features.According to the idea that the smaller the value of redundancy of information between features is, the more beneficial it is to activity classification, which can be expressed by minimizing the MI among features, the minimal redundancy condition is(9)minRS,R=1s2∑xi,xj∈SIxi;xj,where s is the number of features in features subset S and Ixi;xj is MI between feature i and j.


## 3.3.2. Relevance Measure

Relevance measure utilizes the value of MI between the feature and the target activity. If the value of MI is small, it indicates that there is a weak correlation between the feature and the target activity. On the contrary, the larger value of MI means that the feature has greater amount of information to classify the activity. Therefore, it is necessary to select the maximum value of MI between the features and the target activity, the maximal relevance criterion, which can be expressed as(10)maxDS,c,D=1S∑xi∈SIxi;c,where c is the target activity and Ixi;c is the MI between the feature i and the target activity c.Feature selection based on the maximum value of relevance measure is to compose the optimal features subset by selecting MI to target activity.


## 3.3.3. Algorithm Designing

mRMR feature selection algorithm is based on the relevance measure and redundancy measure described above. It combines the relevance between the features and the target activity as well as the redundancy among the features [33, 37]. According to (9) and (10), the influences of relevance measure and redundancy measure have been taken consideration in feature selection, comprehensively. mRMR feature selection algorithm has two evaluation criteria, which optimizes D and R, simultaneously, as(11)maxΦ1S,c,Φ1=D−R,(12)ormaxΦ2S,c,Φ2=DR.Supposing that there is a features subsetSm which is composed of m features, the next step is to extract the optimal (m+1)th feature from the features subset S−Sm according to (11) or (12), through(13)maxxi∈S−SmIxi;c−1m∑xj∈SmIxi;xj,or(14)maxxi∈S−SmIxi;c1/m∑xj∈SmIxi;xj.The incremental procedures of mRMR feature selection algorithm are as follows:Step 1. In the original features setΩ, the optimal feature xi can be selected by Ixi;c and then put into the optimal features subset S;Step 2. In the features subsetΩS=Ω−S, the next optimal feature xj is selected which satisfies (11) or (12);Step 3. Repeat Step 2 to find the optimal features subsetS which meets the size requirement finally.


## 4. Experimental Results

### 4.1. Training and Testing Activities

A total of 10 activities were performed in the CASAS smart apartment by 2 volunteers to provide physical training data for NB classifier and HMM. These activities include both basic and more complex ADLs that are found in clinical questionnaires. These activities are the following:(1)
Bed_to_toilet (activity 0): transition happens between bed and toilet in the night time (30 instances)(2)
Breakfast (activity 1): the resident has breakfast (48 instances)(3)
Bed (activity 2): this is the activity of sleeping in bed (207 instances)(4)
C_work (activity 3): the resident works in the office space (46 instances)(5)
Dinner (activity 4): the resident has dinner (42 instances)(6)
Laundry (activity 5): the resident cleans clothes using the laundry machine (10 instances)(7)
Leave_home (activity 6): the resident leaves smart home (69 instances)(8)
Lunch (activity 7): the resident has lunch (37 instances)(9)
Night_wandering (activity 8): the resident wanders during night time (67 instances)(10)
R_medicine (activity 9): the resident takes medicine (44 instances)The data have been collected in the CASAS smart apartment testbed for 55 days, resulting in total of 600 instances of these activities and 647, 485 collected motion sensor events. The 3-fold cross validation is applied in the data for NB classifier and HMM under the same conditions to ensure that the experimental comparison is fair [38].


### 4.2. Feature Selection with Maximal Relevance Measure

Firstly, maximal relevance (MR) measure of the 13 features has been analyzed. Usually, MI is employed as the criterion of evaluation. Since the feature with larger value of MI has the closer relationship to the target activity, therefore, the values of MI between features and activities must be calculated. By analyzing relevance measure, the ranks of the 13 features according to the values of MI are listed in Table1, and then the 13 features have been sorted in a descending order successively, composed of 13 features subsets, respectively [39].Table 1
The values of mutual information (MI) and the ranks of the 13 features.
Feature12345678910111213MI1.18790.68850.04721.17340.86281.49031.20031.32131.50841.53501.16751.18320.5304Rank61113810354219712It can be found that featuref10 has the largest value of MI, which means that f10 is the most important feature to activity recognition and has the closest relationship to the target activity. On the contrary, f3 has the smallest value of MI, which means that f3 is not discriminatory to activity recognition and has the weakest link to the target activity.Then, the 13 features subsets with MR measure are the following:Features subset 1: (f10)Features subset 2: (f10, f9)Features subset 3: (f10, f9, f6)Features subset 4: (f10, f9, f6, f8)Features subset 5: (f10, f9, f6, f8, f7)Features subset 6: (f10, f9, f6, f8, f7, f1)Features subset 7: (f10, f9, f6, f8, f7, f1, f12)Features subset 8: (f10, f9, f6, f8, f7, f1, f12, f4)Features subset 9: (f10, f9, f6, f8, f7, f1, f12, f4, f11)Features subset 10: (f10, f9, f6, f8, f7, f1, f12, f4, f11, f5)Features subset 11: (f10, f9, f6, f8, f7, f1, f12, f4, f11, f5, f2)Features subset 12: (f10, f9, f6, f8, f7, f1, f12, f4, f11, f5, f2, f13)Features subset 13: (f10, f9, f6, f8, f7, f1, f12, f4, f11, f5, f2, f13, f3)The activity recognition accuracy rate can be divided into two categories: the individual activity recognition accuracy rate (IARAR) and the total activities recognition accuracy rate (TARAR). The definitions are(15)IARAR=correct sample number of this activitythe sample number of this activity,TARAR=total correct sample numbertotal sample number.The results of activity recognition accuracy rates with the 13 features subsets of NB classifier based on MR measures are shown in Table2, and the results of HMM are shown in Table 3, respectively.Table 2
The recognition accuracy rates with all features subsets of NB classifier based on maximum relevance selection.
Features subsetActivity1234567891011121300.0000.4330.4330.3000.3000.5670.6000.5670.6000.6000.6330.6670.66710.7920.7290.9170.9380.9170.9790.9791.0000.9790.9790.9790.9790.97920.7000.6760.8840.9180.9370.9470.9520.9570.9520.9570.9570.9610.96630.0000.0220.6300.5870.6960.7170.7170.7390.7390.7610.7390.7390.73941.0001.0001.0001.0001.0001.0001.0001.0001.0001.0001.0001.0001.00050.0000.0000.3000.2000.2000.3000.3000.3000.2000.3000.3000.3000.20060.0000.0580.0720.8840.8990.8990.8990.9280.9710.9860.9860.9860.98671.0000.9191.0001.0001.0001.0001.0000.9730.9730.9730.9730.9730.97380.8810.6870.6870.7010.7160.8510.8060.8210.8060.8060.8060.8210.82190.0000.0450.1360.8180.8180.8860.8860.8860.9090.8860.8640.8640.864Total0.5350.5280.6800.8270.8430.8880.8870.8930.8950.9000.8980.9030.903Table 3
The recognition accuracy rates with all features subsets of HMM based on maximum relevance selection.
Features subsetActivity1234567891011121300.9000.9000.9000.7000.7000.7670.7670.7670.7670.7000.7330.6670.66710.0000.0000.1040.5210.8960.9380.8960.8330.7710.7920.7500.7500.75020.0000.0050.3910.6670.7970.8600.8700.8840.9130.9180.9280.9420.96130.0000.1740.7390.8040.8040.7830.7830.8040.7610.7610.7610.7610.76140.0000.0000.0000.5240.9290.9760.9760.9760.9761.0001.0000.9760.97650.0000.0000.0000.2000.3000.3000.3000.3000.2000.4000.4000.4000.20061.0000.9280.9420.9860.9860.9861.0000.9860.9860.9860.9860.9860.97170.0000.0000.0000.5140.9730.9730.9730.9460.9460.9730.9190.9730.94680.0900.1490.1790.3130.3130.7010.7010.7010.7310.7310.7760.8060.82190.0000.3860.4320.7500.9320.5680.5680.6590.9090.9320.8640.8640.864Total0.1700.2120.4050.6430.7900.8370.8380.8430.8650.8730.8720.8780.880From Tables2 and 3, the 13 features impact on the classifiers’ recognition accuracy rate can be found differently. Similarly, for NB classifier and HMM, TARARs vary from different features subsets. Generally, with the increasing of size of features subset, activity recognition accuracy rate increases. TARAR tends to be stable as the size of features subset becomes larger finally. However, the trend is not monotonic. Concretely, for NB classifier, TARAR does not improve with features subset 7 (88.7%) which introduces feature f7 in features subset 6 (88.8%). It means that not all the features are positive to activity recognition obviously and different combination of features has different effect on activity recognition accuracy rate.It also can be found that the maximal value of TARAR of NB classifier is slightly higher than that of HMM. With features subset 12, the TARAR of NB classifier reaches the maximal value 90.3%, while, for HMM, the maximal value of TARAR is 88.0% with features subset 13.Furthermore, it can be seen that the trends of IARARs of NB classifier and HMM are similar as well; i.e., with the increasing of the number of features in features subset, IARAR increases until a specific number. Again, the trends are not monotonic. For example, for activity 1, IARARs of NB classifier and HMM have risen along with the sizes of features subset. For NB classifier, the optimal value of IARAR is 100.0%, with features subset 8, and then drop down with the increasing of size of features subset. For HMM, IARAR reaches the optimal value of 93.8% with features subset 6 and then drop down with the increasing of size of features subset. Moreover, from IARARs of activity 1, it can be seen that the performances of NB classifier and HMM are different by introducing the same feature, such as featuref4, compared with features subsets 7 (97.9%) and 8 (100.0%); NB generates a positive result with this feature; however, the recognition performance of HMM does not improve, from 89.6% decreasing to 83.3%. Even with same features subset, the recognition accuracy rates may be quite different from the performances of classifiers, which can be found much more from the recognition accuracy rates for each activity. For example, the performances of NB classifier and HMM differ greatly for activities 0 with features subset 1 (0.0% vs. 90.0%) and activity 2 with features subset 3 (88.4% vs. 39.1%).Furthermore, from Table2, it is indicated that the relatively better features subset is different for each activity; e.g., for activity 3, features subset 10 yields the best result, and the accuracy rate is 76.1%, while features subset 2 generates the best result of activity 2, and the accuracy rate is 100.0%, for NB classifier. With features subset 10, IARARs of activities 3, 4, 5, and 6 are better than or equal to those of the other features subsets; the proportion is 40% for all activities. However, with features subsets 12 and 13, the IARARs of activities 0 through 2, and 4, and 6 through 8 are better than or equal to those of features subset 10; the proportions are 70%. Therefore, the optimal results of TARARs (90.3%) are of features subsets 12 and 13. Relatively, features f3 and f13 are not discriminatory to activity recognition with NB classifier.For HMM, it can be found from Table3 that features subset 10 generates the highest proportion of optimal IARARs for all activities, 40%. Concretely, with features subset 10, IARARs of activities 4, 5, 7, and 9 are better than or equal to those of the other subsets. However, features subset 13 yields the optimal TARAR of 88.0%, which is slightly higher than that of features subset 10, 87.3%. Again, it also can be concluded that feature f3 is not discriminatory to activity recognition with HMM.


### 4.3. Feature Selection with mRMR Algorithm

mRMR feature selection algorithm can be adopted to sort the 13 features and reduce the number of dimensions of features subset. This is done by analyzing the relevance of the features to the target activities on the original features set to remove the irrelevant features and keep the features which have strong correlations to the target activities and then analyzing the redundancy of the selected features to reduce the number of dimensions of features subset.According to (11) to get the value of information of different features, the results of iterations are listed in Table 4 with D-R criterion. At the beginning, the MI equation has been applied to get the first optimal feature and the result is f10. The next interaction, still according to (11), feature f6 is the optimal feature among the other remaining 12 features. And then, the ranks of each feature have been obtained successively.Table 4
The information values of feature groups under the D-R criterion.
FeatureIteration1234567891011121301.1880.6880.0471.1730.8631.4901.2001.3211.5081.5351.1681.1830.53010.4760.213−0.160−0.0090.4410.7740.3100.146−1.989—−0.0320.6070.13420.3760.230−0.0750.2810.434—0.3060.343−0.594—0.2610.3630.15130.5200.288−0.0420.430——0.4400.338−0.041—0.4530.5200.19540.4250.268−0.0300.488——0.4510.4280.206—0.518—0.19850.4740.299−0.0230.452——0.4560.4580.238———0.2166—0.173−0.0220.486——0.4540.4790.330———0.1967—0.206−0.019———0.4840.4820.326———0.2078—0.207−0.016————0.4980.365———0.2029—0.196−0.025—————0.364———0.18810—0.196−0.040—————————0.18711——−0.040—————————0.190Finally, the order of the sorted features isf10, f6, f5, f12, f11, f1, f4, f7, f8, f9, f2, f13, and f3. Again, it can be found that feature f10 is the most important feature and feature f3 is not discriminatory to activity recognition.Similarly, the information values of different feature groups can be obtained according to (12), and the results of iterations are listed in Table 5 under D/R criterion.Table 5
The information values of feature groups under the D/R criterion.
FeatureIteration1234567891011121301.1880.6880.0471.1730.8631.4901.2001.3211.5081.5351.1681.1830.53011.6681.4490.2270.9922.0472.0801.3491.1240.431—0.9742.0541.33921.4631.5020.3851.3142.013—1.3421.3500.717—1.2881.4431.39731.7771.7190.5301.579——1.5781.3440.973—1.6341.7841.58041.5561.6350.6131.712——1.6031.4791.158—1.797—1.59651.6631.7690.6741.626——1.6121.5311.187———1.68661.510—0.6591.811——1.7151.6201.321———1.68971.588—0.695———1.7731.6191.310———1.73381.586—0.732————1.6441.351———1.69491.664—0.753————1.7271.462————101.659—0.667—————1.445————11——0.671—————1.487————The order of the sorted features isf10, f6, f5, f12, f11, f2, f4, f7, f13, f8, f1, f9, and f3.Although the orders of the sorted features with D-R and D/R criteria are different, the first feature still isf10, the most important feature, the second feature is f6, and the last feature is f3, which is not discriminatory to activity recognition.According to the orders of the sorted features with D-R and D/R criteria, 13 features subsets can be obtained through adding one feature to previous features subset each time successively.The 13 features subsets under D-R criterion are the following:Features subset 1: (f10)Features subset 2: (f10, f6)Features subset 3: (f10, f6, f5)Features subset 4: (f10, f6, f5, f12)Features subset 5: (f10, f6, f5, f12, f11)Features subset 6: (f10, f6, f5, f12, f11, f1)Features subset 7: (f10, f6, f5, f12, f11, f1, f4)Features subset 8: (f10, f6, f5, f12, f11, f1, f4, f7)Features subset 9: (f10, f6, f5, f12, f11, f1, f4, f7, f8)Features subset 10: (f10, f6, f5, f12, f11, f1, f4, f7, f8, f9)Features subset 11: (f10, f6, f5, f12, f11, f1, f4, f7, f8, f9, f2)Features subset 12: (f10, f6, f5, f12, f11, f1, f4, f7, f8, f9, f2, f13)Features subset 13: (f10, f6, f5, f12, f11, f1, f4, f7, f8, f9, f2, f13, f3)And the 13 features subsets under D/R criterion are the following:Features subset 1: (f10);Features subset 2: (f10, f6)Features subset 3: (f10, f6, f5)Features subset 4: (f10, f6, f5, f12)Features subset 5: (f10, f6, f5, f12, f11)Features subset 6: (f10, f6, f5, f12, f11, f2)Features subset 7: (f10, f6, f5, f12, f11, f2, f4)Features subset 8: (f10, f6, f5, f12, f11, f2, f4, f7)Features subset 9: (f10, f6, f5, f12, f11, f2, f4, f7, f13)Features subset 10: (f10, f6, f5, f12, f11, f2, f4, f7, f13, f8)Features subset 11: (f10, f6, f5, f12, f11, f2, f4, f7, f13, f8, f1)Features subset 12: (f10, f6, f5, f12, f11, f2, f4, f7, f13, f8, f1, f9)Features subset 13: (f10, f6, f5, f12, f11, f2, f4, f7, f13, f8, f1, f9, f3)The selected features subsets have been validated by NB classifier and HMM to recognize activities. TARARs of NB classifier and HMM, with each features subset, are listed in Table6, respectively.Table 6
Comparison results of TARARs under two mRMR evaluation criteria (D-R and D/R).
Features subsetClassifierCriterion12345678910111213NBD-R0.5350.6950.8700.8700.8700.8900.8850.9020.9030.9000.8980.9030.903D/R0.5350.6950.8700.8700.8700.8800.8770.8920.8880.8870.9030.9030.903HMMD-R0.1700.2550.4470.5230.6380.7450.7700.8320.8370.8730.8720.8780.880D/R0.1700.2550.4470.5230.6380.7470.7680.8170.8370.8580.8530.8780.880It can be found that although D-R and D/R criteria are different, the features subsets which have the same number of features are similar, even the same, e.g., if the number of features is little than 6. Therefore, it can be observed that the results of the same classifier with the same number of features are very slightly different, under the two criteria. If the number of features is smaller than 6 or larger than 11, the results of TARARs are the same.Moreover, the performances of NB classifier and HMM are different even with the same features subset. Generally, with the increasing of size of features subset, TARAR increases until the size reaches a certain value. Still, the trend is not monotonic. For example, the optimal results are with features subsets 9, 12, and 13 under D-R criterion (90.3%), and the optimal result is with features subset 13 under D/R criterion (88.0%), for NB classifier. For HMM, the optimal result is with features subset 13 under D-R (88.0%) and D/R (88.0%) criteria. The results show that NB classifier and HMM yield relatively higher TARARs with features subset 5 through 13 and TARARs of NB classifier are slightly higher than those of HMM with features subsets 8 through 13, but much higher with 1 through 7, under the same criterion.Basically, it can be concluded that both D-R and D/R criteria can be applied to sort the features and then to compose features subset effectively.Tables7 and 8 (under D-R criterion) show that the optimal IARARs of activities 0, 3, 5, 6, and 9 of HMM are higher than those of NB classifier, while the optimal IARARs of the activities 1, 2, 7, and 8 of NB classifier are higher than those of HMM. The optimal IARARs of activity 4 are the same of the two classifiers. Generally, the trends of the two classifiers are nearly the same with the increasing of size of features subset. Again, the trends are not monotonic. Moreover, it can be observed that different features have different effects on activity recognition. For example, features subset 5 means introducing feature f11 to features subset 4; then, IARARs have been improved of some activities, such as activities 0, 2, 3, 4, and 7 through 9; however, IARARs of other activities are degraded or not improved, of NB classifier, as shown in Table 7.Table 7
The recognition accuracy rates with each features subset of NB classifier under the D-R criterion.
Features subsetActivity1234567891011121300.0000.0000.4000.4000.4000.6670.6670.6670.6000.6000.6330.6670.66710.7920.9790.9380.9580.9580.9580.9580.9580.9790.9790.9790.9790.97920.7000.8990.9130.9130.9130.9080.8990.9370.9470.9570.9570.9610.96630.0000.8480.8480.7610.7610.7610.7830.7830.8040.7610.7390.7390.73941.0000.9761.0001.0001.0001.0001.0001.0000.9761.0001.0001.0001.00050.0000.1000.3000.6000.6000.6000.4000.5000.6000.3000.3000.3000.20060.0000.0720.9130.9280.9570.9570.9570.9570.9860.9860.9860.9860.98671.0001.0000.9730.9730.9730.9730.9460.9730.9730.9730.9730.9730.97380.8810.8810.8210.8060.8210.8360.8510.8510.8060.8060.8060.8210.82190.0000.0450.8640.8640.7950.8860.8860.8860.8860.8860.8640.8640.864Total0.5350.6950.8700.8700.8700.8900.8850.9020.9030.9000.8980.9030.903Table 8
The recognition accuracy rates with each features subset of HMM under the D-R criterion.
Features subsetActivity1234567891011121300.9000.9000.8000.8000.8330.8670.8330.8330.7000.7000.7330.6670.66710.0000.0000.2920.2710.2500.2290.0830.5000.4580.7920.7500.7500.75020.0000.0050.1840.2560.4830.6570.7680.8600.9080.9180.9280.9420.96130.0000.8700.9350.9570.9780.9350.8910.8040.8260.7610.7610.7610.76140.0000.0000.5240.5240.7140.9521.0000.9520.9291.0001.0000.9760.97650.0000.0000.4000.7000.4000.7000.5000.5000.6000.4000.4000.4000.20061.0000.9861.0001.0001.0000.9710.9710.9860.9860.9860.9860.9860.97170.0000.0000.2970.7030.8920.9730.8920.9460.8380.9730.9190.9730.94680.0900.1190.2390.3730.3880.7010.7010.7010.7010.7310.7760.8060.82190.0000.2050.6140.7050.8860.7730.8860.9090.9550.9320.8640.8640.864Total0.1700.2550.4470.5230.6380.7450.7700.8320.8370.8730.8720.8780.880HMM has a similar result. It also can be found that, according to the different performance traits of NB classifier and HMM, the adding of the same feature has different effects on IARARs. For example, by introducing of the featuref5 to features subset 2 to compose features subset 3, IARAR of activities 0 has been improved in NB classifier apparently but degraded in HMM. By introducing of feature f11 to features subset 4 to compose features subset 5, IARAR of activity 9 of NB classifier has been degraded but improved in HMM.Furthermore, from Table7, it is also shown that, with features subset 13, IARARs of activities 0, 1, 2, 4, and 6 are better than or equal to those of the other subsets; the proportion is 50% for all activities. With features subset 9, the proportion is 40% (activities 1, 5, 6, and 9). However, with features subset 9, IARARs of activities 1, 3, 5, 6, 7, and 9 are better than or equal to those of features subset 13. Therefore, features subset 9 yields the optimal TARAR of 90.3%, which is the same as that of features subsets 12 and 13. Still, features f3 is not discriminatory to activity recognition with NB classifier.It also can be found from Table8 that, with features subset 13, IARARs of activities 2 and 8 are better than or equal to those of the other features subsets; the proportion is 20% for all activities, while features subset 13 gives the optimal TARAR of 88.0%, which is slightly higher than that of features subset 12. Moreover, with features subset 12, IARARs of activities 0, 1, and 3 to 7 and 9 are better than or equal to those of the features subset 13; the proportion is 80%. Again, it also can be concluded that feature f3 is not discriminatory to activity recognition with HMM.Under the D/R criterion, Tables9 and 10 show the activity recognition accuracy rates with each features subset of NB classifier and HMM. From the experimental results, it can be found that the performances of NB classifier and HMM with the features subsets obtained under D/R criterion are similar to those of D-R criterion, respectively.Table 9
The recognition accuracy rates with each features subset of NB classifier under the D/R criterion.
Features subsetActivity1234567891011121300.0000.0000.4000.4000.4000.7000.7000.7000.7330.6000.6000.6670.66710.7920.9790.9380.9580.9580.9380.9580.9580.9580.9580.9790.9790.97920.7000.8990.9130.9130.9130.9080.9030.9470.9470.9610.9610.9610.96630.0000.8480.8480.7610.7610.7830.7830.7830.7830.8040.8040.7390.73941.0000.9761.0001.0001.0000.9761.0000.9760.9760.9520.9521.0001.00050.0000.1000.3000.6000.6000.6000.4000.4000.4000.5000.6000.3000.20060.0000.0720.9130.9280.9570.9710.9420.9420.9420.9710.9860.9860.98671.0001.0000.9730.9730.9730.9460.9460.9460.9460.9460.9460.9730.97380.8810.8810.8210.8060.8210.8360.8510.8510.8210.7910.8060.8210.82190.0000.0450.8640.8640.7950.7500.7500.7730.7500.7270.8640.8640.864Total0.5350.6950.8700.8700.8700.8800.8770.8920.8880.8870.9030.9030.903Table 10
The recognition accuracy rates with each features subset of HMM under the D/R criterion.
Features subsetActivity1234567891011121300.9000.9000.8000.8000.8330.8330.8000.8000.8000.6670.6000.6670.66710.0000.0000.2920.2710.2500.6880.4170.6250.6250.6670.5000.7500.75020.0000.0050.1840.2560.4830.6520.7580.8650.8790.9180.9370.9420.96130.0000.8700.9350.9570.9780.9350.9130.8040.8040.8260.8260.7610.76140.0000.0000.5240.5240.7140.7380.8570.8570.8330.8810.9520.9760.97650.0000.0000.4000.7000.4000.5000.4000.5000.5000.6000.6000.4000.20061.0000.9861.0001.0001.0000.9860.9860.9860.9861.0000.9860.9860.97170.0000.0000.2970.7030.8920.9190.9190.9190.8650.8920.8110.9730.94680.0900.1190.2390.3730.3880.5220.5220.5220.7160.7460.8060.8060.82190.0000.2050.6140.7050.8860.8860.9320.9550.9320.9090.9090.8640.864Total0.1700.2550.4470.5230.6380.7470.7680.8170.8370.8580.8530.8780.880For example, for NB classifier, the optimal TARARs are 90.3% with features subsets 9, 12, and 13 under D-R criterion, which are the same to those of features subsets 11, 12, and 13 under D/R criterion. And for HMM, the optimal TARAR is 88.0% with features set 13 under D-R criterion, which is the same as that under D/R criterion.From Table9, for NB classifier, it is indicated that, with features subsets 12 and 13, IARARs of activities 1, 4, 6, and 9 are better than or equal to those of the other features subsets; the proportion is 40%, for all activities. However, with features subset 11, IARARs of activities 1, 3, 5, 6, and 9 are better than or equal to those of features subsets 12 and 13; the proportion is 50%. Features subsets 11, 12, and 13 yield the same optimal TARARs of 90.3%. Again, features f3 and f13 are not discriminatory to activity recognition with NB classifier.It also can be found from Table10, for HMM, that with features subset 13, IARARs of activities 1, 2, 4, and 8 are better than or equal to those of the other features subsets. Features subset 13 yields the optimal TARAR of 88.0%, which is slightly higher than that of features subset 12. Actually, with features subset 12, IARARs of activities 0, 1, 3, 4, 5, 6, 7, and 9 are better than or equal to those of the features subset 13; the proportion is 80%. Again, features f3 and f13 are not discriminatory to activity recognition with HMM.Table11 shows the comparison results of the optimal IARARs and TARARs of NB classifier and HMM under the three evaluation criteria (MR, D-R, and D/R) and the required minimal size of features subset, respectively.Table 11
Optimal recognition accuracy rates under three evaluation criteria (MR, D-R, and D/R) and the required minimal size of features subset (in brackets).
ActivityClassifierCriterion0123456789TotalNBMR0.667 (12)1.000 (8)0.966 (13)0.739 (10)1.000 (1)0.300 (3)0.986 (10)1.000 (1)0.881 (1)0.909 (9)0.903 (12)D-R0.667 (6)0.979 (2)0.966 (13)0.848 (2)1.000 (1)0.600 (4)0.986 (9)1.000 (1)0.881 (1)0.886 (6)0.903 (9)D/R0.733 (9)0.979 (2)0.966 (13)0.848 (2)1.000 (1)0.600 (4)0.986 (11)1.000 (1)0.881 (1)0.864 (3)0.903 (11)HMMMR0.900 (1)0.938 (6)0.961 (13)0.804 (4)1.000 (10)0.400 (10)1.000 (1)0.973 (5)0.821 (13)0.932 (5)0.880 (13)D-R0.900 (1)0.792(10)0.961 (13)0.978 (5)1.000 (7)0.700 (4)1.000 (1)0.973 (6)0.821 (13)0.955 (9)0.880 (13)D/R0.900 (1)0.750 (12)0.961 (13)0.978 (5)0.976 (12)0.700 (4)1.000 (1)0.973 (12)0.821 (13)0.955 (8)0.880 (13)It indicates that although the features subsets are different under the three evaluation criteria, however, the optimal results of IARARs and TARARs are similar to the same classifier. For example, for NB classifier, the optimal IARARs of activities 0, 2, 4, 6, 7, and 8 under MR criterion are the same as those under D-R criterion; furthermore, the optimal IARARs of activities 2, 4, 6, 7, and 8 are the same even under the three evaluation criteria, and even the optimal TARARs are the same.Similarly, for HMM, the optimal IARARs of activities 0, 2, and 6 through 8 are the same even under the three evaluation criteria. Besides, the optimal TARARs are also the same with the three evaluation criteria. Additionally, it can be found that the results of the required minimal size of features subset according to the optimal IARAR of each activity and the optimal TARAR are also similar to the same classifier. For example, for NB classifier, the required minimal sizes of features subset of activity 1 to 5 and 7 to 8, under D-R criterion, are the same as those under D/R criterion. Moreover, for activities 2, 4, 7, and 8, the required minimal sizes of features subset are the same under the three evaluation criteria. For HMM, the required minimal sizes of features subset of activities 0, 2, 6, and 8 are the same under the three evaluation criteria; the proportion is 40%. Besides, the required minimal sizes of features subset of TARARs are also the same under the three evaluation criteria.Obviously, maximal relevance measure and mRMR feature selection algorithm (under D-R and D/R criteria) are effective to feature selection for human activity recognition.


## 4.1. Training and Testing Activities

A total of 10 activities were performed in the CASAS smart apartment by 2 volunteers to provide physical training data for NB classifier and HMM. These activities include both basic and more complex ADLs that are found in clinical questionnaires. These activities are the following:(1)
Bed_to_toilet (activity 0): transition happens between bed and toilet in the night time (30 instances)(2)
Breakfast (activity 1): the resident has breakfast (48 instances)(3)
Bed (activity 2): this is the activity of sleeping in bed (207 instances)(4)
C_work (activity 3): the resident works in the office space (46 instances)(5)
Dinner (activity 4): the resident has dinner (42 instances)(6)
Laundry (activity 5): the resident cleans clothes using the laundry machine (10 instances)(7)
Leave_home (activity 6): the resident leaves smart home (69 instances)(8)
Lunch (activity 7): the resident has lunch (37 instances)(9)
Night_wandering (activity 8): the resident wanders during night time (67 instances)(10)
R_medicine (activity 9): the resident takes medicine (44 instances)The data have been collected in the CASAS smart apartment testbed for 55 days, resulting in total of 600 instances of these activities and 647, 485 collected motion sensor events. The 3-fold cross validation is applied in the data for NB classifier and HMM under the same conditions to ensure that the experimental comparison is fair [38].


## 4.2. Feature Selection with Maximal Relevance Measure

Firstly, maximal relevance (MR) measure of the 13 features has been analyzed. Usually, MI is employed as the criterion of evaluation. Since the feature with larger value of MI has the closer relationship to the target activity, therefore, the values of MI between features and activities must be calculated. By analyzing relevance measure, the ranks of the 13 features according to the values of MI are listed in Table1, and then the 13 features have been sorted in a descending order successively, composed of 13 features subsets, respectively [39].Table 1
The values of mutual information (MI) and the ranks of the 13 features.
Feature12345678910111213MI1.18790.68850.04721.17340.86281.49031.20031.32131.50841.53501.16751.18320.5304Rank61113810354219712It can be found that featuref10 has the largest value of MI, which means that f10 is the most important feature to activity recognition and has the closest relationship to the target activity. On the contrary, f3 has the smallest value of MI, which means that f3 is not discriminatory to activity recognition and has the weakest link to the target activity.Then, the 13 features subsets with MR measure are the following:Features subset 1: (f10)Features subset 2: (f10, f9)Features subset 3: (f10, f9, f6)Features subset 4: (f10, f9, f6, f8)Features subset 5: (f10, f9, f6, f8, f7)Features subset 6: (f10, f9, f6, f8, f7, f1)Features subset 7: (f10, f9, f6, f8, f7, f1, f12)Features subset 8: (f10, f9, f6, f8, f7, f1, f12, f4)Features subset 9: (f10, f9, f6, f8, f7, f1, f12, f4, f11)Features subset 10: (f10, f9, f6, f8, f7, f1, f12, f4, f11, f5)Features subset 11: (f10, f9, f6, f8, f7, f1, f12, f4, f11, f5, f2)Features subset 12: (f10, f9, f6, f8, f7, f1, f12, f4, f11, f5, f2, f13)Features subset 13: (f10, f9, f6, f8, f7, f1, f12, f4, f11, f5, f2, f13, f3)The activity recognition accuracy rate can be divided into two categories: the individual activity recognition accuracy rate (IARAR) and the total activities recognition accuracy rate (TARAR). The definitions are(15)IARAR=correct sample number of this activitythe sample number of this activity,TARAR=total correct sample numbertotal sample number.The results of activity recognition accuracy rates with the 13 features subsets of NB classifier based on MR measures are shown in Table2, and the results of HMM are shown in Table 3, respectively.Table 2
The recognition accuracy rates with all features subsets of NB classifier based on maximum relevance selection.
Features subsetActivity1234567891011121300.0000.4330.4330.3000.3000.5670.6000.5670.6000.6000.6330.6670.66710.7920.7290.9170.9380.9170.9790.9791.0000.9790.9790.9790.9790.97920.7000.6760.8840.9180.9370.9470.9520.9570.9520.9570.9570.9610.96630.0000.0220.6300.5870.6960.7170.7170.7390.7390.7610.7390.7390.73941.0001.0001.0001.0001.0001.0001.0001.0001.0001.0001.0001.0001.00050.0000.0000.3000.2000.2000.3000.3000.3000.2000.3000.3000.3000.20060.0000.0580.0720.8840.8990.8990.8990.9280.9710.9860.9860.9860.98671.0000.9191.0001.0001.0001.0001.0000.9730.9730.9730.9730.9730.97380.8810.6870.6870.7010.7160.8510.8060.8210.8060.8060.8060.8210.82190.0000.0450.1360.8180.8180.8860.8860.8860.9090.8860.8640.8640.864Total0.5350.5280.6800.8270.8430.8880.8870.8930.8950.9000.8980.9030.903Table 3
The recognition accuracy rates with all features subsets of HMM based on maximum relevance selection.
Features subsetActivity1234567891011121300.9000.9000.9000.7000.7000.7670.7670.7670.7670.7000.7330.6670.66710.0000.0000.1040.5210.8960.9380.8960.8330.7710.7920.7500.7500.75020.0000.0050.3910.6670.7970.8600.8700.8840.9130.9180.9280.9420.96130.0000.1740.7390.8040.8040.7830.7830.8040.7610.7610.7610.7610.76140.0000.0000.0000.5240.9290.9760.9760.9760.9761.0001.0000.9760.97650.0000.0000.0000.2000.3000.3000.3000.3000.2000.4000.4000.4000.20061.0000.9280.9420.9860.9860.9861.0000.9860.9860.9860.9860.9860.97170.0000.0000.0000.5140.9730.9730.9730.9460.9460.9730.9190.9730.94680.0900.1490.1790.3130.3130.7010.7010.7010.7310.7310.7760.8060.82190.0000.3860.4320.7500.9320.5680.5680.6590.9090.9320.8640.8640.864Total0.1700.2120.4050.6430.7900.8370.8380.8430.8650.8730.8720.8780.880From Tables2 and 3, the 13 features impact on the classifiers’ recognition accuracy rate can be found differently. Similarly, for NB classifier and HMM, TARARs vary from different features subsets. Generally, with the increasing of size of features subset, activity recognition accuracy rate increases. TARAR tends to be stable as the size of features subset becomes larger finally. However, the trend is not monotonic. Concretely, for NB classifier, TARAR does not improve with features subset 7 (88.7%) which introduces feature f7 in features subset 6 (88.8%). It means that not all the features are positive to activity recognition obviously and different combination of features has different effect on activity recognition accuracy rate.It also can be found that the maximal value of TARAR of NB classifier is slightly higher than that of HMM. With features subset 12, the TARAR of NB classifier reaches the maximal value 90.3%, while, for HMM, the maximal value of TARAR is 88.0% with features subset 13.Furthermore, it can be seen that the trends of IARARs of NB classifier and HMM are similar as well; i.e., with the increasing of the number of features in features subset, IARAR increases until a specific number. Again, the trends are not monotonic. For example, for activity 1, IARARs of NB classifier and HMM have risen along with the sizes of features subset. For NB classifier, the optimal value of IARAR is 100.0%, with features subset 8, and then drop down with the increasing of size of features subset. For HMM, IARAR reaches the optimal value of 93.8% with features subset 6 and then drop down with the increasing of size of features subset. Moreover, from IARARs of activity 1, it can be seen that the performances of NB classifier and HMM are different by introducing the same feature, such as featuref4, compared with features subsets 7 (97.9%) and 8 (100.0%); NB generates a positive result with this feature; however, the recognition performance of HMM does not improve, from 89.6% decreasing to 83.3%. Even with same features subset, the recognition accuracy rates may be quite different from the performances of classifiers, which can be found much more from the recognition accuracy rates for each activity. For example, the performances of NB classifier and HMM differ greatly for activities 0 with features subset 1 (0.0% vs. 90.0%) and activity 2 with features subset 3 (88.4% vs. 39.1%).Furthermore, from Table2, it is indicated that the relatively better features subset is different for each activity; e.g., for activity 3, features subset 10 yields the best result, and the accuracy rate is 76.1%, while features subset 2 generates the best result of activity 2, and the accuracy rate is 100.0%, for NB classifier. With features subset 10, IARARs of activities 3, 4, 5, and 6 are better than or equal to those of the other features subsets; the proportion is 40% for all activities. However, with features subsets 12 and 13, the IARARs of activities 0 through 2, and 4, and 6 through 8 are better than or equal to those of features subset 10; the proportions are 70%. Therefore, the optimal results of TARARs (90.3%) are of features subsets 12 and 13. Relatively, features f3 and f13 are not discriminatory to activity recognition with NB classifier.For HMM, it can be found from Table3 that features subset 10 generates the highest proportion of optimal IARARs for all activities, 40%. Concretely, with features subset 10, IARARs of activities 4, 5, 7, and 9 are better than or equal to those of the other subsets. However, features subset 13 yields the optimal TARAR of 88.0%, which is slightly higher than that of features subset 10, 87.3%. Again, it also can be concluded that feature f3 is not discriminatory to activity recognition with HMM.


## 4.3. Feature Selection with mRMR Algorithm

mRMR feature selection algorithm can be adopted to sort the 13 features and reduce the number of dimensions of features subset. This is done by analyzing the relevance of the features to the target activities on the original features set to remove the irrelevant features and keep the features which have strong correlations to the target activities and then analyzing the redundancy of the selected features to reduce the number of dimensions of features subset.According to (11) to get the value of information of different features, the results of iterations are listed in Table 4 with D-R criterion. At the beginning, the MI equation has been applied to get the first optimal feature and the result is f10. The next interaction, still according to (11), feature f6 is the optimal feature among the other remaining 12 features. And then, the ranks of each feature have been obtained successively.Table 4
The information values of feature groups under the D-R criterion.
FeatureIteration1234567891011121301.1880.6880.0471.1730.8631.4901.2001.3211.5081.5351.1681.1830.53010.4760.213−0.160−0.0090.4410.7740.3100.146−1.989—−0.0320.6070.13420.3760.230−0.0750.2810.434—0.3060.343−0.594—0.2610.3630.15130.5200.288−0.0420.430——0.4400.338−0.041—0.4530.5200.19540.4250.268−0.0300.488——0.4510.4280.206—0.518—0.19850.4740.299−0.0230.452——0.4560.4580.238———0.2166—0.173−0.0220.486——0.4540.4790.330———0.1967—0.206−0.019———0.4840.4820.326———0.2078—0.207−0.016————0.4980.365———0.2029—0.196−0.025—————0.364———0.18810—0.196−0.040—————————0.18711——−0.040—————————0.190Finally, the order of the sorted features isf10, f6, f5, f12, f11, f1, f4, f7, f8, f9, f2, f13, and f3. Again, it can be found that feature f10 is the most important feature and feature f3 is not discriminatory to activity recognition.Similarly, the information values of different feature groups can be obtained according to (12), and the results of iterations are listed in Table 5 under D/R criterion.Table 5
The information values of feature groups under the D/R criterion.
FeatureIteration1234567891011121301.1880.6880.0471.1730.8631.4901.2001.3211.5081.5351.1681.1830.53011.6681.4490.2270.9922.0472.0801.3491.1240.431—0.9742.0541.33921.4631.5020.3851.3142.013—1.3421.3500.717—1.2881.4431.39731.7771.7190.5301.579——1.5781.3440.973—1.6341.7841.58041.5561.6350.6131.712——1.6031.4791.158—1.797—1.59651.6631.7690.6741.626——1.6121.5311.187———1.68661.510—0.6591.811——1.7151.6201.321———1.68971.588—0.695———1.7731.6191.310———1.73381.586—0.732————1.6441.351———1.69491.664—0.753————1.7271.462————101.659—0.667—————1.445————11——0.671—————1.487————The order of the sorted features isf10, f6, f5, f12, f11, f2, f4, f7, f13, f8, f1, f9, and f3.Although the orders of the sorted features with D-R and D/R criteria are different, the first feature still isf10, the most important feature, the second feature is f6, and the last feature is f3, which is not discriminatory to activity recognition.According to the orders of the sorted features with D-R and D/R criteria, 13 features subsets can be obtained through adding one feature to previous features subset each time successively.The 13 features subsets under D-R criterion are the following:Features subset 1: (f10)Features subset 2: (f10, f6)Features subset 3: (f10, f6, f5)Features subset 4: (f10, f6, f5, f12)Features subset 5: (f10, f6, f5, f12, f11)Features subset 6: (f10, f6, f5, f12, f11, f1)Features subset 7: (f10, f6, f5, f12, f11, f1, f4)Features subset 8: (f10, f6, f5, f12, f11, f1, f4, f7)Features subset 9: (f10, f6, f5, f12, f11, f1, f4, f7, f8)Features subset 10: (f10, f6, f5, f12, f11, f1, f4, f7, f8, f9)Features subset 11: (f10, f6, f5, f12, f11, f1, f4, f7, f8, f9, f2)Features subset 12: (f10, f6, f5, f12, f11, f1, f4, f7, f8, f9, f2, f13)Features subset 13: (f10, f6, f5, f12, f11, f1, f4, f7, f8, f9, f2, f13, f3)And the 13 features subsets under D/R criterion are the following:Features subset 1: (f10);Features subset 2: (f10, f6)Features subset 3: (f10, f6, f5)Features subset 4: (f10, f6, f5, f12)Features subset 5: (f10, f6, f5, f12, f11)Features subset 6: (f10, f6, f5, f12, f11, f2)Features subset 7: (f10, f6, f5, f12, f11, f2, f4)Features subset 8: (f10, f6, f5, f12, f11, f2, f4, f7)Features subset 9: (f10, f6, f5, f12, f11, f2, f4, f7, f13)Features subset 10: (f10, f6, f5, f12, f11, f2, f4, f7, f13, f8)Features subset 11: (f10, f6, f5, f12, f11, f2, f4, f7, f13, f8, f1)Features subset 12: (f10, f6, f5, f12, f11, f2, f4, f7, f13, f8, f1, f9)Features subset 13: (f10, f6, f5, f12, f11, f2, f4, f7, f13, f8, f1, f9, f3)The selected features subsets have been validated by NB classifier and HMM to recognize activities. TARARs of NB classifier and HMM, with each features subset, are listed in Table6, respectively.Table 6
Comparison results of TARARs under two mRMR evaluation criteria (D-R and D/R).
Features subsetClassifierCriterion12345678910111213NBD-R0.5350.6950.8700.8700.8700.8900.8850.9020.9030.9000.8980.9030.903D/R0.5350.6950.8700.8700.8700.8800.8770.8920.8880.8870.9030.9030.903HMMD-R0.1700.2550.4470.5230.6380.7450.7700.8320.8370.8730.8720.8780.880D/R0.1700.2550.4470.5230.6380.7470.7680.8170.8370.8580.8530.8780.880It can be found that although D-R and D/R criteria are different, the features subsets which have the same number of features are similar, even the same, e.g., if the number of features is little than 6. Therefore, it can be observed that the results of the same classifier with the same number of features are very slightly different, under the two criteria. If the number of features is smaller than 6 or larger than 11, the results of TARARs are the same.Moreover, the performances of NB classifier and HMM are different even with the same features subset. Generally, with the increasing of size of features subset, TARAR increases until the size reaches a certain value. Still, the trend is not monotonic. For example, the optimal results are with features subsets 9, 12, and 13 under D-R criterion (90.3%), and the optimal result is with features subset 13 under D/R criterion (88.0%), for NB classifier. For HMM, the optimal result is with features subset 13 under D-R (88.0%) and D/R (88.0%) criteria. The results show that NB classifier and HMM yield relatively higher TARARs with features subset 5 through 13 and TARARs of NB classifier are slightly higher than those of HMM with features subsets 8 through 13, but much higher with 1 through 7, under the same criterion.Basically, it can be concluded that both D-R and D/R criteria can be applied to sort the features and then to compose features subset effectively.Tables7 and 8 (under D-R criterion) show that the optimal IARARs of activities 0, 3, 5, 6, and 9 of HMM are higher than those of NB classifier, while the optimal IARARs of the activities 1, 2, 7, and 8 of NB classifier are higher than those of HMM. The optimal IARARs of activity 4 are the same of the two classifiers. Generally, the trends of the two classifiers are nearly the same with the increasing of size of features subset. Again, the trends are not monotonic. Moreover, it can be observed that different features have different effects on activity recognition. For example, features subset 5 means introducing feature f11 to features subset 4; then, IARARs have been improved of some activities, such as activities 0, 2, 3, 4, and 7 through 9; however, IARARs of other activities are degraded or not improved, of NB classifier, as shown in Table 7.Table 7
The recognition accuracy rates with each features subset of NB classifier under the D-R criterion.
Features subsetActivity1234567891011121300.0000.0000.4000.4000.4000.6670.6670.6670.6000.6000.6330.6670.66710.7920.9790.9380.9580.9580.9580.9580.9580.9790.9790.9790.9790.97920.7000.8990.9130.9130.9130.9080.8990.9370.9470.9570.9570.9610.96630.0000.8480.8480.7610.7610.7610.7830.7830.8040.7610.7390.7390.73941.0000.9761.0001.0001.0001.0001.0001.0000.9761.0001.0001.0001.00050.0000.1000.3000.6000.6000.6000.4000.5000.6000.3000.3000.3000.20060.0000.0720.9130.9280.9570.9570.9570.9570.9860.9860.9860.9860.98671.0001.0000.9730.9730.9730.9730.9460.9730.9730.9730.9730.9730.97380.8810.8810.8210.8060.8210.8360.8510.8510.8060.8060.8060.8210.82190.0000.0450.8640.8640.7950.8860.8860.8860.8860.8860.8640.8640.864Total0.5350.6950.8700.8700.8700.8900.8850.9020.9030.9000.8980.9030.903Table 8
The recognition accuracy rates with each features subset of HMM under the D-R criterion.
Features subsetActivity1234567891011121300.9000.9000.8000.8000.8330.8670.8330.8330.7000.7000.7330.6670.66710.0000.0000.2920.2710.2500.2290.0830.5000.4580.7920.7500.7500.75020.0000.0050.1840.2560.4830.6570.7680.8600.9080.9180.9280.9420.96130.0000.8700.9350.9570.9780.9350.8910.8040.8260.7610.7610.7610.76140.0000.0000.5240.5240.7140.9521.0000.9520.9291.0001.0000.9760.97650.0000.0000.4000.7000.4000.7000.5000.5000.6000.4000.4000.4000.20061.0000.9861.0001.0001.0000.9710.9710.9860.9860.9860.9860.9860.97170.0000.0000.2970.7030.8920.9730.8920.9460.8380.9730.9190.9730.94680.0900.1190.2390.3730.3880.7010.7010.7010.7010.7310.7760.8060.82190.0000.2050.6140.7050.8860.7730.8860.9090.9550.9320.8640.8640.864Total0.1700.2550.4470.5230.6380.7450.7700.8320.8370.8730.8720.8780.880HMM has a similar result. It also can be found that, according to the different performance traits of NB classifier and HMM, the adding of the same feature has different effects on IARARs. For example, by introducing of the featuref5 to features subset 2 to compose features subset 3, IARAR of activities 0 has been improved in NB classifier apparently but degraded in HMM. By introducing of feature f11 to features subset 4 to compose features subset 5, IARAR of activity 9 of NB classifier has been degraded but improved in HMM.Furthermore, from Table7, it is also shown that, with features subset 13, IARARs of activities 0, 1, 2, 4, and 6 are better than or equal to those of the other subsets; the proportion is 50% for all activities. With features subset 9, the proportion is 40% (activities 1, 5, 6, and 9). However, with features subset 9, IARARs of activities 1, 3, 5, 6, 7, and 9 are better than or equal to those of features subset 13. Therefore, features subset 9 yields the optimal TARAR of 90.3%, which is the same as that of features subsets 12 and 13. Still, features f3 is not discriminatory to activity recognition with NB classifier.It also can be found from Table8 that, with features subset 13, IARARs of activities 2 and 8 are better than or equal to those of the other features subsets; the proportion is 20% for all activities, while features subset 13 gives the optimal TARAR of 88.0%, which is slightly higher than that of features subset 12. Moreover, with features subset 12, IARARs of activities 0, 1, and 3 to 7 and 9 are better than or equal to those of the features subset 13; the proportion is 80%. Again, it also can be concluded that feature f3 is not discriminatory to activity recognition with HMM.Under the D/R criterion, Tables9 and 10 show the activity recognition accuracy rates with each features subset of NB classifier and HMM. From the experimental results, it can be found that the performances of NB classifier and HMM with the features subsets obtained under D/R criterion are similar to those of D-R criterion, respectively.Table 9
The recognition accuracy rates with each features subset of NB classifier under the D/R criterion.
Features subsetActivity1234567891011121300.0000.0000.4000.4000.4000.7000.7000.7000.7330.6000.6000.6670.66710.7920.9790.9380.9580.9580.9380.9580.9580.9580.9580.9790.9790.97920.7000.8990.9130.9130.9130.9080.9030.9470.9470.9610.9610.9610.96630.0000.8480.8480.7610.7610.7830.7830.7830.7830.8040.8040.7390.73941.0000.9761.0001.0001.0000.9761.0000.9760.9760.9520.9521.0001.00050.0000.1000.3000.6000.6000.6000.4000.4000.4000.5000.6000.3000.20060.0000.0720.9130.9280.9570.9710.9420.9420.9420.9710.9860.9860.98671.0001.0000.9730.9730.9730.9460.9460.9460.9460.9460.9460.9730.97380.8810.8810.8210.8060.8210.8360.8510.8510.8210.7910.8060.8210.82190.0000.0450.8640.8640.7950.7500.7500.7730.7500.7270.8640.8640.864Total0.5350.6950.8700.8700.8700.8800.8770.8920.8880.8870.9030.9030.903Table 10
The recognition accuracy rates with each features subset of HMM under the D/R criterion.
Features subsetActivity1234567891011121300.9000.9000.8000.8000.8330.8330.8000.8000.8000.6670.6000.6670.66710.0000.0000.2920.2710.2500.6880.4170.6250.6250.6670.5000.7500.75020.0000.0050.1840.2560.4830.6520.7580.8650.8790.9180.9370.9420.96130.0000.8700.9350.9570.9780.9350.9130.8040.8040.8260.8260.7610.76140.0000.0000.5240.5240.7140.7380.8570.8570.8330.8810.9520.9760.97650.0000.0000.4000.7000.4000.5000.4000.5000.5000.6000.6000.4000.20061.0000.9861.0001.0001.0000.9860.9860.9860.9861.0000.9860.9860.97170.0000.0000.2970.7030.8920.9190.9190.9190.8650.8920.8110.9730.94680.0900.1190.2390.3730.3880.5220.5220.5220.7160.7460.8060.8060.82190.0000.2050.6140.7050.8860.8860.9320.9550.9320.9090.9090.8640.864Total0.1700.2550.4470.5230.6380.7470.7680.8170.8370.8580.8530.8780.880For example, for NB classifier, the optimal TARARs are 90.3% with features subsets 9, 12, and 13 under D-R criterion, which are the same to those of features subsets 11, 12, and 13 under D/R criterion. And for HMM, the optimal TARAR is 88.0% with features set 13 under D-R criterion, which is the same as that under D/R criterion.From Table9, for NB classifier, it is indicated that, with features subsets 12 and 13, IARARs of activities 1, 4, 6, and 9 are better than or equal to those of the other features subsets; the proportion is 40%, for all activities. However, with features subset 11, IARARs of activities 1, 3, 5, 6, and 9 are better than or equal to those of features subsets 12 and 13; the proportion is 50%. Features subsets 11, 12, and 13 yield the same optimal TARARs of 90.3%. Again, features f3 and f13 are not discriminatory to activity recognition with NB classifier.It also can be found from Table10, for HMM, that with features subset 13, IARARs of activities 1, 2, 4, and 8 are better than or equal to those of the other features subsets. Features subset 13 yields the optimal TARAR of 88.0%, which is slightly higher than that of features subset 12. Actually, with features subset 12, IARARs of activities 0, 1, 3, 4, 5, 6, 7, and 9 are better than or equal to those of the features subset 13; the proportion is 80%. Again, features f3 and f13 are not discriminatory to activity recognition with HMM.Table11 shows the comparison results of the optimal IARARs and TARARs of NB classifier and HMM under the three evaluation criteria (MR, D-R, and D/R) and the required minimal size of features subset, respectively.Table 11
Optimal recognition accuracy rates under three evaluation criteria (MR, D-R, and D/R) and the required minimal size of features subset (in brackets).
ActivityClassifierCriterion0123456789TotalNBMR0.667 (12)1.000 (8)0.966 (13)0.739 (10)1.000 (1)0.300 (3)0.986 (10)1.000 (1)0.881 (1)0.909 (9)0.903 (12)D-R0.667 (6)0.979 (2)0.966 (13)0.848 (2)1.000 (1)0.600 (4)0.986 (9)1.000 (1)0.881 (1)0.886 (6)0.903 (9)D/R0.733 (9)0.979 (2)0.966 (13)0.848 (2)1.000 (1)0.600 (4)0.986 (11)1.000 (1)0.881 (1)0.864 (3)0.903 (11)HMMMR0.900 (1)0.938 (6)0.961 (13)0.804 (4)1.000 (10)0.400 (10)1.000 (1)0.973 (5)0.821 (13)0.932 (5)0.880 (13)D-R0.900 (1)0.792(10)0.961 (13)0.978 (5)1.000 (7)0.700 (4)1.000 (1)0.973 (6)0.821 (13)0.955 (9)0.880 (13)D/R0.900 (1)0.750 (12)0.961 (13)0.978 (5)0.976 (12)0.700 (4)1.000 (1)0.973 (12)0.821 (13)0.955 (8)0.880 (13)It indicates that although the features subsets are different under the three evaluation criteria, however, the optimal results of IARARs and TARARs are similar to the same classifier. For example, for NB classifier, the optimal IARARs of activities 0, 2, 4, 6, 7, and 8 under MR criterion are the same as those under D-R criterion; furthermore, the optimal IARARs of activities 2, 4, 6, 7, and 8 are the same even under the three evaluation criteria, and even the optimal TARARs are the same.Similarly, for HMM, the optimal IARARs of activities 0, 2, and 6 through 8 are the same even under the three evaluation criteria. Besides, the optimal TARARs are also the same with the three evaluation criteria. Additionally, it can be found that the results of the required minimal size of features subset according to the optimal IARAR of each activity and the optimal TARAR are also similar to the same classifier. For example, for NB classifier, the required minimal sizes of features subset of activity 1 to 5 and 7 to 8, under D-R criterion, are the same as those under D/R criterion. Moreover, for activities 2, 4, 7, and 8, the required minimal sizes of features subset are the same under the three evaluation criteria. For HMM, the required minimal sizes of features subset of activities 0, 2, 6, and 8 are the same under the three evaluation criteria; the proportion is 40%. Besides, the required minimal sizes of features subset of TARARs are also the same under the three evaluation criteria.Obviously, maximal relevance measure and mRMR feature selection algorithm (under D-R and D/R criteria) are effective to feature selection for human activity recognition.


## 5. Conclusions

This paper has applied maximal relevance measure and minimal redundancy maximal relevance (mRMR) algorithm (under D-R and D/R criteria) to select features and to compose different features subsets based on the observed sensor events for human activity recognition in smart home environments. And then, the selected features subsets have been validated by NB classifier and HMM to recognize human activities. Through the experimental results, it is shown that not all the features are beneficial to activity recognition, as estimated. Different combinations of features lead to different activity recognition results. Furthermore, even the same features subset has different effect on the activity recognition accuracy rate for different activity classifiers. It can be found that featuref10 (the ending time of the current activity) is the most important feature to activity recognition and feature f3 (day of week) is not discriminatory to activity recognition. Therefore, the suitable features subset must be selected in advance, and the selection of unsuitable feature sets increases the computational complexity and degrades the human activity recognition accuracy rate. Moreover, it is significant for activity recognition to consider both relevance between features and activities and redundancy between features. Generally, maximal relevance measure and mRMR algorithm are beneficial to feature selection and positive to activity recognition of NB classifier and HMM.



---

*Source: 8876782-2020-11-29.xml*