High-precision prediction of photonic band structure based on vision transformer model

Guanhua Chen, Yao Junchi, Zhu Hui-fang, Ting Zhang, Jin Wang, Xue Junjun, Chen Lin, Tao Tao, Tao ZhikuoActa 2025

Abstract

Photonic crystals have received widespread attention in the field of photonics due to their unique band structures, which can manipulate the propagation of light through periodic dielectric arrangements. Accurate prediction of these band structures is crucial for designing and optimizing photonic devices. However, traditional numerical simulation methods, such as plane wave expansion and finite element methods, are often limited by high computational complexity and long processing times. In this study, we explore the application of the vision transformer (ViT) model to predicting the band structures of photonic crystals efficiently and accurately. To further validate the superiority of the ViT model, we also conduct experiments by using CNN and MLP models on the same scale for band structure prediction. We first generate a dataset of photonic band structures by using traditional numerical simulations and then train the ViT model on this dataset. The ViT model demonstrates excellent learning capabilities, with the loss function value decreasing to as low as $4.42 \times 10^{-6}$ during training. The test results show that the average mean squared (MSE) error of the ViT model predictions is $3.46 \times 10^{-5}$, and the coefficient of determination ($R^2$) reaches 0.9996, indicating high prediction accuracy and good generalization capability. In contrast, the CNN and MLP models, despite being trained on the same dataset and having the same computational resource allocation, show higher MSE values and lower $R^2$ scores. This highlights the superior performance of the ViT model in predicting the band structures of photonic crystals. Our study shows that the ViT model can effectively predict the band structures of photonic crystals, providing a new and efficient prediction tool for relevant research and applications.

Introduction

Photonic crystals (PhCs) are periodic dielectric structures that serve as the optical equivalent of semiconductors. By creating photonic bandgaps, they allow for the precise control of light propagation, which is essential for technologies ranging from optical sensors to integrated photonic circuits. The fundamental challenge in designing these materials lies in calculating their band structure—the relationship between optical frequency and wave vector.

Traditionally, researchers rely on solving Maxwell’s equations via the Plane Wave Expansion (PWE) or Finite Element Method (FEM). While these methods are the gold standard for accuracy, they are computationally intensive. A single simulation can take nearly a minute, creating a significant bottleneck when thousands of iterations are required for optimization. This study proposes a deep learning alternative using the Vision Transformer (ViT) architecture to achieve near-simulation accuracy at a fraction of the temporal cost.

Methodology and Model Architecture

The core innovation of this work is the transition from local-feature-based models, like Convolutional Neural Networks (CNNs), to the global-context-aware Vision Transformer. While CNNs process images through localized receptive fields, ViTs utilize self-attention mechanisms. This allows the model to weigh the importance of different spatial regions of a unit cell simultaneously, capturing the long-range periodic relationships inherent in crystal lattices.

Comparison between traditional numerical simulation (COMSOL) and the proposed Vision Transformer (ViT) prediction pipeline.

As shown in the architecture above, the input consists of 224×224 pixel images of the PhC unit cell. These images are divided into 16×16 patches, embedded with positional information, and processed through 12 Transformer layers. The model finally outputs 8 dispersion curves, each represented by 31 data points, providing a comprehensive map of the first eight bands of the crystal.

Dataset Generation

To train a robust model, the researchers generated a diverse dataset of 4,800 unit cell structures. Rather than using simple geometric primitives, they employed a 3rd-order Fourier expansion to create randomized, complex boundary shapes. This ensured the model learned the underlying physics of light-matter interaction rather than just memorizing specific shapes like circles or squares.

Examples of randomized unit cell geometries and the corresponding target photonic band structure.

Ground truth data was calculated using COMSOL Multiphysics. The dataset was split into 4,500 training samples and 300 test samples. This variety in geometry (as seen in Figure 1a) allows the model to generalize across a wide design space, from simple blobs to intricate star-like patterns.

Key Results and Discussion

The ViT model demonstrated exceptional performance, significantly outperforming traditional neural network architectures. While a deep 12-layer CNN achieved an $R^2$ of 0.9303, the ViT reached a near-perfect $R^2$ of 0.9996. The Mean Squared Error (MSE) for the ViT was recorded at $3.46 \times 10^{-5}$, indicating that the predicted curves are virtually indistinguishable from those produced by expensive numerical simulations.

Beyond accuracy, the primary advantage is speed. Traditional COMSOL simulations required 50–70 seconds per structure. In contrast, the trained ViT model performed the same prediction in just 0.066 seconds—a speedup of approximately 1000x. Although the ViT requires a longer initial training period (~29 hours) compared to CNNs, the massive gain in inference precision makes it a far superior tool for real-time design and high-throughput optimization.

Conclusion

This research demonstrates that Vision Transformers are uniquely suited for predicting the physical properties of periodic structures. By leveraging self-attention to capture global spatial relationships, the ViT model provides a rapid and highly accurate alternative to traditional Maxwell solvers. Future work may expand this framework to include 3D structures and variable refractive indices, potentially leading to a universal predictor for photonic device design.

Summary updated

BibTeX
@inproceedings{chen2025high,
  author = {Guanhua Chen and YAO Junchi and Zhu Hui-fang and Ting Zhang and Jin Wang and XUE Junjun and Chen Lin and Tao Tao and TAO Zhikuo},
  title = {{High-precision prediction of photonic band structure based on vision transformer model}},
  booktitle = {Acta},
  year = {2025},
  doi = {10.7498/aps.74.20250778},
}
Figure