# Rain Removal of Single Image Based on Directional Gradient Priors
## 3 Proposed Deraining Method
### Proposed Model
#### 3.2.3 Solution for the Proposed Model
The problem in (6) can be expressed as:  
\[\min_{b}||x-b||_{2}^{2}+\alpha\sum\limits_{i=1}^{M}||s_{i}||_{1}\quad s.t.\,s_ {i}=F_{B,i}b \tag{7}\]  
We then use the augmented Lagrangian function to solve problem (7) as follows:  
\[\text{L}_{1}(b,s_{i},L_{i})=||x-b||_{2}^{2}+\alpha\sum\limits_{i=1}||s_{i}||_{ 1}+\left\langle L_{i},s_{i}-F_{B,i}b\right\rangle+\frac{\mu_{k}}{2}||s_{i}-F_ {B,i}b||_{2}^{2} \tag{8}\]  
The solution to each variable is solved using ADMM, as shown below:  
\[\left\{ \begin{array}{l}b^{k+1}=\left(\frac{\mu_{k}}{2}\sum\limits_{i}F_{B,i} ^{T}F_{B,i}+I\right)^{-1}(x+\frac{\mu_{k}}{2}\sum\limits_{i}F_{B,i}^{T}s_{i} +\frac{1}{2}\sum\limits_{i}F_{B,i}L_{i});\\ s_{i}^{k+1}=S_{\frac{\lambda}{\mu_{k}}}(F_{B,i}b^{k+1}-\frac{1}{\mu_{k}}L_{i}); \\ L_{i}^{k+1}=L_{i}^{k}+\mu_{k}(s_{i}^{k+1}-F_{B,i}b^{k+1});\\ if\,\,\mu_{k}<\mu_{\max},\mu_{k+1}=\mu_{k}*\rho.\end{array} \right. \tag{9}\]  
where \(L_{i}\) is the Lagrange variable for \(s_{i}\), and \(\mu_{\max}\) and \(\rho\) are the parameters in the algorithm. We set \(\mu_{k}=1.0\) and \(\rho=1.05\) empirically, where \(S_{\frac{\lambda}{\mu_{k}}}(*)\) denotes a soft-thresholding operator with parameter \(\frac{\lambda}{\mu_{k}}\). The closed solution of (7) is efficiently solved by (9). \(r-\)Subproblem  
The solution to \(r\) requires the value of the intermediate variables \(F_{R,j}\) and \(m_{j}\). Therefore, we create \(F\) = [\(F_{R1}\), \(F_{R2}\),..., \(F_{RM}\)] and \(M=[m_{1},m_{2},\ldots,m_{M}]^{T}\) as two matrices. The optimization problem with respect to \(r\) is rewritten as follows:  
\[\underset{r}{\text{min}}||y-b-r||_{2}^{2}+\beta_{2}||\
abla_{x}(FM-r)||_{1}+ \beta_{3}\underset{j=1}{\text{min}}||M||_{1} \tag{10}\]  
For Equation (10), we first need to calculate the values of \(F\) and \(M\), setting \(A=\
abla_{x}(FM-r)\). The solution to Equation (10) can be obtained by using the Lagrange algorithm as follows:  
\[\text{L}_{2}(F,M,A,p_{1})=\beta_{2}||A||_{1}+\langle p_{1},A-\
abla_{x}(FM-r) \rangle+\frac{\gamma}{2}||A-\
abla_{x}(FM-r)||_{2}^{2}+\beta_{3}||M||_{1} \tag{11}\]  
We adopt the ADMM scheme and exploit the FFT to improve the computation efficiency. The solution to each variable is as follows:  
\[\left\{ \begin{array}{l}A^{k+1}=S_{\frac{\beta_{2}}{7}}(\
abla_{x}(FM-r)- \frac{1}{7}p_{1})\\ F^{k+1}=(\
abla_{x})^{-1}(\
abla_{x}r+A^{k}-\frac{1}{\lambda}p_{1}){(M^{-1})} ^{k}\\ p_{1}^{k+1}=p_{1}^{k}+\gamma(A^{k+1}-\
abla_{x}(FM-r))\end{array} \right. \tag{12}\]  
where \(r\) is a constant, and \(p_{1}\) is a Lagrange variable; thus, we need to optimize the convolutional sparsity coefficient \(M\) as follows:  
\[\underset{M}{\text{min}}\langle p_{1},A-\
abla_{x}(FM-r)\rangle+\frac{\gamma} {2}||A-\
abla_{x}(FM-r)||_{2}^{2}+\beta_{3}||M||_{1} \tag{13}\]  
The subproblems of \(M\) are solved using a lasso regression [38], and we set up the intermediate variables: \(Z=M^{k}-\frac{1}{c}[F^{T}\
abla_{x}^{T}(\
abla_{x}FM-\
abla_{x}r+A-\frac{p_ {1}}{\gamma})]\). The optimization problem of \(M\) is then transformed into the following:  
\[\underset{M}{\text{argmin}}\frac{c\gamma}{2}||M-Z||_{1}+\beta_{3}||M||_{1} \tag{14}\]  
where \(c\) is a constant, and the optimized \(M\) is obtained by the soft threshold algorithm as follows:  
\[M^{k+1}=S_{\frac{\beta_{3}}{c\gamma}}(Z) \tag{15}\]  
Finally, by fixing \(b\), \(m_{j}\), and \(F_{R,j}\), we solve the following sub-problem to obtain \(r\):  
\[\underset{r}{\text{min}}\Bigg{\{}||y-b-r||_{2}^{2}+\beta_{1}||\
abla_{y}r||_ {1}+\beta_{2}||\
abla_{x}(\underset{j=1}{\text{min}}F_{R,j}m_{j}-r)||_{1} \Bigg{\}} \tag{16}\]  
Here, we set \(z=y-b\) as a fixed value, and introduce a group of auxiliary variables \(u=\
abla_{x}(\underset{j=1}{\text{min}}F_{R,j}m_{j}-r),v=\
abla_{y}r\) to solve problem (16), and the augmented Lagrangian form of \(r\) can be written as follows:  
\[