Active learning for photonic crystals

Ryan Lopez, Charlotte Loh, Rumen Dangovski, Marin SoljačićarXiv 2026

TL;DR

This paper introduces an active learning framework for photonic crystals that uses an analytic last-layer Bayesian neural network (LL-BNN) to predict band gaps with 2.7× less training data than standard random sampling. By deriving closed-form uncertainty estimates, the model intelligently selects the most informative simulations to run, matching deep ensemble accuracy at a fraction of the computational cost.

What Problem Does This Paper Address?

Designing photonic crystals requires exploring massive geometric spaces to find structures with optimal properties, such as specific photonic band gaps. However, evaluating each candidate structure requires high-fidelity electromagnetic simulations (like the plane-wave expansion method), which are computationally expensive—especially when moving from 2D to 3D structures.

Machine learning surrogates can drastically speed up this exploration, but training them typically requires a massive dataset of pre-computed simulations. The authors tackle this data bottleneck by asking: How can we train highly accurate surrogate models using the absolute minimum number of expensive simulations?

Methods

The authors combine Active Learning (AL) with an Analytic Last-Layer Bayesian Neural Network (LL-BNN).

Instead of making the entire neural network Bayesian (which is computationally heavy and prone to sampling noise), they use a standard deterministic convolutional neural network (CNN) as a feature extractor and make only the very last layer Bayesian.

Crucially, because only the last layer contains probabilistic weights and biases, the predictive variance and the Kullback-Leibler (KL) divergence regularizer can be solved analytically (representing the infinite Monte Carlo sample limit). This eliminates the need for expensive and noisy Monte Carlo sampling (like MC-dropout) during inference.

The active learning loop starts with just 50 labeled samples. The model evaluates the unlabeled pool, computes the exact uncertainty score for each candidate in a single forward pass, and selects the top 50 most uncertain samples for the simulation "oracle" to label next. This pipeline is illustrated below:

Figure 1. Active-Learning Pipeline for 2D Photonic-Crystal Band-Gap Prediction. Starting from the dielectric-constant map of a 2D two-tone photonic-crystal unit cell (augmented via symme- try operations), we feed each sample into a deep neural network whose final layer is approximate Bayesian. In this last layer, each weight and bias is treated as a Gaussian random variable, so a sin- gle input yields a predictive distribution rather than a point estimate. When evaluating unlabeled candidates, we compute the output variance as an uncertainty score and select the highest-variance samples for expensive band-structure simulations. By iteratively adding only the most informative points, the model rapidly im- proves its accuracy with far fewer training examples.

Datasets

  • 2D Photonic Crystal Dataset: The framework was evaluated on a dataset of 11,376 two-tone 2D photonic crystal unit cells.
  • Representation & Labels: Each unit cell is represented as a 32×32 pixel permittivity map, generated via a random Fourier-sum function. Ground-truth labels (the largest band gap within the first 10 bands) were computed using the MIT Photonic Bands (MPB) package.
  • Data Augmentation: To maximize data efficiency, the authors incorporated physics-preserving data augmentations (translations, 90°/180°/270° rotations, and mirror reflections) to ensure the network learns features robust to lattice orientation, as shown below:
Figure 2. Symmetry-preserving data augmentation for 2D photonic crystal unit cells. Rotations, reflections, and transla- tions of the 32 × 32 permittivity maps leave the photonic band structure unchanged. During training, random combinations of these transformations are applied to each sample, effectively en- larging the dataset while enforcing physical invariance of the band gap labels.

Key Insights and Ideas

  • The Power of the Last Layer: You don't need full-network Bayesian uncertainty to guide active learning effectively. A deterministic backbone paired with a Bayesian last layer provides high-quality uncertainty rankings at a fraction of the cost.
  • Analytic vs. Sampling-Based UQ: By using a formulation that allows a closed-form solution for variance, the authors bypass the sampling noise that plagues traditional BNNs, leading to highly stable active learning trajectories.
  • Ranking Over Calibration: For active learning, absolute calibration (knowing the exact error probability) matters less than relative ranking (knowing which sample is more uncertain than another). The LL-BNN maintains a strong, consistent monotonic relationship between predicted uncertainty and true error throughout the entire active learning process.

Key Results

  • 2.7× Data Savings: The active learning approach achieved the same final predictive accuracy as uniform random sampling while requiring 2.7× fewer training samples (an average of 935 samples vs. 2,500 samples).
  • Ensemble Performance at Single-Model Cost: The analytic LL-BNN performed on par with a Deep Ensemble of 10 distinct models, matching its error reduction rate and uncertainty ranking quality (achieving a strong Spearman rank correlation of ~0.76), but required roughly 10× less compute since it only trains a single network.
Figure 5. Comparison of Random vs Uncertainty-Driven Sam- pling. Test set MSE for photonic-crystal band-gap prediction as a function of total training samples, averaged over ten runs (each ini- tialized with a different random pool of 50 examples). Blue shows standard random sampling; orange shows uncertainty sampling via our approximate Bayesian last layer; pink shows the deep ensemble. The green curve shows an ”oracle” baseline that, at each iteration, greedily selects the 50 unlabeled samples with the highest true regression error—information unavailable in practice. This oracle is not globally optimal but provides an upper bound on what any greedy acquisition based on uncertainty could achieve. Error bars indicate standard error across runs. Both the analytic LL-BNN and the deep ensemble achieve lower error than random sampling at every budget level and reach the same accuracy as random sampling with roughly one-third the data. Notably, the two uncertainty-based methods perform comparably throughout training, while the analytic LL-BNN requires only a single model per iteration compared to N for the ensemble.

Limitations and Future Work

  • Lack of Explicit Diversity Constraints: The current acquisition function relies purely on uncertainty. In some cases, this can cause the model to select clusters of similar, highly uncertain points (batch redundancy), though empirical feature-space analysis in this paper showed that batches did not collapse to near-duplicates in practice. Incorporating batch-diverse functions like determinantal point processes (DPPs) could improve this further.
  • Calibration: The model's absolute uncertainty calibration wasn't optimized, which might be necessary for safety-critical applications or multi-objective optimization.
  • Scaling Up: Future directions include integrating this framework directly into full inverse-design loops, using more expressive backbones (like Graph Neural Networks or Transformers), applying it to complex 3D photonic crystal datasets, and extending it to predict full vector-valued band structures rather than just scalar band gap sizes.

Summary updated

BibTeX
@misc{lopez2026active,
  author = {Ryan Lopez and Charlotte Loh and Rumen Dangovski and Marin Soljačić},
  title = {{Active learning for photonic crystals}},
  year = {2026},
  eprint = {2601.16287},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2601.16287},
}
Figure