• Photonics Research
  • Vol. 13, Issue 5, 1172 (2025)
Jia Shi1,2,5,*, Guanlong Wang1, Shaona Wang1, Wenjing Yu3..., Ling Liang4, Weiling Fu4, Pingjuan Niu1, Jianquan Yao2 and Xiang Yang4,6,*|Show fewer author(s)
Author Affiliations
  • 1Tianjin Key Laboratory of Optoelectronic Detection Technology and System, School of Electronic and Information Engineering, Tiangong University, Tianjin 300387, China
  • 2Key Laboratory of Opto-Electronics Information Technology (Ministry of Education), School of Precision Instruments and Opto-Electronic Engineering, Tianjin University, Tianjin 300072, China
  • 3Department of Laboratory Medicine, Daping Hospital, Third Military Medical University (Army Medical University), Chongqing 400038, China
  • 4Department of Laboratory Medicine, Southwest Hospital, Third Military Medical University (Army Medical University), Chongqing 400038, China
  • 5e-mail: shijia@tiangong.edu.cn
  • 6e-mail: yangxiang@tmmu.edu.cn
  • show less
    DOI: 10.1364/PRJ.547255 Cite this Article Set citation alerts
    Jia Shi, Guanlong Wang, Shaona Wang, Wenjing Yu, Ling Liang, Weiling Fu, Pingjuan Niu, Jianquan Yao, Xiang Yang, "Efficient inverse design for tailoring a terahertz metagrating," Photonics Res. 13, 1172 (2025) Copy Citation Text show less

    Abstract

    The fast and accurate design of terahertz devices for specific applications remains challenging, especially for tailoring metadevices, owing to the complex electromagnetic characteristics of these devices and their large structural parameter space. The unique functionalities achieved by metadevices come at the cost of structural complexity, resulting in a time-consuming parameter sweep for conventional metadevice design. Here, we propose a general solution to achieve efficient inverse design for a terahertz metagrating via machine learning. Metagratings with different structural parameters were selected as illustrations to verify the effectiveness of this method. As proof-of-principle examples, the metagratings predicted via the inverse design model are numerically calculated and experimentally demonstrated. Initially, the physical modeling of a metagrating is performed via the finite element method (FEM). A spectrum dataset obtained from FEM simulation is prepared for the training of machine learning models. Then, trained machine learning models, including the Elman neural network (Elman), support vector machine (SVM), and general regression neutral network (GRNN), are used to predict probable structural parameters. The results of these models are compared and analyzed comprehensively, which verifies the effectiveness of the inverse design method. Compared with conventional methods, the inverse design method is much faster and can encompass a high degree of freedom to generate metadevice structures, which can ensure that the spectra of generated structures resemble the desired ones and can provide accurate data support for metadevice modeling. Furthermore, a metagrating tailored by an inverse design is used as a biological sensor to distinguish different microorganisms. The proposed data-driven inverse design method realizes fast and accurate design of the metagrating, which is expected to have great potential in metadevice design and tailoring for specific applications.

    1. INTRODUCTION

    Metasurfaces, which are composed of two-dimensional artificial material structures at the subwavelength scale, have demonstrated unparalleled capabilities in wavefront manipulation of the amplitude, phase, and polarization of electromagnetic waves [1,2]. As promising resonant metasurfaces with diffractive tunability, metagratings have been developed to design metadevices with novel applications in optical and terahertz sensing, communication, imaging, and energy applications [35], including biosensors [6], augmented reality [7,8], polarimetric imaging [9], photovoltaics [10], metalenses [11,12], and high-quality resonators [13,14]. In particular, dielectric metagratings have shown great potential as compact and high-performance wavefront manipulation platforms with low loss, high efficiency, and sensitivity due to their tailored structural parameters [1518]. However, the prevailing dielectric metagratings with advanced functionalities demonstrate an increased level of structural complexity. Comprehending how subwavelength-scale meta-atoms in dielectric metagratings can be optimally tailored to obtain a set of specific design parameters for specified responses is always a challenging inverse problem.

    To effectively design intricate meta-atoms to obtain the desired spectra, many numerical simulations are indispensable within most metaheuristic methods. The conventional design methodology depends on iterative numerical full-wave simulations, such as the finite element method (FEM), finite integration technique (FIT), and finite difference time domain (FDTD) methods. Nevertheless, the optimization of meta-atoms through numerical simulations has proven to be computationally expensive because of the immense number of potential feature combinations in the large structural parameter space. For example, the computation of electromagnetic field profiles via FEM may entail an extensive simulation time, ranging from several minutes to hours, depending on the volume of the photonic device, to analyze the optical transmission response. Following the assessment of the calculated result and the target response, the design undergoes updates through numerical optimization of the structural parameters. Striving for exceptional performance, the optimization of multiple structural parameters comes with substantial computational expenses and often requires hundreds of thousands or even millions of simulations to achieve a design that meets the desired criteria.

    Machine learning, as a data-driven approach, can be trained to provide high-efficiency design processes [19,20]. Owing to its extraordinary ability to capture essential features from large volumes of high-dimensional data, machine learning has garnered significant attention in various domains, such as plasmonics [21], metamaterials [22], grating couplers [23], photonic crystals [24,25], molecular biosensing [26], photonic mode field distribution [27], and optical communications [28,29]. Machine learning enables automatic learning of the underlying relationships between neurons in different layers (specifically, the relationship between photonic structures and corresponding optical responses) from training data, the ability of which facilitates the determination of desired functionality, thereby resulting in substantial acceleration and simplification of the design process. The structural design achieved through this approach can be accomplished within several milliseconds, completely bypassing the numerical optimization process [22,30]. Capitalizing on exceptional design and optimization capabilities, machine learning has been successfully applied in the design of metasurfaces for diverse applications, including metalenses [3134], beam deflectors [3537], and functionality multiplexing [38]. Metagrating-based devices equipped with the ability to manipulate wavefronts quantitatively have the potential to facilitate practical applications, but they are limited by complex and time-consuming structural design. Therefore, developing new inverse design methods based on machine learning for fast and accurate metagrating design is highly desirable.

    In this work, an efficient inverse design method was demonstrated for terahertz metagratings. The principles and characteristics of dielectric metagratings are analyzed. It can provide efficient wavefront manipulation by tailoring meta-atoms with asymmetric scattering patterns and shows great potential in resonant terahertz functional devices. To overcome the challenge of designing the geometric structure of meta-atoms with desired spectral characteristics for specific applications, an inverse design model based on machine learning is designed to predict the specific geometric parameters of metagratings via the resonant characteristics of the transmission spectrum. The prediction performances of different modeling methods were compared and analyzed comprehensively. Experimental demonstrations have been used to verify the effectiveness of the inverse design method. As a proof of concept, the inverse design of a tailored terahertz metagrating for microorganism sensing was demonstrated for biological application.

    2. RESULTS AND DISCUSSION

    A. Principle and Characteristics of Dielectric Metagrating

    In the wavefront manipulation of electromagnetic waves, the grating equation provides a description of the specific angles at which the diffractive orders occur for a given period and operating wavelength. When considering normal incidence, if the scattering response of the grating is symmetric, it results in an equal distribution of power into both positive and negative diffraction orders [11]. Emerging dielectric metagratings can overcome this limitation by controlling the scattering directivity to a specific diffraction order [39]. In this work, the meta-atoms of the metagrating are designed by unit cells containing two cylinders for operating terahertz waves, as shown in Fig. 1(a). The transmission follows the grating equation [40] mλ=s(ntsinαtnisinαi),where m is the diffraction order, s is the grating periodicity along the diffraction direction, αt and αi are the angles of refraction and incidence, respectively, and nt and ni are the refractive indices of the two media. With the normally incident electromagnetic wave in air, the grating equation can be described as jλ=Psinα.

    (a) Schematic of the metagrating with controlled energy distribution among the supported diffraction orders. The meta-atoms of the metagrating are used to control the scattering directivity to a specific diffraction order. (b) Relationship between the diffraction period and bending angle of a metagrating with a normally incident terahertz wave. (c)–(e) The simulated electric field distributions of a metagrating with the energy concentrated at different diffraction angles (α), which is achieved by controlling the diffraction period of the metagrating arrays. (f) Transmission spectra of different diffraction orders T0, T−1, and T+1.

    Figure 1.(a) Schematic of the metagrating with controlled energy distribution among the supported diffraction orders. The meta-atoms of the metagrating are used to control the scattering directivity to a specific diffraction order. (b) Relationship between the diffraction period and bending angle of a metagrating with a normally incident terahertz wave. (c)–(e) The simulated electric field distributions of a metagrating with the energy concentrated at different diffraction angles (α), which is achieved by controlling the diffraction period of the metagrating arrays. (f) Transmission spectra of different diffraction orders T0, T1, and T+1.

    The operating principle of the terahertz metagrating is schematically depicted in Fig. 1(a). It consists of two solid cylinders with height h and diameters d1 and d2. The gap between adjacent cylinders is set as g. The diffractive and nondiffractive periods of the meta-atoms are Px and Py, respectively. With different structural parameters, a metagrating can be designed for wavefront manipulation by controlling the scattering directivity of the meta-atoms to a specific diffraction order. The diffractive period Px is designed to manipulate the transmission angle and efficiency of different diffraction orders. The nondiffractive period Py is chosen to be sufficiently small to avoid diffraction in the air in a specific direction while maintaining a high density of the array simultaneously. By suitably designing meta-atoms, a metagrating can realize multiple wavefront manipulation functionalities because of its powerful ability to regulate electromagnetic waves. The meta-atoms of the metagrating array consist of two cylinders and are designed to bend normally incident terahertz waves in the designed bending direction. As the diffraction period increased from 1 mm to 100 mm, the bending angle of the metagrating at different frequencies increased, as shown in Fig. 1(b). To show the manipulation ability of the metagrating, the simulated electric field distributions of the metagrating and transmission spectra of arbitrarily desired diffraction orders, such as T0, T1, and T+1, are shown in Figs. 1(c)–1(f), which were obtained by using a commercial finite element solver (COMSOL Multiphysics). This result indicates that the transmitted energy can be concentrated at the desired diffraction angle. With increasing Px, the bending angle of T1 decreases, which agrees with the relationship between the diffraction period and deflection angle, as shown in Fig. 1(b). Further analysis of the spectra in Fig. 1(f) shows that spectral resonance occurred in the designed terahertz metagrating. Such dielectric metagratings can provide efficient wavefront manipulation by tailoring meta-atoms with asymmetric scattering patterns and show great potential in resonant terahertz functional devices.

    B. Inverse Design of the Terahertz Metagrating

    In the design of metagratings, designing the geometric structure of meta-atoms with desired spectral characteristics for specific applications is challenging. Conventional methods for the design of meta-atoms are performed by parameter scanning in electromagnetic simulations until the desired transmission spectrum is obtained, for example, via the FEM. Exploring the intricate relationship between the electromagnetic response and various geometric parameters of metagratings through time-consuming parameter scanning incurs a high computational cost owing to the exhaustive traversal of the parameter space. The efficiency of the device design and variability analysis can be significantly enhanced if it becomes feasible to predict results on the basis of a limited dataset of simulation results. Machine learning methods offer data-driven approaches that can effectively predict responses for unknown data via classification, clustering, and regression methods [41]. Remarkably, trained machine learning models can swiftly predict the geometric parameters of metagratings compared with conventional simulation methods [42,43]. Here, the inverse design model based on machine learning is designed to predict the specific geometric parameters of the metagratings by the resonant characteristics of the transmission spectrum, which is defined and illustrated in Fig. 2.

    (a) The inverse design model and (b) its training and testing processes.

    Figure 2.(a) The inverse design model and (b) its training and testing processes.

    As shown in Fig. 2(a), the inverse design model takes the electromagnetic responses (arbitrary transmission spectra of arbitrary diffraction order simulated by the FEM) as the input and predicts the corresponding geometric parameters of the metagratings as the output. The inverse design model is trained to construct a connection between the resonant transmission spectrum and the geometric parameters of the metagrating. This approach can significantly accelerate and simplify the design process by avoiding repetitive FEM simulations, which are usually time-consuming. In model building, the dataset is generated via the FEM via COMSOL Multiphysics, in which each sample comprises an array of transmission spectra. Each sample is associated with a group of real geometric parameters. The inverse design model aims to predict the geometric parameters of the terahertz metagrating, which are represented as outputs. The geometric parameter vector consists of four primary elements (Px, d1, d2, and g), which collectively define the characteristics of the transmission spectra of metagratings. The training and testing of the inverse design model are demonstrated in Fig. 2(b). The dataset generated by the FEM is randomly divided into two nonoverlap subsets: 90% for model training and 10% for model testing. The training of the inverse design model is an iterative process that involves learning intricate mappings from the input space to the output space by optimizing the parameters of the machine learning model. The iterative optimization gradually aligns the outputs with the desired labels for the given inputs, aiming to minimize training errors between the predicted labels and the real labels. In this work, the desired labels of outputs in the inverse design model are the geometric parameters of the metagratings. The training process continues until the training errors are less than the threshold. The model utilized to predict the geometric parameters of the new input transmission spectrum in the testing dataset for verification was trained successfully. The trained model can leverage the learning and mapping capabilities to analyze the characteristics of the input transmission spectrum and generate predictions for the corresponding geometric parameters of the device. It enables the efficient and accurate determination of the desired geometric parameters without extensive computational simulations or experimental iterations. By utilizing trained inverse design models, various valuable insights can be obtained to guide the design and optimization of various metadevices.

    In this work, the parameter space was explored, including the diffraction period (Px) and the geometric parameters of the cylinders (diameters d1, d2, and gap g). Three machine learning models are introduced in the inverse design process, namely, the Elman neural network (Elman), support vector machine (SVM), and general regression neutral network (GRNN) models. As the parameter space shows in Table 1, the dataset is constructed by FEM-simulated transmission spectra with a total of 1355 groups of different geometric parameters, in which the training sample data are set to 1220 and the test data are set to 135. In inverse design modeling, the GRNN undergoes training through a tenfold cross-validation method to optimize its performance. The spread parameter is determined through tenfold cross-validation, ranging from 0.02 to 10 with a step size of 0.02, and the final optimal spread value is found to be 0.48. For Elman, hidden layer neuron configurations ranging from 1 to 35 are tested iteratively, ultimately determining that the optimal number of neurons 28 yields the best results. The hidden layer uses the tangent sigmoid activation function, and the output layer uses the pure linear activation function. The SVM is trained via particle swarm optimization to identify the optimal penalty parameters, ensuring the highest level of predictive accuracy. The linear kernel function is selected. With the optimization of PSO, the final penalty parameter is 0.325. The performance of the trained models is analyzed by comparing the corresponding outputs from inverse design predictions and FEM simulations. To provide a vivid visualization of the accuracy of the inverse design in the parameter space, a three-dimensional visualization of the design parameters obtained via different methods is shown in Fig. 3(a), where d1, d2, and g are used as the three-dimensional coordinates within a specific diffraction period range. The degree of aggregation in the figure indicates the distribution of the parameter space. The inverse design models can predict the design parameters accurately in the parameter space, and the GRNN has the closest distribution to the real parameters.

    Parameter Space of the Inverse Design Modelsa

    Px (mm)d1 (mm)d2 (mm)g (mm)Groups
    2.40.5–0.80.5–0.80.3–0.780
    2.60.5–0.90.5–0.90.3–0.7125
    2.80.5–1.00.5–1.00.3–0.7180
    3.00.5–1.10.5–1.10.3–0.7245
    3.70.5–1.20.5–1.20.3–0.7320
    4.40.5–1.30.5–1.30.3–0.7405
    Total1355

    The parameters d1, d2, and g are changed with steps of 0.1 mm.

    (a) Comparison of the testing dataset prediction results for different models. (b) Prediction performance of different models for different structure parameters. (c)–(f) The prediction errors and spectra obtained via inverse design models with typical design parameters. The insets in (c)–(f) are the FEM-simulated spectra and corresponding predicted spectra of the inverse design.

    Figure 3.(a) Comparison of the testing dataset prediction results for different models. (b) Prediction performance of different models for different structure parameters. (c)–(f) The prediction errors and spectra obtained via inverse design models with typical design parameters. The insets in (c)–(f) are the FEM-simulated spectra and corresponding predicted spectra of the inverse design.

    To quantify the prediction accuracy, three objective regression evaluation metrics, the root mean squared error (RMSE), relative error (Er), and coefficient of determination (R2), are selected as the criteria to evaluate the performance of the inverse design, which are defined as [44,45] RMSE=(1N)i=1N(y^iyi)2,Er=|y^iyi|yi,R2=1i=1N(yiy^i)2i=1N(yiy¯i)2,where N is related to the total discrete data points in the transmission spectra and y^i and yi are the predicted and real design parameters, respectively. y¯i is the average value of the real design parameters. In the context of neural networks, the R2 score can be used to evaluate how well the network has learned the underlying patterns in the training data. A higher R2 indicates that the model can capture more of the variability in the data and make better predictions. However, the R2 score may have limitations, especially when dealing with complex datasets. It is sensitive to outliers and can be influenced by the number of features in the model. Therefore, using R2 in conjunction with the RMSE and Er allows for a more comprehensive evaluation of a neural network’s predictive performance, considering both accuracy and variability.

    The prediction accuracy is calculated in Fig. 3(b). A high R2 value combined with a low RMSE and Er indicates that the inverse design models have undergone effective training and demonstrated a high level of prediction accuracy. Among these three inverse design models, the GRNN has the highest prediction accuracy for all the design parameters, with an R2 greater than 0.98, an Er less than 0.07, and an RMSE less than 0.07 mm. The prediction errors and spectra obtained by inverse design models are further analyzed by four groups of typical design parameters, as demonstrated in Figs. 3(c)–3(f). The results show that the design parameters predicted by these inverse design models accurately agree with the real geometric parameters. In particular, by using the predicted design parameters of the GRNN, the transmission spectra can be reconstructed accurately with the same resonant characteristics. For a comprehensive evaluation of the prediction performance of these inverse design models, the prediction accuracy in the testing dataset of outputs is presented in Table 2. The results demonstrate that the inverse design methods exhibit significantly lower prediction errors. In particular, the inverse design by the GRNN leads to a significant reduction in the optimal Er as low as 0.0383, with an R2 higher than 0.99. The results confirmed the feasibility of an inverse design method based on machine learning for efficient and accurate parameter prediction in the design of metadevices. The prediction accuracy can be further enhanced by augmenting training data and more complex network models. More diverse and representative training data can enhance the model’s generalization ability and reduce overfitting by allowing it to learn from a broader spectrum of patterns. By integrating these optimization strategies in various scenarios, the inverse design model can systematically enhance the prediction accuracy and generalizability at high levels for the high-accuracy design of metadevices.

    Comparison of the Accuracy of Different Modeling Methods

    ModelRMSE (mm)ErR2
    GRNN0.09730.03830.9945
    Elman0.12200.16790.9892
    SVM0.26890.17980.9537

    To substantiate the temporal efficiency of the inverse design based on machine learning, the computational runtimes are compared with those of conventional FEM simulations in Table 3. The runtime based on machine learning models is contingent upon various training parameters, which encompass factors such as dataset size, number of hidden layers, number of neurons within each hidden layer, and number of epochs. The computational platform used is a laptop with an AMD R7 6800H CPU at 3.20 GHz, 16 GB of RAM, and a Windows 11 operating system. The GRNN model is trained through a tenfold cross-validation method to optimize the performance of the model, and the training time is 26 s. The Elman model is trained by 28 hidden layers and runs for 100,000 epochs; it takes 469 s to train the model using the same training dataset. The SVM model is trained with the optimal penalty parameters obtained via particle swarm optimization, and the training time is 191 s. Once the inverse design model has been trained, the model weights, as well as hyperparameters and other related parameters, are saved, and no further training is required during usage. The computation time of subsequent predictions for new inputs is within a mere millisecond. This prediction is performed by leveraging already saved weights rather than retraining the model from scratch. The FEM simulations for numerical computation require several minutes to compute each point, with the possibility of even longer processing times when considering a denser mesh. The quantitative analysis, which presents a comparison of simulation times between the FEM for different numbers of mesh elements and testing times for the machine learning model, is also presented in Table 3. Machine learning models can predict multiple outputs simultaneously within milliseconds when provided with a dataset of input parameters, whereas the process of numerical simulations usually takes even longer when sweeps are necessary. Consequently, the inverse design based on machine learning models offers a simple and efficient training process, enabling it to predict outputs for unknown device parameters faster than conventional numerical simulation techniques.

    Computational Runtimes of the FEM and Inverse Design Models

    3D FEM SimulationNormal (90×90)Fine (110×110)Extra Fine (200×200)Inverse Design ModelGRNNElmanSVM
    Simulation time (one sample)287 s384 s1490 sTraining26 s469 s191 s
    Testing (one sample)32 ms8 ms9 ms

    C. Experimental Demonstration

    By comprehensively analyzing the three machine learning models, the GRNN is selected for the inverse design of the terahertz metagrating in the experimental demonstration. The process steps of the inverse design are shown in Fig. 4(a). To demonstrate the performance of the inverse design, some transmission spectra with random geometric parameters are generated by the FEM as the input. By the trained inverse design model in Section 2.B, the unique geometric parameters are predicted to construct 3D models of the metagrating with the desired spectrum. Then, a terahertz metagrating with the predicted geometric parameters is fabricated via LCD photocuring 3D printing technology with the printing material of photosensitive resin. The transmission spectra of the metagratings were measured via a terahertz time domain spectroscopy (THz-TDS) system (Advantest, TAS7500TS) to verify the adherence to the desired spectra. The experimental spectra obtained via the inverse design are compared with the FEM-simulated spectra to analyze the design performance in terms of the resonance characteristics. Finally, the electromagnetic behavior of the fabricated metagrating for biosensing is verified.

    (a) Implementation procedure of the inverse design for metadevices. (b) Process of fabrication and characterization for 3D printing of the predicted metagrating.

    Figure 4.(a) Implementation procedure of the inverse design for metadevices. (b) Process of fabrication and characterization for 3D printing of the predicted metagrating.

    The process of fabrication and characterization for 3D printing of the predicted metagrating is shown in Fig. 4(b). LCD photocuring 3D printing can be used to fabricate complex 3D structures in a short cycle with high manufacturing efficiency. In this work, a commercial 3D printer (Anycubic Photon Mono X, resolution 50  μm) and a commercially available photosensitive resin were used. The process encompasses the vital stages of generating a standard tessellation language (STL). These steps are crucial in achieving accurate and intricate 3D objects. In the first stage, an STL model is generated by creating a digital representation of the desired object via computer-aided design (CAD) software. This STL file serves as a fundamental input for subsequent processing stages. Then, the cross-sectional slices are extracted from the STL model on the basis of the layer thickness specified by specialized slicing software. During this stage, the STL file is divided into multiple horizontal layers, each representing a precise thickness that determines the resolution of the final print. The slice processing step is pivotal in preparing the data for the SLA printer. In the 3D printing process, the ultraviolet beam scans the surface of the liquid photosensitive resin, in which the resin is then exposed and solidified to form a cross-section of the object with the excess resin maintained in a liquid state. After a layer is completed, the platform shifts down to a certain height and solidifies the next layer of resin. The process is repeated layer by layer until the metagrating is prepared. In summary, the fabrication of LCD photocuring 3D printing utilizes a liquid photosensitive resin exposed to light with layer-by-layer fabrication to create intricate 3D structures. This mechanism offers great potential for the fabrication of resin-based metadevices. In general, the small errors between the simulated and measured spectra result from the mismatch tolerance of 3D printing. The manufacturing errors during the printing process and the predictive errors arising from reverse design can be appropriately compensated for to increase the accuracy of the results.

    The fabricated metagrating is shown in Fig. 5(a), with the local optical microscope images shown in Fig. 5(b). The size of the metagrating sample is shown in Fig. 5(c). To verify their adherence to the input target spectra, an experimental system is used to measure the transmission spectra, as shown in Fig. 5(d). The incident terahertz pulse interacts with the metagrating, leading to specific diffraction phenomena. The transmission spectra of four typical metagrating samples corresponding to the real structure parameters and predicted structure parameters are shown in Figs. 5(e)–5(h), where a good match between the spectra predicted by the inverse design and FEM-simulated designs can be observed with the identification of specific resonances. Some discrepancies could be attributed to the idealized nature of the simulation data, which neglects scattering caused by imperfect dielectric surfaces. Notably, nonidealities in printing fabrication and measurement environments may also contribute to these deviations. The results substantiated the effectiveness and accuracy of the inverse design based on machine learning in predicting structural parameters for terahertz metagratings.

    (a) Fabricated metagrating. (b) Optical microscope images of the fabricated metagrating. (c) Size of the fabricated metagrating. (d) Experimental system for measurement of the transmission spectra. (e)–(h) FEM-designed transmission spectra and corresponding inversely designed spectra used in the experiments.

    Figure 5.(a) Fabricated metagrating. (b) Optical microscope images of the fabricated metagrating. (c) Size of the fabricated metagrating. (d) Experimental system for measurement of the transmission spectra. (e)–(h) FEM-designed transmission spectra and corresponding inversely designed spectra used in the experiments.

    D. Inverse Design of a Tailored Terahertz Metagrating for Microorganism Sensing

    The rapid and accurate identification of microorganisms has always been a hot issue. Traditional methods like cell culture and biochemical assays are time-consuming and complex, and require specialized expertise [46]. Although newer techniques such as ELISA, PCR, and mass spectrometry provide faster alternatives, they are still facing challenges like high costs, complex procedures, and limited microbial databases [47,48]. Terahertz provides a fast, label-free method for microbial detection by assessing the function and conformation of biomolecules through probing intermolecular vibrations [4951]. In this work, the inverse design of terahertz metagratings was demonstrated as a sensitive biosensor with the ability to discriminate between diverse microorganisms, including different fungi and bacteria. Simple and early differentiation of different types of microorganisms aids in the selection of appropriate treatment in infectious diseases. Terahertz metagratings have also shown great potential in microorganism sensing because the presence of microorganisms on the surface will induce an enhanced resonant response [6]. The process flow of microorganism sensing by terahertz metagratings is shown in Fig. 6(a). The variations in the transmitted signals, especially the resonance frequency shifts, can be analyzed to identify and classify different microorganisms on the basis of their distinct spectral fingerprints in a label-free manner. The specific biosensor is designed to operate in frequency regions centered at 200 and 400 GHz. This design accommodates the need to compare multiple parameters by incorporating distinct fingerprint frequencies in the spectrum, due to the wide variety of microorganisms, and with the lower frequency set to at least 200 GHz to ensure a sufficient frequency shift range for detection.

    (a) Schematic description of terahertz metagrating for microorganism sensing. (b) Measured transmission spectra of the samples filled with air (blank), different fungi, and bacteria. (c) Analysis of resonance peaks for different microorganisms.

    Figure 6.(a) Schematic description of terahertz metagrating for microorganism sensing. (b) Measured transmission spectra of the samples filled with air (blank), different fungi, and bacteria. (c) Analysis of resonance peaks for different microorganisms.

    With the framework we propose, a metagrating tailored by inverse design is used as a biological sensor to distinguish different microorganisms. The tailored metagrating was designed with structural parameters of Px=4.35  mm, d1=0.7  mm, d2=1.1  mm, and g=0.5  mm, which allows the metagrating to selectively excite specific frequencies, enhance the spectral resonance, and provide distinctive fingerprint signals. The inverse design of structural parameters enables the ability to discriminate between different microorganisms with enhanced accuracy by tailoring specific spectra with low transmission loss. Three genera of fungi (Candida tropicalis ATCC 13803, Candida albicans ATCC 14053, and Candida krusei ATCC 6258) and two kinds of bacteria (Pseudomonas aeruginosa ATCC 27853 and Staphylococcus aureus ATCC 25923) were detected in the experiments with a 100 μL sample of different microorganisms. The metagrating was placed into the detection chamber to obtain the terahertz transmission spectra via the THz-TDS system. As shown in Fig. 6(b), two distinguished fingerprint frequencies f1 and f2 are excited, which can confine the incident energy into the metagrating and offer significant spectral resonant enhancement, which lies in the frequency regions centered at 200 GHz and 400 GHz, respectively. The measured terahertz transmission characteristics of the metagrating with microorganisms are shown in Fig. 6(b). An analysis of the resonance peaks for different microorganisms, as shown in Fig. 6(c), revealed that the fingerprint frequency of the fungi was relatively high, with f1>200  GHz and f2>430  GHz, whereas for bacteria, an inverse region was observed. Therefore, different microorganisms, e.g., fungi and bacteria, can be discriminated by this terahertz metagrating, which is enhanced by the fingerprint frequency. Compared to the traditional microbial identification method based on phenotypic and biochemical assays, which is labor-intensive and time-consuming [52,53], a terahertz metagrating has advantages of label-free and reagent-free detection, simple workflow, and applicability to minimally trained personnel. Moreover, terahertz metagating biosensors exhibit low transmission loss with a high signal-to-noise ratio (SNR). Therefore, inverse design provides an automatic and efficient solution for tailoring terahertz metagratings with complex geometric structures for specific applications.

    3. CONCLUSION

    In this work, efficient inverse design methods for terahertz metagratings have been demonstrated. The proposed strategy, assisted by artificial intelligence based on machine learning, successfully resolves the limitations of conventional physical modeling methods by offering rapid and accurate predictions of structural parameters for metadevices. The designed metagrating, demonstrated as a sensitive biosensor, was used to distinguish different microorganisms, including various fungi and bacteria. The experimental results confirmed that both the GRNN and Elman models exhibit a remarkable ability to predict the structural parameters of metagratings. A new data-driven inversion method has been developed for terahertz metagratings, which is expected to have significant potential in the design, analysis, and optimization of metadevices. These methods can demonstrate diverse terahertz wavefront modulation characteristics, which could be beneficial for their integration into a variety of terahertz devices for a wide range of applications. Additionally, while machine learning is being increasingly applied for inverse design and optimization acceleration in the fields of photonics and nanophotonics, its effectiveness is primarily observed in cases where reasonably large datasets can be obtained. In situations where moderately large datasets can be generated, conventional optimization can effectively circumvent the complexities associated with dataset generation, model training, and validation. In addition, using dropout, adding regularization to the loss function, and using cross-validation can all improve the model’s generalization ability and reduce overfitting. As a result, the proposed method holds significant applications in the context of inverse design for metadevices, whereas future works can focus on improving the generalization ability of inverse design models, especially for small dataset support.

    4. MATERIALS AND METHODS

    A. LCD Photocuring 3D Printing

    In this work, a commercial LCD photocuring 3D printer (Anycubic Photon Mono X) was utilized. The process involved vat photopolymerization, wherein the LCD functioned as a dynamic mask to selectively transmit UV light onto the photosensitive resin and generate a pattern on the resin surface. The LCD panel was organized into a matrix of pixels capable of independent control to produce the desired design. Initially, slicing software was employed to segment 3D models of dielectric devices into multilayer structures. As each layer was projected onto the LCD, the transparent pixels were controlled on the basis of molecular orientation. UV light penetrated through the LCD and targeted specific transparent areas to solidify layers of UV-sensitive resin under incremental UV exposure. With each layer cured, the built platform ascended to allow resin replenishment for the next layer. This iterative process continued until the full 3D model was constructed, which shows the efficacy and versatility of LCD technology in rapid solidification and integrated manufacturing processes. The fabrication of metagratings via SLA 3D printing has the advantages of simple operation, fast formation, and low manufacturing cost. This innovative approach highlights the efficiency and effectiveness of LCD-based 3D printing technologies in achieving high-speed solidification and integrated manufacturing processes.

    B. Preparation of Microorganism Samples

    The standard strains of P. aeruginosa and S. aureus were inoculated on blood plates and cultured overnight in a 37°C CO2 constant-temperature incubator. Then, the bacteria were passaged twice, and the cultured colonies were diluted to 1×106  CFU/mL in ultrapure water for later use. The standard strains of C. tropicalis, C. albicans, and C. krusei were inoculated into Sabouraud media and incubated at 28°C for 3 days. After two passages, the colonies were diluted to 1×108  CFU/mL in ultrapure water for later use. For terahertz measurements, 100 μL of different bacterial solutions was added dropwise onto the metagrating.

    References

    [1] N. Yu, P. Genevet, M. A. Kats. Light propagation with phase discontinuities: generalized laws of reflection and refraction. Science, 334, 333-337(2011).

    [2] L. Huang, X. Chen, H. Muhlenbernd. Dispersionless phase discontinuities for controlling light propagation. Nano Lett., 12, 5750-5755(2012).

    [3] V. Neder, Y. Ra’di, A. Alù. Combined metagratings for efficient broad-angle scattering metasurface. ACS Photonics, 6, 1010-1017(2019).

    [4] Z. Zhang, M. Kang, X. Zhang. Coherent perfect diffraction in metagratings. Adv. Mater., 32, 2002341(2020).

    [5] C. McDonnell, J. Deng, S. Sideris. Terahertz metagrating emitters with beam steering and full linear polarization control. Nano Lett., 22, 2603-2610(2022).

    [6] R. Aoni, S. Manjunath, B. Karawdeniya. Resonant dielectric metagratings for response intensified optical sensing. Adv. Funct. Mater., 32, 2103143(2022).

    [7] Z. Liu, C. Zhang, W. Zhu. Compact stereo waveguide display based on a unidirectional polarization-multiplexed metagrating in-coupler. ACS Photonics, 8, 1112-1119(2021).

    [8] H. Liu, F. Zhou, Z. Xia. Bidirectional augmented reality 3D signage enabled by a metagrating waveguide. ACS Photonics, 10, 4259-4266(2023).

    [9] X. Weng, J. Feng, A. Perry. Non-line-of-sight full-stokes polarimetric imaging with solution-processed metagratings and shallow neural networks. ACS Photonics, 10, 2570-2579(2023).

    [10] F. Uleman, V. Neder, A. Cordaro. Resonant metagratings for spectral and angular control of light for colored rooftop photovoltaics. ACS Appl. Energy Mater., 3, 3150-3156(2020).

    [11] E. Khaidarov, H. Hao, R. Paniagua-Dominguez. Asymmetric nanoantennas for ultrahigh angle broadband visible light bending. Nano Lett., 17, 6267-6272(2017).

    [12] J. Shi, H. Gao, X. Jia. All-dielectric tunable terahertz metagrating for diffraction control. ACS Appl. Mater. Interfaces, 14, 55174-55182(2022).

    [13] X. Zang, H. Ding, Y. Intaravanne. A multi-foci metalens with polarization-rotated focal points. Laser Photonics Rev., 13, 1900182(2019).

    [14] H. Xu, Y. Shi. Silicon-waveguide-integrated high-quality metagrating supporting bound state in the continuum. Laser Photonics Rev., 14, 1900430(2020).

    [15] Z. L. Deng, F. J. Li, H. Li. Extreme diffraction control in metagratings leveraging bound states in the continuum and exceptional points. Laser Photonics Rev., 16, 2100617(2022).

    [16] Z. Fan, M. R. Shcherbakov, M. Allen. Perfect diffraction with multiresonant bianisotropic metagratings. ACS Photonics, 5, 4303-4311(2018).

    [17] R. Gao, M. D. Kelzenberg, Y. Kim. Optical characterization of silicon nitride metagrating-based lightsails for self-stabilization. ACS Photonics, 9, 1965-1972(2022).

    [18] Q. Liu, Z. Liu, X. Ma. Incomplete phase metasurface for wavefront reconstruction. ACS Photonics, 10, 2563-2569(2023).

    [19] F. Ghorbani, S. Beyraghi, J. Shabanpour. Deep neural network-based automatic metasurface design with a wide frequency range. Sci. Rep., 11, 7102(2021).

    [20] T. Zhan, Q.-S. Liu, Y.-J. Sun. A general machine learning-based approach for inverse design of one-dimensional photonic crystals toward targeted visible light reflection spectrum. Opt. Commun., 510, 127920(2022).

    [21] J. Baxter, A. C. Lesina, J.-M. Guay. Plasmonic colours predicted by deep learning. Sci. Rep., 9, 8074(2019).

    [22] W. Ma, F. Cheng, Y. Liu. Deep-learning-enabled on-demand design of chiral metamaterials. ACS Nano, 12, 6326-6334(2018).

    [23] D. Gostimirovic, W. N. Ye. Automating photonic design with machine learning. IEEE 15th International Conference on Group IV Photonics (GFP), 1-2(2018).

    [24] T. Asano, S. Noda. Optimization of photonic crystal nanocavities based on deep learning. Opt. Express, 26, 32704-32716(2018).

    [25] A. da Silva Ferreira, G. N. Malheiros-Silveira, H. E. Hernandez-Figueroa. Computing optical properties of photonic crystals by using multilayer perceptron and extreme learning machine. J. Lightwave Technol., 36, 4066-4073(2018).

    [26] A. Tittl, A. John-Herpin, A. Leitis. Metasurface-based molecular biosensing aided by artificial intelligence. Angew. Chem.-Int. Edit., 58, 14810-14822(2019).

    [27] C. Barth, C. Becker. Machine learning classification for field distributions of photonic modes. Commun. Phys., 1, 58(2018).

    [28] B. Karanov, M. Chagnon, F. Thouin. End-to-end deep learning of optical fiber communications. J. Lightwave Technol., 36, 4843-4855(2018).

    [29] T. A. Eriksson, H. Bulow, A. Leven. Applying neural networks in optical communication systems: possible pitfalls. IEEE Photonics Technol. Lett., 29, 2091-2094(2017).

    [30] Z. Liu, D. Zhu, S. P. Rodrigues. Generative model for the inverse design of metasurfaces. Nano Lett., 18, 6570-6576(2018).

    [31] Y. Luo, D. Mengu, N. T. Yardimci. Design of task-specific optical systems using broadband diffractive neural networks. Light Sci. Appl., 8, 112(2019).

    [32] I. Tanriover, W. Hadibrata, K. Aydin. Physics-based approach for a neural networks enabled design of all-dielectric metasurfaces. ACS Photonics, 7, 1957-1964(2020).

    [33] S. An, C. Fowler, B. Zheng. A deep learning approach for objective-driven all-dielectric metasurface design. ACS Photonics, 6, 3196-3207(2019).

    [34] F. Wang, G. Geng, X. Wang. Visible achromatic metalens design based on artificial neural network. Adv. Opt. Mater., 10, 2101842(2022).

    [35] J. Jiang, J. A. Fan. Global optimization of dielectric metasurfaces using a physics-driven neural network. Nano Lett., 19, 5366-5372(2019).

    [36] S. An, B. Zheng, M. Y. Shalaginov. Deep convolutional neural networks to predict mutual coupling effects in metasurfaces. Adv. Opt. Mater., 10, 2102113(2022).

    [37] C.-H. Lin, Y.-S. Chen, J.-T. Lin. Automatic inverse design of high-performance beam-steering metasurfaces via genetic-type tree optimization. Nano Lett., 21, 4981-4989(2021).

    [38] W. Ma, Y. Xu, B. Xiong. Pushing the limits of functionality-multiplexing capability in metasurface design based on statistical machine learning. Adv. Mater., 34, 2110022(2022).

    [39] J. Shi, M. Li, L. Tang. All-dielectric integrated meta-antenna operating in 6G terahertz communication window. Small, 20, 2308958(2024).

    [40] J. Liu, X. Fang, F. He. Directional conversion of a THz propagating wave into surface waves in deformable metagratings. Opt. Express, 29, 21749-21762(2021).

    [41] Y. LeCun, Y. Bengio, G. Hinton. Deep learning. Nature, 521, 436-444(2015).

    [42] J. Peurifoy, Y. Shen, L. Jing. Nanophotonic particle simulation and inverse design using artificial neural networks. Sci. Adv., 4, eaar4206(2018).

    [43] K. Kojima, B. Wang, U. Kamilov. Acceleration of FDTD-based inverse design using a neural network approach. Advanced Photonics, ITu1A.4(2017).

    [44] Z. Zhang, S. Rao, X. Zhang. Performance prediction of switched reluctance motor using improved generalized regression neural networks for design optimization. CES Trans. Electr. Syst., 2, 371-376(2018).

    [45] T. Zhang, J. Wang, Q. Liu. Efficient spectrum prediction and inverse design for plasmonic waveguide systems based on artificial neural networks. Photonics Res., 7, 368-380(2019).

    [46] S. A. Yoon, S. H. Cha, S. W. Jun. Identifying different types of microorganisms with terahertz spectroscopy. Biomed. Opt. Express, 11, 406-416(2020).

    [47] M. T. Alula, S. Krishnan, N. R. Hendricks. Identification and quantitation of pathogenic bacteria via in-situ formation of silver nanoparticles on cell walls, and their detection via SERS. Microchim. Acta, 184, 219-227(2017).

    [48] A. Niemz, T. M. Ferguson, D. S. Boyle. Point-of-care nucleic acid testing for infectious diseases. Trends Biotechnol., 29, 240-250(2011).

    [49] M. Seo, H. R. Park. Terahertz biochemical molecule-specific sensors. Adv. Opt. Mater., 8, 1900662(2020).

    [50] E. Gil-Santos, J. J. Ruz, O. Malvar. Optomechanical detection of vibration modes of a single bacterium. Nat. Nanotechnol, 15, 469-474(2020).

    [51] W. J. Yu, J. Shi, G. R. Huang. THz-ATR spectroscopy integrated with species recognition based on multi-classifier voting for automated clinical microbial identification. Biosensors, 12, 378(2022).

    [52] S. M. Yoo, S. Y. Lee. Optical biosensors for the detection of pathogenic microorganisms. Trends Biotechnol., 34, 7-25(2016).

    [53] X. Yang, K. Yang, Y. Luo. Terahertz spectroscopy for bacterial detection: opportunities and challenges. Appl. Microbiol. Biotechnol., 100, 5289-5299(2016).

    Jia Shi, Guanlong Wang, Shaona Wang, Wenjing Yu, Ling Liang, Weiling Fu, Pingjuan Niu, Jianquan Yao, Xiang Yang, "Efficient inverse design for tailoring a terahertz metagrating," Photonics Res. 13, 1172 (2025)
    Download Citation