Human Gait Analysis: A Sequential Framework of Lightweight Deep Learning and Improved Moth-Flame Optimization Algorithm

Human gait recognition has emerged as a branch of biometric identification in the last decade, focusing on individuals based on several characteristics such as movement, time, and clothing. It is also great for video surveillance applications. The main issue with these techniques is the loss of accuracy and time caused by traditional feature extraction and classification. With advances in deep learning for a variety of applications, particularly video surveillance and biometrics, we proposed a lightweight deep learning method for human gait recognition in this work. The proposed method includes sequential steps–pretrained deep models selection of features classification. Two lightweight pretrained models are initially considered and fine-tuned in terms of additional layers and freezing some middle layers. Following that, models were trained using deep transfer learning, and features were engineered on fully connected and average pooling layers. The fusion is performed using discriminant correlation analysis, which is then optimized using an improved moth-flame optimization algorithm. For final classification, the final optimum features are classified using an extreme learning machine (ELM). The experiments were carried out on two publicly available datasets, CASIA B and TUM GAID, and yielded an average accuracy of 91.20 and 98.60%, respectively. When compared to recent state-of-the-art techniques, the proposed method is found to be more accurate.


Introduction
Person recognition and identification using gait have great importance in the field of machine learning and computer vision [1]. Gait is the walking behavior of a person but to recognize a person by gait from distance and in less illuminated environment it becomes very complicated and difficult [2]. Moreover, as compared to other traditional biometric techniques such as fingerprint, face detection, and iris detection, it does not require direct contact of a person [3]. Due to these discriminative factors, it has taken a lot of attention from researchers and it is used to apply in various applications like security surveillance, dubious person detection, and forensics [4,5].
In early research, gait recognition was categorized in to two main categories such as model-based and appearancebased [6]. e prior categories are more costly to implement the human model using high-resolution videos and give low average results as compared to modern categories; hence, researchers focus on using modern categories for gait feature detection [7]. In the model-based method, prior information is used to extract the moving features of the human body [8]. Furthermore, in this method, the movement of human body is examined using changing factors like gait path, position of joints, and the torso [9]. is is a challenging method, due to its high computational complications. In the model-free method, gait cycle is used to extract the features from a silhouette, and it is simple to implement due to less computational cost [10].
ere are various machine learning and computer vision techniques that are used to overcome the covariate factors like angular deviations [11], lightning conditions [12], and clothing and carrying bags [6,13], but there exist various challenges in extracting useful features that affect the optimal accuracy results. Feature extraction is considered as the most important step in recognizing gait traits [14], such as if the extracted features are related to the problem, then the system will be able to correctly recognize the human gait patterns. In contrast, if irrelevant features are evaluated, then the system performance will go down and it will not give optimal recognition results [10]. In past, various types of features are used like shape-based features [15], geometrical features [16], and statistical features [17]. Deep features are extracted using deep convolutional neural network techniques to overcome these challenges. Deep learning techniques, rather than manual feature extraction, extract automated features from raw images [18,19]. In this work, we proposed a sequential lightweight deep learning architecture for human gait recognition. Our major contributions are listed as follows: (i) Two pretrained deep learning models are modified namely VGG-19 and MobileNet-V2 based on the target dataset classes and adjusted their weights. en, both models are trained using transfer learning without freezing any layer and obtained newly trained models. (ii) Feature engineering is performed on fully connected layer 7 (VGG- 19) and global pooling layer (MobileNet-V2) and fused by employing discriminant correlation analysis (DCA) (iii) A modified moth-flame optimization algorithm is developed for the selection of optimum features that are finally classified using extreme learning machine (ELM) e rest of the article is organized as follows: Section 2 describes the manuscript's related work. Section 3 discusses the specifics of selected datasets. e proposed methodology is presented in Section 4. Section 5 discusses and explains the experimental results. Finally, Section 6 brings the entire manuscript that followed the references to a close.

Related Works
Identification of human through gait is the most biometric application, and researchers have made extensive studies for it by extracting feature values [20]. In literature, various machine learning and computer vision-based techniques are implemented for human gait recognition [21]. Liao et al. [22] presented Pose-gait model-based gait recognition method. In this approach, the human 3D pose is estimated using CNN, and then spatiotemporal features extracted from the 3D pose are used for the improvement in recognition. Two publicly available datasets CASIA B and CASIA E are used for experimentation, and it gives auspicious results in the presence of covariate factors. Sanjay et al. [23] introduced an automated approach for human gait recognition in the presence of a covariate situation. In the first step, basic distinct stances in the gait cycle are detected which are used to compute the gait features related to these detected stances and it is termed as dynamic gait energy image (DGEI). en generative adversarial network (GAN) is used to detect the corresponding dynamic gait energy image. ese extracted features are then used to compare with the gallery sequences. Finally, GAN-created DGEI is used for final recognition. Publicly available datasets such as CASIA B, TUM Gait, and OU-ISIR TreadMill B are used to validate the presented approach, and it gives considerably improved results as compared to existing methods. Chen et al. [24] introduced a method for cross-view gait recognition using deep learning. Multiview gait generative adversarial network is introduced for creating fake gait data samples for extension in existing data. e method is then used to train each instance of each view involved in single or multiple datasets. Domain alignment using projected maximum mean dependency (PMMD) is utilized to minimize the effect of distribution divergence. CASIA B and OUMVLP are used for experimentation, and the achieved results show that the introduced method gives better results than existing methods. Hou et al. [25] presented a set residual network-based gait recognition model to detect more discriminative features from the silhouettes. Set residual block is introduced to extract the silhouette level and two-level features in a parallel sequence, and then the residual connection is applied to join the two-level features. Moreover, an efficient method is applied to utilize features from the deep layers. Two datasets CASIA B and OUMVLP are used for experimentation. e applied approach gives consistent results as compared to existing methods. Gul et al. [13] introduced a machine vision method to extract the distinct gait features from covariate factors. Spatiotemporal gait features are extracted, and these features are used to train the 3D CNN model to overcome these challenges. en, the holistic method is used by the model to implement the distinct gait features in the form of gait energy images. Two publicly available datasets OULP and CASIA B are used to test the validity of the introduced method with large gender and age differences. e presented approach gives promising results using CASIA B dataset as compared to existing methods. e methods presented above concentrated on both spatial and temporal data. None of them focused on feature fusion or optimization of extracted features to achieve better results in the shortest amount of time. As a result, in this article, we proposed a lightweight deep learning framework for human gait recognition that not only improves accuracy but also reduces a system's computational time.

Datasets
3.1. TUM GAID Dataset. TUM Gait from Audio, Image and Depth (GAID) [26] dataset consists of RGB audio, video, and depth. It consists of 305 subjects carried out in two indoor walking sequences in which four distinct situations are captured without any view variation through Microsoft Kinect like six normal walk videos (n1-n6), two videos with carrying a bag (b1-b2), and two walking videos wearing coating shoes (s1-s2), and there is an elapsed time instance in which 32 subjects were recorded wearing distinct cloths. A few sample images are shown in Figure 1.

Methodology
e proposed lightweight (LW) human gait recognition framework has been presented in this section with detailed mathematical formulations and flow diagrams. e main architecture is shown in Figure 3. In this figure, it is illustrated that the proposed method consists of some important steps such as modification of pretrained CNN models, training of modified models using transfer learning (TL), feature engineering on global average pooling layers, fusion of extracted deep features using discriminant correlation analysis (DCA), selection of best features using the modified moth-flame optimization algorithm, and finally classification using the extreme learning machine (ELM). e details of each step are given.

Convolutional Neural Network (CNN).
e convolutional neural network (CNN) has become an important recognition task in the domain of computer vision. e CNN architecture is employed for feature extraction of an image based on several hidden layers. CNNs have many layers, including convolutional, pooling, fully connected, and others. e convolution layer (CL) is the most important layer of a CNN that performed a 2D convolution process on the input and the kernels through a forward pass. e kernel weights in every CL are assigned randomly and their values are changed at each step by applying the loss function through network training. In the end, the resultant learned kernels may identify some types of shapes within the input images. In CL, three different types of steps are performed like convolution, stack, and nonlinear activation function.
Suppose, we have an input matrix M and an output Z of the CL, and there are some set of kernels K l , ∀l ∈ [1, . . . , L], then the output of the convolution process O(l) after step 1 is represented as where ⊗ refers to the convolution process, which is the product of filter and inputs. Second, all O(l) activation maps are combined to create a novel 3D activation map.
where Q represents the combination of operations with channel direction, and L is the total number of filters. ird, the 3D activation map R is given as input into the activation function and gives the resultant activation map as e size Q of three main matrices (input, filters, and result) is taken as where the variables (T, U, V) represent the size of height, width, and channels of the activation map, and the subscripts A, P, and N represent input, filter, and output, respectively. It contains two equalities. First, V A � V P refers the channel of input V A equals to the channels of filter V P . Second, V N � L refers the channels of output V N equals the number of filters L. Suppose Y represents padding, S represents stride, so the result of T N , U N , V N can be evaluated as where d de is the floor function. e nonlinear activation Υ generally selects the rectified linear unit (ReLU) function [28].
where r mn ∈ R is the component of the activation map R. At present, ReLU is the mostly used NLAF as compared to the traditional hyperbolic tangent (HT) and sigmoid function (SM) function, that are computed as      Computational Intelligence and Neuroscience source domain ξ S � F S , P S (ϕ S ) with the source task λ S � F S , f S (·) and a target domain ξ T � F T , P T (ϕ T ) with the target task, λ T � F T , f T (.) aims to learn a better mapping function f T (.) for the target task λ T for the knowledge transfer from the source domain ξ S and task λ S . Hence, the TL is expressed as follows: Hence, DTL is defined as follows: given a TL task tives to acquire the f S⟶T (.) by leveraging powerful DL process. Visually, the DTL process is shown in Figure 4.

Modified VGG-19
Model. Visual geometry group (VGG)-19 [29] is the modified version of VGG, and it consists of 19 layers with 16 convolutional layers of 64, 128, and 256, and 512 filter sizes with stride length and padding is 1 pixel on each side. e convolutional layer consists of 5 sets, two of them contain 64 filters, the next set contains 2 convolutional layers with 128 filters, the next set contains 4 convolutional layers with 256 filters, and the last two sets contain 4 convolutional layers with 512 filters each. en, a max pooling layer with a 2 × 2 filter size and stride rate of 2 pixels are used after each set of convolutional layers. e output is then passed to the fully connected layer. ree fully connected (FC) layers and one softmax layer are used for the classification. In this work, we removed the last fully connected (FC) layer and added a new FC layer. en, several hyperparameters are employed such as training rate, epochs, mini batch size, optimizer, and training loss. Based on these hyperparameters, we trained the modified model from scratch through TL and obtained a new model for only gait recognition task. Later, this modified model is used for the feature engineering task.

Modified MobileNet-V2
Model. MobileNet-V2 [30] is a lightweight CNN-based model specially designed for mobile devices. is architecture can perform well on small datasets as it can overcome the effect of overfitting and it also optimized the memory consumption. In this network, 17 inverted residuals are used between two convolutional layers and one FC layer. So, the depth of the network consists of 53 convolutional layers and one FC layer. e working of this architecture is based on two concepts that include depthwise separable convolution and the inverted residual methods. In this architecture, a full convolutional layer is replaced with a factorized version that divides the convolution into two separate groups. e first layer is named as depth-wise convolution; its function is to do lightweight filtering by using one convolutional filter on each input channel. e second layer is named as point-wise convolutional layer, which is used for creating new features by Computational Intelligence and Neuroscience computing linear models of the input channels. e depthwise convolutional layers contains 2 convolutional layers: the first layer contains a 3 × 3 filter size, while the other one has a 1 × 1 filter size. e other two regular convolutional layers have filter sizes of 3 × 3 and 1 × 1. Moreover, in this architecture, ReLU6 is used instead of ReLU as it is more efficient for less accurate computation. Dropout and batch normalization are then applied, where layer activators are standardized to mean zero and unit variance, and then, linear transformation is applied [31].
In this work, we removed the last layer and added a new FC layer. en, several hyperparameters are employed such as training rate (0.005), epochs (100), mini batch size (32), optimizer (Adam), and training loss. Based on these hyperparameters, we trained the modified model from scratch through TL and obtained a new model for only gait recognition task.

Feature Engineering.
Feature engineering is applied on global average pooling layers of both models and obtained two feature vectors of dimension ×K 1 and N × K 2 . Mathematically, this process is defined as follows: where K 1 and K 2 represent the length of feature vectors, and layer defines the selected one like global average pooling. ereafter, the fusion process is performed using discriminant canonical correlation analysis approach.

Discriminative Canonical Correlation Analysis-Based
Fusion. In this work, the DCCA fusion approach is employed for feature fusion. By applying canonical correlation analysis (CCA), the correlated features l v m m t and l v n n t , t � 1, . . . , z, are extracted and merged for identification.
ough the features extracted from related class samples are not utilized, resultantly it becomes the constraint of the recognition capabilities of CCA. Moreover, the basic concept to introduce CCA is for modeling instead of recognition, and correlation β refers to the certainty among l v m m t and l v n n t , t � 1, . . . , z. CCA was more often utilized for modeling and estimation, for instance image extraction and parameter prediction. If the extracted features are for recognition, then the class description of the instances should be utilized to get more discriminatory features. Finally, the class description was fused with the CCA framework for cooperated feature extraction and presented an innovative approach of fused feature extraction for multimodal recognition, termed as discriminative canonical correlation analysis (DCCA). Mathematically, this approach is defined as follows.
Suppose z pairs of mean-normalized pairwise instances (m t , n t ) z t�1 ∈ ξ a × ξ b access from p classes, DCCA can be systematically represented in the below optimization problem: max l m ,l n l v m S l l n − μ.l v m S h l n , where the parameters S l and S h are used to compute the inside-class association and between-class association, respectively (detailed description is given below), μ > 0 adjustable metric that shows the comparative significance of the inside-class association l v m S l l n contrasted with the between-class association l v m S h l n . Moreover, the limitation value represents the scale limitation on l m , l n .
where m (t) k refers the kth instance in the tth class, similarly n (t) k , and z t shows the number of instances of m (t) k or n (t) k in the tth class. e matrix S l is represented as where G represents a proportionate, positively defined, block crosswise matrix, and Matrix (G) � p. In contrast, the matrix S h is represented as e "�" in the end holds because mean normalization is applied on the instances, hence both M1 z � 0 and N1 z � 0 holds. In contrast between equations (13) and (15), the only difference among S l and S h is a single negative sign, thus the objective of equation (10) will be (1 + μ)l v m S l l n , and this enhancement issue is free from parameter μ, consequently μ can be excluded. Hence, DCCA can be represented as max l m ,l n l v m MGN V l n , By applying the Lagrangian multiplier technique, it becomes very simple to get main equation of DCCA, which is represented as When the vector pairs (l mt , l nt ), i � 1, . . . , g, adjacent to the first g largest generalized eigenvalues and attained, let L m � [l m1 , . . . , l mg ], L n � [l n1 , . . . , l ng ], then both feature extraction and the feature fusion can be performed using FFS-I and II, respectively, where g fulfills the limitations g ≤ min(a, b) and g ≤ p. e formulation returned a fused vector of dimension N × K 3 , where K 3 ∈ (K 1 , K 2 ). Later on, this resultant vector is further improved using a modified moth-flame optimization algorithm.

Moth-Flame Optimization Algorithm (MFO).
Several nature-inspired optimization algorithms have been introduced in the literature for best feature selection such as genetic algorithm, particle swarm optimization, and moth-flame optimization [32]. e improved mothflame optimization algorithm is utilized in this work for the best feature selection. Originally, the MFO algorithm was presented by Mirjalili [33]. It is under the populacebased metaheuristics algorithm. In this procedure, first the data flow of MFO begins by randomly generating moths within the resultant space. en it calculates the positional (i.e., fitness) value of each moth and label the best position by flame. Afterwards, changing the moth place depends on a whole movement function used to attain a better position labeled by a flame. Moreover, it updates the new best positions of the individual. e previous process (i.e., updating of moths' location and generating the new location) until it meets the resultant criteria. e MFO algorithm consists of three major steps that are as follows. [33], it is supposed that an individual moth can fly in 1D, 2D, 3D, or in hyper-dimensional position. e matrix of moths can be represented as H � h 1,1 h 1,2 · · · · · · h 1,a h 2,1 h 2,2 · · · · · · h 2,a ⋮ ⋮ ⋮ ⋮ ⋮ h m,1 h m,1 · · · · · · h m,a

Creating the Initial Population of Moths. As stated in
where m represents the number of moths' and a represents the number of dimensions in the resultant region. Moreover, the fitness values for entire moths' stored in an array are represented as e remaining elements in the algorithm are flames that are represented using D-dimensional space with their fitness/position value function in the following matrix set as P � P 1,1 P 1,2 · · · · · · P 1,a P 2,1 P 2,2 · · · · · · P 2,a ⋮ ⋮ ⋮ ⋮ ⋮ P m,1 P m,1 · · · · · · P m,a It is important to note that moths and flames both are solutions. e moths are the real search agents that revolve around the search area, while flames are the moth's best position that is obtained yet. Hence, an individual moth hunts around a flame and updates it when it finds the best solution. Following this procedure, a moth never misses its best solution.

Updating Moths' Location/Positions. MFO utilizes
three distinct functions to convergent the global optimum of the optimization issues. Mathematically, it is defined as follows: where L represents the first random positions of the moths (πl: ∅ ⟶ H, VH { }), M represents that the motion of the moths in the search is (M: H ⟶ H), and E represents end of the search process (E: H ⟶ true, false). e equation given below represents L function, which is used for the implementation of random distribution: where UB and LB refers to the upper and lower bound variables, respectively. As discussed before, the moths fly in the search area by means of transverse direction. ere are Computational Intelligence and Neuroscience three conditions that should be followed when applying a logarithmic spiral: (i) e spiral starting point should start from the moth; (ii) the spiral endpoint should be the location of the flame, and (iii) variation in the range of spiral should not extend from the search area. us, in the MFO algorithm, the logarithmic spiral can be defined as where R x represents space between the xth moth and yth flame (computed by equation 24), q represents a solution to define the shape of the logarithmic spiral, b represents a random range between [−1, 1].
In MFO, the equalization among exploitation and examination is affirmed by the spiral motion of the moth near the flame in the search area. Moreover, to escape from falling in the trap of the local goal, the best solution has been kept in each step, and the moths fly around the flames by means of VP and VH matrices. en, the update criteria are defined as follows:

Updating the Size of Flames.
is part highlights to augment the manipulation of the MFO algorithm (i.e., updating the moths' location in m various positions in the search area may minimize the chance of exploitation of the best optimal solutions). However, minimizing the extent of flames helps to overcome this problem using the following equation: where O refers to the maximum number of flames, c refers the current number of iterations, and I represents the maximum number of iterations. is equation returns the best features; however, during the analysis stage, it is observed that the best selected features contain some redundant information; therefore, we tried to overcome this problem and speedup the selection process based on Newton Raphson (NR) formulation. Mathematically, the NR method is defined as follows: where δ n ∈ Sf and Sf represent the selected features of moth-flame. rough the above formulation, a stop value is obtained that added in equation 25 for final selection.
e final selected features are passed to the extreme learning machine (ELM) for classification. A few visual predicted frames are shown in Figure 5.

Experimental Results and Analysis
In this section of the proposed method, the detailed experimental process is presented in the form of tables and graphs. e proposed method is tested using two publicly available datasets, CASIA B and TUM GAID. Section 2 contains more information on both datasets. Instead of 70 : 30, the selected datasets are divided 50 : 50 for training and testing. e main reason for this portioning is to make the validation process more equitable. All of the results are based on 10-fold cross-validation. For the classification results, several classifiers are used, including the extreme learning machine (ELM), support vector machine (SVM), KNN, ensemble tree (EBT), and decision trees (DTs). e entire proposed framework is implemented on MATLAB 2021b using Personal Desktop Computer Corei7, 32 GB RAM, and 8 GB graphics card.

CASIA B Dataset Results.
e proposed method results for the CASIA B dataset are presented in the form of numerical values and a time plot in this section. Table 1 provides the classification results of the CASIA B dataset from all perspectives. Normally, researchers choose only a few angles, but in this work, we chose all 11 angles to test the capability of the proposed algorithm. Each angle has three classes: normal walk (NM), walk with a bag (BG), and walk while wearing a coat (WC) (CL). On this dataset, ELM performed better, with average accuracies of 96.89, 93.07, and 83.66% for NM, BG, and CL, respectively. For each angle, the obtained accuracy is above 90% that shows the proposed method effectiveness. A comparison of ELM with other classifiers such as SVM, FKNN, EBT, and DT shows that ELM performed better than all of them. Moreover, the time is also noted of each classifier as shown in Figure 6. From this figure, it is observed that the ELM and DT classifiers executed fast than the other listed methods.

TUM GAID Dataset Results.
e results of the proposed method on the TUM GAID dataset are given in Table 2. In this table, accuracy is computed of each class of the selected dataset such as normal walk, walk with a bag, and walk with shoes. Moreover, the average accuracy of each classifier is also computed. Many classifies are selected and ELM shows the better average accuracy of 98.60%. e rest of the classifiers obtained average accuracies of 97.25, 96.73, 96.91, and 96.26%, respectively. e computational time of each classifier is also computed and plotted in Figure 7. It can be seen from this figure that the ELM has a minimum computation time of 86.43 (sec) compared to the rest of the classifiers. Hence, overall, ELM classifier performed better using the proposed method on the TUM GAID dataset.

Discussion and Comparison.
A detailed analysis of the proposed framework has been conducted in this section based on confidence interval and standard error means (SEM). As given in Tables 3 and 4, the proposed  Based on the minimum and maximum accuracy, the standard error mean is computed. rough SEM, a confidence error is obtained that shows the consistency of proposed framework. Table 3 provides the confidence interval-based analysis of the CASIA B dataset. Confidence level and margin of error (MoE) are calculated for each class such as walk, bag, and coat. We selected several confidence levels such as 68.3%, σ x ; 90%, 1.645σ x ; 95%, 1.960σ x ; and 99%, 2.576σ x and obtained MOE for each is noted as given below. Based on the MoE, it is observed that the proposed framework showed consistent performance on the CASIA B dataset after 500 iterations. Similarly, Table 4 provides the proposed confidence intervalbased analysis of the TUM GAID dataset. From this table, it is also confirmed that the proposed method's accuracy is consistent after the numbers of iterations.
At the end, a detailed comparison is conducted with recent techniques for both selected datasets such as CASIA B and TUM GAID. Table 5 provides the comparison of the proposed method accuracy with recent techniques on the CASIA B dataset. In this table, the authors of [34] obtained an average accuracy of 51.4% on the CASIA B dataset. e authors in [35] improved the average accuracy and reached to 84.2% that was later further improved by [36] of 87.5%. Recently, the authors of [37] obtained an average accuracy of 89.66% on the CASIA B dataset that is improved then the previous noted techniques. Our method achieved an accuracy of 91.20% on the CASIA B dataset that is improved    Finally, the improved moth-flame optimization algorithm is compared to several other nature-inspired algorithms ( Figure 8) such as the genetic algorithm, particle swarm optimization, bee colony optimization, ant colony optimization, whale optimization, crow search, and firefly algorithm. is graph shows that the proposed optimization algorithm outperforms the other compared algorithms in terms of accuracy. Moreover, the gait is important for several purposes such as assisting those suffering from Parkinson's disease [41,42]. In this work, we used Adam as an optimizer [18] during the training of deep learning models instead of stochastic gradient descent (SGD). For the gait recognition task, SGD is not performed better than Adam due to a high number of video frames. As we know, Adam is known to be computationally fast, requires less memory, and needs little tuning.

Conclusion
Human gait recognition using lightweight deep learning models and improved moth-flame optimization algorithm has been presented in this work. Two lightweight pretrained CNN models were fine-tuned and deep transfer learning based trained. Features are extracted from the global average pooling layer and fused using a new approach named DCCA. Furthermore, an optimization algorithm is developed for the selection of the best features. e proposed method was compared based on several classifiers such as ELM and SVM and found ELM is more suitable based on accuracy and time. Two publicly available datasets were employed for the validation process and achieved an improved average accuracy of 91.20 and 98.60%.
e key findings of this work are as follows: (i) freezing few middle layers can train a model with less time but it is a chance to sacrifice the better accuracy; (ii) fusion of lightweight models features using DCCA approach is time-consuming but at the end, better information in the form of features is obtained; and (iii) improved optimization algorithm provides the better accuracy and reduces the computational time. In the future, a new scratch-based CNN model will be developed for human gait recognition.

Conflicts of Interest
e authors declare that they have no conflicts of interest.   Computational Intelligence and Neuroscience 11