Abstract
In this work, we propose a novel transformer-based deep learning model for the design of electromagnetically induced transparency (EIT) metasurfaces, which consists of a forward network to predict transmission spectra from structural parameters and an inverse network to retrieve structural parameters from target spectra. To train the model, we generated a dataset of 23,500 samples by automating CST simulations. The well-trained model can predict all seven structural parameters of an EIT metasurface from a given target spectrum within milliseconds, achieving a mean square error (MSE) of 8.49 × 10−4 at convergence. The mean errors between the predicted data and target parameters remain below 0.25 μm. The relative spectral error (RSE) is employed to evaluate the discrepancy between the spectra from predicted structures and the targets, with a maximum RSE of 0.57%. Benchmarking against two other neural networks confirms the superior predictive capability and accuracy of our model. Furthermore, the method not only streamlines EIT metasurface design but is readily adaptable to diverse metasurface devices across the electromagnetic spectrum, establishing a versatile platform for metasurface inverse design.
1. Introduction
Terahertz metasurfaces, as subwavelength-structured electromagnetic metamaterials, allow for customized manipulation of wave amplitude, phase, and polarization through geometric design [1,2,3], thereby developing devices such as electromagnetically induced transparency (EIT) effect devices [1,4], metalenses [5], holographic projectors [6], and sensors [7]. Terahertz EIT metasurfaces provide a classical platform for mimicking three-level quantum systems [8], making them suitable for developing slow-light devices [9], sensors [10], and terahertz filters [1]. The recent rapid advancement in EIT metasurfaces has garnered significant attention from researchers in electromagnetics. As research advances, metasurface designs have incorporated more diverse materials and developed increasingly sophisticated geometric shapes and structural parameters. Although advances meet the need for high-dimensional design freedom in metasurfaces, they also considerably escalate the computational cost and time required for optimization, placing heavy burdens on the design process [1,8,11]. However, while full-wave simulation software facilitates metasurface design by providing solutions to Maxwell’s equations, the optimization process remains computationally intensive and time-consuming even for experienced researchers. Consequently, achieving on-demand EIT responses continues to pose a significant challenge.
With the advent of the artificial intelligence (AI) era, deep learning models have emerged as a viable alternative for solving engineering problems that traditionally require complex, computationally intensive simulations. In electromagnetic metasurface design, recent studies demonstrate that deep learning has achieved remarkable progress in both forward spectrum prediction and inverse structural design, showing its bright potential for real-world applications [2,12,13,14,15,16,17,18,19]. In a typical deep learning-assisted metasurface design, the model extracts the implicit physical patterns from comprehensive simulation datasets. By iteratively fitting its approximations of target parameters, it minimizes prediction discrepancies and streamlines the design workflow, circumventing the need for direct computation of Maxwell’s equations [20,21,22]. Therefore, the deep learning approach proves highly valuable for inversely designing complex multi-parameter EIT metasurfaces [16,20,23]. Therefore, researchers with basic programming expertise can train models on simulated data. A single trained model can then efficiently explore an extensive design space of related EIT configurations. For example, in 2020, Huang W et al. developed a fully connected neural network for the inverse design of terahertz EIT metasurfaces. The model took six key spectral features (the amplitudes and frequencies of two dips and one peak) as the input to optimize five geometric parameters, yielding a mean squared error (MSE) of 0.014 on the test set [20]. In 2021, Zhu RC et al. repurposed transfer learning on the Inception V3 architecture to map binary images of metasurface structures to their spectral responses, facilitating the design of a metalens and an anomalous refractor using pre-screened phase-building blocks [21]. In 2022, Zhu L et al. proposed a Y-CNN model for the inverse design of EIT metasurfaces, which achieved an MSE of 0.011 and a structural prediction error of 0.3 μm [16]. In 2024, Huang YP et al. employed a modified Transformer architecture to simultaneously predict the structural parameters and Fermi level of multi-resonant graphene metasurfaces, demonstrating favorable design outcomes [24]. In the same year, Ma JD et al. proposed a transformer-based inverse design model for quad-band metasurface absorbers operating in the GHz frequency range. Their experiments demonstrated that this model achieved superior performance compared to designs based on long short-term memory (LSTM) neural networks [25]. Overall, these studies demonstrate the progression of deep learning in metasurface inverse design, evolving from simple fully connected networks to LSTM-based models. However, most existing works remain constrained by their focus on a single type of metasurface or a specific physical mechanism. Their dependence on manually extracted features—such as spectral peaks—or predefined structural representations like binary images, limits their applicability to higher-dimensional, continuous design spaces. Therefore, to address these limitations, our team introduced in 2025 a novel neural network architecture that synergistically combines LSTM and 1D convolutional (Conv1D) layers for the inverse design of all-dielectric EIT metasurfaces [2]. While this model proved effective for related problems such as EIT and Fano resonance tuning and achieved a notably low Mean Squared Error (MSE) of 0.0095, we observed significant instability during its training process, characterized by substantial loss fluctuations and a prolonged convergence period. Hence, in order to achieve more reliable inverse design, it is essential to enhance the stability of models for multi-parameter, all-dielectric EIT metasurfaces.
In this work, an improved transformer network for EIT metasurface with multiple geometric parameters is developed [26,27,28] and termed as ID-TransNet, which consists of a forward network to predict transmission spectra from structural parameters and an inverse design network to retrieve structural parameters from target spectra. The inverse network incorporates a transformer encoder and a 1D-CNN decoder, with positional encoding that provides contextual position information for identifying W-shaped features in EIT spectra. Our well-trained model enables direct prediction of metasurface structural parameters from target spectra within only 4.5 ms. To this end, the model was developed and trained as follows. Firstly, a simulated dataset of 23,500 samples, containing structural parameters and transmission spectra, was built through procedural modeling in CST. Subsequently, this dataset was used to train the transformer-based inverse design model for all-dielectric EIT metasurfaces, overcoming the iterative trial-and-error limitations of conventional design methods. The model achieved training and validation losses of 5.48 × 10−5 and 8.74 × 10−4, respectively. We further evaluated the ID-Transformer by comparing spectra generated from its predicted structural parameters against those produced by other deep learning networks. Comparative results confirm our model as the best-performing approach, achieving the smallest relative spectral error (RSE) in inverse design. Therefore, this approach provides an efficient route for accelerating EIT metasurface development, paving the way for future applications.
2. Metasurface Design and Deep Learning Network Framework
2.1. Metasurface Design
To validate the efficacy of the proposed inverse design algorithm, an EIT metasurface was designed as an example, and its structure is illustrated in Figure 1. The structure is composed of two T-shaped lithium tantalate (LiTaO3) units on a silicon dioxide (SiO2) substrate. The periods of the meta-atom are Px = Py = 40 μm in both the x and y directions. The refractive index of LiTaO3 is 6.43, and the refractive index of SiO2 is 1.45 [2,29]. The meta-cell is built on a substrate with a thickness h1 = 16 μm and is characterized by seven variable structural parameters. Specifically, the lengths of the two horizontal rectangular strips are defined by a1 and a2, both sharing a common width defined by w1, and the distance between them is defined as d. The two vertical rectangular strips, with heights defined by b1 and b2, have a uniform width of w2. Within the design space, the parameters are defined as follows: a1 and a2 are sampled from normal distributions with means of 26.3 μm and 20.5 μm, and standard deviations of 3.9 μm and 3.4 μm, respectively. The remaining parameters are uniformly sampled from bounded intervals: w1 and w2 range from 2 to 5 μm, b1 and b2 range from 1 to 16 μm, and the separation d ranges from 1 to 6 μm. A script was developed to generate the seven structural parameters and automatic modeling was performed in CST Microwave Studio, covering the frequency range of 4.5 to 6.1 THz. With periodic x-y and open z-boundaries, the metasurface with seven structural parameters is illuminated by a y-linearly polarized light in CST, yielding a transmission spectrum resolved into 256 frequency points.
Figure 1.
Schematic diagram of the metasurface structure.
As displayed in Figure 2a, the transmission of the metasurface has two pronounced transparency windows at 5.44 THz and 5.83 THz. To elucidate the physical mechanisms behind these spectral features, the corresponding electric field distributions at five representative resonance frequencies are provided in Figure 2b–f [1,4,10]. As shown in Figure 2b, at 4.99 THz, the electric field is predominantly confined to the upper, longer rectangular strip, with electric field energy mainly concentrated at both ends. The electric field emanates from the left end and couples into the right end, which can be regarded as an electric dipole, which suggests that the longer resonator is preferentially excited at lower incident energy, corresponding to the observed resonance dip. As depicted in Figure 2c, at 5.44 THz, as the frequency increases, the longer strip acts as the excitation source and transfers energy to the shorter strip. The electric field energy is intensively concentrated between the long and short rectangular strips, with the electric field directed vertically upward at the left end and vertically downward at the right end. A certain proportion of electric field energy is also distributed on the shorter rectangular resonator, thereby giving rise to a pronounced transmission window. In Figure 2d, at 5.5 THz, the electric field is strongly localized at both ends of the shorter horizontal strip, with the electric field flowing out from the left end and flowing into the right end, which can be regarded as an electric dipole, indicating that the shorter strip is excited at this frequency, giving rise to a sharp resonant absorption dip. As illustrated in Figure 2e, at 5.83 THz, the magnetic field energy is concentrated in the middle of the two vertical arms with an upward vertical orientation, behaving as a magnetic dipole. Meanwhile, a weak electric field is also distributed at both ends of the horizontal short rectangular strip. Electric field lines flow into the left end and emanate from the right end, which can be regarded as an electric dipole. The electromagnetic coupling between the electric dipole and magnetic dipole jointly induces a relatively broad transmission peak covering the frequency range of 5.7–5.9 THz. Finally, as shown in Figure 2f, at the upper frequency bound of 5.97 THz, a strong electromagnetic resonance emerges between the two vertical strips. Meanwhile, intense magnetic field energy is distributed on the two vertical arms with a vertically downward direction, behaving as a magnetic dipole. The magnetic dipole produces an extremely narrow absorption peak at this frequency.
Figure 2.
(a) Transmission spectrum of the EIT metasurface. (b–d) Electric field distributions corresponding to 4.99 THz, 5.44 THz, and 5.5 THz, respectively. (e,f) Magnetic field distributions corresponding to 5.83 THz and 5.97 THz. The black dashed arrows denote the electric field lines, while the red solid arrows represent the magnetic field lines.
2.2. Design of Forward and Inverse Neural Networks
To achieve efficient inverse design of EIT metasurfaces, we develop two neural network models, as shown in Figure 3. Specifically, Figure 3a illustrates the forward prediction network, termed ForwardNet, which maps the given metasurface structural parameters to the corresponding transmission spectra. This network primarily serves to assist the inverse design process by improving design efficiency and can be used as a surrogate for electromagnetic simulations. Figure 3b illustrates the architecture of the inverse design network, which adopts a hybrid structure combining a Transformer with a 1D convolutional layer. As shown in the figure, the input to the network consists of the co-polarized transmission coefficients sampled at 256 frequency points under y-polarized light illumination. The model outputs the corresponding seven geometric parameters of the metasurface unit.
Figure 3.
Schematic diagram of forward and inverse design of metasurfaces. (a) Forward design using a multilayer perceptron (MLP) neural network. (b) Inverse design network based on transformer architecture. Gray represents fully-connected layers, green represents 1D-CNN, and yellow, light yellow, and light green represent the Transformer architecture.
As depicted in Figure 3a, the forward network consists of an eight-layer multilayer perceptron (MLP), comprising an input layer, an output layer, and six hidden layers. The input layer receives seven structural parameters of the metasurface unit, while the output layer produces the transmission spectrum sampled with 256 frequency points. The hidden layers are configured with neuron counts of 64, 128, 256, 512, 1024, and 512, respectively. Following each hidden layer, an ELU activation function is applied, which helps prevent dead neurons and facilitates smoother gradient propagation compared to the ReLU function [2,8]. Given that both the structural parameters and transmission spectra are continuous analog variables, and mean squared error (MSE) is commonly adopted for regression tasks, we employ MSE as the loss function during both training and validation.
Figure 3b illustrates the architecture of the proposed inverse design network. Specifically, the proposed inverse design network comprises three key components: a linear pre-processing layer, an encoder based on a Transformer network, and a decoder composed of Conv1ds and fully connected layers. This architecture enables the effective prediction of the EIT metasurface cells’ structural parameters from a given transmission spectrum. First, the linear pre-processing layer transforms the input spectral data from a shape of (1, 256) to (256, 128). Second, the transformer network incorporates sinusoidal positional encoding and an 8-head self-attention mechanism to provide crucial positional information and capture comprehensive global context, making it highly effective for the inverse design task. Through the encoder, the data is embedded into a higher-dimensional representation with a shape of (256, 128). Third, the decoder network comprises four Conv1d layers and five FC layers. And its outputs are seven structural parameters of the metasurface cell. To enhance the feature extraction capability of the decoder, each Conv1d layer is followed by a BatchNorm1d layer [30], a ReLU activation function [31], and a MaxPool1d layer with a kernel size of 2 [1]. Similarly, each fully connected layer is followed by BatchNorm1d and ReLU. As ID-TransNet is designed to predict the continuous structural parameters of the metasurface, the learning problem is a regression task.
3. Data Collection and Model Training
To prepare for training the inverse design network ID-TransNet, a dataset of 23,500 metasurface models was generated through simulation. For each case, the corresponding transmission spectrum and its structural parameters were recorded. In our design, the metasurface is excited by a y-polarized incident wave, which generates a co-polarized transmission response. The modeling and simulation were automated via scripting to control the CST Studio Suite software 2024. Each simulated spectrum across the 4.5–6.1 THz range is discretized into 256 data points. In the training process, the dataset was randomly divided into training, validation, and test sets with a ratio of 7:1:1.
Both the ForwardNet and ID-TransNet models are implemented using the PyTorch (2.5.1) deep learning framework. The architecture and optimization parameters of the ForwardNet follow the design described in ref. [2,16], with modifications primarily made to the input and output dimensions. For ID-TransNet model optimization, we employed the Adam algorithm with an initial learning rate of 1 × 10−4. The hyperparameters of the optimizer were set with exponential decay rates for the first and second moment estimates (β1 and β2) at 0.9 and 0.999, respectively [32]. During training, the mean squared error (MSE) was employed as the loss function. A learning rate scheduler was utilized to dynamically adjust the learning rate, which was multiplied by a factor of 0.9 every 500 epochs. The model was trained with a batch size of 256 for 18,000 epochs. The structural parameters were standardized to equilibrate their impact on the learning process; these statistics were saved for the test data and subsequent inverse design predictions.
As shown in Figure 4a, the training and validation losses of the ForwardNet decrease rapidly during the first 300 epochs, reaching values of 4.56 × 10−4 and below 0.001, respectively. This rapid decline reflects the model’s strong learning capability in the early training stage, where initial errors are relatively large. During the subsequent training period from 300 to 3000 epochs, the training loss initially exhibits slight fluctuations before gradually converging. Ultimately, the training loss stabilizes at 4.71 × 10−5, while the validation loss converges to 6.26 × 10−4. Given that both losses no longer show significant variation after convergence, the forward model is considered well-trained, and 3000 epochs suffice for achieving satisfactory performance. For the ID-TransNet model, which is the core component of our inverse design framework, the training process is presented in Figure 4b. The training and validation losses decrease rapidly within the first 1000 epochs, demonstrating efficient learning during the early stage. The model gradually stabilizes and achieves convergence around epoch 4000, with final training and validation losses of 9.93 × 10−5 and 8.54 × 10−4, respectively. Notably, the validation loss is consistently higher than the training loss, but it drops sharply and then maintains a stable low value without rebound or evident deviation, suggesting good convergence and no overfitting. The total training time is approximately 10 h. Once trained, the inverse model can predict the seven geometric parameters of a metasurface unit from a given transmission spectrum in 4.5 ms, enabling rapid on-demand design. Traditional metasurface optimization design mainly relies on parametric sweep traversal, which heavily depends on extensive designer experience and repeated trial-and-error iterations. In conventional optimization methods, the simulation time for each structural model ranges from 2 to 30 min, and the complete design cycle for achieving a specific target spectrum and phase-coding sequence typically requires 10 to 30 days of continuous debugging and optimization [23,33]. In contrast, once the proposed model is well-trained, it can rapidly predict the optimal metasurface structural parameters within only 4.5 ms. This intelligent prediction strategy effectively avoids the risk of traditional parametric optimization easily falling into local optimal solutions or missing the best design configuration. Furthermore, the developed model can flexibly adapt to diverse electromagnetic design requirements and possesses powerful transfer learning capability, enabling fast generalization and rapid adaptation to various other metasurface optimization scenarios.
Figure 4.
Loss curves of the forward design model and inverse design model. (a) Training loss and validation loss curves of the forward model. (b) Training loss and validation loss curves of the inverse model during training.
To quantitatively evaluate the convergence stability of the model in the late training stage, two core quantitative indicators, namely the late-stage loss standard deviation (Std) and coefficient of variation (CV), are adopted for comparative analysis [34]. Among them, the Std is utilized to measure the dispersion degree of loss values in the late training phase and directly reflects the absolute fluctuation amplitude of the loss curve. The corresponding calculation formula is defined as follows:
Here, Li is the loss value at the i-th epoch in the late training stage, is the mean of all loss values in the late training period, and n is the number of epochs for the late-stage statistics, which is taken as the last 30% of the total epochs. A smaller value indicates better convergence performance, demonstrating that the loss remains stable in the late training phase without obvious fluctuations.
Another evaluation metric is CV, which is a normalized fluctuation indicator; it is used to compare the relative stability of different models at distinct loss levels. Its calculation formula is expressed as follows:
where represents the standard deviation calculated by Equation (1), and denotes the mean loss value in the late training stage. A smaller Cv value implies a weaker relative fluctuation of the loss with respect to its mean, reflecting higher stability during the model training process.
To quantitatively assess the training convergence stability, Std and CV of the training and validation losses were calculated using Equations (1) and (2). For the proposed ID-TransNet, the Std and CV corresponding to the training and validation losses are denoted as σ11, Cv11, and σ12, Cv12, respectively. For the previously developed LSTM-based inverse design network (IDN), the corresponding metrics are defined as σ21, Cv21, and σ22, Cv22. The calculated results are as follows: σ11 = 2.0 × 10, Cv11 = 0.0428, σ12 = 3.0 × 10, Cv12 = 0.00292; and σ21 = 3.66 × 10, Cv21 = 0.0714, σ22 = 4.51 × 10, Cv22 = 0.0710. The comparison shows that the σ values of ID-TransNet are two orders of magnitude lower, and the Cv values are one order of magnitude lower than those of the IDN. This indicates that the ID-TransNet achieves considerably better convergence stability than the LSTM-based IDN. In the late training stage, the loss of the proposed model remains stable at a low level without obvious fluctuations or rebounds, effectively overcoming the training instability and severe late-stage oscillation problems of the previous LSTM model.
To evaluate the performance of the trained forward model, all samples in the test set are fed into ForwardNet to predict their transmission spectra. The MSE between the target and predicted spectra is calculated, yielding an average MSE of 4.8 × 10−5 across the entire test set, with a maximum MSE of 0.0246. For visual inspection, four representative samples—two single-EIT and two double-EIT structures—are selected from the test set, and the corresponding results are presented in Figure 5. In this figure, the target transmission spectra are depicted as solid black lines, while the predicted spectra from the forward model are shown as red dashed lines. The MSE values for the four selected samples are 1 × 10−6, 5 × 10−6, 1 × 10−6, and 2 × 10−6, respectively. As observed in Figure 5a,b, the ForwardNet accurately reproduces the characteristic features of the EIT spectra, including the transmission window and the two dips in single EIT cases. For double EIT-like spectra, the model also successfully captures the two transmission windows and the three dips, demonstrating its capability to handle both single- and double-EIT responses with high fidelity and minimal error. These results confirm that the proposed forward model can reliably predict the transmission spectrum for a given metasurface structure, making it a suitable surrogate for electromagnetic simulations. Consequently, it can be effectively employed to evaluate whether the structures generated by the inverse design model satisfy the target spectral requirements.
Figure 5.
Spectral comparisons between the ForwordNet prediction and the target. (a) Single EIT Case 1; (b) Single EIT Case 2; (c) Double EIT Case 1; (d) Double EIT Case 2.
To comprehensively evaluate the ID-TransNet’s performance, we evaluated the fully trained model on the entire test data (unseen during training) to predict the corresponding metasurface structure parameters. Figure 6 shows the mean error between the target metasurface parameters and the predictions from the proposed inverse design model across the entire test set. As shown in the figure, the maximum error of 0.25 μm occurs in the prediction of parameter b1.
Figure 6.
The mean error between the target and the ID-TransNet-predicted parameters.
To further validate the performance of our proposed algorithm on test samples, four test samples that were not seen during training were randomly selected and fed into the ID-TransNet for further analysis. A comparison between the target and predicted parameters is presented in Table 1. As shown in Table 1, the maximum prediction error is highlighted with a gray background and occurs in parameter b2 of the second sample, with a value of 0.11 μm.
Table 1.
Comparison between target parameters and the corresponding predictions by the ID-TransNet (the gray area indicates the maximum prediction error).
To further validate the accuracy and efficacy of the, we reconstructed the metasurface models based on the predicted structural parameters listed in Table 1 and performed full-wave simulations. Figure 7 compares the resulting transmission spectra with the target spectra. In the figure, the black solid curves denote the target transmission spectra, the red dotted curves represent the transmission spectra predicted by the ForwardNet using the inversely designed structural parameters, and the blue upward-pointing dashed curves correspond to the full-wave simulation results of the inversely designed structures.
Figure 7.
Spectral comparison among the target spectrum (black solid). (a) Single EIT Case 1; (b) Single EIT Case 2; (c) Double EIT Case 1; (d) Double EIT Case 2. ForwardNet predictions (red dotted), and full-wave simulation results (blue upward-pointing dashed) based on the structures inversely designed by ID-TransNet.
As observed in Figure 7, the spectrum in Figure 7a displays the characteristic single EIT-like profile, featuring two dips at 5.1 THz and 5.6 THz and a central peak at 5.5 THz. Similarly, the response in Figure 7b shows dips at 5.4 THz and 5.55 THz with a peak at 5.50 THz. For the double-band EIT spectra, Figure 7c shows the first transmission peak at 5.3 THz and the second at 5.85 THz, with three transmission dips located at 5.0 THz, 5.5 THz, and 5.98 THz, respectively. Similarly, in Figure 7d, the first and second transmission peaks are observed at 5.1 THz and 5.65 THz, accompanied by three transmission dips at 4.95 THz, 5.2 THz, and 5.8 THz. Despite variations in the center frequency, bandwidth, and amplitude of the EIT resonances across the spectra, all four test samples successfully achieved the inverse design of the metasurface structure. This indicates that our inverse design model can accurately predict all target responses. Furthermore, the model provides a versatile framework for designing application-specific metasurfaces, as demonstrated by the successful generation of both single-band and dual-band EIT effects.
In summary, these simulation results verify that our inverse design model can effectively predict metasurface structures exhibiting diverse EIT characteristics. They also confirm the model’s strong generalization capability, showing its potential for designing novel metasurface devices. Furthermore, the proposed inverse design approach can be directly extended to the optimization of other metasurfaces with analogous architectures.
4. Comparison Experiment
To evaluate the prediction error in the simulation experiments, the Relative Spectral Error (RSE) is employed to quantify the discrepancy between the target and predicted spectra. Its calculation is given by Equation (3) [20]:
where ti and si represent the i-th point of the target spectrum and the predicted spectrum, respectively, and n is the total number of sampling points (256 in this study). The calculated RSEs for the four cases in Figure 6 are 0.19%, 0.15%, 0.35%, and 0.57%.
A comparative study was conducted between our proposed model and the IDN presented in Ref. [2]. The model comprises an LSTM layer, four Conv1d layers, and five fully connected layers, with corresponding dimensional sizes of (256, 128, 40, 50, 60, 500, 256, 120, 7). Each convolutional layer is sequentially followed by a 1D batch normalization layer, a ReLU activation layer, and a max-pooling layer [1]. The training converged with a final MSE loss of 0.0014. When the well-trained IDN was applied to predict metasurface parameters, discernible differences were observed between the predicted results and the target spectra, as quantitatively detailed in Table 2. As shown in Table 2, the IDN model exhibits a maximum prediction error of 0.55 μm. Furthermore, its errors for other parameters are considerably larger than those of our proposed model, as detailed in Table 1. To further compare the prediction performance of the models, the same four metasurfaces were inversely designed by the IDN. The simulated transmission spectra of both the target and predicted structures are presented in Figure 8. As shown in Figure 8, the black solid curves denote the transmission spectra of the target structures, while the red dash-dotted curves represent the simulated results obtained from the metasurface structural parameters predicted by the IDN. The RSE was calculated using Equation (3), yielding values of 0.49%, 1.29%, 2.68%, and 14.25%, respectively. The maximum RSE of the IDN is 14.25%, whereas that of ID-TransNet is only 0.57%, indicating a significantly higher prediction error in the former. This is rooted in the IDN’s architectural limitations. As the IDN is originally designed for simpler structures with only six parameters, its LSTM-based input layer is inherently less powerful than the Transformer architecture used in the ID-TransNet for capturing complex spectral mappings. As a result, the IDN demonstrates insufficient generalization when applied to our more challenging inverse design problem.
Table 2.
Comparison between the target data and the predictions from the IDN model (gray area indicates the maximum prediction error).
Figure 8.
Spectral comparisons between the IDN-predicted structures and the target. (a) Single EIT Case 1; (b) Single EIT Case 2; (c) Double EIT Case 1; (d) Double EIT Case 2.
For additional verification of the ID-TransNet’s efficacy, we implemented the same network structure as described in Ref. [1], termed the CNN model. This CNN was trained on the same dataset (with 23,500 samples) and subsequently employed for the inverse prediction of metasurface structures.
The CNN model from Ref. [1] consists of four Conv1d layers and five subsequent fully connected layers. Each Conv1d layer is succeeded by a standard set of layers in the following order: 1D batch normalization, ReLU activation, and max pooling. Similarly, each fully connected layer is followed by a 1D batch normalization layer and a ReLU activation function. As shown in Table 3, the CNN model achieves a maximum prediction error of 0.74 μm (gray highlight) across its predicted structural parameters for the four test samples. Figure 9 compares the target spectra of the four metasurfaces with the spectra predicted by the CNN model, represented by black solid curves and red dash-dotted curves, respectively. The RSE values for the four metasurfaces are 4.98%, 15.59%, 5.86%, and 0.36%, respectively. These results collectively validate the superior performance of the ID-TransNet for the inverse design task.
Table 3.
Comparison between target parameters and predictions from the CNN model (gray area indicates the maximum prediction error).
Figure 9.
Spectral comparisons between the CNN model-predicted structures and the target. (a) Single EIT Case 1; (b) Single EIT Case 2; (c) Double EIT Case 1; (d) Double EIT Case 2.
The RSEs of the ID-TransNet, the IDN, and the CNN model are compared using the same four test samples, as summarized in Table 4. These comparative results show that our model obtains smaller RSE values than the other two models, confirming its superior generalization capability. Hence, ID-TransNet’s enhanced capability originates from the Transformer layer’s dual function: encoding spectral sequence positions through positional embedding and extracting richer features via multi-head attention mechanisms. Furthermore, the Transformer architecture serves as the foundation for many contemporary large-scale models, owing to its exceptional ability to capture intrinsic deep-level information within sequences [35]. This capability is highly beneficial for the precise extraction of the complex features in the EIT profiles.
Table 4.
Comparison of RSE of the ID-TransNet vs. the IDN and the CNN model.
5. Discussion
In order to explain the experimental results, we outline below the criteria for evaluating a high-quality EIT spectrum. An ideal EIT profile is typically characterized by the following features [8]. Firstly, a high-quality EIT spectrum in a transmissive metasurface must exhibit a pronounced transparency window, i.e., a narrowband, high-transmission peak over a specific frequency range. Secondly, a well-defined EIT response requires pronounced contrast between the transparency peak and absorption dips, where the transmission at the resonant peak significantly exceeds the off-resonance baseline. Thirdly, the EIT spectrum should demonstrate significant phase changes, especially near the transparency window, which enables remarkable slow-light effects. These three fundamental principles provide a comprehensive framework for evaluating the quality of an EIT spectral profile. Based on these fundamental principles, our model allows for the on-demand inverse design of EIT metasurfaces.
It is noteworthy that our model possesses the following advantages. Firstly, this model can achieve precise inverse design of metasurface structures from target EIT spectra, consistently yielding low relative spectral errors in the predictions. Secondly, our approach achieves exceptional design efficiency. It rapidly produces optimized structures by learning complex spectral-structure relationships. This allows it to significantly reduce reliance on time-consuming traditional optimization [9,27], substantially accelerating the overall design workflow [36]. Thirdly, the model demonstrates powerful generalization capability, which stems from its ability to learn the underlying physical principles governing metasurface responses from large-scale simulation data. The model also exhibits strong generalization capability, enabling accurate predictions for novel design scenarios beyond its training data. Remarkably, the pre-trained model can be efficiently transferred to new metasurface design problems through minimal fine-tuning, significantly reducing the data and computational resources required for new applications [22,37].
6. Conclusions
In summary, the ID-TransNet proposed in this work provides an effective approach for the inverse design of EIT metasurfaces and can directly predict optimal structural parameters from target spectra. The trained model can not only dramatically simplify the design of complex EIT metasurfaces but also serve as a versatile platform for broader inverse design tasks. Notably, it enables on-demand inverse design for both single and dual EIT effects, delivering precise structural parameters within seconds. Furthermore, the framework can be extended to handle additional parameters, such as geometric thickness and material refractive index, and can target diverse optical responses beyond EIT, including Fano resonances and transmission phase. Such extensions require only minimal architectural adjustments to the input and output dimensions. Future improvements could integrate optimization algorithms, conditional generative networks, and reinforcement learning to further extend its capabilities, paving the way for more powerful design tools.
Author Contributions
Conceptualization, H.M., H.F. and Y.L.; methodology, H.M. and H.F.; software, H.M. and H.F.; validation, H.F., Y.L. and Y.J.; formal analysis, H.M., Y.L., W.S. and Y.J.; investigation, H.M., W.S. and G.W.; resources, Y.J. and J.J.; data curation, H.M., H.F., W.S., J.W., J.J. and J.L. (Jingyi Liu); writing—original draft preparation, H.M.; writing—review and editing, Y.G.; visualization, H.F. and J.L. (Jia Liu); supervision, Y.G., J.J., J.L. (Jia Liu) and J.L. (Junguo Lu); project administration, H.M.; funding acquisition, H.M., Y.J. and J.L. (Junguo Lu). All authors have read and agreed to the published version of the manuscript.
Funding
This work was supported by Heilongjiang Provincial Natural Science Foundation of China (PL2024F039), Basic Scientific Research Operating Expenses Project of Provincial Higher Education Institutions in Heilongjiang Province (145509116), Basic Scientific Research Operating Expenses Project of Provincial Higher Education Institutions in Heilongjiang Province (145309635), Qiqihar Science and Technology Plan Innovation Incentive Project (CGYGG-2025009), Undergraduate Innovation and Entrepreneurship Training Program (Y202510232340).
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
The authors will supply the relevant data in response to reasonable requests.
Acknowledgments
The authors have reviewed and edited the output and take full responsibility for the content of this publication.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Zhu, L.; Dong, L. Electromagnetically induced transparency metamaterials: Theories, designs and applications. J. Phys. D Appl. Phys. 2022, 55, 263003–263019. [Google Scholar] [CrossRef] [Scilit]
- Meng, H.Y.; Feng, H.L.; Cong, D.Q.; Liu, J.; Yang, S.; Du, H.; Yang, J.; Lin, Y.; Gao, Y.C. Target-driven deep learning for optimization design of electromagnetically induced transparency metasurfaces based on lithium tantalate. Opt. Commun. 2025, 583, 131684–131693. [Google Scholar] [CrossRef] [Scilit]
- Zhao, S.Q.; Fan, Y.C.; Yang, R.S.; Ye, Z.; Zhang, F.; Wang, C.; Luo, W.; Wen, Y.; Zhao, J. Smart reconfigurable metadevices made of shape memory alloy metamaterials. Opto-Electron. Adv. 2025, 8, 240109-1-240109-9. [Google Scholar] [CrossRef] [Scilit]
- Yang, R.; Zhang, F.; Li, Z.; Fu, Q.; Fan, Y. Controllable electromagnetically induced transparency in an electrically tunable terahertz hybrid metasurface. Opt. Laser Technol. 2023, 163, 109380. [Google Scholar] [CrossRef] [Scilit]
- Feng, H.; Meng, H.; Cong, D.; Liu, J.; Yang, S.; Shi, W.; Gao, Y. Spin decoupling-based broadband terahertz encoded metalens with multi-focal points. Opt. Express 2025, 33, 37474–37488. [Google Scholar] [CrossRef] [Scilit]
- Cheng, J.; Li, R.; Wang, Y.; Yuan, Y.; Wang, X.; Chang, S. Inverse design of generic metasurfaces for multifunctional wavefront shaping based on deep neural networks. Opt. Laser Technol. 2023, 159, 109038–109043. [Google Scholar] [CrossRef] [Scilit]
- Guo, L.H.; Zhang, Z.X.; Xie, Q.; Li, W.X.; Xia, F.; Wang, M.; Feng, H.; You, C.; Yun, M. Toroidal dipole bound states in the continuum in all-dielectric metasurface for high-performance refractive index and temperature sensing. Appl. Surf. Sci. 2023, 615, 156408–156416. [Google Scholar] [CrossRef] [Scilit]
- Zhu, L.; Zhang, C.; Dong, L.; Rong, X.M.; Gong, J.Y.; Meng, F.Y. Inverse design of electromagnetically induced transparency(EIT) metasurface based on deep convolutional generative adversarial network. Phys. Scr. 2023, 98, 105501–105511. [Google Scholar] [CrossRef] [Scilit]
- Safavi-Naeini, A.H.; Mayer Alegre, T.P.; Chan, J.; Eichenfield, M.; Winger, M.; Lin, Q.; Hill, T.J.; Chang, D.E.; Painter, O. Electromagnetically induced transparency and slow light with optomechanics. Nature 2011, 472, 69–73. [Google Scholar] [CrossRef] [Scilit]
- Xiao, S.Y.; Wang, T.; Liu, T.T.; Yan, X.C.; Li, Z.; Xu, C. Active modulation of electromagnetically induced transparency analogue in terahertz hybrid metal-graphene metamaterials. Carbon 2018, 126, 271–278. [Google Scholar] [CrossRef] [Scilit]
- Sun, Z.; Xu, B.J.; Jin, F.; Zhou, G.X.; Lin, L. Machine Learning Approach for On-Demand Rapid Constructing Metasurface. IEEE J. Sel. Top. Quantum Electron. 2022, 28, 4700209–4700217. [Google Scholar] [CrossRef] [Scilit]
- Ma, W.; Liu, Z.C.; Kudyshev, Z.A.; Boltasseva, A.; Cai, W.S.; Liu, Y.M. Deep learning for the design of photonic structures. Nat. Photonics 2020, 15, 77–90. [Google Scholar] [CrossRef] [Scilit]
- Qiu, Y.H.; Chen, S.X.; Hou, Z.Y.; Wang, J.J.; Shen, J.; Li, C.Y. Chiral Metasurface for Near-Field Imaging and Far-Field Holography Based on Deep Learning. Micromachines 2023, 14, 789–799. [Google Scholar] [CrossRef] [Scilit]
- Han, C.; Zhang, B.F.; Wang, H.; Ding, J.P. Metamaterial perfect absorber with morphology-engineered meta-atoms using deep learning. Opt. Express 2021, 29, 19955–19963. [Google Scholar] [CrossRef] [Scilit]
- Deng, W.Q.; Xu, Z.J.; Wang, J.H.; Lv, J.W. Long short-term memory neural network for directly inverse design of nanofin metasurface. Opt. Lett. 2022, 47, 3239–3242. [Google Scholar] [CrossRef] [Scilit]
- Zhu, L.; Zhang, C.; Guo, J.; Dong, L.; Gong, J.Y. Deep learning for electromagnetically induced transparency (EIT) metasurface optimization design. J. Phys. D Appl. Phys. 2022, 55, 315001–315010. [Google Scholar] [CrossRef] [Scilit]
- Han, C.; Zhang, B.F.; Wang, H.; Xu, J.; Ding, J.P. Predicting the eigenstructures of metamaterials with QR-code meta-atoms by deep learning. Opt. Lett. 2022, 47, 1863–1866. [Google Scholar] [CrossRef] [Scilit]
- Zhang, Q.; Liu, C.; Wan, X.; Zhang, L.; Liu, S.; Yang, Y. Machine-Learning Designs of Anisotropic Digital Coding Metasurfaces. Adv. Theory Simul. 2018, 2, 1800132–1800144. [Google Scholar] [CrossRef] [Scilit]
- Liu, X.; Cao, X.; Hong, T.; Jiang, W. Deep convolutional generative adversarial networks assisted inverse design of quad-channel full-space metasurface. Opt. Express 2024, 32, 46542–46556. [Google Scholar] [CrossRef] [Scilit]
- Huang, W.; Wei, Z.M.; Tan, B.Y.; Yin, S.; Zhang, W.T. Inverse engineering of electromagnetically induced transparency in terahertz metamaterial via deep learning. J. Phys. D Appl. Phys. 2021, 54, 135102–135110. [Google Scholar] [CrossRef] [Scilit]
- Ashalley, E.; Acheampong, K.; Besteiro, L.V.; Yu, P.; Neogi, A.; Govorov, A.O.; Wang, Z.M. Multitask deep-learning-based design of chiral plasmonic metamaterials. Photonics Res. 2020, 8, 1213–1225. [Google Scholar] [CrossRef] [Scilit]
- Ma, J.; Huang, Y.; Pu, M.; Xu, D.; Luo, J.; Guo, Y.; Luo, X. Inverse design of broadband metasurface absorber based on convolutional autoencoder network and inverse design network. J. Phys. D Appl. Phys. 2020, 53, 464002–464007. [Google Scholar] [CrossRef] [Scilit]
- Zhu, R.C.; Qiu, T.S.; Wang, J.F.; Sui, S.; Hao, C.L.; Liu, T.; Li, Y.; Feng, M.; Zhang, A.; Qiu, C.-W. Phase-to-pattern inverse design paradigm for fast realization of functional metasurfaces via transfer learning. Nat. Commun. 2021, 12, 2974–2983. [Google Scholar] [CrossRef] [Scilit]
- Huang, Y.P.; Feng, N.X.; Cai, Y.J. Artificial Intelligence-Generated Terahertz Multi-Resonant Metasurfaces via Improved Transformer and CGAN Neural Networks. J. Light. Technol. 2024, 42, 1518–1525. [Google Scholar] [CrossRef] [Scilit]
- Ma, J.; Ma, Z.; Li, M.; Li, Y.; Tan, B.; Ding, S. TRMD: A transformer-based reverse design model for quad-band metasurface absorbers. Phys. Scr. 2024, 100, 016003–016016. [Google Scholar] [CrossRef] [Scilit]
- Zhou, Y.; Lai, T.; He, X. Deep learning-based inverse design of broadband metasurface polarization converter. AIP Adv. 2025, 15, 075235. [Google Scholar] [CrossRef] [Scilit]
- Chen, W.; Li, Y.; Liu, Y.; Gao, Y.; Yan, Y.; Dong, Z.; Zhu, J. All-Dielectric SERS Metasurface with Strong Coupling Quasi-BIC Energized by Transformer-Based Deep Learning. Adv. Opt. Mater. 2023, 12, 2301697–2301704. [Google Scholar] [CrossRef] [Scilit]
- Bian, X.; Cheng, X.A.; Liao, J.; Hua, Z.; Xu, Z.; Zhang, J.; Xing, Z. A Transformer-Based Approach to Facilitate Inverse Design of Achromatic Metasurfaces. Photonics 2025, 12, 913–935. [Google Scholar] [CrossRef] [Scilit]
- Li, J.S.; Xue, Y.Y.; Guo, F.L. Triple frequency bands terahertz metasurface sensor based on EIT and BIC effects. Opt. Commun. 2024, 554, 130225–130230. [Google Scholar] [CrossRef] [Scilit]
- Li, Y.; Wang, N.; Shi, J.; Hou, X.; Liu, J. Adaptive Batch Normalization for practical domain adaptation. Pattern Recognit. 2018, 80, 109–117. [Google Scholar] [CrossRef] [Scilit]
- Xia, H.; Chen, S.-L.; Wang, Y.; Zhao, Y.; Jia, H.; Yang, R.; Guo, Y.J. Deep-learning-assisted intelligent design of terahertz hybrid-functional metasurfaces with freeform patterns. Opt. Laser Technol. 2025, 181, 112041. [Google Scholar] [CrossRef] [Scilit]
- Zhang, S.J.; Lu, J.F.; Zhao, H.K. Deep Network Approximation: Beyond ReLU to Diverse Activation Functions. J. Mach. Learn. Res. 2024, 25, 1–39. [Google Scholar]
- Liu, C.; Gao, C.Y.; Xia, X.; Lo, D.; Grundy, J.C. On the Reproducibility and Replicability of Deep Learning in Software Engineering. IEEE Trans. Softw. Eng. 2022, 46, 945–963. [Google Scholar] [CrossRef] [Scilit]
- Harper, E.S.; Coyle, E.J.; Vernon, J.P.; Mills, M.S. Inverse design of broadband highly reflective metasurfaces using neural, networks. Phys. Rev. B 2020, 101, 195104–195109. [Google Scholar] [CrossRef] [Scilit]
- Liu, Y.; Hu, T.; Zhang, H.; Wu, H.; Wang, S.; Ma, L.; Long, M. Transformer: Inverted transformers are effective for time series forecasting. In Proceedings of the International Conference on Learning Representations 2024, Vienna, Austria, 7–11 May 2024. [Google Scholar]
- An, S.S.; Zheng, B.W.; Tan, H.; Shalaginov, M.Y.; Zhou, L.; Li, H.; Kang, M.; Richardson, K.A.; Gu, T.; Hu, J.; et al. Multifunctional Metasurface Design with a Generative Adversarial Network. Adv. Opt. Mater. 2021, 9, 2001433–2001442. [Google Scholar] [CrossRef] [Scilit]
- Xu, D.; Luo, Y.; Luo, J.; Pu, M.; Zhang, Y.; Ha, Y.; Luo, X. Efficient design of a dielectric metasurface with transfer learning and genetic algorithm. Opt. Mater. Express 2021, 11, 1852–1861. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.








