{'fraction_non_alphanumeric': 0.036790762492534344, 'fraction_numerical': 0.009436591678279913, 'mean_word_length': 5.094637223974764, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Data-Driven Design for Fourier Ptychographic Microscopy

Fourier Ptychographic Microscopy (FPM) is a computational imaging method that is able to super-resolve features beyond the diffraction-limit set by the objective lens of a traditional microscope. This is accomplished by using synthetic aperture and phase retrieval algorithms to combine many measurements captured by an LED array microscope with programmable source patterns. FPM provides simultaneous large field-of-view and high resolution imaging, but at the cost of reduced temporal resolution, thereby limiting live cell applications. In this work, we learn LED source pattern designs that compress the many required measurements into only a few, with negligible loss in reconstruction quality or resolution. This is accomplished by recasting the super-resolution reconstruction as a Physics-based Neural Network and learning the experimental design to optimize the network's overall performance. Specifically, we learn LED patterns for different applications (e.g. amplitude contrast and quantitative phase imaging) and show that the designs we learn through simulation generalize well in the experimental setting. Further, we discuss a context-specific loss function, practical memory limitations, and interpretability of our learned designs.

. Fourier Ptychographic Microscopy (FPM) achieves super-resolution Quantitative Phase Imaging (QPI) with an LED array microscope (left). Here, we show the super-resolved QPI reconstruction for heuristic multiplexing designs (middle) and our proposed learned designs (right). The respective LED pattern designs are shown below the phase reconstructions. Our learned LED source patterns enable improved reconstruction quality without sacrificing temporal resolution.

I. INTRODUCTION
F OURIER Ptychographic Microscopy (FPM) [1] is a computational imaging method that achieves both large fieldof-view (FOV) and high resolution for both amplitude and quantitative phase imaging (QPI), enabling high-throughput imaging for applications in pathology [1] and live cell imaging [2]. It can be conveniently implemented using an inexpensive hardware modification to a conventional microscope simply by replacing the illumination source with a programmable LED array [1], [3] (Fig. 1). By capturing many low-resolution images, each using a different LED to encode a distinct part of the sample's Fourier space (Fig. 2c), the high-resolution complex transmittance function of the sample can be recovered via non-linear phase retrieval optimization.
FPM increases the space-bandwidth product of the microscope, but comes at the cost of significantly reduced temporal resolution. In the originally proposed FPM system, a single measurement is acquired per LED [1] (single-LED design). To produce a high-quality reconstruction, measurements must redundantly encode information such that neighboring LEDs result in at least 60% overlapping coverage of the sample's Fourier space [4], [5]. This results in a poor data input:output ratio -approximately 10× more pixels are acquired than the number of pixels reconstructed [2]. In practice, dozens of measurements are used and the slow speed of capture prevents imaging of live cell dynamics. Several works have improved upon the temporal resolution of the single-LED design, by turning on multiple LEDs simultaneously [2], [6], spatially multiplexing the measurements across the sensor [7], colormultiplexing [8], only acquiring the most important measurements [9], or motion correction [10], [11].
Multiplexed FPM [2], [6] improves upon the measurement requirement for single-LED design to achieve a data input:output ratio of approximately 1× without sacrificing FOV or resolution. This is accomplished by acquiring fewer measurements, each taken under multiple-LED illumination, thereby encoding multiple parts of the sample's Fourier space into each measurement. However, as fewer measurements are acquired and more of the sample's Fourier space is encoded per measurement, the reconstructions become blurry. Practically, the reconstruction's performance is governed by the system's experimental design: which LEDs are turned on in each measurement and how many measurements are acquired.
Recent work has shown that supervised learning can be used to find the experimental design that optimizes the performance of a computational imaging system. Several modelfree methods [12], [13] consider learning design parameters in addition to a black-box Neural Network (NN) that learns an image reconstruction. These methods require a huge number of training examples to properly learn millions of parameters that model the reconstruction process, and they often do not transfer well to the experimental setting. In comparison, model-based methods [14], [15] are able to efficiently learn the experimental design with very few training examples and have been shown to learn designs that do transfer well to the experimental setting. This is achieved by unrolling the image reconstruction process [16]- [19] into a Physics-based Neural Network (PbNN) [14] and then learning the experimental design parameters to maximize system performance.
In this work, we use the physics-based learned design framework [14] to find LED pattern designs that maximize the reconstruction performance of the FPM system. Using our learned designs, we demonstrate the ability to reduce the data input:output ratio below 1 without compromising reconstruction performance, thereby improving temporal resolution of the system, without sacrificing FOV or resolution. Next, by incorporating a context-specific loss function, we are able to tailor the learned LED patterns to different applications (e.g. amplitude contrast imaging vs. QPI). In experiment, we demonstrate that the LED patterns learned in simulation work well for both amplitude contrast imaging and QPI applications. Finally, we discuss interpretations of our learned designs and confirm that they match our intuition, as well as practical implementation details required to build PbNNs for large-scale systems.
II. FOURIER PTYCHOGRAPHIC MICROSCOPY As mentioned in Section I, FPM achieves super-resolution, in that it resolves features beyond the diffraction limit of the microscope's objective. To do so, a set of low-resolution measurements recorded under varying illumination configurations are combined using a computational reconstruction. In this section, we revisit the principles of FPM and mathematically describe how a complex-valued reconstruction is obtained.

A. Forward Model
Given the optical setup in Fig. 2 -a conventional microscope with a coded LED source -we model the optically-thin sample by its 2D transmittance function, x(r) = e iφ(r)−µ(r) , where φ(r) and µ(r) represent the phase and absorption distributions of the sample, respectively, and r ∈ R 2 is the spatial coordinate vector.
Each individual LED's illumination at the sample plane is modeled as a monochromatic plane wave (with wavelength λ) propagating at an angle characterized by the LED's physical position with respect to the azimuth of the microscope [1]. When the lth LED is "on", the complex-field after the sample can thus be written as x(r) exp (2πi ξ l , r ), where ξ l ∈ R 2 is the spatial frequency vector corresponding to the angle of illumination. This can be interpreted as a translation in the Fourier domain (pupil plane), where u is the 2D spatial frequency vector. At the pupil plane of the microscope, the sample's shifted Fourier space is low-pass filtered due to the finite-aperture objective lens, then Fourier-transformed again by the 2nd (tube) lens of the microscope. At the camera, an intensity-only (i.e. phaseless) real-space image is captured. Mathematically, the process relating the sample's transmission function to the measured low-resolution image y l (r) is expressed as (2) Here, F and F −1 denote Fourier transform and its inverse, respectively, P is the pupil function of the microscope objective, which has a hard frequency cutoff at the diffraction limit set by its numerical aperture ( u 2 < NAobj λ ) [20]. In multiplexed FPM (where L LEDs illuminate the sample simultaneously), the measured intensity is the weighted sum of the individual LED measurements, since LEDs are mutually incoherent with each other [2], [6]: where the non-negative scalar c l represents the relative brightness of the lth LED. The implication of Eq. (3) is that multiplexing mixes images, each of which non-linearly encodes information from a distinct region in the sample's Fourier space (see Fig. 2), thereby reducing the number of required measurements and improving the temporal resolution over the single-LED design. However, there is a limit: as more LEDs are used per measurement, it becomes harder to retrieve the high-resolution complex image. It has been shown that the data input:output ratio can be reduced to approximately 1, without a significant reduction in reconstruction quality [2], [6].
Depending on an LED's illumination angle, its resulting intensity image will either be a bright-field or dark-field image [21]. Bright-field images (see Fig. 3a) are produced by central LEDs (inner circle of LED patterns in Fig. 3b) whose spatial-frequency vectors are within the acceptance angle of the objective (where ξ 2 < NAobj λ ). These measurements encode a sample's low spatial-frequency information and are generally very bright, with high signal-to-noise ratio (SNR). Dark-field images are produced by LEDs in the outer shell of patterns in Fig. 3b (where ξ 2 > NAobj λ ). These measurements encode a sample's high spatial-frequency information and are generally very dim, with low SNR. Because bright-field and dark-field images have orders-of-magnitude different brightness, they will be affected by Poisson noise differently [22], and so we always design their LED patterns separately.

B. Inverse Problem
Given a forward model described above, the sample's complex-field is reconstructed by solving a non-linear inverse problem. Following convention, we discretize the 2D transmission function and multiplexed measurements as x ∈ C q and y m ∈ R p , respectively. Note that p < q since the reconstructed transmission function has a higher space-bandwidth product than that of the measurements [1].
Reconstruction of the super-resolved complex transmittance function is then cast as an optimization problem: where Ω k is the index set for LEDs that are "on" during the kth multiplexed measurement y m k . In Eq. (4), the discretized system model is given by where P l ∈ C p×q is the matrix representation of the pupil function shifted by ξ l , and F and F H represent the discrete (normalized) Fourier transform matrix and its inverse, respectively. In this work we solve the optimization problem via gradient descent for which the convergence of the iterates to a stationary point is established [22], [23].

III. PHYSICS-BASED LEARNED DESIGN
Physics-based Learned Design [14] formulates the experimental design as a supervised learning problem that optimizes the source patterns to maximize the performance of the system. The method takes advantage of the PbNN, a rethinking of iterative optimization procedures as NNs that incorporate known quantities such as the system model and reconstruction non-linearities. The inclusion of these quantities provide the robustness and generality associated with modelbased reconstruction and reduces the number of learnable parameters, thereby significantly reducing the number of training examples required. In this section, we show how to utilize this framework for FPM, discuss tailoring the experimental design for a specific application, and analyze memory limitations.

A. Physics-based Neural Network
Our PbNN is defined by the gradient-based optimizer used to solve the inverse problem in Eq. 4 (Fig. 3d). Rather than using a network made up of millions of learnable parameters (e.g. convolutional filters), which would require a large number of training examples, our network is constructed from welldefined functions (i.e. gradient operations and the system model). Each layer of our network corresponds to a single iteration of our gradient-based optimizer. The network, takes as input a set of single LED measurements {y l } l (Fig. 3a), linearly combines them according to the scalar weights in C ∈ R K×L (Fig. 3b) (which represent the relative brightness for each of L LEDs across K measurements), and outputs the reconstructed super-resolved complex image, x (Fig. 3e). The only learnable parameters in the PbNN are the scalar weights that set the relative brightness of each LED, thereby enabling learning with just a few training examples.

B. Context-Specific Learning Objective
For specific applications, we can learn a custom experimental design by tailoring the loss function and training dataset. For example, with stained pathology slides, only amplitude contrast imaging is desired and phase is not used. In this case, our loss function penalizes only the amplitude error of the reconstruction. For live cell imaging applications, samples are nearly transparent and essentially pure phase objects. Hence, our loss function penalizes just the phase error of the reconstruction. For the general case, we can design for a spectrum of applications using this non-convex loss function, wherex n is the ground truth complex transmittance function for the nth training example, N is the total number of training examples, γ ∈ [0, 1] weights the loss between the phase (γ = 0) and amplitude (γ = 1) loss functions, and | · | and ∠ return the amplitude and phase of the complex image, respectively. In addition to tailoring the loss function, we also tailor our training examples to be predominately amplitude or phase samples, simulated from stock images of cells. For pathology applications, the dominant structural contrast is simulated in the absorption component of the sample's transmittance function. For QPI, the dominant structural contrast is in the phase component. Thanks to the efficient parameterization of the network by only the design parameters, we do not require a large amount of training data (90 image patches).
The loss function is then minimized via stochastic gradient descent (SGD) subject to several practical constraints, b k c k = 0 (geometric) (9) c kl ≥ 0 ∀l ∈ {1 . . . L}, (non-negativity) (10) where is element-wise multiplication. The geometric constraint (Eq. 9) allows us to insert prior knowledge about the design by constraining certain LEDs to be "on" or "off" in each measurement. This is enforced using a mask, b k , for the kth measurement. In practice, we use the geometric constraint to separately design source patterns for the bright-field and dark-field regions. The non-negativity constraint (Eq. 10) on the LED brightnesses enables our designs to be feasibly implemented in hardware. Finally, the scaling constraint (Eq. 11) removes degenerate solutions by eliminating arbitrary scalings of the same solution. After training, the overall brightness of the LED patterns can be scaled to utilize the full dynamic range of the camera or to a match desired image noise level.

C. Computational Limitations
The feed-forward process of the PbNN has identical speed and memory complexity to that of its iterative reconstruction. However, when using graphical processing units (GPU) to accelerate the training process, the memory required for reversemode differentiation with backpropagation is limiting. The memory required is proportional to the product of the number of unrolled iterations, the number of measurements, and the size of the reconstructed image. To ensure convergence, we must use a sufficient number of unrolled iterations, which limits us to tuning only the latter two factors. To stay within our GPU's memory limit (12GB on an NVIDIA TITAN X Pascal GPU), we learn the design for reconstructing small patches (35px×35px) using up to 15 measurements. Thanks to the Fourier relationship between FOV and sampling in Fourier space, our designs generalize well to larger FOVs.

IV. RESULTS
We validate our learned designs for FPM with both simulated and experimental results. To learn the designs, we create a PbNN by unrolling 100 iterations of gradient descent (as described in Sec. 3) with the step size of 0.5. Training is conducted in Pytorch using auto-differentiation to compute the gradients with respect to the learnable parameters. Data examples (100 patches each of 35px × 35px) are generated in simulation for two context-specific applications (amplitude contrast imaging and QPI). Each set of examples is shuffled and split into groups of 90 and 10 for training and testing, respectively. The training process is initialized using LED brightnesses drawn from a uniform random distribution.
Simulations are set up to match our experimental system parameters (8× objective, NA obj = 0.2, with camera pixel size ps camera = 6.5µm and LEDs of wavelength λ = 0.514µm). We consider 89 total LEDs on a Cartesian grid separated by a distance of 4mm in x and y with 21 in the bright-field region and 68 in the dark-field region, up to NA illum. = 0.42. This allows us to reconstruct features up to NA recon. = NA obj + NA illum. = 0.62. To mimic experimental noise, each measurement is simulated with a fixed exposure time such that the shot noise for bright-field measurements has a mean rate of 10,000.

A. Simulation Results
In Fig. 4, we display LED patterns for heuristic multiplexing designs for 15, 10, and 5 measurements [2], [6], as compared to our proposed learned designs for 15, 10, and 5 measurements for both amplitude contrast imaging (γ = 1) and QPI (γ = 0) applications. The heuristic multiplexing design for K measurements consists of 3 half-circle brightfield measurements and K − 3 dark-field measurements. The LEDs in the dark-field measurements are randomly distributed such that each measurement has an equal number of LEDs "on" with equal brightness and each LED is "on" exactly once.
For the learned designs, our geometric constraint (Eq. 9) enforces separate LED patterns for bright-field and dark-field LEDs. Specifically, we learn a single bright-field measurement for amplitude contrast imaging and two bright-field measurements for QPI. Generally, the amplitude contrast learned designs are symmetric in the bright-field, while the QPI learned designs are asymmetric in the bright-field (Fig. 4b,c). This makes sense because phase is anti-symmetrically encoded in Fourier space, whereas amplitude is symmetrically encoded. Unlike in heuristic multiplexing designs, the learned dark-field patterns are not random, but systematic. First, the learned designs are predominantly symmetric and LEDs are turned on in clusters, thereby encoding similar information of the sample's Fourier space in each measurement. Second, the LED clusters are fairly disjoint between measurements, thereby encoding different parts of the sample's Fourier space. Finally, as the number of measurements increases, the LED clusters decrease  in size. These themes are further discussed in Section V. In Fig. 5 and Fig. 6, we show super-resolved amplitude and QPI reconstructions from simulated measurements. We compare results for heuristic multiplexing designs [2], [6] and our learned designs to ground truth for 15, 10, and 5 measurements (corresponding to data input:output ratios of 1, 0.66, and 0.33, respectively). Insets highlight a small region and their differences with ground truth. Using heuristic multiplexing designs, as the number of measurements increases, finer detail features are resolved, but reconstructions become corrupted by artifacts. As the number of measurements decreases, reconstruction results become less noisy, but blurrier. In comparison, reconstructions using our learned designs remain sharp as the number of measurements decreases.
To further quantify this trend, we report average testing peak signal-to-noise ratio (PSNR) for different regions of the reconstruction's Fourier space. Specifically, we calculate the PSNR for the low spatial-frequency region (LF-PSNR) up to the incoherent diffraction limit (NA = 0.4) and the PSNR for the high spatial-frequency region (HF-PSNR) (NA = 0.4 to NA = 0.62) to quantify high-frequency noise and the quality of super-resolved features. In Table I and Table II we report average testing LF-PSNR and HF-PSNR for super-resolved amplitude contrast imaging and super-resolved QPI applications, respectively. For heuristic multiplexing design, blurring causes the HF-PSNR for 5 measurements to be relatively higher and noise causes the HF-PSNR for 15 measurements to be relatively lower. In comparison, HF-PSNR for our learned designs are able to achieve approximately consistent performance as the number of measurements decreases.

B. Experimental Results
To validate our learned designs experimentally and show that training on simulated data is sufficient, we implemented our method on an LED array microscope. Our setup is a commercial Nikon TE300 microscope equipped with a custom LED array illumination system and a PCO.edge 5.5 monochrome camera (2560×2160, 6.5µm pixel pitch, 16 bit). We image two samples: a USAF amplitude target and a USAF phase target (Benchmark Technologies).
The experimental reconstructions of amplitude (Fig. 7) and phase (Fig. 8) targets compare our proposed learned designs to heuristic multiplexing designs [2], [6] and FPM single-LED design (89 measurements), which will serve as "ground truth" for validation. To make a fair comparison between different methods, we synthesize measurements for different designs by digitally combining a fixed set of single LED measurements. For amplitude contrast imaging (Fig. 7), we show insets and their error maps, demonstrating resolution of features with a pitch of 0.97µm, even as the number of measurements is reduced. Heuristic multiplexing designs, on the other hand, lose quality and resolution as the number of measurements decreases. For QPI (Fig. 8), we show insets and their error maps, demonstrating resolution of features with a pitch of 1.38µm, while reconstructions with heuristic multiplexing designs degrade with fewer measurements.

V. DISCUSSION
Physics-based learned design for FPM helps beat the tradeoff between temporal resolution and reconstruction quality. Heuristic multiplexing designs have significantly improved temporal resolution, as compared to single-LED design, but reconstruction quality degrades as fewer measurements are acquired (data input:output ratio less than 1). Our learned designs produce systematic LED patterns that more efficiently encode the sample's Fourier space, thereby allowing for highquality reconstructions using fewer measurements.
For LED patterns in the bright-field region, our learned designs (Fig. 4) can be explained intuitively. Asymmetric illumination yields strong phase contrast and symmetric illumination yields strong amplitude contrast. In Fig. 9a, we illustrate this by simulating measurements of a circular object with asymmetric and symmetric LED illumination. For an amplitude object, a pair of asymmetric LEDs produce identical contrast intensity measurements, such that when the sample is symmetrically illuminated the image contrasts add constructively. For a phase object, a pair of asymmetric LEDs produce opposite contrast intensity measurements, such that when the sample is illuminated the two image contrasts add destructively, reducing image contrast. Hence, phase samples will provide better contrast with asymmetric bright-field LED patterns, whereas amplitude samples favor symmetric patterns.
In contrast, our learned designs for dark-field LEDs always form symmetric clusters (Fig. 4). In Fig. 9b, we simulate measurements of a circular object with asymmetric and symmetric dark-field LED patterns to understand why. For both amplitude and phase samples, pairs of asymmetric LEDs produce similar image contrasts such that when either sample is illuminated symmetrically the two image contrasts add constructively. We speculate that by turning on dark-field LEDs that produce similar contrast within the same measurement, it is less ambiguous where the encoded information is from in the sample's Fourier space and thus the reconstruction is able to retrieve the sample's high-resolution Fourier space more faithfully. Practically, symmetrical illumination increases the total illumination brightness, thereby allowing a reduction in the total acquisition time.

VI. CONCLUSION
In this work, we have introduced a physics-based learned design framework to create interpretable context-specific LED source patterns for Fourier Ptychographic Microscopy, a highly non-linear computational imaging system. With these learned designs, we can achieve a more favorable trade off between temporal resolution and reconstruction quality, and tailor our source designs for context-specific applications such as amplitude imaging and quantitative phase imaging. Finally, we demonstrate that designs learned in simulation generalize well in the experimental setting.