All-optical image transportation through a multimode fibre using a miniaturized diffractive neural network on the distal facet
  • SJ_Zhang
  • Apr. 19, 2025

Abstract

The direct optical transportation of images through multimode fibres (MMFs) is highly sought after in compact photonic systems for MMF-based optical information processing. However, MMFs are highly scattering media, thus degrading information transmitted through them. Existing approaches utilize artificial neural networks or spatial light modulators to reconstruct images scrambled after propagation through the fibre. Despite these advances, achieving direct optical image transportation through MMFs using integrated optical elements with micrometre-scale footprints remains challenging. Here we develop a miniaturized diffractive neural network (DN2s) integrated on the distal facet of a MMF for the direct all-optical image transportation through the fibre. The DN2s has a footprint of 150 μm by 150 μm and is fabricated on the facet of a 0.35-m-long MMF using three-dimensional two-photon nanolithography. The fibre-integrated DN2s enables single-shot optical transportation of images with flat phases in real time for a constant configuration of the MMF. The system achieves a minimum image reconstruction feature size of approximately 4.90 μm over a field of view 65 μm by 65 μm when imaging handwritten digits. Transfer learning is also demonstrated by the direct optical transportation of HeLa cell images projected by spatial light modulators, which were not part of the training dataset. The concept and implementation pave the way to the integration of miniaturized DN2s with MMFs for compact photonic systems with unprecedented functionalities.

Main

Optical fibres are fundamental components in modern science and technology owing to their inherent advantages, including strong light confinement capabilities and efficient light transmission, and have thus been used in numerous applications, including fibre communications1,2, optical trapping3, nonlinear optical effects analysis4, optical endoscopy5 and quantum information processing6. Compared with single-mode fibres (SMFs)7,8, multimode fibres (MMFs) can support a much larger number of guided modes (~103 to ~104), offering the attractive advantage of high-capacity information and image transportation within the diameter of a hair. Such technology is of great importance for a plethora of compact photonic systems, from minimally invasive endoscopy9,10, to chip-scale mode-multiplexing and demultiplexing for short-distance interconnections11,12, on-chip quantum photonics13,14 and hybrid photonic integration15.

However, MMFs are regarded as highly scattering media16,17, where the MMF-supported guided modes travel at different velocities as a consequence of the modal dispersion phenomenon18, leading to spatial wavefront distortions, that is, speckle patterns at the fibre distal facet19. Thus, MMFs are naturally unsuitable for spatial optical signal transportation owing to modal dispersion, resulting in a fundamental bottleneck for direct spatial signal transmission through MMFs.

Advances in MMF-based technologies involved wavefront-reshaping methods based on spatial light modulators (SLMs) or artificial neural networks (ANNs) to achieve spatial signal transportation or processing through MMFs. The wavefront-shaping methods based on SLMs have demonstrated the transportation of optical information through MMFs, including via digital holography20, the transmission matrix (TM) measurements21,22, the compressive sampling23 and the fibre memory effect24. Important progress in optically untangling light propagation through MMFs was theoretically and experimentally demonstrated on the basis of the optical inverse concept25,26, where a multiplane light converter was utilized to achieve the single-shot propagation of scenes through an MMF. This scheme can be understood as a physical matrix preconditioner or a linear diffractive optical neural network (ONN) designed by the optical inverse method. Recently, the mathematical reconstruction methods based on ANNs were introduced to reconstruct the distorted image by MMFs27, including multilayer perceptron28, deep learning network29 and U-net30,31. However, the program-based ANNs cannot achieve physical image transportation in real space, and bulk optics-based SLMs pose a fundamental footprint limit towards micrometre-scale spatial optical signal transmission for MMF-based technologies on the tip of a fibre in compact photonic systems32,33,34.

Regarded as an ONN35, the free-space diffractive neural networks (DN2s)36 have been proposed as more efficient ANN approaches based on deep learning to directly process the optical matrix multiplication at the speed of light, and realizing the high number of connectivity in ANNs, such as optical image classification37, decryption and phase detection38. The DN2s offer unprecedented parallel processing capability for multidimensional optical inputs, where synthetic complex optical fields can be manipulated39. Furthermore, the free-space ONNs have also been demonstrated to reconstruct optical fields for scattering medium40, such as frosted glass41, and opaque occlusions42 using SLMs or three-dimensionally printed phase plates.

Thereby, introducing a fibre-integrated miniaturized DN2s to achieve the direct optical image transportation through MMFs would alleviate the necessity to use bench-top SLMs and is of great importance for current MMF-based technologies, including optical communications, optical computing and quantum science. However, traditional fabrication methods, such as ion-beam lithography43, and chemical-etching techniques44, are not suitable for three-dimensional (3D) MMF-integrated fabrication, as they fail to create 3D arbitrary structures for efficient light field manipulation at the fibre facet.

Here, we report the direct all-optical image transportation through a MMF using a miniaturized DN2s integrated at the distal facet. We used the 3D galvo-scanning two-photon nanolithographic (GS-TPN) fabrication approach to integrate a miniaturized DN2s with a footprint of 150 μm by 150 μm at the distal facet of a commercial 0.35-m-long MMF. Due to the physics-driven nature of the DN2s and the TM obtained according to the accurate vectorial theory of light propagation in the MMFs45, the fibre-integrated miniaturized DN2s based on the multilayer diffractive elements demonstrates the direct optical image transportation at the distal facet of an MMF.

Optical images at the fibre input can be reconstructed at the output of the DN2s for constant configuration of the MMF. The well-trained DN2s at the distal facet of the MMF achieved an image reconstruction feature size of approximately 4.90 μm with an image size of 65 μm by 65 μm, and an average optical intensity contrast of around 4%, corresponding to around 35% diffraction efficiency per diffractive layer. The fibre-integrated miniaturized DN2s also demonstrates a transfer learning characteristic, as the DN2s is equivalent to the inverse TM through an optical inference process based on the position-related TMs used in the training process. Transfer learning schemes were applied to the fibre-integrated miniaturized DN2s for the direct optical transportation of SLM-projected images of HeLa cells. Alternatively to the multiplane light converter designed by the optical inverse method26, the fibre-integrated miniaturized DN2s was developed on the basis of the optical forward propagation and optimization using the connectivity in ANNs. This concept alleviates the technological necessity of utilizing SLMs for future MMF-based technologies in compact photonic systems, including miniature rigid endoscope46, short-range optical communications17 and quantum photonics6.

Fibre-integrated DN2s for MMF image transportation

The conceptual design of the fibre-integrated miniaturized DN2s for MMF image transportation is illustrated in Fig. 1. A commercial MMF with a core diameter of 105 μm with a numerical aperture (NA) of 0.22 is utilized to transmit the optical images directly as a key component for MMF image transportation. A coherent, monochromatic continuous-wave laser at a wavelength of 532 nm was chosen to generate the optical images incident into the proximal facet of the MMF. This MMF supports around N = 4,650 spatial modes per polarization channel (given by N ≈ (πdNA/2λ)2, where d is the diameter of the fibre and λ is the wavelength of the incident light). Due to the varied velocities of a large number of guided modes in the MMF, the propagating optical images became speckle patterns at the MMF distal facet. The well-trained DN2s integrated at the distal facet of the MMF function as a physical wavefront correction device, where the amplitude and phase information propagating out of the MMF can be manipulated through the multiple layers of the DN2s, and desired optical images are reconstructed. Consequently, the miniaturized DN2s at the MMF distal facet achieve direct optical image transportation without the need to use SLMs.

 

Fig. 1: Schematic illustration of the fibre-integrated miniaturized DN2s for all-optical image transportation through a MMF.

figure 1

An optical image is incident on the proximal facet of a MMF, and a speckle pattern is induced by the MMF at the distal facet. By integrating a miniaturized DN2s on the distal facet of the MMF, the distorted wavefront (amplitude and phase) of the propagating optical image can be reconstructed. An optical image of a handwritten digit 3 was projected onto a MMF, and speckle patterns were generated on the distal facet of the MMF. After the optical reconstruction process through the DN2s, the optical image of handwritten digit 3 can be optically transported in a direct fashion.

Integration of the vectorial model of a MMF and DN2s

To accurately achieve the amplitude and phase correction at the distal facet of the MMF using miniaturized DN2s, the accurate vectorial model of an MMF should be utilized in the training process of the DN2s. However, unlike the traditionally widely used SMFs, where the transmitted modes are well defined as Gaussian distributions, the propagating modes in MMFs were believed to be chaotic, the mathematical modelling of which has been achieved recently46. These variations in the amplitudes and phases induced by the MMF mean the data cannot be directly applied to train DN2s, which require accurate datasets including the inputs and output speckles (amplitude and phase). Instead of adopting recently developed methods such as the digital holography method to measure the TM, we introduced the deterministic vectorial light propagation model within MMFs to train the DN2s (see Supplementary Note 1 for modelling details). We obtain the vectorial modelling results of the TMs for a 35-cm-long, 105-μm-core-diameter step-index MMF (Fig. 2a). Each row in the TM represents the amplitudes and phases of all output focal points for a single-input focal point mode sent into the fibre. Due to space constraints, the basis of modes for the TMs shown is reduced to a quarter of the full dimension, while the complete TMs are shown in Supplementary Fig. 1.

 

Fig. 2: Development process of the fibre-integrated miniaturized DN2s based on the complex TM of the MMF.

figure 2

a, Calculation of the TM of the MMF and the obtained complex TM, by which the intensity and phase information of the speckle patterns can be generated. b, Training process of the DN2s for MMF speckle pattern reconstruction. A group of training data consisting of the intensity and phase information of the speckle patterns is introduced into the multilayer DN2s model based on the Rayleigh–Sommerfeld theory, and a gradient descent optimization method is used in the training process of the DN2s.

After the TM acquisition, we can numerically represent the MMF as an optical system and obtain the amplitude and phase data of the speckle patterns needed to train the DN2s. The training dataset for DN2s was generated by multiplying the TM with a given input intensity distribution, and the output pattern (amplitude and phase) can be mathematically generated. A series of handwritten digits from the Modified National Institute of Standards and Technology (MNIST) database was input into the TM47. For each handwritten digit, the output intensity and phase distribution were obtained. An example with the digit 4 is shown in Fig. 2a, and the calculated output intensity and phase data for ten handwritten digits are shown in Supplementary Fig. 3. The reliability of the theoretical calculation is also demonstrated by comparing the similarity index (the matrix correlation coefficient) between the experimentally obtained speckle patterns and the theoretically calculated speckle patterns, as shown in Supplementary Note 2 and Supplementary Figs. 3 and 4. The average matrix correlation coefficient between the theoretical and experimental obtained speckle amplitudes is 0.758, proving that the theoretical calculation is an accurate model for describing MMF. The final training dataset consists of 15,000 randomly selected MNIST handwritten digits and their corresponding output amplitude and phase information, and another 5,000 randomly selected datasets for the test.

Numerical performance of the fibre-integrated DN2s

After the acquisition of the amplitude and phase information of the MMF-induced speckle patterns, the overall training datasets were used to train the multilayer DN2s for fibre end speckle reconstruction. During the training process, the multilayer DN2s diffracted and modulated many inputs numerically on the basis of the Rayleigh–Sommerfeld theory37. The schematic training process of the DN2s is shown in Fig. 2b, and further details about the training process are discussed in Supplementary Notes 3 and 4. Specifically, the first layer (the input layer) receives the amplitude and phase distribution from the fibre distal facet, and through the optical inference process performed in each of the diffractive layers, the wavefront of the fibre output can be modulated. Due to the physical wavefront manipulation fact, the output intensity was directly optimized to desired distributions in the training process; thus, the intensity distribution over (x, y) in the output plane of the DN2s was captured using a charge-coupled device (CCD) camera in the experimental setup. In consequence, a direct optical imaging process was realized using the fibre-integrated miniaturized DN2s. In the training of DN2s, a stochastic optimization method, namely adaptive moment estimation (Adam), was utilized to optimize the training process. The negative Pearson correlation coefficient (NPCC) and structural similarity index measure (SSIM) were both used to evaluate the MMF speckle pattern reconstruction performance of the DN2s. To efficiently train the DN2s, a recurrent training method was used. For every 10 training epochs of the total 200 training epochs, a group of test data was sent into the DN2s model, and the performance was evaluated by calculating the provisional SSIM and NPCC. If the SSIM is approaching 1, and NPCC approaching −1, the optimization of the DN2s is believed to be evolving in the correct direction, and the optimization continues. Otherwise, the algorithm reoptimizes the neural networks for higher SSIM and lower NPCC.

The training and testing results of the DN2s are shown in Fig. 3a. The evolution of the NPCC and the SSIM with an increasing number of training epochs suggested a well-defined recurrent training process, with the lowest NPCC value reaching −0.725 and the highest SSIM reaching 0.68. These results show that the DN2s were a successful model for retrieving the speckled optical field produced by an MMF. The numerical test results for speckle pattern reconstruction are shown in Fig. 3b; an average SSIM of 0.68 was obtained for the test dataset (handwritten digits from 0 to 9).

 

Fig. 3: Performance of the fibre-integrated miniaturized DN2s.

figure 3

a, The evolution of the NPCC and SSIM in the training and testing process of the three-layer DN2s. The NPCC is used as a loss function in the recurrent training/testing process and SSIM is used only in the testing process for evaluations. b, The performance of the network in reconstructing the input amplitudes on the basis of the output amplitude speckle patterns. Examples of the output amplitude speckle patterns and the reconstructed fibre input amplitude patterns produced by the DN2s are shown. The ground-truth number for each reconstructed image with respect to its corresponding grayscale label is shown. c, The numerically calculated phase matrices of the three-layer DN2s for MMF image reconstruction at the distal facet.

The eventual trained DN2s also produced consecutive layers of phase distributions for the physical construction of the multilayer DN2s. Figure 3c shows a plot of the phase matrix data for the three-layered DN2s. Each diffraction layer contained 120-by-120 cuboid diffraction pixels, with the modulation phases of the propagating light ranging from 0 to 2π. The physical dimensions of the diffractive neurons were 875 nm with a diffractive layer size of 105 μm by 105 μm covering the total facet of the MMF described in ‘Fibre-integrated DN2s for MMF image transportation’.

Fabrication of the fibre-integrated miniaturized DN2s

To integrate the DN2s on the distal facet of the MMF and achieve efficient wavefront manipulation for the output beam, we designed and printed a hollow tower structure on the distal facet of the MMF to expand and fully capture its output in free space and to hold the fibre-integrated miniaturized DN2s. A built-in-house 3D GS-TPN fabrication system was used to achieve this goal, owing to its advantages in fabricating arbitrary 3D structures with nanometre feature sizes, especially free-standing 3D structures on small surfaces (see Supplementary Note 10 for a detailed discussion). The phase values of each diffractive neuron in the DN2s were calculated to generate relative height distributions and then printed with IP-dip (commercial photoresist from Nanoscribe GmbH) in the shape of a cuboid. The 3D GS-TPN fabrication results are reported in Fig. 4a–c. The final DN2s fabricated on the distal facet of the MMF contained three diffraction layers with distinct neuron patterns; each of the diffractive neurons had a width of approximately 875 nm, the neuron density in the three-layer DN2s was 3.92 × 108 neurons cm−2, and the phase could be accurately modulated between 0 and 2π.

 

Fig. 4: Fabrication of the fibre-integrated miniaturized DN2s.

figure 4

a, A schematic diagram showing the 3D GS-TPN fabrication approach used to produce three-layered DN2s at the distal facet of a MMF. b, Experimental results of the miniaturized DN2s integrated at the distal facet of a MMF using the 3D GS-TPN fabrication method, showing SEM and white-light microscopy images. c, Zoomed-in SEM images of the three-layered DN2s on the distal facet of the MMF. The fabrication results of individual DN2s layers and a three-layer DN2 on cover glass are shown in Supplementary Figs. 21 and 22.

Experimental performance of the fibre-integrated DN2s

We experimentally tested the performance of the fibre-integrated miniaturized DN2s in reconstructing scrambled optical images transmitted through MMFs. In the experiments, a coherent laser source and a SLM were used to project optical images on the proximal facet of the MMF, and the output was detected with a CCD camera at the distal facet. The capturing of the reconstructed optical images was obtained by moving the imaging objective at different axial positions away from the fibre-integrated miniaturized DN2s. The corresponding results are shown in Fig. 5a. The experimental layout and detailed description of the characterization procedure are shown in Supplementary Fig. 23.

Fig. 5: Experimental characterization of the fibre-integrated miniaturized DN2s in the straight state.

figure 5

a, The experimental characterization results of handwritten digit 0 at various positions along the CCD camera imaging direction through an objective (OB). b, Representative experimental results of the reconstructed handwritten digits at the distal facet of the MMF. The average SSIM values for the experimental reconstruction results (light green) and the numerical reconstruction results (blue) are shown for each handwritten digit. c, The measured experimental image reconstruction feature size of the fibre-integrated miniaturized DN2s. The experimental data for handwritten digit 1, as shown by the dashed red line in Fig. 5b, is used for the analysis. The red line is the Gaussian-shaped fitting of the measured intensity profile (black dots). d, An example of the reconstructed amplitude input patterns for HeLa cell fluorescence images. The ground truth of each reconstructed image is also shown. Scale bars, 50 μm. The images were mathematically enhanced with a MATLAB image enhancement algorithm (see Methods for a detailed discussion of the enhancement method).

In the experiments, the positions of the MMF were carefully adjusted by using a pair of 3D fibre alignment microstages, and the rotations of the MMF were eliminated by copositioning the microstage to release the mechanical stress in the MMF. The miniaturized DN2s integrated at the distal facet of a MMF achieved high-quality speckle image reconstruction (50 handwritten digits images were experimentally incident on the MMF to test the experimental performance), with an average SSIM of 0.54 and an average NPCC of −0.65 (Fig. 5b). These values are slightly lower than the numerical results owing to the misalignment of the fibre facets. Moreover, the image reconstruction diffraction efficiency achieved in the experiment is around 10%, which is theoretically analysed in Supplementary Note 4.

As demonstrated in Fig. 5c, the DN2s at the distal facet of a MMF demonstrated a smallest image reconstruction feature size of approximately 4.90 μm for handwritten digits, which is higher than but approaching the resolution limit that can be achieved by a MMF with an NA of 0.22 (ref. 18). In addition, the fibre-integrated miniaturized DN2s proposed in this work provides an image size of 65 μm by 65 μm, and this result is strikingly advantageous over the imaging using SMFs8, where the imaging is achieved through a point-by-point scanning method, the image size of which is limited to the size of a diffraction-limited focus. A detailed analysis of the image reconstruction feature size and the image size is provided in Supplementary Note 5.

It is worth noting that the diffraction/transmission efficiency is notably influenced by factors such as the number of layers in the DN2s and the alignment accuracy in the experimental system, which impacted our final reconstruction results. The experimental reconstruction results collected by the CCD camera had low intensities and contrast (the enhancement process of the experimental reconstruction results are shown in Supplementary Fig. 24). Therefore, to reduce the effect of misalignment errors and enhance the reconstruction results, we used MATLAB to improve the image contrast. In addition, the numerical analysis of the diffraction/transmission efficiency of the DN2s in image reconstruction applications is detailed in Supplementary Notes 4 and 5.

Capability of transfer learning

Traditional ANN-based machine learning algorithms suffer from a common problem called transfer learning. In other words, ANNs are not capable of performing image reconstruction when the input datasets belong to a different category compared with the training dataset29. It is discovered that the proposed fibre-integrated miniaturized DN2s in our work can reconstruct SLM-projected HeLa cell images from the MMF speckles (Fig. 5d), with an average SSIM value of approximately 0.53, even though the HeLa cell images were not included in the training of the DN2s. The cellular optical image reconstruction results demonstrate that the miniaturized DN2s at the distal facet of the MMF can be potentially utilized in biological endoscopic imaging scenarios. The transfer learning characteristic is a direct result of the physics-driven nature of the DN2s, where the DN2s represent position-related input–output correlations in MMF-based systems, with inputs at certain positions generating different output patterns. Consequently, the DN2s enable an outstanding transfer learning capability.

Fibre bending effect on image reconstruction

Another challenge in using MMF for image transportation is the deformation effect of the fibre, where the disorder induced by the fibre deformation/bending greatly impairs the image reconstruction properties (the schematic diagram is shown in Fig. 6a). In the DN2s, the effect of fibre deformation on the performance of the fibre-integrated miniaturized DN2s was considered by incorporating the deformed-fibre dataset with the straight-fibre dataset DN2s training process. In this process, the TM for a 35-cm-long MMF bent at an angle of 90° was first obtained (Supplementary Fig. 5), and 6,000 training data pairs and 500 test data pairs for the deformed fibre state were generated and introduced into the training process.

 

Fig. 6: Experimental characterization of the fibre-integrated miniaturized DN2s in a bent state (bending angle of 90°).

figure 6

a, The schematic setup for experimental characterization of the fibre-integrated miniaturized DN2s in a bent state (bending angle of 90°). b, The experimental image reconstruction results in the bent state. The experimental measurement of the fibre-integrated miniaturized DN2s was evaluated by calculating the SSIM of the reconstructed images, and the SSIM values are shown in the insets of the figure. The numerical reconstruction results are shown in Supplementary Fig. 8. Scale bar, 50 μm.

At the bent state, the fibre-integrated miniaturized DN2s can numerically reconstructed the speckle pattern transmitted by the MMF, with an average SSIM of around 0.45 (Supplementary Fig. 8). However, the experimental performance of fibre-integrated miniaturized DN2s degraded notably at a bending state and achieved an imaging reconstruction SSIM around 0.15 (Fig. 6b). The discrepancy between the numerical and experimental results might result from the fact that the bending configuration in the experiment cannot be exactly the same as that in the numerical modelling, and the fact that different bending angles may lead to similar output light fields (the memory effect) would introduce ambiguity into the training process, which can be compensated by using the more accurate TM-obtaining methods48, where the bending effect can be fully considered.

The realization of the direct optical image transportation through MMFs with a small device footprint and cellular scale has been a long-unsolved challenge for compact photonic systems including optical imaging, optical information communication and quantum science in hybrid integrated photonics. To realize the direct MMF image transportation, we numerically investigated and experimentally validated the miniaturized DN2s integrated at the distal facet of a commercial MMF. The fibre-integrated miniaturized DN2s can physically and optically reconstruct scrambled images propagating through the MMF at the speed of light. This miniaturized and compact device integrated at the fibre end operates in the visible wavelength region and processes the amplitude and phase information of the speckle pattern through an optical inference process, optically transporting the unscrambled images through the MMF with an image reconstruction feature size of approximately 4.90 μm with an image size of around 65 μm by 65 μm, and an average optical intensity contrast of around 4% for fibre-integrated miniaturized DN2s with three layers (details are provided in Supplementary Note 5).

Alternative to the MMF wavefront manipulation methods based on SLMs designed by the optical inverse25,26, the fibre-integrated miniaturized DN2s achieves single-shot reconstruction of the scrambled images through MMF with a 150-μm-by-150-μm footprint, but with the trade-off of eminently reduced image reconstruction intensity contrast. Details about the number of channels of the DN2s and image reconstruction intensity contrast are discussed in Supplementary Note 5 based on the numerical and experimental analysis results.

In terms of computational costs, the fibre-integrated miniaturized DN2s for MMF image transportation consumes much fewer training resources compared with the ANN algorithms used in MMF speckle reconstruction, in which billions of hyperparameters are used28, while the fibre-integrated miniaturized DN2s only requires less than 0.04 million hyperparameters and 4–6 h for the training. The resources needed by the fibre-integrated miniaturized DN2s are three orders of magnitude lower than conventional ANN algorithms (discussion in Supplementary Note 8 and Supplementary Table 1). Moreover, the fibre-integrated miniaturized DN2s also enables real-time image transportation, where the achieved imaging speed is around 100 frames s−1 (Supplementary Note 9).

Although potential challenges exist for applying the proposed method to dynamic fibre configurations, such as the lack of reconfigurability, lack of immunity to dramatic temperature variations, relatively low diffraction efficiency and inadequate mechanical stability for larger numbers of diffractive layers using the 3D GS-TPN fabrication method (see discussions in Supplementary Note 7 for the exploration of the performance of the all-optical DN2s at the distal facet in reconstructing natural scenes), the physics-driven nature of the fibre-integrated miniaturized DN2s at the distal facet provides an unprecedented micrometre-scale platform to harness the power of recent advances in DN2s for MMF-based technologies in compact photonic systems, such as miniature rigid endoscope10,46, MMF optical signal transmission1, MMF modes sorter17 and short-range optical interconnects for quantum information processing in hybrid integrated photonics15,34. Moreover, the successful integration of multilayer DN2s on the fibre facet can also be applied to a diversity of fibre systems, including single-mode fibres8, gradient index fibres49 and disordered fibres50.

Methods

3D GS-TPN

The fibre-integrated miniaturized DN2s integrated at the distal facet of the MMF was achieved using a 3D GS-TPN fabrication system built in-house that incorporates a femtosecond laser source (Coherent Axon 1064), second-harmonic generation module (Coherent SGH), piezo nanotranslation stage (PI-545), one pair of two-dimensional galvo mirrors (Thorlabs GVS002), scan lens (Thorlabs SL50-CLS2) and tube lens (Thorlabs TTL200MP) utilized to reduce the focus aberration during the galvo-scanning fabrication process. The mechanical and dynamic control of the system is controlled by a home-developed program, by which the 3D CAD models can be translated into the fabrication documents required by the program. The galvo mirrors rotate at a fast speed without the movement of the nanopiezo translation stage, thus enabling ultrafast movement of the fabrication voxel.

During the fabrication of the miniaturized DN2s integrated at the distal facet of the MMF, a 35-cm-long MMF (Thorlabs, FG105LCA, NA 0.22) with a core diameter of 105 µm was first cleaved to obtain a flat end face. Then, the MMF was installed on a specially designed microstage that could be used to adjust the orientation of the MMF. A hollow tower structure with a height and width of 75 µm and 150 µm, respectively, was designed to cover the total output facet of the MMF to ensure efficient wavefront manipulation on the MMF. The height of the hollow tower structure was determined according to the direct output facet of the MMF. To prevent the fibre beam from impacting the sidewall of the tower, the first layer in the DN2s was designed to have a diameter much larger than the mode field diameter of the fibre output. A video of the integration process is demonstrated in Supplementary Video 4, in which the video clips showing the multilayer fabrication process are provided and each diffraction layer was carefully imaged along the z direction. Due to the high-precision alignment and fabrication capability in the 3D GS-TPN system, the multilayer DN2s can be successfully integrated on the fibre tip. A close-up scanning electron microscopy (SEM) image verifies the successful fabrication of the designed fibre-integrated miniaturized DN2s (Fig. 4). Further details regarding the design and fabrication processes can be found in Supplementary Figs. 20–22.

Characterization setup

In the characterization experiments, a coherent continuous wave laser with a wavelength of 532 nm (JCOPTIX-532), a SLM (LBTEK-2K-8), a polarized beam splitter (JCOPTIX-PB532), to generate the optical images incident on the fibre-proximal facet, and a 4-f imaging system were aligned with two objectives with a magnification of 20× and a NA of 0.4 (Olympus 1-U2B225) at the proximal and distal facet of the MMF. This setup can generate optical holographic images and images incident on the proximal facet of the MMF. The alignment of the MMF is controlled by a pair of 3D fibre alignment stages (Newport 466A). Details of the layout of the setup are shown in Supplementary Fig. 23.

Training and test data

The MNIST handwritten datasets are obtained from the MNIST database with original pixel numbers 28 × 28. The HeLa Cell image datasets are obtained from the Murphy lab (http://murphylab.web.cmu.edu). All the datasets are resized to have pixel numbers of 120 × 120 in this work. In addition, the dataset with complicated natural scenes (the Imagenet database, https://www.image-net.org/) was also utilized to numerically test the performance of the fibre-integrated miniaturized DN2s in reconstructing the scrambled natural scenes through MMF, and the detailed results and discussion are presented in Supplementary Note 7.

Experimental obtained data enhancement

The experimentally obtained images are normalized by the intensity distribution per image, where the contrast of patterns is mathematically enhanced by a MATLAB code. A schematic diagram of the data enhancement process is shown in Supplementary Fig. 24.