## 2 Methodology
### Principle of the SSA Algorithm  
SSA is a novel swarm intelligence algorithm [27]. In SSA, a group of sparrows imitates the foraging behavior of real sparrows. Some sparrows serve as scouts, scouting foraging areas and providing directions to the entire group, while the remaining sparrows act as followers, relying on the scouts to find food. Sparrows only have positional attributes, and during foraging, the roles of scout and follower can interchange, but the total number and proportions of sparrows in each role remain constant. Sparrows on the periphery of the group emit alarms when they detect danger, prompting the entire group to move to a safer area if the alarm value exceeds a certain threshold. When optimizing with SSA, the positional update of the scouts during iterations can be expressed as follows:  
\[X_{i,j}^{K+1}=\begin{cases}X_{i,j}^{K}\cdot\exp(-\frac{i}{aK_{max}})&(R_{2}<ST )\\ X_{i,j}^{K}+QL&(R_{2}\geqslant ST)\end{cases} \tag{10}\]  
where \(X_{i,j}^{K}\) and \(X_{i,j}^{K+1}\) are the jth dimensional position information of the ith sparrow at iteration number \(K\) and \(K+1\), respectively; a is a random number within 0-1; \(K_{\max}\) is the maximum iterations; \(Q\) is a random number obeying a normal distribution; \(L\) is a matrix of type 1\(\times\)d with all elements of 1 (d is the dimension of feature); \(R_{2}\) is the alarm value, \(R_{2}\in[0,1]\); and \(ST\) is the safe value, \(ST\in[0.5,1]\).  
When \(R_{2}<ST\), there are no predators in the foraging environment, and the discovers can conduct forage extensively; the sparrow position will be updated based on the current solution \(X_{ij}^{K}\) in an exponential decay manner, which reduces the value of the solution by multiplying \(X_{i,j}^{K}\) by \(\exp\left(-\frac{i}{aK_{max}}\right)\). When \(R_{2}\geq ST\), certain sparrows detect predators and sound an alarm, prompting the sparrow group to migrate to a safe area.  
The sparrow positions will then be updated based on the current solution \(X_{i,j}^{K}\) and \(Q\). The expression for the position of the follower flying to the center when \(R_{2}\geq ST\) is as follows:  
\[X_{i,j}^{K+1}=\begin{cases}Q\cdot\exp(\frac{X_{\text{w}}-X_{i,j}^{K}}{t^{2}})&( i>\frac{n}{2})\\ X_{\text{P}}^{K+1}+\mid X_{i,j}^{K}-X_{\text{P}}^{K+1}\mid\text{A}^{+}\text{L}&( i\leq\frac{n}{2})\end{cases} \tag{11}\]  
where \(X_{\text{w}}\) is the worst position; \(X_{p}^{K+1}\) is the current optimal position of the discover; A is a matrix of type \(1\times\text{d}\) with elements randomly assigned to \(1\) or \(-1\) and satisfying the relation \(A^{+}=A^{\text{T}}\big{(}AA^{\text{T}}\big{)}^{-1}\); and n is the number of followers.  
When \(i>\frac{n}{2}\), if the \(i\)th follower is less adapted and unable to forage, the sparrow group needs to fly elsewhere to obtain food. During the course of group activity, once the danger is perceived by a marginal sparrow, the anti-predator behavior is initiated as follows:  
\[X_{i,j}^{K+1}=\begin{cases}X_{b}^{K}+\beta\mid X_{i,j}^{K}-X_{b}^{K}\mid&(f_{i }>f_{\text{g}})\\ [2 ex]X_{i,j}^{K}+\alpha[\frac{|X_{i}^{K}-X_{b}^{K}|}{(f_{i}-f_{w})+\varepsilon }]&(f_{i}=f_{\text{g}})\end{cases} \tag{12}\]  
where \(X_{b}^{K}\) is the global optimal position; \(\alpha\) and \(\beta\) are the control step parameters; \(\varepsilon\) is a constant to avoid a denominator of \(0\); \(f_{i}\) is the adaptation of the ith follower; \(f_{g}\) is the optimal adaptation; and \(f_{w}\) is the worst adaptation.