A machine-learning pipeline that designs a microstrip patch antenna automatically for a target frequency, replacing slow trial-and-error electromagnetic simulation with a fast surrogate model and a genetic-algorithm search.
Developed at SPACE MAKERS Lab as part of a research internship.
Designing a patch antenna to resonate at a target frequency normally means repeatedly adjusting its dimensions and re-running a full-wave simulation in a tool like Ansys HFSS — where each run takes minutes and reaching a good design can take dozens of iterations. It is slow, manual, and experience-dependent.
This project automates that loop in three stages:
- Surrogate model (forward). A Random Forest is trained on HFSS-simulated data to predict an antenna's reflection coefficient (S11) from its geometry — instantly, instead of running a full simulation.
- Genetic algorithm (inverse). A GA searches the design space, using the surrogate as a fast fitness function, to find the geometry that best meets a target (a deep match at 2.45 GHz).
- Validation (closing the loop). The GA's chosen design is re-simulated in HFSS — and then fabricated and measured on a Vector Network Analyzer — to confirm it works on real hardware, not just in the model.
HFSS data -> Random Forest surrogate -> Genetic algorithm -> Best geometry -> Re-simulate + fabricate + measure
(slow) (design -> S11, fast) (search / inverse) (validation)
| Metric | Value |
|---|---|
| Surrogate R² (honest, geometry-grouped split) | 0.84 ± 0.03 |
| GA-optimised geometry | l = 28.79 mm, w = 28.10 mm |
| Predicted S11 @ 2.45 GHz | −18.77 dB |
| HFSS-verified S11 @ 2.45 GHz | −15.49 dB |
Both predicted and verified show a strong impedance match at the 2.45 GHz target — the pipeline produces a design that works in the real solver and on fabricated hardware.
- Random Forest — the data is structured and low-dimensional (length, width, frequency), so a tree ensemble captures the non-linear S11 behaviour accurately with little data and no hyper-parameter fuss. It is also scale-invariant, so no feature normalisation is needed.
- GroupKFold validation — each geometry appears at many frequencies, so a random train/test split would leak near-identical rows into both sets and inflate the score. We hold out entire geometries to measure true generalisation.
- Voltage/power/phase dropped — for a single passive antenna these do not affect S11 or normalised gain (verified numerically to < 1e-10 dB). They only matter for multi-element arrays (future work).
src/
preprocess.py # load + clean datasets (drop voltage, de-duplicate)
surrogate.py # train Random Forest + geometry-grouped cross-validation
genetic_optimize.py # PyGAD inverse design against the surrogate
data/
README.md # dataset schema (raw CSVs are lab-generated)
results/ # figures (S11 sweep, design space, GA result)
models/ # saved surrogate (.pkl) after training
pip install -r requirements.txt
# 1. Train the surrogate and print honest cross-validation metrics
python src/surrogate.py data/s11_dataset.csv
# 2. Run the genetic-algorithm inverse design
python src/genetic_optimize.pyPython · scikit-learn · PyGAD · pandas · NumPy · Ansys HFSS 2025 R2
- Complete the gain dataset across geometries → multi-objective optimisation (S11 + gain).
- Extend to a two-element array, where phase and voltage steering matter.
- Optimise for wider impedance bandwidth rather than a single-frequency match.
- I. Merino-Fernandez, J. del Pino, S. Khemchandani, "Design of rectangular patch antennas through machine learning," Scientific Reports 15:33605 (2025).
- D. Sarkar et al., "Application of Genetic Algorithm and Deep Neural Network for UWB Antennas," URSI AT-RASC (2024).
- A. Gupta et al., "Radiation Pattern Synthesis of a Millimeter-Wave Array Antenna using Deep Learning," ICIIP (2025).
Developed during a research internship at SPACE MAKERS Lab. Antenna simulation, fabrication, and VNA measurement were a collaborative effort; this repository focuses on the machine-learning pipeline.
