# Denoising of Wrapped Phase in Digital Speckle Shearography Based on Convolutional Neural Network
## 2 Theoretical Analysis and Proposed CNN Denoiser
### Proposed CNN Denoiser
#### 2.2.3 Dataset Generation and Network Training  
The establishment of the database is necessary to train the model. Combining Equations (1)-(6) for data simulation, the undeformed intensity \(I_{1}\) can be generated by Equation (3). The amplitude \(A\) is set as a random variable distributed within (0, 1], and the initial phase difference \(\Delta\varphi\) is set as a random variable uniformly distributed within (\(-\pi\), \(\pi\)). Similarly, after the object deformation, the deformed intensity \(I_{2}\) can also be simulated by Equation (4), where the phase \(\varphi\) of the object beam is changed into \(\Delta\varphi+\Delta\delta\)  
Figure 2: The architecture of the proposed network for image denoising.  
The deformation of \(I_{2}\) is controlled by expanding Equation (2) and varying it according to Equation (14).  
\[\begin{split}&\varphi_{2}(x,y)=\varphi_{1}(x,y)+\lambda\times(1+\cos(Q) \times Z,\\ & Z=3*(1-x)^{2}\times\exp\Bigl{(}-x^{2}\times(y+1)^{2}\Bigr{)}-\\ & 10\times\bigl{(}\tfrac{x}{5}-x^{3}-y^{5}\bigr{)}\times\exp\bigl{(} -x^{2}-y^{2}\bigr{)}-\tfrac{1}{3}\times\exp\Bigl{(}-(x+1)^{2}-y^{2}\Bigr{)} \end{split} \tag{14}\]  
where the laser wavelength \(\lambda\)= 632.8 nm, \(Q\) denotes the angle of light incidence relative to the object surface, and \(Z\) symbolizes a three-dimensional surface subject to deformation through adjustments in its value, thereby altering the object surface. By manipulating the value of \(Z\), such adjustments involve adding or removing various terms and modifying coefficients. Figure 3 illustrates the wrapped phase resulting from distinct deformations.  
In addition, assume that the incident laser is perpendicular to the object surface and the surface is sheared along the \(x\) direction. The relationship between the deformation phase, the derivative of the out-of-plane displacement along the \(x\) direction, and the phase-shift shear is shown in Equation (15).  
\[\Delta\delta=\frac{4\pi}{\lambda}\times\frac{\partial G(x,y)}{\partial x} \times\Delta S \tag{15}\]  
\[G(x,y)=600\times\frac{1}{2\pi\sigma^{2}}\exp\left(-\frac{\left(x-\varepsilon \right)^{2}+\left(y-\varepsilon\right)^{2}}{2\sigma^{2}}\right) \tag{16}\]  
where \(\partial G(x,y)/\partial x\) is the derivative of the out-of-plane displacement in the \(x\) direction by adjusting the Gaussian function with the different mean values (from 1 to 80) and standard deviations (from 1 to 80) shown in Equation (15) to simulate the pixel displacement. The wrapped phase produced by different shears \(\Delta S\) (from 20 to 60) is shown in Figure 4.  
FFDNET introduces different noise-level maps to make the denoising model adapt to different noise levels. In order to make the model adapt to different levels of speckle noise, this paper proposes a new wrapped-phase map generation method based on the character  
Figure 4: The wrapped phase produced by different shear amounts.  
Figure 3: The wrapped phase produced by different deformations.  
istics of speckle noise. A clean wrapped-phase diagram is obtained from Equations (1)-(9), and wrapped-phase maps with different noise levels are obtained from Equations (17)-(19).  
\[\Delta\delta(x,y)_{N}=\Delta\delta(x,y)\times I_{G}+I_{N} \tag{17}\]  
\[I_{G}(x;k,\theta)=\frac{x^{k-1}e^{-\frac{x}{\theta}}}{\Gamma(k)\theta^{k}} \tag{18}\]  
\[I_{N}(x;\sigma)=\frac{1}{\sigma\sqrt{2\pi}}\exp\left(-\frac{x^{2}}{2\sigma^{2 }}\right) \tag{19}\]  
where \(I_{G}\) is a random variable whose value conforms to gamma distribution. \(k\) denotes the shape parameter, with the default value of 1. \(\theta\) is the inverse scale parameter of the distribution. The larger the value, the lower the visibility of the wrapped-phase fringe. In this paper, \(\theta\) is used to adjust the noise level of the training image, \(\theta\) = 0.5 to 4. \(I_{N}\) is a random variable whose value obeys the Gaussian distribution and \(\sigma\) is the variance. The greater the value, the greater the noise, \(\sigma\) = 25 to 100.