Introduction

The simultaneous encryption and compression of information has become increasingly essential with the rapid rise in data security requirements and transmission demands. Optical encryption1,2,3 presents a promising solution to this challenge, leveraging its capability for parallel data processing and multidimensional encryption, including wavelength4,5, phase6,7, amplitude8,9, and polarization10,11. These characteristics make optical encryption inherently well-suited for large-scale 2D imaging and offer superior security compared to conventional digital encryption technologies. Single-image optical encryption8,12,13,14,15,16,17,18 has been extensively studied since the introduction of double random phase encryption19. However, with the rapidly growing demands for data transmission and storage, the research on multi-image optical encryption (MOE), which compresses multiple images into a single ciphertext, has gained significant momentum1,3.

So far, several approaches have been developed for MOE. One common strategy was the multiplexing of physical parameters5,20,21,22,23,24,25,26,27,28. For instance, during the encryption, each plaintext is first encrypted using the double phase random encoding method and then superimposed to generate the final enciphered image. Due to the phase modulation applied to the plaintext, the obtained enciphered image appears as randomly distributed noise, providing high security properties. Decryption is achieved by decoding the enciphered image using its corresponding wavelength, allowing each plaintext image to be individually retrieved. Numerical simulations indicated that the decryption performance becomes unsatisfactory when the compression ratio (CR) exceeds 55, because cross-talk between different channels not only limits the achievable CR but also poses challenges for maintaining high decryption quality. Additionally, the impact of noise on the decryption quality was not thoroughly analyzed. Similar issues were observed in other multiplexing-based techniques. Furthermore, due to the challenges of accurately calibrating phase modulation, most parameter multiplexing-based MOE methods were only explored in simulations, which failed to fully leverage the parallel processing capabilities of optical systems. To the best of our knowledge, the highest achievable CR reported in the experiments so far is only 424.

To achieve higher CR and fidelity in MOE, end-to-end neural networks were utilized in the decryption process29,30. Firstly, the plaintexts are individually processed through a scattering imaging-based encryption scheme, where these plaintexts are transformed into scattering images with noise appearances, ensuring high security performance. Then, these transformed images are randomly sampled and integrated into a single package (i.e., ciphertext) using space multiplexing. Finally, a well-trained deep neural network is employed to recover the scattering image from its sampled version29. The deep neural network serves as the decryption key, making the plaintext more difficult to steal due to the large number of hyper-parameters in the network. This study showed that noise degrades decryption quality, but no feasible scheme was proposed to mitigate this issue. The deep learning-based MOE circumvents the cross-talk problem existing in many current multi-image encryption schemes, but it suffers from some disadvantages, such as extensive training time, large data requirement, and limited generalization ability, which hinder its widespread applications.

Another emerging strategy was metasurfaces, which can manipulate light across multiple degrees of freedom at subwavelength scales31,32,33. These methods go beyond traditional degrees of freedom of light, such as wavelength34, polarization35, and orbital angular momentum (OAM)36. On the one hand, plasmonic nanorods were engineered to exhibit hierarchical reaction kinetics during hydrogenation and dehydrogenation, forming addressable pixels in a multiplexed metasurface. Here, the helicity of light, hydrogen, oxygen, and reaction duration can function as multiple keys of encryption37. On the other hand, a novel metasurface platform was developed to simultaneously encode color and intensity information into the wavelength-dependent polarization profile of a light beam, and fine control of brightness and contrast enables the decryption of information38. Both the illuminated light field and the design parameters of the metasurface can serve as decryption keys, ensuring high security for this method. However, similar to the multiplexing-based MOE method, the impact of noise on the decryption quality was not sufficiently analyzed. Additionally, the orthogonality between different OAM modes makes this approach suitable for high-capacity optical encryption systems, achieving CR as high as 1039. Nevertheless, the precise manufacturing requirements for metasurfaces limit their broader application, and a processed metasurface can only encrypt specific information, compromising encryption flexibility.

Alternatively, compressive sensing (CS)40,41, which leverages the sparsity of natural images in certain transform domains to map low-dimensional data to higher dimensions, offered a new perspective to MOE42,43. For example, by modifying a Mach–Zehnder interferometer, the interference of multiple object beams with unique reference beams enables the simultaneous encryption of multiple images into a single hologram. The original images for encryption are modulated with random phase masks and positioned at different locations and distances relative to the CCD camera. Each image acts as an encryption key for the others, enabling mutual encryption. A four-step phase shifting technique is incorporated into the holographic recording, which is treated as a CS procedure. Decryption is formulated as a minimization problem, and solved by using an optimization-based algorithm with a CR of 443. The phase modulation of the optical field enhances security performance. Like the deep learning-based MOE method, this method demonstrated that the noise greatly affects decryption quality, but no feasible scheme to address this issue was given. Unfortunately, the accurate calibration of phase modulation remains a significant barrier to experimental validation.

Evidently, the four major MOE schemes discussed above have their shortcomings. To comprehensively enhance the performance of MOE, here we present a lensless sparse point spread function-based MOE method, referred to as sPSF-MOE. In the encryption of sPSF-MOE, each plaintext image is encoded using a sparsely distributed PSF with geometric shapes, designed through spatial phase engineering, and then the encoded ciphertexts are superimposed to produce a compressed ciphertext. In the decryption, a physics-constrained two-step iterative shrinkage/thresholding algorithm (PC-TwIST) based on CS is employed to achieve high-quality image reconstruction. Furthermore, a principal component analysis (PCA) method44 is incorporated into the decryption process to ensure robustness against ambient light interference. Consequently, sPSF-MOE demonstrates not only high fidelity for binary and gray-scale images and robust security against autocorrelation-based decryption attacks but also unprecedented anti-interference ability even under strong ambient light conditions. Importantly, sPSF-MOE achieves a high CR greater than 10, surpassing traditional MOE methods.

Methods

As illustrated in Fig. 1, the sPSF-MOE method consists of two main steps: multi-image compressed encryption and single-ciphertext decryption. The multi-image encryption process, depicted in Fig. 1a, involves convolving objects in different frames with their respective geometric sPSF encryption keys. The convolution results of all frames are then spatially superimposed to generate the final compressed ciphertext. The geometric sPSF codes are created using the lensless phase retrieval (LPR) method, as shown in Fig. 1b. This method determines the phase distribution corresponding to the desired amplitude distribution by iteratively performing Fresnel diffraction (FD) and inverse Fresnel diffraction (IFD). The single-ciphertext decryption process is illustrated in Fig. 1c, where a PC-TwIST algorithm, leveraging the intensity non-negativity constraint of the image, is applied to reconstruct high-quality decrypted plaintexts.

Fig. 1: Flowchart of sPSF-MOE.
figure 1

a This encryption process involves convolving objects in different frames with their respective geometric sPSF encryption keys, followed by spatial superimposition to generate the compressed ciphertext; b The geometric sPSF codes are created using the lensless phase retrieval (LPR) method, which involves iterative fresnel diffraction (FD) and inverse fresnel diffraction (IFD) to determine the desired phase distribution; c The decryption process uses the PC-TwIST algorithm to reconstruct high-quality plaintext from the compressed ciphertext; sPSF: sparse point spread function; Conv: convolution; Sum: summation; POH: phase-only hologram; MSE: mean square error; Dec: decryption.

Forward model of sPSF-MOE

In the encryption process of sPSF-MOE, each plaintext image is convolved with a specific randomly distributed sPSF featuring geometric shapes, designed through spatial phase engineering. The resulting convolved ciphertexts are then superimposed to form a single frame of compressed ciphertext. Mathematically, the forward model for N-image encryption can be generally expressed in a matrix form as

$${{\rm{Y}}}={\sum }_{b=1}^{N}{{{\rm{P}}}}_{b}* {{{\rm{X}}}}_{b}+{{\rm{Z}}}$$
(1)

where \({{\rm{Y}}}\in {{\mathbb{R}}}^{{M}_{x}\times {M}_{y}}\), \({{{\rm{X}}}}_{b}\in {{\mathbb{R}}}^{{M}_{x}\times {M}_{y}}\), \({{{\rm{P}}}}_{b}\in {{\mathbb{R}}}^{{M}_{x}\times {M}_{y}}\), and \({{\rm{Z}}}\in {{\mathbb{R}}}^{{M}_{x}\times {M}_{y}}\) denote the compressed single-frame ciphertext, the b-th plaintext image, the corresponding sPSF, and the noise, respectively. Additionally, * and \(\varSigma\) respectively denote the operations of convolution and summation, where b is the frame index, and Mx and My refers to the planar dimensions of the plaintexts. By introducing A as a combined encryption and compression operator, the forward model of sPSF-MOE in Eq. (1) can be further abbreviated as

$${{\bf{Y}}}={{\bf{A}}}{{\bf{X}}}+{{\bf{Z}}},$$
(2)

where X represents the 3D data cube of plaintext images, and Eq. (2) is treated as an underdetermined problem. The details of the matrix representation of sPSF-MOE forward model are illustrated in Supplementary Fig. 1. The sPSF-MOE method encodes each plaintext using its corresponding sPSF, theoretically eliminating issues such as cross-talk between different channels and the need for precise phase modulation calibration. This ensures a reliable foundation for high-quality decryption results.

PSF generation of sPSF-MOE

As a critical operation in sPSF-MOE, randomly distributed sPSFs with geometric shapes are generated using the LPR method, which modulates the wavefront of light under incoherent illumination. Similar to the Gerchberg-Saxton (GS) algorithm45, widely employed for phase optimization through iterations between spatial and frequency domains, LPR leverages FD and IFD to achieve the desired phase distribution under incoherent light illumination. This approach eliminates the need for lenses, significantly simplifying the optical system.

To begin with, a random phase of φ0 is used to multiply the target intensity as the initial input complex amplitude on the image plane, A0 = |At|exp(0), where |At| is the amplitude distribution of the target image. In each iteration, there are four steps: (i) The complex amplitude field on the hologram plane, Hk = |Hk|exp(jФk), is calculated by IFD of the complex amplitude field on the image plane, Ak = |Ak|exp(k), where k refers the k-th iteration; (ii) The phase-only hologram (POH), Hk = |Hk|exp(jФ’k), is obtained from the complex amplitude field Hk after phase extraction and replaced by amplitude normalization; (iii) The reconstructed complex amplitude field on the image plane, Ak = |Ak|exp(k), is calculated by FD of the POH; (iv) The input complex amplitude Ak+1 for the next iteration is generated after the reconstructed amplitude |At| is replaced by the target amplitude |At | . In general, the iterative process can be formulated as

$$\begin{array}{c}{H}_{k}=IFD({A}_{k})\\ H{\hbox{'}}_{k}=\frac{{H}_{k}}{|{H}_{k}|}\\ A{\hbox{'}}_{k}=FD({H\hbox{'}}_{k})\\ {A}_{k+1}=|{A}_{t}|\frac{A{\hbox{'}}_{k}}{|A{\hbox{'}}_{k}|}\end{array}$$
(3)

In each iteration, the mean square error (MSE) between the target and reconstructed amplitudes on the imaging plane is utilized to evaluate the generated key, which decreases and stabilizes after a few dozen iterations.

Image reconstruction of sPSF-MOE

In sPSF-MOE, reconstructing multi-frame plaintexts from a single-frame compressed ciphertext poses an underdetermined problem. CS has demonstrated great potential in addressing such challenges, including applications in single-pixel imaging46, snapshot compressive imaging47, scattering imaging48, and so on. As discussed in forward model of sPSF-MOE, Eq. (2) characterizes this underdetermined problem, and several iterative optimization-based as well as deep learning-based reconstruction algorithms have been developed to solve it. In this work, the framework of TwIST algorithm49 is adopted, and the intensity non-negativity of the image is incorporated as a physical constraint (PC) alongside image sparsity to enhance the reconstruction quality. As a result, the decryption process is reformulated as minimizing the objective function, and is given by

$$f({{\bf{X}}})=\frac{1}{2}{\Vert {{\bf{Y}}}-{{\bf{A}}}{{\bf{X}}}\Vert }_{2}^{2}+\lambda \varPhi ({{\bf{X}}}){{\rm{subjectto}}}{{\bf{X}}} > 0$$
(4)

where\({\Vert \bullet \Vert }_{2}^{2}\) is the l2 norm, \({\Vert {{\bf{Y}}}-{{\bf{A}}}{{\bf{X}}}\Vert }_{2}^{2}\) is the fidelity term, \(\varPhi ({{\bf{X}}})\) denotes the regularization term, and \(\lambda\) is the regularization parameter to balance the two terms. The pseudo-code of the iterative process in PC-TwIST is shown in Table 1.

Table 1 Pseudo-code of the iterative process in PC-TwIST

Here, α and β are the parameters used in the iterative process, both α and β are regularization parameters used to control different constraints in the optimization process, ensuring that the recovered image not only fits the observed data but also maintains reasonable sparsity or smoothness, the algorithm’s performance does not vary significantly with different values of these parameters. \(\varGamma\) represents the operator of total-variation denoising, and x* denotes the reconstruction result. Beyond the traditional TwIST iteration, the update step, xt+1=max(xt+1, 0), is incorporated into the iterative process to enforce the non-negative intensity property of natural images, ensuring more accurate convergence. The flowchart of PC-TwIST is shown in Supplementary Fig. 2. To accelerate the reconstruction, 2D fast Fourier transform (FFT) replaces the forward convolution operation, leveraging the equivalence between convolution in the spatial domain and the dot product in the frequency domain.

Results

Simulations

Numerical simulation of sPSF-MOE

To evaluate the feasibility and security performance of sPSF-MOE, numerical simulations are conducted at a CR of 8, and its resilience against autocorrelation-based attacks is demonstrated. The numerical simulations are implemented using Matlab R2021a with a GPU (Nvidia GTX 3060).

Based on the forward encryption model of sPSF-MOE, a numerical simulation on multi-image encryption is performed with a CR of 8, and the results are presented in Fig. 2. The first row of Fig. 2a illustrates eight plaintext images with binary objects to be encrypted, each image involves 300 × 300 pixels. The second row depicts the corresponding sparsely and randomly distributed geometric sPSFs generated using the LPR method, which serve as encryption keys. By convolving each plaintext image with its corresponding sPSFs, the objects are encrypted as a frame of ciphertext, as shown in the third row of Fig. 2a. The intensity values of the 8 frame convolution results are superimposed and normalized to obtain a single-frame compressed ciphertext shown in Fig. 2b, and the intensity distribution of the ciphertext resembles random noise, thereby enhancing the security of the encoded information. During decryption, the geometric sPSFs serve as the keys to recover the plaintext, and decrypted results are obtained using PC-TwIST, as shown in the fourth row of Fig. 2a. Visually, the decrypted objects are almost identical to the originals, with only minor noise points visible. To quantitatively evaluate the reconstructed results, correlation coefficient (CC) values between each recovered and its corresponding plaintexts are displayed in Fig. 2c. The CC values exceed 0.95 for all cases, with a mean value of 0.96. Moreover, to analyze the efficiency of the decryption process, the lg(MSE) value between the output and measurement at each iteration is displayed in Fig. 2d. Over the first 30 iterations, the value decreases sharply before stabilizing. Here, the use of lg(MSE) instead of MSE highlights the rapid error reduction in the initial iterations. These numerical simulations verify the feasibility of sPSF-MOE and demonstrate that the reconstructed results effectively avoid cross-talk between different encrypted channels, ensuring high-quality decryption performance. For the robustness tests of the system against noise and rotation compared with other multiplexing-based and CS-based methods, please refer to Supplementary Figs. 36.

Fig. 2: Numerical simulation of sPSF-MOE with a CR of 8.
figure 2

a Plaintexts, corresponding sPSFs, convolution results, and reconstructed results frame by frame; b The compressed single-frame ciphertext; c CC values of the reconstructed results; d Lg(MSE) between the output and measurement during iterations. CC: correlation coefficient.

Security performance of sPSF-MOE

Modulating an optical encryption system’s PSF into sparse points for encryption has been extensively explored50,51,52,53,54. However, this approach is susceptible to autocorrelation-based attacks, which utilizes the known frequency intensity to reconstruct spatial domain information through iterative processes between spatial and frequency domains55,56,57,58, thereby undermining the system’s security. To counteract this vulnerability, a series of specially designed geometric sPSFs is introduced to enhance encryption security, with each sPSF composed of five randomly distributed circles. Here, single-frame encryption is taken as an example for the security performance analysis of sPSF-MOE, mathematically represented as follows

$${{{\rm{Y}}}}_{b}={{{\rm{P}}}}_{b}* {{{\rm{X}}}}_{b}$$
(5)

The autocorrelation of Yb can be obtained:

$${{{\bf{Y}}}}_{{\mbox{b}}}\star {{{\bf{Y}}}}_{{\mbox{b}}}=\left[\left({{{\bf{P}}}}_{{\mbox{b}}}* {{{\bf{X}}}}_{{\mbox{b}}}\right)\star \left({{{\bf{P}}}}_{{\mbox{b}}}* {{{\bf{X}}}}_{{\mbox{b}}}\right)\right]=\left[\left({{{\bf{X}}}}_{{\mbox{b}}}\star {{{\bf{X}}}}_{{\mbox{b}}}\right)* \left({{{\bf{P}}}}_{{\mbox{b}}}\star {{{\bf{P}}}}_{{\mbox{b}}}\right)\right]$$
(6)

The autocorrelation of Yb consists of the autocorrelation of the object convolved with that of the sPSF. Unfortunately, the autocorrelation of sparse points is typically a sharply peaked function, which makes it susceptible to autocorrelation-based attacks that can easily extract encrypted information57,58. In contrast, the autocorrelation of sparse circles does not exhibit such a sharply peaked function, thereby enhancing security performance.

The security performances of both point and circular sPSFs under an autocorrelation algorithm attack are illustrated in Fig. 3, the intensity colorbar applies to every panel. The single-frame plaintext to be encrypted is the eighth object of ‘Darts’ shown in Fig. 2a. After being convolved with the two types of sPSFs shown in the first column of Fig. 3a, the object is obscured in the convolution images presented in the second column. Additionally, the decryption results under the autocorrelation algorithm attack, without the key, are displayed in the third column of Fig. 3a. Intuitively, the point sPSF encoded plaintext is successfully decrypted by the autocorrelation algorithm. In contrast, the result of the circular sPSF convolution is barely distinguishable, demonstrating the superior security performance of the sparse circular encryption strategy over the sparse point encryption approach.

Fig. 3: Security performance comparison of sPSF-MOE under autocorrelation algorithm attack.
figure 3

a Autocorrelation cracked results for point sPSF and circular sPSF convolutions; b AC and FFT analyses for sparse point and sparse circular convolutions. SP sparse point, SC sparse circle, Conv convolution, Rec reconstruction AC autocorrelation, FFT fast Fourier transform.

To quantitatively evaluate the security performance of the sparse circular encryption method, the autocorrelation of the ‘Darts’ object, the autocorrelation of convolution with the point sPSF and circular sPSF are shown in the first row of Fig. 3b, respectively. As indicated in the yellow boxes, the autocorrelation of convolution with point sPSF exhibits information that closely resembles the autocorrelation of the plaintext, whereas, in the case of convolution with circular sPSF, the autocorrelation of plaintext shows minimal resemblance. Using the autocorrelation of the plaintext as a reference, the structural similarity (SSIM) values of sparse point-based and sparse circular-based approaches are 0.312 and 0.108, respectively. Furthermore, the FFT result of plaintext, the FFT result after decryption for point sPSF, and that for circular sPSF are shown in the second row of Fig. 3b, respectively. The SSIM values for sparse point-based and sparse circular-based approaches are 0.286 and 0.173, respectively. These results collectively highlight the superior security performance of circular sPSF-MOE.

Experimental results

sPSF-MOE with high CR

To verify that the designed sPSF-MOE effectively minimizes cross-talk between encrypted channels while achieving a high CR, the binary and gray-scale images with CRs of 12 and 6 are further experimentally implemented, respectively. The decryption process for the experimental data is performed using Matlab R2021a, leveraging a GPU (Nvidia GTX 3060).

The experimental validation of sPSF-MOE for binary images is conducted with a CR of 12, and the experimental setup of sPSF-MOE is shown in Fig. 4a. An LED source (M470l5, Thorlabs) emits incoherent light with a central wavelength of 470 nm, followed by a 3 nm narrowband filter (FBH473-3, Thorlabs) and a polarizer (LPVISA050, Thorlabs) to align the polarization direction of the incident light with the effective phase modulation direction of a liquid-crystal spatial light modulator (SLM) (PLUTO-2.1, Holoeye). The input light first illuminates a digital micromirror device (DMD) (F4320 DDR 0.7 XGA, Fldiscovery), which generates binary or gray-scale objects for encryption, and then passes through a beam splitter (BS) (MBS1355-A, Lbtek) before being modulated by the SLM. The SLM loads specific phase patterns generated by an LPR method to produce geometric sPSFs, as depicted in the bottom left of Fig. 4a. After reflection by the BS, the objects are convolved with the corresponding sPSFs and recorded by a CMOS camera (acA1920-40gm, Basler). The upper and lower rows of Fig. 4b display 6 representative frames of the simulated and experimentally acquired circular sPSFs on the detection plane selected from a total of 12 frames, respectively. The experimental results exhibit strong consistency with the simulation ones. The corresponding 6-frame convolution results are shown in Fig. 4c, while all 12-frame convolution results are superimposed to generate a single-frame compressed ciphertext, as depicted in the bottom right of Fig. 4a. Subsequently, PC-TwIST is applied to recover the plaintexts, with the recovered frames shown in Fig. 4d. The ground truths, along with reconstructed plaintexts for all the 12 frames, are respectively presented in Supplementary Figs. 7 and 8. The magnification of the system please refer to Supplementary Fig. 9. In line with the theoretical analysis in Methods, each plaintext is convolved with its corresponding sPSF, and the solution for the plaintexts can be effectively transformed into an optimization problem. Since sPSF-MOE avoids cross-talk between different encrypted channels, it enables the recovery of high-quality decrypted plaintexts.

Fig. 4: Experimental validation of sPSF-MOE for binary objects with CR of 12.
figure 4

a The experimental setup for multi-object encryption and decryption is illustrated. A phase-modulating spatial light modulator (SLM) is used to encode objects, which are then passed through a beam splitter (BS) and focused onto a CCD camera for detection. The SLM pattern and the corresponding intensity distribution are shown, demonstrating the relationship between the encoded phase and the captured intensity. insets: A representative SLM pattern for the circular sPSF and CMOS intensity of the compressed ciphertext; b The first row shows simulated sPSF patterns, while the second row shows the experimental sPSF patterns generated using the LPR algorithm. The simulated and experimental results are in good agreement, demonstrating the successful generation of sPSF; c The figure displays the encrypted image obtained by convolving the plaintext with the corresponding sPSF, plaintext information is almost invisible after encryption; d The final panel shows the result of the reconstruction using the PC algorithm, successfully retrieving the original information from the encrypted image. LED light-emitting diode, F filter, P polarizer, DMD digital micromirror device, CMOS complementary metal oxide semiconductor.

For simplicity, the shapes are designed as circles with identical sizes, and the results of validation with various shapes and sizes are provided in Supplementary Fig. 10.

Furthermore, a CR of 6 is conducted to experimentally validate sPSF-MOE for gray-scale images. The experimental setup depicted in Fig. 4a is also utilized, and the DMD is used to generate 6 frames of a rotating fan with a varying intensity distribution, as shown in Fig. 5a. The sPSFs used are consistent with those shown in Fig. 4b, the corresponding convolution results are displayed in Fig. 5b, a single frame compressed ciphertext is obtained by superimposing the 6-frame convolution results shown in Supplementary Fig. 11. The reconstructed results are shown in Fig. 5c, and the profiles of the purple and yellow horizontal lines align closely, as illustrated in Fig. 5d, demonstrating the superior performance of sPSF-MOE on grayscale images. In comparison, most existing MOEs primarily focus on binary images due to challenges such as system calibration and cross-talk1,3,59.

Fig. 5: Experimental validation of sPSF-MOE for gray-scale objects with CR of 6.
figure 5

a 6 frames of a rotating fan with varying intensity. b Convolution results for the 6 frames using the sPSFs. c Reconstructed image after decryption. d Intensity profiles along the purple and yellow lines in (a) and (c), showing the alignment and confirming the accuracy of the reconstruction.

sPSF-MOE with strong anti-interference ability

Optical systems are often constrained in their application range due to noise interference, typically requiring a controlled laboratory environment to manage ambient light interference60. To broaden the applicability of sPSF-MOE, PCA is incorporated into the decryption process to reduce ambient light interference at a CR of 4. PCA, a widely used technique for data dimensionality reduction, was commonly applied in various fields of data science (e.g., image compression, time series prediction)61,62, and has also found applications in specific optical domains63,64.

The experimental setup shown in Fig. 4a is used to verify the decryption quality of sPSF-MOE with PCA under strong ambient light interference. At a compression ratio of 4, ambient light interference is introduced by illuminating the CMOS plane with light from a mobile phone during the recording of the convolution results. The first row of Fig. 6a displays the convolution results under strong ambient light, the intensity colorbar applies to every panel. Using the PCA technique, ‘clean’ images shown in the third row of Fig. 6a can be obtained by treating the ambient light as a slowly changing background, as illustrated in the second row of Fig. 6a. The demonstration of PCA is given in Fig. 6b, a 2D matrix can be expressed as44

$$A=US{V}^{T}$$
(7)

The values on the diagonal of the matrix S represent the percentage contribution of the components shown in Fig. 6b, which are typically lower in the high-frequency regions of a natural image. A slowly changing background can be obtained by retaining only the first component, while a ‘clean’ image can be achieved by setting the component to zero. For the detailed process of PCA and its quantitative analysis on decryption quality, please refer to Supplementary Figs. 1214. The reconstructed results under ambient light are displayed in the first row of Fig. 6c, where little to no plaintext information is discernible due to noise. In contrast, PCA-processed noisy images can be reconstructed using PC-TwIST, enabling the recovery of plaintext information. Notably, the sparsity of natural images allows CS to further suppress residual ambient light as background noise48, thereby further enhancing reconstruction quality.

Fig. 6: Anti- interference ability of sPSF-MOE with PCA under ambient light.
figure 6

a The process of eliminating the effect of ambient light with PCA; b Illustration of PCA; c Comparison of reconstructed results w/o PCA. Bg background, P-PCA, processed by principal component analysis, Rec without PCA the reconstructed image obtained without applying principal component analysis, Rec with PCA the reconstructed image obtained after applying principal component analysis.

Conclusions

In encryption of sPSF-MOE, various shapes and sizes of sPSF elements have been validated in our simulation, demonstrating little impact on decryption results. Regarding the number of sparse geometries, if the quantity is too small, it does not meet the restricted isometry property, thereby degrading reconstruction quality65. Conversely, an excessive number of sparse geometries can result in challenges such as insufficient detector bit depth and a reduced signal-to-noise ratio. sPSF-MOE faces challenges in reconstructing complex scenes, where fine details and textures are often lost due to limited sampling rates. A promising solution is a dual-channel PSF encoding approach to increase the sampling rate, where two independent PSFs capture different spatial frequency components66.

In decryption of sPSF-MOE, PC-TwIST is an effective iterative method for image reconstruction, but its reliance on multiple iterations and pixel-by-pixel processing makes it computationally expensive, especially for images with large sizes or multi-image encryption, preventing it from real-time encryption and reconstruction. To improve this limitation, a deep image prior (DIP) method67 can be adopted, which has the advantages of utilizing the implicit prior information inherent in the structure of the neural network itself. As DIP does not require a large amount of training datasets, it can enable the real-time processing ability of sPSF-MOE.

Given that optical systems process information significantly faster than digital electronics, all-optical networks68,69,70,71 are envisioned as the next generation of computational systems, with the potential to revolutionize modern society. The experimental realization of high CR and high fidelity in sPSF-MOE is of great significance for data transmission, storage, and security in all-optical networks. Moreover, a forward information acquisition model based on compressed convolution is also proposed in this work, similar to those used in 3D imaging72 and microscopy73. As such, this model can be extended to snapshot multidimensional imaging.

To conclude, we have reported a sPSF-MOE in this work, which achieves both a high CR of 12 for binary plaintexts and high reconstruction quality. By incorporating CS into the MOE framework, the reconstruction process is transformed into an optimization problem. This approach effectively avoids cross-talk between encrypted channels and the challenges of precise phase modulation calibration, further enhancing reconstruction quality through the application of PC-TwIST. Additionally, the integration of PCA into sPSF-MOE enables large-scale extension and plays a critical role in the industrialization of optical systems, providing an approach to improve the security and storage capacity of all-optical networks.