# Robust Facial Expression Recognition Using an Evolutionary Algorithm with a Deep Learning Model
## 3 The Proposed Model
### Facial Expression Classification  
To carry out the FER method, the LSTM model was utilized in this study. LSTM is a kind of network structure that is intended to resolve the RNN problem of an unstable gradient that limits its use for modeling temporal dependency and long-term activity sequences with those data gained from a sensor [46; 47; 48]. Thereby, the LSTM architecture could learn long-term dependency that is impossible via RNN. The building block of LSTM is the cell state. With the grouping of memory cells, the LSTM controls the input data flow. It can be obtained by the gate structure that could optionally permit data to be entered. The LSTM comprises three gates for controlling the values of the cell state. Figure 2 depicts the infrastructure of LSTM. The initial gate of LSTM determines which data should be clear from the cell position. The outcome can be performed using a sigmoid layer named the \"forget gate\". The output of these gates is demonstrated in Equation (12), where \(u_{t}\) indicates the input vector at time \(t\) (existing input); \(h_{t-1}\) represents the history or memory value from the preceding time step; \(w_{(u_{t})}\) and \(w_{(h_{t})}\) indicates the weight matrices, correspondingly, associated with the \(u\) and \(h\) values; and \(b\) denotes the bias vector that determines the transformation of the specific gate [49]. This gate output 0 or 1 value for all the numbers in the cell state \(c_{t-1}\) concerning \(h_{t-1}\) and \(u_{t}\). The value of 0 signifies \"completely forgetting these states\", whereas the value of 1 signifies completely keeping these states. \[f_{t}=\sigma_{f}\Big{(}w_{uf^{u_{t}+w_{t}}f^{h_{t-1}}}+b_{f}\Big{)} \tag{12}\]  
The next gate is intended to decide which novel information needs to be stored in all the cell states. The procedure has two phases. Initially, there exists a sigmoid layer named the input gate to determine what value needs to be upgraded. Next, it generates a vector named \(g_{t}\) that is added to the cell state with the help of a hyperbolic tangent layer as follows:  
\[i_{t}=\sigma_{i}(w_{ui}u_{t}+w_{hi}b_{t-1}+b_{i}) \tag{13}\]  
\[g_{t}=\ \tanh\Big{(}w_{ug}u_{t}+w_{hg}b_{t-1}+b_{c}\Big{)} \tag{14}\]  
Figure 2: Architecture of LSTM. Then, the oldest cell state \(C_{t-1}\) is enhanced by the new cell state, \(g_{t}\). \[c_{t}=f_{t}\cdot c_{t-1}+i_{t}\cdot g_{t} \tag{15}\]  
\[o_{t}=\sigma(w_{uo}u_{t}+w_{ho}b_{t-1}+b_{o}) \tag{16}\]  
Consequently, the value of output variable \(b_{t}\) (novel history) is upgraded in all the steps based on the value of cell state \(0_{t}\) and the output value \(0_{t}\):  
\[b_{t}=0_{t}\cdot\ \tan\h\ (c_{t}) \tag{17}\]  
To enhance the efficacy of the LSTM model, the TLBO algorithm is exploited for the hyperparameter tuning process. TLBO technique is a novel metaheuristic algorithm that enhances the knowledge level by simulating \"teaching\" and \"learning\" from people's learning procedures [50; 51; 52]. TLBO is the feature of some parameters and performs well. TLBO is well implemented in mechanical-design-optimized, heat-exchanger-optimized, thermoelectric-cooler-optimized applications. For facilitating understanding, the subsequent are any basic explanations of the TLBO technique:  
**Definition 1:**_Search space for individual (solution vector) \(X=(x_{1},\ x_{2}\,\ldots,\ x_{D})\) named learners; \(x_{i}\ (i=l,2\ldots\,\ D)\) is the \(i\) course for students._  
**Definition 2:**_The group of students is termed a class._  
**Definition 3:**_Students with the maximum level (fitness) \(X^{best}=(x_{1^{\text{best}}},\ x_{2^{\text{best}}},\ldots,\ x_{D^{\text{best}}})\) are termed \(X^{teacher}\). In the TLBO technique, the class is equivalent to the population from GA, a student is equivalent to an individual, and the teacher is an individual with the maximum adaptive value. The task of teachers is to teach hard and promote the average level of students in the class. The students enhance their skills by learning from teachers and interconnecting with classmates.