This repository implements the framework and experiments described in our paper "Improving Generative Inverse Design of Rectangular Patch Antennas with Test Time Optimization.". We propose a two-stage inverse design framework for generating rectangular patch antennas that meet target frequency response specifications. Further, we show that leveraging search and optimization techniques at test-time improves the accuracy of the generated designs and enables consideration of auxiliary objectives such as manufacturability.
-
Clone the repository and navigate into its directory:
git clone https://github.com/becklabs/patch-antenna-tto.git cd patch-antenna-tto -
Install the
patchttopackage in editable mode:pip install -e .
Our custom simulation dataset used for training and evaluation is available via 🤗 Datasets.
Run the following command from the root of the repository to download and preprocess the dataset:
python -m scripts.huggingface.download_datasetThis command will save the preprocessed dataset to data/results/preprocessed_all/, where the training and evaluation configurations expect to find it.
To run the simulation harness, you will need to install openEMS. Detailed instructions can be found here. openEMS was successfully installed on macOS Sonoma 14.5 (M2 Chip) via the following method:
- Update Homebrew
brew update
brew upgrade
brew cleanup- Tap the openEMS repository
brew tap thliebig/openems https://github.com/thliebig/openEMS-Project.git- Install openEMS
brew install --HEAD openems- Build the CSXCAD Python bindings
cd ~/Library/Caches/Homebrew/openems--git/CSXCAD/python
python setup.py build_ext -I /opt/homebrew/opt/openems/include -L /opt/homebrew/opt/openems/lib -R /opt/homebrew/opt/openems/lib- Build the openEMS Python bindings
cd ~/Library/Caches/Homebrew/openems--git/openEMS/python
python setup.py build_ext -I /opt/homebrew/opt/openems/include -L /opt/homebrew/opt/openems/lib -R /opt/homebrew/opt/openems/libFor tracking training experiments, you will need a Weights & Biases account.
Login into Weights and Biases:
wandb loginThe repository contains several training scripts for different components of the framework:
Train the S11 VAE to learn representations of antenna frequency responses:
python scripts/s11_vae/train.py --config config/train/s11_vae.yamlTrain the Conditional VAE (CVAE) model to learn a distribution of designs conditioned on a target S11 curve:
python scripts/design_cvae/train.py --config config/train/design_cvae.yamlTrain the forward surrogate model for approximating the EM simulation:
python scripts/forward_model/train_betanll.py --config config/train/surrogate_nll.yamlEach configuration file under the config/ directory specifies training hyperparameters, dataset paths, and checkpointing details.
Reproduce experiments from the paper using the provided scripts:
Run the full inverse design framework to generate antenna designs that meet target S11 specifications:
python scripts/experiments/inverse_design.pyThis script combines generative modeling, latent space optimization, and simulation-based scoring to produce candidate designs.
Study the effect of varying the number of latent curves or design samples:
-
Number of Curves Scaling:
python scripts/experiments/n_curves_scaling.py
-
Number of Designs Sampling:
python scripts/experiments/n_designs_scaling.py
If you find our work helpful, please use the following citation.
@misc{labash2025improvinggenerativeinversedesign,
title={Improving Generative Inverse Design of Rectangular Patch Antennas with Test Time Optimization},
author={Beck LaBash and Shahriar Khushrushahi and Fabian Ruehle},
year={2025},
eprint={2505.18188},
archivePrefix={arXiv},
primaryClass={eess.SP},
url={https://arxiv.org/abs/2505.18188},
}
MIT. Check LICENSE for details.
For questions or feedback, please open an issue or contact labash.b@northeastern.edu.
