Next Article in Journal
Thermal Robustness of Entanglement in a Dissipative Two-Dimensional Spin System in an Inhomogeneous Magnetic Field
Previous Article in Journal
Occlusion-Based Explanations in Deep Recurrent Models for Biomedical Signals
Previous Article in Special Issue
A Hybrid Rao-NM Algorithm for Image Template Matching
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Novel Hybrid Gradient-Based Optimizer and Grey Wolf Optimizer Feature Selection Method for Human Activity Recognition Using Smartphone Sensors

by
Ahmed Mohamed Helmi
1,2,
Mohammed A. A. Al-qaness
3,*,
Abdelghani Dahou
4,
Robertas Damaševičius
5,*,
Tomas Krilavičius 
5 and
Mohamed Abd Elaziz
6
1
Department of Computer and Systems Engineering, Faculty of Engineering, Zagazig University, Zagazig 44519, Egypt
2
Engineering and Information Technology College, Buraydah Private Colleges, Buraydah 51418, Saudi Arabia
3
State Key Laboratory for Information Engineering in Surveying, Mapping and Remote Sensing, Wuhan University, Wuhan 430079, China
4
LDDI Laboratory, Faculty of Science and Technology, University of Ahmed DRAIA, Adrar 01000, Algeria
5
Department of Applied Informatics, Vytautas Magnus University, 44404 Kaunas, Lithuania
6
Department of Mathematics, Faculty of Science, Zagazig University, Zagazig 44519, Egypt
*
Authors to whom correspondence should be addressed.
Entropy 2021, 23(8), 1065; https://doi.org/10.3390/e23081065
Submission received: 11 June 2021 / Revised: 6 August 2021 / Accepted: 13 August 2021 / Published: 17 August 2021
(This article belongs to the Special Issue Unconventional Methods for Particle Swarm Optimization II)

Abstract

:
Human activity recognition (HAR) plays a vital role in different real-world applications such as in tracking elderly activities for elderly care services, in assisted living environments, smart home interactions, healthcare monitoring applications, electronic games, and various human–computer interaction (HCI) applications, and is an essential part of the Internet of Healthcare Things (IoHT) services. However, the high dimensionality of the collected data from these applications has the largest influence on the quality of the HAR model. Therefore, in this paper, we propose an efficient HAR system using a lightweight feature selection (FS) method to enhance the HAR classification process. The developed FS method, called GBOGWO, aims to improve the performance of the Gradient-based optimizer (GBO) algorithm by using the operators of the grey wolf optimizer (GWO). First, GBOGWO is used to select the appropriate features; then, the support vector machine (SVM) is used to classify the activities. To assess the performance of GBOGWO, extensive experiments using well-known UCI-HAR and WISDM datasets were conducted. Overall outcomes show that GBOGWO improved the classification accuracy with an average accuracy of 98%.

1. Introduction

The widespread use of mobile and smart devices has increased the demand for various smart home and Internet of Things (IoT) applications [1]. One of the most important applications is the Internet of Medical Things (IoMT) [2]/Internet of Healthcare Things (IoHT) [3], in which a real-time tracking, detection, and surveillance system is required for monitoring people’s daily activities for medical diagnostics, healthy lifestyle purposes or assisted living environments [4]. In many cases, a such system uses mobile device (such as a smartphone) sensor data [5]. To this end, human activity recognition (HAR) is a necessary application for IoHT, which plays an essential role in medical care applications [6].
In previous decades, different techniques have been used for HAR, such as computer vision methods [7,8,9] that use cameras to track human motion and actions, and wearable devices that should be carried by users, such as wearable sensors [10], smartwatches [11], and smartphones [12,13]. Additionally, there are other techniques, such as environment installed sensors [14], and WiFi signals, which include three techniques, namely received signal strength [15], channel state information [16], and WiFi radar (micro-Doppler radar) [17]. Each of these techniques has its advantages and disadvantages. For instance, computer vision methods need good light conditions, and they raise significant concerns in terms of people’s privacy [18]. Wireless methods do not require additional installation, but they are still in their early stage, and they require more and more improvements. Using carried sensors, such as smartphones, is preferred because virtually everyone uses smartphones today, so it is easy to collect data and to track different motions and activities.
With the developments in context-aware and machine learning techniques, researchers have applied different methods for HAR using data collected from smartphones. Smartphones have gained significant popularity for HAR due to three reasons. The first one is the ubiquitous nature of these small devices, which are used by almost everyone. The second reason is because of the reliability and efficiency of the procured data, and the third reason is that less restrictions can be considered in terms of privacy concerns compared to the case of computer vision methods. Therefore, in recent years, a number of studies have been proposed using different artificial intelligence (AI) techniques, such as [19,20,21].
In general, feature selection (FS) plays a vital role in improving classification accuracy and reducing computation costs. Nature-inspired algorithms such as ant colony optimization [22], particle swarm optimization [23], artificial bee colony [24], firefly algorithm [25], artificial ecosystem-based optimization [26], marine predators algorithm [27], Harris hawks optimizer [28], grey wolf optimizer [29], polar bear optimization [30] and red fox optimization [31], not to mention many others [32], are applicable and robust algorithms for finding a subset of prominent features while removing the non-informative features.
Especially in HAR, FS methods are popular techniques that help in obtaining high accuracy rates [33,34]. However, there are some limitations that can affect the performance of FS methods. For example, obtaining high accuracy rates can only be achieved with the correct features since some features do not provide improvements to the classification accuracy. In addition, FS methods are prone to a large number of features (i.e., high dimensionality), which can result in a high computational cost. Thus, to overcome these limitations and challenges, an efficient FS method should fulfill certain criteria such as being light and fast and able to extract relevant features, lower the feature space dimension, and reduce computation costs in terms of time and resources.
Hybrid algorithms are important for increasing the feature selection capability. Hybridization aims to benefit from each underlying optimization method to create a hybrid algorithm while minimizing any significant drawbacks. Such hybridization can often enhance the performance of various systems on complex tasks [35,36,37].
In our study, we propose a new FS method to improve the HAR system using the hybridization of two algorithms, namely the gradient-based optimizer (GBO) and grey wolf optimizer (GWO). The GBO is a novel metaheuristic (MH) algorithm proposed by Ahmadianfar et al. [38]. The GBO was inspired by gradient-based Newton’s model, which has two operators, namely the gradient search rule and local escape operator. Moreover, GBO uses a set of vectors for exploring the search space. To our knowledge, this is the first study to apply GBO for feature selection. Meanwhile, the GWO algorithm is a swarm intelligence and MH algorithm inspired by the hunting mechanisms and leadership hierarchies of grey wolves [39]. The GWO has four types of grey wolves, called alpha, beta, delta, and omega. These types are applied to emulate leadership hierarchies. Furthermore, GWO has three hunting steps, called searching, encircling, and attacking prey. In recent years, the GWO has been adopted to solve various optimization tasks, including feature selection [40,41,42].

Contribution

The main contribution of the current study is to provide an efficient HAR system using smartphone sensors. The proposed system uses advanced AI techniques to overcome the complexity and limitations of traditional methods. We investigated the applications of MH optimization methods to select the best features that enhance the performance of the proposed HAR system. The GBO and GWO have proven their performance in the literature, but their individual applications suffer from certain limitations, such as being stuck at the local optima and the slow convergence. Thus, the combination of GBO and GWO provides a more robust method that balances between exploration and exploitation stages, in which the combined method will overcome the local optima problem. In addition, the proposed GBOGWO models the features as input for the well-known classifier, support vector machine (SVM), which is applied to classify human activities. Furthermore, extensive experimental evaluations have been carried out to evaluate the proposed HAR system performance using a public dataset, called UCI-HAR [43], and to verify its significant performance in extensive comparisons with existing HAR methods. We applied several performance measures, and we found that the proposed GBOGWO achieved better results when compared to several existing methods. Additionally, we also used the WISDM dataset to verify the performance of the GBOGWO method.
The rest of the current study is structured as follows. Related works are highlighted in Section 2. The preliminaries of the applied methods are described in Section 3. The proposed GBOGWO system is described in Section 4. Evaluation experiments are studied in Section 5. Finally, we conclude this study in Section 6.

2. Related Work

In this section, we only focus on the recent related works of HAR using smartphones. For other HAR techniques, the readers can refer to the survey studies [10,18,44].
Ronao and Cho [45] proposed a deep convolutional neural network (CNN) for tracking human activities using smartphone sensors. They used the UCI-HAR dataset [43], which was also used in this paper to test the performance of our proposed method. Their method achieved an average accuracy of 94.79%. Ahmed et al. [34] proposed a hybrid FS method to improve HAR using smartphones. They applied both wrapper and filter FS methods using a sequential floating forward search approach to extract features and then fed these features to the multiclass support vector machine classifier. The proposed approach showed robust performance and achieved significant classification results. Chen et al. [46] applied an ensemble extreme learning machine method for HAR using smartphone datasets. They applied Gaussian random projection to generate the input weights of the extreme learning machine, which improves the performance of the ensemble learning. Additionally, they tested the proposed method with two datasets, and they obtained high accuracy rates on both datasets. Wang et al. [21] proposed an HAR system using deep learning. They proposed an FS method using CNN to extract local features. After that, they employed several machine learning and deep learning classifiers to recognize several activities from two benchmark datasets. Zhang et al. [47] proposed an HAR model, called HMM-DNN, which uses a deep neural network to model the hidden Markov model (HMM). The main idea of this hybrid model is to enhance the performance of the HMM using DNN to be able to learn suitable features from the learning datasets and improve the classification process. Cao et al. [48] proposed a group-based context-aware HAR method, called GCHAR. They used a hierarchical group-based approach to enhance the classification accuracy and reduce errors. The GCHAR uses two hierarchical classification structures, inner and inter groups, that are used for detecting transitions through the group of the activities. Wang et al. [49] proposed an HAR model using a new feature selection method combining both wrapper and filter and wrapper methods. Moreover, they studied the use of different entrails’ sensors of smartphones and their impacts on HAR. Sansano et al. [50] compared several deep learning models, including CNN, long short-term memory (LSTM), bidirectional LSTM (biLSTM), deep belief networks (DBN), and gated recurrent unit networks (GRU), for human activity recognition using different benchmark datasets. They found that the CNN methods achieved the best results. Xia et al. [51] proposed a hybrid HAR model that combined both CNN and LSTM. The hybrid model aims to automatically extract features of the proposed activities and classify these activities using a set of a few parameters. They evaluated the proposed model using different datasets, including the UCI-HAR dataset, which achieved an average accuracy of 95.78%. Moreover, a few studies have used swarm intelligence in the HAR field. For example, Elsts et al. [52] proposed an efficient HAR system using the multi-objective particle swarm optimization algorithm (PSO). The PSO was applied to select the appropriate features, which also leads to reduce computation time. They used a random forest (RF) to classify several activities. The results confirmed that the PSO improved the classification accuracy and reduced the computational cost. Abdel-Basset et al. [6] proposed a new HAR system, called ST-DeepHAR, which uses an attention mechanism to improve long short-term memory (LSTM). Two public datasets were utilized to evaluate the performance of the ST-DeepHAR, which showed significant performance.

3. Material and Methods

In this section, we describe the datasets used in our experiments. Furthermore, we present the preliminaries of gradient-based optimization (GBO) and grey wolf optimization.

3.1. UCI-HAR Dataset

Anguita et al. [43] have published a public dataset for activities of daily living. Thirty participating subjects were asked to follow a protocol for performing 6 activities using a waist-mounted smartphone, namely walking (WK), walking upstairs (WU), walking downstairs (WD), sitting (ST), standing (SD), and lying down (LD). A sampling rate of 50 Hz was used to collect the tri-axial linear acceleration and angular velocity of the smartphone accelerometer and gyroscope sensors. Each participant performed a sequence of activities in order. Hence, the raw signals of all activities were registered in one text file per participant. Due to the low sampling rate and high amount of noise, collected signals were filtered using a low-pass filter with a corner frequency 20 Hz. Then, body acceleration was separated from the gravity acceleration component in order to better extract representative features. After that, additional time and frequency-domain signals were generated from the filtered body/gravity tri-axial signals such as jerk (or time derivative), signal magnitude using Euclidean norm, and fast Fourier transformation (FFT). A total of 17 signals were obtained per subject. Time-domain signals were segmented using fixed-width sliding windows of a length of 2.56 s with 50% overlapping, and an equivalent rate was applied to FFT signals. Thus, each window contained approximately 128 data points of activity; such a selected segmentation rate is supposed to meet the activities of normal people, as justified in [43]. After that, many useful functions were applied to filter and segment the signals in order to extract the features including the mean, standard deviation, signal magnitude area, entropy, energy, autoregressive coefficients and the angle between vectors. Now, each activity window is represented by a 561-length vector. Authors have also published separate files for training and testing featured data where 70% of the data samples were randomly selected for training and the remaining 30% were the independent set for testing. Thus, the number of examples per activity for the training and testing is indicated in Table 1. The percentage of each activity in this dataset refers to a more or less balanced dataset. Hence, it is relevant to design and test different classification and recognition HAR models from an applicability point of view.

3.2. Gradient-Based Optimization (GBO)

Within this section, we introduce the basic concept of a new metaheuristic technique named GBO. In general, GBO simulates the gradient-based Newton’s approach. The GBO depends on two operators to update the solutions, and each one of them has its own task. The first operator is the gradient search rule (GSR) which is used to improve the exploration, while the second operator is the local escaping operator (LEO), which is used to enhance the exploitation ability.
The first process in GBO is to construct a population X with N solutions, randomly generated using the following equation:
x i = x m i n + r a n d × ( x m a x x m i n ) , i = 1 , 2 , . . . , N
where x m i n and x m a x are the limits of the search space and r a n d [ 0 , 1 ] denotes a random number. Then, the fitness value for each solution is computed, and the best solution is determined.
Thereafter, the gradient search rule (GSR) and direction movement (DM) are applied to update the solutions ( x i I t , i = 1 , 2 , . . . , N ) in the direction ( x b x i I t ) (where x b refers to the best solution). This updating process is achieved by computing new three solutions x 1 i I t , x 2 i I t and x 3 i I t as
x 1 i I t = x i I t G S R + r a n d × ρ 1 × ( x b x i I t )
In Equation (2), ρ 1 is applied to improving the balance between exploitation and exploration during the optimization process and it is defined as
ρ 1 = 2 × r a n d × α α
where:
α = | β × s i n ( 3 π / 2 + s i n ( β × 3 π / 2 ) ) |
β = β m i n + ( β m a x β m i n ) × ( 1 ( I t / M a x I t ) 3 ) 2
where β m i n = 0.2 and β m a x = 1.2 . I t e r denotes the current iterations, and  M a x I t is the total number of iterations. The gradient search rule (GSR) is defined as follows:
G S R = r a n d n × ρ 2 × ( 2 × Δ x × x i I t ) / ( y p i y q i + ϵ )
with:
Δ x = r a n d ( 1 : N ) × | ( ( x b x r 1 I t ) + δ ) / 2 |
δ = 2 × r a n d × ( | ( x r 1 I t + x r 2 I t + x r 3 I t + x r 4 I t ) / 4 x i I t | )
where r a n d ( 1 : N ) is a random vector whose dimensions N, r 1 , r 2 , r 3 , and  r 4 refer to random integers selected from [ 1 , N ] . ρ 2 is formulated as defined by Equation (3).
The locations y p i and y q i are updated using Equations (5) and (6):
y p i = r a n d × ( x s + x i ) / 2 + r a n d × Δ x
y q i = r a n d × ( x s + x i I t ) / 2 r a n d × Δ x
with:
x s = x i I t r a n d n × ρ 1 × ( 2 × Δ x × x i I t ) / ( x b x w o r s t + ϵ )
x 2 i I t = x b G S R + r a n d × ρ 2 × ( x r 1 I t x r 2 I t )
x 3 i I t = x i I t ρ 1 × ( x 1 i I t x 2 i I t )
Finally, based on the positions x 1 i I t x 2 i I t , and  x 3 i I t , a new solution at iteration I t + 1 is obtained:
x i I t + 1 = r a × ( r b × x 1 i I t + ( 1 r b ) × x 2 i I t ) + ( 1 r a ) × x 3 i I t
where r a and r b denote two random numbers.
Moreover, the local escaping operator (LEO) is applied to improve the exploitation ability of GBO. This is achieved by updating the solution x i I t using the following equation according to the probability p r :
x i I t + 1 = x i I t + f 1 × W 1 + f 2 × ρ 1 × W 3 + u 2 × W 2 / 2 p r < 0.5 x b + f 1 × W 1 + f 2 × ρ 1 × W 3 + u 2 × W 2 / 2 o t h e r w i s e
W 1 = ( u 1 × x b u 2 × x k I t ) ,
W 2 = ( x r 1 I t x r 2 I t ) ,
W 3 = ( u 3 × ( x 2 i I t x 1 i I t ) )
In Equation (11), f 1 [ 1 , 1 ] and f 2 denote a uniform random number and normal random number, respectively. u 1 , u 2 , and  u 3 are three random numbers defined as
u 1 = L 1 × 2 × r a n d + ( 1 L 1 )
u 2 = L 1 × r a n d + ( 1 L 1 )
u 3 = L 1 × r a n d + ( 1 L 1 )
where L 1 represents a binary variable (i.e., assigned to 0 or 1). Therefore, the new solution is obtained using the following equation:
x k I t = L 2 × x p I t + ( 1 L 2 ) × x r a n d
where L 2 is similar to L 1 and x p I t refers to a selected solution from X, and x r a n d denotes a random solution obtained using Equation (1).
The main steps of the GBO algorithm are presented in Algorithm 1.
Algorithm 1 The Gradient-Based Optimizer (GBO)
 1:
Initialize the parameters of GBO: ϵ , p r , M a x I t Maximum Iteration number, N: Population size.
 2:
Initialize randomly the population of N vectors using Equation (1)
 3:
Evaluate the position of each vector using the fitness function fit
 4:
Determine the best and worst solutions: x b e s t , x w o r s t
 5:
Let I t = 1
 6:
while I t M a x I t do
 7:
for each vector x i I t do
 8:
  Choose four integers randomly in the range [ 1 . . N ] such that: r 1 r 2 r 3 r 4
 9:
  Update the position of the vector x i I t + 1 using Equation (14).
10:
  Evaluate the quality of the vector x i I t + 1 using the fitness function f i t i
11:
end for
12:
if r a n d < p r then
13:
  Update the position of x i I t + 1 using the first branch of Equation (11)
14:
else
15:
  Update the position of x i I t + 1 using the second branch of Equation (11)
16:
end if
17:
 Determine the best and worst solutions: x b e s t , x w o r s t
18:
I t = I t + 1
19:
end while
20:
Return the optimal solution x b e s t

3.3. Grey Wolf Optimization

In this section, the steps of the grey wolf optimization (GWO) [39] are described. The GWO emulates the behaviors of wolves in nature during the process of catching the prey X b . The GWO has three groups of solutions named α , β , and γ —each of which has its own task and represents the first three best solutions, respectively, while the other solutions are called the μ group.
GWO starts by setting the initial value for a set of solutions X and evaluating the fitness value for each of them and determines X α , X β , and  X γ . Thereafter, the solutions are updated using a set of approaches, such as the encircling technique, and it is formulated as [39]
X t + 1 = X p r t B × D , B = 2 b × q 1 b ,
D = | A × X p r t X t | , A = 2 q 2
where A and B denote the coefficient parameters, whereas q 1 and q 2 refer to random numbers generated from [0, 1]. The value of b sequentially decreases from 2 to 0 with an increase in the iterations as
b = 2 2 × t / t m a x
where t m a x refers to the total number of iterations.
The second strategy in GWO is called hunting, and this solution can be updated using the following Equation [39]:
X t + 1 = ( X 1 + X 2 + X 3 ) 3 ,
X 1 = X α t B 1 × ( D α ) , X 2 = X β t B 2 × ( D β )
X 3 = X γ t B 3 × ( D γ )
D α = | A 1 × X α t X t | , D β = | A 2 × X β t X t | , D γ = | A 3 × X γ t X t |
where A k = 2 q 2 , k = 1 , 2 , 3 , and  B k = 2 b × q 1 b .
The steps of GWO are listed in Algorithm 2 [39].
Algorithm 2 Grey Wolf Optimization(GWO)
 1:
Initialize the population X of wolves X i ( i = 1 , 2 , . . . , N ) and parameters.
 2:
Find the fitness of the population.
 3:
Find alpha ( X α ) , beta ( X β ) and gamma ( X γ ) solutions.
 4:
while t < t m a x do
 5:
 Update the position of each wolf X i ( i = 1 , 2 , . . . , N ) based on Equation (17).
 6:
 Find the fitness of population.
 7:
 Update alpha ( X α ), beta ( X β ) and gamma ( X γ ).
 8:
t = t + 1
 9:
end while
10:
Return X α

4. Proposed Approach

Within this section, the steps of the developed HAR method based on a modified version of the GBO are introduced. The framework of the developed HAR method is given in Figure 1. The developed method starts by receiving the input data and splits them into the training and testing sets. This is followed by determining the initial value for the parameters of the developed HAR model such as the population size, the total number of generations, and the probability p r . Then, the initial population X is generated and the quality of each solution X i , i = 1 , 2 , . . . , N is evaluated. This is achieved through two steps; the first step is to convert X i into a binary solution using the following equation:
B X i j = 1 i f X i j > 0.5 0 o t h e r w i s e
where B X i is the binary form of X i . The second step is to remove the features corresponding to zeros in B X , which represent irrelevant features. Then, those selected features from the training set are used to learn the multiclass-SVM classifier and compute the fitness value as [43,51]
F i t i = λ × η i + ( 1 λ ) × ( | B X i | D i m ) , η i = ( 1 P R )
where P R presents the classification precision.
The next step in the developed model is to find the best solution X b and the worst solution. Then, the solutions are updated according to X b and the operators of GBO and GWO. Here, GWO is applied to enhance the local escaping operator (LEO) according to the value of p r . In the case of p r greater than the random value, the operators of GBO are used to generate a new solution. Otherwise, the operators of GWO are used. By comparing the fitness value of the new obtained solution with the current solution X i , we select the best of them and remove the worst one. The process of updating the solutions is ongoing until it reaches the stopping criteria. Thereafter, the testing set is reduced according to the features obtained by the best solution and the performance of the predicted activities is computed using different classification measures.
Equation (22) illustrates the time complexity analysis of the GBOGWO algorithm:
T G B O G W O = T i n i t . + T N ( T G S R + ( 1 p ) T X n e w G W O + p T X n e w G B O + T u p d . ) = O ( N D + N T F E ) + O ( T N D ) + O ( T F E ) = O ( T N D + N T F E ) .
where T i n i t . represents the time spent collecting the initial population. p is the probability of selecting either the GWO update mechanism or GBO exploration subprocedure. T G S R G B O , T X n e w G B O and T X n e w G W O each has a time complexity of O ( D ) . T F E refers to the time taken by the function evaluation, which has a notable enhancement in terms of execution time in HAR applications due to using classifiers such as multiclass-SVM, random forest, neural networks and others. T u p d . denotes the time for evaluating X n e w and updating the best solution if necessary. T refers to the total number of iterations.

5. Experimental Results and Discussion

The proposed algorithm was applied to improve the classification performance of the UCI-HAR dataset via a feature selection approach. In this section, the experimental settings, the results of the proposed approach, the comparisons with other models, and the classification rates for the concerned dataset with comparison to other studies in the literature are presented. Moreover, a critical analysis of the obtained results using the proposed HAR system is given.

5.1. UCI-HAR Dataset

The performance of GBOGWO was exhaustively compared to a set of 11 optimization algorithms for feature selection. Basic continuous-based versions of the GBO, GWO, genetic algorithm (GA) [53], differential evolutionary algorithm (DE) [54], moth–flame optimization (MFO) [55], sine–cosine algorithm (SCA) [56], Harris hawks optimization (HHO) [57], and manta ray foraging (MRFO) [58] were implemented, in addition the particle swarm optimization (B-PSO) [59], bat algorithm (B-BAT) [60] and sine–cosine algorithm (B-SCA) [56]. The settings and parameter values of all algorithms used in the comparison are provided in Table 2.
As a classification task, true positive (TP), true negative (TN), false positive (FP) and false negative (FN) rates define the commonly used performance metrics for HAR systems, which are defined as follows:
A c c u r a c y = T P T P + T N + F P + F N
P r e c i s i o n ( P R ) = T P T P + F P
R e c a l l / S e n s i t i v i t y = T P T P + F N
S p e c i f i c i t y = T N F P + T N
Evaluation metrics of the comparison involve the mean (M) and standard deviation (std) of the precision (PR), M, and std of the number of selected features (# F), the percentage of feature reduction (red (%)), and the execution time. The Wilcoxon statistical test was used to determine the degree of significant difference between GBOGWO and each other compared algorithm in terms of the null hypothesis indicator H and significance level p-value. Each algorithm was repeated for 10 independent runs; this may be considered as the bottom line for examining the behavior of such a stochastic optimization technique. The reason refers to the huge execution time when training a multi-class SVM for extremely long training records (the training set was recorded with the dimension 561). The classification rates obtained by the proposed approach were compared to those of the original paper of the dataset under study as well as one recent study in the literature. Moreover, the performance of GBOGWO was compared to commonly used filter-based methods such as the t-test and ReliefF [61] in feature-selection applications.
All algorithms were implemented in the Matlab 2018a (MathWorks Inc., Natick, MA, USA) environment using CPU 2.6 GHz and RAM 10 GB.

5.2. Numerical Results of Experiments

Table 3 summarizes the results obtained for the proposed HAR model using various optimizers. The GBOGWO as a feature selector outperforms other techniques where the SVM model gives a PR of 98.13 % using 304 features on average. Furthermore, average accuracy reaches 98%. Thus, the number of features is reduced from 561 to 304, which achieves a reduction ratio of 45.8%. The standard deviation of the proposed model, together with GA, are minimal (0.12 and 0.119, resp.) in this comparison. This reflects the good precision of the feature selection approach for this problem. However, the MRFO found a reduced feature set with a cardinality of 286.6 on average (i.e., a 52.12% reduction ratio), however, it seems that some important features were missing, thus the mean PR is 97.77%. Furthermore, HHO selected more features (approximately 428.6 on average), but the mean PR was only 97.25%. The results of the Wilcoxon test show that the performance of the GBOGWO is statistically distinguishable, where the p-value, which is <0.05 for all pairwise comparisons, together with H = 1 , reflects the superiority of the proposed technique. Under the experimental settings shown in Table 2, GBOGWO with the multiclass SVM model consumes 50.8 min on average for a single run. This execution time is very close to other faster optimizers such as GWO, BSCA, SCA, and DE with 49.02, 49.35, 49.8, and 49.8 min. In comparison, HHO takes a notable long execution time with 128.3 min. Figure 2 shows a summary of the reported results in Table 3 in a normalized fashion, which gives more clear intuition about the behavior of GBOGWO according to different evaluation metrics.
The confusion matrix, presented in Table 4, provides the rates of PR, sensitivity (Sens.), and specificity (Spec.) for each single activity. Walking downstairs (WD), lying down (LD), and walking (WK) were the highest recognized activities with PR rates of 100%, 100%, and 99.2%, respectively, while the worst PR rate was for standing (SD) activity with 93.57%. The recall of most activities was high except for sitting (ST) with 92.46%. It can also be noticed that the Spec. for all activities is quite good (>98.51%). The proposed model was able to well distinguish between the group of periodic activities (WK, WU, WD) and the other one of static or single-transition activities (ST, SD, LD) where the rate of misclassification is almost zero (only one wrong label between WU and ST in Table 4).
Figure 3 presents 2D visualization for the basic feature records of activities (i.e., with 561 features) via carrying out principal component analysis and clustering. In Figure 3, (WK, WU, WD) in (dark green, blue, black) can be linearly separated from (SD, ST, LD) in (red, yellow, light green), except for very few records which are clustered to wrong classes between WU and ST. On the other hand, there is a high degree of similarity between the extracted features of each of SD and ST. Such similarity has complicated the classification task; thus, there is notable confusion between SD and ST (on average, 36 wrong labels in-between).
To summarize the conducted experiments, the proposed feature set for the UCI-HAR dataset in [43] was useful for the targeted recognition task; however, discarding some illusive features using the proposed technique proved very useful to improve the overall performance of such an HAR model. The feature set was successfully reduced by 45.8%, and at the same time, the mean PR reached 98.13%, and the mean accuracy was 98%.

5.3. Comparison with Other Studies

Recognition rates of the proposed HAR model were compared to each of the original studies of UCI-HAR dataset [43] and the recent study by [51]. In [43], 561D feature vectors were provided to a multiclass SVM, which gave a mean PR of 96%. A hybrid model using LSTM and CNN was applied to segmented sequences of activity signals in [51], which reported a mean PR of 95.8%. Table 5 shows a comparison of the results obtained herein and in the aforementioned studies. The notable improvement of whole model performance is noticed, in particular for WK and ST activities. However, the three models resulted in low precision for the SD activity.

5.4. Comparison with Filter-Based Methods

Filter-based methods such as the statistical tests and the ReliefF algorithm [62] are commonly used for feature selection tasks. Such methods are time-efficient and their classifier-independent nature simplifies passing the selected feature set to any further classifier [63]. As a statistical test, the t-test examines the similarity between classes for each individual feature via mean and standard deviation calculations. It is then possible to rank features according to the significance importance and finally, define some cut-off threshold to select a feature set. The RelieF algorithm applies a penalty scheme, where features that map to different values for the same neighbors are penalized (i.e., negative weight); and otherwise rewarded. After that, the feature set with non-negative weights is expected to better represent the concerned classes.
Table 6 gives the results of the comparison between the proposed model and the filter-based approach using the t-test and ReliefF. ReliefF was able to extract the smallest feature set, achieving a reduction ratio of 67%, but the GBOGWO was outstanding, according to the resulting accuracy, sensitivity, and precision. However, the feature set selection using the t-test was enlarged to 350D, but this did not improve the performance. In Table 6, and for a typical value λ = 0.99 , the proposed GBOGWO fitness was 97.15%. For a more biased λ = 0.9 towards reducing the feature set, the fitness of GBOGWO reaches 88.37%. For both cases of α , the proposed approach is superior to the examined filter-based methods.
The superior performance of the developed method over all other tested methods can be noticed from the previous discussion. However, the developed method still suffers from several limitations, such as the relatively large feature set required for achieving reasonable performance (i.e., 304 features on average for six activities). Thus, it is reasonable to realize such an HAR system on a smartphone environment to examine both the model size and real-time behavior. Moreover, enlarging the set of targeted activities is expected to add more time complexity for training a classifier such as the multi-class SVM.

5.5. Evaluate the Proposed GBOGWO with WISDM Dataset

For further evaluation, we test the proposed GBWGWO with other HAR datasets, called WISDM [64] dataset. This dataset contains six activities, namely walking (WK), walking upstairs (WU), walking downstairs (WD), sitting (ST), standing (SD), and jogging (JG). Table 7 shows the results of the proposed GBOGWO and several optimization methods, including the GWO, GA, MFO, MRFO, and GBO. From the table, we can see that the proposed method achieved the best results. It is worth mentioning that the best results for the WISDM dataset were achieved by using the random forest (RF) classifier; therefore, in this paper, for the WISDM dataset, we also used the RF.
A basic version of the RF algorithm with 50 decision trees gives an average accuracy of 97.5% for the feature set defined in Table 8. Following the pre-processing steps of the UCI-HAR dataset, each activity signal was separated into body acceleration and gravity component signals. Then, segments of a length of 128 points (i.e., same segment length used for UCI-HAR dataset) with 50% overlap were generated for the purposes of real-time applications. The feature set in Table 8 was generated using simple time-domain statistics in the three-axes of each segment, notably the mean, standard deviation (STD), the coefficients of the auto-regressive model (AR) in the order of 4, and the histogram counts where the number of bins is 5, among others. Moreover, the mean, max, and median frequencies of each segment in the three-axes enhance the feature set. Considering that the proposed features are generated for both the body signal and gravity component, then the cardinality of the feature set reaches 150. Thus, such a feature set can help distinguish the behavior of the compared algorithms for the WISDM dataset. Since previous studies that addressed the WISDM dataset have considered Accuracy to evaluate their algorithms, then the classification error is set to 1 mean(Accuracy) as shown in Figure 4b.
Since the search space of UCI-HAR—as a feature selection problem—is high-dimensional, then it is a suitable examiner for compared algorithms. Thus, for avoiding redundancy, only the top six algorithms according to the results in Table 3, namely GBOGWO, GWO, GA, MFO, MRFO, and GBO, were included in the experimentation of the WISDM dataset.
In Table 7, GBOGWO is able to achieve a mean accuracy (Acc) of 98.87 % , which is a notable optimization for the basic model with a whole feature set of 97.5 % . The GBOGWO outperforms other algorithms according to the Acc of classification only using 32.7 features on average ( 78.2 % of reduction ratio). However, MFO uses the largest feature set among examined optimizers with 59.9 features, but it can reach a mean Acc of 98.21 % . GBO attains the minimal feature set with cardinality of 25, but it seems insufficient to achieve a mean Acc above 98.11 % . It was noticed that the STD for all algorithms was less than 0.01 , which may refer to the relatively limited search space (e.g., the feature set size is 150). Moreover, the Wilcoxon test results in Table 7 ensure that GBOGWO is well distinguished from other algorithms of comparison.
In Table 9, the selection power of GBOGWO outperforms both the t-test and ReliefF which tend to attain a large feature set of size 124 and 108, respectively, whilst lesser mean Acc of 97.58 % and 98.11 % , respectively. According to the fitness criteria defined in Equation (21), GBOGWO outperforms both methods in the case of giving most importance to Acc (i.e., λ = 0.99 ) or to feature set reduction (i.e., λ = 0.9 ).
Table 10 shows the confusion matrix of the test set, which represents 30 % of whole samples. The activities ST, SD, and WK, were well recognized with the mean PR that exceeds 99.5 % . It was noticed that the rates of PR, Sens. and Spec. were close for most activities which reflects that the classification model (features + classifier) was balanced between such metrics. Most conflicts occur between WU and WD, as well as between WU and JG where misclassifications reach 27 and 15, respectively. Such conflicts may be caused by the sensor position (in the pocket); thus, for such applications, it is suggested to collect activity signals from different positions on the body such as pocket, wrist, waist, and shoulder.
Figure 5 presents the selections of each of the top six algorithms for both datasets.
Table 11 focuses on the most frequent features in the optimized feature sets of each algorithm. For UCI-HAR, only features attained by all considered algorithms (e.g., count = 6) are shown. These features are generated from the body signals of both the accelerometer (BodyAcc) and gyroscope (BodyGyro) in both the time-domain (with the prefix t) and frequency-domain (with the prefix f). For more explanation of such features, the reader can refer to [43]. For WISDM, the skewness of the y axis of the body signal (Skewness-Y) looks like the most important feature as it is attained by every algorithm. Similarly, the tilt angle (TA), the STD of the jerk of x axis body signal (STD-Jerk-X), and the first coefficient of the AR model of magnitude signal (AR-Magnitude,1) have a frequency of 5. The maximum frequency of the z axis of the body signal (Max-Freq-Z) shows most notable effectiveness in the generated frequency-domain features with a count of 4. It is reasonable to find that body signal statistics are more useful than those of gravity components for such applications. Thus, only Gravity-STD-Y and Gravity-Kurtosis-Y appear in the elite feature set.

6. Conclusions and Future Work

In this study, we presented a robust human activity recognition (HAR) system based on data collected from smartphones. We developed a new feature selection (FS) method that was applied to enhance the HAR system using a hybrid MH algorithm that combine both gradient-based optimization (GBO) and grey wolf optimization (GWO). The proposed method, called GBOGWO, was applied to the SVM classifier to classify the activities of well-known UCI-HAR dataset. The combination of GBO and GWO overcomes the shortcomings of individual methods by exploiting the advantages of both algorithms to build an efficient FS method, which is employed to build a robust HAR classification system. Compared to existing HAR methods, and also to several metaheuristic algorithms that are applied as FS methods with SVM classifier, the developed GBOGWO has shown better performance in terms of classification accuracy and other performance metrics. Additionally, we evaluated the proposed GBOGWO with the WISDM dataset using the RF classifier. It also obtained the best results compared to several optimization algorithms.
The developed method could be further improved in future work to address more complex HAR datasets that may contain two or more human activities conducted simultaneously.

Author Contributions

Conceptualization, A.M.H. and M.A.A.A.-q.; data curation, A.M.H. and M.A.A.A.-q.; formal analysis, A.D. and M.A.E.; funding acquisition, T.K.; investigation, R.D. and T.K.; methodology, A.M.H. and M.A.E.; project administration, M.A.A.A.-q.; resources, A.M.H. and M.A.E.; software, A.M.H. and M.A.E.; supervision, M.A.A.A.-q.; writing—original draft preparation, A.M.H., M.A.A.A.-q., A.D., and M.A.E.; writing—review and editing, R.D. and T.K.; validation, M.A.E. and R.D. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The UCI-HAR datasets used in this study are public datasets.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Ye, J.; O’grady, M.; Banos, O. Sensor technology for smart homes. Sensors 2020, 20, 7046. [Google Scholar] [CrossRef] [PubMed]
  2. Joyia, G.J.; Liaqat, R.M.; Farooq, A.; Rehman, S. Internet of medical things (IOMT): Applications, benefits and future challenges in healthcare domain. J. Commun. 2017, 12, 240–247. [Google Scholar] [CrossRef] [Green Version]
  3. Zhou, X.; Liang, W.; Wang, K.I.; Wang, H.; Yang, L.T.; Jin, Q. Deep-Learning-Enhanced Human Activity Recognition for Internet of Healthcare Things. IEEE Internet Things J. 2020, 7, 6429–6438. [Google Scholar] [CrossRef]
  4. Maskeliunas, R.; Damaševicius, R.; Segal, S. A review of internet of things technologies for ambient assisted living environments. Future Internet 2019, 11, 259. [Google Scholar] [CrossRef] [Green Version]
  5. Bettini, C.; Civitarese, G.; Presotto, R. CAVIAR: Context-driven Active and Incremental Activity Recognition. Knowl. Based Syst. 2020, 196, 105816. [Google Scholar] [CrossRef]
  6. Abdel-Basset, M.; Hawash, H.; Chakrabortty, R.K.; Ryan, M.; Elhoseny, M.; Song, H. ST-DeepHAR: Deep Learning Model for Human Activity Recognition in IoHT Applications. IEEE Internet Things J. 2020, 8, 4969–4979. [Google Scholar] [CrossRef]
  7. Ribeiro, P.C.; Santos-Victor, J.; Lisboa, P. Human activity recognition from video: Modeling, feature selection and classification architecture. Proceedings of International Workshop on Human Activity Recognition and Modelling, Oxford, UK, 9 September 2005; pp. 61–78. [Google Scholar]
  8. Jalal, A.; Kim, Y.H.; Kim, Y.J.; Kamal, S.; Kim, D. Robust human activity recognition from depth video using spatiotemporal multi-fused features. Pattern Recognit. 2017, 61, 295–308. [Google Scholar] [CrossRef]
  9. Afza, F.; Khan, M.A.; Sharif, M.; Kadry, S.; Manogaran, G.; Saba, T.; Ashraf, I.; Damaševičius, R. A framework of human action recognition using length control features fusion and weighted entropy-variances based feature selection. Image Vis. Comput. 2021, 106, 104090. [Google Scholar] [CrossRef]
  10. Lara, O.D.; Labrador, M.A. A survey on human activity recognition using wearable sensors. IEEE Commun. Surv. Tutorials 2012, 15, 1192–1209. [Google Scholar] [CrossRef]
  11. San-Segundo, R.; Blunck, H.; Moreno-Pimentel, J.; Stisen, A.; Gil-Martín, M. Robust Human Activity Recognition using smartwatches and smartphones. Eng. Appl. Artif. Intell. 2018, 72, 190–202. [Google Scholar] [CrossRef]
  12. Hassan, M.M.; Uddin, M.Z.; Mohamed, A.; Almogren, A. A robust human activity recognition system using smartphone sensors and deep learning. Future Gener. Comput. Syst. 2018, 81, 307–313. [Google Scholar] [CrossRef]
  13. Damaševičius, R.; Vasiljevas, M.; Šalkevičius, J.; Woźniak, M. Human activity recognition in AAL environments using random projections. Comput. Math. Methods Med. 2016, 2016, 4073584. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  14. Hong, X.; Nugent, C.D. Segmenting sensor data for activity monitoring in smart environments. Pers. Ubiquitous Comput. 2013, 17, 545–559. [Google Scholar] [CrossRef]
  15. Gu, Y.; Ren, F.; Li, J. Paws: Passive human activity recognition based on wifi ambient signals. IEEE Internet Things J. 2015, 3, 796–805. [Google Scholar] [CrossRef]
  16. Al-qaness, M.A. Device-free human micro-activity recognition method using WiFi signals. Geo-Spat. Inf. Sci. 2019, 22, 128–137. [Google Scholar] [CrossRef]
  17. Ma, X.; Zhao, R.; Liu, X.; Kuang, H.; Al-qaness, M.A. Classification of Human Motions Using Micro-Doppler Radar in the Environments with Micro-Motion Interference. Sensors 2019, 19, 2598. [Google Scholar] [CrossRef] [Green Version]
  18. Al-qaness, M.A.; Abd Elaziz, M.; Kim, S.; Ewees, A.A.; Abbasi, A.A.; Alhaj, Y.A.; Hawbani, A. Channel state information from pure communication to sense and track human motion: A survey. Sensors 2019, 19, 3329. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  19. Qi, W.; Su, H.; Aliverti, A. A Smartphone-Based Adaptive Recognition and Real-Time Monitoring System for Human Activities. IEEE Trans. Hum. Mach. Syst. 2020, 50, 414–423. [Google Scholar] [CrossRef]
  20. Jain, A.; Kanhangad, V. Human activity classification in smartphones using accelerometer and gyroscope sensors. IEEE Sens. J. 2017, 18, 1169–1177. [Google Scholar] [CrossRef]
  21. Wan, S.; Qi, L.; Xu, X.; Tong, C.; Gu, Z. Deep learning models for real-time human activity recognition with smartphones. Mob. Netw. Appl. 2020, 25, 743–755. [Google Scholar] [CrossRef]
  22. Joseph Manoj, R.; Anto Praveena, M.D.; Vijayakumar, K. An ACO–ANN based feature selection algorithm for big data. Clust. Comput. 2019, 22, 3953–3960. [Google Scholar] [CrossRef]
  23. Ibrahim, R.A.; Ewees, A.A.; Oliva, D.; Abd Elaziz, M.; Lu, S. Improved salp swarm algorithm based on particle swarm optimization for feature selection. J. Ambient Intell. Humaniz. Comput. 2019, 10, 3155–3169. [Google Scholar] [CrossRef]
  24. Rao, H.; Shi, X.; Rodrigue, A.K.; Feng, J.; Xia, Y.; Elhoseny, M.; Yuan, X.; Gu, L. Feature selection based on artificial bee colony and gradient boosting decision tree. Appl. Soft Comput. J. 2019, 74, 634–642. [Google Scholar] [CrossRef]
  25. Selvakumar, B.; Muneeswaran, K. Firefly algorithm based feature selection for network intrusion detection. Comput. Secur. 2019, 81, 148–155. [Google Scholar]
  26. Sahlol, A.T.; Elaziz, M.A.; Jamal, A.T.; Damaševičius, R.; Hassan, O.F. A novel method for detection of tuberculosis in chest radiographs using artificial ecosystem-based optimisation of deep neural network features. Symmetry 2020, 12, 1146. [Google Scholar] [CrossRef]
  27. Sahlol, A.T.; Yousri, D.; Ewees, A.A.; Al-qaness, M.A.A.; Damasevicius, R.; Elaziz, M.A. COVID-19 image classification using deep features and fractional-order marine predators algorithm. Sci. Rep. 2020, 10, 1–15. [Google Scholar] [CrossRef]
  28. Jouhari, H.; Lei, D.; Al-qaness, M.A.A.; Abd Elaziz, M.; Damaševičius, R.; Korytkowski, M.; Ewees, A.A. Modified Harris Hawks optimizer for solving machine scheduling problems. Symmetry 2020, 12, 1460. [Google Scholar] [CrossRef]
  29. Makhadmeh, S.N.; Al-Betar, M.A.; Alyasseri, Z.A.A.; Abasi, A.K.; Khader, A.T.; Damaševičius, R.; Mohammed, M.A.; Abdulkareem, K.H. Smart home battery for the multi-objective power scheduling problem in a smart home using grey wolf optimizer. Electronics 2021, 10, 447. [Google Scholar] [CrossRef]
  30. Polap, D.; Woźniak, M. Polar bear optimization algorithm: Meta-heuristic with fast population movement and dynamic birth and death mechanism. Symmetry 2017, 9, 203. [Google Scholar] [CrossRef] [Green Version]
  31. Połap, D.; Woźniak, M. Red fox optimization algorithm. Expert Syst. Appl. 2021, 166, 114107. [Google Scholar] [CrossRef]
  32. Brezočnik, L.; Fister, I.; Podgorelec, V. Swarm Intelligence Algorithms for Feature Selection: A Review. Appl. Sci. 2018, 8, 1521. [Google Scholar] [CrossRef] [Green Version]
  33. Capela, N.A.; Lemaire, E.D.; Baddour, N. Feature selection for wearable smartphone-based human activity recognition with able bodied, elderly, and stroke patients. PLoS ONE 2015, 10, e0124414. [Google Scholar] [CrossRef] [Green Version]
  34. Ahmed, N.; Rafiq, J.I.; Islam, M.R. Enhanced human activity recognition based on smartphone sensor data using hybrid feature selection model. Sensors 2020, 20, 317. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  35. Thangaraj, R.; Pant, M.; Abraham, A.; Bouvry, P. Particle swarm optimization: Hybridization perspectives and experimental illustrations. Appl. Math. Comput. 2011, 217, 5208–5226. [Google Scholar] [CrossRef]
  36. Vanneschi, L.; Codecasa, D.; Mauri, G. A comparative study of four parallel and distributed PSO methods. New Gener. Comput. 2011, 29, 129–161. [Google Scholar] [CrossRef]
  37. Damaševičius, R.; Woźniak, M. State Flipping Based Hyper-Heuristic for Hybridization of Nature Inspired Algorithms; Springer: Berlin/Heidelberg, Germany, 2017; Volume 10245, pp. 337–346. [Google Scholar]
  38. Ahmadianfar, I.; Bozorg-Haddad, O.; Chu, X. Gradient-based optimizer: A new Metaheuristic optimization algorithm. Inf. Sci. 2020, 540, 131–159. [Google Scholar] [CrossRef]
  39. Mirjalili, S.; Mirjalili, S.M.; Lewis, A. Grey wolf optimizer. Adv. Eng. Softw. 2014, 69, 46–61. [Google Scholar] [CrossRef] [Green Version]
  40. Emary, E.; Zawbaa, H.M.; Hassanien, A.E. Binary grey wolf optimization approaches for feature selection. Neurocomputing 2016, 172, 371–381. [Google Scholar] [CrossRef]
  41. Abdel-Basset, M.; El-Shahat, D.; El-henawy, I.; de Albuquerque, V.H.C.; Mirjalili, S. A new fusion of grey wolf optimizer algorithm with a two-phase mutation for feature selection. Expert Syst. Appl. 2020, 139, 112824. [Google Scholar] [CrossRef]
  42. Al-Tashi, Q.; Rais, H.M.; Abdulkadir, S.J.; Mirjalili, S.; Alhussian, H. A review of grey wolf optimizer-based feature selection methods for classification. In Evolutionary Machine Learning Techniques; Springer: Berlin/Heidelberg, Germany, 2020; pp. 273–286. [Google Scholar]
  43. Anguita, D.; Ghio, A.; Oneto, L.; Parra, X.; Reyes-Ortiz, J.L. A public domain dataset for human activity recognition using smartphones. In Proceedings of the ESANN 2013 Proceedings, European Symposium on Artificial Neural Networks, Computational Intelligence and Machine Learning, Bruges, Belgium, 24–26 April 2013; Volume 3, p. 3. [Google Scholar]
  44. Jobanputra, C.; Bavishi, J.; Doshi, N. Human activity recognition: A survey. Procedia Comput. Sci. 2019, 155, 698–703. [Google Scholar] [CrossRef]
  45. Ronao, C.A.; Cho, S.B. Human activity recognition with smartphone sensors using deep learning neural networks. Expert Syst. Appl. 2016, 59, 235–244. [Google Scholar] [CrossRef]
  46. Chen, Z.; Jiang, C.; Xie, L. A novel ensemble ELM for human activity recognition using smartphone sensors. IEEE Trans. Ind. Inform. 2018, 15, 2691–2699. [Google Scholar] [CrossRef]
  47. Zhang, L.; Wu, X.; Luo, D. Human activity recognition with HMM-DNN model. In Proceedings of the 2015 IEEE 14th International Conference on Cognitive Informatics & Cognitive Computing (ICCI* CC), Beijing, China, 6–8 July 2015; pp. 192–197. [Google Scholar]
  48. Cao, L.; Wang, Y.; Zhang, B.; Jin, Q.; Vasilakos, A.V. GCHAR: An efficient Group-based Context—Aware human activity recognition on smartphone. J. Parallel Distrib. Comput. 2018, 118, 67–80. [Google Scholar] [CrossRef]
  49. Wang, A.; Chen, G.; Yang, J.; Zhao, S.; Chang, C.Y. A comparative study on human activity recognition using inertial sensors in a smartphone. IEEE Sens. J. 2016, 16, 4566–4578. [Google Scholar] [CrossRef]
  50. Sansano, E.; Montoliu, R.; Belmonte Fernández, Ó. A study of deep neural networks for human activity recognition. Comput. Intell. 2020, 36, 1113–1139. [Google Scholar] [CrossRef]
  51. Xia, K.; Huang, J.; Wang, H. LSTM-CNN Architecture for Human Activity Recognition. IEEE Access 2020, 8, 56855–56866. [Google Scholar] [CrossRef]
  52. Elsts, A.; Twomey, N.; McConville, R.; Craddock, I. Energy-efficient activity recognition framework using wearable accelerometers. J. Netw. Comput. Appl. 2020, 168, 102770. [Google Scholar] [CrossRef]
  53. Holland, J.H. Genetic algorithms. Sci. Am. 1992, 267, 66–73. [Google Scholar] [CrossRef]
  54. Storn, R.; Price, K. Differential evolution—A simple and efficient heuristic for global optimization over continuous spaces. J. Glob. Optim. 1997, 11, 341–359. [Google Scholar] [CrossRef]
  55. Mirjalili, S. Moth-flame optimization algorithm: A novel nature-inspired heuristic paradigm. Knowl. Based Syst. 2015, 89, 228–249. [Google Scholar] [CrossRef]
  56. Mirjalili, S. SCA: A sine cosine algorithm for solving optimization problems. Knowl. Based Syst. 2016, 96, 120–133. [Google Scholar] [CrossRef]
  57. Heidari, A.A.; Mirjalili, S.; Faris, H.; Aljarah, I.; Mafarja, M.; Chen, H. Harris hawks optimization: Algorithm and applications. Future Gener. Comput. Syst. 2019, 97, 849–872. [Google Scholar] [CrossRef]
  58. Zhao, W.; Zhang, Z.; Wang, L. Manta ray foraging optimization: An effective bio-inspired optimizer for engineering applications. Eng. Appl. Artif. Intell. 2020, 87, 103300. [Google Scholar] [CrossRef]
  59. Kennedy, J.; Eberhart, R. Particle swarm optimization. In Proceedings of the ICNN’95-International Conference on Neural Networks, Perth, WA, Australia, 27 November–1 December 1995; Volume 4, pp. 1942–1948. [Google Scholar]
  60. Yang, X.S.; Gandomi, A.H. Bat algorithm: A novel approach for global engineering optimization. Eng. Comput. 2012, 29, 464–483. [Google Scholar] [CrossRef] [Green Version]
  61. Kononenko, I.; Šimec, E.; Robnik-Šikonja, M. Overcoming the Myopia of Inductive Learning Algorithms with RELIEFF. Appl. Intell. 1997, 7, 39–55. [Google Scholar] [CrossRef]
  62. Kira, K.; Rendell, L.A. A practical approach to feature selection. In Machine Learning Proceedings 1992; Elsevier: Amsterdam, The Netherlands, 1992; pp. 249–256. [Google Scholar]
  63. Urbanowicz, R.J.; Meeker, M.; La Cava, W.; Olson, R.S.; Moore, J.H. Relief-based feature selection: Introduction and review. J. Biomed. Inform. 2018, 85, 189–203. [Google Scholar] [CrossRef]
  64. Weiss, G.M.; Lockhart, J. The impact of personalization on smartphone-based activity recognition. In Proceedings of the Workshops at the 26th AAAI Conference on Artificial Intelligence, Toronto, ON, Canada, 22–26 July 2012. [Google Scholar]
Figure 1. HAR model optimization framework (left) and GBOGWO flow chart (right).
Figure 1. HAR model optimization framework (left) and GBOGWO flow chart (right).
Entropy 23 01065 g001
Figure 2. Normalized evaluation metrics of the compared algorithms.
Figure 2. Normalized evaluation metrics of the compared algorithms.
Entropy 23 01065 g002
Figure 3. Original featured data [43] visualization in 2D.
Figure 3. Original featured data [43] visualization in 2D.
Entropy 23 01065 g003
Figure 4. Convergence curves for the compared optimization algorithms: (a) UCI-HAR; and (b) WISDM.
Figure 4. Convergence curves for the compared optimization algorithms: (a) UCI-HAR; and (b) WISDM.
Entropy 23 01065 g004
Figure 5. Feature frequency according to the top 6 algorithms for both datasets: (a) UCI-HAR; and (b) WISDM.
Figure 5. Feature frequency according to the top 6 algorithms for both datasets: (a) UCI-HAR; and (b) WISDM.
Entropy 23 01065 g005
Table 1. Summary of UCI-HAR activities data.
Table 1. Summary of UCI-HAR activities data.
ActivityAbb.TrainingTestTotalPer. (%)
WalkingWK1226496172216.72
Walking upstairsWU1073471154414.99
Walking downstairsWD986420140613.65
SittingST1286491177717.25
StandingSD1374532190618.51
LyingLY1407537194418.11
Total 7352297410299100
Table 2. Search settings and parameter values of algorithms.
Table 2. Search settings and parameter values of algorithms.
Search settings l b −10Lower bound
u b 10Upper bound
t h r 0Threshold
N30Population size
T50Maximum number of iterations
AlgorithmParameterValueDescription
GBOGWO p r 0.75Local escape probability
GBO p r 0.5Local escape probability
GAcrossover0.4Crossover percentage between individuals
mutation rate0.15Rate of mutation operator
mutation per0.7Percentage of mutation operator
MFOb1.5Controlling shape of logarithmic spiral
SCAa2Controlling range of sine and cosine waves.
B-SCAa2Controlling range of sine and cosine waves.
TFV-shaped 2 π atan2 ( π 2 · x )
B-BATA0.5Loudness factor.
r0.5Pulse rate
Q m i n 0Minimum frequency
Q m a x 2Maximum frequency
TFV-shaped 2 π atan2 ( π 2 · x )
B-PSO V m a x 0.5Maximum velocity.
W m a x 0.9Inertia value upper bound
W m i n 0.4Inertia value lower bound
C 1 2.78Personal learning coefficient
C 2 2.78Global learning coefficient
TFS-shaped 1 1 + exp x
Table 3. Comparison of GBOGWO and other algorithms’ feature selection results.
Table 3. Comparison of GBOGWO and other algorithms’ feature selection results.
GBOGWOGWOGAMFOMRFOGBODEBBATHHOBSCASCABPSO
M PR98.1397.8297.897.7797.7397.6897.5597.3497.2597.2197.1896.89
Std PR0.120.2130.1190.1730.1750.1790.1490.130.1370.1760.1720.148
M # F304289.4285299.1286.6298.5290.5288.4428.6281.6282.8290.3
Std # F11.0914.169.8214.519.2936.158.9211.8768.566.8514.3812.47
Red (%)45.848.4149.1946.6852.1246.7948.1248.5923.649.849.7348.25
H-11111111111
p-value- 4.3 × 10 3 2.4 × 10 4 2.1 × 10 4 2.3 × 10 4 5.2 × 10 5 1.3 × 10 5 1.3 × 10 7 3.2 × 10 8 4.9 × 10 8 1.7 × 10 7 4.3 × 10 9
Time (min)50.849.0254.7853.8395.452.349.850.1128.349.3549.850.03
Table 4. Classification rates and confusion matrix of UCI-HAR activities using the proposed model.
Table 4. Classification rates and confusion matrix of UCI-HAR activities using the proposed model.
True Class
ActivitiesWKWUWDSTSDLDSens.Spec.
Predicted ClassWK4960000010099.84
WU0471000010099.56
WD41040600096.6100
ST01045436092.4699.67
SD0008524098.598.51
LD00000537100100
Precision (PR)99.297.7210098.2793.5710098.13
Table 5. Comparison with other studies in the literature.
Table 5. Comparison with other studies in the literature.
Ref.TechniqueActivitiesPR (%)
WKWUWDSTSDLD
 [43]All features+SVM969899979010096
[51]LSTM-CNN94.6595.0310092.3293.6110095.8
ST-DeepHAR [6]LSTM99969995999897.66
Proposed techniqueGBOGWO+SVM99.297.7210098.2793.5710098.13
Table 6. Comparison with filter-based methods.
Table 6. Comparison with filter-based methods.
MethodClassification Rates (%)# FRed (%)Fitness Using Equation (21)
Acc.Sens.PR λ = 0.99 λ = 0.9
t-test95.1295.1595.5335037.694.5886.04
ReliefF96.7196.6296.781836795.8187.13
Proposed model9897.9298.1330445.897.1588.37
Table 7. Numerical results for WISDM.
Table 7. Numerical results for WISDM.
GBOGWOGWOGAMFOMRFOGBO
M Acc98.8798.3098.198.2198.2398.11
Std PR0.0060.0020.010.0090.0130.019
M # F32.727.943.559.929.725
Std # F3.774.384.676.338.350.9
Red (%)78.281.4716080.283.33
H-11111
p-value- 6.5 × 10 9 7.4 × 10 13 1.7 × 10 13 1.3 × 10 13 2.6 × 10 13
Time (min)65.6758.5789.8867.28117.2878.13
Table 8. Feature engineering for the WISDM dataset.
Table 8. Feature engineering for the WISDM dataset.
SignalsBody Acceleration and Gravity Component
Time-domain *AR coeff. (12); AR coeff. of magnitude (4); acceleration (1);
entropy of jerk (3); histogram (15); kurtosis (3); mean (3);
mean of jerk (3); mean of magnitude (1); max (3);
mean of absolute difference (3); power of gravity (3);
skewness (3); STD (3); STD of jerk (3);
STD of magnitude (1); SMA (1); TA (1)
Frequency-domainMean freq. (3); max freq. (3); median freq. (3)
Cardinality150
* AR coeff.: auto-regressive model coefficients; STD: standard deviation; SMA: signal magnitude area; TA: tilt angle. The enhancement of each statistic/coefficient is mentioned in parentheses.
Table 9. Comparison with filter-based methods for the WISDM dataset.
Table 9. Comparison with filter-based methods for the WISDM dataset.
MethodClassification Rates (%)# FRed (%)Fitness Using Equation (21)
Acc.Sens.PR λ = 0.99 λ = 0.9
t-test97.5896.0196.3712417.3396.6187.9
ReliefF98.1196.8597.321082897.1488.37
Proposed model98.8798.0298.5432.778.297.8889
Table 10. Classification rates and confusion matrix of WISDM activities using the proposed model. Test set represents 30% of total samples.
Table 10. Classification rates and confusion matrix of WISDM activities using the proposed model. Test set represents 30% of total samples.
True Class
ActivitiesWDSTSDWUWKJGSens.Spec.
Predicted ClassWD42600270293.6399.85
ST0266130098.52100
SD0021600010099.98
WU70053901596.0899.28
WK000019430100100
JG00020158899.8799.51
Precision (PR)98.3810099.5494.4010098.9498.54
Table 11. Features selected by top 6 algorithms.
Table 11. Features selected by top 6 algorithms.
UCI-HAR (Count = 6)WISDM
IndexNameIndexNameCount
38tBodyAcc-correlation()-X,Y52Skewness-Y6
93tBodyAccJerk-min()-X14TA5
100tBodyAccJerk-iqr()-X21STD-Jerk-X5
132tBodyGyro-max()-Z30AR-Magnitude,15
135tBodyGyro-min()-Z8AR-Y,44
183tBodyGyroJerk-entropy()-X9AR-Z,14
196tBodyGyroJerk-arCoeff()-Z,323STD-Jerk-Z4
229tBodyAccJerkMag-mad()24Mean-X4
298fBodyAcc-kurtosis()-X26Mean-Z4
352fBodyAccJerk-mad()-Y27STD-X4
353fBodyAccJerk-mad()-Z28STD-Y4
355fBodyAccJerk-max()-Y33AR-Magnitude,44
367fBodyAccJerk-entropy()-X35STD-Magnitude4
433fBodyGyro-max()-X67Max-Freq.-Z4
447fBodyGyro-entropy()-Y72Acceleration4
557angle(tBodyGyroMean,gravityMean)103Gravity-STD-Y4
130Gravity-Kurtosis-Y4
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Helmi, A.M.; Al-qaness, M.A.A.; Dahou, A.; Damaševičius, R.; Krilavičius , T.; Elaziz, M.A. A Novel Hybrid Gradient-Based Optimizer and Grey Wolf Optimizer Feature Selection Method for Human Activity Recognition Using Smartphone Sensors. Entropy 2021, 23, 1065. https://doi.org/10.3390/e23081065

AMA Style

Helmi AM, Al-qaness MAA, Dahou A, Damaševičius R, Krilavičius  T, Elaziz MA. A Novel Hybrid Gradient-Based Optimizer and Grey Wolf Optimizer Feature Selection Method for Human Activity Recognition Using Smartphone Sensors. Entropy. 2021; 23(8):1065. https://doi.org/10.3390/e23081065

Chicago/Turabian Style

Helmi, Ahmed Mohamed, Mohammed A. A. Al-qaness, Abdelghani Dahou, Robertas Damaševičius, Tomas Krilavičius , and Mohamed Abd Elaziz. 2021. "A Novel Hybrid Gradient-Based Optimizer and Grey Wolf Optimizer Feature Selection Method for Human Activity Recognition Using Smartphone Sensors" Entropy 23, no. 8: 1065. https://doi.org/10.3390/e23081065

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop