# Single-Lens Imaging Spectral Restoration Method Based on Gradient Prior Information Optimization
## 3 Methods
\begin{cases}D_{x}^{\prime}=D_{x}+\frac{D_{x}}{D_{x}+D_{y,avg}}\\ D_{y}^{\prime}=D_{y}+\frac{D_{y}}{D_{y}+D_{y,avg}}\\ D_{z}^{\prime}=D_{z}+\frac{D_{z}}{D_{z}+D_{z,avg}}\end{cases}  \tag{17}\]  
\[D_{x,avg}=\left(\sum\limits_{i=1}^{M}D_{x_{i}}\right)/M \tag{18}\] \[D_{y,avg}=\left(\sum\limits_{i=1}^{N}D_{x_{i}}\right)/N\] \[D_{z,avg}=\left(\sum\limits_{k=1}^{S}D_{x_{k}}\right)/S\]  
where \(D_{z}\) represents the gradient operator for the spectral dimension. \(D_{x,avg}\), \(D_{y,avg}\), and \(D_{z,avg}\) represent the average gradients for the spatial and spectral dimensions. \(M\) and \(N\) denote the spatial size of an image, while \(S\) represents the number of spectral bands. By pre-processing and enhancing constraints on the gradient information, the model becomes more closely aligned with the original image's gradient information. The resulting restoration model is as follows:  
\[\|f\|=\sum\limits_{i}\left(\sum\limits_{k}\sqrt{\left(D_{x}^{\prime}f\right)_{ i,k}^{2}+\left(D_{y}^{\prime}f\right)_{j,k}^{2}+\left(D_{z}^{\prime}f\right)_{ j,k}^{2}}\right) \tag{19}\]  
Based on the above, the spectral restoration model can be finally represented as:  
\[\underset{f}{\operatorname{min}}\frac{1}{2}\|Hf-G\|_{2}^{2}+a\|P_{i}f\|_{2} \tag{20}\]According to the aforementioned alternating direction method of multipliers (ADMM) for solving the problem, the model has non-differentiability. Therefore, the solution is decomposed into multiple sub-problems by introducing intermediate variables \(w_{i}=P_{i}f\), \(i=1,2\ldots n^{2}\), Therefore, the problem is transformed into:  
\[ \begin{array}{l}\underset{f}{\min}\frac{1}{2}\|Hf-G\|_{2}^{2}+a\underset{i}{ \sum}\|w_{i}\|_{2}\\ s.t.w_{i}=P_{i}f,i=1,2\ldots n^{2}\end{array}  \tag{21}\]  
The construction of the augmented Lagrangian function \(L(f,w_{i},\mu_{i})\) for the above function is as follows:  
\[L(f,w_{i},\mu_{i})=\frac{1}{2}\|Hf-G\|_{2}^{2}+\sum_{i}\biggl{(}\|w_{i}\|_{2}- \mu_{i}^{T}(w_{i}-P_{i}f)+\frac{\beta}{2}\|w_{i}-P_{i}f\|_{2}^{2}\biggr{)} \tag{22}\]  
Scaling parameter \(\mu\), we obtain:  
\[L(f,w_{i},b_{i})=\frac{1}{2}\|Hf-G\|_{2}^{2}+\sum_{i}\biggl{(}\|w_{i}\|_{2}+ \frac{\beta}{2}\|w_{i}-P_{i}f-b_{i}\|_{2}^{2}\biggr{)} \tag{23}\]  
In the above equation, \(b_{i}=\mu_{i}/\beta\) represents the Lagrange multiplier. For each iteration, only one variable is optimized while fixing all other variables, and the iterative process alternates to update each variable to be solved. To verify the feasibility of the proposed algorithm in this study, the image restoration quality was evaluated using root-mean-square error (RMSE), peak signal-to-noise ratio (PSNR), and the structural similarity index (SSIM) [32]. Let \(y\) be the restored image and \(y\prime\) be the original image, both with size \(M\times N\). RMSE is used to calculate the deviation between the restored image and the original image by first computing the mean squared error (MSE) and then taking its square root. A lower RMSE indicates a better restoration result. The formula for calculating RMSE is as follows:  
\[ \begin{array}{l}\text{MSE}=\frac{1}{M\times N}\underset{n=1}{\sum}\underset {m=1}{\sum}\underset{m=1}{\sum}(y_{mn}-y_{mn}^{\prime})^{2}\\ \text{RMSE}=\sqrt{\text{MSE}}\end{array}  \tag{24}\]  
PSNR is an objective criterion for evaluating images, where a higher value indicates a better restoration result. The formula for calculating PSNR is:  
\[\text{PSNR}=10\log_{10}\Bigl{[}(2^{n}-1)^{2}/\text{MSE}\Bigr{]} \tag{25}\]  
SSIM utilizes the structural relationship of images to evaluate their similarity at a deeper level. In practical applications, it applies to the mean and variance information of an image matrix, using the mean to describe luminance information and the variance to describe contrast information. Finally, it uses covariance between the matrices to represent the similarity.