A new spin on single-pixel imaging: spatial light modulation at megahertz switch rates via cyclic Hadamard masks


 Optical imaging is commonly performed with either a camera and wide-field illumination or with a single detector and a collimated beam that scans the imaged object. Unfortunately, sources that can be collimated and cameras do not exist at all wavelengths and may not always achieve the specifications required for a given application. Single-pixel imaging (SPI) offers an alternative that requires a single detector and may be performed with wide-field illumination, potentially enabling imaging applications in which both the detection and illumination technologies are immature. However, SPI currently struggles with low imaging rates owing to its reliance on configurable spatial light modulators, whose rates do not generally exceed 22 kHz. In this work, we develop an approach towards rapid SPI which relies on cyclic patterns coded onto a spinning mask and demonstrate it for in vivo imaging of C. elegans worms. Spatial modulation rates of up to 2.4 MHz and imaging rates of up to 72 fps are reported, creating new opportunities for using the SPI paradigm in dynamic imaging scenarios.

Optical imaging is commonly performed with either a camera and wide-field illumination or with a single detector and a collimated beam that scans the imaged object. Unfortunately, sources that can be collimated and cameras do not exist at all wavelengths and may not always achieve the specifications required for a given application. Single-pixel imaging 1 (SPI) offers an alternative that requires a single detector and may be performed with wide-field illumination, potentially enabling imaging applications in which both the detection and illumination technologies are immature. However, SPI currently struggles with low imaging rates owing to its reliance on configurable spatial light modulators (SLMs), whose rates do not generally exceed 22 kHz. In this work, we develop an approach towards rapid SPI which relies on cyclic patterns coded onto a spinning mask and demonstrate it for in vivo imaging of C. elegans worms. Spatial modulation rates of up to 2.4 MHz and imaging rates of up to 72 fps are reported, creating new opportunities for using the SPI paradigm in dynamic imaging scenarios.
Digital cameras are one of the most widely used tools in optical imaging today. From mobile phones to advanced microscopy techniques, camera technologies, such as chargecouple devices (CCD) and metal-oxide-semiconductor (CMOS), have revolutionized the world of imaging. Yet, in many applications digital cameras are not an option. Mature camera technology is available only in a small portion of the electromagnetic spectrum and its performance characteristics may limit some applications. For example, time-domain imaging techniques often require response times shorter than 1 ns 2 , whereas in techniques such as full-field optical coherence tomography 3 (OCT) the dynamic range has been limited by camera saturation.
When only a single detector is available, imaging may be performed with collimated or focused illumination that is raster-scanned over the imaged object, while continuously monitoring the detector signal. Raster scanning is the favorable approach in numerous applications, including OCT 4 , multi-photon fluorescence microscopy 5 , and time-of-flight imaging methods 6 . Additionally, raster scanning is common in hybrid imaging techniques in which only the excitation is optical, e.g. optoacoustic 7 and photothermal imaging 8 . While raster-scanning offers more flexibility in detection characteristics than camera-based methods, it imposes more strict limitations on the source. Namely, while cameras can operate with wide-field illumination, raster scanning requires sources with high spatial coherence that enables collimation and focusing.
SPI offers an alternative to camera-based and rasterscanning techniques, which requires only a single detector and wide-field illumination, potentially enabling imaging in fields in which both the source and detection technologies are limited 9 . In SPI, SLMs are used to code the illumination with a set of spatial patterns and the detection is performed with a single detector. The signal from the detector is recorded for each pattern projected on the object, and the image is formed from the signals by an inversion algorithm. SLM-based SPI has been demonstrated in numerous applications in optics 9 , including visible and infrared microscopy 10 , 3D imaging 11,12 , fluorescence microscopy 13 , multi-spectral imaging 14 , multiphoton wide-field imaging 15 , viewing through scattering media 16 as well as in hybrid optically assisted techniques, such as optoacoustic imaging 17 , optical detection of ultrasound 18 and terahertz imaging [19][20][21] .
In addition to its ability to operate with simple sources and detectors, SPI carries the advantage of compatibility with compressed-sensing theory 22,23 : If the coded patterns are properly chosen, an image with N pixels may be reconstructed with fewer-than-N projected pattern. Thus, compressed sensing may facilitate, at least in theory, imaging at higher rates than conventional approaches, which require N measurement for forming an image with N pixels. However, in practice, the benefits of compressed sensing are often marginalized by the slow refresh rate of most SLMs, which cannot compete with the parallel data acquisition of cameras or with the speed of beam-scanning techniques. Specifically, the most common SLMs in the field of SPI are digital micromirror devices (DMDs), which operate at typical rates of up to 22 kHz -insufficient for dynamic imaging scenarios.
Recently, Xu et al. have demonstrated an alternative approach to SPI in which the structured-illumination patterns are created by a matrix of light emitting diodes (LEDs), rather than by using SLMs 24 . By using fast-switching LEDs, rates as high as 500 kHz have been demonstrated. While Xu's approach employs only a single-pixel detector and relies on the mathematical principles of SPI for image formation, it deviates from the SPI paradigm due to its reliance on a multi-pixel source. This difference is not merely semantic. A major advantage of SPI is its general compatibility with any optical source, and this advantage is lost in schemes based on multipixel sources. In the case of complex sources, e.g. femtosecond lasers used in multi-photon microscopy 15 , manufacturing a matrix of individually controlled sources is impractical. Furthermore, in the case of spatially incoherent sources, e.g. LEDs, imaging at microscopic resolutions would require using micron-scale source pixels due to fundamental limitations in focusing spatially low-coherent light. Such dense arrays, if produced with high switching rates and luminance, would involve challenges in both manufacturability and heat dissipation. In the specific implementation of Ref. 24 , an imaging resolution of 270 µm was reported for images with 32×32 pixels. This paper presents a method for ultra-fast SPI and demonstrate it with rates up to 2.4 million pixels per second achieved without compressed-sensing algorithms. Our proposed scheme is based on illuminating a photomask coded with a predetermined binary pattern to spatially modulate the light. Switching between the patterns is performed by rotating the mask. While mechanically switching between different codes would generally lead to low imaging rates 25 , our scheme is based on cyclic codes, in which translation by a single cell leads to a new pattern 26 . Using cyclic codes, N basis functions of a complete, well-conditioned basis can be produced by N single-cell shifts (additional details found in the Supplementary Information). By shrinking the cell size to the scale of the wavelength and employing a fast rotation stage, spatial modulation at megahertz rates is demonstrated for images with up to 25,111 pixels and image-pixel size down to 2 µm.
An illustration of our experimental setup is shown in Fig. 1. The binary codes, consisting of 1's and 0's, were coded in circular pattern on a 6.35 mm thick chrome-coated photomask (Toppan Photomasks). A small portion of the mask, corresponding to a single basis function, was illuminated with a light-emitting diode (LED) operating at 625 nm. The resulting spatial light pattern at the output of the mask was projected onto the imaged sample using objective and tube lenses with a magnification of ×10. The light transmitted through the imaged sample was focused onto a single silicon photodiode. The performance of several masks was tested, with both square and hexagonal cell shapes, with cell widths ranging from 1.5 µm to 5.2 µm. The photomasks were rotated at a constant speed of 540-600 revolutions per minute. For patterns fabricated 55 mm from the center of rotation and a cell size of 1.5 µm, the transition time between two basis function, denoted by T, was approximately 0.43 µs. Since the center of rotation did not fully coincide with the center of the circular patterns, the illumination beam was scanned in synchronization with the mask rotation to minimize the radial drift of the projected pattern. The details of the experimental setup, arrangement of the mask geometries, conversion of 1D code elements into 2D patterns, radial drift compensation, and the variation in cell size due to the changing radius across the pattern are discussed in the Supplementary Information. Fig. 2 shows an example of the measured signal obtained from a resolution mask and an illustration of the reconstruction procedure. To efficiently transform N distinct samples of the measured signal into an image with N pixels, we exploit the cyclic property of the sampling matrix and the fast Fourier transform (Supplementary Information), leading to an image-reconstruction complexity of ( ). Since the model matrix is well-conditioned, no regularization is used in the reconstruction procedure. To fully optimize the signal-tonoise ratio (SNR) of the measurement, the entire signal during the pattern transition time T is used, rather than merely a single discrete sample. Since the transition between neighboring basis functions is gradual, rather than abrupt, we divide the signal during T into M discrete samples, each corresponding to a sub-pixel shift between the mask and imaged object (Fig. 2b). Thus, we obtain M sets of N samples, where each of these M sets is used to reconstruct the N-pixel image (Fig. 2c). Since the M resulting images are not identical, but rather represent slightly shifted versions of the imaged object, the images are first aligned to each other via sub-pixel shifts and then summed to form a single image. The benefit of summing sub-pixel-shifted images in terms of SNR and image contrast is demonstrated in the Supplementary Information. Fig. 3 show representative SPI images obtained by our system under various experimental conditions with imaging rates as high as 2.4 megapixel/sec (the experimental parameters are specified in the Supplementary Information). Figs. 3a-c show binary images of a resolution target (3a and 3b) and the Technion logo (3c), in which the white regions  a. and b. are of a resolution target, c. is a slide the Technion logo, d. is an image of an old photographic film with a photo of flowers (comparison to a camera reference is given in the Supplementary  Information) and e. is a microscopy image of a C. elegans worm. Images a-d have 25k pixels and image e. has 10k pixels. Additional configuration details are found in the Supplementary Information. correspond to full transparency of the imaged objects. To demonstrate the ability of our scheme to produce gray-scale images, we imaged objects that partially absorb or scatter light. For the partially absorbing object, we chose an old photographic film on which a complex image of flowers was captured (Fig. 3d), where for the partially scattering object, a live C. elegans worm was used (Fig. 3e). In both cases, higher levels of absorption or scattering in a given region led to darker pixels in the SPI since less light from that region reached the photodetector.
We demonstrated the capability of our system for dynamic imaging in two distinct scenarios. In the first scenario, the imaged object was a resolution target that was manually scanned in the vertical direction. Imaging was performed with rectangular illumination patters with 101x103 (N=10,403) pixels, where the imaging speed was 72 frames per second (fps). In the second scenario, freely moving C. elegans worms 27 were imaged at 10 fps with hexagonal illumination patterns, where the imaged region was approximately circular and contained N=25,111 pixels. The reconstruction time for a single image ranged from 1.5 ms (for N=10,403) to 4 ms (for N=25,111) of a CPU without parallelization, i.e. shorter than the acquisition time. The details of the imaging procedure, image characteristics, and resulting videos are found in the Supplementary Information, whereas snapshots of the videos are presented in Fig. 4.
In conclusion, we have developed an alternative approach to SPI in which a rapid transition between basis functions is performed by rotating a photomask coded with cyclic patterns. Using our system, imaging rates of up to 2.4 megapixels/s have been achieved -2 orders of magnitude faster than the rates achievable with conventional DMDs -with a high reconstruction efficiency of ( ), enabling real-time performance for both the data acquisition and image reconstruction. Video-rate imaging has been demonstrated with rates up to 72 fps, enabling us to capture the movement of C. elegans worms in vivo. Further increase in the imaging rate may be achieved by using compressed-sensing algorithms (Supplementary Information), but at the expense of potentially slower image reconstruction, with a typical complexity of ( 2 ) even for highly efficient algorithms 28 . To fully exploit the benefits of compressed-sensing theory, it may be beneficial to replace the well-conditioned basis used in this work with a new type of cyclic, or semi-cyclic, basis in which the incoherence is optimized 29 .
In contrast to DMD-based systems, our spatial-modulation scheme is not reconfigurable, and the illumination patterns need to be determined before the production of the mask. However, since the width of the patterns is generally less than a millimeter, tens of patterns may be produced on a single mask, enabling one to switch between different options of image resolution and size. In some cases, the use of photomasks may offer greater flexibility than DMDs, since it enables arbitrary element geometries and sizes that are not configurable on DMDs.
Our rapid modulation scheme and algorithms may be regarded as a new paradigm for SPI, which is not limited by the speed of DMDs, and may enable new applications in fields in which camera technology is limited. In contrast to schemes based on multi-pixel sources 24 , our approach is generic and may be generally used with any optical source or generalized to other wave-based imaging fields by producing appropriate masks for those applications, e.g. thin acoustic blockers in the case of ultrasound 30 or printed circuit boards for terahertz imaging 31 . Alternatively, our scheme may be generalized to other fields by using elements that convert from optics to the field of interest. For example, it has been demonstrated that illuminating a highly resistive silicon wafer with spatially modulated light can enable the spatial modulation of a terahertz beam transmitted through the wafer 21 . With recent advancements in terahertz SPI, the speed of such systems is currently limited by the rates of DMDs, and thus may be improved by using our scheme.
Since the imaging speed of our approach is mainly limited by the speed of the scanning apparatus and bandwidth of the detector and acquisition system, it may, in principle, achieve the high imaging rates of raster-scanning techniques. For example, by using acousto-optic modulators, which can perform line scans at a typical rate of 100 MHz 32 , and fast detectors with gigahertz bandwidths, imaging at rates of several gigapixels per second may be possible, transforming SPI into a high-performance method for dynamic imaging.