Manuscript Offprint
arXiv:2608.29907Diffusion-Based Inverse Design of Dielectric Resonator Metasurfaces for Shaping Smart Electromagnetic Environments
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Future wireless systems are expected to transform the surrounding space from a passive propagation medium into a smart electromagnetic environment, where engineered surfaces control wave propagation, support wireless sensing, and create programmable electromagnetic fingerprints. A key challenge in realizing this vision is the inverse design of metasurfaces for tailored electromagnetic propagation. While forward analysis evaluates the response of a known geometry, the inverse task starts from a prescribed scattering signature and seeks a physically realizable structure that produces it. This inverse task is inherently nonlinear and often high-dimensional, while candidate solutions may be non-unique and provide no direct indication of practical realizability. Here, we introduce a conditional diffusion framework for inverse design of dielectric resonator metasurfaces from target angular scattering patterns. Trained on T-matrix simulated geometry–response pairs, the model learns a conditional distribution of geometries instead of a deterministic mapping, enabling multiple candidate designs for the ill-posed inverse problem. The best generated metasurface achieves a mean percentage error of 1.39%, outperforming CMA-ES optimization (4.1% after 10 h) while requiring only about one minute for after-training inference. The model also produces lower error distributions than deterministic neural baselines for out-of-distribution spectra, highlighting the potential of diffusion models for efficient metasurface design.
*corresponding author (mik.tsukerman@gmail.com)
Introduction
Future wireless systems are expected to operate in environments that are no longer treated as passive propagation media. Instead, the surrounding space can become an active electromagnetic component, shaping waves in ways that support communication, sensing, localization, and identification. This vision is captured by the concept of smart electromagnetic environments, where engineered surfaces are embedded into physical spaces to control reflections, redistribute energy, shape multipath, and create object- or task-specific electromagnetic fingerprints [1], [2], [3], [4], [5].
Metasurfaces are among the main physical platforms proposed for this purpose. By arranging subwavelength or resonant elements across a surface, they can impose tailored amplitude, phase, polarization, or scattering responses on incident waves [6], [7], [8], [9]. This capability has motivated a broad range of approaches, including passive metasurfaces with fixed responses, reconfigurable intelligent surfaces with tunable elements, and optimization-driven designs aimed at beam steering, focusing, anomalous reflection, channel improvement, or sensing enhancement [4], [5], [10]. In most cases, however, the design procedure is still formulated around a reduced target: a prescribed phase profile, a desired far-field lobe, or an isolated scattering characteristic.
A key difficulty is that smart electromagnetic environments require more than designing a standalone surface under idealized illumination. The surface response must remain physically realizable, compatible with material and fabrication constraints, and useful inside a real propagation scenario containing multiple objects, users, paths, and boundary conditions [11]. This creates a demanding inverse-design task. Forward electromagnetic analysis can evaluate the scattering response of a known geometry, but the practically relevant direction is reversed: starting from a desired electromagnetic signature or environmental function, one must identify a feasible structure that produces it. Such a task is nonlinear, often high-dimensional, and constrained by the fact that mathematically suitable responses do not automatically correspond to manufacturable or robust designs [10], [12], [13], [14], [15].
Traditional approaches, such as topology optimization or evolutionary algorithms, rely on repeated forward simulations and often require expert tuning, making them computationally demanding for rapid inverse design [16]. These challenges motivate data-driven inverse scattering methods that learn from electromagnetic simulations while preserving the ability to generate multiple candidate geometries [17]. Machine Learning has provided a promising alternative allowing for learning the structure–response mapping [18]. In particular, generative models are attractive because they do not force the inverse map into a single deterministic prediction. Instead, they approximate the data distribution information about which can be extracted from the training dataset [19]. After approximation, generative models sample a family of possible structures conditioned on a target response without versatility vanishing and falling to a mean solution that does not satisfy all conditions [20]. This capability is especially relevant for metasurface design in smart electromagnetic environments, where the final goal is not merely to reproduce an isolated scattering curve, but to enable controllable electromagnetic functionality under realistic system-level requirements [21], [22].
Here, we position diffusion-based inverse design as a generative route toward metasurface synthesis for smart electromagnetic environments. Rather than treating metasurface design as a search for one optimized structure under a fixed target, the proposed approach frames the task as conditional generation of feasible scattering architectures. This shift is important for complex electromagnetic settings, where useful solutions may form a family of possible designs rather than a single optimum. By combining data-driven generation with forward electromagnetic verification, such a workflow can bridge the gap between abstract target responses and practically testable metasurface candidates, Figure 1.
- Smart electromagnetic environment

Multipath shaping
Controlled propagation
Wireless sensing
Programmable EM fingerprints
- Conditional diffusion inverse design
Iterative denoising / sampling
Search space
Cell i:
Geometry vector:
Dielectric resonator metasurface
- Targeted angular scattering
Figure 1. Diffusion-based inverse design for smart electromagnetic environments. Step 1: The electromagnetic environment defines the target functionality, including multipath shaping, controlled propagation, wireless sensing, and programmable electromagnetic fingerprints. Step 2: The required functionality is encoded as a target angular scattering response and used to condition a diffusion-based inverse-design model. Through iterative denoising, the model generates candidate geometry vectors within an N×N dielectric resonator metasurface search space, where each unit cell contains one spherical resonator described by its in-plane position and radius: . Step 3: The generated metasurface is introduced into the environment and verified by forward electromagnetic simulation, yielding a structure that realizes the desired angular scattering response on demand.
The remainder is structured as follows. Angular scattering control is first formulated as an inverse-design problem, followed by a description of the T-matrix dataset generation procedure. The conditional diffusion framework is then introduced and benchmarked against deterministic neural baselines and CMA-ES optimization. Finally, random target-spectrum conditioning is used to evaluate sampling efficiency and generalization.
For a given metasurface geometry x, the forward electromagnetic model returns the far-field differential scattering cross section. Although the scattering process is fully two-dimensional (it depends on elevation and azimuth spherical coordinates), the design target is reduced here to a one-dimensional polar angular profile. For each geometry, the electromagnetic solver calculates the far-field differential cross section, which is then integrated over the azimuthal coordinate:
The target response is represented by a vector sampled at a predefined set of polar observation angles:
Similarly, the response of a candidate structure is written as:
The inverse design task is to find a physically admissible geometry whose calculated angular response matches the prescribed vector . In compact form:
where X denotes the space of allowed metasurface geometries and quantifies the mismatch between the desired and obtained scattering diagrams. This task is non-trivial because the metric compares an entire angular distribution rather than a single scalar quantity. Small deviations near minima, rapid angular variations, and multi-lobe responses can strongly affect the quality of the generated design. In addition, some prescribed patterns may not be achievable within a chosen parameterization, while mathematically suitable candidates may remain detached from practical constraints such as fabrication limits, material availability, losses, and tolerances. Here, the main quantitative error is the mean percentage error (MPE), defined as:
where , . The same metric is used to evaluate generated metasurfaces and compare the diffusion approach with deterministic neural baselines and direct optimization. This formulation makes the design target more general than conventional beam shaping, since the optimization is driven by the complete angular scattering signature.
Methods
Forward T-Matrix Model and Dataset Generation
The conditional diffusion model requires paired examples linking a metasurface geometry to its electromagnetic response. In the present work, these pairs are generated synthetically rather than collected experimentally. This choice is deliberate: the forward problem can be solved accurately for the selected class of arrays, allowing a large and internally consistent training set to be produced before the inverse model is trained.
The chosen structures consist of dielectric spherical resonators arranged on a planar (NxN) lattice, as schematically shown in Figure 1. Each unit cell contains one dielectric spherical resonator. The sphere is parameterized by its in-plane center coordinates and radius , which vary continuously within geometrical bounds that keep it inside the assigned cell and prevent overlap with neighboring elements. The refractive index is fixed at , corresponding to a non-magnetic lossless dielectric. This value represents a generic moderate-index contrast, relevant to high-index dielectrics in photonics and polymer-based materials at microwave frequencies [23]. All geometrical parameters are normalized to the wavelength. Owing to the scale invariance of Maxwell's equations in dispersionless media, the same formulation can be transferred across frequency ranges, provided that material dispersion, losses, and fabrication constraints are properly accounted for.
The forward solver was implemented using the T-matrix formalism in SMUTHI [24]. This choice is natural for the present parameterization, because each meta-atom is a homogeneous dielectric sphere whose electromagnetic response can be represented by a single-particle scattering operator in a vector-spherical-harmonic basis [25]. The array response is then obtained by coupling these operators through translation matrices, allowing recurrent multiple scattering between all resonators to be included. Compared with mesh-based full-wave simulations, this formulation is computationally efficient for generating large datasets, while still retaining the electromagnetic interactions needed to evaluate the angular scattering pattern. The solver therefore provides a suitable forward model for both training-data generation and independent verification of the structures produced by the inverse-design algorithm.
The dataset used to train the diffusion network was constructed as follows. A small array with 4 occupied cells was taken as a benchmark system. Thus, each structure is represented by a 12-dimensional geometry vector. The square design region had a side length of , and all geometrical parameters were expressed in wavelength-normalized units. For every generated geometry, the forward T-matrix solver calculated the azimuthally integrated far-field response, which was then sampled at 10 polar observation angles: (10°, 20°, 40°, 60°, 70°, 80°, 100°, 120°, 140°, 160°). The incident field is a TE-polarized plane wave. In total, 11,000 randomly generated structures were calculated, producing paired geometry-response examples for training, validation, and benchmarking.
Conditional Diffusion Framework for Inverse Scattering Design
To address the one-to-many nature of inverse geometry design, we propose a conditional diffusion model that learns to generate metasurface geometries from target scattering profiles. As illustrated in Figure 2, the model operates through two complementary phases and follows the Denoising Diffusion Probabilistic Model (DDPM) framework [26]: here, each metasurface geometry is represented by a one-dimensional vector , while the conditioning input is the desired differential scattering cross-section spectrum sampled at selected polar angles. During training, Gaussian noise is progressively added to the forward diffusion process, producing a noisy geometry vector :
In the forward diffusion process, the amount of added Gaussian noise was controlled by a cosine schedule, which provides a smoother SNR decay than a linear schedule and improves the stability of DDPM training [27]:
The neural network receives the noisy geometry vector , the diffusion step , and the target spectrum condition. It learns to predict the noise component that was added during the forward process at each step. This prediction is used to compute the mean of the reverse Gaussian distribution used for denoising:
There, denotes the forward noise variance. Using , the denoising process is performed, Eq. 9.
The meaning of the final denoised vector depends on the stage of operation. During training, the clean geometry vector is known, and the network learns to recover it from a noisy realization by predicting the injected Gaussian noise. During inference, no initial geometry is provided; instead, the reverse process starts from a random Gaussian vector . After the T denoising steps, the model outputs a generated geometry vector conditioned on the prescribed scattering spectrum.
The denoising network is based on a 1D U-Net architecture [28], chosen to operate directly on the geometry-vector representation. The architecture upgrade was performed in the conditioning field. To incorporate the target scattering spectrum into the generation process, FiLM modulation was implemented in the architecture [29]. In this mechanism, the desired spectrum vector is transformed into affine modulation parameters ( , ) generated by two-layer networks (different for each ResNet Block in the U-Net architecture, 19 in total, producing different & for different channels), processing the scattering conditions. These parameters adjust the internal feature maps of the U-Net during denoising, Eq. 10. The network therefore learns not only the distribution of valid geometry vectors, but also how the denoising trajectory should change for different requested scattering signatures. The advantage of FiLM conditioning over, for example, concatenation of a vector of desired scattering values and a vector of geometric features of a metasurface is the ability to add information about the spectrum to any number of hidden states of a neural network. In this way, information about scattering remains undiminished in the depth of the network, which makes it possible to train deeper and more complex architectures more efficiently.
The network was trained on the simulated dataset described above using 1000 diffusion steps, a batch size of 16, a learning rate of , and 116 training epochs. This architecture enables repeated sampling for the same target spectrum, producing multiple candidate geometries that can be ranked by their forward-calculated scattering error. The entire learning process took 6 hours on a virtual machine with access to a 2.20 GHz dual-threaded Intel Xeon CPU E5-2673 v4 processor.

Figure 2. Conditional Denoising Diffusion Probabilistic Model (DDPM) workflow for metasurface geometry generation. A dielectric resonator metasurface is first encoded as a one-dimensional geometry vector. During training, Gaussian noise is added to this vector through the forward diffusion process. A one-dimensional U-Net receives the noisy geometry, the diffusion step, and the desired differential scattering cross-section (DSCS) spectrum, which is introduced through Feature-wise Linear Modulation (FiLM) and Time modulation to know the number of denoising steps. The network predicts the added noise, enabling reconstruction of a clean geometry vector. The reconstructed vector is then converted back into a candidate metasurface geometry.
Results
Diffusion Model Performance and Baseline Comparison
Figure 3A shows the evolution of the MPE statistics during training. To test generalization beyond the training set, the model was evaluated on a target scattering spectrum that was not included in the training data. For each training milestone, the conditional generation process was repeated ten times to calculate the mean, median, and standard deviation of the resulting MPE values. The decrease in these statistics with the number of epochs indicates that the model gradually learns to generate geometry vectors whose forward-calculated scattering responses approach the conditioning spectra. This behavior shows that the model does not simply pick geometries randomly from the search space, but learns a reproducible relation between the target scattering response and admissible metasurface geometries. The remaining fluctuations are expected because diffusion sampling is stochastic and because the inverse task requires matching the scattering response at multiple polar angles, rather than optimizing a single scalar quantity.
After training, the diffusion model was used to sample 40 candidate metasurfaces conditioned on the target DSCS profile of the unseen structure. The best-performing generated sample, shown in Figure 3B, achieved an MPE of 1.39%, indicating accurate reproduction of the target scattering response at the specified polar angles, including both low-scattering regions and the rapidly increasing response at larger angles. The MPE distribution across all 40 generated samples is shown in Figure 3C. The median error of 18.91%, together with a relatively compact interquartile range, indicates that the model generates physically relevant candidates rather than isolated successful samples. The spread of the distribution reflects the stochastic nature of diffusion-based generation: individual samples differ in quality, but the generated candidate pool contains several structures that can be ranked by forward electromagnetic verification. This workflow is important for practical inverse design, where the neural model proposes candidate geometries and the final selection is performed using the physical solver.
Comparison with Deterministic Neural Baselines
The diffusion model was further benchmarked against two deterministic neural baselines: a multilayer perceptron (MLP) and a one-dimensional convolutional neural network (1D-CNN), as described in Appendix A1. Figure 3D compares the MPE distributions obtained for 100 out-of-distribution target spectra. The deterministic models produce broader error distributions and more high-error cases, reflecting the difficulty of mapping a one-to-many inverse problem onto a single predicted geometry. In contrast, the diffusion model yields a lower and more compact error distribution, indicating that conditional generative sampling is better suited for this inverse scattering task.
Overall, Figure 3 demonstrates three key points. First, the diffusion model converges during training toward a lower forward-verified reconstruction error. Second, high-quality geometries can be generated for target spectra that were not directly present in the training set. Third, the probabilistic generation strategy provides a clear advantage over deterministic neural predictors when the objective is to synthesize full angular scattering patterns.
A
MPE Loss statistics over epochs

B
Differential scattering cross-section spectra
C
MPE Loss distribution
D
Figure 3. Performance of the conditional diffusion framework for inverse scattering design. (A) Evolution of the mean percentage error (MPE) during training, showing the mean, median, and standard deviation over generated samples. (B) Representative target-spectrum reconstruction, comparing the prescribed differential scattering cross-section (DSCS) profile with the forward-calculated response of the best generated metasurface. (C) MPE distribution for 40 independently generated candidates conditioned on the same out-of-distribution target spectrum. (D) Benchmark against deterministic multilayer perceptron (MLP) and one-dimensional convolutional neural network (1D-CNN) baselines over 100 out-of-distribution target spectra.
Comparison with evolutionary optimization
The performance of the diffusion model was also compared with the evolutionary optimization algorithm CMA-ES, Appendix A2. The evolutionary stochastic optimization algorithm was chosen for comparison as one of the most stable optimization methods with good convergence in complex and nonlinear search spaces, which, however, does not belong to the class of deep learning algorithms. CMA-ES has proven itself well in various metasurface optimization problems in electromagnetism [11], [30]. The scheme of its optimization process is detailed in Appendix A2. CMA-ES starts by randomly generating an initial population of array geometries. Each candidate is evaluated by calculating the MPE between its forward-calculated scattering response and the target spectrum. The candidates are then ranked from lowest to highest MPE, and the best-performing half of the population is selected. This selected subset is used to update the mean and covariance matrix of the sampling distribution, guiding the next generation toward regions of the design space with lower error. Using the updated sampling distribution, CMA-ES generates a new set of candidate geometries. These candidates replace the discarded lower-performing geometries, and the optimization loop is repeated: objective-function evaluation → ranking → selection → distribution update. In this work, the loop was terminated after a preset number of iterations.
The main CMA-ES hyperparameters are the population size, the initial step size ( ), and the number of iterations. The values used in this study are summarized in Table 1. In addition to these parameters, the initial mean of the sampling distribution is important because it determines the region of the design space explored at the beginning of the optimization. A suitable initialization can accelerate convergence, whereas a poor initialization may increase the required optimization time and lead to lower-quality solutions. The population size was selected based on the commonly used CMA-ES recommendation as [31], where d the dimensions of the problem are (here d = 12). This choice corresponds to a population size of 12. Convergence usually requires O(100d) to O(1000d) iterations [32]. In this study, two population sizes were tested: the recommended value of 12 and an enlarged population of 60.
| Hyperparameter | Value |
|---|---|
| Population size (λ) | 12 / 60 |
| Value of σ | 0.05 |
| Number of iterations | 1,200 |
Table 1. Hyperparameters of CMA-ES optimization.
The population size affects both optimization quality and runtime. Larger populations explore a broader region of the design space at each iteration, but require more forward-scattering calculations. The results of the numerical experiments are summarized in Table 2.
| Algorithm / Model | CMA-ES, λ = 12 | CMA-ES, λ = 60 | Diffusion |
| Best solution (MPE) | 9.4% | 4.1% | 1.4% |
|---|---|---|---|
| Runtime | ≈ 2 hours | ≈ 10 hours | ≈ 1 minutes |
Table 2. Performance comparison of CMA-ES and the Diffusion model
The diffusion model outperforms CMA-ES both in solution quality and generation time. After a one-time training stage of approximately 6 hours, the trained diffusion model generates candidate metasurfaces for a new target spectrum in less than one minute. In contrast, CMA-ES must be restarted for each new target spectrum and requires repeated forward-scattering evaluations throughout the optimization process, leading to runtimes of several hours. The difference is especially important because the performance of CMA-ES depends on the initial population. Different random initializations can lead to different convergence trajectories and final errors, so several independent restarts are often required to obtain a reliable solution. The diffusion model avoids this repeated optimization cost: once trained, it can be reused for different target spectra and can rapidly provide a pool of candidate geometries for subsequent forward electromagnetic verification.
Random Spectrum Conditioning and Sampling Efficiency
To test whether the trained models can respond to scattering requirements beyond spectra directly drawn from the dataset, an additional random-spectrum conditioning study was performed. In this test, target angular responses were generated by varying two parameters of a random spectral construction: the number of terms in the series and the maximal random frequency, Eq. 11. The random target spectra were constructed as weighted sums of angular components with random frequencies and phases. This choice is motivated by the modal nature of electromagnetic scattering, where far-field angular responses can be represented as superpositions of angular modes or multipole contributions. The amplitude weighting (1/k) was introduced as a simple regularization envelope: lower-order components define the dominant scattering lobes, whereas higher-order components contribute weaker fine-scale angular variations. This prevents the synthetic targets from being dominated by rapid oscillations while still providing diverse conditioning spectra for testing the generative model:
where denotes a uniform distribution. To recap, the amplitude of the (k)-th angular component was weighted by (1/k), rather than chosen randomly, to suppress excessive high-order oscillations. This weighting is consistent with multimode electromagnetic scattering, where lower-order modes typically define the dominant angular response and higher-order modes add weaker fine-scale variations.
Figure 4A compares the absolute MPE obtained by the multilayer perceptron (MLP), the one-dimensional convolutional neural network (1D-CNN), and the conditional diffusion model for the same set of random target spectra. The horizontal axis shows the number of angular components used to generate the target spectrum, while the vertical axis shows the maximum angular frequency allowed in the random spectrum. Moving to the right increases the number of components, and moving upward increases the angular complexity of the target profile. The color scale represents the absolute MPE, with lower values corresponding to better agreement between the generated and target scattering spectra. The deterministic neural networks show relatively large errors over much of the grid, with several cases exceeding 40–60% MPE. By contrast, the diffusion model maintains substantially lower errors across the tested conditions, including cases with increased spectral complexity. This behavior indicates that the diffusion generator does not merely interpolate a fixed geometry-response map, but can use the conditioning vector to search a broader family of candidate metasurface geometries.
A

1D CNN Model
Diffusion Model
B
How fast we can find the best solution with Diffusion

Figure 4. Random angular scattering targets. (A) Absolute mean percentage error (MPE) obtained by the multilayer perceptron (MLP), one-dimensional convolutional neural network (1D-CNN), and diffusion model for randomly generated target spectra with different numbers of series terms and maximal random frequencies. (B) The number of diffusion sampling attempts required to obtain a generated geometry that outperforms both deterministic neural baselines.
The sampling behavior of the diffusion model is further quantified in Figure 4B. The horizontal axis shows the number of diffusion sampling attempts required to obtain a generated geometry that outperforms the deterministic neural baselines. The vertical axis shows the number of target spectra for which this occurred after the corresponding number of attempts. For each random target spectrum, the model was sampled repeatedly until a generated geometry outperformed both deterministic baselines. In most cases, only a small number of sampling attempts were required, while a few harder conditions required additional trials. This result is important for inverse scattering design: the diffusion model is not limited to a single output, and performance can be improved by generating a candidate pool followed by forward electromagnetic verification. The computational cost of repeated sampling remains low compared with direct iterative optimization, making this workflow suitable for practical screening of multiple metasurface designs. As an intermediate conclusion, this study demonstrates that the conditional diffusion model is more robust to random target scattering conditions than the deterministic baselines. Across the tested grid of random spectra, the MLP and 1D-CNN frequently produce high MPE values, while the diffusion model keeps the error substantially lower for most conditions. This indicates that generative sampling is better suited to the one-to-many nature of the inverse scattering task. The sampling-efficiency analysis further shows that the best diffusion result is usually found after only a few trials, meaning that repeated generation followed by forward verification can improve design quality without resorting to expensive direct optimization. Overall, these results support the use of diffusion models as practical candidate generators for complex metasurface inverse design.
Conclusion
A conditional diffusion framework was developed for the inverse design of dielectric resonator metasurfaces with prescribed angular scattering responses. The inverse-design task was formulated as the generation of physically admissible geometry vectors whose forward-calculated differential scattering cross-section spectra match a target angular profile. Paired geometry-response data were generated using a T-matrix forward solver, allowing the diffusion model to learn a conditional distribution of metasurface geometries rather than a single deterministic mapping. The results demonstrate that diffusion-based generation is well suited to the one-to-many nature of electromagnetic inverse design. For an unseen target spectrum, the trained model generated a candidate metasurface with an MPE of 1.39% after forward electromagnetic verification. Compared with deterministic MLP and 1D-CNN baselines, the diffusion model produced lower and more compact error distributions for out-of-distribution targets. It also outperformed CMA-ES optimization in both reconstruction quality and runtime after training, reducing the generation of candidate structures from several hours of iterative optimization to approximately one minute of inference. The random-spectrum conditioning study further showed that the model can respond to target angular profiles beyond those directly sampled from the training set. The use of repeated stochastic sampling allowed multiple candidate geometries to be generated for the same prescribed spectrum, with final selection performed by the physical solver. This workflow is important for practical metasurface synthesis, where non-unique solutions, fabrication constraints, and forward-verification requirements make single-output deterministic prediction insufficient.
As an outlook, the main potential of the proposed approach lies in complex electromagnetic environments where direct optimization becomes prohibitively expensive. In realistic environments, each candidate metasurface must be evaluated together with surrounding objects, sources, receivers, and boundary conditions. Repeating such full-wave calculations inside an evolutionary or topology-optimization loop can quickly become impractical. A trained diffusion model can instead serve as a fast candidate generator, producing physically plausible designs that are then screened by a limited number of high-fidelity simulations. This makes the approach attractive for system-level metasurface optimization, where the direct solver is the computational bottleneck.
Data Availability
The dataset and source code supporting the findings of this study are available at https://github.com/mikzuker/inverse_design_metasurface_generation.
Author Contributions
M.T. and K.G. conceptualized the study, designed the parametrization, performed diffusion model training and inference, and analyzed results statistically. D.V. coordinated physics aspects of the project. P.G. supervised the project. All authors contributed to writing the manuscript and approved the final version.
References:
[1] C. Liaskos, S. Nie, A. Tsioliaridou, A. Pitsillides, S. Ioannidis, and I. Akyildiz, "A New Wireless Communication Paradigm through Software-Controlled Metasurfaces," IEEE Commun. Mag., vol. 56, no. 9, pp. 162–169, Sep. 2018, doi: 10.1109/MCOM.2018.1700659.
[2] M. Di Renzo et al., “Smart Radio Environments Empowered by Reconfigurable Intelligent Surfaces: How It Works, State of Research, and The Road Ahead,” IEEE J. Sel. Areas Commun., vol. 38, no. 11, pp. 2450–2525, Nov. 2020, doi: 10.1109/JSAC.2020.3007211.
[3] Q. Wu and R. Zhang, “Towards Smart and Reconfigurable Environment: Intelligent Reflecting Surface Aided Wireless Network,” IEEE Commun. Mag., vol. 58, no. 1, pp. 106–112, Jan. 2020, doi: 10.1109/MCOM.001.1900107.
[4] E. Basar, M. Di Renzo, J. De Rosny, M. Debbah, M.-S. Alouini, and R. Zhang, "Wireless Communications Through Reconfigurable Intelligent Surfaces," IEEE Access, vol. 7, pp. 116753–116773, 2019, doi: 10.1109/ACCESS.2019.2935192.
[5] T. J. Cui, M. Q. Qi, X. Wan, J. Zhao, and Q. Cheng, "Coding metamaterials, digital metamaterials and programmable metamaterials," Light Sci. Appl., vol. 3, no. 10, pp. e218–e218, Oct. 2014, doi: 10.1038/lsa.2014.99.
[6] N. Yu and F. Capasso, "Flat optics with designer metasurfaces," Nat. Mater., vol. 13, no. 2, pp. 139–150, Feb. 2014, doi: 10.1038/nmat3839.
[7] A. V. Kildishev, A. Boltasseva, and V. M. Shalaev, "Planar Photonics with Metasurfaces," Science, vol. 339, no. 6125, p. 1232009, Mar. 2013, doi: 10.1126/science.1232009.
[8] N. Yu et al., “Light Propagation with Phase Discontinuities: Generalized Laws of Reflection and Refraction,” Science, vol. 334, no. 6054, pp. 333–337, Oct. 2011, doi: 10.1126/science.1210713.
[9] D. Lin, P. Fan, E. Hasman, and M. L. Brongersma, “Dielectric gradient metasurface optical elements,” Science, vol. 345, no. 6194, pp. 298–302, Jul. 2014, doi: 10.1126/science.1253213.
[10] S. Molesky, Z. Lin, A. Y. Piggott, W. Jin, J. Vucković, and A. W. Rodriguez, “Inverse design in nanophotonics,” Nat. Photonics, vol. 12, no. 11, pp. 659–670, Nov. 2018, doi: 10.1038/s41566-018-0246-9.
[11] M. Tsukerman et al., “Tailor-made metasurfaces for scattering control,” Sci. Rep., vol. 16, no. 1, p. 17665, Apr. 2026, doi: 10.1038/s41598-026-44531-3.
[12] Y. Deng, S. Ren, K. Fan, J. M. Malof, and W. J. Padilla, “Neural-adjoint method for the inverse design of all-dielectric metasurfaces,” Opt. Express, vol. 29, no. 5, pp. 7526–7534, Mar. 2021, doi: 10.1364/OE.419138.
[13] S. Ren, A. Mahendra, O. Khatib, Y. Deng, W. J. Padilla, and J. M. Malof, “Inverse deep learning methods and benchmarks for artificial electromagnetic material design,” Nanoscale, vol. 14, no. 10, pp. 3958–3969, Mar. 2022, doi: 10.1039/D1NR08346E.
[14] Y. Augenstein and C. Rockstuhl, “Inverse Design of Nanophotonic Devices with Structural Integrity,” ACS Photonics, vol. 7, no. 8, pp. 2190–2196, Aug. 2020, doi: 10.1021/acsphotonics.0c00699.
[15] Y. Augenstein, T. Repän, and C. Rockstuhl, “Neural Operator-Based Surrogate Solver for Free-Form Electromagnetic Inverse Design,” ACS Photonics, vol. 10, no. 5, pp. 1547–1557, May 2023, doi: 10.1021/acsphotonics.3c00156.
[16] C. Qian and W. Ye, “Accelerating gradient-based topology optimization design with dual-model neural networks,” Sep. 14, 2020, arXiv:2009.06245. doi:10.48550/arXiv.2009.06245.
[17] D. Lee, W. W. Chen, L. Wang, Y.-C. Chan, and W. Chen, "Data-Driven Design for Metamaterials and Multiscale Systems: A Review," Adv. Mater., vol. 36, no. 8, p. 2305254, Feb. 2024, doi: 10.1002/adma.202305254.
[18] J.-H. Bastek, S. Kumar, B. Telgen, R. N. Glaesener, and D. M. Kochmann, “Inverting the structure–property map of truss metamaterials by deep learning,” Proc. Natl. Acad. Sci., vol. 119, no. 1, p. e2111505119, Jan. 2022, doi: 10.1073/pnas.2111505119.
[19] L. Wang, Y.-C. Chan, F. Ahmed, Z. Liu, P. Zhu, and W. Chen, "Deep Generative Modeling for Mechanistic-based Learning and Design of Metamaterial Systems," Comput. Methods Appl. Mech. Eng., vol. 372, p. 113377, Dec. 2020, doi: 10.1016/j.cma.2020.113377.
[20] Z. Liu, D. Zhu, S. P. Rodrigues, K.-T. Lee, and W. Cai, “Generative Model for the Inverse Design of Metasurfaces,” Nano Lett., vol. 18, no. 10, pp. 6570–6576, Oct. 2018, doi: 10.1021/acs.nanolett.8b03171.
[21] P. Naseri and S. V. Hum, “A Generative Machine Learning-Based Approach for Inverse Design of Multilayer Metasurfaces,” IEEE Trans. Antennas Propag., vol. 69, no. 9, pp. 5725–5739, Sep. 2021, doi: 10.1109/TAP.2021.3060142.
[22] I. Tanriover, D. Lee, W. Chen, and K. Aydin, “Deep Generative Modeling and Inverse Design of Manufacturable Free-Form Dielectric Metasurfaces,” ACS Photonics, vol. 10, no. 4, pp. 875–883, Apr. 2023, doi: 10.1021/acsphotonics.2c01006.
[23] D. Filonov, S. Kolen, A. Shmidt, Y. Shacham-Diamand, A. Boag, and P. Ginzburg, "Volumetric 3D-Printed Antennas, Manufactured via Selective Polymer Metallization," Phys. Status Solidi RRL – Rapid Res. Lett., vol. 13, no. 6, 2019, doi: 10.1002/pssr.201800668.
[24] A. Egel, K. M. Czajkowski, D. Theobald, K. Ladutenko, A. S. Kuznetsov, and L. Pattelli, "SMUTHI: A python package for the simulation of light scattering by multiple particles near or between planar interfaces," J. Quant. Spectrosc. Radiat. Transf., vol. 273, p. 107846, Oct. 2021, doi: 10.1016/j.jqsrt.2021.107846.
[25] N. Asadova et al., “Gradient-based optimization of scatterer arrangements based on the T-matrix method,” APL Photonics, vol. 11, no. 5, p. 056116, May 2026, doi: 10.1063/5.0316808.
[26] P. Nakkiran, A. Bradley, H. Zhou, and M. Advani, “Step-by-Step Diffusion: An Elementary Tutorial,” Jun. 23, 2024, arXiv:2406.08929. doi: 10.48550/arXiv.2406.08929.
[27] A. Nichol and P. Dhariwal, “Improved Denoising Diffusion Probabilistic Models,” Feb. 18, 2021, arXiv:2102.09672. doi: 10.48550/arXiv.2102.09672.
[28] J. Ho, A. Jain, and P. Abbeel, “Denoising Diffusion Probabilistic Models,” Dec. 16, 2020, arXiv: arXiv:2006.11239. doi: 10.48550/arXiv.2006.11239.
[29] E. Perez, F. Strub, H. de Vries, V. Dumoulin, and A. Courville, “FiLM: Visual Reasoning with a General Conditioning Layer,” Dec. 18, 2017, arXiv:1709.07871. doi:10.48550/arXiv.1709.07871.
[30] A. Mikhailovskaya, K. Grotov, D. Vovchuk, D. Dobrykh, C. Rockstuhl, and P. Ginzburg, "Superradiant Broadband Magnetoelectric Arrays Empowered by Meta-Learning," IEEE Trans. Antennas Propag., vol. 73, no. 4, pp. 2596–2604, Apr. 2025, doi: 10.1109/TAP.2024.3524423.
[31] N. Hansen, “The CMA Evolution Strategy: A Tutorial,” Mar. 10, 2023, arXiv: arXiv:1604.00772. doi: 10.48550/arXiv.1604.00772.
[32] N. Hansen, S. D. Müller, and P. Koumoutsakos, “Reducing the time complexity of the derandomized evolution strategy with covariance matrix adaptation (CMA-ES),” Evol. Comput., vol. 11, no. 1, pp. 1–18, 2003, doi: 10.1162/106365603321828970.
Supplementary information
A1. Deterministic neural-network baselines
Two deterministic neural architectures were implemented as additional baselines, Figure S1: a multilayer perceptron (MLP) and a one-dimensional convolutional neural network (1D-CNN). Both networks receive the target scattering vector as input and predict a single metasurface geometry vector. The MLP consists of fully connected layers with normalization, nonlinear activation, and dropout. The 1D-CNN uses convolutional blocks to extract local patterns from the input scattering vector before mapping the encoded representation to the geometry parameters. These models test whether the inverse-design task can be solved by direct deterministic regression from scattering spectra to geometries. Their learnable parameter counts were chosen to be comparable to the diffusion model, so that the comparison reflects the effect of the architecture rather than a large difference in network capacity. The MLP contains approximately 935,000 trainable parameters, while the 1D-CNN contains approximately 943,000. The 1D U-Net contains approximately 880,000 trainable parameters.
A

B
Figure S1. Deterministic neural-network baselines. Architectures used for comparison with the conditional diffusion model: (A) A multilayer perceptron (MLP) mapping the scattering vector directly to a metasurface geometry vector; (B) a one-dimensional convolutional neural network (1D-CNN) using convolutional feature extraction followed by a dense output layer. Both architectures produce one deterministic geometry for each prescribed scattering spectrum.
A2. CMA-ES optimization baseline
The diffusion model was compared with the covariance matrix adaptation evolution strategy (CMA-ES), a derivative-free evolutionary optimization method. CMA-ES was selected as a non-neural baseline because it is suitable for nonlinear search spaces where gradients are unavailable or expensive to compute. In the present inverse-design task, each individual in the population corresponds to a candidate metasurface geometry vector. At every iteration, the forward T-matrix solver evaluates the angular scattering response of each candidate, and the mean percentage error is used as the objective function. The population statistics are then updated by adapting the mean vector and covariance matrix of the sampling distribution, from which the next generation of candidate geometries is drawn. CMA-ES therefore provides a direct optimization reference: unlike the trained diffusion model, it does not learn a reusable inverse map, but solves each target-spectrum problem from scratch through repeated forward simulations. This makes it useful for benchmarking reconstruction quality and runtime against the diffusion-based generator. The algorithm starts from an initialized population of candidate metasurface geometries. Each candidate is evaluated by the forward solver, ranked according to the scattering-error objective, and used to update the population means and covariance matrix. New geometries are then sampled from the updated distribution until the termination criterion is reached, Figure S2.

Figure S2. Scheme of CMA-ES (Covariance Matrix Adaptation Evolution Strategy) algorithm.