# Research on Rolling Bearing Fault Diagnosis Method Based on ECA-MRANet
## 2 Fault Feature Extraction of Rolling Bearings
### Feature Extraction Method for Rolling Bearings Based on SSA Optimization VMD
#### 2.2.2 Sparrow Search Algorithm  
The Sparrow Search Algorithm (SSA) [19] is a novel intelligent optimization algorithm first proposed in 2020 that draws inspiration from the observation and simulation of sparrow flocks' behavior while searching for food. Sparrows, being social birds, typically forage in groups, effectively locating food sources through communication and coordinated actions. Sparrows exhibit adaptability and flexibility in their search strategies, adjusting them based on the distribution of food and changes in the surrounding environment. The SSA aims to emulate this adaptability and flexibility to address various types of optimization problems. In the SSA algorithm, sparrows are randomly categorized into two roles, explorers and followers, based on their capabilities. Explorers are responsible for locating target food areas and sharing this information with followers. The roles of explorers and followerscan be exchanged, but their respective ratios remain constant. Throughout the foraging process, the sparrow population remains vigilant to the external environment. If a predator is detected, some individuals emit warning signals. Explorers then lead the entire group to search for alternative safe areas to continue foraging. In simulated experiments, a population composed of \(n\) sparrows is represented by the Equation (4):  
\[X= \begin{bmatrix}x_{1,1}&x_{1,2}&\cdots&x_{1,d}\\ x_{2,1}&x_{2,2}&\cdots&x_{2,d}\\ \vdots&\vdots&\vdots&\vdots\\ x_{n,1}&x_{n,2}&\cdots&x_{n,d}\end{bmatrix}  \tag{4}\]  
where \(n\) represents the number of sparrows in the population and \(d\) represents the dimensionality of the optimization problem. The fitness value of each sparrow is denoted by the Equation (5):  
\[F_{X}= \begin{bmatrix}f([x_{1,1}&x_{1,2}&\cdots&x_{1,d}])\\ f([x_{2,1}&x_{2,2}&\cdots&x_{2,d}])\\ &\vdots&\\ f([x_{n,1}&x_{n,2}&\cdots&x_{n,d}])\end{bmatrix}  \tag{5}\]  
where \(f\) represents the fitness function. In SSA, the fitness value of the explorers is directly related to their probability of finding food. During each iteration, the update of the explorers' positions is as follows:  
\[X^{t+1}_{i,j}= \begin{cases}X^{t}_{i,j}\cdot\exp(-\frac{i}{\pi\cdot iter_{\max} })&if&R_{2}<ST\\ X^{t}_{i,j}+Q\cdot L&if&R_{2}\geq ST\end{cases}  \tag{6}\]  
where \(X^{t}_{i,j}\) represents the position information of the i-th sparrow in the \(j\)-th dimension at the \(t\)-th iteration; \(\alpha\in(0,1]\); \(R_{2}\in(0,1]\) represents the warning value; \(ST\in[0.5,1]\) represents the safety threshold; \(Q\) is a random number following a normal distribution; and \(L\) is a \(d\)-dimensional vector where all elements are equal to 1. When \(R_{2}<ST\), the population is in a safe region without predators, allowing discoverers to conduct a broader search and guide the population to maximize the fitness function. However, if \(R_{2}\geq ST\), indicating a danger signal, all sparrows must swiftly evacuate the area. Explorers will lead the entire flock to search for another safe region to continue foraging. During the foraging process of the sparrow population, followers consistently monitor the position of the explorers to obtain superior food sources. The update of their positions is expressed as follows:  
\[X^{t+1}_{i,j}= \begin{cases}Q\cdot\exp(\frac{X_{worst}-X^{t}_{i,j}}{i^{2}})& if&i>n/2\\ X^{t+1}_{p}+\left|X^{t}_{i,j}-X^{t+1}_{p}\right|\cdot A^{+}\,\cdot L&otherwise \end{cases}  \tag{7}\]  
where \(X^{t+1}_{p}\) represents the current optimal position in the population and \(X_{worst}\) represents the current worst position in the population. \(A\) is a \(d\)-dimensional vector with randomly assigned elements of 1 or \(-1\) and \(A^{+}=A^{T}(AA^{T})^{-1}\). When \(i>n/2\), this indicates that the fitness value of the \(i\)-th follower is relatively low, suggesting hunger and the follower needs to search for a new location to forage. In simulated experiments, the sparrows responsible for vigilance constitute a fraction of the total population.