The inverse design of terahertz metamaterial sensors is often hindered by the high cost of full-wave simulations and the inherent non-uniqueness of the structure–spectrum relationship (one-to-many mapping). To address these issues, we propose an improved end-to-end conditional variational autoencoder (CVAE) framework. We established an experience-guided multi-topology library and adopted a non-parameterized binary-grid representation. This approach avoids the resource wastage caused by simulating the majority of invalid non-resonant structures, thereby reducing computational costs while enabling inverse designs beyond fixed geometric templates. Additionally, to accommodate the non-uniqueness, our model leverages the probabilistic generative mechanism to produce a diverse solution space for a single target, enabling a candidate structure pool for secondary selection under engineering constraints. To underpin these capabilities with robust feature learning, the architecture integrates Bi-GRU and ResNet modules to capture spectral long-range dependencies and preserve geometric edge details, stabilized by a dynamic KL annealing strategy. Experimental results demonstrate that the model exhibits high-fidelity bidirectional mapping capabilities, where the forward prediction MSE is as low as 0.00062 and the spectral MAE for inversely designed structures is below 0.025. Based on this workflow, we achieved on-demand designs for distinct absorption targets; the optimized dual-peak sensor achieves a maximum sensitivity of 444 GHz/RIU and a figure of merit (FOM) of 7.58, while the quad-peak sensor attains a maximum sensitivity of 311 GHz/RIU and a FOM of 10.30. This work provides an efficient and practical generative route for customizable terahertz metamaterial sensors under engineering constraints.
Sun et al. (Sun,) studied this question.