# Study of Image Classification Accuracy with Fourier Ptychography
## 2 Methodology  
### Fourier Ptychography  
For the imaging task, given an object complex field \(\mathrm{O_{0}(x,y)}\) with spectrum represented by \(\mathrm{O_{0}\left(k_{x},k_{y}\right)}\), where \(k_{x}\) and \(k_{y}\) denote the spatial frequencies along the x and y-direction. The \(n\)-th captured low-resolution raw image intensity is \(\mathrm{I_{n}(x,y)}\) (\(n=1,2,\,3\,\dots\,\,\mathrm{N}\)) with a spectrum of \(\mathrm{G_{n}\left(k_{x},k_{y}\right)}\). The coherent transfer function (CTF) of the microscope objective is given as \(\mathrm{C\left(k_{x},k_{y}\right)}=\mathrm{circ}(k_{r}/k_{0}NA)\), where \(k_{r}=\sqrt{k_{x}^{2}+k_{y}^{2}}\), \(k_{x}\) and \(k_{y}\) represent the spatial frequencies along the x and y directions. denotes a value 1 within a circle of radius r\({}_{0}\) and 0 otherwise, and \(r=\sqrt{x^{2}+y^{2}}\). NA is the numerical aperture of the microscope objective and finally \(k_{0}\) is the wavenumber of the light source. The FPM reconstruction starts from an initial guess of the spectrum distribution of the nth raw image, \(G_{n}^{0}\big{(}k_{x},k_{y}\big{)}\), according to:  
\[g_{n}^{0}(x,y)=\Im^{-1}\Big{\{}G_{n}^{0}\big{(}k_{x},k_{y}\big{)}\Big{\}}=\Im^{- 1}\big{\{}O_{0}\big{(}k_{x}-k_{xn},k_{y}-k_{yn}\big{)}C\big{(}k_{x},k_{y}\big{)} \big{\}} \tag{1}\]  
where \(\Im\) and \(\Im^{-1}\) represent Fourier transform and inverse Fourier transform. \(k_{xn}\) and \(k_{yn}\) indicate the phase-shift caused by the oblique illumination along the x and y directions. To update \(g_{n}^{0}\), we replace the amplitude of \(g_{n}^{0}\) with \(\sqrt{I_{n}}\) as:  
\[g_{n}^{1}(x,y)=\sqrt{I_{n}}\frac{g_{n}^{0}}{|g_{n}^{0}|} \tag{2}\]  
The superscript indices \(0\) and \(1\) in \(g_{n}(x,y)\) represent the prior and post updated low-resolution image, respectively. The updated spectrum is \(G_{n}^{1}\big{(}k_{x},k_{y}\big{)}=\Im\big{\{}g_{n}^{1}(x,y)\big{\}}\), as such the updated spectrum \(O_{0}^{1}\big{(}k_{x},k_{y}\big{)}\) is:  
\[O_{0}^{1}\big{(}k_{x}-k_{xn},k_{y}-k_{xn}\big{)}=O_{0}\big{(}k_{x}-k_{xn},k_{ y}-k_{yn}\big{)}\big{[}1-C\big{(}k_{x},k_{y}\big{)}\big{]}+G_{n}^{1}\big{(}k_{x},k_{y} \big{)} \tag{3}\]  
Repeating Equations (1) to (3) by using \(I_{n}\) from \(n=1\) to \(n=N\) in one iteration, following convergence, the error function \(E_{k}\) becomes:  
\[E_{k}=\sum_{n=1}^{N}\sum_{x,y}\biggl{\{}\Bigl{|}g_{k,n}^{1}(x,y)\Bigr{|}-\sqrt {I_{n}(x,y)}\biggr{\}}^{2}, \tag{4}\]  
The second summation indicates the pixel-by-pixel summation for every single image. In \(g_{k,n}^{0}\), the superscript indices \(0\) and \(k\) represent the complex distribution of the \(n\)-th low-resolution image before the \(k\)-th iteration is completed. Following the \(k\)-th iteration, the high-frequency component-maintained spectrum \(O_{k}\big{(}k_{x},k_{y}\big{)}\) is recovered. The intensity distribution of it is:  
\[I_{k}=|O_{k}(x,y)|^{2}=\Bigl{|}\Im^{-1}\big{\{}O_{k}\big{(}k_{x},k_{y}\big{)} \big{\}}\Bigr{|}^{2} \tag{5}\]  
\(O_{k}\big{(}k_{x},k_{y}\big{)}\) of Equation (5) indicates the desired spectrum after the \(k\)-th iteration, correspondingly, the \(O_{0}\big{(}k_{x},k_{y}\big{)}\) indicates the original spectrum prior to the iteration of the update, the same as to \(I_{k}\) and \(O_{k}(x,y)\). Figure 1 shows the sequence of the FPM algorithm. Figure 1: The iteration process of FPM. In the iteration, the sampling rate of the initial guess of the high-resolution object is higher than the collected low-resolution images. Through the iterative process, the reconstructed image is increased in spatial resolution. In simulation, we choose to use a 630 nm red laser. Camera CCD resolution is 2.76 \(\upmu\)m. The distance between the LED array and the sample is 90 mm. The gap between LEDs is 4 mm. The Fourier Ptychography image reconstruction process starts from the lower resolution direct images. In our study, we used 225 slower resolution images (15 \(\times\) 15 LED array). Based on the 225 lower resolution images, we continued to perform spectrum sampling in the frequency domain.