## 2 Computer Simulation for Speckle Fringe and Phase Map  
The schematic of the DHSPI system is shown in Figure 1, and the laser is divided into an object beam and a reference beam by a beam splitter. The object beam is driven by mirrors, and eventually illuminates the surface of the rough object. After the reference beam passes through a series of optical devices, the reference beam is combined with the object beam by a collimated beam combiner. The combined beam is recorded by a charge-coupled device (CCD) sensor. In the reference beam path, a mirror on a piezoelectric transducer is used for generating the optic path difference. Assume that the object beam \(U_{O}(u,v)\) and the reference beam \(U_{R}(u,v)\) are described by  
\[U_{O}(u,v)=a_{O}(u,v)\textit{exp}[i\varphi_{O}(u,v)], \tag{1}\]  
\[U_{R}(u,v)=a_{R}(u,v)\textit{exp}[i\varphi_{R}(u,v)], \tag{2}\]  
where \((u,v)\) are spatial coordinates, \(a_{O}(u,v)\) and \(a_{R}(u,v)\) are the corresponding amplitudes of beam, and \(\varphi_{O}(u,v)\) and \(\varphi_{R}(u,v)\) are the phase terms. Before the surface of the object is deformed, the resulting intensity \(I_{1}(u,v)\) of the speckle pattern on the detector can be written as  
\[I_{1}(u,v)=\big{|}U_{O}(u,v)+U_{R}(u,v)\big{|}^{2}, \tag{3}\]  
and we can further derive that  
\[I_{1}(u,v)=a^{2}{}_{O}(u,v)+a^{2}{}_{R}(u,v)+2\sqrt{a^{2}{}_{O}(u,v)a^{2}{}_{R }(u,v)}\cos[\phi_{1}(u,v)], \tag{4}\]  
where \(\phi_{1}(u,v)=\varphi_{O}(u,v)-\varphi_{R}(u,v)\). When the surface of the object is deformed, the resulting optical intensity \(I_{2}(u,v)\) on the detector is defined as  
\[I_{2}(u,v)=a^{2}{}_{O}(u,v)+a^{2}{}_{R}(u,v)+2\sqrt{a^{2}{}_{O}(u,v)a^{2}{}_{R }(u,v)}\cos[\phi_{2}(u,v)]. \tag{5}\]  
The phase difference between \(I_{1}(u,v)\) and \(I_{2}(u,v)\) can be expressed as  
\[\Delta\phi(u,v)=\phi_{1}(u,v)-\phi_{2}(u,v), \tag{6}\]  
and the subtraction operation between \(I_{1}(u,v)\) and \(I_{2}(u,v)\) can be expressed as a speckle fringe pattern,  
\[I_{d}(u,v)=\big{|}I_{1}(u,v)-I_{2}(u,v)\big{|}. \tag{7}\]  
The establishment of the database is necessary to train the model. In this work, the method of manipulating the spectrum of the light field by imitating the 4f system is used to generate a  
Figure 1: The schematic of the digital holographic speckle pattern interferometry (DHSPI) system redrawn from [13]: BS, beam splitter; OBS, object beam shutter; RBS, reference beam shutter; VA, variable attenuator; CVX, convex; L, lenses; M, mirrors; SL, surface lens; OW, optical window; PZT, piezoelectric transducer. speckle pattern, and a low-pass filter \(d(k_{1},k_{2})\) is simulated to be applied in object beams to imitate an aperture [32; 33]. An object beam can be written as  
\[U_{O}(u,v)=F^{-1}[d(k_{1},k_{2})\times F[a_{O}(u,v)exp[i\varphi_{O}(u,v)]]], \tag{8}\]  
where \(F\) represents the Fourier transform and \(F^{-1}\) represents the inverse Fourier transform. For simulation, the phase \(\varphi_{O}(u,v)\) as a random variable is uniformly distributed in \((-\pi,\pi]\), and the amplitude \(a_{O}(u,v)\) is set to a constant of 1. The undeformed intensity \(I_{1}(u,v)\) can be generated by Equation (3), where \(U_{R}(u,v)=1\) for simulation. After the object deformation, the phase term \(\varphi_{O}(u,v)\) of the object beam is changed into \(\varphi_{O}(u,v)+\Delta\varphi(u,v)\). Similarly, the deformed intensity \(I_{2}(u,v)\) can also be simulated by Equation (3). According to Equation (7), the speckle fringe pattern can be computed by the subtraction operation between \(I_{1}(u,v)\) and \(I_{2}(u,v)\). The speckle fringe pattern with the different speckle sizes can be generated by adjusting the aperture size \(d(k_{1},k_{2})\) according to Equation (8). An example with simulated data is shown in Figure 2, and the peaks function as the phase difference \(\Delta\varphi(u,v)\) is simulated. The speckle fringes (\(500\times 500\) pixels) with the different aperture sizes generate different speckle sizes, where the smaller selected aperture produces a larger speckle size.