# Study on Gearbox Fault Warning Based on the Improved M-IALO-GRU Model
## 3 Method, Principle, and Improvement
### Optimization of the GRU Model Based on the Modified Ant Lion Optimization  
#### 3.2.1 Ant Lion Optimization Algorithm (ALO)  
As a variant of the RNN neural network, a GRU (gated cycle unit) can solve the problem of gradient explosion and long-term dependence and can significantly improve the prediction accuracy for the long sequence data. Reasonable setting of the GRU hyperparameters has a great influence on the predictive ability of the model, and choosing appropriate hyperparameters can effectively accelerate the convergence process. The initial learning rate, the number of hidden-layer neurons, the hidden-layer dimension, and the batch size determine the learning ability, training complexity, and training effect of the model. Therefore, in this paper, the improved ant lion optimization algorithm (IALO) is used to optimize the four hyperparameters of the GRU iteratively, so as to achieve the prediction effect of the model.  
The ant lion optimization algorithm is an optimization algorithm based on simulating the behavior of ant lion hunting ants in nature. Ant lions live in the desert and catch ants by digging sand pits, an algorithm proposed in 2015 by [PERSON] [33]. The algorithm mimics the ant lion predation process and uses the interaction between ants and lions for global optimization. In the algorithm, ants represent the solution in the search space, which adjusts the position to avoid the capture of the ant lion, while the ant lion acts as the global searcher, simulating the way the ant lion catches ants. Ant movement updates are both influenced by local attraction and guided by ant lion capture mechanisms, ultimately enabling optimized search.  
The ant's update formula is usually expressed as follows:  
\[x_{i}^{\sim\text{new}}=x_{i}^{\sim\text{current}}+\beta\cdot\left(x_{i}^{\sim }\text{est}-x_{i}^{\sim\text{current}}\right)+\alpha\cdot\left(L-x_{i}^{\sim \text{current}}\right) \tag{8}\]  
where \(x_{i}^{\sim\text{new}}\) represents the new position of ants, \(x_{i}^{\sim\text{current}}\) represents the current position, \(x_{i}^{\sim\text{'}}\)est represents the global optimal solution, \(L\) represents the best position of the ant lion  
Figure 4: The GRU memory unit network structure.  
(i.e., bunker), and \(\alpha\) and \(\beta\) represent the weight parameters controlling the local and global search, respectively.  
Update the formula for the ant lion:  
\[\mathrm{L_{i}^{\rightarrow\mathrm{new}}=L_{i}^{\rightarrow\mathrm{current}}+ \gamma\cdot\left(x_{i}^{\rightarrow\mathrm{best}}-L_{i}^{\rightarrow\mathrm{ current}}\right)} \tag{9}\]  
where \(L_{i}^{\rightarrow\mathrm{new}}\) and \(L_{i}^{\rightarrow\mathrm{current}}\) represent the old and new locations of ant lions, \(x_{i}^{\rightarrow\mathrm{best}}\) represents the best position for all ants, and \(\gamma\) represents the weight of their position updates.  
Although the ant lion optimization algorithm performs well in many application scenarios, there are also some shortcomings and limitations. The ant lion optimization algorithm easily falls into the local optimal solution, and there are a series of problems with slow convergence speed and low search accuracy in the later stage, especially in the complex high-dimensional optimization problems. Although the algorithm has some exploratory power by simulating the interaction between ants and ant lions, it may still converge prematurely to some local optimal solution and fail to find a global optimal solution. At the same time, because the iteration process depends on the alternating behavior between the ant and the ant lion, the update process is relatively slow. Therefore, in the traditional ALO algorithm [34], the Latin hypercube sampling (LHS) algorithm is introduced and the Levy flight algorithm optimizes the ant lion and avoids the local search trap, forming an improved ant lion optimization algorithm.