# Fourier Ptychographic Reconstruction Method of Self-Training Physical Model
## 2 Principle of FPM
### Fourier Ptychographic Reconstruction Process  
The traditional FPM reconstruction algorithm updates the spectrum of the sample by alternating iterations in the spatial and frequency domains. Taking the most traditional G-S method as an example, the reconstruction process is based on the gradient descent algorithm to minimize the loss function. From the FPM imaging process in the previous section, we can obtain the complex amplitude corresponding to each LED array illumination Bash transmitted to the image plane, \(U_{rst}^{l}(x,y)\), and \(l\) = 1,2,...... N, N is the number of LED arrays. The reconstruction process is as follows: the loss function is constructed by combining the low-resolution light intensity image actually collected by the FPM system, and the loss function converges to the minimum value through iterative updates. The high-resolution complex amplitude reconstruction process of the whole sample is regarded as a nonlinear minimization problem based on the loss function. The traditional FPM technology often adopts an iterative update strategy based on the minimization of mean squared error (MSE). The expression of the loss function can be expressed as follows:  
\[Loss=\sum_{l}^{N_{LED}}\left|\left|U_{est}^{l}(x,y)\right|-\sqrt{l^{l}(x,y)} \right|\right|^{2}+\tau R(O(x_{0},y_{0})) \tag{7}\] \[=\sum_{l}^{N_{LED}}\left|\left|\left|\mathcal{F}^{-1}\right\{P(k _{x},k_{y})\,\widetilde{O}\big{(}k_{x}-\mu_{l},k_{y}-v_{l}\big{)}\}\right|- \sqrt{l^{l}(x,y)}\right|^{2}+\tau R(O(x_{0},y_{0}))\]  
Figure 3: Imaging diagram of bright field image and dark field image. (**a**) LED direct incidence lighting (**b**) LED small angle tilt lighting (**c**) LED large angle tilt lighting. Here, \(U_{est}^{l}(x,y)\) represents the low-resolution complex amplitude obtained under the illumination of the first LED array. \(l^{l}(x,y)\) represents the low-resolution light intensity image actually collected corresponding to the lth LED illumination; \(P(k_{x},k_{y})\) represents the pupil function of the system; \(O(x_{0}\,y_{0})\) represents the complex amplitude function representing the high resolution of the sample; \(\mathcal{F}^{-1}\)represents inverse Fourier transform; \(\widetilde{O}(k_{x}\,k_{y})\) represents the high-resolution spectrum; and \((\mu_{l},v_{l})\) represents the illumination wave vector represented by the lth LED array. Considering that the nonlinear effect of the model will lead to overfitting of the reconstruction results, a regular term \((\mu_{l},v_{l})\) is added to the reconstructed complex amplitude. \(\tau\) is the regularization weight. Taking the relatively simple first-order gradient descent algorithm and the lth LED array illumination as an example, using the nonlinear optimization method to solve the high-resolution complex amplitude in Equation (7), the first derivative of the high-resolution complex amplitude spectrum to be solved is conducted for Equation (7):  
\[G_{\widetilde{O}(k_{x},k_{y})}=P^{*}\big{(}k_{x},k_{y}\big{)}\cdot\mathcal{F} \left\{\frac{U_{est}^{l}(x,y)}{|U_{est}^{l}(x,y)|}\bigg{[}\left|U_{est}^{l}(x, y)\right|-\sqrt{l^{l}(x,y)}\right]\right\} \tag{8}\]  
By minimizing the loss function through the traditional gradient descent method, the formula for solving the sample spectrum of FPM imaging optimization is updated:  
\[=\widetilde{O}\big{(}k_{x}-\mu_{l},k_{y}-v_{l}\big{)}+\alpha\frac{P^{*}\big{(} k_{x},k_{y}\big{)}}{\left|\left|P\left(k_{x}-k_{y}\right)\right|\right|_{max}^{2}} \mathcal{F}\left\{\frac{U_{est}^{l}(x,y)}{|U_{est}^{l}(x,y)|}\sqrt{l^{l}(x,y) }-U_{est}^{l}(x,y)\right\} \tag{9}\]  
where \(\alpha\) is the step length of updating the sample spectrum, and \(\frac{U_{est}^{l}(x,y)}{|U_{est}^{l}(x,y)|}\sqrt{l^{l}(x,y)}\) is the replacement process of spatial information in Formula (9), that is, the estimated low-resolution complex amplitude is updated by using the actual collected light intensity image.