Computational field-resolved coherent chemical imaging

Shupeng Zhao, Lea Chibani, Edward Chandler, Fangyu Liu, Jianqi Hu, Lorenzo Valzania, Ulugbek Kamilov, Hilton B. de Aguiar

► To cite this version:

Shupeng Zhao, Lea Chibani, Edward Chandler, Fangyu Liu, Jianqi Hu, et al.. Computational field-resolved coherent chemical imaging. Nature Communications, 2025, 16 (1), pp.7406. 10.1038/s41467-025-62716-8 . hal-05210265

HAL Id: hal-05210265

https://hal.science/hal-05210265v1

Submitted on 18 Nov 2025

**HAL** is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>
Computational field-resolved coherent
chemical imaging

Shupeng Zhao<sup>1,*</sup>, Lea Chibani<sup>1</sup>, Edward Chandler<sup>2</sup>, Fangyu Liu<sup>3</sup>, Jianqi Hu<sup>1</sup>, Lorenzo Valzania<sup>1</sup>, Ulugbek S. Kamilov<sup>2</sup>, and Hilton B. de Aguiar<sup>1,†</sup>

<sup>1</sup>Laboratoire Kastler Brossel, ENS-Université PSL, CNRS, 24 rue Lhomond, 75005 Paris, France

<sup>2</sup>Washington University in St. Louis, MO 63130, USA

<sup>3</sup>Department of Precision Instruments, Tsinghua University, Beijing
100084, China

*Corresponding author: spzhao0724@gmail.com

†Corresponding author: h.aguiar@lkb.ens.fr

Abstract

Coherent Anti-Stokes Raman Scattering (CARS) has found critical applications across various fields, including high-speed chemical imaging, material science, and biomedical diagnostics. However, the inherent coherent nature of CARS poses challenges for quantitative chemical imaging due to the loss of spectral phase information. Accessing such information would enable faster chemical imaging speed through computational methods. Here, we develop a robust reference-less interferometric broadband pump/probe CARS to retrieve the vibrational spectral phase. We transfer the computational phase retrieval concept from quantitative spatial phase imaging (QPI) to frequency-domain spectroscopy. We then unlock and demonstrate the concept of supervised compressive CARS microscopy, enabling artifactless high-speed quantitative chemical imaging.

**Introduction**

Raman imaging is a simple, label-free technique that utilizes the unique vibrational spec-
tra of substances as molecular fingerprints [1]. It has been widely applied in various
biological fields, such as chemically selective imaging of cells [2–5] and spectroscopic
detection of pathologies [6], bacteria [7], and algae [8]. However, spontaneous Raman
imaging is inherently weak, and managing the large hyperspectral datasets it generates is
particularly challenging with large biological specimens. To accelerate imaging speed, it
is essential to enhance signal levels. Coherent Raman scattering can boost signal strength
by several orders of magnitude by leveraging the nonlinear molecular response to multiple
pulsed laser excitation fields [9–11], as seen in Coherent Anti-Stokes Raman Scattering
(CARS) [12] and stimulated Raman scattering (SRS) [13], which enable the coherent
excitation of specific vibrational states.
However, even with strong signal levels, the excessive data throughput in video-rate hyperspectral imaging still makes real-time data acquisition and processing extremely challenging [14]. The concept of compressive Raman [15–21] imaging, which leverages strong prior knowledge of the system, can significantly reduce the amount of sampling required for imaging [22–25]. In the supervised compressive imaging case, the spectra of pure chemicals are known priors, and the goal is simply to detect the presence or quantity of a specific chemical in an unknown mixture. Since both spontaneous Raman [22, 23, 25] and SRS [24] are considered incoherent processes (from a mathematical point-of-view), implementing supervised approaches based on these techniques is relatively straightforward and has already been demonstrated in several studies to significantly speed up chemical imaging [26–28]. However, while CARS is generally easier to implement than SRS from a hardware perspective, it presents more challenges for supervised compressive methods due to its coherent nature.

<figure><img src="image_2.png" /><figcaption>**Figure 1:** **Principle of field-resolved spectroscopy.** A The concentration of the chemicals *c* is proportional to the magnitude of Im{χ<sub>ω</sub><sup>(3)</sup>} However, two chemicals with the same concentration produce completely different |χ<sub>ω</sub><sup>(3)</sup>|<sup>2</sup> spectra when mixed at different phases. B The energy level diagram of the proposed method: the broadband probe beam E<sub>pr</sub> generates the necessary interference for phase retrieval. Each probe component, ω<sub>pr</sub>, excites and spectral shifts χ<sub>ω</sub><sup>(3)</sup> spectra (shifted by the amount of ω<sub>pr</sub>), with the resulting spectrum as an interference pattern from all these shifted components. C Schematic of the setup: DMD, Digital Micromirror Device; PBS, Polarizing Beam Splitter; GM system, Galvo-Mirror System; PMT, Photomultiplier Tube. D The signal collection process of the proposed interferometric method is shown. By modulating the pump/probe spectrum with a DMD, all elements in the target spectrum, χ<sub>ω</sub><sup>(3)</sup>(j), is sequentially turned on and interfere with a reference frequency component χ<sub>ω</sub><sup>(3)</sup>(ref) to retrieve the spectral phase. E The signal acquisition process for the frequency-domain phase retrieval algorithm based on interference is illustrated. To boost the signal strength, a series of random binary masks are applied to the DMD, resulting in the anti-Stokes signal undergoing multiple random interferences. The χ<sub>ω</sub><sup>(3)</sup> is then obtained by solving the inverse problem of the forward model in Eq.1. F The reconstructed complex χ<sub>ω</sub><sup>(3)</sup> using D and E.</figcaption></figure>

The challenge in CARS is the loss of spectral phase information. Furthers complica-
tions arise from interference within the vibrational response and with the non-resonant (NR) background, leading to quantitative artifacts [29]. When different chemicals are mixed, their complex spectra of the third-order nonlinear susceptibility $\chi_{\omega}^{(3)}$ interfere with each other in phase-dependent ways, as shown in Fig. 1A. However, the concentration of the chemicals is only proportional to the imaginary part of $\chi_{\omega}^{(3)}$, so detecting $|\chi_{\omega}^{(3)}|^2$ alone is insufficient for quantitative chemical analysis.

To retrieve phase information, numerical phase recovery methods based on Kramers-Kronig (KK) transformations [30] and the Maximum Entropy Method (MEM) [31] have been proposed. However, since these methods rely on having access to at least one complete Lorentzian line shape, they cannot be applied to supervised compressive methods that involve very limited sampling.

Similarly, time-domain methods can access the field [32, 33], but are only available in unsupervised compressive methods [34]. An alternative to retrieve the phase is to introduce an external reference [35–39] or multiple internal references [40, 41]. However, these require complex experimental setups with interferometric stability. Single-pulse CARS has a simpler setup [42–46], but its forward model is too complicated, making accurate phase retrieval very challenging. Although some studies have achieved estimates of $\chi_{\omega}^{(3)}$ under certain approximations [47, 48], the need for a spectrometer prevents these methods to be extended to supervised compressive methods. To summarize, we need a general method that can access the spectral field and enable supervised compressive approaches.

Therefore, in this work, we propose a field-resolved CARS method using a single pulse shaper. Inspired by quantitative phase imaging (QPI) techniques in spatial domain, the vibrational phase of molecules can be retrieved through both analytical interferometric methods (Fig. 1D) and computational phase retrieval algorithms (Fig. 1E). Furthermore, since our hardware implementation relies on single-pixel detection rather than a spectrometer, we can directly integrate supervised compressive Raman concepts [21, 49] into our proposed phase retrieval model, enabling high-speed chemical imaging.

# Results

## Fundamental physical principle

We start by introducing the mathematical framework underlying the physical principle. In conventional broadband CARS [50], a narrowband pump/probe beam and a broadband Stokes beam are typically used and the anti-Stokes field spectrum can be described by $[42, 51]$, $E_{as} = [(E_s \star E_p) \cdot \chi_{\omega}^{(3)}] * E_{pr}$, where $\chi_{\omega}^{(3)}$ represents susceptibility vector and $E_p, E_s, E_{pr}$, and $E_{as}$ denote the field spectrum at the pump, Stokes, probe, and anti-Stokes frequencies, respectively. Here, $\star$ denotes element-wise multiplication, $*$ represents convolution, and $\star$ indicates cross-correlation: because the probe beam is narrowband, no interference exists among different Raman shifts, therefore preventing the retrieval of the spectral phase from $\chi_{\omega}^{(3)}$. To retrieve the spectral phase, we chose the opposite approach: a narrowband Stokes beam and a broadband pump/probe beam, with energy levels addressed schematically shown in Fig. 1B. In this way, each probe component $\omega_{pr}$ excites a shifted $\chi_{\omega}^{(3)}$ spectrum (red-shifted by the amount of $\omega_{pr}$), and the resulting $E_{as}$ is the coherent sum of all these components. By carefully selecting the appropriate pump/probe components, we can induce the desired interference in the generated $E_{as}$, thus allowing for the retrieval of spectral phase information.
We demonstrate this interference effect analytically. Fig.1C shows the simplified version of the setup we used in the experiment. A folded digital micromirror device (DMD)-based pulse shaper is placed in the pump/probe path for frequency selection. After the two beams are combined, they reach the sample through a galvanometric mirror system for raster scanning, with the CARS signal detected with a Photomultiplier Tube (PMT) in the forward direction. To simplify the analysis, we assume the Stokes beam is a delta function in the frequency domain, while the pump/probe beam is considered constant. For this spectral sampling scheme, the corresponding forward model is:

$$I_i = \sum_{\omega} |(\chi_{\omega}^{(3)} \cdot M_i) * M_i|^2 \quad (1)$$

where $M_i \in \mathbb{R}^{N_{\omega} \times 1}(N_{\omega}$ is the frequency dimension) represents the mask applied to the DMD, which is a vector composed of 1 and 0. $\chi_{\omega}^{(3)} \in \mathbb{C}^{N_{\omega} \times 1}$ represents the third-order susceptibility to be determined. $I_i$ represents intensity measurement corresponding to the i-th DMD mask. From this forward model, the phase of $\chi_{\omega}^{(3)}(j)$ relative to a reference frequency $\chi_{\omega}^{(3)}(\text{ref})$ can be easily derived:

$$\arg(\chi_{\omega}^{(3)}(j)) = \arccos\left(\frac{I_{\times} - 2I_{\text{ref}} - 2I_{j}}{2\sqrt{I_{\text{ref}}}\sqrt{I_{j}}}\right) \quad (2)$$

$I_{\text{ref}}$, $I_j$, and $I_{\times}$ represent the measured signals when the reference frequency, the j-th frequency, and both the reference and j-th frequencies are activated on the DMD, respectively. Therefore, by making each $\chi_{\omega}^{(3)}(j)$ interfere with $\chi_{\omega}^{(3)}(\text{ref})$, we can obtain the ground truth of $\chi_{\omega}^{(3)}$ before applying any computational approach. We refer to this scheme henceforth as interferometric method.

### Energy efficient approach through multiplexing

To improve energy efficiency and signal strength, we use a broadband approach with a spectrally-random amplitude-binary excitation modulation. The interferometric method we propose above retrieves the phase of $\chi_{\omega}^{(3)}$ in a straightforward and clean manner. However, it remains narrowband with a low signal level, as shown in Fig.1D. By employing this multiplexed strategy, we are able to detect a stronger signal, as demonstrated in Fig.1F. To extract $\chi_{\omega}^{(3)}$ from this enhanced signal, we develop a gradient descent-based algorithm (Alg.1) to reconstruct $\chi_{\omega}^{(3)}$ by solving the inverse problem of the forward model (Eq.(1)). Just as in spatial phase imaging, where the signal can be reconstructed using phase retrieval algorithms [52] instead of interferometry [53], the Alg.1 corresponds to such a phase retrieval approach, however applied to the one-dimensional spectral problem. Unlike traditional phase retrieval methods in coherent Raman spectroscopy, which are ineffective when the spectral range is limited, our approach is based on interferometry, establishing it as a “true” phase retrieval technique, in the sense that the phase information is not lost (as it is the case in traditional methods).

### A framework for complex-valued supervised compressive Raman imaging

To enable high-speed quantitative chemical imaging, we introduce the well-established concept of supervised compressive Raman, commonly used in spontaneous Raman and SRS, to this CARS framework. Our method treats the spectra of pure chemicals as a known matrix $\chi_{\text{spec}}^{(3)}$ and incorporates it into the generalized forward model. To generalize the proposed phase retrieval approach to the entire spatial-spectral domain, we modify the
forward model in Eq.1 to encompass the full hyperspectral susceptibility matrix $\chi_{\omega,s}^{(3)} \in \mathbb{C}^{N_{\omega} \times N_s}$ ($N_s$ is the spatial dimension) as follows:

$$I_{i,s} = \sum_{\omega} |(\chi_{\omega,s}^{(3)} \cdot \mathbf{M}_i) * \mathbf{M}_i|^2 \quad (3)$$

where $\chi_{\omega,s}^{(3)} \cdot \mathbf{M}_i$ denotes the element-wise multiplication of the vector $\mathbf{M}_i$ with each column of the matrix $\chi_{\omega,s}^{(3)}$. The symbol $*$ represents convolution along the spectral dimension (column-wise). As noted in the literature, spontaneous Raman hyperspectral images can be represented as low-rank matrices [15, 25], where the rank is equal to the number of species. Similarly, in CARS, the rank $r$ is equal to the number of species plus one (due to the presence of non-resonant component). Therefore, $\chi_{\omega,s}^{(3)}$ can be represented as $\chi_{\text{spec}}^{(3)} \times \mathbf{C}_{\text{image}}$, where $\times$ denotes matrix multiplication. Here, $\chi_{\text{spec}}^{(3)} \in \mathbb{C}^{N_{\omega} \times r}$ represents the $r$ complex eigenspectra, and $\mathbf{C}_{\text{image}} \in \mathbb{R}^{r \times N_s}$ represents the $r$ non-negative eigenimage, where $N_s$ is the size of the spatial dimension. We propose Alg.2, which is still based on gradient descent, to solve this inverse problem and obtain only the eigenimage $\mathbf{C}_{\text{image}}$. Although the eigenimage is real, the forward model involves complex signals, and we only detect intensity information. Therefore, this still constitutes a phase retrieval problem. Alg.2 requires a measurement quantity at each spatial point comparable to $r$, allowing for accurate reconstruction of the eigenimage while significantly reducing data throughput.

<figure><img src="image_3.png" /><figcaption>Figure 2: **Interferometric method.** A Spectral masks used for the acquisition procedure (leftmost panel). Reconstructed complex-valued third-order spectral susceptibility, $\chi_{\omega}^{(3)}$, in the C-H stretch region for three chemical species: Dimethyl Sulfoxide (DMSO), Polymethyl Methacrylate (PMMA), and Polystyrene (PS). **B** Hyperspectral imaging of a mixture with these three species, with the resulting $\chi_{\omega,s}^{(3)}$ decomposed into eigenimages by using eigenspectra. “Intensity” serves as the reference imaging result of the mixture under broad-band pump/probe excitation.</figcaption></figure>

154 Proof-of-concept experiments
To demonstrate the system’s capability to measure phase, we first perform experiments on well-established chemical standards using both approaches. We start by verifying the interferometric method to reconstruct the third-order susceptibility $\chi_{\omega}^{(3)}$, and also obtain ground truths for the multiplexed approach, in the C-H region for three different species: Dimethyl Sulfoxide (DMSO), Polymethyl Methacrylate (PMMA), and Polystyrene (PS), as shown in Fig. 2A. The blue, red and black curves represent the real part, the imaginary part, and the absolute value of $\chi_{\omega}^{(3)}$, respectively. The reconstructed real part indicates a noticeable level of non-resonant background. The spectrum resolution is close to $14 \text{ cm}^{-1}$ here. To further demonstrate that the approach can be extended to the entire spatial and frequency domains, we perform hyperspectral imaging on the mixture of the three species. To verify the accuracy of the method, we left-multiply the eigenspectrum matrix $\chi_{\text{spec}}^{(3)}$ with $\chi_{\omega,s}^{(3)}$ to obtain the eigenimages of DMSO, PMMA, PS, and the non-resonant background, which are shown in Fig. 2B. Note that $\chi_{\text{spec}}^{(3)}$ contains four spectra (the presence of the NR background increases the rank by one), which are the three spectra shown in Fig. 2A without the non-resonant background, along with the non-resonant background itself, represented as a real constant. Additionally, the CARS intensity imaging under broadband pump excitation for the mixture is provided as a reference in Fig. 2B (the “Intensity” image.).

We verify the accuracy of the multiplexed approach. In order to increase the signal level, we propose a multiplexed frequency-domain phase retrieval method, inspired by techniques from the field of spatial phase imaging. By applying a series of random binary masks onto the DMD, we achieve multiplexed utilization of the pump/probe beams, which still maintains the corresponding random interference intensities. By feeding these data into the iterative Alg. 1, the complex $\chi_{\omega}^{(3)}$ can be accurately retrieved. Similarly to spatial phase retrieval algorithms, Alg. 1 requires $4N_{\omega}$ random measurements, where $N_{\omega}$ is the length of the vector $\chi_{\omega}^{(3)}$. Fig. 3A show the reconstructed $\chi_{\omega}^{(3)}$ for four liquids: acetonitrile (ACN), DMSO, ethanol, and pentadecane. The blue, red and black curves represent the real part, the imaginary part, and the absolute value of $\chi_{\omega}^{(3)}$, respectively. The real part is slightly above zero, indicating that some NR background remains here. Compared to interferometric methods, this approach makes more efficient use of laser energy, leading to significantly stronger signal intensities. As a result, we can achieve high-resolution spectra with a resolution halved from the interferometric approach (close to $7 \text{ cm}^{-1}$). This phase retrieval method can be applied point by point in space to reconstruct the entire hyperspectral complex matrix $\chi_{\omega,s}^{(3)}$, but the process can be time-consuming. In the supplementary information, we propose an accelerated algorithm that exploits the low-rank structure of $\chi_{\omega,s}^{(3)}$, significantly reducing the reconstruction time.
<figure><img src="image_4.png" /><figcaption>**Figure 3: Multiplexed phase retrieval and supervised compressive imaging.** A Reconstructed third-order susceptibility $\chi_{\omega}^{(3)}$ for four different liquids: acetonitrile (ACN), dimethyl sulfoxide (DMSO), ethanol, and pentadecane, obtained using the multiplexed phase retrieval method. **B** In the supervised compressive imaging, the low-rank structure of the complex-valued hyperspectral matrix $\chi_{\omega,s}^{(3)}$ is leveraged (top left panel). The first row of **B** displays three complex-valued spectra composing the columns of the known $\chi_{\text{spec}}^{(3)}$ matrix for bovine serum albumin (BSA), pentadecane, and the non-resonant (NR) background, respectively. The second row shows the corresponding real-valued images composing the rows of the retrieved $C_{\text{image}}$ (using Alg.2). To retrieve $C_{\text{image}}$, four masks spectral masks are needed and representative examples are illustrated (right most panel). The “Intensity” serves as the reference imaging result under broad-band pump/probe excitation.</figcaption></figure>

Having established the physical principles, we demonstrate a supervised complex-valued compressive Raman approach to further increase imaging speeds. To tackle the challenge of excessive data throughput, a common issue in hyperspectral imaging [14], we incorporate the concept of supervised compressive Raman imaging into our existing phase retrieval model. As shown in Fig. 3B, in supervised compressive imaging the low-rank structure of the hyperspectral complex matrix $\chi_{\omega,s}^{(3)}$ plays a crucial role in data compression. In the proposed Alg.2, the eigenspectrum matrix $\chi_{\text{spec}}^{(3)}$ is treated as a known input, while only the eigenimage matrix $C_{\text{image}}$ is solved. To verify its feasibility, weimerse a bovine serum albumin (BSA) crystal in pentadecane and only use four different random masks on the DMD (the right part in Fig. 3B) to sample the mixture. The input eigenspectrum matrix, shown in the top row of Fig. 3B, consists of three columns
corresponding to the complex eigenspectra of BSA, pentadecane, and NR, respectively. They are obtained from the phase retrieval method, where the real part has already been adjusted by subtracting the constant NR background. The eigenimages $C_{\text{image}}$, reconstructed using Alg.2, are presented in the bottom row in Fig.3B, with a corresponding effective pixel dwell time of 80 µs. The CARS intensity imaging result of the sample mixture under broadband pump excitation is also shown as a reference (the “Intensity” image.).

## Bio-imaging compatibility

We showcase the proposed methods for biological samples chemical imaging. Pig ear tissue is analyzed using the interferometric methods in Fig.4A. The “Intensity” shows a reference broadband pump/probe imaging result. Non-negative matrix factorization (NMF) is applied to the imaginary part of $\chi_{\omega,s}^{(3)}$, obtained from the interferometric method, resulting in the “Merged” eigenimage and eigenspectrum (“Imag” curve). In these images, red indicates lipid-rich regions, and blue indicates protein-rich regions. Next, the analysis is extended to pig ear skin, as shown in Fig.4B. The “Intensity” provides a reference imaging result, while the “Merged” presents the composite image generated using NMF on the interferometric method’s data. Three distinct regions are identified: lipid-rich (red), protein-rich (blue), and water-rich (green). By averaging the $\chi_{\omega}^{(3)}$ in each region separately, the real part and the imaginary part are obtained as shown in “Real” and “Imag” curves, respectively. The result shows that the lipid spectrum in the skin differs from that in the internal tissues of the pig ear. Due to the very small phase variations of water in this region, our system cannot detect these phase changes, and thus the water spectrum appears in the real part of the $\chi_{\omega}^{(3)}$. We also applied the proposed supervised compressive Raman method to the pig ear tissue. The complex eigenspectra of protein and lipid required for the supervised method are obtained using the interferometric method on the same type of tissue, but from a different sample. Fig.4C shows the results of supervised compressive Raman microspectroscopy, achieved using only five random masks (See Fig.S1 in Supplementary Information for more details). The effective pixel dwell time is 100 µs. The “Intensity” here provides a reference broadband imaging result.
<figure><img src="image_5.png" /><figcaption>Figure 4: **Biological specimens imaging.** A Pig ear tissue is analyzed using the interferometric method. The “Intensity” image shows the reference broadband pump/probe imaging result, while the “Merged” image is generated using non-negative matrix factorization (NMF) applied to the imaginary part of the obtained $\chi_{\omega,s}^{(3)}$. In the “Merged” image, red corresponds to lipid-rich regions, and blue protein-rich regions. (bottom most) Eigenspectrums obtained through NMF, distinguishing between lipid- and protein-rich species. B Pig ear skin is further analyzed using the interferometric method. In this example, three distinct ROI are detected: lipid-rich (red), protein-rich (blue), and water-rich (green). C Supervised compressive Raman imaging applied to pig ear tissue. The complex-valued eigenspectra of protein and lipid, obtained from a separate sample, are used as inputs to Alg.2. The “Merged” image is reconstructed using only five random spectral masks, with an effective pixel dwell time of 100 µs, and the “Intensity” image serves as a reference broadband imaging result.</figcaption></figure>

Discussion

232

233

234

235

In this study, we introduced a computational field-resolved CARS approach that leverages interferometry in the frequency domain to achieve precise phase retrieval, addressing a major challenge in traditional CARS. Using a relatively simple setup, we successfully
retrieved the phase of the susceptibility $\chi_{\omega}^{(3)}$ through both analytical and computational algorithms, enabling quantitative chemical imaging.

In the analytical method, the range of $\arg(\chi_{\omega}^{(3)})$ is restricted to $[0, \pi]$ due to the analyticity of $\chi_{\omega}^{(3)}$. This allows the use of an amplitude modulation device like a DMD, without requiring an SLM for phase stepping, as the arccos function is monotonic within this range. This demonstrates that, unlike in spatial quantitative phase imaging where the use of a KK transformation requires imposing more constraints on the signal (a stronger reference signal) [54–56], measuring KK-compliant signals through interference is actually easier than spatially-based interferometric phase imaging. The phase retrieval method based on random spectral masks on the excitation fields significantly enhances the signal level, but also increases the complexity of the forward model, making it difficult to find an analytical solution. However, with the surge in computational power driven by advancements in machine learning, analytical solutions are no longer a necessity. Instead, we can achieve highly accurate results using iterative phase retrieval algorithms. By incorporating the constraint that the phase to be recovered is limited to 0 to $\pi$ in each iteration can lead to faster algorithm convergence.

In regards to the supervised compressive CARS approach, although the eigenimage to be solved for is real, it involves a forward model with complex signals and, since we only detect intensity, remains a phase retrieval problem. Therefore, methods based on conventional BCARS systems (broadband Stokes and narrowband pump/probe) cannot, in principle, achieve a quantitative compressive supervised approach [57], as no controllable interference occurs in these systems. However, in our setup, we can excite with deterministic spectral profiles on the pump/probe spectrum: this conditioning act as “support constraints” [52] which is essential for enabling phase retrieval or compressive sensing in coherent systems. We have demonstrated the quantitative supervised compressive CARS in experiments with excellent performance, marking an important step toward high-speed chemical imaging.

Unlike traditional phase retrieval methods such as KK and MEM, which require a substantial non-resonant background to ensure numerical stability, our approach benefits from an internal local oscillator approach. This is provided by a stable interference among resonant components without the need to have necessarily a non-resonant contribution, still allowing for accurate phase retrieval. Additionally, our system employs a single-pixel detector, which is highly compatible with biomedical imaging applications, as it eliminates the need for a spectrometer, making it ideal for imaging opaque specimens. While the current implementation focuses on single-pixel detection, our method can be readily extended to wide-field CARS [58–60], opening up broader applications in high-speed, high-resolution quantitative chemical imaging.

# Method

## Experimental setup and sample preparation

The complete setup is illustrated in Fig.S3 in the supplementary information. The source used (Light Conversion I-OPA) outputs both pump and Stokes beams with a repetition rate of 2 MHz. The pump beam has a pulse duration of 60 fs, with a central wavelength around 790 nm (tunable), and the picosecond Stokes pulse has a central wavelength of 1030 nm, achieved through a pulse shaper with a fixed slit. For the tunable pulse shaper in the pump arm, we use a DMD (DLP7000). Additionally, a photodetector (Thorlabs
DET100A/M) is included in this arm to monitor the pump beam intensity. After the two beams are combined, they pass through a galvanometric mirror scanning system (Thorlabs GVS001 ×2) before entering the microscope body. Two identical objectives (Nikon LWD-PF 16X/0.8) are used for sample illumination and for collecting the CARS signal, which is directed towards a PMT (Hamamatsu C14455). Additional filters placed in front of the PMT (Thorlabs FESH0700 ×2) ensure that only the CARS signal is detected. To reduce noise in the PMT signal, a lock-in amplifier (Zurich, MFLI 500kHz/5MHz) synced with the laser is used for signal collection. DMD and galvanometric mirrors are synchronized by a data acquisition board (NI, USB-6356).

Samples were cast in a coverslip and sealed with another coverslip. PMMA (15 µm, Microparticles) and PS (20 µm, Microparticles) beads were dropcast on the coverslip and filled with DMSO (Sigma-Aldrich). The pig ear tissue and skin used in the experiment are purchased from a local supermarket.

## Reconstruction details

In order to reconstruct $\chi_{\omega}^{(3)}$ in Eq.1. The Alg.1 is proposed to solve the following optimization problem:

$$ \min_{\chi_{\omega}^{(3)}} f, \quad \text{with} \quad f = \sum_{i=1}^{m} \left| I_i - \sum_{\omega} \left| \left( \chi_{\omega}^{(3)} \cdot \mathbf{M}_i \right) * \mathbf{M}_i \right|^2 \right|^2 \quad (4) $$

Here, $\mathbf{M}_i$ represents the resulting random binary vector loaded onto the DMD, after modulated by the spectrum of the pump. The pump spectrum is predetermined based on measurements from the photodetector in the pump arm. And $m$ represents the number of mask we used, for the result in Fig.3A, $m = 4N_{\omega}$, and $N_{\omega} = 30$. We randomly initialize the $\chi_{\omega}^{(3)}$ from a Gaussian distribution. The gradient $\frac{\partial f}{\partial \chi_{\omega}^{(3)}}$ is automatically computed using PyTorch's autograd functionality. In each iteration, we force the imaginary part of $\chi_{\omega}^{(3)}$ to zero to constrain the phase variation of $\chi_{\omega}^{(3)}$ within a range of $\pi$ instead of $2\pi$. This speed up the algorithm's convergence. The reconstruction of Alg.1 takes less than 10 seconds on GPU.

### Algorithm 1 Phase Retrieval of $\chi_{\omega}^{(3)}$

1: **Input:** Number of iterations $n$, step size $\eta$, measurements $I_i$, masks $\mathbf{M}_i$

2: Random Initialization of $\chi_{\omega}^{(3)}$

3: **for** $i = 1$ to $n$ **do**

4: $\chi_{\omega}^{(3)} \leftarrow \chi_{\omega}^{(3)} - \eta \frac{\frac{\partial f}{\partial \chi_{\omega}^{(3)}}}{\left\| \frac{\partial f}{\partial \chi_{\omega}^{(3)}} \right\|_2}$

5: Clip Imag($\chi_{\omega}^{(3)}$) to min = 0

6: **end for**

7: Return $\chi_{\omega}^{(3)}$

In order to reconstruct only eigenimages $\mathbf{C}_{\text{image}}$ in the supervised method, Alg.2 is proposed to solve the following optimization problem:

$$ \min_{\mathbf{C}_{\text{image}}} f, \quad \text{with} \quad f = \sum_{i=1,s=1}^{m,N_s} \left| I_{i,s} - \sum_{\omega} \left| \left[ (\chi_{\text{spec}}^{(3)} \times \mathbf{C}_{\text{image}}) \cdot \mathbf{M}_i \right] * \mathbf{M}_i \right|^2 \right|^2 \quad (5) $$
where *m* represents the number of random masks used at each spatial point. The same set of masks is applied to every point in space. For the results in Fig.3B, *m* = 4, while in Fig.4C, *m* = 5. *N*<sub>s</sub> = 100 × 100 is the dimension of each eigenimages. The gradient $\frac{\partial f}{\partial C_{\text{image}}}$ is automatically computed using PyTorch's autograd functionality. We force each element of the $C_{\text{image}}$ to be positive in each iteration because the eigenimages should not contain negative values. The reconstruction of Alg.2 takes less than 1 minute on GPU.

The gradient descent algorithms presented here (Alg.1 and Alg.2) can also be referred to as physics-informed neural networks [61]. Both algorithms operate as offline methods, where the required input data is collected in a single acquisition. The computational resource we use: GPU, 2 Nvidia GeForce RTX 2080 Ti; RAM, 64 GB.

<caption>**Algorithm 2** Phase Retrieval of $C_{\text{image}}$</caption>

1: **Input:** Number of iterations *n*, step size *η*, measurements $I_{i,s}$, masks $M_i$, eigenspecrum $\chi_{\text{spec}}^{(3)}$
2: Random Initialization of $C_{\text{image}}$
3: **for** *i* = 1 to *n* **do**
4: &nbsp;&nbsp;&nbsp;&nbsp;**C**_{image} ← **C**_{image} − η $\frac{\frac{\partial f}{\partial C_{\text{image}}}}{\left\|\frac{\partial f}{\partial C_{\text{image}}}\right\|_2}$
5: &nbsp;&nbsp;&nbsp;&nbsp;Clip **C**_{image} to min = 0
6: **end for**
7: Return $C_{\text{image}}$

## Code and data available

The code for Alg.1 and Alg.2, along with some experimental data, is available at:
https://github.com/spzhao0724/Frequency-domain-Phase-retrieval

## Funding information

This work was funded by the grants ANR-21-CE42-0013. L.V. acknowledges funding from the Swiss National Science Foundation (project P400P2_199329).

## References

[1] Dustin W Shipp, Faris Sinjab, and Ioan Notingher. Raman spectroscopy: techniques and applications in the life sciences. *Advances in Optics and Photonics*, 9(2):315–428, 2017.

[2] Walter Müller, Martin Kielhorn, Michael Schmitt, Jürgen Popp, and Rainer Heintzmann. Light sheet raman micro-spectroscopy. *Optica*, 3(4):452–457, 2016.

[3] Masaya Okada, Nicholas Isaac Smith, Almar Flotildes Palonpon, Hiromi Endo, Satoshi Kawata, Mikiko Sodeoka, and Katsumasa Fujita. Label-free raman observation of cytochrome c dynamics during apoptosis. *Proceedings of the National Academy of Sciences*, 109(1):28–32, 2012.
[4] Katharina Klein, Alexander M Gigler, Thomas Aschenbrenner, Roberto Monetti, Wolfram Bunk, Ferdinand Jamitzky, Gregor Morfill, Robert W Stark, and Jürgen Schlegel. Label-free live-cell imaging with confocal raman microscopy. *Biophysical journal*, 102(2):360–368, 2012.

[5] Christian Matthäus, Tatyana Chernenko, Judith A Newmark, Carol M Warner, and Max Diem. Label-free detection of mitochondrial distribution in cells by nonresonant raman microspectroscopy. *Biophysical journal*, 93(2):668–673, 2007.

[6] Michael Jermyn, Kelvin Mok, Jeanne Mercier, Joannie Desroches, Julien Pichette, Karl Saint-Arnaud, Liane Bernstein, Marie-Christine Guiot, Kevin Petrecca, and Frederic Leblond. Intraoperative brain cancer detection with raman spectroscopy in humans. *Science translational medicine*, 7(274):274ra19–274ra19, 2015.

[7] Björn Lorenz, Christina Wichmann, Stephan Stöckel, Petra Rösch, and Jürgen Popp. Cultivation-free raman spectroscopic investigations of bacteria. *Trends in microbiology*, 25(5):413–424, 2017.

[8] Q Wu, WH Nelson, P Hargraves, J Zhang, CW Brown, and JA Seelenbinder. Differentiation of algae clones on the basis of resonance raman spectra excited by visible light. *Analytical chemistry*, 70(9):1782–1787, 1998.

[9] Ji-Xin Cheng and Xiaoliang Sunney Xie. *Coherent Raman scattering microscopy*. CRC press, 2016.

[10] Hervé Rigneault and Pascal Berto. Tutorial: Coherent raman light matter interaction processes. *Apl Photonics*, 3(9), 2018.

[11] Charles H. Camp Jr. and Marcus T. Cicerone. Chemically sensitive bioimaging with coherent raman scattering. *Nature Photonics*, 9:295–305, 2015.

[12] Ji-Xin Cheng and X Sunney Xie. Coherent anti-stokes raman scattering microscopy: instrumentation, theory, and applications, 2004.

[13] Christian W Freudiger, Wei Min, Brian G Saar, Sijia Lu, Gary R Holtom, Cheng-wei He, Jason C Tsai, Jing X Kang, and X Sunney Xie. Label-free biomedical imaging with high sensitivity by stimulated raman scattering microscopy. *Science*, 322(5909):1857–1861, 2008.

[14] Motoki Yako, Yoshikazu Yamaoka, Takayuki Kiyohara, Chikai Hosokawa, Akihiro Noda, Klaas Tack, Nick Spooren, Taku Hirasawa, and Atsushi Ishikawa. Video-rate hyperspectral camera based on a cmos-compatible random array of fabry–pérot filters. *Nature Photonics*, 17(3):218–223, 2023.

[15] Haonan Lin, Chien-Sheng Liao, Pu Wang, Nan Kong, and Ji-Xin Cheng. Spectroscopic stimulated raman scattering imaging of highly dynamic specimens through matrix completion. *Light: Science & Applications*, 7(5):17179–17179, 2018.

[16] Dong Wei, Shuo Chen, Yi Hong Ong, Clint Perlaki, and Quan Liu. Fast wide-field raman spectroscopic imaging based on simultaneous multi-channel image acquisition and wiener estimation. *Optics letters*, 41(12):2783–2786, 2016.
373

374

375

[17] Diana Fernanda Galvis-Carreño, Yuri Hercilia Mejía-Melgarejo, and Henry Arguello-Fuentes. Efficient reconstruction of raman spectroscopy imaging based on compressive sensing. *Dyna*, 81(188):116-124, 2014.

376

377

378

[18] Brandon M Davis, Amanda J Hemphill, Derya Cebeci Maltas, Michael A Zipper, Ping Wang, and Dor Ben-Amotz. Multivariate hyperspectral raman imaging using compressive detection. *Analytical chemistry*, 83(13):5086-5092, 2011.

379

380

381

[19] Yajun Yu, Yichuan Dai, Xianli Wang, Kaiqin Chu, and Zachary J Smith. A critical evaluation of compressed line-scan raman imaging. *Analyst*, 148(12):2809-2817, 2023.

382

383

[20] Hang Yuan, Pengfei Zhang, and Feng Gao. Compressive hyperspectral raman imaging via randomly interleaved scattering projection. *Optica*, 8(11):1462-1470, 2021.

384

385

[21] Haonan Lin and Hilton B de Aguiar. Compressive raman microspectroscopy. In *Stimulated Raman Scattering Microscopy*, pages 371-382. Elsevier, 2022.

386

387

388

[22] David S Wilcox, Gregory T Buzzard, Bradley J Lucier, Ping Wang, and Dor Ben-Amotz. Photon level chemical classification using digital compressive detection. *Analytica chimica acta*, 755:17-27, 2012.

389

390

391

392

[23] Camille Scotté, Hilton B de Aguiar, Didier Marguet, Ellen Marie Green, Pascale Bouzy, Sébastien Vergnole, Charles Peter Winlove, Nicholas Stone, and Herve Rigneault. Assessment of compressive raman versus hyperspectral raman for microcalcification chemical imaging. *Analytical chemistry*, 90(12):7197-7203, 2018.

393

394

395

[24] Pascal Berto, Camille Scotté, Frédéric Galland, Hervè Rigneault, and Hilton B de Aguiar. Programmable single-pixel-based broadband stimulated raman scattering. *Optics letters*, 42(9):1696-1699, 2017.

396

397

398

[25] Fernando Soldevila, Jonathan Dong, Enrique Tajahuerce, Sylvain Gigan, and Hilton B de Aguiar. Fast compressive raman bio-imaging via matrix completion. *Optica*, 6(3):341-346, 2019.

399

400

401

402

[26] Christian W. Freudiger, Wei Min, Gary R. Holtom, Bingwei Xu, Marcos Dantus, and X. Sunney Xie. Highly specific label-free molecular imaging with spectrally tailored excitation-stimulated Raman scattering (STE-SRS) microscopy. *Nature Photonics*, 5(2):103-109, 2011. Publisher: Nature Publishing Group ISBN: 1749-4885.

403

404

405

406

407

[27] Fa Ke Lu, Srinjan Basu, Vivien Igras, Mai P. Hoang, Minbiao Ji, Dan Fu, Gary R. Holtom, Victor A. Neel, Christian W. Freudiger, David E. Fisher, and X. Sunney Xie. Label-free DNA imaging in vivo with stimulated Raman scattering microscopy. *Proceedings of the National Academy of Sciences of the United States of America*, 112(37):11624-11629, 2015.

408

409

410

411

[28] Clémence Gentner, Samuel Burri, Edoardo Charbon, Claudio Bruschini, and Hilton B. de Aguiar. Towards video-rate compressive spontaneous raman imaging via single-photon avalanche diode arrays. *Opt. Lett.*, in print, January 2023. arXiv:2301.07709 [physics].
412

413

414

[29] Andreas Volkmer. Vibrational imaging and microspectroscopies based on coherent anti-stokes raman scattering microscopy. *Journal of Physics D: Applied Physics*, 38(5):R59, 2005.

415

416

417

[30] Yuexin Liu, Young Jong Lee, and Marcus T Cicerone. Broadband cars spectral phase retrieval using a time-domain kramers-kronig transform. *Optics letters*, 34(9):1363-1365, 2009.

418

419

420

[31] Erik M Vartiainen, Hilde A Rinia, Michiel Müller, and Mischa Bonn. Direct extraction of raman line-shapes from congested cars spectra. *Optics Express*, 14(8):3622-3630, 2006.

421

422

423

[32] Andreas Volkmer, Lewis D Book, and X Sunney Xie. Time-resolved coherent anti-stokes raman scattering microscopy: Imaging based on raman free induction decay. *Applied Physics Letters*, 80(9):1505-1507, 2002.

424

425

426

[33] Xiaoji G Xu, Stanislav O Konorov, John W Hepburn, and Valery Milner. Background-free coherent raman spectroscopy by detecting the spectral phase of molecular vibrations. *Optics letters*, 33(11):1177-1179, 2008.

427

428

429

[34] Shigekazu Takizawa, Kotaro Hiramatsu, and Keisuke Goda. Compressed time-domain coherent Raman spectroscopy with real-time random sampling. *Vibrational Spectroscopy*, 107:103042, February 2020. Publisher: Elsevier.

430

431

[35] Y Yacoby, R Fitzgibbon, and B Lax. Coherent cancellation of background in four-wave mixing spectroscopy. *Journal of Applied Physics*, 51(6):3072-3077, 1980.

432

433

434

435

[36] Conor L Evans, Eric O Potma, and X Sunney Xie. Coherent anti-stokes raman scattering spectral interferometry: determination of the real and imaginary components of nonlinear susceptibility χ (3) for vibrational microscopy. *Optics letters*, 29(24):2923-2925, 2004.

436

437

[37] Eric O Potma, Conor L Evans, and X Sunney Xie. Heterodyne coherent anti-stokes raman scattering (cars) imaging. *Optics letters*, 31(2):241-243, 2006.

438

439

440

[38] M Jurna, JP Korterik, C Otto, JL Herek, and HL Offerhaus. Background free cars imaging by phase sensitive heterodyne cars. *Optics express*, 16(20):15863-15869, 2008.

441

442

443

[39] Xi Wang, Aihua Zhang, Miaochan Zhi, Alexei V Sokolov, George R Welch, and Marlan O Scully. Heterodyne coherent anti-stokes raman scattering for spectral phase retrieval and signal amplification. *Optics letters*, 35(5):721-723, 2010.

444

445

446

[40] Stanislav O Konorov, Michael W Blades, and Robin FB Turner. Non-resonant background suppression by destructive interference in coherent anti-stokes raman scattering spectroscopy. *Optics Express*, 19(27):25925-25934, 2011.

447

448

449

[41] Baolei Li, Warren S Warren, and Martin C Fischer. Phase-cycling coherent anti-stokes raman scattering using shaped femtosecond laser pulses. *Optics Express*, 18(25):25825-25832, 2010.

450

451

[42] Nirit Dudovich, Dan Oron, and Yaron Silberberg. Single-pulse coherently controlled nonlinear raman spectroscopy and microscopy. *Nature*, 418(6897):512-514, 2002.
452

453

454

[43] Dan Oron, Nirit Dudovich, Dvir Yelin, and Yaron Silberberg. Narrow-band coherent anti-stokes raman signals from broad-band pulses. *Physical Review Letters*, 88(6):063004, 2002.

455

456

[44] Dan Oron, Nirit Dudovich, Dvir Yelin, and Yaron Silberberg. Quantum control of coherent anti-stokes raman processes. *Physical Review A*, 65(4):043408, 2002.

457

458

459

[45] Dan Oron, Nirit Dudovich, and Yaron Silberberg. Femtosecond phase-and-polarization control for background-free coherent anti-stokes raman spectroscopy. *Physical Review Letters*, 90(21):213902, 2003.

460

461

[46] Dan Oron, Nirit Dudovich, and Yaron Silberberg. Single-pulse phase-contrast non-linear raman spectroscopy. *Physical review letters*, 89(27):273001, 2002.

462

463

464

[47] Yuan Liu, Matthew D King, Haohua Tu, Youbo Zhao, and Stephen A Boppart. Broadband nonlinear vibrational spectroscopy by shaping a coherent fiber supercon- tinuum. *Optics express*, 21(7):8269-8275, 2013.

465

466

467

[48] Sang-Hyun Lim, Allison G Caster, and Stephen R Leone. Single-pulse phase-control interferometric coherent anti-stokes raman scattering spectroscopy. *Physical Review A—Atomic, Molecular, and Optical Physics*, 72(4):041803, 2005.

468

469

470

[49] Derya Cebeci, Bharat Mankani, and Dor Ben-Amotz. Recent Trends in Compressive Raman Spectroscopy Using DMD-Based Binary Detection. *Journal of Imaging*, 5(1):1, December 2018. Publisher: Multidisciplinary Digital Publishing Institute.

471

472

473

[50] Dario Polli, Vikas Kumar, Carlo M Valensise, Marco Marangoni, and Giulio Cerullo. Broadband coherent raman scattering microscopy. *Laser & Photonics Reviews*, 12(9):1800020, 2018.

474

475

476

477

[51] Charles H. Camp, Young J. Lee, John M. Heddleston, Christopher M. Hartshorn, Angela R. Hight Walker, Jeremy N. Rich, Justin D. Lathia, and Marcus T. Cicerone. High-speed coherent raman fingerprint imaging of biological tissues. *Nature Photonics*, 8:627-634, 2014.

478

479

[52] James R Fienup. Phase retrieval algorithms: a comparison. *Applied optics*, 21(15):2758-2769, 1982.

480

481

482

[53] Mitsuo Takeda, Hideki Ina, and Seiji Kobayashi. Fourier-transform method of fringe-pattern analysis for computer-based topography and interferometry. *JosA*, 72(1):156-160, 1982.

483

484

[54] YoonSeok Baek, Kyeoreh Lee, Seungwoo Shin, and YongKeun Park. Kramers–kronig holographic imaging for high-space-bandwidth product. *Optica*, 6:45–51, 2019.

485

486

[55] YoonSeok Baek and YongKeun Park. Intensity-based holographic imaging via space-domain kramers–kronig relations. *Nature Photonics*, 15:354–360, 2021.

487

488

489

[56] Zhongzheng Lin, Jianqi Hu, Yujie Chen, Camille-Sophie Brès, and Siyuan Yu. Single-shot kramers–kronig complex orbital angular momentum spectrum retrieval. *Advanced Photonics*, 5(3):036006–036006, 2023.
490

491

492

[57] Janet E Sorrells, Lingxiao Yang, Rishyashring R Iyer, Eric J Chaney, Carlos A Renteria, and Stephen A Boppart. Programmable hyperspectral coherent anti-stokes raman scattering microscopy. *Optics Letters*, 49(9):2513-2516, 2024.

493

494

495

[58] Christoph Heinrich, Stefan Bernet, and Monika Ritsch-Marte. Wide-field coherent anti-stokes raman scattering microscopy. *Applied physics letters*, 84(5):816-818, 2004.

496

497

498

499

[59] Eric M Fantuzzi, Sandro Heuke, Simon Labouesse, Dominykas Gudavičius, Randy Bartels, Anne Sentenac, and Hervé Rigneault. Wide-field coherent anti-stokes raman scattering microscopy using random illuminations. *Nature Photonics*, 17(12):1097-1104, 2023.

500

501

502

503

[60] Chiara Ceconello, Federico Vernuccio, Alejandro De la Cadena, Arianna Bresci, Francesco Manetti, Subir Das, Renzo Vanna, Giulio Cerullo, and Dario Polli. Wide-field broadband cars microscopy. In *EPJ Web of Conferences*, volume 266, page 08001. EDP Sciences, 2022.

504

505

506

[61] Alexandra d'Arco, Fei Xia, Antoine Boniface, Jonathan Dong, and Sylvain Gigan. Physics-based neural network for non-invasive control of coherent light in scattering media. *Optics Express*, 30(17):30845-30856, 2022.
# Supplementary Information: Computational field-resolved coherent chemical imaging

507

508

509

Shupeng Zhao¹, Lea Chibani¹, Edward Chandler², Fangyu Liu³, Jianqi Hu¹, Lorenzo Valzania¹, Ulugbek S. Kamilov², Hilton B. de Aguiar¹

510

511

¹Laboratoire Kastler Brossel, ENS-Université PSL, CNRS, 24 rue Lhomond, 75005 Paris, France

512

513

²Washington University in St. Louis, MO 63130, USA

514

³Department of Precision Instruments, Tsinghua University, Beijing 100084, China

515

Corresponding author: email@domain.com

## Supervised compressive method

516

517

518

519

520

521

522

523

524

The supplementary results in Fig.S1 are related to the supervised compressive method in the main text (Fig. 4I). We demonstrate the reconstruction process of Alg.2 (in the main text). Fig.S1**A-E** show the raw images captured by the Photomultiplier Tube (PMT) during galvo scanning, where the Digital Micromirror Device (DMD) was used to load five different random masks. These raw images serve as the input for the Alg.2. Fig.S1**F-H** display the predefined input eigenspectra $\chi_\omega^{(3)}$ for protein, lipid, and the non-resonant (NR) background, respectively. In these spectra, the dashed lines represent the real parts, while the solid lines represent the imaginary parts.

525

526

527

528

529

The output eigenimages obtained from Alg.2 are shown in Fig.S1**J-L**, corresponding to protein, lipid, and NR. Fig.S1**I** presents a composite image with protein in blue and lipid in red, showing the spatial distribution of these components. This result highlights the effectiveness of the supervised method in retrieving chemically specific images based on prior knowledge of the spectral signatures.
<figure><img src="image_6.png" /><figcaption>Figure S1: **Supplementary result for supervised compressive method in Fig.4C.**
A-E show the raw images recorded by the Photomultiplier Tube (PMT) during galvo scanning, with the DMD loading five different random masks. F-H represent the input eigenspectra $\chi_\omega^{(3)}$ for protein, lipid, and Non-Resonant (NR) background, respectively, where the dashed lines indicate the real part and the solid lines indicate the imaginary part. J-L display the three eigenimages obtained from Alg.2, corresponding to protein, lipid, and NR, respectively. I presents a composite image with protein (in blue) and lipid (in red) overlaid.</figcaption></figure>

## Hyperspectral imaging

The phase retrieval method (Alg.1 in the main text) can be applied point-by-point in the spatial domain to reconstruct the entire hyperspectral complex matrix, $\chi_{\omega,s}^{(3)}$. However, to improve efficiency, we use a sliding window approach across the spatial domain to select the data processed during each gradient descent step. This is illustrated in Fig.S2B, where “indice” represents the spatial coordinates corresponding to the current window. During each gradient descent step, we utilize the low-rank prior of the data to simultaneously update both $\chi_{\text{spec}}^{(3)}$ and $C_{\text{image}}(\text{indice})$ (Fig.S2A). This process continues as the sliding window moves across the entire spatial image. Once the window has covered the entire image, one full iteration is complete. By repeating this procedure for several iterations, we can successfully recover the low-rank hyperspectral complex matrix $\chi_{\omega,s}^{(3)} = \chi_{\text{spec}}^{(3)} \times C_{\text{image}}$.
541 The gradient steps are used to minimize the following optimization problem

$$
\begin{equation}
\begin{aligned}
\min_{\mathbf{\chi}_{\text{spec}}^{(3)}, \mathbf{C}_{\text{image}}} f, \quad \text{with} \quad f = & \sum_{i,s \in \text{indice}} \left| I_{i,s} - \sum_{\omega} \left| \left( (\mathbf{\chi}_{\text{spec}}^{(3)} \times \mathbf{C}_{\text{image}}(\text{indice})) \cdot \mathbf{M}_i \right) * \mathbf{M}_i \right|^2 \right. \\
& \left. + \lambda \operatorname{ReLU}(-\mathbf{C}_{\text{image}}(\text{indice})), \right\}
\end{aligned}
\tag{S1}
\end{equation}
$$

542 where the inclusion of the ReLU function accelerates convergence by enforcing the element
543 of $\mathbf{C}_{\text{image}}(\text{indice})$ to be non-negative. The complete algorithmic procedure can be found in
544 Alg.S1. In there, all the random masks $\mathbf{M}_i$ form the measurement matrix $\mathbf{M} \in \mathbb{R}^{m \times N_\omega}$,
545 and all the measured values $I_{i,s}$ form the detection matrix $\mathbf{I} \in \mathbb{R}^{m \times N_s}$. To normalize
546 the excitation energy, we use $\mathbf{M}$ to normalize the detection matrix as $\mathbf{I}_{\text{normalized}}(\cdot, s) =$
547 $\mathbf{I}(\cdot, s) / \sum(\mathbf{M}, 2)$. The initialization of $\mathbf{\chi}_{\text{spec}}^{(3)}$ and $\mathbf{C}_{\text{image}}$ is achieved by applying Non-
548 negative Matrix Factorization (NMF) to the linear inverse approximation. All gradients
549 in there are automatically computed using PyTorch's autograd functionality.

550 We applied the proposed method to the sample in Fig.3A (in the main text). After
551 performing NMF on the imaginary part of $\chi_{\omega,s}^{(3)}$ output from Alg.S1, the resulting eigenim-
552 ages and eigenspectra are shown in Fig.S2C and D. The corresponding data dimensions
553 is $\chi_{\omega,s}^{(3)} \in \mathbb{C}^{13 \times 10000}$, and the number of random masks used is $m = 13 \times 4$. Note that
554 these eigenimages and eigenspectra are not necessarily the same as $\mathbf{C}_{\text{image}}$ and $\chi_{\text{spec}}^{(3)}$ in
555 Alg.S1, as the rank-one decomposition of a low-rank matrix is not unique. The struc-
556 ture in Fig.S2A does not guarantee that $\mathbf{C}_{\text{image}}$ and $\chi_{\text{spec}}^{(3)}$ correspond to pure chemical
557 substances. The low-rank prior simply ensures the correctness of $\chi_{\omega,s}^{(3)}$. In contrast, for
558 the supervised method proposed in the main text, since $\chi_{\text{spec}}^{(3)}$ is predefined, the $\mathbf{C}_{\text{image}}$
559 obtained from Alg.2 corresponds to pure chemical substances.

<caption>**Algorithm S1** Phase Retrieval of $\chi_{\omega,s}^{(3)}$</caption>

1: **Input:** $\eta_{\text{spec}} = 0.0001$, $\eta_{\text{image}} = 0.0002$, window = 10, $n_{\text{iter}} = 50$
2: **Initialization:** [$\chi_{\text{spec}}^{(3)}, \mathbf{C}_{\text{image}}$] = nmf($\mathbf{M}^{-1} \times \mathbf{I}_{\text{normalized}}$)
3: **for** $i = 1$ to $n_{\text{iter}}$ **do**
4: &nbsp;&nbsp;&nbsp;&nbsp;**for** $x = 1$ to 91, $y = 1$ to 91 **do**
5: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;indice = [$x : x + \text{window}, y : y + \text{window}$]
6: &nbsp;&nbsp;&nbsp;&nbsp;${\chi}_{\text{spec}}^{(3)} \leftarrow \chi_{\text{spec}}^{(3)} - \eta_{\text{spec}} \frac{\partial f}{\partial \chi_{\text{spec}}^{(3)}}$
7: &nbsp;&nbsp;&nbsp;&nbsp;${\mathbf{C}}_{\text{image}}(\text{indice}) \leftarrow \mathbf{C}_{\text{image}}(\text{indice}) - \eta_{\text{image}} \frac{\partial f}{\partial \mathbf{C}_{\text{image}}(\text{indice})}$
8: &nbsp;&nbsp;&nbsp;&nbsp;**end for**
9: **end for**
10: Return $\chi_{\text{spec}}^{(3)} \times \mathbf{C}_{\text{image}}$
<figure><img src="image_7.png" /><figcaption>Figure S2: Hyperspectral imaging A The low-rank prior applied in Alg.S1. B The sliding window approach used in Alg.S1 for efficient spatial domain processing. C Eigen-images obtained after Non-negative Matrix Factorization to the imaginary part of $\chi_{\omega,s}^{(3)}$ reconstructed by Alg.S1, the sample used is the same as in Fig. 3A (in the main text). D Eigenspectra corresponding to the eigenimages in C.</figcaption></figure>

Experimental setup

The complete optical setup is shown in Fig.S3.
<figure><img src="image_8.png" /></figure>

Figure S3: Detailed scheme of the setup used to perform experiments. Legend: OPA=optical parametric Amplifier, DL=delay line, G=grating, DMD=digital micromirror device, W=quarter-wave plate, PBS=polarization beam spilt, BS=beam spilt, DM=dichroic mirror, GM = galvo mirror, 4f=4f system, T=telescope, PD=photodiode, PMT=Photomultiplier Tube, SPF=short pass filter, LIA=lock-in amplifier, PC=personal computer.