# Fourier Ptychographic Reconstruction Method of Self-Training Physical Model
## 4 Experimental Results and Analysis
### The Selection of Network Hyperparameters under Noise Data  
In the field of deep learning, how to find the parameters that make the loss function value as small as possible is the main problem. The process of problem solving is called optimization. Unfortunately, this problem is difficult to solve, because the parameter space is very complex and the minimum value cannot be obtained by mathematical formula, and in the deep neural network, the size of parameters is very huge, resulting in the optimization problem being more complex. It is worth noting that the objectives of optimization and deep learning are different. The objective function of the optimization algorithm is usually a loss function based on the training data set. Its goal is to reduce the training error, and the purpose of deep learning is to reduce the generalization error. Figure 9: The construction process of real data set. So far, there are many ways to find the optimal parameters. For example, the stochastic gradient descent (SGD) method uses the gradient of the parameters, updates the parameters along the gradient direction, and repeats this step to gradually approach the optimal parameters. Small-batch stochastic gradient descent uses a small batch of randomly uniformly sampled samples to calculate the gradient. Usually, the time consumption of the small-batch stochastic gradient in each iteration period is between that of gradient descent and stochastic gradient descent. The momentum method uses the idea of the average exponentially weighted movement. It makes a weighted average of the gradient of the past time step, and the weight decays exponentially according to the time step. The momentum method makes the independent variable update of the adjacent time step more consistent in the direction.RMSProp adjusts the learning rate by using a small batch of random gradients to exponentially weighted moving averages of the square of the elements. The AdaDelta algorithm replaces the learning rate of the RMSProp algorithm by using the exponential weighted average moving term of the square of the independent variable update amount to achieve better results in finding the optimal parameters. Based on basis of RMSProp algorithm, Adam algorithm also makes exponential weighted moving average for small batch stochastic gradient, and uses deviation correction to find the optimal parameters faster and more accurately. In the custom training SwinIR code, we use AdamW as the training optimizer. The AdamW optimizer directly adds the gradient of the regularization term to the back propagation, eliminating the step of manually adding the regularization term to the loss, which improves the efficiency and time of the program. The initial learning rate is set to \(2\times 10^{-3}\), and the multi-step attenuation strategy is used to update the learning rate by 0.1 times in the case of 30, 50, and 80 iterations. At the same time, in order to present the optimal reconstruction results, the selection of loss function is very important during training. For making the model fit the training data during the training process to minimize the error, in the process of selecting the loss functions, we refer to the current loss function that has a better effect on Fourier ptychographic microscopic reconstruction, and select L2-loss, SSIM, and combined loss function L2-loss and SSIM as our comparison loss function. L2-loss as a loss function is currently the most popular choice for FPM reconstruction networks based on neural networks and deep learning directions. It can prevent overfitting and improve the generalization capability of the model. The L2-loss loss function is also called the square loss function, L2 loss, mean squared error (MSE), secondary loss, etc. Its mathematical expression is as follows:  
\[MSE=mean\Big{(}(I_{1}-I_{2})^{2}\Big{)} \tag{24}\]  
Figure 10: Physical model training flow chart. \(I_{1}\) represents the original image, \(I_{2}\) represents the reconstructed image, and the size of the \(I_{1}\) and \(I_{2}\) images is the same.