원시데이터 수집 시스템
선정목록으로

Inverse Design of Diffractive Metasurfaces Using Diffusion Models

간접 관련 필름·전자재료 · (13) 프리즘 필름 (11) 배리어 필름(15) 디스플레이 패널재료(16) CPI(투명 폴리이미드)

기본 정보

저자
  1. Liav Hen — School of Electrical and Computer Engineering|||Tel-Aviv University|||School of Electrical and Computer Engineering, Tel-Aviv University, Tel-Aviv 6997801, Israel
  2. Erez Yosef — School of Electrical and Computer Engineering|||Tel-Aviv University|||School of Electrical and Computer Engineering, Tel-Aviv University, Tel-Aviv 6997801, Israel
  3. Dan Raviv — School of Electrical and Computer Engineering|||Tel-Aviv University
  4. Raja Giryes — School of Electrical and Computer Engineering|||Tel-Aviv University
  5. Jacob Scheuer — School of Electrical and Computer Engineering|||Tel-Aviv University|||The Center for Nanosciences and Nanotechnology|||The Center for Nanosciences and Nanotechnology, Tel-Aviv University, Tel-Aviv 6997801, Israel
DOI
10.1021/acsphotonics.5c01384
저널
ACS Photonics
발행년도
2025
발행기관
American Chemical Society
피인용수
0
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1021/acsphotonics.5c01384
토픽
Optical Coatings and Gratings
OpenAlex ID
W4414381629

평가 내용

관련도
간접 관련
사업분야
필름·전자재료 · (13) 프리즘 필름
부 분야
(11) 배리어 필름, (15) 디스플레이 패널재료, (16) CPI(투명 폴리이미드)
R&D 측면
분석·모델링
확신도
0.70
근거 용어
metasurfaces, inverse design, diffractive, diffusion models, optical response
판단 근거
논문은 확산 모델(Diffusion Models)을 이용해 원하는 광학 특성을 갖는 메타표면(Metasurfaces)의 구조를 역설계하는 방법론을 다룹니다. 이는 코오롱인더스트리의 광학 필름(13) 및 디스플레이 관련 소재(11, 15, 16)의 미세 구조 설계 및 광학 성능 최적화 공정에 응용 가능한 기술입니다.
R&D 활용 포인트
차세대 광학 필름(프리즘 필름 등)이나 디스플레이용 나노 구조 설계 시, AI 기반 역설계 기법을 도입하여 원하는 빛의 굴절/분산 특성을 가진 미세 구조를 신속하게 설계하고 최적화하는 데 활용할 수 있습니다.
평가 입력
본문 76,401자 중 30,032자 발췌

초록

Metasurfaces are ultrathin optical elements composed of engineered subwavelength structures that enable precise control of light. Their inverse design─determining a geometry that yields a desired optical response─is challenging due to the complex, nonlinear relationship between structure and optical properties. This often requires expert tuning, is prone to local minima, and involves significant computational overhead. In this work, we address these challenges by integrating the generative capabilities of diffusion models into computational design workflows. Using an RCWA simulator, we generate training data consisting of metasurface geometries and their corresponding far-field scattering patterns. We then train a conditional diffusion model to predict meta-atom geometry and height from a target spatial power distribution at a specified wavelength, sampled from a continuous supported band. Once trained, the model can generate metasurfaces with low error, either directly using RCWA-guided posterior sampling or by serving as an initializer for traditional optimization methods. We demonstrate our approach on the design of a spatially uniform intensity splitter and a polarization beam splitter, both produced with low error in under 30 min. To support further research in data-driven metasurface design, we publicly release our code and data sets.

본문 76,401자

본문 펼치기
### INVERSE DESIGN OF DIFFRACTIVE METASURFACES USING DIFFUSION MODELS Liav Hen <sup>1, *</sup>, Erez Yosef <sup>1</sup>, Dan Raviv <sup>1</sup>, Raja Giryes <sup>1</sup>, and Jacob Scheuer <sup>1,2,</sup> <sup>_†_</sup> 1School of Electrical and Computer Engineering, Tel-Aviv University, Israel 2The Center for Nanosciences and Nanotechnology, Tel-Aviv University, Israel *email: `liavhen@gmail.com` _†_ email: `kobys@tauex.tau.ac.il` ABSTRACT Metasurfaces are ultra-thin optical elements composed of engineered sub-wavelength structures that enable precise control of light. Their inverse design - determining a geometry that yields a desired optical response - is challenging due to the complex, nonlinear relationship between structure and optical properties. This often requires expert tuning, is prone to local minima, and involves significant computational overhead. In this work, we address these challenges by integrating the generative capabilities of diffusion models into computational design workflows. Using an RCWA simulator, we generate training data consisting of metasurface geometries and their corresponding far-field scattering patterns. We then train a conditional diffusion model to predict meta-atom geometry and height from a target spatial power distribution at a specified wavelength, sampled from a continuous supported band. Once trained, the model can generate metasurfaces with low error, either directly using RCWA-guided posterior sampling or by serving as an initializer for traditional optimization methods. We demonstrate our approach on the design of a spatially uniform intensity splitter and a polarization beam splitter, both produced with low error in under 30 minutes. To support further research in data-driven metasurface design, we publicly release our code and datasets. <sup>1</sup> _Keywords_ metasurfaces, diffusion models, inverse design, nanophotonics 1 Introduction Diffractive metasurfaces are optical devices composed of sub-wavelength meta-atoms that enable precise control over light propagation. Designing these structures to achieve specific optical properties remains a significant challenge due to the complex and non-linear relationship between the geometry and the optical response. Early research on metasurface inverse design focused on classical optimization techniques. In particular, gradient-based methods relying on numerical light-scattering simulations, such as Rigorous Coupled-Wave Analysis (RCWA) [1], were extensively explored [2, 3, 4]. However, these approaches often converge to local minima. To address this, alternative strategies, such as topology optimization, evolutionary algorithms, and particle swarm optimization, have been proposed [5, 6]. These are frequently combined with global phase initialization schemes, such as the Iterative Fourier Transform Algorithm (IFTA), to improve convergence [7, 8, 9]. While effective, these methods are computationally intensive, often requiring hours to design a single metasurface, and depend on expert-tuned regularization strategies. With the rise of deep learning, neural networks (NNs) have also been explored for metasurface design [3, 10, 11, 12, 13]. However, these models often underperform analytical methods due to their reliance on large, task-specific datasets which are rarely available in practice. It is important to note that most prior work on metasurface inverse design using NNs has focused on the spectral response as the primary design objective. In contrast, controlling the far-field spatial power distribution, namely the 1 `[https://github.com/liavhen/metagen](https://github.com/liavhen/metagen)` (a) A meta-atom represented as a binary image. (b) A schematic of a meta-atom. Incident direction ###### Far-field plane Metasurface Lightsource (c) A schematic of the scattering scenario: A periodic metasurface, excited by a monochromatic plane-wave. directionality and intensity of scattered Bragg orders, has received limited attention, despite its importance in beam splitting, shaping, and multiplexing applications. This paper addresses the inverse design of metasurfaces that produce a desired spatial far-field power distribution. We consider periodic, binary-thickness dielectric metasurfaces under normal incidence. Since the wavelength and geometric features are of comparable scale, the periodicity induces scattering into discrete diffraction orders. Our goal is to recover a meta-atom configuration that yields a prescribed angular power distribution at specified wavelengths. To this end, we have developed a generative framework based on diffusion models [14, 15] - a class of neural generative algorithms increasingly used to generate high-fidelity samples and solve inverse problems. We train the model on a large dataset of simulated structure–response pairs, constructed using a novel, scalable data generation pipeline. It should be emphasized that in contrast to the more common tasks tackled by NNs, such as image classification, generation or text prediction, a large training dataset does not exist and must be constructed ad hoc. Our data generation method addresses the lack of high-quality task-specific data and can be adapted to various nanophotonic design problems. Once trained, diffusion models can be sampled to generate solutions that match the learned distribution. We explore two operational modes: - RCWA guidance (posterior sampling): full-wave simulations (e.g., RCWA) are integrated into the diffusion generative process, trading off accuracy vs. runtime. - Integrative mode: The diffusion model provides initial guesses for downstream optimization routines. It should be noted that the training process (especially the dataset generation method - see Section 2) creates a distribution of topology and diffraction pattern pairs. It can be expected that some of the metasurface topologies (and, hence, the attainable diffraction patterns) are not well-represented within this distribution. Consequently, the design of metasurfaces targeting such diffraction patterns is a challenging task for our diffusion model. We tackle this gap through incorporation of careful considerations to the data generation process and state-of-the-art methods for querying diffusion models in light or desired measurements consistency. We demonstrate the effectiveness of our approach on several challenging design tasks, particularly targeting patterns which are not well-represented within the distribution of the learned dataset. These include the generation of SiO2 metasurfaces exhibiting an X-shaped scattering pattern across multiple wavelengths, the design of a silicon dualpolarization uniform beam splitter, and a polarization splitter refined via gradient descent, all within minutes. This paper is organized as follows: Section 2 details the data generation process, the inverse design process, and evaluation methodology. Section 3 presents experimental results and demonstrates the usage modes of our diffusion model for metasurface inverse design. 2 2 Method In this section, we present our proposed method for the inverse design of diffractive metasurfaces using diffusion models. We begin by introducing a novel data generation procedure. We then describe the training of our diffusion model, which we designate as _MetaGen_, and how it is used to design new metasurfaces. Finally, we outline our evaluation methodology, which includes comparisons with alternative generative frameworks and the design of metasurfaces corresponding to target scattering patterns. Additional details are provided in Sections B-D of the appendix. 2.1 Data Generation <u>Dataset</u> <u>B2</u> <u>C2</u> Polarizations TE Only TE & TM Material SiO2 ( _n ≈_ 1 _._ 45) Si ( _n ≈_ 3 _._ 6) Wavelengths _λ_ [ _µm_ ] _{_ 0 _._ 8 _,_ 0 _._ 85 _,_ 0 _._ 9 _,_ 0 _._ 95 _,_ 1 _._ 0 _}_ _{_ 1 _._ 4 _,_ 1 _._ 45 _,_ 1 _._ 5 _,_ 1 _._ 55 _,_ 1 _._ 6 _}_ Heights _h_ [ _µm_ ] 0 _._ 75 _−_ 1 _._ 25 0 _._ 1 _−_ 0 _._ 6 <u>Periodicity</u> _p_ [ _µm_ ] 2 _._ 86 4 _._ 6 Table 1: Physical settings of the main datasets. The B2 and C2 datasets were generated using our method and are used for training. Both are designed to ensure the presence of scattering patterns with at least 5 _×_ 5 propagating Bragg orders. Additional datasets and configurations are described in the appendix. The datasets consist of pairs of binary images that represent the topology of the metasurface and the transmitted and reflected scattering efficiencies _T_ and _R_, which are represented as matrices. Each pixel in these matrices contains the total power projected into one of the Bragg diffraction orders, where the central pixel corresponds to the zero-order diffraction lobe. Binary Structures Randomized Generation. To construct a diverse dataset of binary metasurface structures, we developed a custom generation pipeline that produces meta-atoms from randomized noise. The process begins by applying a low-pass spatial filter to realizations of uniformly sampled noise _∼_ U(0 _,_ 1). While the random sampling promotes diversity and free-form variation, the low-pass filter enforces a minimum feature size, ensuring compatibility with standard fabrication constraints. We perform the spatial filtering in the frequency domain using a 2D Fourier transform, which naturally enforces periodic boundary conditions in the generated meta-atoms. The filtered noise is then binarized, where each resulting binary pattern encodes a metasurface design: `1` denotes dielectric material, and `0` denotes air. To further diversify the dataset, we generate additional parameterized shapes, such as rectangles, ellipsoids and grating profiles - structures which may not naturally arise from free-form generation. For implementation details, see Section B of the appendix. Figure 2: Binary Structures from our Proposed Dataset . Different gray levels represent different thicknesses _h_ . By design, the structures are naturally periodic and continuous. Simulations. The light scattering patterns from the metasurfaces are computed using Rigorous Coupled-Wave Analysis (RCWA) [1], a numerical method for solving Maxwell’s equations in periodic structures by representing electromagnetic fields as truncated Fourier series. We use a GPU-accelerated, differentiable implementation of RCWA [2]. In each dataset, the metasurface thickness and operating wavelength vary uniformly across samples, while other physical parameters, such as the periodicity and material composition, are fixed. All simulations are carried out under normal incidence, though this assumption can be relaxed by generating datasets corresponding to oblique illumination conditions. 3 Datasets. To demonstrate our method under varying physical conditions, we constructed two main datasets, B2 and C2. Both datasets are designed to exhibit at least 5x5 propagating orders in air, but differ in the material, the supported wavelengths and the periodicity. Additional datasets with a different number of excited orders are detailed in Section B in the appendix. Both datasets consist of 3.6M (720K data points per operating wavelength), with the resolution of the binary images set to 64x64 pixels. 2.2 Inverse Model ? ? ###### Optional Traditional Optimization Methods ###### Initial Noise #### Conditions Head ## MetaGen Optional ###### RCWA Guidance ?"!, ℎ <sup>%</sup> Figure 3: _MetaGen_ : Diffusion-based inverse design. We train a diffusion model to reconstruct the geometry of a metasurface, specifically, the binary pattern _x_ and height _h_, starting from pure noise and conditioned on the target far-field scattering pattern and operating wavelength. The model’s output is denoted by ˆ _x_ 0 _,_ _h_ <sup>ˆ</sup>, following the conventional notation used in diffusion models. We train a diffusion model, _MetaGen_, to serve as an inverse predictor, reconstructing the geometrical attributes of a metasurface - specifically, its binary structure and height - given a target spatial power distribution and an operating wavelength _λ_ . The model outputs a 2D binary image representing the meta-atom layout, along with a corresponding scalar height value. Training is performed separately on the B2 and C2 datasets (see Table 1) using a standard diffusion modeling approach. Samples from the training set are corrupted with additive Gaussian noise, and the model is trained to denoise them while conditioned on the corresponding target scattering patterns and wavelengths. Through this process, the model learns the statistical relationship between metasurface geometry and its optical response. The training procedure follows the Elucidated Diffusion Models (EDM) framework [16], with further details provided in Sections A and D of the appendix. Sampling. Once trained, _MetaGen_ can be sampled through an iterative process to generate valid metasurface designs starting from pure noise. See Figure 3 for a schematic overview. To further enforce consistency with physical measurements, we employ _Diffusion_ _Posterior_ _Sampling_ (DPS) [17]. This technique integrates gradients from a forward simulator (RCWA in our case) into the diffusion trajectory, guiding the generation toward samples that are both physically plausible and consistent with the target scattering pattern. In our context, we refer to this approach as _RCWA guidance_ . This technique requires backpropagating through the simulator, which increases computational cost in exchange for improved accuracy. In practice, we apply RCWA guidance either at all diffusion steps or only at selected ones, depending on the complexity of the target design task. We note that the model can also be sampled directly without RCWA guidance, enabling near-instant generation. While this unguided approach performs well on target patterns drawn from the training distribution, we observe reduced effectiveness when generalizing to idealized or out-of-distribution target diffraction patterns. 2.3 Evaluation We evaluate model performance by comparing the target scattering patterns _T, R_, which condition the generation process along with the wavelength _λ_, to the actual scattering patterns _T,_ <sup>ˆ</sup> _R_ <sup>ˆ</sup> obtained from simulating the predicted meta-atom structures using the RCWA simulator. Given its relevance in many applications, our evaluation primarily focuses on the relative error in transmittance ( _T_ ). When assessing performance across multiple components (e.g., two polarizations), the relative error is computed for each component separately and then averaged. 4 Metrics. We propose using relative error as the metric, as it intuitively represents the relative amount of power that is either missing or incorrectly distributed between the diffraction lobes compared to the desired scattering pattern. The error metric is defined as follows for x _∈{T, R}_ : e( x _,_ ˆ x ) = <sup>_<u>∥</u>_</sup> <sup><u>x</u></sup> <sup>_<u>−</u>_</sup> <sup>ˆ</sup> <sup><u>x</u></sup> <sup>_<u>∥</u>_</sup> <sup><u>1</u></sup> _∥_ x _∥_ 1 (1) Evaluation Strategy. Since _MetaGen_ relies on the data distribution used during training, it is important to evaluate its performance not only on the test set, drawn from the same distribution as the train set, but also on manually constructed scattering patterns representative of real-world applications. We generally refer to such scattering patterns as _target_ _patterns_ . In Section 3, we present three such application-driven designs obtained using our approach. To further assess the effectiveness of diffusion models in capturing the training distribution, and also generalizing to target patterns beyond the observed distribution, we compare _MetaGen_ with other generative baselines. Specifically, we evaluate a modified Wasserstein Generative Adversarial Network (GAN) with Gradient Penalty (WGAN-GP) [18, 19, 20, 21], adapted for conditional sampling, and a Conditional Variational Autoencoder (CVAE) [22, 23] designed for similar inverse tasks. A detailed comparison is provided in Section C of the appendix. Visualization. Scattering patterns are shown as heat maps, with each Bragg order ( _mx, my_ ) color-coded by intensity. Values above 0.01 are reported with two decimal places. 3 Results This section presents results demonstrating the effectiveness of _MetaGen_ in solving real-world optical design tasks. First, we present its broad spectral support by generating metasurfaces that produce scattering patterns that are beyond the learned distribution across multiple wavelengths. More specifically, we show the ability of _MetaGen_ to design a metasurface exhibiting X-shaped scattering patterns. Next, we showcase the design of a spatially uniform scattering pattern, achieving performance comparable to prior works but with significantly reduced runtime. Finally, we demonstrate the use of _MetaGen_ to generate candidate metasurface designs that serve as initializations for auxiliary optimization procedures, thus reducing significantly the design time. As a concrete example we demonstrate fast design of a metasurface based polarization beam splitter. As illustrated in Figure 3, the sampling process begins from a random noise realization, which gradually transforms into a fresh sample valid under the training distribution, i.e., a metasurface. Thus, the generation process is essentially stochastic, and multiple candidate metasurfaces may be designed by initializing the sampling process with different noises. We leverage this variability, together with the parallelism capabilities of modern GPU-accelerated frameworks, to improve design outcomes with only marginal runtime overhead. For each design task presented in this study, we generate _k_ candidate samples in parallel and select the one that yields the lowest scattering error. 3.1 Wide Spectral Support We use _MetaGen_ to generate a non-trivial (out of the learned distribution) X-shaped scattering pattern across a range of wavelengths: _{_ 0 _._ 825 _,_ 0 _._ 875 _,_ 0 _._ 925 _,_ 0 _._ 975 _}_ [ _µ_ m]. Note that none of these wavelengths is present in the training set, demonstrating the model’s broad spectral support and its ability to interpolate between trained wavelengths. This design is conducted under the B2 configuration, i.e., SiO2 based metasurface with TE-polarized incident light only (see Table 1). Figure 4 shows the resulting metasurface designs (for each wavelength) and the actual scattering patterns they produce. 3.2 Spatially Uniform Intensity Beam Splitter In this section, we demonstrate the design of a beam splitter, i.e., a metasurface that uniformly distributes the intensity of the incident plane wave across a 5 _×_ 5 Bragg diffraction orders. Prior studies [7, 4, 8, 9] have addressed this task using optimization procedures that typically require several hours. Our goal is to significantly accelerate the design process while maintaining comparable performance. In contrast with prior works, we choose to showcase a design that is simultaneously constrained to exhibit a uniform scattering pattern in both polarizations. This represents an extension of the original challenge, which typically considers only a single polarization mode. Following these works, we evaluate our design using the Uniformity Error (UE) metric: 5 Figure 4: Wide spectral support. Our model is trained on multiple discrete wavelengths, enabling it to generalize to unseen wavelengths through interpolation. In this example, we design metasurfaces that produce an X-shaped scattering pattern across several operating wavelengths outside the training distribution. eUE( _T_ <sup>ˆ</sup> ) = <sup>_<u>T</u>_</sup> <sup><u>max</u></sup> <sup>_<u>−</u>_</sup> <sup>_<u>T</u>_</sup> <sup><u>min</u></sup> _T_ max + _T_ min _,_ where _T_ max = max _Ti,_ _T_ min = min _i_ _i_ _Ti,_ (2) _i_ where _{Ti}_ denotes the transmitted power in each diffraction order. Figure 5: Uniform Beam-Splitting Metasurface. Our approach integrates information from RCWA measurements directly into the diffusion sampling process. This allows us to overcome local-minima sensitivity without expert tuning and to achieve high-quality results within minutes. In this example, we present a uniform, dual-polarization 5 _×_ 5 beam-splitting silicon metasurface designed for normally incident light at wavelength _λ_ = 1 _._ 5 _µ_ m. The results are summarized in Table 2. Our model, trained under the C2 configuration, achieves comparable performance to those of previous works while simultaneously constraining both polarizations. The corresponding design is shown in Figure 5. Notably, our solution was generated in just 28 minutes using a best-of- _k_ = 30 sampling strategy, in contrast to the hours-long runtimes reported in previous works. To achieve this, we use 200 diffusion steps and apply RCWA-based guidance during the final 100 steps. <u>Method</u> <u>Hao et al. [7]</u> <u>Li et al. [8]</u> <u>Yan et al. [9]</u> _<u>MetaGen</u>_ <u>(Ours)</u> UE (Eq. 2) 0.1740 0.1264 0.1176 0.1280 <u>Runtime</u> <u>3.5 hours</u> <sup>1</sup> <u>2.6 hours</u> <u>18.9 hours</u> <u>28 minutes</u> Table 2: Inverse design of a 5 _×_ 5 uniform beam splitter. Compared to prior works, our method achieves comparable UE while completing in a fraction of the runtime. <sup>2</sup> 3.3 Polarization Splitter: Integrating Traditional Optimization Recent studies on the inverse design of diffractive metasurfaces commonly employ conventional optimization techniques, initialized randomly or using phase-response methods such as IFTA. Given the vast design space and susceptibility to 1The runtime was estimated based on the reported duration of 90 seconds per generation and visual analysis of figures showing approximately 140 generations. 2Runtime comparisons may be affected by differences in hardware. See Section F of the appendix for full hardware specifications. 6 Meta-atom <u>h = 0.475 [um]</u> 0.6 0.5 0.4 0.3 0.2 0.1 0.0 0.6 0.5 0.4 0.3 0.2 0.1 0.0 Metasurface (4x4) <u>p = 4.600 [um]</u> TE Transmission <u>(total = 0.594)</u> .02 .02 .05 .01 .46 .02 .00 -3 -2 -1 0 1 2 3 .01 .03 .46 .01 .05 .02 .00 -3 -2 -1 0 1 2 3 TM Transmission <u>(total = 0.577)</u> >= 0.7 0.4 0.2 0.1 0.05 0.01 < 0.001 Figure 6: Polarization splitter design using _MetaGen_ . Candidate patterns generated by _MetaGen_ were used as initializations for gradient descent optimization, consistently outperforming randomly initialized baselines. Here, 800 optimization steps were performed with a decaying learning rate, and the objective function was the Mean Squared Error (MSE). Each pixel contains the fractional amount of transmitted power. local minima, population-based algorithms are frequently used to improve convergence [7, 9]. While effective, these approaches are typically computationally intensive and require expert-tuned initialization through IFTA. We propose leveraging _MetaGen_ as an expert-free, data-driven initializer within such optimization pipelines. By providing good initial guesses, _MetaGen_ mitigates local-minima convergence issues and significantly accelerates the overall design process. As a reference method, we adopt Gradient Descent (GD) with smoothing and gradual projection steps, as outlined in [4, 2]. The smoothing step involves applying a spatial low-pass filter to suppress high-frequency features, while the gradual projection step progressively enforces binarization. Further details on the GD-based implementation for metasurfaces inverse design are provided in Section E of the appendix. In this example, we target the design of a _polarization beam splitter_, a device that directs TE- and TM-polarized incident waves into different diffraction orders. We begin by querying _MetaGen_, which was trained on dual-polarized Silicon dataset C2 (see Table 1), to generate patterns that aim to split both polarizations evenly between the (1 _,_ 0) and ( _−_ 1 _,_ 0) diffraction orders. These patterns are then used as an initialization for GD, which is applied to refine the design and enhance the scattering response. Figure 6 presents an example of a polarization splitter generated using this hybrid approach. Our results show that initializing auxiliary optimization methods such as GD with outputs from _MetaGen_ consistently improves final performance, as illustrated in Figure 7. Moreover, the reduced variance of model-initialized optimization trajectories could also benefit population-based methods, such as genetic algorithms and particle swarm optimization. 2.5 2.0 1.5 1.0 0.5 <u>Polarization Splitter - Relative Error vs. Optimization Steps</u> MetaGen Initialization Random Initialization 0 100 200 300 400 500 600 700 800 Step Figure 7: Optimization performance for polarization splitting. The blue and orange curves show the average relative error across 30 randomly and model-initialized runs, respectively. Shaded regions denote standard deviation. In the hybrid approach, sampling from _MetaGen_ is performed directly, i.e., without applying RCWA guidance, thus completes almost instantly. The subsequent optimization process requires approximately 8 minutes on the hardware used in this study. Overall, high-quality metasurface designs can be generated within a matter of minutes. Further details regarding the computational setup are provided in Section F of the appendix. 3.4 Additional Results and Baseline Comparisons For quantitative evaluation, we compare our diffusion model with other generative approaches, which we also train on data sets constructed using our data generation method. We provide WGAN-GP and C-VAE baselines on additional 7 datasets (C1–C3) of increasing structural complexity. As detailed in Supplementary Section 3, _MetaGen_ consistently achieves lower relative error on both test and target patterns (Table S2, Fig. S6), demonstrating superior accuracy and generalization beyond the training distribution. Visual results further support its advantage in modeling complex structure–response mappings (Figs. S4–S7). Notably, these findings align with prior works, in which diffusion models were consistently proven to outperform GANs also in other applications [24, 25]. 4 Conclusion In this work, we introduce a diffusion model-based framework for the inverse design of metasurfaces conditioned on specified spatial scattering patterns across multiple incident wavelengths. Our method can operate in a standalone manner to generate metasurfaces with low error. Additionally, accuracy can be improved at the cost of increased computation time by integrating a RCWA simulator into the sampling process, enabling posterior refinement. Furthermore, recognizing the limitations of traditional optimization methods, which often require expert-tuned initialization or incur long runtimes, we demonstrate how our model can serve as a fast, expert-free initializer to accelerate and improve the performance of such methods. Our diffusion model is trained on paired data consisting of metasurface structures and their corresponding scattering patterns. To support this approach, we develop a novel, scalable data generation pipeline capable of producing training data at any scale, for a wide range of physical settings and tasks. We construct two primary datasets encompassing diverse physical conditions to enable systematic evaluation of inverse design methods. By designing applicable optical devices, such as a uniform beam splitter and a polarization beam splitter, we show that our diffusion model achieves performance comparable to state-of-the-art approaches that typically require hours of optimization, while significantly reducing computational overhead. These results highlight the potential of diffusion models for scalable and efficient metasurface design, opening avenues for further research in data-driven nanophotonics. Acknowledgements We thank Doron Klepach and Guy Ben-Dov from FVMat and Shady Abu-Hussein for fruitful discussions. References [1] M. G. Moharam, Eric B. Grann, Drew A. Pommet, and T. K. Gaylord. Formulation for stable and efficient implementation of the rigorous coupled-wave analysis of binary gratings. _J. Opt. Soc. Am. A_, 12(5):1068–1076, May 1995. [2] Changhyun Kim and Byoungho Lee. Torcwa: Gpu-accelerated fourier modal method and gradient-based optimization for metasurface design. _Computer Physics Communications_, 282:108552, 2023. [3] John Peurifoy, Yichen Shen, Li Jing, Yi Yang, Fidel Cano-Renteria, Brendan G. DeLacy, John D. Joannopoulos, Max Tegmark, and Marin Soljaˇci´c. Nanophotonic particle simulation and inverse design using artificial neural networks. _Science Advances_, 4(6):eaar4206, 2018. [4] Dong Cheon Kim, Andreas Hermerschmidt, Pavel Dyachenko, and Toralf Scharf. Inverse design and demonstration of high-performance wide-angle diffractive optical elements. _Opt. Express_, 28(15):22321–22333, Jul 2020. [5] Rasmus E. Christiansen and Ole Sigmund. Inverse design in photonics by topology optimization: tutorial. _J. Opt._ _Soc. Am. B_, 38(2):496–509, Feb 2021. [6] Zhaoyi Li, Raphaël Pestourie, Zin Lin, Steven G. Johnson, and Federico Capasso. Empowering metasurfaces with inverse design: Principles and applications. _ACS Photonics_, 9(7):2178–2192, 2022. [7] Huang Hao, Zhai Tingting, Song Qiang, and Yin Xiaodong. Wide angle 2d beam splitter design based on vector diffraction theory. _Optics Communications_, 434:28–35, 2019. [8] Jinzhe Li, Fei Zhang, Mingbo Pu, Yinghui Guo, Xiong Li, Xiaoliang Ma, Changtao Wang, and Xiangang Luo. Quasi-continuous metasurface beam splitters enabled by vector iterative fourier transform algorithm. _Materials_, 14(4), 2021. [9] Yu Yan, Zhentao Fan, Guofang Sun, and Kehan Tian. Diffractive optical element design based on vector diffraction theory and improved PSO-SA algorithm. _Optical Engineering_, 62(2):025103, 2023. [10] Ibrahim Tanriover, Doksoo Lee, Wei Chen, and Koray Aydin. Deep generative modeling and inverse design of manufacturable free-form dielectric metasurfaces. _ACS Photonics_, 10(4):875–883, 2023. [11] Zezhou Zhang, Chuanchuan Yang, Yifeng Qin, Hao Feng, Jiqiang Feng, and Hongbin Li. Diffusion probabilistic model based accurate and high-degree-of-freedom metasurface inverse design. _Nanophotonics_, 12(20):3871–3881, October 2023. 8 [12] Chen Niu, Mario Phaneuf, and Puyan Mojabi. A diffusion model for multi-layered metasurface unit cell synthesis. _IEEE Open Journal of Antennas and Propagation_, 4:654–666, 2023. [13] Zezhou Zhang, Chuanchuan Yang, Yifeng Qin, Zhihai Zheng, Jiqiang Feng, and Hongbin Li. Addressing high-performance data sparsity in metasurface inverse design using multi-objective optimization and diffusion probabilistic models. _Opt. Express_, 32(23):40869–40885, Nov 2024. [14] Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations, 2021. [15] Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. _arXiv_ _preprint_ _arXiv:2010.02502_, 2020. [16] Tero Karras, Miika Aittala, Timo Aila, and Samuli Laine. Elucidating the design space of diffusion-based generative models. In _Proc. NeurIPS_, 2022. [17] Hyungjin Chung, Jeongsol Kim, Michael T Mccann, Marc L Klasky, and Jong Chul Ye. Diffusion posterior sampling for general noisy inverse problems. _arXiv preprint arXiv:2209.14687_, 2022. [18] Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein generative adversarial networks. In _Interna-_ _tional conference on machine learning_, pages 214–223. PMLR, 2017. [19] Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. _Advances in neural information processing systems_, 30, 2017. [20] Mehdi Mirza. Conditional generative adversarial nets. _arXiv preprint arXiv:1411.1784_, 2014. [21] Gilad Cohen and Raja Giryes. _Generative Adversarial Networks_, pages 375–400. Springer International Publishing, 2023. [22] Kihyuk Sohn, Honglak Lee, and Xinchen Yan. Learning structured output representation using deep conditional generative models. _Advances in neural information processing systems_, 28, 2015. [23] Dor Bank, Noam Koenigstein, and Raja Giryes. _Autoencoders_, pages 353–374. Springer International Publishing, 2023. [24] Prafulla Dhariwal and Alex Nichol. Diffusion models beat gans on image synthesis. _ArXiv_, abs/2105.05233, 2021. [25] François Mazé and Faez Ahmed. Diffusion models beat gans on topology optimization. In _Proceedings of the_ _AAAI conference on artificial intelligence_, volume 37, pages 9108–9116, 2023. [26] Brian DO Anderson. Reverse-time diffusion equation models. _Stochastic_ _Processes_ _and_ _their_ _Applications_, 12(3):313–326, 1982. [27] Bradley Efron. Tweedie’s formula and selection bias. _Journal_ _of_ _the_ _American_ _Statistical_ _Association_, 106(496):1602–1614, 2011. [28] Aapo Hyvärinen and Peter Dayan. Estimation of non-normalized statistical models by score matching. _Journal of_ _Machine Learning Research_, 6(4), 2005. [29] Pascal Vincent. A connection between score matching and denoising autoencoders. _Neural_ _computation_, 23(7):1661–1674, 2011. [30] Jonathan Ho and Tim Salimans. Classifier-free diffusion guidance. _arXiv preprint arXiv:2207.12598_, 2022. [31] Erwin G. Loewen and Evgeny Popov. Diffraction gratings and applications. In _Diffraction_ _Gratings_ _and_ _Applications_, 2018. [32] Sensong An, Clayton Fowler, Bowen Zheng, Mikhail Y. Shalaginov, Hong Tang, Hang Li, Li Zhou, Jun Ding, Anu radha Murthy Agarwal, Clara Rivero-Baleine, Kathleen A. Richardson, Tian Gu, Juejun Hu, and Hualiang Zhang. A deep learning approach for objective-driven all-dielectric metasurface design. _ACS Photonics_, 6(12):3196–3207, 2019. [33] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation, 2015. [34] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In _International_ _Conference_ _on_ _Learning Representations_, 2019. [35] Aaron Defazio, Xingyu Yang, Harsh Mehta, Konstantin Mishchenko, Ahmed Khaled, and Ashok Cutkosky. The road less scheduled, 2024. [36] Diederik P Kingma. Adam: A method for stochastic optimization. _arXiv preprint arXiv:1412.6980_, 2014. 9 Appendix A Background In this section, we briefly introduce the main concepts that form the foundation of this study. A.1 Diffusion Models Diffusion models are a class of generative models that synthesize data by reversing a gradual noising process. Both the noising and denoising processes, also termed the forward and reverse processes, can be modeled using stochastic differential equations (SDEs) [14]. The forward process adds noise to clean data, while the generative task is formulated as solving the corresponding reverse-time SDE to recover structured samples from noise. Let _x_ ( _t_ ) _∈_ R <sup>_d_</sup> denote a sample evolving under a forward SDE of the form: d _x_ = _f_ ( _x, t_ ) d _t_ + _g_ ( _t_ ) d _w,_ (3) where _f_ ( _x, t_ ) is a drift term, _g_ ( _t_ ) is a time-dependent noise scale, and _w_ is standard Brownian motion. This forward diffusion gradually corrupts the data, yielding a tractable prior distribution, typically standard Gaussian, at the final time _t_ = _T_ . The reverse-time SDE, used for sampling, is given by [26]: d _x_ = - _f_ ( _x, t_ ) _−_ _g_ ( _t_ ) <sup>2</sup> _∇x_ log _pt_ ( _x_ )� d _t_ + _g_ ( _t_ ) d ¯ _w,_ (4) where _∇x_ log _pt_ ( _x_ ) is the _score function_, the gradient of the log-density of the noised data at time _t_, and _w_ ¯ denotes reverse-time Brownian motion. Alternatively, one can sample from the _probability flow ODE_, which shares the same marginals but evolves deterministically [14]: d _x_ = _f_ ( _x, t_ ) d _t −_ 2 <sup><u>1</u></sup> <sup>_g_</sup> <sup>(</sup> <sup>_t_</sup> <sup>)2</sup> <sup>_∇x_</sup> <sup>log</sup> <sup>_pt_</sup> <sup>(</sup> <sup>_x_</sup> <sup>) d</sup> <sup>_t._</sup> (5) To generate samples from the data distribution _p_ data( _x_ ), one must solve either the reverse SDE or the probability flow ODE (Eq. 4 and 5). However, both require access to the score function, which is intractable in practice, but can be computed using _Tweedie’s Formula_ [27]: E[ _x_ 0 _|xt_ ] = _xt_ + _σ_ <sup>2</sup> ( _t_ ) _∇x_ log _pt_ ( _x_ ) (6) where _xt, x_ 0 abbreviate _x_ ( _t_ ) _, x_ (0) and _σ_ ( _t_ ) is the noise level at time _t_, depending on the choice of _g_ ( _t_ ) in Eq. 3. Previous works [28, 29, 14, 16] have shown that E[ _x_ 0 _|xt_ ] can be approximated using a neural network _Dθ_ ( _xt, t_ ) minimizing the expected _L_ 2 denoising loss. Namely, if for every time _t_, _Dθ_ ( _xt, t_ ) minimizes E _x_ 0 _∼p_ data _,xt∼p_ ( _xt|x_ 0) where _p_ ( _xt|x_ 0) follows the forward SDE (Eq. 3), then: - _∥Dθ_ ( _xt, t_ ) _−_ _x_ 0 _∥_ <sup>2</sup> 2, <u>1</u> _sθ_ ( _xt, t_ ) := _σ_ <sup>2</sup> ( _t_ ) <sup>(</sup> <sup>_Dθ_</sup> <sup>(</sup> <sup>_xt, t_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_xt_</sup> <sup>)</sup> <sup>_≈∇x_</sup> <sup>log</sup> <sup>_pt_</sup> <sup>(</sup> <sup>_x_</sup> <sup>)</sup> (7) With the approximated score function from Eq. 7, new samples can be generated by discretizing and solving the reverse-time SDE or the probability flow ODE (Eq. 4 and 5) using numerical solvers. In this work, we follow the elucidated formulation of [16]. A.2 Inverse Problems Inverse problems are typically formulated as: _y_ = _A_ ( _x_ ) + _η,_ (8) where _y_ is a measurement of the unknown signal _x_, obtained via a forward operator _A_, and _η_ represents measurement noise. Recovering _x_ from _y_ is often difficult because either dim( _y_ ) _≪_ dim( _x_ ) or _A_ is non-injective, making the problem ill-posed. In this work, we cast the metasurface inverse design task as a noiseless ( _η_ _≡_ 0) inverse problem, where _x_ denotes the metasurface geometry and height, _y_ is the diffraction pattern, and _A_ is the measurement operator implemented using a RCWA simulation [1, 2]. For generality, we use conventional inverse problem notation throughout this section. 10 A.3 Solving Inverse Problems with Diffusion Models When the operator _A_ is non-linear or non-convex, solving the optimization problem arg min _x_ <sup>_∥y −A_</sup> <sup>(</sup> <sup>_x_</sup> <sup>)</sup> <sup>_∥_</sup> <sup>2</sup> (9) can be challenging in practice. Alternatively, especially due to the possible multiplicity of solutions, one can take a Bayesian approach and solve: _p_ ( _x | y_ ) = arg max _x_ _x_ log _p_ ( _x_ ) + log _p_ ( _y_ _| x_ ) _,_ (10) _x_ arg max _p_ ( _x_ ) _p_ ( _y_ _| x_ ) = arg max _x_ _x_ where the second equality follows from Bayes’ theorem and the last from taking the logarithm. This splits the objective into a prior term log _p_ ( _x_ ) and a likelihood term log _p_ ( _y_ _| x_ ). To solve such problems without direct access to the densities _p_ ( _x_ ) _, p_ ( _y|x_ ), one can leverage diffusion models by modifying the score-based sampling equations (Eq. 4 or Eq. 5), replacing the unconditional score with a conditional one, as follows: _∇x_ log _pt_ ( _x | y_ ) = _∇x_ log _pt_ ( _x_ ) + _∇x_ log _pt_ ( _y_ _| x_ ) _≈_ _sθ_ ( _xt, t_ ) + _∇x_ log _pt_ ( _y_ _| x_ ) _._ (11) The prior term is approximated by the trained denoiser _ϵθ_, but the likelihood term remains intractable in the general case and requires further derivations. Two main strategies have been explored to address this. Conditional Diffusion Models. This approach involves training the denoising network _Dθ_ ( _xt, t, y_ ) to explicitly condition on _y_, with the aim of directly learning the conditional score, i.e., _∇x_ log _pt_ ( _x | y_ ) _≈_ _sθ_ ( _xt, t, y_ ). Notably, [30] show that by randomly hiding the conditional input ( _y_ = ∅), one can train a conditional diffusion model _Dθ_ ( _xt, t, y_ ) and an unconditional one _Dθ_ ( _xt, t,_ ∅) simultaneously. It is further shown that by extrapolating the conditional and unconditional scores with a scale _w_, an enhanced sampling can be achieved, termed _classifier-free_ _guidance_ .: _s_ <sup>(</sup> _θ_ <sup>_w_</sup> <sup>)</sup> ( _xt, t, y_ ) = _sθ_ ( _xt, t,_ ∅) + _w_ ( _sθ_ ( _xt, t, y_ ) _−_ _sθ_ ( _xt, t,_ ∅)) (12) Guided Diffusion Models. In contrast, guidance-based methods do not require conditional training. Instead, they approximate the likelihood gradient using a differentiable forward operator _A_, assuming access to it. In deep learning frameworks, the gradients of such operators are available due to the backpropagation algorithm. In the Gaussian case ( _η_ _∼N_ ), [17] suggest to approximate the likelihood gradient as: where _∇x_ log _pt_ ( _y_ _| x_ ) _≈_ _γt∇x ∥y −A_ (ˆ _x_ 0( _xt_ )) _∥_ <sup>2</sup> 2 <sup>_,_</sup> (13) _x_ ˆ0( _xt_ ) = _xt_ + _σ_ <sup>2</sup> ( _t_ ) _sθ_ ( _xt, t_ ) (= _Dθ_ ( _xt, t_ )) (14) is the Tweedie estimator as in Eq. 6, and _γt_ is a scaling factor. This technique, known as Diffusion Posterior Sampling (DPS), results in a guided conditional score: _∇x_ log _pt_ ( _x | y_ ) _≈_ _sθ_ ( _xt, t_ ) + _γt∇x ∥y −A_ (ˆ _x_ 0( _xt_ )) _∥_ <sup>2</sup> 2 <sup>_._</sup> (15) In this work, we combine both approaches. Following [30], we train an unconditional and a conditional diffusion model together on paired data samples ( _x, y_ ). While conditional sampling alone often produces good results, it was observed that combining it with posterior guidance improves both reconstruction accuracy and robustness, effectively enables the generation of samples beyond the training distribution. We note that although our inverse design problem for diffractive metasurfaces involves no measurement noise, we still adopt the DPS formulation for the Gaussian case, due to its observed positive impact on performance. B Data B.1 Data Generation Details The data generation process involves filtering uniform noise realizations in the frequency domain using a 2-D Fourier Transform, which ensures computational efficiency and cyclic-induced operations that produce binary images with 11 natural periodic continuity. Then, the smoothed noise is binarized to obtain a binary defined structure. <u>In the frequency</u> ~~�~~ domain, a circularly symmetrical low-pass filter is applied to the spatial frequency magnitude _r_ = _νx_ <sup>2</sup> + _νy_ <sup>2</sup>, where _νx, νy_ are the spatial frequencies of the image. The low-pass filter is characterized by _rc_, the cut-off radial frequency, and _β_, a smoothing factor which we set to 3, as defined in Eq. 16. To align with fabrication limitations, the cut-off frequency was set to _rc_ = _l_ min1 <sup>, with</sup> <sup>_l_</sup> <sup>min the minimal feature size allowed in the spatial domain.</sup> <sup>However, while performing spatial</sup> smoothing suppresses the existence of high-frequency features, projecting it either 0 or 1 re-introduces high-frequencies. We observe that iteratively smoothing and projection mitigates this phenomena, and promotes better enforcement of the minimal feature size criteria. _H_ ( _r_ ) = <sup><u>1</u></sup> 4 <sup>(1 + tanh (</sup> <sup>_β_</sup> <sup>(</sup> <sup>_r_</sup> <sup>+</sup> <sup>_rc_</sup> <sup>))) (1 + tanh (</sup> <sup>_−β_</sup> <sup>(</sup> <sup>_r −_</sup> <sup>_rc_</sup> <sup>)))</sup> (16) Choosing the generation parameters. We focus on metasurfaces composed of square-shaped unit cells. For such structures, under normal incidence, a diffraction order ( _mx, my_ ) can propagate in air only if it satisfies the condition _m_ <sup>2</sup> _x_ <sup>+</sup> <sup>_m_</sup> <sup>2</sup> _y_ <sup>_≤_</sup> - _λp_ �2 [31]. As a result, each dataset is characterized by a specific number of propagating diffraction orders. _m_ <sup>2</sup> _x_ <sup>+</sup> <sup>_m_</sup> <sup>2</sup> _y_ <sup>_≤_</sup> - _λp_ �2 [31]. As a result, each dataset is characterized by a specific number of propagating diffraction orders. We define the height and minimal feature size of the meta-atoms given the choice of material and fabrication constraints. The operating wavelengths are selected to encourage high transmission efficiency. Based on these wavelengths, the periodicity _p_ is then set to ensure that the resulting metasurfaces support the desired number of propagating orders. <sup>2</sup> _x_ <sup>+</sup> <sup>_m_</sup> <sup>2</sup> _y_ <sup>2</sup> _y_ <sup>_≤_</sup> - _<u>p</u>_ _λ_ Introducing structural biases. During this study, we observe that, under absolute structural freedom, meta-atoms frequently exhibit somewhat similar scattering patterns. In practice, many interesting applications, such as prisms, beam-splitters and more, require some inherent structural order such as symmetry and directionality. Addressing this observation, we introduce additional steps for biasing the random generation procedure towards such structural properties. First, after generating a random noise realization _n_, we randomly draw _γ_ _∈{_ 0 _,_ 0 _._ 1 _,_ 0 _._ 2 _,_ 0 _._ 3 _,_ 0 _._ 4 _,_ 0 _._ 5 _}_, and modify the noise to be _n_ ˆ = _γn_ + (1 _−_ _γ_ )˜ _n_, where _n_ ˜ is a horizontally flipped version of _n_ . This step introduces pseudo-symmetry, with _γ_ = 0 _._ 5 enforcing actual horizontal symmetry of the meta-atom and _γ_ = 0 corresponding to an absolute free-form structure. We then rotate the image in a random angle to encourage the existence of symmetry in all directions. Next, we randomize _l_ min, allowing for structures with larger characteristic features. Then, within the application of the low-pass filter, we randomly shrink one of the axes _νx_ or _νy_, and then rotate the filter, resulting in a non-isotropic filter with respect to the periodic axes. Figure 8 visualizes these heuristics. Figure 8: Visualization of _H_ ( _r_ ) with Random Variations. Each sample is generated by filtering standard uniform noise using a 2D radial filter, as shown here, with occasional axis scaling and rotation applied to the filter in Fourier space to encourage diversity in the output data points. Combining other parameterized distributions. While our biased free-form generation method covers a broad range of scattering patterns, we augment the dataset with additional parameterized families of structures that are unlikely to be produced through free-form generation alone: 1. Rectangles. 2. Ellipsoids. 3. Jerusalem crosses. 4. Pseudo-freeform structures (from a publicly available collection of reciprocal designs <sup>2</sup> [32]). 5. Grating profiles. 2 `[https://github.com/SensongAn/Meta-atoms-data-sharing](https://github.com/SensongAn/Meta-atoms-data-sharing)` 12 Figure 9 shows representative examples from each family. For the pseudo-freeform and parameterized families (i.e., families 1–4), additional variation was introduced by occasionally compressing structures along one axis, forming artificial sub-periods. In total, 80% of the dataset was generated using the free-form method, and 4% was allocated to each of the families 1–5. Figure 9: Examples of meta-atom structures . Each row shows representative samples from a different family. Accuracy. The RCWA algorithm exploits the periodicity of metasurfaces by representing their structure using a truncated Fourier expansion [1]. This formulation enables a trade-off between computational efficiency and simulation accuracy, controlled by the number of retained Fourier orders. In our experiments, we prioritize speed while maintaining acceptable accuracy by using 7 Fourier orders for SiO2 datasets and 9 orders for Si datasets. The higher setting for Si reflects its larger refractive index contrast with air, which requires finer resolution to capture sharp field variations. We validate these choices by calculated total transmitted and reflected energy, allowing numerical errors within a 5% margin. B.2 Analysis of The Computed Scattering Distribution The RCWA simulations, conducted across various thicknesses and incident wavelengths, map the geometric design space onto a new, unknown distribution of diffraction patterns. The randomization method used to generate the metasurface structures significantly influences this distribution, potentially creating dominant modes or underrepresented regions. Since diffusion models are designed for approximating the training data distribution, ensuring sufficient coverage of the scattering space is crucial for enabling diverse and representative sampling of scattering patterns. To evaluate this coverage, we propose a qualitative method that leverages Principal Component Analysis (PCA) for dimensionality reduction and Kernel Density Estimation (KDE) for visualization of the distribution’s density, allowing examination of the resulted distribution. PCA is a commonly used technique for linear dimensionality reduction. It identifies the principal directions, or principal components, along which the data shows the most variance. In our case, the target scattering patterns are processed by computing their covariance matrix, from which the _N_ largest eigenvectors are extracted to define these directions of maximum variance. Each data point is then projected onto the principal plane, spanned by the selected _N_ principal components. This plane minimizes the mean Euclidean distance between the data points and their projections onto it, allowing high-dimensional data to be visualized in two dimensions when _N_ = 2 while highlighting the data’s 13 primary variances. Once the scattering patterns are projected onto a 2D plane, we apply Kernel Density Estimation (KDE) to smooth the empirically obtained data points and approximate the continuous density of the underlying distribution. KDE achieves this by placing a kernel (e.g., Gaussian) at each data point and summing their contributions across the space. This provides a smoothed density map, helping visualize the distribution of scattering patterns derived from the randomized metasurface structures, as demonstrated in Figure 10. In this figure, the density of the computed scattering distribution is empirically estimated and visualized. Selected target patterns are then projected onto the resulting principal plane, enabling navigation within the reduced space and validating the coverage of these patterns. To summarize, the coverage of the scattering space can be assessed through the following steps: - Sample a large set of scattering patterns. - Perform PCA with _N_ = 2 and project the scattering patterns onto the attained plane. - Visualize the 2D plane using KDE for a smoothed density representation. - Construct a set of target patterns of interest, including potentially unachievable ones, and project them onto the plane. Figure 10: Scattering Space Visualization. Target patterns projected on the 2-D principal plane of 5000 data points drawn from the training distribution of dataset A2. We propose this visualization as macro-level inspection of the distribution. Ideally, a fully covered scattering space would be desirable for robust training of distribution leaning algorithms such as diffusion models. However, in our study, achieving this was found to be challenging, and we leave further exploration of this task for future research. B.3 Additional Datasets In addition to datasets B2 and C2, we construct three additional SiO2-based datasets (A1, A2, and A3) with larger periodicity values, as detailed in Table 3. These datasets include only free-form structures generated using our method and are designed to empirically test how well our approach scales with growing complexity, in comparison to alternative methods. Polarization Material Wavelengths _λ_ [µm] Heights _h_ [µm] <u>TE only</u> <u>SiO2</u> _{_ 0 _._ 85 _,_ 0 _._ 9 _,_ 0 _._ 95 _,_ 1 _._ 0 _,_ 1 _._ 05 _,_ 1 _._ 1 _}_ 0 _._ 75 – 1 _._ 45 Datasets Periodicity _p_ [µm] Data Size <u>A1 / A2 / A3</u> <u>1.9 / 3.2 / 4.6</u> <u>1.5M (250k</u> _×_ <u>6)</u> Table 3: Physical settings of the datasets A1, A2, and A3. These datasets differ only in the periodicity of the meta-atoms, enabling a controlled evaluation of how increasing structural complexity impacts the performance of the proposed method. C Evaluation Details and Quantitative Results C.1 Comparison to Competing Methods To the best of our knowledge, this is the first study to perform distribution learning for metasurface generation conditioned on diffractive scattering patterns. For consistent evaluation, we train all methods - _MetaGen_, WGAN-GP, and C-VAE - on the same datasets. We compare the models across three key aspects: (i) their ability to capture the training distribution, (ii) generalization to a reference set of target patterns, and (iii) robustness to increasing complexity. To this end, all methods are trained on datasets A1, A2, and A3. 14 The evaluation is conducted by querying each model with a desired scattering pattern. The models generate corresponding meta-atom structures, which are then simulated using RCWA to obtain their actual scattering patterns. The resulting patterns are compared to the target patterns using relative error as the evaluation metric. Further architectural and training details for each method are provided Section D in this supplementary material. C.2 Evaluation on Data Distribution We evaluate _MetaGen_ ’s performance using Relative Error, reported for each of A1, A2, and A3 datasets. The results are averaged over _N_ = 500 data points which the model has not observed during training. The results are detailed in Table 4, demonstrating the superiority of _MetaGen_ in capturing the data distribution. Representative visualized samples are shown in Figure 11. <u>Model / Dataset</u> <u>A1</u> <u>A2</u> <u>A3</u> CVAE 0 _._ 5326 _±_ 0 _._ 2718 0 _._ 5951 _±_ 0 _._ 2017 0 _._ 6266 _±_ 0 _._ 1699 WGAN-GP 0 _._ 2857 _±_ 0 _._ 1679 0 _._ 4655 _±_ 0 _._ 1725 0 _._ 5323 _±_ 0 _._ 1535 _<u>MetaGen</u>_ <u>(Ours)</u> <u>0.1012</u> _<u>±</u>_ <u>0.0926</u> <u>0.1658</u> _<u>±</u>_ <u>0.0883</u> <u>0.2725</u> _<u>±</u>_ <u>0.1255</u> Table 4: Evaluation on the Test Set . Relative Error comparisons across the test set for various methods, under the physical settings A1, A2, and A3. The results are averaged across 500 samples. Sampling was done without RCWA guidance. Figure 11: Representative In-Distribution Samples . Metasurfaces designed by sampling _MetaGen_ conditioned on scattering patterns drawn from our proposed datasets. Topmost - A1 dataset, middle - A2, bottom - A3. C.3 Generalization to Target Patterns Our approach extends beyond training a diffusion model to generate high-fidelity samples as it also synthesizes the data distribution itself. This can result in general but non-functional samples. To address this, we evaluate the model’s ability to generate metasurfaces for out-of-distribution patterns, i.e. diffraction patterns that are not included in the training/test sets and might not be fully realizable. For each dataset A1, A2 and A3, we manually construct a reference set of target patterns on which we evaluate all approaches. The target sets are presented in Figure 12. It should be emphasized that 15 obtaining precisely these diffraction patterns could prove to be impossible within the constraints (binary, phase-only, metasurfaces with a minimal permittable feature size). Thus, the evaluation of our diffusion model in such cases would be its ability to generate designs that approximate the desired diffraction patterns. Figure 12: Target Patterns . Top - A1, Middle -A2, Bottom - A3. Each dataset is characterized by a distinct periodicity, hence a different the number of diffraction orders. Accordingly, target patterns were tailored for each dataset. We also assess the ability of our approach to generalize by evaluating each method’s performance on the target patterns across a broad wavelength range, including wavelengths beyond the training data. Quantitative results are presented in Figure 13. Although each method maintains, roughly, similar accuracy across operating wavelengths within and beyond the training datasets, Figures 13 and 14 show that WGAN-GP and CVAE models struggle to generalize from the training data distribution to target patterns. In contrast, _MetaGen_ not only significantly outperforms the competing methods but also demonstrates strong generalization to out-of-distribution scattering patterns. For example, Figure 14 illustrates the results of sampling _MetaGen_ WGAN-GP, and CVAE 10 times, by feeding the models with both an out-of-distribution scattering pattern and _λ_ = 0 _._ 975[ _µm_ ]. From this set, the metasurface with the minimal relative error is selected, directly demonstrating the superiority of _MetaGen_ over competing generative methods. 16 Figure 13: Evaluation on Target Patterns . Performance comparison of all examined methods on manually assembled scattering conditions, which lie outside the training data distribution, for each dataset A1, A2, and A3. These conditions are evaluated across multiple operating wavelengths, both included in the training dataset and beyond. The reported results are averaged across 10 experiments for each model and dataset. Sampling is done without RCWA guidance. _MetaGen_ WGAN-GP CVAE Figure 14: Target Pattern Sampling . (Top to bottom) _MetaGen_, WGAN-GP and CVAE sampled metasurfaces conditioned by the presented X-shaped scattering pattern, with out-of-distribution wavelength _λ_ = 0 _._ 975[ _µm_ ]. The metasurfaces were obtained by sampling each model 10 times and taking the metasurfaces with the lowest relative error. The leftmost and rightmost panels depict, respectively, the desired and obtained spatial power distributions. D Implementation Details D.1 _MetaGen_ ’s Implementations Details D.1.1 Training We train a diffusion model, implemented using EDM, the pre-conditioning and sampling framework proposed in [16]. The training process is illustrated in Figure 15 and is explained hereby. The model receives _x_ 0, a sample from the 17 Data Point RCWA ###### Diffusion training only Figure 15: _MetaGen_ Training . Images from the source distribution _x_ 0 are noised by a Gaussian noise with zero-mean and random noise level _σ_, then passed to the diffusion model which is conditioned by both the noise level and the scattering patterns. source distribution, augmented by random cyclic-shifts, along with its corresponding height _h_, both concatenated together channel-wise to form a [2 _,_ 64 _,_ 64] shaped Tensor. It is then noised by a Gaussian noise _nσ_ _∼N_ (0 _, σ_ <sup>2</sup> _I_ ) with _σ_ drawn from a log-normal distribution, i.e. log _σ_ _∼N_ ( _µ, s_ <sup>2</sup> ) for some proper choices of _µ, s_ (see the supplementary material, Section 2.A). The noised sample, denoted by _xσ_ := _x_ 0 + _nσ_, is fed into the diffusion model, which is a U-Net shaped encoder-decoder neural network [33, 16]. The scattering patterns and the wavelength _λ_, along with the noise level _σ_, are fed into the diffusion model as conditional signals and later injected into each level of the encoder and decoder. The model is trained to reconstruct a denoised version of _xσ_, denoted as _x_ ˆ0, conditioned by the additional input parameters. We apply the _L_ 2 loss criterion between the target image _x_ 0 and its reconstruction _x_ ˆ0. Because we focus on the transmitted spatial power distribution _T_, we use _T_ and _λ_ only as conditional signals, and omit _R_ . Noise level distribution. Contrary to the common practice of sampling _σ_ uniformly, empirical experiments done in [16] suggest sampling _σ_ from a log-normal distribution, i.e log _σ_ _∼N_ ( _µ, s_ <sup>2</sup> ), with _µ, s_, optimally found for natural images to be _−_ 1 _._ 2 _,_ 1 _._ 2 respectively, implying _σ_ values between 0 _._ 09 to 1 within one standard deviation. We follow this spirit, but rather set _µ_ = 0 to induce higher noise levels ranging from 0 _._ 3 to 3 _._ 3 within one standard deviation. This adjustment is based on the observation that denoising binary images, as well as constant images, is less challenging than denoising natural images. Cyclic augmentations. Due to the periodic nature of the overall metasurface, the intensity of the transmitted and reflected light is invariant to cyclic shifts of the meta-atom topology. This fact facilitates data augmentations, which expand the dataset and ultimately enhance the model’s generative capabilities. Moreover, as the model is trained by observing meta-atoms only, we hypothesize that applying cyclic-shifts augmentations informs the model of the periodic nature of these kinds of meta-surfaces. In practice, a random cyclic shift is applied to the input binary image during training while keeping the corresponding scattering pattern unchanged. We note that during training, the model can partially reconstruct moderately noisy samples. However, when presented with an extremely noisy sample, _xσ_, which contains almost no information, the model might ignore the noisy input and rely solely on the conditional information. This can result in the generation of a new meta-atom, _x_ ˆ0, which may be a cyclic-shifted variant of _x_ 0, the original, clean binary structure. In such cases, due to the cyclic pixel-wise misalignment, the model may incur a high _L_ 2 loss penalty, causing it to deviate from a desired behavior. To mitigate this, we apply cyclic-shift correction by aligning the denoised structure _x_ ˆ0 to the original clean structure _x_ 0. This correction is performed by computing the maximal correlation between _x_ 0 and _x_ ˆ0, implemented using a 2-D Fast Fourier Transform for efficiency, and cyclically shifting the image accordingly. Training parameters. All _MetaGen_ models have 62 _M_ parameters, trained with batch size of 32 and optimized by AdamW Schedule-Free optimizer [34, 35] with learning rate 10 <sup>_−_</sup> <sup>4</sup> and no weight decay regularization. The models for datasets B2 and C2 were trained for 3 _M_ optimization steps, while the models for A1, A2 and A3 were trained for 1 _M_ steps. 18 D.1.2 Sampling Details The authors of EDM [16] proposed a noise schedule over discretized time steps that achieves strong sampling performance on natural image datasets. The schedule defines a decreasing sequence of noise levels for _i ∈{_ 0 _, . . ., T_ _}_, where earlier time steps correspond to higher noise magnitudes: (17) _<u>i</u>_ max <sup>1</sup> <sup>_/ρ_</sup> <sup>+</sup> _T_ _−_ 1 - _σ_ min <sup>1</sup> <sup>_/ρ_</sup> min <sup>1</sup> <sup>_/ρ_</sup> <sup>_−_</sup> <sup>_σ_</sup> max <sup>1</sup> <sup>_/ρ_</sup> max - <sup>�</sup> <sup>_ρ_</sup> _,_ if _i < T_ _σi_ =   _σ_ max <sup>1</sup> <sup>_/ρ_</sup> 0 _,_ if _i_ = _T_ While this schedule is effective for natural image generation, our setting involves a joint distribution over binary metasurface structures and their corresponding scattering patterns, which differs significantly in structure and semantics. Accordingly, although we retain the overall shape of the noise schedule, we adapt its parameters to better suit our data. In particular, we slow down the progression at high noise levels, where conditional information (e.g., the desired scattering pattern) is parsed, and accelerate it at low noise levels, where the model primarily refines fine structural details. The original EDM parameters are provided in [16]. In our implementation, we increase _σ_ max to 100 and set _ρ_ = 3, encouraging more gradual transitions in the early (noisy) stages, which was found to improve performance empirically. We use _T_ = 100 time steps and follow the sampling procedure described in Algorithm 2 of [16], with the following key modifications: - Deterministic Sampling. We disable stochasticity by setting _S_ churn = 0, ensuring a stable and consistent sampling trajectory given the initial noise _nσ_ . - Posterior Sampling via DPS (RCWA Guidance). We incorporate Diffusion Posterior Sampling (DPS) [17], which introduces a measurement consistency term into the sampling process. Specifically, we modify the intermediate noised sample at each step by adding a gradient correction term that minimizes the _L_ 2 error between the predicted and desired scattering patterns. We find that scaling this gradient by the noise level _σi_ at each timestep _i_ yields the best empirical results. - First-Order Solver. We omit the second-order Heun correction term proposed in [16], as we observe no performance gain in our setting. Furthermore, we find that this first-order Euler method integrates more naturally with DPS-guided sampling. D.1.3 Architecture _MetaGen_ adopts the U-Net backbone architecture introduced in [14], as implemented in EDM [16]. The architecture of _MetaGen_ features a mirror-like encoder-decoder structure composed of UNet blocks, detailed in Table 5. Skip connections link the outputs of each encoder block to their corresponding decoder blocks. Conditional information is incorporated by embedding an _N_ -dimensional vector into a high-dimensional space and injecting it into each UNet block throughout the network via element-wise addition at every level. The complete architecture of _MetaGen_ including the shapes of all intermediate components, is outlined in Table 6. <u>Layer #</u> <u>Type</u> <u>Inputs (by Layer #)</u> <u>Output Shape</u> <u>Notes</u> 1 Inputs _x_ [ _B, C_ in _, H, W_ ] <u>2</u> _<u>emb</u>_ <u>[</u> _<u>B, K</u>_ <u>]</u> <u>3</u> <u>Conv2D</u> <u>1</u> <u>[</u> _<u>B, C</u>_ <u>out</u> _<u>, H, W</u>_ <u>]</u> <u>SiLU Activation</u> <u>4</u> <u>Linear</u> <u>2</u> <u>[</u> _<u>B, C</u>_ <u>out]</u> <u>5</u> <u>Group Norm</u> <u>3, 4</u> <u>[</u> _<u>B, C</u>_ <u>out</u> _<u>, H, W</u>_ <u>]</u> <u>SiLU Activation</u> <u>6</u> <u>Conv2D</u> <u>5</u> <u>[</u> _<u>B, C</u>_ <u>out</u> _<u>, H, W</u>_ <u>]</u> <u>7</u> <u>Group Norm</u> <u>6, 1</u> <u>[</u> _<u>B, C</u>_ <u>out</u> _<u>, H, W</u>_ <u>]</u> <u>8</u> <u>Self-Attention</u> <u>7</u> <u>[</u> _<u>B, C</u>_ <u>out</u> _<u>, H, W</u>_ <u>]</u> <u>9</u> <u>Conv2D</u> <u>8</u> <u>[</u> _<u>B, C</u>_ <u>out</u> _<u>, H, W</u>_ <u>]</u> <u>10</u> <u>Output</u> <u>9, 6</u> <u>[</u> _<u>B, C</u>_ <u>out</u> _<u>, H, W</u>_ <u>]</u> Table 5: UNet Block( _C_ in _, C_ out _, K_ ) Description . The block has two inputs: an image _x_ of shape [ _H, W_ ] where _C_ in is the number of channels, and a _K_ -dimensional embedding _emb_ that encodes the conditional information. Skip connections between sequential sub-modules within the block are implemented as element-wise additions. 19 Layer # Type Inputs (by <u>Layer #)</u> Output Shape Notes 1 Inputs _x_ [ _B,_ 2 _,_ 64 _,_ 16] 2 _y_ [ _B, N_ ] <u>3</u> _<u>σ</u>_ <u>[</u> _<u>B,</u>_ <u>1]</u> <u>4</u> <u>Positional Embedding</u> <u>3</u> <u>[</u> _<u>B,</u>_ <u>128]</u> <u>-</u> <u>5</u> <u>Linear</u> <u>2, 4</u> <u>[</u> _<u>B,</u>_ <u>128]</u> <u>-</u> <u>6</u> <u>Linear</u> <u>5</u> <u>[</u> _<u>B,</u>_ <u>512]</u> <u>SiLU Activation</u> <u>7</u> <u>Linear</u> <u>6</u> <u>[</u> _<u>B,</u>_ <u>512]</u> <u>SiLU Activation</u> <u>8</u> <u>Conv2D</u> <u>1</u> <u>[</u> _<u>B,</u>_ <u>2</u> _<u>,</u>_ <u>64</u> _<u>,</u>_ <u>64]</u> <u>-</u> <u>9</u> <u>4 x UNetBlock</u> <u>8, 7</u> <u>[</u> _<u>B,</u>_ <u>128</u> _<u>,</u>_ <u>64</u> _<u>,</u>_ <u>64]</u> <u>-</u> <u>10</u> <u>Down Sampling UNet Block</u> <u>9, 7</u> <u>[</u> _<u>B,</u>_ <u>128</u> _<u>,</u>_ <u>32</u> _<u>,</u>_ <u>32]</u> <u>-</u> <u>11</u> <u>4 x UNetBlock</u> <u>10, 7</u> <u>[</u> _<u>B,</u>_ <u>256</u> _<u>,</u>_ <u>32</u> _<u>,</u>_ <u>32]</u> <u>-</u> <u>12</u> <u>Down Sampling UNet Block</u> <u>11, 7</u> <u>[</u> _<u>B,</u>_ <u>256</u> _<u>,</u>_ <u>16</u> _<u>,</u>_ <u>16]</u> <u>-</u> <u>13</u> <u>4 x UNetBlock</u> <u>12, 7</u> <u>[</u> _<u>B,</u>_ <u>256</u> _<u>,</u>_ <u>16</u> _<u>,</u>_ <u>16]</u> <u>Inc.</u> <u>Self-Attention.</u> <u>14</u> <u>Down Sampling UNet Block</u> <u>13, 7</u> <u>[</u> _<u>B,</u>_ <u>256</u> _<u>,</u>_ <u>8</u> _<u>,</u>_ <u>8]</u> <u>-</u> <u>15</u> <u>4 x UNetBlock</u> <u>14, 7</u> <u>[</u> _<u>B,</u>_ <u>256</u> _<u>,</u>_ <u>8</u> _<u>,</u>_ <u>8]</u> <u>-</u> <u>16</u> <u>2 x UNetBlock</u> <u>15, 7</u> <u>[</u> _<u>B,</u>_ <u>256</u> _<u>,</u>_ <u>8</u> _<u>,</u>_ <u>8]</u> <u>Inc.Self-Attention.</u> <u>17</u> <u>5 x UNetBlock</u> <u>16, 7, 15</u> <u>[</u> _<u>B,</u>_ <u>256</u> _<u>,</u>_ <u>8</u> _<u>,</u>_ <u>8]</u> <u>-</u> <u>18</u> <u>Up Sampling UNet Block</u> <u>17, 7, 14</u> <u>[</u> _<u>B,</u>_ <u>256</u> _<u>,</u>_ <u>16</u> _<u>,</u>_ <u>16]</u> <u>-</u> <u>19</u> <u>5 x UNetBlock</u> <u>18, 7, 13</u> <u>[</u> _<u>B,</u>_ <u>256</u> _<u>,</u>_ <u>16</u> _<u>,</u>_ <u>16]</u> <u>Inc.</u> <u>Self-Attention.</u> <u>20</u> <u>Up Sampling UNet Block</u> <u>19, 7, 12</u> <u>[</u> _<u>B,</u>_ <u>256</u> _<u>,</u>_ <u>32</u> _<u>,</u>_ <u>32]</u> <u>-</u> <u>21</u> <u>5 x UNetBlock</u> <u>20,7, 11</u> <u>[</u> _<u>B,</u>_ <u>256</u> _<u>,</u>_ <u>32</u> _<u>,</u>_ <u>32]</u> <u>-</u> <u>22</u> <u>Up Sampling UNet Block</u> <u>21, 7, 10</u> <u>[</u> _<u>B,</u>_ <u>128</u> _<u>,</u>_ <u>64</u> _<u>,</u>_ <u>64]</u> <u>-</u> <u>23</u> <u>5 x UNetBlock</u> <u>22, 7</u> <u>[</u> _<u>B,</u>_ <u>128</u> _<u>,</u>_ <u>64</u> _<u>,</u>_ <u>64]</u> <u>-</u> <u>24</u> <u>Group Norm</u> <u>23</u> <u>[</u> _<u>B,</u>_ <u>128</u> _<u>,</u>_ <u>64</u> _<u>,</u>_ <u>64]</u> <u>SiLU Activation</u> <u>25</u> <u>Conv2D</u> <u>24</u> <u>[</u> _<u>B,</u>_ <u>2</u> _<u>,</u>_ <u>64</u> _<u>,</u>_ <u>16]</u> <u>-</u> Table 6: Our diffusion model is inherited from [16] and follows the DDPM++ architecture proposed in [14]. The network adopts a mirror-like Encoder-Decoder structure. Skip connections are implemented by concatenating the encoder outputs with inputs of its corresponding decoder layer. The self-attention layer in the UNet blocks is omitted by default unless explicitly stated otherwise. Down and up sampling are achieved using stride = 2 in convolution and transposed convolution layers, respectively. D.2 WGAN-GP Implementation Details To evaluate our model, we trained a Wasserstein GAN with Gradient Penalty (WGAN-GP) [18, 19, 20, 21] on each of our datasets (A1, A2, and A3). To adapt WGAN-GP for our conditional generation task, we modified the standard framework by conditioning both the Generator and Critic networks on the scattering patterns. Conditioning in the Generator was achieved by incorporating a small 3-layer Multi-Layer Perceptron (MLP) to embed the scattering patterns into a learned high-dimensional space, which was then concatenated with random noise, as is typical in GAN architectures. For the Critic, the same embedding MLP was used, with its output reshaped to match the spatial dimensions of the input image. The embedding dimensionality for both networks was thus set to 64 <sup>2</sup>, and the latent noise dimension was set to 100. The training process on each of our dataset A1, A2 and A3, consisted of 1M optimization steps for the Generator, and for each Generator update, a decoupled separated optimization step was performed for the Critic. The batch size was set to 64. Both the Generator and the Critic were optimized by Adam optimizer [36] with unscheduled learning rate of 0 _._ 0001, and _β_ 1 = 0 _, β_ 2 = 0 _._ 9. These training settings were selected to align closely with the training procedure of _MetaGen_ for a fair comparison. Additionally, the embedding MLP used for conditioning both the Generator and the Critic was identical to the one used in _MetaGen_, following the implementation of [16]. D.3 C-VAE Implementation Details Building upon an existing implementation of a Conditional Variational Autoencoder (C-VAE) [22, 23], we introduced architectural enhancements to ensure competitiveness with our method. Standard implementations of Conditional VAEs typically condition the model by providing the auxilary information as input only to the first layer of the Encoder and Decoder. For enhancing the compliance of the model to the conditional information, we rather utilize a preceding MLP to first embed this information into a learned high-dimensional space, and inject it into every convolutional layer of both Encoder and Decoder networks by stacking the embedded conditional information as an extra data channel. Moreover, the embedded conditional information is incorporated into the final layer of the Encoder, which outputs the mean and variance of the learned posterior distribution of the latent space. This design enforces a strong impact of the conditions on the structure of the latent space. To complement these enhancements, we added several unconditional residual 20 layers in cascade to both the Encoder and the Decoder, creating of a more meaningful latent space. Together, these improvements significantly strengthen the enforcement of conditional information and the model’s overall performance. We trained a Conditional Variational Autoencoder (C-VAE) separately for each dataset - A1, A2, and A3 - over 200 epochs with a batch size of 1024. The training employed Adam optimizer with a learning rate of 0 _._ 001, a decay rate of 0 _._ 95, and no weights decay. The Kullback-Leibler Divergence loss term was weighted by a factor of 0 _._ 00025 to balance its impact on the overall loss function.The latent space dimension was set to 100. E Gradient Descent for Metasurface Inverse Design For metasurface inverse design, standard gradient descent (GD) algorithms must be adapted to produce binary outputs while maintaining fabrication feasibility, i.e. eliminating small features and preserving periodic continuity. In this study, we follow the approach introduced in [4, 2], modifying the GD scheme to suit metasurface design by incorporating two key components: a fixed spatial blurring kernel and a soft, differentiable binarization function that is gradually sharpened during optimization. The blurring step is applied in the spatial frequency domain using the filter defined in Eq. 16, as described in Section B of this supplementary material. To enforce binarization while maintaining gradient flow, we apply a soft projection function with a time-dependent sharpness parameter. This function is defined as: �� _x −_ <sup><u>1</u></sup> <u>2</u> <sup><u>1</u></sup> <u>2</u> - _β_ ( _t_ ) _P_ ( _x_ ; _t_ ) = <sup>tanh</sup> - <u>12</u> <sup>_β_</sup> <sup>(</sup> <sup>_t_</sup> <sup>)</sup> - + tanh <u>2</u> _,_ where _β_ ( _t_ ) = exp 2 tanh <u>�</u> <u>12</u> <sup>_β_</sup> <sup>(</sup> <sup>_t_</sup> <sup>)</sup> <u>�</u> - _<u>t</u>_ _N_ <sup>ln(</sup> <sup>_β_</sup> <sup>max)</sup> (18) where _N_ is the total number of optimization steps, and _β_ max = 1000 is the final binarization sharpness. The projection function _P_ ( _x_ ; _t_ ) smoothly approximates a step function, becoming increasingly sharper as _t_ increases, thereby gradually enforcing binary values while preserving differentiability throughout the optimization. F Hardware Statement All computations in this study were performed using a single NVIDIA L40S GPU, utilizing the GPU-accelerated PyTorch framework. The codebase relies on GPU support not only for model training, but also for sampling, optimization, and forward measurements conducted via the ToRCWA simulator [2]. These components are implemented to leverage the computational efficiency of modern GPUs. While the code is compatible with CPU execution, doing so requires sufficient memory and results in significantly slower runtimes. G Additional Results This section presents additional examples of metasurfaces generated by _MetaGen_ for qualitative evaluation. Figure 16 shows results conditioned on target patterns constructed for datasets A1, A2, and A3. These examples highlight _MetaGen_ ’s ability to generate metasurface designs that match diffraction patterns beyond the range of the training set, both in terms of spatial configuration and wavelength. 21 22 Figure 16: Representative Results For Out-of-distribution Samples. The examples are generated from all _MetaGen_ models (A1, A2 and A3), all under illumination of _λ_ = 0 _._ 975[ _µm_ ] which was not included in the training data. 23

섹션 본문

섹션 본문이 없습니다.

참고문헌 20건

  1. Formulation for stable and efficient implementation of the rigorous coupled-wave analysis of binary gratings Journal of the Optical Society of America A · Optica Publishing Group · 1995 10.1364/josaa.12.001068
  2. Conditional Generative Adversarial Nets arXiv (Cornell University) · Cornell University · 2014 10.48550/arxiv.1411.1784
  3. Nanophotonic particle simulation and inverse design using artificial neural networks Science Advances · American Association for the Advancement of Science · 2018 10.1126/sciadv.aar4206
  4. Wide angle 2D beam splitter design based on vector diffraction theory Optics Communications · Elsevier BV · 2018 10.1016/j.optcom.2018.10.026
  5. Inverse design and demonstration of high-performance wide-angle diffractive optical elements Optics Express · Optica Publishing Group · 2020 10.1364/oe.394442
  6. Inverse design in photonics by topology optimization: tutorial Journal of the Optical Society of America B · Optica Publishing Group · 2020 10.1364/josab.406048
  7. Denoising Diffusion Implicit Models arXiv (Cornell University) · Cornell University · 2020 10.48550/arxiv.2010.02502
  8. Quasi-Continuous Metasurface Beam Splitters Enabled by Vector Iterative Fourier Transform Algorithm Materials · Multidisciplinary Digital Publishing Institute · 2021 10.3390/ma14041022
  9. Diffusion Models Beat GANs on Image Synthesis arXiv (Cornell University) · Cornell University · 2021 10.48550/arxiv.2105.05233
  10. Empowering Metasurfaces with Inverse Design: Principles and Applications ACS Photonics · American Chemical Society · 2022 10.1021/acsphotonics.1c01850
  11. Deep Generative Modeling and Inverse Design of Manufacturable Free-Form Dielectric Metasurfaces ACS Photonics · American Chemical Society · 2022 10.1021/acsphotonics.2c01006
  12. TORCWA: GPU-accelerated Fourier modal method and gradient-based optimization for metasurface design Computer Physics Communications · Elsevier BV · 2022 10.1016/j.cpc.2022.108552
  13. Diffusion Posterior Sampling for General Noisy Inverse Problems arXiv (Cornell University) · Cornell University · 2022 10.48550/arxiv.2209.14687
  14. Diffractive optical element design based on vector diffraction theory and improved PSO-SA algorithm Optical Engineering · SPIE · 2023 10.1117/1.oe.62.2.025103
  15. Diffusion Models Beat GANs on Topology Optimization Proceedings of the AAAI Conference on Artificial Intelligence · Association for the Advancement of Artificial Intelligence · 2023 10.1609/aaai.v37i8.26093
  16. A Diffusion Model for Multi-Layered Metasurface Unit Cell Synthesis IEEE Open Journal of Antennas and Propagation · Institute of Electrical and Electronics Engineers · 2023 10.1109/ojap.2023.3292149
  17. Machine Learning for Data Science Handbook 2023 10.1007/978-3-031-24628-9
  18. Diffusion probabilistic model based accurate and high‐degree‐of‐freedom metasurface inverse design Nanophotonics · De Gruyter · 2023 10.1515/nanoph-2023-0292
  19. Addressing high-performance data sparsity in metasurface inverse design using multi-objective optimization and diffusion probabilistic models Optics Express · Optica Publishing Group · 2024 10.1364/oe.537389
  20. Inverse Design of Diffractive Metasurfaces Using Diffusion Models arXiv (Cornell University) · Cornell University · 2025 10.48550/arxiv.2506.21748