# Metaheuristics and Support Vector Data Description for Fault Detection in Industrial Processes
## 2 Theoretical Background
### Squirrel Search Algorithm SSA  
Recently, Ref. [39] proposed an innovative nature-inspired algorithm for optimization, the Squirrel Search Algorithm, which has been very efficient in solving unconstrained numerical optimization problems. The algorithm mimics the strategies of flying squirrels in searching for food sources and escaping predators. A summer and winter phases are considered since the motion dynamics are different depending on the season. This strategy allows it to escape from local minima, thus raising the likelihood of reaching the global optimum. The algorithm considers a certain number of flying squirrels in a forest. It is assumed that each squirrel is located on a tree. Each squirrel searches for food by gliding among trees looking for the best food source and there are three types of trees: normal tree (no food), oak tree (acorn nuts food source), and hickory tree (hickory nuts food source). It is supposed that there is a population of \(N\) flying squirrels in the forest, one at hickory tree, \(N_{fs}\) at acorn trees, and the rest (\(1\leq N_{fs}\leq N\)) at normal trees. Each squirrel is represented by a vector with \(D\) components corresponding to the dimension of the problem. Initially, the flying squirrels are in a random position to start the algorithm and the location of the squirrels can be represented by the following expression:  
\[FS_{i}=FS_{L}+rand(1,D)\times(FS_{U}-FS_{L})\]  
Since each row represents one squirrel, this matrix can be initialized in a random manner with a uniform distribution between \((0,1)\) with the lower and upper dimensions of each squirrel as \(FS_{U}\) and \(FS_{L}\), respectively. Considering the full matrix, then the fitness evaluation corresponding to the location for each squirrel gives a fitness vector with the value of the objective function. This vector is arranged in ascending order in order to identify the best value associated with the best food source (hickory tree \(F_{h}\)), another food source (acorn tree \(F_{a}\)), and the squirrels in normal trees \(F_{n}\), in such a manner that each squirrel can be identified. Considering the case when foraging squirrels do not run into a predator, flying squirrels then look for better food sources in the forest, which implies that \(F_{h}\) remains unchanged. The destination of \(F_{a}\) is \(F_{h}\) and the destination of \(F_{n}\) is random between \(F_{a}\) or \(F_{h}\). In the case when they find a predator, they are forced to seek and find shelter in a random location. Their behavior can be mathematically described as follows:  
Case 1. The flying squirrels in acorn trees move to hickory trees, according to the following equation:  
\[FS_{i}^{t+1}=\left\{ \begin{array}{ll}FS_{i}^{t}+d_{g}\times G_{c}\times(F_{ h}^{t}-FS_{i}^{t})&\text{ if }r\geq P_{dp}\\ \text{random location},&\text{otherwise}\end{array} \right.\]  
Case 2. Some of the flying squirrels on normal trees move to the acorn trees looking for better food and some that have already been fed move to hickory trees in order to store food. The new locations read:  
\[FS_{i}^{t+1}=\left\{ \begin{array}{ll}FS_{i}^{t}+d_{g}\times G_{c}\times(F_{ a}^{t}-FS_{i}^{t})&\text{ if }r\geq P_{dp}\\ \text{random location}&\text{otherwise}\end{array} \right.\]where \(r\in(0,1)\) is a random number, \(P_{dp}\) represents the predator appearance probability, \(t\) is the current iteration, \(G_{c}\) a constant, and \(d_{g}\) is the gliding distance. The detailed calculation of these parameters are introduced in [39]. The season changes that help the algorithm to escape from local optima are considered by calculating the season constant as follows:  
\[S_{c}^{t}=\sqrt{\sum_{k=1}^{D}(F_{ai,k}^{t}-F_{h,k}^{t})^{2}}\qquad i=1,2, \ldots,N_{fs}\]  
\[S_{\min}=\frac{10e^{-6}}{(365)^{t/(T/2.5)}}\]  
where \(T\) is the maximum number of iterations and \(c\) is the current iteration. Moreover, the condition is verified if \(S_{c}^{t}<S_{\min}\).