Toward a Mode-Aware Electromagnetic World Model for Microstrip Patch Antennas
Physics-structured neural models for patch antennas: a pole–residue network that beats the published HFSS benchmark by about 41% with zero passivity violations, an open-source solver validated against HFSS, and field prediction that learns corrections to physics.
Research report · İbrahim Çoban · November 2026
Neural surrogates for antennas usually map a handful of design parameters to a performance curve such as S11(f). A world model for electromagnetics would instead represent the physical state itself, i.e. the fields and currents, and how that state responds to changes in geometry, materials and excitation. Before building one, three things are needed:
a clear picture of what existing surrogates achieve, and why;
a trustworthy, open source of full-wave field data;
evidence for a good latent representation.
This report works through all three. It builds on the open METU-SIMPL dataset of 5000 HFSS simulations and the thesis that accompanies it.
In short:
An independent MLP with cavity-model features and the thesis' knowledge-based regularizers reaches RSE 0.050 / 0.051 (Re/Im). That is on par with the thesis' unregularized STCNN, but not its best model.
A re-implementation of the STCNN reproduces the effect of the regularizers but not its absolute accuracy.
About half of the in-band resonances turn out to be TM20 and TM02, not TM10.
An openEMS rebuild of the HFSS model places single-mode resonances within 0.10–0.15 GHz of HFSS on a 50-design benchmark.
A cavity-mode basis chosen from the patch geometry alone, with no field data, captures 99.4% of the field energy with ten modes.
The published S11 benchmark is beaten on a sealed test. A pole–residue network found by an autonomous, sandboxed search scores RSE 0.0249 / 0.0251 (Re/Im) as a single model and 0.0225 / 0.0227 as a 5-model ensemble. The published best is 0.042 / 0.043. It wins on all 5 test splits, with 0% passivity violations.
Predicting the fields of unseen designs, learning small corrections to a physical resonator model beats neural networks trained from scratch. The error drops from 0.58 to 0.36 with 20 training designs, and from 0.46 to 0.30 on patches larger than any seen in training.
1. Dataset and reference HFSS model
The METU-SIMPL Microstrip-Patch repository accompanies Saçın and Durgun (Neural Computing and Applications, 2025) and Saçın's MSc thesis (METU, 2023). It contains the data and the HFSS project, but no model code.
Size: 5000 designs, Latin-hypercube sampled.
Inputs: 11 parameters:
patch length and width (1.8–5.2 mm);
conductor thickness;
substrate height (0.1–0.8 mm);
solder-resist height;
probe radius;
pad and anti-pad clearances;
feed offset c = x_probe / L (0.05–0.45);
two permittivities (2–5).
Output: complex S11 at 201 points, 23–33 GHz in 0.05 GHz steps.
Resonances: about 26% of designs have a clear in-band resonance (below −10 dB).
The following facts come from the HFSS project file and matter for modelling:
the probe sits at x = −c·L, so the offset is measured from the patch centre;
the board is a finite 10 × 10 mm board covered by solder resist;
the dielectrics are lossless;
excitation is a 50 Ω terminal lumped port on the pad/anti-pad annulus, without de-embedding;
the radiation boundary lies 4.35 mm from the board.
The 1465-sample, mode-labelled dataset used for the cavity-model network in Chapter 4 of the thesis is not public.
2. S11 surrogate baselines
The protocol follows the thesis:
a random 4000/1000 train/test split per seed;
a fixed training schedule, with the model taken at the last epoch, so nothing is selected on the test set;
the thesis metric, RSE: the per-sample relative squared error, computed separately for Re S11 and Im S11 and averaged over test designs.
Additional metrics are the dB error, the reflected-power error, the resonance errors, and passivity violations (any |S11| > 1).
Models and losses:
Models: an MLP; a DeepONet-style frequency operator; a mean-curve baseline and a shuffled-target control.
Losses: MSE or Huber, plus the thesis' derivative, filtered-FFT (F-FFT) and magnitude regularizers, used with the thesis' weights.
Optional inputs: closed-form cavity-model features.
| Model | RSE Re | RSE Im | |S11| dB MAE | passivity violations |
|---|---|---|---|---|
| Mean-curve baseline | 21.2 | 5.42 | 4.00 | 0% |
| Shuffled-target control (1 seed) | 28.4 | 9.13 | 3.12 | – |
| MLP, MSE | 0.068 ± 0.008 | 0.068 ± 0.004 | 0.400 ± 0.013 | 24% |
| Frequency operator, MSE | 0.064 ± 0.007 | 0.067 ± 0.002 | 0.405 ± 0.025 | 23% |
| MLP, Huber | 0.060 ± 0.007 | 0.060 ± 0.003 | 0.377 ± 0.019 | 20% |
| MLP, Huber + F-FFT + magnitude | 0.054 ± 0.006 | 0.055 ± 0.007 | 0.344 ± 0.009 | 16% |
| MLP + cavity features, Huber + F-FFT + magnitude | 0.050 ± 0.009 | 0.051 ± 0.007 | 0.324 ± 0.020 | 16% |
| Our STCNN, Huber (3 seeds) | 0.074 ± 0.009 | 0.077 ± 0.017 | 0.372 ± 0.005 | 11% |
| Our STCNN, Huber + F-FFT + magnitude (3 seeds) | 0.063 ± 0.013 | 0.064 ± 0.009 | 0.326 ± 0.024 | 6.5% |
| Thesis STCNN, Huber | 0.051 | 0.053 | – | 9.1% |
| Thesis STCNN, F-FFT + magnitude | 0.042 | 0.043 | – | 1.7% |
Mean ± 95% CI over 5 seeds unless noted.
All comparisons are paired: both models share the split and the initialization of each seed. The p-values come from a two-sided t-test on the per-seed differences. A hierarchical bootstrap, which resamples seeds and then test designs within each seed, gives the same conclusions.
Huber beats MSE (5/5 seeds, p ≈ 0.02).
Magnitude regularization helps, and so does F-FFT. Both agree with the thesis.
Derivative regularization with the thesis weights hurts in 5/5 seeds. The weights were tuned for the STCNN and do not transfer to our network; this is an untuned setting, not a refutation of the method.
Cavity features improve the MLP by −0.011 RSE (5/5 seeds, p < 0.001; bootstrap 95% CI [−0.014, −0.008]).
Resonant designs are harder: RSE 0.070 versus 0.043 on non-resonant ones. The best model places the resonance within 0.31 GHz but misses the dip depth by about 5 dB. The reflected-power error at the dip is only 0.025, because dB errors at deep dips come from tiny absolute differences.
The regularizers help most when data is scarce (the training-set-size curve has the same shape as the thesis').
Continuous frequency is not the same as generalization. With the 28–30 GHz band held out during training, the frequency operator does worse than linear interpolation of the MLP (complex MAE 0.30 vs 0.087). A natural next step is a pole–residue output layer, in the spirit of vector fitting.

3. Reproducing the STCNN
The thesis' spectral transposed CNN was re-implemented from its description:
an FCNN of 3 × 60 tanh units;
transposed convolutions with kernels (21, 7, 3) and strides (1, 3, 3), upsampling 1 → 21 → 67 → 201;
a learnable 51-point Gaussian smoothing filter;
Adam with learning rate 0.007, multiplied by 0.7 every 1000 epochs, for 3200 epochs;
Huber loss.
The thesis does not specify the intermediate channel counts or the batch size, so those were assumed.
Reproduced: the effect of the regularizers. RSE improves by 14.9%, versus 17.6% in the thesis. Passivity violations start from a similar level (10.6% vs 9.1%) and fall.
Not reproduced: the absolute accuracy. Our STCNN is about 0.02 RSE worse. Its passivity improvement is also weaker (6.5% vs 1.7%).
In our runs the plain MLP with cavity features beats our STCNN. Budgets are not equalized, so no architectural claim is made.
4. What the cavity model says
A closed-form cavity model was implemented, with each correction switchable:
effective permittivity and fringing extension (Hammerstad);
TMmn resonances;
edge resistance and Q;
probe inductance;
a parallel-RLC input impedance.
Four findings:
Feed position. A first version measured the feed offset from the patch edge, which inverted the feed resistance. The HFSS project measures it from the centre.
Higher-order modes. About half of the in-band resonances are not TM10. For large patches, TM10 lies below 23 GHz and the in-band dips are TM20 and TM02. Because the probe sits on the y-centreline, odd-n modes such as TM01 and TM11 are not excited.
Multi-mode model. A multi-mode model that accounts for feed coupling cuts the resonance error from 5.1 to 2.8 GHz. What remains is mostly a systematic downward shift of about 1 GHz in HFSS relative to the cavity prediction, consistent with probe inductance and solder-resist loading.
RLC curve. As a full S11 curve, the RLC prior is still poor. It is useful as input features, not as a base to learn a residual on.

5. An open-source solver, checked against HFSS
The HFSS project was rebuilt in openEMS (FDTD), running in Docker.
What it reproduces:
the finite lossless board and the solder resist;
the centre-referenced probe;
the air padding.
What it simplifies, measured below rather than assumed to be harmless:
zero-thickness conductors;
no pad/anti-pad structure;
a square probe;
the port: HFSS's annular port cannot be expressed in FDTD, so it is approximated by a PEC probe plus a short lumped port at the ground.
Mesh convergence. With the usual 1/3–2/3 rule at the patch edges, the resonance moves erratically as the mesh is refined. Placing mesh lines exactly on the edges gives monotonic convergence toward HFSS:
| Mesh (λ/N) | 15 | 20 | 30 | 40 | 50 | HFSS |
|---|---|---|---|---|---|---|
| Dip frequency (GHz) | 26.15 | 26.40 | 26.70 | 26.80 | 26.90 | 27.10 |
| Dip depth (dB) | −22.0 | −20.0 | −18.9 | −18.0 | −17.5 | −17.85 |

The 50-design benchmark uses ten random designs per category, with medians over designs reported below:
| Category | complex MAE | |S11| dB MAE | dip frequency error | dip depth error |
|---|---|---|---|---|
| TM10 | 0.153 | 0.63 | 0.10 GHz | 4.0 dB |
| TM20 | 0.149 | 0.77 | 0.10 GHz | 6.1 dB |
| TM02 | 0.129 | 0.90 | 0.15 GHz | 3.0 dB |
| Multi-resonance | 0.143 | 1.26 | 0.20 GHz | 6.5 dB |
| No resonance | 0.208 | 0.07 | – | – |

The phase offset. Most of the remaining complex error is a nearly constant phase offset of about 10°. Fitting a correction to each design separately would make the two solvers look closer than they are. So each correction is fitted on calibration designs and tested on different designs:
| Category | raw | after one global phase correction (held-out) |
|---|---|---|
| TM10 | 0.153 | 0.085 |
| TM20 | 0.150 | 0.082 |
| TM02 | 0.136 | 0.096 |
| Multi-resonance | 0.166 | 0.158 |
| No resonance | 0.211 | 0.084 |
A single global rotation of −8.6° transfers to new designs. It cuts the overall error from 0.163 to 0.102.
It does not help multi-resonance designs. There the difference lies in where the resonances fall, not in phase.
It is not a reference-plane delay. A delay term adds nothing, so its physical cause is still open.
It is an S-parameter calibration only and must not be applied to field data.
6. Field export
The pipeline exports at selected frequencies:
complex E and H over the board region;
the port voltage and current;
the incident and accepted power.
The surface current on the patch follows from the jump in H across it.
Two sanity checks pass:
Power balance: accepted over incident power equals 1 − |S11|² at every frequency.
Current patterns: TM10 currents run along x and TM02 currents along y, with the expected concentration at the edges.
For learning, every snapshot is normalized by the incident port voltage, so that amplitude and phase share one physical reference across designs.
7. Are a few modes enough?
For one design from each single-mode family, the field under the patch (E_z at mid-substrate) is projected onto cavity modes cos(mπx/L)·cos(nπy/W). The dominant mode found this way matches each design's category. That is an independent check of the classification in Section 4.

Four bases are compared, each on a design it has not seen:
oracle: the best K cavity modes, picked per snapshot from the true field;
fixed set: the K cavity modes with the most energy on the other designs;
POD: a basis learned from the other designs;
geometry only: the K lowest-frequency cavity modes the probe can excite, computed from L and W alone, with no field data.
| K | cavity, oracle selection | cavity, fixed from other designs | POD from other designs | cavity, geometry only |
|---|---|---|---|---|
| 1 | 0.793 (46%) | 0.036 (98%) | 0.089 (95%) | 0.049 (98%) |
| 3 | 0.957 (21%) | 0.332 (82%) | 0.381 (79%) | 0.795 (45%) |
| 6 | 0.988 (11%) | 0.973 (16%) | 0.932 (26%) | 0.981 (14%) |
| 10 | 0.994 (8%) | 0.991 (10%) | 0.989 (10%) | 0.994 (8%) |
| 20 | 0.995 (7%) | 0.995 (7%) | 0.996 (6%) | 0.995 (7%) |
Captured energy; relative L2 error in brackets. 3 designs, 33 snapshots.
Ten modes chosen from the geometry alone, with no field data, do as well as an oracle that looks at the field.
The fields are sparse in the cavity family.
Which modes are active depends on the design, so a basis fitted to other designs transfers poorly when K is small.
A geometry-conditioned basis needs no data at all and matches the oracle at K = 10.
Every basis plateaus near 7% error, mostly from the field right around the probe. That points to a hybrid representation: modes for the global field, plus a small neural correction for the local one.
8. Learning corrections to physics, not physics from scratch
The final experiment asks the question a world model has to answer: given the 11 design parameters and a frequency, predict the field under the patch of a design the model has never seen.
The data is a new 100-design openEMS field dataset:
20 designs per category, disjoint from the solver benchmark;
1583 complex field snapshots, with extra frequencies around each resonance.
The test set is fixed at 20 designs. Training sets have 10, 20, 40, 60 or 80 designs, with 5 seeds each. The metric is the shape error: the relative error after the best complex scale. Absolute amplitude is a separate port problem, because the cavity relation between port voltage and feed field holds only approximately (within a factor of about 0.6–0.7 and ±40°).
The physics layer. Each cavity mode k is a resonator:
a_k = b_k · e^β / (f̃_k² − f² + j·f̃_k·f / Q̃_k), with f̃_k = s_f · f_k · e^δ and Q̃_k = s_Q · Q · e^q
The frequencies f_k, the quality factor Q and the feed coupling b_k come from the cavity model. The models climb a ladder, from no learning to learned corrections of δ, q and β:
M0: pure cavity model.
M1: two global numbers, s_f and s_Q.
M2: a linear correction.
M3: a small network correcting frequency and Q.
M4: a small network correcting frequency, Q and coupling.
M5: M4 plus a small field residual.
Corrections start at zero, so every model begins as M1 and only moves away from physics when the data supports it. The baselines learn from scratch: a direct MLP, POD + MLP, and an MLP predicting free cavity coefficients.

| Model | 10 designs | 20 | 40 | 60 | 80 |
|---|---|---|---|---|---|
| Oracle projection (ceiling) | 0.069 | 0.069 | 0.069 | 0.069 | 0.069 |
| M0 cavity, no learning | 0.573 | 0.573 | 0.573 | 0.573 | 0.573 |
| M1 two global parameters | 0.435 | 0.432 | 0.422 | 0.428 | 0.424 |
| M2 linear correction | 0.563 | 0.479 | 0.330 | 0.283 | 0.268 |
| M4 network correction | 0.469 | 0.401 | 0.342 | 0.296 | 0.283 |
| M5 = M4 + field residual | 0.455 | 0.358 | 0.294 | 0.246 | 0.220 |
| Direct MLP | 0.697 | 0.578 | 0.450 | 0.312 | 0.246 |
| POD + MLP | 0.688 | 0.640 | 0.498 | 0.379 | 0.283 |
| Cavity + MLP, free coefficients | 0.860 | 0.830 | 0.685 | 0.590 | 0.494 |
Out of distribution. Holding out the 20 largest patches (training on the rest):
| Model | shape error | phase error |
|---|---|---|
| M2 linear correction | 0.309 | 7.2° |
| M5 network correction + residual | 0.300 | 8.8° |
| Direct MLP | 0.464 | 16.9° |
| POD + MLP | 0.522 | 20.5° |
A correct basis is not enough. What generalizes is the resonant structure of the coefficients.
The basis alone does not generalize. Free coefficients over the cavity basis are the worst learned model at every size, even though the same basis reconstructs the fields to 7% error.
With 10 designs, two physical numbers beat every network. Every correction overfits at that size.
With 20–40 designs, learned corrections win clearly: 35–38% lower error than the direct MLP.
The advantage narrows with data. At 80 designs the direct MLP (0.246) comes close to the hybrid (0.220), which is what a physics prior should do.
Physics extrapolates. On patches larger than any in training, the hybrid models are about 35% better and halve the phase error.
The weak link is the probe–mode coupling. Correcting only frequency and Q helps little; correcting the coupling gives most of the gain.
Two caveats. The fitted global frequency scale (s_f = 0.93, about −2 GHz at 28 GHz) is larger than the S11 dip shift, because the dip is also moved by the probe reactance. And multi-resonance designs remain the hardest group for every model.
9. Beating the published S11 benchmark
The last experiment returns to where this work started: the HFSS dataset of the thesis and its published result. The question is whether the lesson of Section 8, to put the physics of resonance inside the model, also holds for S11.
How the search was run. We ran an autonomous experiment loop, inspired by Karpathy's autoresearch, on one laptop. It ran for 6.6 hours, made 812 runs and had 8 crashes. The safeguards:
Fixed protocol and metric. The data splits and the thesis metric live in files locked by checksums.
Isolated experiments. Each experiment runs in its own sandboxed process, with no access to the dataset files, no network and no write access to the code.
Sealed test labels. Models were selected on a validation set carved from the training designs, then confirmed with 5-fold cross-validation.
One look at the test. The test set was opened exactly once, at the end, using the thesis protocol: train on 4000 designs, test on 1000, last epoch, 5 random splits.
What was searched. The search compared seven output structures:
a direct 201-point head;
a pole–residue (rational) head, where each resonance is a pole;
passive impedance and Foster RLC heads;
cavity-initialized variants;
the STCNN.
Input features, losses, a hard |S11| bound and the optimization settings were searched too.

What won. The pole–residue head took over within the first twenty experiments and kept improving:
8 poles plus a small residual curve;
a 512×3 network on the 11 parameters plus cavity and multi-mode cavity features;
the thesis' own Huber + F-FFT + magnitude losses;
weight averaging (EMA);
|S11| bounded by 0.999.
It has 766k parameters.
| Model (sealed test, mean of 5 splits) | parameters | RSE Re | RSE Im | passivity violations |
|---|---|---|---|---|
| Pole–residue network (ours, single model) | 766k | 0.0249 (worst split 0.0275) | 0.0251 (worst split 0.0284) | 0% |
| Pole–residue network (ours, 5-model ensemble) | 3.8M | 0.0225 | 0.0227 | 0% |
| Larger variant without the bound (5-model ensemble) | 10.8M | 0.0220 | 0.0219 | 1.4% |
| Published STCNN, best (thesis Table 3.7, one split) | not reported | 0.042 | 0.043 | 1.7% |
| Published STCNN, unregularized | not reported | 0.051 | 0.053 | 9.1% |
| Our earlier best (MLP + cavity features) | 1.0M | 0.050 | 0.051 | 16% |
The same loss functions, a different output structure: about 41% lower error than the published model, on every test split.
Large margin. The error is about 41% below the published best, and the worst of the 5 test splits is still far below it.
No passivity violations. The bound on |S11| holds at every frequency the model is evaluated at. It is a constraint on the output, not a proof that an underlying circuit is passive.
Ensembles help further. Averaging five networks gives 0.0225 / 0.0227 with still 0% violations, about 47% below the published best.
Not a lucky configuration. All three cross-validated candidates land within 0.0219–0.0251 on every split.
The engineering errors halve too. On the same test designs as our earlier best model:
resonance-frequency error drops from 0.31 to 0.20 GHz;
dip-depth error drops from 4.9 to 2.7 dB;
the design-level paired error reduction is 50–56% (95% bootstrap interval excludes zero; 5/5 splits better).
The search's own verdict on structure. On identical cross-validation folds, the winning structure cut the error of our earlier best model by 53% (0.0631 → 0.0296).
Passive-by-construction models improved but did not win. The Foster RLC family beat the old baseline on validation (about 0.046–0.050 vs 0.059) with passivity guaranteed by construction. It stayed well behind the pole–residue network, which remains an open direction.
10. Limitations and next steps
Limitations:
The STCNN's absolute accuracy is not reproduced; our pole–residue network beats the published number instead.
The S11 result still needs a blind benchmark on new HFSS designs.
The openEMS model simplifies conductors and the port, and the cause of the phase offset is unknown.
The modal pilot rests on three designs.
Field prediction is evaluated on 100 openEMS designs, for E_z under the patch only, with a scale-invariant metric.
Next steps:
Absolute amplitude. Couple the field model to the port, using the S11 surrogate to supply the port voltage.
Richer physics before richer networks. Add mode-dependent permittivity, probe reactance and mode coupling to the resonator layer.
Beyond E_z under the patch. Fringing fields, H, surface currents, far fields, and arbitrary patch shapes through numerically computed eigenmodes.
The port phase offset.
Dynamics. A modal state-space model with learned parameters, dz/dt = A(g)·z + B(g)·u, as the route to a time-domain world model.
Sources. E. S. Saçın, Microstrip Patch Antenna Modeling With Knowledge-Based Neural Networks, MSc thesis, METU, 2023. E. S. Saçın and A. C. Durgun, "Microstrip patch antenna modeling using neural networks with knowledge-based regularization," Neural Computing and Applications, 2025. METU-SIMPL, Microstrip-Patch dataset. T. Liebig et al., "openEMS – a free and open source equivalent-circuit (EC) FDTD simulation platform," Int. J. Numerical Modelling, 2013. C. A. Balanis, Antenna Theory: Analysis and Design, 4th ed., Wiley, 2016. E. O. Hammerstad, "Equations for microstrip circuit design," European Microwave Conference, 1975. P. J. Huber, "Robust estimation of a location parameter," Annals of Mathematical Statistics, 1964. L. Lu et al., "Learning nonlinear operators via DeepONet," Nature Machine Intelligence, 2021. B. Gustavsen and A. Semlyen, "Rational approximation of frequency domain responses by vector fitting," IEEE Trans. Power Delivery, 1999.
