A Computational Microspectrometer Based on Binary-Image-Generated Freeform Metasurfaces for Spectral Sensing

In the trend of spectrometer miniaturization, the design of combining computational imaging with the metasurfaces has been proved to be an efficient and feasible solution. Nevertheless, determining the optimal filter array design remains a compelling subject for ongoing research. A computational microspectrometer consisting of a planar array of broadband optical filters is proposed, which are formed by low-loss freeform dielectric metasurfaces. Diverse metasurface designs are obtained by using binary graph generation technology, and rich spectral responses are obtained. The final performance of microspectrometer depends on the trade-offs between reconstruction time, relative error, footprint, and resolution. To optimize these trade-offs, we have improved the existing freeform metasurface design scheme and optimized the filter array design. Simulation results show the proposed microspectrometer can successfully reconstruct the spectra over the 380 to 680 nm spectral range with a resolution of 1 nm. In summary, we propose an integrated design including meta-pixel design, filter combinations and simulation test flow, which leads to an impressive performance microspectrometer.

One of the most representative techniques is the computational microspectrometer on chip, which uses a series of broadband sampling filters with different spectral characteristics to sample the entire spectrum of the incident light, and uses advanced signal processing algorithms to reconstruct the spectrum [6].Compared to split-detection structures, computational spectrometer requires fewer channels to achieve larger bandwidth and comparative resolution, while provides shorter operating time, higher signal-to-noise ratio, and smaller footprint [1].To achieve these broadband sampling filters, various nanostructures have been employed, including plasmonic filters [7], photonic crystal plates [8] and metasurfaces [9], [10], [11], [12], [13], [14], [15], [16], as well as in-plane layered waveguide filters [17] and reconstructed waveguide couplers [18].In these impressive works, compressive sensing (CS) and deep learning (DL) are widely used as two common reconstruction strategies.Compared with DL, CS stands out by not requiring huge datasets and advantages in interpretability, and adaptability to sparse signals [12].
Different filters in the array exhibit distinct optical responses.Reducing the degree of cross-correlation coefficient between these filters is essential for improving spectral reconstruction.In addition, the spectral reconstruction effect is also affected by the number of filters.Given this, the customizable metasurface can effectively meet the above design requirements.First, it is compatible with complementary metal oxide semiconductor (CMOS) fabrication technology.Second, nano-level manufacturing of metasurface allows for extremely compact device footprint.Third, there are many CMOS-compatible metasurface materials, such as silicon nitride (Si 3 N 4 ), silicon (Si), and titanium dioxide (TiO 2 ), that can be utilized in integrated spectrometers for different wavelength ranges based on different properties [18], [19], [20], [21], [22], [23], [24], [25].
In this paper, a freeform metasurface design method based on binary-pixel generation is proposed, and the correlation coefficient of the filter array is reduced by Particle Swarm Clustering Optimization (PSCO) to meet the requirements of CS algorithm.We obtain 2000 different designs of a-Si metasurfaces with freeform patterns on fused silica substrate by binary-pixel generation.And we obtain the corresponding transmission spectra from 380 nm to 680 nm through rigorous coupled-wave analysis (RCWA).In the design of filter channels, we use PSCO to determine the optimal filter combination, considering a range of 16 to 36 filter channels, and the correlation coefficients are reduced by an average of 25.46%.By balancing reconstruction error and reconstruction time, we identify the optimal number of filter channels as 25 [26], [27].We successfully reconstructed the spectrum with 1-nm full width half maximum (FWHM) narrow peak with an average RMSE of 0.0206, and a high average fidelity of 98.03%.And a resolution of 1 nm is achieved for spectrum with dual-narrow-peak with a RMSE of 0.018 and a fidelity of 97.53%.The angle dependence analysis also shows the design is robust to incident angle variation.

II. DESIGN AND WORKING PRINCIPLE
Fig. 1. shows the working principle of the proposed computational microspectrometer.It consists of an array of filters on top of a detector array.The number of filters is denoted as M. Each filter is made of a metasurface supercell.The transmission spectra of the filters are distinct with each other.So, their transmission functions T(λ) can form a sensing matrix T, where λ indicates the wavelength.The unknown spectral information f(λ) of the incident light is thus encoded by the transmission function T(λ) of each filter when the light transmits through the filter array.The detector array measures the transmitted light intensity from each filter I.The sensing matrix T can be measured from experiment.The unknown spectrum of the incident light can be reconstructed from the sensing matrix T and the measured values I from the detectors.Thus, the target of the filter design is to construct a sensing matrix T that can maximizes the perception of incident spectrum information with fewer filters [28].
Here, 25 broadband filters are used.The working spectral range is 380 to 680 nm.Ignoring the effect of noise, the measured light intensity I i modulated by the filter i can be expressed by: where I i is approximately written as the summation of N discrete values.N equals to 601 here and f consists of 601 spectral components from 380 to 680 nm after discretization.Thus, the above equation for M filters can be discretized similarly and approximately written by a set of linear equations as Since M<N, the above equations exhibit an underdetermined problem.
CS framework [21] is exploited as the reconstruction algorithm considering its efficiency in sampling and reconstruction.According to CS [29], natural signals usually have sparse representations in some transform domains.Hence the input spectrum f can also be sparsely expressed by a sparse base matrix Ψ and a sparse signal s as f = Ψs.Here, Ψ N × N is obtained by dictionary learning method of singular value decomposition with K-means (K-SVD) [30].Then the corresponding sparse signal s can be reconstructed by Lasso regularization as below where β is a non-negative regularization parameter.Thereby, the reconstructed spectrum f can be represented by the sparse base matrix Ψ as f = Ψŝ, where ŝ is the sparse representation of the original spectrum f [31].

A. Filter Design
CS relies heavily on irrelevance and incoherent sparsity [28].Therefore, for computational microspectrometers based on CS method, low-correlation filter spectral responses must be obtained.In the design of metasurfaces, various nanopillar shapes, dimensions and materials need to be considered.In our design, by fixing the pitch of the metasurface units, diverse transmittances are obtained by utilizing freeform metasurfaces.The freeform metasurfaces pattern are generated using an image generation process and are designed to satisfy C-4 symmetry purposely to achieve polarization independence.The algorithm for generating the freeform-shaped patterns is illustrated in Fig. 2.
Firstly, the continuity constraint is applied to avoid abrupt break in the image pattern, and symmetrical operations are carried out by defining the diagonal line as the symmetry axis, a random lower triangular matrix of 0s and 1s is generated and subjected to symmetric operations.Then a binary image of 16 × 16 pixels is randomly generated as shown in Fig. 2(a).The black and white blocks indicate 1 and 0 to represent silicon (i.e., unetched region) and etched region, respectively.The generated data are converted into a binary image of 16 × 16 pixels.Secondly, the image is rotated three times by 90˚each time to generate a binary image of 32 × 32 pixels with C-4 symmetry as Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.shown in Fig. 2(b).We then use the generated freeform pattern as the topological structures of metasurface units.Similar pixels generation have been applied to spectrometer filters design, differing primarily in pixel size and the generation process [16], [32].
As shown in Fig. 2(c), the metasurface unit is on top of a silica substrate.The refractive index of the etched region is set to be 1 since the area is filled with air.We set period P = 1600 nm, silicon thickness h = 200 nm, and silica substrate H = 1000 nm.The size of a single pixel is set as 50 nm × 50 nm.The size of each filter array is set to 40 × 40 metasurface units (64 × 64 μm2), ensuring close to the periodic boundary conditions of simulation.The size of microspectrometer is designed as 320 × 320 μm 2 .RCWA algorithm is used to calculate the transmission spectra of the freeform Si metasurface supercells.The corresponding transmission spectra of three metasurface filters are shown in Fig. 3.We acquire 2000 filter spectral responses in the spectral range from 380 to 680 nm with a 0.5-nm interval.The average transmission efficiency of the 25 selected filters is between around 0.25 and 0.5 over the working spectral range.
During the signal reconstruction process in CS, multiple filters are used to sample the original signal and reconstruct it.Increasing the number of filters generally leads to better reconstruction results, as more filters can capture the details and features of the signal better, thereby reducing reconstruction errors.However, as the number of filters increases, the processing and computation time required also increases, resulting in longer reconstruction time.Moreover, the footprint also increases proportionally, which will reduce spatial resolution in spectral imaging scenarios.Therefore, a trade-off needs to be made among reconstruction time, error, and footprint.Optimal number of filters needs to be selected for a specific application to achieve the best compression and reconstruction performance.To address the above challenges, we mainly analyze from the perspectives of filter selecting mechanism and reconstruction time and error.In this paper, reconstruction fidelity [32] and error RMSE are introduced to quantitatively compare the original and reconstructed spectra as: where X and Y are the normalized original and reconstructed spectra, respectively, and f m and fm are the corresponding intensities at the m-th wavelength sampling point.We use the mean cross-correlation coefficient to calculate the correlation of each transmission spectrum with the other transmission spectra [33].Smaller absolute value of cross-correlation coefficient means the transmission spectrum presents better non-correlation with the others.
A simple way to acquire low cross-correlation sensing matrix is, assuming there are multiple transmission spectra, after calculating the average correlation coefficient between each transmission spectrum and the others The first n spectra with the lowest overall mean correlation coefficient are selected.The process is referred to simple sort method.The correlation coefficient is defined as: where t i and t j are the transmittance of different spectra, respectively, E means the average value, and δ indicates the standard deviation.The mean correlation coefficient ρ of the i-th column is defined as: However, a drawback arises from this approach, as the spectra with the lowest average correlation coefficients may exhibit high correlations among themselves.
Therefore, we introduce a PSO algorithm for clustering to acquire the optimization sensing matrix T. Particle swarm optimization (PSO) [26] is a widely recognized and extensively used metaheuristic algorithm.To overcome the weakness of PSO algorithm easily getting stuck in local optimal solutions, we employ a developed PSO algorithm called PSCO that was proposed recently to reliably achieve global optimal solutions [27].In PSCO, a group of particles explores and exploits solutions by moving within the search space.In the context of our work, we define the average correlation coefficient as the objective function to select variable combinations.By treating each transmittance combination as a particle, PSCO iteratively updates the positions and velocities of these particles, aiming to converge towards clusters of variables that exhibit the desired attributes.This iterative process effectively selects combinations with the lowest correlation.The main goal is to find the global optimal solution, which corresponds to a subset of these transmittance combinations that exhibit the lowest average internal correlation.
We set the number of filters commonly used in the previous work [8], [21], [31] as a reference, and set the maximum value to 36 and the minimum value to 16.We select the 36 filters based on the PSCO method and used to reconstruct 20000 randomly generated Gaussian curves.The reconstruction experiment is conducted 21 times when filter number decreases from 36 to 16.Each time the number of filters is decreased by 1, and the average reconstruction RMSE and time were recorded.The results are shown in Fig. 4(a), illustrating the trade-off between RMSE and time, and in view of balancing the two factors, we decided to Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.choose the 25 filters to build the filter array.The experiment provides a guidance for selecting the appropriate number of filters in the spectral reconstruction based on CS.
As shown in Fig. 4(c), simple sort and PSCO are used to select different numbers of filters, and the cross-correlation coefficient obtained by PSCO showed varying degrees of reduction compared to simple sort.The cross-correlation coefficient of the 25 simple sort filter array is 0.28, while the PSCO is 0.21, which decreased by 25.16%.The correlation coefficients of 16 to 36 different number of filter arrays are reduced by an average of 25.46%.The 25 corresponding shapes are shown in Fig. 4(b).It is highly desirable to use as few filters as possible to maximize the spatial resolution that the sensor could offer for spectral imaging.We conduct spectral reconstructions with our freeform metasurface filter array.

B. Spectral Reconstruction
To test the reconstruction performance of narrowband spectra, we reconstructed a series of narrowband and broadband spectra, as shown in Figs. 5 and 6, respectively.The dash lines and solid lines represent the ground truths and the corresponding reconstructed spectra, respectively.
In the process of reconstruction, we added Gaussian white noise to represent measurement noise.Ground truths and reconstructed spectra are normalized for comparison with a signalto-noise ratio (SNR) of 20 dB.The peaks in Fig. 5(a) have a FWHM of 1 nm and are located between 400 and 660 nm with 20-nm space.The average RMSE is 0.0206, and average fidelity is 98.03%.Fig. 5(b) shows the zoom-in view of the reconstructed  spectrum centered at 520 nm.The RMSE of the reconstructed dual-peak spectrum is 0.018 and fidelity is 97.53%.The peaks are separated by 1 nm and the FWHMs are 1 nm at 524 and 525 nm, respectively in Fig. 5(c).The dual-peak reconstruction result shows a 1-nm resolution.The RMSE of random broadband spectrum is 0.0173 shown in Fig. 6(a).
In addition, we also test the reconstruction performance of multiple narrow peaks in one spectrum as shown in Fig. 6(b).It can be seen the reconstructed spectrum matches well with the ground truth and the RMSE is 0.0201, the fidelity is 96.03%.
The original filter array is calibrated under vertical conditions, with the electric field vector vibrating parallel to the incident surface, and the light does not Reflect.However, when the light is inclined incident, refraction occurs.In this case, the electric field vector of the incident light is decomposed into two components: one perpendicular to the surface and the other parallel to the surface.The change in the angle of incidence causes the response of the filter array's transmittance (absorption or reflection) to change.The vertically-calibrated transmissions are still used in reconstruction, which leads to inevitable errors.To investigate the angle dependency of our filter arrays, we conduct a simulation experiment at three different incident angles: 5°, 10°, and 15°.Firstly, we established a mapping relationship between the incident angle and the transmission matrix T M × N is calibrated Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.at normal incident light computed by RCWA.Then We defined T as the transmission matrix at incident angle θ, and compared its reconstruction performance with the normal incident transmission matrix T. We generated a dataset of 20000 random Gaussian spectra and measure the RMSE of the reconstruction results using T relative to the original transmission matrix T.
As shown in Fig. 7, The simulation results demonstrate that our design exhibits high stability, with the reconstruction RMSE for all three angles concentrated below 0.03.This indicates that our designed filters have strong robustness to small angle variations in the incident angle.

IV. CONCLUSION
In this work, we propose a computational microspectrometer based on freeform metasurfaces designed with binary image generation.We designed 2000 patterns and selected the 25 designs with the lowest average cross-correlation coefficient as the sampling units of the spectrometer, based on PSCO optimization.Furthermore, we evaluated the reconstruction stability under three different angles, the RMSE of broadband spectra is about 0.01, and that of narrowband spectra is about 0.03, showing good angular stability.In our future work, we can reduce the cross-correlation coefficients and the number of channels for sampling by increasing the number of binary graph pixels.In addition, this flexibility in performance customization can be adapted to a variety of material platforms and applied to a wider wavelength range, enabling more diverse applications.

Fig. 1 .
Fig. 1.Illustration of the proposed computational microspectrometer.Different colors in the filter array represent filters with distinct filter characteristics.

Fig. 2 .
Fig. 2. Illustration of freeform-shaped pattern generation process.(a) Image pattern of 16 × 16 pixels with a symmetric axis denoted by the black line.(b) Image pattern of 32 × 32 pixels after rotation.(c) Generated freeform metasurface.

Fig. 4 .
Fig. 4. (a) Average reconstruction RMSE and time comparison of different filter numbers.(b) The 25 freeform shapes to construct the freeform metasurface filters corresponding to the 25 selected transmission spectra.(c) Comparison of average cross-correlation coefficient between simple sort and PSCO filter combinations.

Fig. 5 .
Fig. 5. (a) Reconstructed results for a series of narrowband spectra (solid line) and comparison with the ground truth (black dashed line).(b) Reconstructed spectrum of single-peak spectrum centered at 520 nm.(c) and (d) Reconstruction of a spectrum with dual-narrow peaks.

Fig. 6 .
Fig. 6.(a) Reconstruction of a random broadband spectrum.(b) Reconstruction of a spectrum consisting of six peaks, each with a distance of 40 nm and a FWHM of 2 nm.

Fig. 7 .
Fig. 7. (a) Boxplot of RMSEs of spectral reconstructions at different angles.(b) Comparison between reconstruction results at three different angles, reconstruction result using original transmission matrix at normal incidence, and ground truth.