Structural Smoothing Low-Rank Matrix Restoration Based on Sparse Coding and Dual-Weighted Model

Group sparse coding (GSC) uses the non-local similarity of images as constraints, which can fully exploit the structure and group sparse features of images. However, it only imposes the sparsity on the group coefficients, which limits the effectiveness of reconstructing real images. Low-rank regularized group sparse coding (LR-GSC) reduces this gap by imposing low-rankness on the group sparse coefficients. However, due to the use of non-local similarity, the edges and details of the images are over-smoothed, resulting in the blocking artifact of the images. In this paper, we propose a low-rank matrix restoration model based on sparse coding and dual weighting. In addition, total variation (TV) regularization is integrated into the proposed model to maintain local structure smoothness and edge features. Finally, to solve the problem of the proposed optimization, an optimization method is developed based on the alternating direction method. Extensive experimental results show that the proposed SDWLR-GSC algorithm outperforms state-of-the-art algorithms for image restoration when the images have large and sparse noise, such as salt and pepper noise.


Introduction
Sparse representation theory [1][2][3] has always been a very interesting research field due to its good performance in the fields of computer vision and image processing. It can be well used to represent or extract the main features of images. Among existing works, the image denoising methods based on patch sparse coding [4] divide the image into each patch equally, and use the patch's structure to encode the image into a combination of dictionary and sparse coefficient. By constraining the L 0 norm of coding coefficients, the real coding can be approximately estimated on the noisy image, so as to remove the noise.
On this topic, the dictionary is very important for the performance of these methods and should be learned firstly. Thus, the popular technologies such as PCA [5], K-SVD [6], and S-KSVD [7] are used to train dictionaries, to achieve higher expressive ability. However, they are all large-scale and highly non-convex problems, which often have high computational complexity. On the other hand, patches are units of sparse representation. Each patch is usually considered independently in dictionary learning and sparse coding, which leads to its focus on the local structure of the image and essentially ignores the relationship between similar patches-that is, the non-local self similarity (NSS) of the image [8][9][10][11].
For these non-local image denoising approaches, they provide a new research theory and direction for image denoising. Group sparse coding (GSC) [12], which uses groups instead of a single patch as the basic unit of sparse coding, combines the advantages of local sparsity and NSS of images, and shows great potential in various image processing tasks [13,14]. Similar to the sparse representation based on patches, each image patch group can also be accurately fitted by the sparse linear combination of dictionary atoms. In order to make full use of the similarity between groups, Zha et al. proposed low-rank regulated group sparse coding (LR GSC) [15], which imposed a low-rank constraint on the sparse coefficients of each group. It is the first time that the low-rank property of group sparsity in GSC has been used to ensure that the dictionary domain coefficients are not only sparse but also low-rank. Although the above methods have achieved good results, they are mainly aimed at the removal of Gaussian white noise, and cannot be used to remove the outlier noise effectively. In addition, when the density of noise is large, the acquisition of similar patches will be affected since each image patch also contains these noisy pixels. Figure 1 shows the effect of the LR-GSC model on image restoration from Gaussian noise and outlier noise, respectively. It can be seen that the LR-GSC model is more suitable for removing Gaussian noise than outlier noise. Because of the two-dimensional structure of a matrix, it can effectively protect the original details and structure information of the images. It is also more robust to data with outliers-for example, salt and pepper noise. Wright et al. [16] proposed the problem of low-rank restoration, which decomposes the original data as the sum of the low-rank matrix and sparse noise matrix. Candes et al. [17] accurately removed large low-rank matrices containing noise samples through kernel norm minimization. Using this theory to denoise the image, the original image structure with low-rank characteristics is separated from the observed noisy image, which has good performance on the removal of impulse and outlier noise.
When the rank or sparsity exceeds the threshold limit, the convex approximation model will not be able to accurately estimate the low-rank solution and sparse solution. For this reason, Candes et al. [18] proposed a weighted L 1 norm method to allocate smaller weights to larger matrix elements, restrain the overshrinkage of the L 1 norm, and improve the accuracy of the sparse solution. Gu et al. [19] proposed the weighted nuclear norm minimization (WNNM) model and the WNNM-based RPCA model (WNNM-RPCA) [20]. The model uses the weighted nuclear norm to relax the rank function. Considering the importance of different rank components, they assign weights according to the size of singular values to control the penalization of different rank components, so as to retain more important rank components and improve the accuracy of low-rank solutions. Peng et al. [21] proposed a double-weighted model, which simultaneously weighted the sparse and lowrank terms in the RPCA model, and was combined with the reweighted method to allocate weights in the iterative algorithm. The model can improve the accuracy of the sparse solution and low-rank solution at the same time. Although the low-rank theory performs well in removing impulse or outlier noise, it is mainly based on local similarity-that is, only the overall low-rank structure is considered.
Therefore, in order to overcome the above shortcomings, we propose a smoothing dual-weighted low-rank group sparse coding (SDWLR-GSC) algorithm to remove impulse or outlier noise. The main contributions are as follows: (1) In addition to using the non-local self-similarity prior to the image, as with LR-GSC, to maintain the low rank of similar patch coefficients when constructing similar patches, we also impose a low-rank constraint on the reconstructed similar patches as a whole. We not only consider the low-rank property between similar patches, but also consider local structural smoothness. Based on this, we combine the model with the TV norm to further strengthen the local structural smoothness of the matrix. Figure 2 shows an example of image recovery from dense noise based on using and not using the TV norm. (2) Because the low rank of the coefficients of similar patches and the global low rank of the reconstruction matrix of similar patches are both considered in the objective function, the optimization problem becomes a challenging non-convex optimization problem. In order to solve this problem effectively, we develop a new numerical solution based on the inexact augmented Lagrange multiplier (IALM) and non-uniform singular value threshold (NSVT). The experimental results show that the proposed method can improve the quality of the restored image significantly.
The remainder of this paper is organized as follows. Section 2 reviews the related work on low-rank regularized group sparse coding (LR-GSC). Section 3 presents our proposed SDWLR-GSC model, and Section 4 shows the solution of our proposed method. The experimental results are presented in Section 5. Finally, Section 6 summarizes this paper.

Related Work
In this section, we will review the work related to our proposed method.

Low-Rank Regularized Group Sparse Coding
In GSC [13,14], the method is mainly divided into two steps: grouping similar patches, and then sparsely representing the grouped patches, which can be formulated as the following problem, where X i ∈ R b×m is a group composed of patches with similar structure, and D i is the dictionary learned from each group of X i . · F and · 1 denote the Frobenius norm and L 1 norm, respectively. Thus, the optimal A i is the sparse codes of X i with λ ≥ 0. Zha et al. [15] proposed LR-GSC, which combines the low-rank characteristics of group coefficients in GSC, to further utilize the similarity between groups; the dictionary domain coefficients of each group are constrained as not only sparse but also low-rank. Taking the sparsity penalty and low-rank penalty as dual regularizers, the following problem is obtained: where · 1 is applied for the sparsity penalty, and the nuclear norm · * is applied for the low-rank penalty. τ is a non-negative constant, and η is a balancing factor in making (2) more feasible. A low-rank approximation B i is jointly estimated for each group sparse matrix A i . Similar to GSC, the optimal sparse codes { A i } n i=1 are used to restore the latent image.

Dual-Weighted Low-Rank Matrix Recovery
The authors in [22] proved that the RPCA model can be transformed into solving the following convex optimization problem by minimizing the combined decomposition matrix of the L 1 norm and nuclear norm, i.e., min X,S X * + λ S 1 , where Y ∈ M m×n is the observed matrix. X * is the nuclear norm of matrix X, which is defined as the sum of matrix singular values, i.e., the i-th singular value of matrix X. S 1 is the L 1 norm of matrix S, which is defined as the sum of matrix absolute elements-that is, |s i,j |, s i,j represents the elements in matrix S. λ > 0 is the regularization parameter.
In the process of solving, the model can easily lead to overshrinkage, which affects the accuracy of the solution. In [21], the sparse term and low-rank term in the RPCA model are weighted at the same time, and a double-weighted model is proposed, i.e., min X,S X Ω, * + λ W S 1 , where

Formulation of the Proposed Method
Low-rank regularized group sparse coding (LR-GSC) [15] ensures that the dictionary domain coefficients of each group are not only sparse but also low-rank. However, when the density of outlier noise becomes higher, the method cannot recover the image well. In this section, inspired by the low-rank matrix restoration algorithm in [21,23], we propose a new group sparse coding model, called SDWLR-GSC, which introduces total variation (TV) regularization into low-rank group sparse coding to realize image structure smoothing. At the same time, the dual-weighted model is used to recover the clean image better from the large and sparse noise. Our new method can be formulated as follows: where Y i ∈ R b×m represents the matrix constructed by the batches of similar patches for each basic patch y i . Y i is calculated by multiplying D i and A i . D i and A i are the dictionary learned from each group Y i and the sparse representation of each group X i under a given dictionary, respectively.
The constraint B l,u states that pixel values are bounded-for example, [0, 255]. · TV denotes the TV norm. In [24], total variation is proposed as a penalty term to deal with image restoration. The advantage of TV regularization is that it can well restore the edge and eliminate the noise. Apparently, the proposed SDWLR-GSC, based on LR-GSC, exploits the sparsity and low-rankness of the dictionary domain coefficients of each group at the same time. For the image patches reconstructed by the given dictionary and the sparse coding, we further introduce the dual-weighted model to weight low-rank terms and sparse terms, and we add the TV norm to maintain the smoothing structure of images. Therefore, the proposed model can better separate the clean image from the sparse noise and achieve better reconstruction results. Figure 3 shows the flowchart of the proposed SDWLR-GSC by taking the simple image denoising as an example.  [15], we applied the dual-weighted model to the reconstructed similar patches, and introduced the TV norm to maintain the smoothness of the image structure. Finally, the optimal sparse codes are used to estimate the clean patch groups for constructing the restored image. (Firstly, the corrupted image is extracted from non-local similar patches through a block matching operator. Secondly, patches with similar structures are grouped to perform dictionary learning to obtain group coefficients. At the same time, the group coefficients remain sparse and low-rank concurrently.)

The Proposed Solution
In this section, to solve the proposed SDWLR-GSC problem, we will present our solution method based on the alternating direction method of multipliers, which separates the multi-variable optimal problem into several single-variable problems, so that these variables can be undated one by one in each iteration.
First, to address the problem more easily, we introduce an auxiliary variable as follows: where In this way, the augmented Lagrange function of (7) can be obtained as follows: Then, we use the iterative alternating direction method, which optimizes one variable and fixes the remaining optimization variables in an iterative way. In this way, the original complex multi-variable optimization problem can be simplified to a single-variable optimization problem, and its solution can be obtained analytically. In our problem, there are seven sub-problems, i.e., H i , X i , S i , A i , B i , Y 1 , Y 2 sub-problems. Next, we will give a detailed implementation for each of them.

X i Sub-Problem
Similar to the constrained convex problem represented by the image denoising problem using the TV norm in [23], if µ and β are given, γ can be obtained by β/µ. Then, the solution of problem (10) is given by: where (p, q), L, P are the matrix pairs, linear operator, and orthogonal projection operator, respectively. In addition, the bounds of the constraint are set to be [l, u] = [0, 255].

S i Sub-Problem
Similar to other variables, if we fix the variables (H i , X i , A i , B i , Y 1 , Y 2 ), the variable S i can be updated by the optimal solution of minimizing f (H i , This minimization problem (12) can be solved by non-uniform soft thresholding (NST) [25] as follows:

A i Sub-Problem
If we fix the variables ( , the A i sub-problem can be reduced to the following optimal problem. We use the principal component analysis (PCA) of each group to learn the grouping sub-dictionary D i [26]. Since the learned PCA dictionary is singular, Equation (14) is equivalent to the following problem.
where Y i D i G i , P i ηG i +ρB i η+ρ and v = ρηλ. Then, this minimization problem (15) can be solved by non-uniform soft thresholding (NST) [25] as follows:

B i Sub-Problem
The same as the above methods, if we want to find the updating formula of B i , the variables (H i , S i , X i , A i , Y 1 , Y 2 ) should also be fixed firstly, and then the solution of the variable B i can be obtained by minimizing f (H This minimization problem (17) can be solved by non-uniform singular value thresholding (NSVT) [23] as follows: 4.6. Y 1 and Y 2 Sub-Problems Finally, Y 1 and Y 2 are Lagrange multiplier matrices of the original optimization problem. They should be updated after other variables. If Y 1 is unknown and other variables are fixed, Y 1 can be updated as follows: If Y 2 is unknown and other variables are fixed, Y 2 can be updated as follows: In Algorithm 1, we summarize the complete algorithm of SDWLR-GSC for image restoration.

Algorithm 1 Smoothed and Dual-Weighted Low-Rank Group Sparse Coding (SDWLR-GSC).
Require: The degraded image y ∈ R m×n (assuming m ≥ n); Output: The final restored image X (K) ; 1: Initialization: Set parameters b, m, ρ, η, λ, τ and Max-Iter; 3: for k = 1 to Max-Iter do 4: Iterative regularization y (k) = x (k−1) + δ(y − y (k) ) 5: Divide y (k) into a set of overlapping patches with size b × b 6: for each patch y i in y (k) do 7: Find non-local similar patches to form a group Y i 8: Construct dictionary D i by Y i using PCA 9: Update A i by computing A i = D T i Y i 10:

Results
To verify the performance of the SDWLR-GSC algorithm in image restoration, we carried out a large number of experiments and compared its performance with the most novel methods based on the low-rank matrix. We also selected 16 classical images (Lena, Barbara, Couple, House, Monarch are from the Set12 dataset. Frame, Road, Bridge, Elaine, Pentagon, Lin are from Google Images. Flower is from the Kodak24 dataset. Monkey, Tank are from the USC-SIPI image dataset http://sipi.usc.edu/database/ (accessed on 28 March 2022)) with size 512 × 512 as the test dataset. The images used in all experiments are shown in Figure 4. This experiment mainly aimed at outlier noise with high density. Outlier noise includes two types: salt and pepper noise and random-valued sparse additive noise. Thus, we introduced two classes of numerical experiments. First, the test image was only destroyed by different levels of large and sparse additive noise. Second, the test image was only destroyed by different levels of salt and pepper noise. The peak signal to noise ratio (PSNR) [28] and structural similarity index metric (SSIM) [27] were used as quality evaluation indicators to evaluate performance. The larger the value of PSNR and SSIM, the better the image quality. All experiments were carried out on MATLAB R2020a running on Windows 10. The CPU was Intel Core i7-2600, the memory was 8 GB, and the frequency was 3.40 GHz.

Parameter Setting
The parameter settings involved in this algorithm are as follows. The size of the input matrix is m × n. In Algorithm 1, we set A Following the practice in [29] and our tests, we set the Lagrange multiplier matrices Y where M is the spectral norm of matrix M and M ∞ is the maximum absolute value of the entries in matrix M. In addition, the constants X i and S i in Algorithm 2 are set to 0.1, the same as in [21].
In addition, we set θ in (13), which controls the sensitivity of the model to coefficient errors to be 1.25/ max(m, n), and we set β in (11), which controls the sensitivity of the model to the TV norm to be 10 −8 / max(m, n). Finally, in Algorithm 2, γ can be computed by γ = η/β, and µ corresponds to parameter µ (t) in Algorithm 2, and we set δ = 0.1.
The above parameters can be set according to experience. However, in Algorithm 1, the size of patch b, the number of non-local similar patches m, balancing factors ρ and η in (15), regularization parameters λ in (15) and τ in (17), and other parameters are determined by parameter experiments.
In the parameter experiments of patch size b and patch number m, the value range of b is multiples of 2 from 8 to 64, the value range of m is 100∼180, and the sampling interval is 20. Figure 5 shows the influence of the values of b and m on the restoration results when the noise density p = 0.3. Therefore, according to the experiment, when the noise density is p = 0.3, we set the size of image blocks to 64 × 64 and look for 160 similar image patches. In addition, through experiments, when p = 0.2, p = 0.4, we set patch sizes to 60 × 60 and 70 × 70, and the number of non-local similar patches selected is 160 and 190. It can be seen that when the noise density increases, the size of the image patch also increases. When the noise density increases, the original similar patches may be different from each other, so expanding the size of similar patches and increasing the number of similar patches can improve the accuracy of the algorithm.
In addition, we analyze the parameter experiments of balancing factors ρ and η, and regularization parameters λ and τ. Figure 6 shows that when the noise density p = 0.3, the influence of the value of this parameter on the restoration result when other parameters are fixed is noticeable. We set ρ = 1, η = 0.1, λ = 0.02, τ = 0.5 when the noise density In Algorithm 1, the maximum number of iterations maxiter, and in Algorithm 2, the internal maximum number of iterations inneriter, are parameters related to the convergence of the algorithm. Because SDWLR-GSC is a non-convex model, it is difficult to prove the global convergence of the algorithm in theory. Therefore, this paper analyzes the influence of iteration times on the restoration results through experiments. Through experiments, maxiter = 2 and inneriter = 100 are selected to avoid unnecessary iterative calculation.

Large Sparse Additive Noise Removal
We first test the experimental results of the proposed SDWLR-GSC for removing large and sparse additive noise. We suppose that the ratio of damaged pixels to all pixels in the image is p, and the values of these noisy pixels are 255, and a noisy observation image is generated. In this test, we give the denoising results of three noise levels, namely p = 0.2, p = 0.3, and p = 0.4. There are several other parameters in the algorithm, which are set as follows. In Algorithm 1, the number of iterations k and the patch size are set according to the noise level. For higher noise levels, we choose larger patches and run more iterations. According to experiments, let the ratio of the number of damaged pixels to the number of all pixels be p, and set patch sizes to 60 × 60, 64 × 64, and 70 × 70 for p = 0.2, p = 0.3, and p = 0.4, respectively. At these noise levels, the number of non-local similar patches selected is 160, 160, and 190, respectively.
We compare the proposed SDWLR-GSC with the most advanced existing methods, including the PCP algorithm [30], reweighted L 1 algorithm [31], NSVT method [21], and SRLRMR algorithm [29]. We also compare it with the LR-GSC algorithm [15]. It can be seen from Table 1 that under all noise levels, compared with other competitive methods, the SDWLR-GSC proposed by us achieves higher peak signal-to-noise ratio results. It can be seen from Table 1 that under all noise levels, compared with other competitive methods, the SDWLR-GSC proposed by us achieves higher PSNR results. In addition, the LR-GSC is more suitable for removing Gaussian noise than large and sparse noise. When p = 0.4 noise probability, on average, the PSNR performance of this method is 13.11 dB higher than that of PCP, 7.87 dB higher than that of specific gravity reweighted L 1 , 11.97 dB higher than that of NSVT, and 5.09 dB higher than that of SRLRMR. Figure 7 shows the visual comparison results of an image (Lena) when the noise density is p = 0.2. It can be observed that the PCP, reweighted L 1 , and NSVT methods cannot completely restore the damaged image, while the SRLRMR method can better complete the image denoising task, but it is slightly lacking in structure and the edge is still blurred. In contrast, our proposed SDWLR-GSC method not only effectively eliminates noise, but also retains sharp edges and fine details.

Salt and Pepper Noise Removal
In this subsection, we apply the proposed SDWLR-GSC to remove salt and pepper noise-that is, we add the noise with a pixel value of 0 on the basis of the noise in the previous section, and then the ratio of damaged pixels' total number with pixel values of 0 and 255 to all pixels' number is p. Similarly, in this test, we still give three different noise levels of p = 0.2, p = 0.3, and p = 0.4. We compare this model with LR-GSC [15], PCP [30], the WNNM-RPCA model [20], the WSNM-RPCA model [32], WSNM-L 1 [33], and the DWLP model [34]. Table 2 quantitatively compares the denoising results of various methods under different salt and pepper noise probability p. It can be seen that when p = 0.2, p = 0.3, p = 0.4, the PSNR of our model is higher than that of LR-GSC, PCP, WNNM-RPCA, WSNM-L 1 , and DWLP. Moreover, Figure 8 shows the visual comparison results of an image (House) when the noise density is p = 0.3.
Through the experiments, we can draw several conclusions: firstly, the strong salt and pepper noise destroys the sparse prior and low-rank of the image, and the restoration performance of the PCP model is poor; secondly, the PSNR of our model is higher than the average level of other models, which shows that using the dual-weighted model in group sparse coding, processing low-rank components and sparse components at the same time, and introducing the TV norm to solve the problem of image structure smoothing can reconstruct the low-rank structure of images more accurately.

Conclusions
In this paper, we constructed a smooth dual-weighted low-rank group sparse coding model. It combined group sparse coding, the TV norm, and a dual-weighted model. We also proved the superior performance of the proposed method in image denoising. Experimental results show that this method is obviously superior to the original PCP optimization, reweighted L 1 norm minimization, and NSVT and SRLRMR algorithms in removing large and sparse additive noise, and it is obviously superior to the PCP optimization, WNNM-RPCA, WSNM-RPCA, WSNM-L 1 , and DWLP methods in removing salt and pepper noise.
Although our proposed method has good performance, there is still room for further improvement. In this paper, the algorithm solver is based on the alternating direction method, due to the matrix-matrix multiplications and matrix inversions, and singular value decomposition is required for each iteration, which has high computational complexity for large matrices. In addition, when the expectation matrix becomes complex-for example, it has a high internal rank structure or the deletion becomes dense-satisfactory performance may not be obtained. Therefore, the question of how to reduce the computational complexity while maintaining high performance will be our research direction in the future. In addition, other applications of the proposed method are another important issue for future work.