# Salt and Pepper Noise Removal with Multi-Class Dictionary Learning and L0 Norm Regularizations
## 2 Methods
### Proposed Method
#### 2.2.2 FLCLP-Based Image Reconstruction with The L\({}_{0}\) Norm Regularizations  
Two L\({}_{1}\) norm terms are defined in Equation (2) for impulse noise removal, and they play different roles and can be replaced by two L\({}_{0}\) norms for a better reconstruction. The first term enforces the image sparsity, and the L\({}_{1}\) norm may lose weak signals in the reconstruction, thus, researchers tend to minimize the sparsity by the L\({}_{0}\) norm. This modification has been observed to improve the reconstruction [8; 15; 20; 21] including impulse denoise removal [18]. The second term maintains the data fidelity, and L\({}_{1}\) norm may reduce robustness to impulse noise [6; 29; 30], while using the L\({}_{0}\) norm has been observed to significantly improve rejecting the outliers and good edge preserving in the reconstruction [18]. Therefore, both the L\({}_{0}\) norm terms on the sparsity and data fidelity are adopted in this work.  
The FLCLP-based image reconstruction with the L\({}_{0}\) norm regularizations is proposed as follows:  
\[\min_{\mathbf{x}}\ \|\mathbf{\Phi}^{T}\mathbf{x}\|_{0}+\lambda\|\mathbf{W}(\mathbf{y}-\mathbf{x})\|_{0} \tag{10}\]  
where the \(\|\mathbf{\alpha}\|_{0}\) is the total number of nonzero entries in the \(\mathbf{\alpha}\). For simplicity, we name the proposed method as FDLCP-L\({}_{0}\) in the following descriptions. The two L\({}_{0}\) norms significantly boost the FDLCP-based impulse noise removal as shown in Figure 3.  
To better understand the model, we will illustrate L\({}_{0}\) norm regularizations from the Bayesian view.  
Given the observed noisy image \(\mathbf{y}\), the maximize posterior probability for the reconstructed image \(\mathbf{x}\) can be obtained by maximize posterior probability:  
\[\underset{\mathbf{x}}{max}\{\log p(\mathbf{y}|\mathbf{x})+\log p(\mathbf{x})\}. \tag{11}\]  
Since a given \(\mathbf{x}\) corresponds to the unique transform coefficients \(\mathbf{\Phi}^{\mathrm{T}}\mathbf{x}\), then \(p\big{(}\mathbf{y}|\mathbf{\Phi}^{\mathrm{T}}\mathbf{x}\big{)}=p(\mathbf{y}|\mathbf{x})\). By plugging in the salt and pepper noise model:  
\[\mathbf{y}_{j}=\left\{\begin{array}{l}0,\text{ with probability }\frac{q}{q}\\ 1,\text{ with probability }\frac{q}{2}\\ \mathbf{x}_{j},\text{ with probability }1-q\end{array}\right. \tag{12}\]  
where \(q\) is the probability that \(j\)th pixel is contaminated by noise, then the first term in Equation (11) is modified as [18]:  
\[p(\mathbf{y}|\mathbf{x})=e^{1-q}=1-\frac{\|\mathbf{y}-\mathbf{x}\|_{0}}{N} \tag{13}\]  
Therefore, ignoring the constant in Equation (13), maximizing the posterior probability of \(\mathbf{x}\) means minimizing \(\|\mathbf{y}-\mathbf{x}\|_{0}\), which is the same as our data consistency term in Equation (10) by setting W as the identity matrix.  
We then use a transform domain prior as \(p(\mathbf{x})=\frac{1}{v}e^{-g[\mathbf{\Phi}^{\mathrm{T}}\mathbf{x}]}\) where \(\mathbf{\alpha}=\Phi^{\mathrm{T}}\mathbf{x}\) and \(g\big{(}\mathbf{\alpha}_{j}\big{)}=\left\{\begin{array}{l}1-h,\text{ if }\mathbf{\alpha}_{j}=0\\ h,\text{ otherwise }\end{array}\right.\) and \(h\) is a probability of a coefficient being in nonzero value. Then, maximizing the log function of \(p(\mathbf{x})\) leads to minimizing \(\|\mathbf{\Phi}^{\mathrm{T}}\mathbf{x}\|_{0}\) which is the same as our sparsity constraint term.  
The above analysis implies that the L\({}_{0}\) norm in data consistency specifically works for impulse noise removal, and the L\({}_{0}\) norm that directly counts the number of non-zero coefficients in sparsity constraint evaluates the sparsity better the L\({}_{1}\) norm.