# Gray Image Denoising Based on Array Stochastic Resonance and Improved Whale Optimization Algorithm
## 3 Improved Whale Optimization Algorithm
### Improve Whale Optimization Algorithm
#### 3.2.2 Nonlinear Convergence Factor and Variable Weight  
In the traditional whale optimization algorithm, the convergence factor decreases linearly from 2 to 0 as the number of evolutionary iterations increases, but WOA algorithm changes nonlinearly in the evolutionary search process. The linear decrease strategy of the convergence factor cannot fully reflect the actual optimization search process of the algorithm. To solve this problem, this paper proposes a nonlinear change strategy of convergence factor \(v^{\prime}\) with the number of evolution iterations, namely  
\[\left\{\begin{array}{l}v^{\prime}=1+\cos(\pi\times\frac{t}{T}),\ t\leq 0.5T \\ v^{\prime}=\cos(\pi\times\frac{t-0.5T}{T}),\ t>0.5T\end{array}\right. \tag{7}\]  
The value of nonlinear time-varying factor \(v^{\prime}\) changes dynamically with the number of iterations. The initial \(v^{\prime}\) value of the algorithm is large, which increases the step size of the global optimization stage of the algorithm, effectively expands the scope of the algorithm for global search, and enhances the global performance of the algorithm. In the middle of the algorithm, local development is carried out after the suspected target is determined. At this time, the larger \(v^{\prime}\) value enables the algorithm to have a larger step size, effectively enhancing the ability of the algorithm to jump out of the local extreme value, and avoiding the algorithm from falling into local optimization. In the later stage of the algorithm, when approaching the optimal solution, the convergence speed of the \(v^{\prime}\) value becomes slower, making the algorithm have a smaller step size, which is conducive to a local fine search and stable optimization, effectively improving the convergence speed of the algorithm. Therefore, the nonlinear time-varying factor \(v^{\prime}\) can more reasonably balance the global exploration in the early stage and the local exploitation in the middle and late stage of the algorithm without changing the segmentation point of the global exploration and local exploitation.  
Because in the traditional whale optimization algorithm, the position of new individuals generated in each iteration only depends on the current target individual position and the global optimal individual position. Therefore, it is easy to cause the algorithm to fall into local optimum. This paper designs a variable weight strategy for this purpose, namely  
\[w(t)=\frac{2}{\pi}\times\tan(\frac{t}{T}) \tag{8}\]  
The improved location update formula is as follows  
\[\overset{\rightarrow}{X}(t+1)=X_{rand}^{\rightarrow}\times w-\overset{ \rightarrow}{A}\cdot\overset{\rightarrow}{E}_{rand},p<0.5,|A|>1 \tag{9}\]  
\[\overset{\rightarrow}{X}(t+1)=\overset{\rightarrow}{X}^{*}(t)\times w- \overset{\rightarrow}{A}\cdot\overset{\rightarrow}{E},p<0.5,|A|\leq 1 \tag{10}\]  
\[\overset{\rightarrow}{X}(t+1)=\overset{\rightarrow}{E}(t)e^{ml}\cos(2\pi l)+ \overset{\rightarrow*}{X}(t)\times(1-w),p\geq 0.5 \tag{11}\]  
With the increase of the number of iterations, the weights in the variable weight strategy increase nonlinearly. Since the target of individual whale is fuzzy at the initial stage of search, a smaller weight is used to perturb the current optimal solution position.  
In the middle and late stages of the iteration, the target of the whale is gradually clear. At this time, the current optimal position is disturbed with a large weight to achieve the goal of fine search and rapid convergence in the optimal solution field.