Ghost imaging with electron microscopy inspired, non-orthogonal phase masks

Transmission electron microscopes (TEM) achieve high resolution imaging by raster scanning a focused beam of electrons over the sample and measuring the transmission to form an image. While a TEM can achieve a much higher resolution than optical microscopes, they face challenges of damage to samples during the high energy processes involved. Here, we explore the possibility of applying computational ghost imaging techniques adapted from the optical regime to reduce the total, required illumination intensity. The technological lack of the equivalent high-resolution, optical spatial light modulator for electrons means that a different approach needs to be pursued. Using the optical equivalent, we show that a simple six-needle charged device to modulate the illuminating beam, alongside a novel reconstruction method to handle the resulting highly non-orthogonal patterns, is capable of producing images comparable in quality to a raster-scanned approach with much lower peak intensity.


Introduction
Raster scanning a focused beam of light or electrons and measuring the transmission is a simple approach to creating an image in the absence of complicated detector arrays. An alternative approach that has been pioneered in the optical regime has been measuring the transmission of the sample when illuminated with more complicated spatial patterns. This approach, often referred to a classical computational ghost imaging, inverts knowledge of the known patterns and their measured transmission to reveal the image. Furthermore, the inversion can be constrained using known image properties (e.g. sparsity of spatial frequencies) such that the image can be estimated from fewer measurements than would have been required by a raster scan; a form of compressed sensing 1,2 .
The spatial structuring of optical beams has been extended to matter waves, primarily electrons. This structuring of electron beams paved the way for the production of vortex electron beams 3 , self-accelerating beams 4 , non-diffracting beams 5 and orbital angular momentum analysers 6 . In the case of electron beams, an arbitrary way of flexibly spatially programming a beam is problematic and existing methods for the dynamic shaping of electron beams are limited. One realisable option uses multiple, electrically charged needles inserted into the beam aperture to create a programmable phase mask and hence, a modified beam cross-section in the far-field. In this work, we use optical elements and light shaping technologies to emulate existing needle-based modulation techniques from electron microscopy and show it is possible to create complicated far-field patterns that when combined with a novel inversion algorithm produces images comparable to those produced by raster scanning but using much lower peak intensities.
The potential advantages of the computational ghost imaging approach are two-fold. First, that single element detectors cover a wide range of operating wavelengths, and/or have faster response times than detector arrays. Second, when combined compressed sensing techniques, an image can be obtained with fewer measurements [7][8][9] . This ability to image with fewer measurements potentially increases the frame rate and/or reduces the exposure of potentially delicate samples to the illumination. Using these computational ghost imaging techniques, novel imaging systems have been developed that include imaging at terahertz wavelengths 10 , time of flight imaging 11,12 , and imaging sensitive to fluorescent lifetime 13 . As an alternative to the electromagnetic spectrum, electron beams can also be used for imaging but at much shorter length scales. Since the time-independent wave equation for the light and electrons are perfectly analogous 14 components like lenses for electron beams are defined with the similar nomenclature as for light. However, optical elements for light are inherently easier to build and  16 consists of a spatial light modulator (SLM) that superposes the phase masks onto the beam and illuminates the target in the far-field. The transmitted light is measured by a single element detector (i.e. photomultiplier tube). Light at 633 nm is spatially filtered and expanded to fill the aperture of an SLM. The output beam of the laser is filtered using an aperture (P), a 50 mm focal length lens (L 1 ), precision pinhole (P 50µ ) and 400 mm focal length lens (L 2 ). The SLM includes both the six-needles phase masks and a diffraction grating. The latter projects the majority of the modulated light into the first order, which is selected using a 250 mm focal length lens (L 3 ) and aperture (P). This light is propagated into the far-field through a combination of lenses (250 mm focal length lens (L 4 ) and 400 mm focal length lens (L 5 )). The beam is propagated into two separate arms using beamsplitter (BS). One arm uses a power meter to measure the laser power and the second arm consists of the target (T). The photomultiplier tube (Thorlabs, PMM02) measures the transmitted light after interaction with the target. spatial light modulators (SLMs) that shape the optical beams in a programmable, and near arbitrary way, do not explicitly exist for electrons. Although single-element detector-based imaging has previously been introduced for specialised electron imaging systems 15 , the barrier to more general use is indeed the difficulty in creating the equivalent of an SLM.
In the context of electron beams, holographic plates 14 laid the foundation for applications related to the shaping of electron beams. However, these are passive elements and cannot be dynamically addressed like optical SLMs. Moreover, after the early experiments with material-based electron holograms, it is becoming obvious that material transmission with the electron beam should be reduced as much as possible in the microscope optics as it deteriorates the beam coherence and/or intensity. A most welcomed recent development has been the introduction of active optical elements or programmable phase plates 17 . These are based on simple electrostatic elements to be positioned along the beam path. Two technological solutions are currently available: the research group led by Verbeeck has been developing devices based on Einzel lenses. These lenses work like the individual pixels of an optical spatial light modulator but the number of addressable points are few in comparison the the optical devices 17 . An additional challenge for these lenses arises from the difficulty to bias and drive many connections from outside the microscope column, which necessarily limits the useful fill fraction of such a pixel-based approach. As an alternative, other groups are using separated electrodes to define specific phase landscapes across a wider area. This electrode-based approach has the benefit that the beam itself only interacts with the electric field created rather than the modulator components themselves, avoiding the main problems of the other approach. However, whereas the solution is defined everywhere the phases φ are limited by the harmonic condition ∇ 2 φ = 0 everywhere except on the electrodes 18 . In other words, the variations in possible phase modulation is far more restricted.
The most trivial electrode used thus far is a simple metallic needle 19 . The definition of the electrostatic field around a charged microtip has been studied in detail 20, 21 , wherein charge applied to these needles induces a phase shift around their tips to the electron beam. Interestingly, the phase shift generated by a metallic needle was used as key to implement an orbital angular momentum (OAM) sorter 22 . More importantly, multiple metallic needles have been demonstrate to be capable of producing complex tunable caustic phenomena in the far field 23 . This current work uses an arrangement of six such needles, regularly spaced around an aperture, as shown in figure 2.

Ghost imaging reconstruction algorithms
The choice of mask patterns is key to the performance of the system and also key to the type of algorithm used to reconstruct the image. The evolution of ghost imaging has seen an evolution in both experimental setups and algorithms 24,25 . Although the vast majority of computational ghost imaging and the related work on signal pixel camera uses a spatial modulator position in the image plane of the object, the original work by Shapiro recognised that this need not be the case, rather given any specific modulation, the resulting form of the light field in the plane of the object could be calculated using numerical beam propagation techniques enabling both lens free and far field implementations 16 .
Another important aspect of ghost imaging are the algorithms used to recover an image from the measurements and knowledge of the patterns used. This problem can be cast into a simple matrix form: where A is a matrix containing the patterns p i ⊤ as rows, x represents the (discretised) scene, and b is the set of measurements b i . The methods used to retrieve x and thereby an image fall roughly into two categories, offline or online 26 . Offline approaches infer the image from the final complete set of patterns and corresponding measurements. The majority of well known methods for solving linear systems fall in this category, e.g. the matrix (pseudo)inverse, Newton's method, etc. Conversely, online approaches update a best guess of the image with every new measurement and light pattern. The most common online algorithm involves a straightforward weighted sum of the patterns, where the weights are adjusted based on a statistical interpretation of the measurements: Here g i is the best estimate after i patterns and b i indicates the mean detector value up to the current pattern, and g 0 = 0. This algorithm, which we will refer to as traditional ghost imaging (TGI), has been extensively explored with different setups 27,28 . The primary advantage of online reconstruction algorithms lies in the low computational overhead and robustness to undersampling. In the absence of additional constraints, to achieve a reasonable spatial resolution, the number of illumination patterns required is typically equal to the number of pixels in the image. This quickly makes the matrix A from equation 1 very large, leading to high memory requirements and long computation times for offline methods. Online methods only need to store the current best guess of x and the current pattern, and only ever operate on vectors of that size. Moreover, TGI is by its very nature impervious to problems with undersampling and can show approximations to the correct image with comparatively only a handful of measurements.
Both classes of reconstruction method work significantly better when used with orthogonal pattern sets, for example Hadamard matrices [29][30][31] , where each mask probes a subset of spatial frequencies. For offline methods this is equivalent to ensuring full row rank, which increases the stability of the matrix inversion results. For TGI, it ensures that each pattern's spatial frequencies are counted democratically in the mean correction term. Either way, in the absence of noise, the result approaches the true image when the number of orthogonal patterns equals the number of pixels.
If the mask patterns are implemented using a pixelated spatial light modulator, specifying their design to be orthogonal is straightforward (e.g. Hadamard, or similar). If, however, the patterns are produced in other ways, e.g. using natural scattering or with the highly limited modulators available in a TEM, then orthogonality between the patterns can no longer be enforced and the reconstruction algorithms no longer converge to an accurate image. The TGI algorithm in particular will overemphasize the overlapping parts of the patterns. To resolve this issue, we report an alternative approach that is computationally efficient and makes optimal use of patterns regardless of their orthogonality. This alternative method, which we will call orthogonalised ghost imaging (OGI), takes inspiration from the Kaczmarz algorithm for solving linear systems.
OGI essentially takes the projection of each new pattern onto the current best pattern estimate as an extra correction to the mean detector value used in TGI: where c i = p i · g i−1 is the predicted signal under the assumption that the previous best estimate is the correct reconstruction. This has the effect of mitigating double counting stemming from non-orthogonality and emphasising actual new information present in the measurement. Note that care needs to be taken such that both the measured and predicted values are correctly scaled to each other such that the reconstructed image approaches the true image. This is equivalent to ensuring that the quantity Figure 4. Our approach illustrates the viability of using TEM-inspired phase masks for image reconstruction using a new approach to ghost imaging known as orthogonalised ghost imaging (OGI). This approach is ideal for cases such as six-needles phase mask sets, where the pattern set is not orthogonal. The comparison shows (a) randomised raster scan using traditional ghost imaging (TGI), (b) six-needle phase masks using TGI and (c) six-needle phase masks using the proposed OGI technique.
In each case, the construction was done using a set of 50000 patterns. The target used is a laser cut, 8 spoke shape.
tends to zero. The approach we adopt here to ensure this scaling is to iteratively normalise the signals such that c = b and σ c = σ b . Figure 5. The corresponding radial contrast functions to quantify the resulting reconstruction using OGI-six needles, TGI-six needles phase masks and TGI-raster scans combinations of 50000 patterns. The six-needles patterns are non-orthogonal by nature and the resulting images are of 512 × 512 pixel resolution.
Both algorithms, by principle, deal with noise differently. The TGI algorithm's averaging approach decreases the noise with larger pattern sets. If the illumination budget is unlimited, the noise decreases with increased sampling (as a function of 1/ √ N when N denotes the number of measurements). In contrast, once the OGI algorithm has converged on the image, further measurement will alter the noise but in general will not reduce it. OGI is therefore particularly appropriate for use when the illumination budget is limited. If longer measurements are possible, a relaxation term could be introduced into OGI to slow down convergence and bring its sensitivity to noise in line with TGI, without losing the ability to work with non-orthogonal patterns.

Experimental demonstration of six-needle ghost imaging
The optical analogy investigated in this article is inspired from the charged microtips approach, designed by Matteucci et al. 20 . The six needles (arranged as shown in figure 2) in a simple and elegant geometry allow for the realisation of complicated illumination patterns that can be exploited for image reconstruction techniques and approaches to improve electron microscopy. The needles, to which random voltages are applied, create a spatially structured phase change in the transmitted electron beam, leading to a complicated, spatially structured, point spread function in the far-field that illuminates the sample. In our experiment, the equivalent phase change to that induced by the charged needles is, in the optical regime, created using a liquid crystal spatial light modulator (LC-SLM).
Our experimental apparatus for demonstrating the six-needles approach to computational ghost imaging is shown in figure  1. The expanded output beam from a HeNe laser is shaped using the six-needle phase mask as displayed on the spatial light modulator (SLM) and propagates into the far-field. These phase masks create an intensity distribution in the far-field that illuminates the object. Figure 3 illustrates example holograms generated simulating the six-needles modulation and their corresponding calculated intensity patterns in the far-field.
Reflective SLMs have the advantage of faster response rates and a higher fill factor than those devices based upon transmission. However, these reflective devices are susceptible to manufacturing limitations that result in deviations from flatness of the addressed surface, resulting in aberrations such as astigmatism and defocus. Correction of these distortions is key to accurately manipulating the phase of the incoming light beam. 32,33 . Our approach to aberration correction, adapted from Turtaev et al. 34 , uses a diagonal blazed phase grating with a predetermined periodicity. The aberration-corrected SLM operates in a diffractive mode, and therefore, the masks are combined with a phase-grating to diffract the desired pattern to the first-order which is selected by a pinhole in the Fourier-plane. The chosen order is then propagated through the lens system and into two optical paths ( Figure 1): (a) laser power meter to monitor the laser power for any variations and (b) ghost imaging system (photomultiplier tube, PMT). The PMT is positioned to collect the light after transmission by the object. Based on the known voltage applied to each of the needles and the phase change this creates, the calculation of the far-field intensity distribution and the measured signal are used to reconstruct the image, using the various algorithms described above.
We benchmark the performance of our six-needle approach against a traditional raster scan. Raster scanning is achieved by displaying the appropriate series of linear phase gratings on the SLM to produce a scanning spot in the far-field. The experiment results are presented in figure 4, which gives a visual representation of the TGI and OGI algorithms performance compared to that of a raster scan. Clearly, the non-orthogonal nature of the six-needle pattern sets has significantly degraded the reconstructed image when using the TGI algorithm. By comparison we see that the OGI algorithm allows reconstruction an image with the same resolution as a traditional raster scan. As a more quantitative comparison, the spatial frequency and resolution is assessed using a radial contrast function ( Figure 5). Although the overall optical energy used in the six-needle OGI and the traditional raster scan is the same we note that the peak intensity in six-needle approach is orders of magnitude lower. This reduction would be extremely important in situations where the sample can be damaged by the illumination, especially if that damage mechanism was non-linear with respect to intensity.

Conclusions
We have shown a successful proof-of-principle ghost imaging scheme using the equivalent of a six-needle phase mask of the type that could be implemented in a transmission electron microscopy. Due to the non-orthogonal nature of the far-field intensity pattern produced by the six-needle mask, the reconstruction requires a modified algorithm if image resolution is to be maintained. The results obtained using six-needle mask in the far-field show a comparable reconstruction resolution between the proposed method and a traditional raster scanning with a focused spot. Beyond the work in this article, post-processing and recognition techniques utilising image prior knowledge could be helpful. The phase modulation performed here using a spatial light modulator can be replicated in TEM with a six-needle modulator arrangement that introduces the random changes in phase. Future work will incorporate techniques of compressed sensing in addition to testing the robustness of these phase masks in different signal-to-noise conditions in both optical and electron microscopy regimes.