# Improved Image Denoising Algorithm Based on Superpixel Clustering and Sparse Representation
## 3 Proposed SC-SR Algorithm
### Sparse Representation Model for Image Denoising  
It was addressed that similar patches shared the same dictionary elements in their sparse decomposition [5]. In other words, there was NSS in the sparse transform domain as well. The proposed algorithm takes advantage of that fact to achieve a better sparse representation and improve the performance of image denoising. In the previous subsection, we learned a PCA dictionary for each cluster. Given the dictionaries, the initial sparse coefficients \(\mathbf{\alpha}_{i}^{(\mathbf{0})}\) of all patches within each cluster are found by solving the minimization problem of Equation (7) in the condition of \(p=0\) It is known that \(\ell_{0}\) pseudo norm regularization term has usually better reconstruction performance than \(\ell_{1}\) pseudo norm regularization term [17]. Since \(\ell_{0}\) minimization problem is NP-hard, greedy approaches are employed to achieve an approximate solution. One of the most widely used greedy approach is the orthogonal matching pursuit (OMP) that successively selects the best atom of dictionary minimizing the representation error until a stopping criterion is satisfied. In our algorithm, we employed a modified version of OMP, referred to as generalized OMP (GOMP) [18], to obtain the initial sparse coefficients \(\mathbf{\alpha}_{i}^{(\mathbf{0})}\), which allowed the selection of multiple atoms per iteration. Simultaneous selection of multiple atoms reduced the number of iterations and achieved better sparse representation. After obtaining the initial sparse coefficients \(\mathbf{\alpha}_{i}^{(\mathbf{0})}\), we exploited the NSS prior in the sparse transform domain to produce a better estimate of the original image. To begin, we looked for the first \(L\) most similar patches to each patch across the region of similar superpixels. Each pixel in a patch was denoted as a column vector that is computed by Equation (9), and the patch with the size of \(b\times b\) was described as a matrix \(\mathbf{P}_{i}=\left[\mathbf{f}_{i_{1}}\mathbf{,}\mathbf{f}_{i_{2}}\cdots\mathbf{,}\mathbf{f}_{i_{p} _{2}}\right]\) The similarity between the two patches was measured by Equation (13) with their covariance matrixes. After obtaining the patches similar to each local patch, we computed the weighted average of initial sparse coefficients associated with the similar patches as \(\mathbf{\chi}_{i}\) Next, \(\mathbf{\chi}_{i}\) was exploited to constrain the sparse coefficient of the local patch to reduce the impact of noise on sparse representation and achieve a better solution. A better sparse representation coefficient for each patch \(\mathbf{y}_{i}\) can be found by:  
\[\mathbf{\hat{\alpha}}_{i}=\underset{\mathbf{\alpha}_{i}}{argmin}||\mathbf{y}_{i}-\mathbf{D} \mathbf{\alpha}_{i}||_{2}^{2}+\eta||\mathbf{\alpha}_{i}-\mathbf{\chi}_{i}||_{1}, \tag{18}\]  
\[\mathbf{\chi}_{i}=\sum_{j=1}^{L}w_{ij}\mathbf{\alpha}_{j}^{(0)}, \tag{19}\]  
where \(\mathbf{\chi}_{i}\) is the weighted average of sparse coefficients for the first \(L\) most similar patches to the patch \(\mathbf{y}_{i}\) and \(\eta\) is a regularization parameter making a balance between sparsity and reconstruction error.