## 2 Materials and Methods
### Image Denoising Based on Group Sparse Representation
#### 2.3.2 Adaptive Nonlocal Similar Block Searching  
The nonlocal self-similarity (NSS) prior refers to the fact that each given local patch in a natural image can find many similar patches across the whole image. These patches compose the low-rank matrix which has a sparse solution. The noise in the infrared image is relatively complex, with a certain sparsity feature. Among the common denoising algorithms, the main method to find the data block with a similar structure is the K-nearest neighbor (KNN) algorithm [34]. The similar blocks of a group can be obtained based on the Euclidean distance. Traditional methods are used to look for similar groups in the iteration process with a noisy image. Additionally, they use the KNN cluster or K-means cluster methods to attain all groups. The matrix is not sparse enough. The observation samples contain high-intensity noise, and the similar blocks obtained from the original observation data are not necessarily high in regard to real similarity. The adaptive patch searching method used in the WNNM model is based on the KNN cluster algorithm. To achieve the optimal solution, we must construct sparse groups in each iteration. Compared with the universal cluster methods, adaptive patch searching based on KNN has some advantages. The differences are displayed in Table 1.  
The adaptive KNN in WNNM is to attain more similar patches for the low-rank matrix, which achieves a higher PSNR and SSIM for denoising images. PSNR with adaptive KNN in WNNM is about 0.1 dB\(\sim\)0.3 dB higher than others with different noisy images. SSIM with adaptive KNN in WNNM is about 0.01\(\sim\)0.06 higher than others with different noisy images.  
The original observation data can be pre-filtered by definition in [10].  
\[f(y)=Y*filter_{BM3D} \tag{14}\]  
\(f(y)\) is the pre-filtered image through the BM3D pre-filter method. The method is maturely applied in denoising for a long time. It could suppress noise and achieve better restoration of image details. Then, the criterion of similar patch selection depends on the rule in [35].  
\[\tau=SSIM(f(y),\widetilde{X^{i}})-SSIM(f(y),\widehat{X}^{t-1}) \tag{15}\]  
\(SSIM\) is the definition of structural similarity between two variables. \(f\) is a small parameter through concrete tests. When \(\tau<f\), the pre-filtered image is used to obtain similar blocks in all groups. Otherwise, we select the last iteration result as the input of similar patches. They constitute many similar groups that could use the WNNM model for optimization. In a high-noise environment, this method can achieve a better denoising  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Method** & **Class** & **Advantages** & **Disadvantages** \\ \hline \multirow{4}{*}{KNN} & unsupervised & high precision, & \\  & machine learning & insensitive to outlier, & \\  & method & no input data & \\  & & assumption & \\ \hline \multirow{4}{*}{Adaptive KNN} & unsupervised & high precision, & \\  & unsupervised & suitable for high noise & \\  & machine learning & environment, more & \\  & method & similar structure, high & \\  & & PSNR and SSIM & \\ \hline \hline \end{tabular}
\end{table}
Table 1: Comparison between different patch searching methods in WNNMeffect. The fusion of the WNNM model with the adaptive patch searching process is described in the following items:  
* Use the pre-filter to achieve the image with less noise;
* Perform iterative calculations with the WNNM model;
* According to the adaptive selection rule of similar patches, obtain all groups of an image from the iteration result or the pre-filter image;
* Finish the optimization based on the KNN cluster.