Model-independent noise-robust extension of ptychography

A noise-robust extension of iterative phase retrieval algorithms that does not need to assume a noise model is proposed. It works by adapting the intensity constraints using the reconstructed object. Using a proof-of-principle ptychographic experiment with visible light and a spatial light modulator to create an object, the proposed method is tested and it compares favorably to the Extended Ptychographic Iterative Engine (ePIE) with reduced step size. The method is general, so it can also be applied to other iterative reconstruction schemes such as phase retrieval using focus variation. © 2017 Optical Society of America under the terms of the OSA Open Access Publishing Agreement OCIS codes: (110.1758) Computational imaging; (110.4280) Noise in imaging systems; (100.5070) Phase retrieval; (100.3190) Inverse problems. References and links 1. J. M. Rodenburg and H. M. L. Faulkner, “A phase retrieval algorithm for shifting illumination,” Appl. Phys. Lett. 85(20), 4795 (2004). 2. T. M. Godden, R. Suman, M. J. Humphry, J. M. Rodenburg, and A. M. Maiden, “Ptychographic microscope for three-dimensional imaging,” Opt. Express 22(10), 12513 (2014). 3. M.Holler,M.Guizar-Sicairos, E. H. R. Tsai, R. Dinapoli, E.Müller, O. Bunk, J. Raabe, andG.Aeppli, “High-resolution non-destructive three-dimensional imaging of integrated circuits,” Nature 543(7645), 402–406 (2017). 4. A. M. Maiden, J. M. Rodenburg, and M. J. Humphry, “Optical ptychography: a practical implementation with useful resolution,” Opt. Lett. 35(15), 2585 (2010). 5. G. Zheng, R. Horstmeyer, and C. Yang, “Wide-field, high-resolution Fourier ptychographic microscopy,” Nat. Photonics 7(9), 739–745 (2013). 6. B. Zhang, D. F. Gardner, M. D. Seaberg, E. R. Shanblatt, H. C. Kapteyn, M. M. Murnane, and D. E. Adams, “High contrast 3d imaging of surfaces near the wavelength limit using tabletop EUV ptychography,” Ultramicroscopy 158, 98–104 (2015). 7. M. Holler, A. Diaz, M. Guizar-Sicairos, P. Karvinen, E. Färm, E. Härkönen, M. Ritala, A. Menzel, J. Raabe, and O. Bunk, “X-ray ptychographic computed tomography at 16 nm isotropic 3d resolution,” Sci. Rep. 4, 3857 (2014). 8. H. Yang, R. N. Rutte, L. Jones, M. Simson, R. Sagawa, H. Ryll, M. Huth, T. J. Pennycook, M.L.H. Green, H. Soltau, Y. Kondo, B. G. Davis, and P. D. Nellist, “Simultaneous atomic-resolution electron ptychography and z-contrast imaging of light and heavy elements in complex nanostructures,” Nat. Commun. 7, 12532 (2016). 9. L. Yeh, J. Dong, J. Zhong, L. Tian, M. Chen, G. Tang, M. Soltanolkotabi, and L. Waller, “Experimental robustness of Fourier ptychography phase retrieval algorithms,” Opt. Express 23(26), 33214 (2015). 10. L. Bian, J. Suo, J. Chung, X. Ou, C. Yang, F. Chen, and Q. Dai, “Fourier ptychographic reconstruction using Poisson maximum likelihood and truncated Wirtinger gradient,” Sci. Rep. 6, 27384 (2016). 11. P. Thibault and M. Guizar-Sicairos, “Maximum-likelihood refinement for coherent diffractive imaging,” New J. Phys. 14(6), 63004 (2012). 12. P. Godard, M. Allain, V. Chamard, and J. Rodenburg, “Noise models for low counting rate coherent diffraction imaging,” Opt. Express 20(23), 25914 (2012). 13. S. Marchesini, H. Krishnan, B. J. Daurer, D. A. Shapiro, T. Perciano, J. A. Sethian, and F. R. N. C. Maia, “SHARP: a distributed GPU-based ptychographic solver,” J. Appl. Crystallogr. 49(4), 1245–1252 (2016). 14. Y. Zhang, P. Song, and Q. Dai, “Fourier ptychographic microscopy using a generalized Anscombe transform approximation of the mixed Poisson-Gaussian likelihood,” Opt. Express 25(1), 168 (2017). 15. C. Zuo, J. Sun, and Q. Chen, “Adaptive step-size strategy for noise-robust Fourier ptychographic microscopy,” Opt. Express 24(18), 20724 (2016). 16. A. M. Maiden and J. M. Rodenburg, “An improved ptychographical phase retrieval algorithm for diffractive imaging,” Ultramicroscopy 109(10), 1256–1262 (2009). 17. P. Dwivedi, A. P. Konijnenberg, S. F. Pereira, and H. P. Urbach, “New method for probe position correction for ptychography,” Proc. SPIE 10329, 103292Y (2017). Vol. 26, No. 5 | 5 Mar 2018 | OPTICS EXPRESS 5857 #303798 https://doi.org/10.1364/OE.26.005857 Journal © 2018 Received 31 Jul 2017; revised 12 Nov 2017; accepted 14 Nov 2017; published 26 Feb 2018 18. A.P. Konijnenberg, W.M.J. Coene, and H.P. Urbach, “Non-iterative phase retrieval by phase modulation through a single parameter,” Ultramicroscopy 174, 70–78 (2017). 19. H. Chang and S. Marchesini, “A general framework for denoising phaseless diffraction measurements,” arXiv:1611.01417 (2016). 20. M. Guizar-Sicairos and J. R. Fienup, “Phase retrieval with transverse translation diversity: a nonlinear optimization approach,” Opt. Express 16(10), 7264 (2008). 21. J. R. Fienup, “Reconstruction of an object from the modulus of its Fourier transform,” Opt. Lett. 3(1), 27 (1978). 22. A. P. Konijnenberg, W. M. J. Coene, S. F. Pereira, and H. P. Urbach, “Combining ptychographical algorithms with the Hybrid Input-Output (HIO) algorithm,” Ultramicroscopy 171, 43–54 (2016). 23. A.M. Maiden, G.R. Morrison, B. Kaulich, A. Gianoncelli, and J.M. Rodenburg, “Soft x-ray spectromicroscopy using ptychography with randomly phased illumination,” Nat. Commun. 4, 1669 (2013). 24. P. Thibault, M. Dierolf, O. Bunk, A. Menzel, and F. Pfeiffer, “Probe retrieval in ptychographic coherent diffractive imaging,” Ultramicroscopy 109(4), 338–343 (2009). 25. C. Wang, Z. Xu, H. Liu, Y. Wang, J. Wang, and R. Tai, “Background noise removal in x-ray ptychography,” Appl. Opt. 56(8), 2099 (2017). 26. J. Zhong, L. Tian, P. Varma, and L. Waller, “Nonlinear optimization algorithm for partially coherent phase retrieval and source recovery,” IEEE Trans. Comput. Imaging 2(3), 310–322 (2016).


Introduction
Ptychography [1] has recently been proven to be a very promising technique to image objects ranging from biological samples [2] to semiconductor structures [3] in both the visible light regime [4,5], as well as in the extreme ultraviolet (EUV) [6], X-ray [3,7], and electron regimes [8].
In this method, multiple intensity patterns are recorded, from which the object is reconstructed computationally using an iterative algorithm. Since the object is recorded from a series of intensity patterns, it is important that these patterns are recorded with a sufficiently high signal-to-noise ratio (SNR).
For both regular [1] and Fourier ptychography [5], the effects of noise in the intensity measurements on the object reconstruction have been studied, and to make the reconstruction algorithm more noise robust several methods have been proposed, most of which rely on choosing the right cost function to minimize [9], sometimes combined with a regularization scheme [10]. One choice for the cost-function is the log-likelihood cost function which can be derived from a maximum-likelihood principle [10,11]. In this scheme, one needs to assume a certain noise model and maximize the likelihood of obtaining the measured intensity patterns by minimizing the negative logarithm of the likelihood function. A very good initial guess is required, or some regularization to prevent divergence is necessary [10,11].
An alternative method uses variance stabilizing transforms [12][13][14]. Also in this scheme a noise model needs to be assumed. In the noise model, the variance of the measured intensity depends on its expectation value, but by applying a variance stabilizing transform, the variance becomes approximately independent of the noise-free intensity value. It can be shown that the cost function using the variance stabilizing transform closely approximates the log-likelihood cost function [14]. However, the update function derived from the log-likelihood cost function can diverge, which would therefore require some additional regularization, whereas the cost function using a variance-stabilizing transformation for Poisson noise does not suffer from such instabilities. Another way to reliably increase noise-robustness is to simply reduce the step size of the update function [15].
We propose an extension to the ptychographic algorithm that can be applied to any of the aforementioned algorithms [10][11][12][13][14], does not require an assumed noise model, and works by adapting the intensity constraints. We test the algorithm with a proof-of-principle experiment in the visible light regime where we use a phase-only Spatial Light Modulator (SLM) to create and shift the object. The proposed algorithm is shown to compare favorably to regular ePIE [16] with reduced step size combined with a position correction scheme [17]. Note that the idea behind this algorithm is not necessarily restricted to ptychography, but could also be applied to other reconstruction schemes where a field is reconstructed from multiple intensity measurements, such as for example a through-focus scan or similar scans [18].

Noise robust ptychographic algorithms
Previous proposals for noise robust ptychographic algorithms mainly revolved around assuming a known noise model, and using a maximum-likelihood optimization scheme [10,11] or a variance-stabilizing scheme [12][13][14] to construct a cost function which, when minimized, yields a superior reconstruction, because prior knowledge of the noise model has been incorporated. In this section, we discuss the methods in more detail to see where there is room for improvement in these reconstruction schemes, which is what motivated the development of the algorithm that is proposed in this article.

Maximum likelihood scheme
Let us start by describing the problem posed in ptychography when noise is present. We have an unknown complex-valued object O(x) that we want to estimate with O est (x). Here, x is a two-dimensional position vector in object space. The object is illuminated with a known probe P(x) that is shifted to different positions X. We denote the noise-free diffraction pattern intensities by and the estimated diffraction patterns by Here, F{·} denotes the Fourier transform, and u denotes a two-dimensional position vector in diffraction space. We assume that u is discrete due to the pixelation of the detector. We denote the measured noisy diffraction patterns by y X (u). The problem that needs to be solved is: how do we find an estimated object O est (x) that matches the noise-free diffraction patterns m X (u), while only noisy diffraction patterns y X (u) are given?
The reasoning behind the maximum-likelihood optimization scheme is the following. We assume that y X (u) obeys a certain noise model. For example, if we assume Poissonian noise, then the probability that we measure a certain intensity y given a noise-free intensity m is The total probability that we measure the data set y X (u) is given by assuming that the noise at each pixel is uncorrelated. We then try to find O est such that P tot [z X (u)] is maximized, or equivalently, such that − log P tot [z X (u)] is minimized. Thus, we define the cost function Here, the term X,u log y X (u)! is independent of z X (u), so it can be omitted. The ptychographic algorithm is then constructed by minimizing L[O est (x)] using an optimization scheme, which is commonly the steepest-descent scheme. In the steepest-descent scheme, O est (x) is updated using the Wirtinger derivative of the cost function The derivative of Eq. (5) may diverge. One way to remedy that is to assume that z X (u) ≈ y X (u) when we have a good object estimate (i.e. O est (x) ≈ O(x)), so that we can Taylor expand Eq. (5) in terms of z X (u) around the point z X (u) = y X (u), which gives [11] z − y log z ≈ y − y log y Thus, ignoring irrelevant additive and multiplicative constants, we can define the cost function This is the amplitude-based cost function that is used to derive regular PIE and ePIE, which supports the claim that regular ePIE is optimized to deal with Poisson noise.

Variance stabilization scheme
Another way to look at the problem is from the perspective of variance stabilization. For example, consider the intensity-based cost function If we again assume that y X (u) is drawn from a Poisson distribution, then for larger y X (u) we expect a larger error (m X (u) − y X (u)) 2 , and therefore the cost function weighs the pixels with high intensity more strongly than pixels with low intensity. If we want each pixel to have equal weight regardless of its measured intensity, we need to apply a transformation so that the expected error is independent of the measured intensity, which is a variance-stabilizing transformation. For Poisson noise, this transformation is taking the square-root, which leads once more to the amplitude-based cost functional of Eq. (8). It has been proposed to use other variance-stabilizing transforms, such as the Anscombe transform [14]. We have seen that the amplitude-based cost function in Eq. (8) can be derived either by using a Maximum-Likelihood approach that aims to find an object for which the probability of obtaining the measured intensity patterns is maximized, or by using a variance-stabilizing approach that aims to make the variance the same for each pixel regardless of its measured intensity. Even though these two approaches appear to be very different, it can be shown that the Maximum Likelihood approach is also a way to make the probability distribution the same for each pixel regardless of its measured intensity value. If P(y|m) denotes the probability we measure a noisy value y given a noise-free value m, then we can use Bayes' rule to calculate the probability P(m|y) that m is the noise-free value if we measure a noisy value y [19] We now want to find a transformation T y such that T y (m) is normally distributed with mean 0 and standard deviation 1, independently of the measured intensity value y The cost function we then want to minimize is We can solve for T y (m) 2 This expression for T y can be plugged into Eq. (12). If we assume we have no prior information about m (so P(m) is independent of m), and we ignore all irrelevant additive constants that are independent of z, and we ignore global multiplicative constants, we find the cost function which is the negative log-likelihood function as used in the maximum-likelihood method.

Discussion
We have seen that the maximum-likelihood schemes and variance-stabilizing schemes aim to construct a cost function that gives equal weight to pixels with low intensity and pixels with high intensity. It has been demonstrated that this is important in Fourier ptychography because the dark-field images which carry information about the high spatial frequencies of the object have a very low intensity compared to the bright-field images [9]. However, in regular ptychography such a distinction is absent (although there may be a large dynamic range in each single measurement, depending on what illuminating probe function one uses), and it has even been suggested to give pixels with a higher signal-to-noise ratio (which for Poisson noise are the pixels with higher intensity) more weight [20]. There is still some room for improvement in these schemes because all these cost functions push the algorithm towards the solution for which z X (u) = y X (u) which we know almost certainly to be wrong. After all, if y X (u) is randomly distributed, the probability that y X (u) = m X (u) for all X and u is extremely small, so we expect that for the true solution O est (x) = O(x) that L 0, even though the aforementioned algorithms try to achieve L = 0.
Another way to think about it is that in Eq. (13) we assumed that we have no prior information P (m X (u)) about the probability that a certain noise-free intensity value is m X (u). However, with all the overlap constraints in ptychography, there is in fact some information about this probability. For example, consider a probe position X and all its adjacent probe positions. If we measure certain intensity patterns for the adjacent probe positions, then the intensity pattern we measure for probe position X is not completely arbitrary, which means P(m X (u)) is not independent of m X (u). More specifically, one could create an object reconstruction using the intensity patterns for all probe positions except X, and then use that object estimate to give a rather accurate prediction of m X (u) that can be used to update P(m X (u)). By including this term in the cost function as prescribed by Eq. (13), the algorithm is not necessarily pushed to the solution z X (u) = y X (u) anymore. Note that P(m X (u)) is independent of the assumed noise model.
In the extension that we propose in this article, we aim to find a cost function for which L = 0 can be achieved, making use of the overlap constraints that are present in ptychography.

The proposed extension
In the noise-free case, one would obtain O est (x) by minimizing for each probe position X a cost functional such as In this ideal case, ePIE would be able to obtain a good reconstruction of the object. However, since we only have noisy measurements y X (u), we cannot define this cost functional. What we can do, however, is to estimate m X (u) from y X (u) and all the additional information we have, such as the probe and the probe positions. So by running the ePIE algorithm we would be using all our available information to estimate m X (u) from y X (u) using z X (u). Inspired by the observation that ePIE becomes more noise robust when decreasing the step size [15], one can come up with the following scheme to update the estimate for m X (u): 1. Choose the initial estimate m X,est,0 (u) of m X (u) to be y X (u) or some denoised version of y X (u).
2. Run the PIE algorithm with a small step size for a certain number of iterations, using m X,est,k (u) as the intensity constraints. We denote the resulting estimated diffraction patterns as z X,k (u) Here, µ is a step size that should be chosen much smaller than 1 but larger than 0.
Adapting the intensity constraints has also been considered when combining the Hybrid Input-Output (HIO) algorithm [21] with PIE [22]. Note that if we choose µ = 0 this scheme is identical to the regular ePIE algorithm, and in case the intensity measurements are corrupted by noise, the value of the cost functional L X [O est (x)] can in general not be minimized to be 0. By contrast, if we choose µ > 0 (but still small), then the algorithm stagnates when z X,k (u) ≈ m X,est,k (u) which means that L X [O est (x)] ≈ 0. However, it is important to realize that if we obtain L = 0, the error of the reconstructed object need not be 0 as well.

Method
To create and shift a phase object on which to test our proposed algorithm experimentally, we use a phase-only Spatial Light Modulator (SLM) to which we assign an image that we want to reconstruct. The SLM in which the object is created is a reflective liquid crystal phase-only PLUTO SLM by Holoeye, with a resolution of 1920 × 1080 pixels, and a pixel pitch of 8.0µm. With a lens with a focal length of 15cm we create the Fourier transform of the field that is reflected by the SLM. To reduce the dynamic range of the diffraction patterns [4,23], a fixed rapidly varying phase pattern as shown in Fig. 1(c) is added with the SLM on top of the shifted object, which more or less defines the probe P(x). The illuminated area of the SLM (which corresponds to the size of the probe) is a circle with a radius of 250 pixels. The object is shifted along a 7 × 7 square grid with a period of 50 pixels with some random offsets to reduce the raster grid pathology in the reconstruction [24]. The images are recorded with an 8-bit SVS-VISTEK eco204MVGE CCD camera with a resolution of 1024 × 768 pixels and a pixel size of 4.65µm × 4.65µm. For each intensity measurement, we take the average of 50 pictures. The object is then reconstructed using ePIE [16] and a probe position correction scheme [17]. Another reconstruction is then performed which uses, in addition to ePIE and the probe position correction scheme, the proposed noise-robust scheme where the intensity constraints are updated as in (16). The experimental setup is shown in Fig. 2.

Results
In Fig. 1 the phase objects that are applied to the SLM are shown. The object should in principle have a constant amplitude, but the contours of the phase pattern become apparent in the amplitude if the object is low-pass filtered. In the experiment, low-pass filtering of the object is inevitable since the information of the higher spatial frequencies that is present in the diffraction patterns is  lost due to the finite size and limited dynamic range of the detector. Also, in Fig. 1 the probe with which the reconstruction was performed is shown. This probe was reconstructed using phase-shifting holography and refined using ePIE [16]. Before performing the reconstruction on the noisy data set using ePIE and the proposed algorithm, the intensity measurements were denoised. To do this, measurements that were taken in the dark (i.e. when the laser is completely blocked) were subtracted from the ptychographic measurements. Then, a rectangular region in the measurements was selected where the images should be practically zero, as shown in Fig. 3. In this region, the mean and standard deviation of the noise level were determined. The mean value was subtracted from the entire image, and everything below three times the standard deviation was set to zero. This denoising method as well as others are described in [25]. We run two reconstruction algorithms: ePIE with a reduced step size combined with a probe position correction scheme, and the proposed adaption of this algorithm. For the first algorithm we eventually use a step size of 0.1, although in the initial iterations a larger step size can be used. For the position correction update scheme [17], we use a step size of 0.1. For the proposed noise-robust algorithm we do the same, but after 150 iterations, we update the intensity constraints according to (16) each 10 iterations with a step size of µ = 0.05. In Fig. 4 the reconstruction for the object 1 is shown. For object 1, which is a more 'natural' image, we observe in some regions an increase in contrast. In Fig. 5 it is shown how adapting the intensity measurements causes a stronger presence of higher spatial frequencies, thus indeed leading to an increased resolution in the object reconstruction. In Fig. 6 it is shown that for the amplitude-based cost function L as defined in Eq. (8) L cannot converge to 0 when using regular ePIE, whereas when we adapt the amplitude constraints the value of L gradually approaches 0. For object 2, which is a binary image that may be more characteristic of fabricated semiconductor structures, we see in Fig. 7 that the smaller structures become more clearly visible by applying the proposed algorithm. The structured nature of object 2 causes the differences in the reconstructions to be more easily visible, so we choose this object to perform further tests of the algorithm. In Fig. 8 only a single measurement is taken per probe position, meaning that the signal-to-noise ratio is significantly lower than in Fig. 7. Additionally, in Fig. 9 we use incorrect initial probe guesses and use probe position correction. One can observe that in Fig. 9 the reconstruction quality is significantly lower than in 8, which is because the algorithm fails to find the correct probe positions due to the high noise levels. Nonetheless, in both cases the noise-robust extension appears to improve the reconstruction quality in some points, as evidenced by the zoomed-in images where the phase along the vertical lines are more uniform when the proposed algorithm is used.
Unfortunately, it is difficult to perform further quantitative analysis on these reconstructions. Even though we know the image that has been assigned to the SLM, there are still small uncertainties in the magnification factor between the assigned image and the reconstructed image, the rotation angle between the SLM and the detector which causes the reconstructed image to be slightly rotated, and the way the SLM converts assigned grayscale values into phase shifts. Even though the uncertainties may be small, the differences between the reconstruction errors for the two algorithms are small as well, so it is difficult to use the image that is assigned to the SLM for quantitative analysis.

Simulations
To quantify the benefit of the proposed algorithm more accurately, we performed reconstructions with simulated data that closely resembled the measured data, i.e. we used the same object and probe as the ones that were assigned in the SLM in the experiment, and we used an oversampling rate that approximately matches the one from the experiment. We multiplied the simulated intensity patterns with a certain value to change the photon count. Then, Poisson noise was added to simulate shot noise. This process was performed for different values of the photon count, and for each value we compared the PIE reconstruction with the reconstruction obtained with the proposed algorithm (we assumed no uncertainty in the probe or probe positions). The Fig. 5. A comparison of the estimated diffraction patterns (log scale) of object 1 using standard ePIE and the proposed algorithm. One can observe that in the proposed algorithm the higher spatial frequencies have a stronger presence, thus causing the reconstructed object to have a higher resolution. For the regular ePIE algorithm, the estimated amplitudes are compared with the measured amplitudes y X (u), while for the proposed algorithm the estimated amplitudes are compared reconstruction error is calculated using the error metric where O est (x) is the reconstructed object, O(x) is the actual object, and c is a complex constant that minimizes the error The results are shown in Fig. 10. We see that for higher photon counts (higher than 10 4 ), using the proposed algorithm gives the same reconstruction error as using the regular PIE algorithm at a photon count that is 10 0.5 ≈ 3.2 times higher. In practice this would mean that one could reduce the radiation dose to which the sample is exposed by a factor of 3 without sacrificing reconstruction quality. The reason why the benefit of the proposed extension is lower for higher noise levels is because it uses the reconstructed object to update the intensity constraints. If the noise levels are higher, the reconstructed object is worse, and the intensity constraints are updated in a less reliable manner. With these simulations it was also investigated how many PIE updates should be applied each time after the intensity constraints have been updated according to Eq. (16). For an update parameter of µ = 0.05, the reconstruction error has been plotted for different numbers of PIE updates in Fig. 11. One can observe that for this situation, applying just one PIE update after the intensity constraints are updated gives the same reconstruction error as applying 20 PIE updates, and significantly fewer iterations are needed.
To demonstrate that the proposed method is not restricted to one specific noise model, simulations with different amounts of additive Gaussian noise were performed. After normalizing the set of intensity patterns such that the overall maximum value is 1, Gaussian noise with standard deviations of 10 −3.5 , 10 −3 , 10 −2.5 was added. The resulting simulated intensity pattern were then denoised using the same procedure as described in Section 5. The reconstruction results shown in Fig. 12 indicate that the proposed method also works for additive Gaussian noise, provided that the noise level is not too high.
Lastly, it was noted in Section 2.3 that for Fourier ptychography the effect of Poisson is significantly different for Fourier ptychography than it is for regular ptychography. Therefore, simulations were performed to test if the proposed method also works for Fourier ptychography. As shown in Fig. 13, a phase object with constant amplitude was used for the simulations. The simulation results presented in Fig. 14 indicate that also in this case the proposed method is capable of improving the reconstruction results. For example, one can visually observe that by using the proposed extension, the reconstructed amplitude becomes more constant, as it should be since the object is a pure phase object.

Phase retrieval using focus variation
Even though our focus has been on the ptychographical algorithm, the idea behind the proposed algorithm is rather general, and can also be applied to other iterative phase retrieval methods. As a demonstration of this, we simulate a set of through-focus measurements by adding a quadratic phase factor e 2πi A|x| 2 to the object O(x). For each value A of the defocus parameter, we take a noisy measurement m A (u) ≈ |F{O(x)e 2πi A|x | 2 }| 2 . Similar to Eq. (15), we define a cost function that we can use to update O est (x) sequentially for each A using the steepest-descent method with a small step size of 0.01. This gives essentially the same update scheme as the one used in PIE,  except we define the probe as P A (x) = e 2πi A|x | 2 instead of P X (x) = P(x − X). We refer to this method as the Sequential Gerchberg-Saxton method [26]. In Fig. 15 the reconstruction results are shown for simulated data sets of 50 different values of the defocus parameter A. Also in this case it can be seen that by adapting the intensity measurements during the reconstruction a reduction in the reconstruction error can be achieved.

Conclusion
We have proposed a noise-robust extension of iterative phase retrieval algorithms. It does not rely on an assumed noise model, and works by adapting the intensity constraints using the reconstructed object. This algorithm has been tested experimentally for ptychography, and it was compared to the standard ePIE algorithm with reduced step size combined with a probe position correction scheme. Both experimental and simulation results show that the proposed algorithm outperforms (e)PIE when the noise level is not too high. The idea behind this algorithm is general enough to be applied to other iterative phase retrieval methods, such as the focus variation method, as was demonstrated using simulations. Quite possibly the applications of the proposed method extend beyond phase retrieval algorithms.