haoliuarena commited on
Commit
434c9b4
·
verified ·
1 Parent(s): b500042

Card and protocol revision (#1496): rotating board and near-field views; v0 statistics

Browse files
PROTOCOL.md CHANGED
@@ -1,76 +1,77 @@
1
- # Evaluation protocol
2
 
3
- How submissions to the benchmarks are scored. The reference implementation in `emval/metrics.py` is the specification — this document explains it; where prose and code could ever disagree, the code wins. Protocol version: 1.0.0.
4
 
5
- ## Aggregation
6
 
7
- Every metric reduces one board to one scalar, then boards are averaged with equal weight — the board is the unit of generalization, so a board with many ports or probes counts no more than a small one. For the near-field metrics, all of the board's probes are pooled across its driven ports and frequencies before the reduction.
8
 
9
- Reported per split (`public`, `private_standard`, `private_challenge`); the public scorer also breaks results down by port count.
10
 
11
- ## EMVal-SP-v1 metrics
12
 
13
- For one board, let $S_{ijf}$ be the true complex S-parameter (output port $i$, driven port $j$, frequency $f$), $\hat S_{ijf}$ the prediction, and $N$ the number of $(i,j,f)$ entries.
14
 
15
- `real_imag_rmse` — error in the complex plane, linear scale:
 
 
 
 
16
 
17
  $$
18
- \mathrm{rmse} = \sqrt{\frac{1}{2N} \sum_{ijf} \left[ (\Re\hat S - \Re S)^2 + (\Im\hat S - \Im S)^2 \right]}
19
  $$
20
 
21
- The $\tfrac{1}{2}$ averages over the real and imaginary components, so the number reads as a per-component RMS deviation. A small numerical floor under the square root means a perfect submission scores $10^{-4}$, not 0.
22
 
23
- `mag_wmae` — weighted mean absolute error of the magnitude in dB. With $M = 20\log_{10}|S|$, $\hat M = 20\log_{10}|\hat S|$, and a sigmoid gate
24
 
25
  $$
26
- w_{ijf} = \sigma\!\left(\frac{M_{ijf} - N_0}{\tau}\right), \qquad N_0 = -20\ \mathrm{dB},\ \tau = 2\ \mathrm{dB},
27
  $$
28
 
29
- $$
30
- \mathrm{mag\_wmae} = \frac{\sum_{ijf} w_{ijf}\, |\hat M_{ijf} - M_{ijf}|}{\sum_{ijf} w_{ijf}}.
31
- $$
32
 
33
- `ph_wmae` — the same weighted mean over phase error, wrapped to one period so a $-179^\circ$ vs $+179^\circ$ disagreement counts as $2^\circ$, not $358^\circ$:
34
 
35
  $$
36
- \mathrm{ph\_wmae} = \frac{\sum_{ijf} w_{ijf}\, \left|\mathrm{wrap}(\arg\hat S_{ijf} - \arg S_{ijf})\right|}{\sum_{ijf} w_{ijf}}, \qquad \mathrm{wrap}(\theta) = \mathrm{atan2}(\sin\theta, \cos\theta).
37
  $$
38
 
39
- Why the gate: S-parameter sweeps contain deep nulls — frequencies where $|S|$ drops tens of dB below unity. At a null, magnitude in dB and phase are numerically defined but physically irrelevant: a 3 dB error at $-60$ dB changes nothing an engineer cares about, while the same error at $-3$ dB is a different circuit. An ungated dB/phase MAE would let nulls dominate the score. The sigmoid keeps full weight on entries near 0 dB, rolls off smoothly around $-20$ dB, and effectively removes entries far below it — and the *true* magnitude drives the gate, so a submission cannot influence its own weighting. Phase uses the same gate so both numbers describe the same population of entries. `real_imag_rmse` stays ungated as the complement: in the linear complex plane, nulls are near zero and contribute naturally little.
40
 
41
- ## EMVal-NF-v1 metrics
42
 
43
- For one board, let $\mathbf{E}_p \in \mathbb{C}^3$ be the true field at probe $p$, where $p$ runs over the board's pooled probe set — every probe at every driven port and frequency, $P$ in total — and $\hat{\mathbf{E}}_p$ the prediction; identically for $\mathbf{H}$. Three metrics per field axis, each answering a different question; each is one reduction over the pooled set.
44
 
45
- `rel_l2_E`, `rel_l2_H` — relative L2 error over the board's pooled probes:
 
 
46
 
47
  $$
48
- \mathrm{rel\_l2} = \frac{\left( \sum_p \lVert \hat{\mathbf{E}}_p - \mathbf{E}_p \rVert_2^2 \right)^{1/2}}{\left( \sum_p \lVert \mathbf{E}_p \rVert_2^2 \right)^{1/2}}.
49
  $$
50
 
51
- The numerator sums squared absolute errors and the normalization happens once at the end, so the metric is dominated by the probes where the true field is large — it asks "is the field right where the field is large". Pooling across frequencies means high-field frequencies dominate low-field ones for the same reason.
52
 
53
- `local_q50_E`, `local_q50_H` — the median over the pooled probes of the per-point relative error:
54
 
55
  $$
56
- e_p = \frac{\lVert \hat{\mathbf{E}}_p - \mathbf{E}_p \rVert_2}{\lVert \mathbf{E}_p \rVert_2}, \qquad \mathrm{local\_q50} = \mathrm{median}_p\, e_p.
57
  $$
58
 
59
- Each probe is normalized by its own magnitude, so weak-field regions count as much as strong ones — fields span many orders of magnitude, and a model can score well on `rel_l2` while being badly wrong wherever the field is small. The median (rather than a mean) keeps the handful of probes sitting on near-zero true field, where $e_p$ blows up, from dominating.
60
-
61
- `local_cos_q50_E`, `local_cos_q50_H` — the median per-point complex direction cosine over the pooled probes:
62
 
63
  $$
64
- c_p = \frac{\Re\left( \hat{\mathbf{E}}_p \cdot \mathbf{E}_p^{*} \right)}{\lVert \hat{\mathbf{E}}_p \rVert_2\, \lVert \mathbf{E}_p \rVert_2}, \qquad \mathrm{local\_cos\_q50} = \mathrm{median}_p\, c_p.
65
  $$
66
 
67
- $c_p = 1$ means the predicted field vector points the right way *and* has the right phase at that probe, independent of its magnitude; 0 is uncorrelated, $-1$ anti-phase. This separates "right direction, wrong scale" from "wrong field".
68
 
69
- Roll-ups: `rel_l2_avg` is the mean of `rel_l2_E` and `rel_l2_H`, and likewise `local_q50_avg`, computed after the per-board mean.
70
 
71
- ## Reading the numbers
 
 
72
 
73
- - `rel_l2_*` and `local_q50_*`: lower is better; 0 is perfect.
74
- - `local_cos_q50_*`: higher is better; 1 is perfect.
75
- - `real_imag_rmse` (linear), `mag_wmae` (dB), `ph_wmae` (radians): lower is better.
76
- - Labels are simulation outputs with a finite noise floor — read errors against that floor, not against zero.
 
1
+ # EMVal evaluation protocol
2
 
3
+ Protocol version: `1.0.0`.
4
 
5
+ EMVal evaluates models of time-harmonic electromagnetic behavior. `EMVal-NF` measures complex near-field predictions, and `EMVal-SP` measures complex S-parameter predictions.
6
 
7
+ ## Evaluation subsets and aggregation
8
 
9
+ EMVal separates in-distribution (ID) boards from out-of-distribution (OOD) boards by geometry family, where an ID board belongs to a design family that is included in model training, and an OOD board belongs to a design family that is excluded from model training. Regardless of whether a board geometry in our evaluation sets is ID or OOD, it is NOT included in the model training set. The `public` and `private_standard` groups are ID. The `private_challenge` group is OOD.
10
 
11
+ Each metric is computed for one board. The dataset-level value is the equal-weight mean of the board values. Thus, a board with more ports or probes does not receive more weight. Near-field metrics pool all excited ports, frequencies, and probes within each board before the board-level reduction.
12
 
13
+ ## Metrics
14
 
15
+ ### EMVal-NF
16
+
17
+ For a board excited at port $j$ and frequency $f$, let $\mathbf{F}_{jfp}\in\mathbb{C}^3$ be the simulated field vector at probe $p$, and let $\hat{\mathbf{F}}_{jfp}$ be the prediction. Here, $\mathbf{F}$ is either the electric field $\mathbf{E}$ or the magnetic field $\mathbf{H}$.
18
+
19
+ The global relative $L_2$ error compares total error energy with total simulated field energy across every excited port, frequency, and probe:
20
 
21
  $$
22
+ \operatorname{rel}L_2(\mathbf{F}) = \frac{\sqrt{\sum_{jfp}\lVert\hat{\mathbf{F}}_{jfp}-\mathbf{F}_{jfp}\rVert_2^2}}{\sqrt{\sum_{jfp}\lVert\mathbf{F}_{jfp}\rVert_2^2}}.
23
  $$
24
 
25
+ The scorer reports `rel_l2_E` and `rel_l2_H`. Because the metric sums squared absolute errors before normalization, it gives more weight to regions where the simulated field is strong. Lower values are better, and 0 is the optimum.
26
 
27
+ The median local error normalizes the error at each probe by the simulated field magnitude and then takes the median:
28
 
29
  $$
30
+ \operatorname{local\text{-}q_{50}}(\mathbf{F}) = \operatorname{median}_{jfp}(e_{jfp}), \qquad e_{jfp} = \frac{\lVert\hat{\mathbf{F}}_{jfp}-\mathbf{F}_{jfp}\rVert_2}{\lVert\mathbf{F}_{jfp}\rVert_2}.
31
  $$
32
 
33
+ The scorer reports `local_q50_E` and `local_q50_H`. The local normalization gives low- and high-magnitude probes equal influence. The median limits the effect of a small number of large errors. Lower values are better, and 0 is the optimum.
 
 
34
 
35
+ The median local alignment measures the alignment of the predicted and simulated complex vectors at each probe:
36
 
37
  $$
38
+ \operatorname{local\text{-}cos\text{-}q_{50}}(\mathbf{F}) = \operatorname{median}_{jfp}(c_{jfp}), \qquad c_{jfp} = \frac{\operatorname{Re}\!\left(\sum_{k=1}^{3}\hat F_{jfp,k}F_{jfp,k}^{*}\right)}{\lVert\hat{\mathbf{F}}_{jfp}\rVert_2\lVert\mathbf{F}_{jfp}\rVert_2}.
39
  $$
40
 
41
+ The scorer reports `local_cos_q50_E` and `local_cos_q50_H`. A value of 1 means that the prediction is aligned with the simulated vector in direction and complex phase. Higher values are better, and 1 is the optimum.
42
 
43
+ The scorer also reports two field-average values. `rel_l2_avg` is the arithmetic mean of the dataset-level `rel_l2_E` and `rel_l2_H` values. `local_q50_avg` is the corresponding mean of `local_q50_E` and `local_q50_H`.
44
 
45
+ ### EMVal-SP
46
 
47
+ For one board, let $S_{ijf}\in\mathbb{C}$ be the true S-parameter for receiving port $i$, excited port $j$, and frequency $f$. Let $\hat S_{ijf}$ be the prediction, and let $N$ be the number of $(i,j,f)$ entries.
48
+
49
+ The real-and-imaginary RMSE is
50
 
51
  $$
52
+ \operatorname{riRMSE} = \sqrt{\frac{1}{2N}\sum_{ijf}\left[\left(\operatorname{Re}(\hat S_{ijf}-S_{ijf})\right)^2+\left(\operatorname{Im}(\hat S_{ijf}-S_{ijf})\right)^2\right]}.
53
  $$
54
 
55
+ The scorer reports this value as `real_imag_rmse`. The factor $2N$ treats the real and imaginary parts as separate dimensions. Lower values are better, and the mathematical optimum is 0.
56
 
57
+ For the magnitude weighted-MAE, define $M=20\log_{10}|S|$, $\hat M=20\log_{10}|\hat S|$, and
58
 
59
  $$
60
+ w_{ijf} = \sigma\!\left(\frac{M_{ijf}-N_0}{\tau}\right), \qquad N_0=-20\ \mathrm{dB}, \qquad \tau=2\ \mathrm{dB}.
61
  $$
62
 
63
+ Then
 
 
64
 
65
  $$
66
+ \operatorname{mag\text{-}wMAE} = \frac{\sum_{ijf}w_{ijf}|\hat M_{ijf}-M_{ijf}|}{\sum_{ijf}w_{ijf}}.
67
  $$
68
 
69
+ The scorer reports this value as `mag_wmae` in dB. The sigmoid weight uses the simulated magnitude and reduces the contribution of deep nulls, where magnitude error in dB has limited engineering significance. Lower values are better, and 0 is the optimum.
70
 
71
+ The phase weighted-MAE applies the same magnitude-derived weights to the shortest angular distance between the predicted and simulated phases:
72
 
73
+ $$
74
+ \operatorname{phase\text{-}wMAE} = \frac{\sum_{ijf}w_{ijf}\left|\operatorname{wrap}_{[-\pi,\pi]}(\hat\phi_{ijf}-\phi_{ijf})\right|}{\sum_{ijf}w_{ijf}}.
75
+ $$
76
 
77
+ The scorer reports this value as `ph_wmae` in radians. The magnitude weights prevent phase errors in deep nulls from dominating the metric. Lower values are better, and 0 is the optimum.
 
 
 
README.md CHANGED
@@ -1,7 +1,4 @@
1
  ---
2
- # HuggingFace dataset-card frontmatter. Citation and contact are placeholders pending sign-off;
3
- # the license is set to CC BY-NC 4.0 pending legal review. HDF5 is not a format the HF dataset viewer can read, so the viewer is
4
- # disabled deliberately rather than left to fail — see "Loading" below.
5
  pretty_name: "EMVal"
6
  license: cc-by-nc-4.0
7
  task_categories:
@@ -11,6 +8,7 @@ tags:
11
  - printed-circuit-board
12
  - surrogate-model
13
  - scientific-ml
 
14
  - physics
15
  size_categories:
16
  - n<1K
@@ -18,66 +16,70 @@ configs: []
18
  viewer: false
19
  ---
20
 
21
- # EMVal — PCB electromagnetic near-field and S-parameter benchmark
22
-
23
- DRAFT for internal review. Pending sign-off: license (CC BY-NC 4.0 under legal review), citation, contact.
24
 
25
  ## Motivation
26
 
27
- We are building a foundation model that understands electromagnetic fields — a model that, given a circuit-board design, predicts the physics a full-wave solver would compute, and with it helps solve downstream RF design tasks: see [RF Studio](https://www.arenaphysica.com/publications/rf-studio).
28
 
29
- We publish this dataset so the ML community can understand the problem concretely and engage with us on it. Each board is a complete, self-contained instance of the core task: given a printed-circuit-board geometry, predict the complex electromagnetic near fields on a dense probe cloud and the S-parameters at its ports.
30
 
31
  ## Composition
32
 
33
- Two benchmarks share one set of PCBs and differ only in what they label and score:
34
 
35
- | Benchmark | Label |
36
  |---|---|
37
- | `EMVal-NF-v0` | complex E and H near fields on a probe cloud |
38
- | `EMVal-SP-v0` | complex S-parameters at the ports |
39
 
40
- A model that predicts only one quantity uses only its benchmark's files; a model that predicts both is scored on both. The evaluation protocol and reference scorer live in the companion code repository (link pending) — metric definitions are code, not prose.
41
 
42
  ### This release: v0
43
 
44
- v0 is a demonstration release of 500 boards, all with labels (one split, `public`). What a board is, in this release:
45
 
46
- - Size: every board is 8 mm × 8 mm.
47
- - Stack-up: three layers — a 35 µm copper signal layer on top, a 200 µm dielectric core, and a 35 µm copper ground plane at the bottom. Two dielectric materials appear: a low-loss RF laminate on 281 boards (ε_r 3.55, loss tangent 0.0027, 203 µm) and an FR4-class laminate on 219 (ε_r 4.6, loss tangent 0.011, 200 µm). Copper is modelled with σ = 5.96 × 10⁷ S/m.
48
- - Components: planar copper traces and patches on the signal layer (transmission lines, filters, resonators, antennas); 103 boards have one port and 397 have two; 79 boards have plated vias to the ground plane, between 2 and 64 of them. No solder balls in v0.
49
- - Frequencies: 101 points from 1 GHz to 20 GHz, the same grid for the S-parameters and the near fields.
50
- - Fields: 10,000 probes per board in a 3D cloud around the whole board, two field vectors (E, H) per probe per frequency per driven port.
51
 
52
  | Split | Boards | Released | Size |
53
  |---|---|---|---|
54
  | `public` | 500 | designs and labels | ~41 GB (near fields), ~7 MB (S-parameters) |
55
 
56
- Later versions add larger board sets, more layer stacks and board types, and held-out splits whose labels stay private; the format does not change.
 
 
 
 
 
 
57
 
58
  ### Files per board
59
 
60
- `v0/public/boards/<design_id>/` contains three files. Everything is SI — metres, Hz, V/m, A/m, S/m — with the unit in the key name (`_m`, `_hz`) or an HDF5 attribute.
61
 
62
  | File | For | Contents |
63
  |---|---|---|
64
- | `design.json` | everyone | the authoritative geometry. ~2–5 KB of JSON |
65
  | `near_field.h5` | `EMVal-NF` | probe cloud, frequency grid, and the E/H labels. ~47–93 MB |
66
  | `sparams.h5` | `EMVal-SP` | frequency grid and the S-parameter labels. ~15 KB |
67
 
68
- Both HDF5 files carry the exact text of `design.json` as a `design_json` root attribute, so one file is a complete sample for its benchmark — an `EMVal-SP` user downloads a few MB for the whole split and never touches the field data.
69
 
70
  `design.json` keys:
71
 
72
  | Key | What it is |
73
  |---|---|
74
- | `size_m` | board extent `[x, y]` in metres |
75
- | `layers` | the stack-up, listed top to bottom: per layer its `index`, `type` (`metal`/`dielectric`), `subtype` (`signal`/`ground`/`core`), `thickness_m`, `material` (name, conductivity in S/m for metals; ε_r, loss tangent for dielectrics), and `shape` — the copper as a list of rectangles/polygons/circles in board coordinates |
76
- | `ports` | one entry per port: `name`, a `signal` pin and a list of `grounds` pins, each pin a `position`, `layer` and `width_m` — see "Ports and excitation" |
77
  | `vias` | plated vias: position, `diameter_m` (these are cylinders), spanned layers |
78
  | `solder_balls` | truncated-sphere solder balls (BGA boards; empty list in v0) |
79
 
80
- Geometry is published raw — no voxel grid, raster, or padded array is provided. How to encode geometry for a model is a research choice, and shipping one encoding would quietly privilege models that match it.
81
 
82
  `near_field.h5` (flat file, no groups):
83
 
@@ -90,7 +92,7 @@ Geometry is published raw — no voxel grid, raster, or padded array is provided
90
 
91
  Root attributes: `layout = "[excited_port, frequency, probe, xyz]"`, `E_units`, `H_units`, `coordinate_units`, `z_origin`, `design_id`, `design_json`, `labels_included`.
92
 
93
- The probes are a 3D cloud around the whole board, not a plane: they extend beyond the board edge in x and y and several millimetres below and above a stack that is itself only ~0.27 mm thick, and about a third of them lie inside the stack (in the dielectric, and inside copper where the field is ~0). One (port, frequency) pair is a snapshot; a 2-port board therefore ships 202 snapshots of 10,000 complex E and H vectors.
94
 
95
  `sparams.h5` (flat file):
96
 
@@ -99,83 +101,96 @@ The probes are a 3D cloud around the whole board, not a plane: they extend beyon
99
  | `frequencies_hz` | `[F]` float64 | Hz | the same grid as the near fields |
100
  | `real`, `imag` | `[P, P, F]` float32 | — | layout `[port_out, port_in, frequency]` |
101
 
102
- Root attributes: `layout`, `reference_impedance_ohm = 50.0`, `interpolated = false` (values are as-simulated, never resampled), plus the same identity attributes as above.
103
 
104
  `index.parquet` lists every board with `design_id`, `n_ports`, `n_frequencies`, `n_probes`, `labels`; `checksums.json` carries a SHA-256 per published file; `export_meta.json` records the export's provenance.
105
 
106
  ### What the data looks like
107
 
108
- One `public` board — a split-ring resonator, `design_id 534a8fe5…` — showing the copper, the dielectric, the ground plane, and both ports as a signal pin on the trace with its ground pin on the ground plane directly beneath:
109
 
110
- ![board geometry](assets/board.png)
111
 
112
- Its S-parameters — the `EMVal-SP` label. The ring resonates at 13.4 GHz, where transmission drops to −33 dB:
113
 
114
- ![S-parameters](assets/sparams.png)
115
 
116
- The `EMVal-NF` label for the same board: |E| over a subsample of the probe cloud, port 1 driven, at mid-band. The dynamic range spans many orders of magnitude:
117
 
118
- ![near field](assets/near_field.png)
119
 
120
  Reading actual values from this board, at the resonance (frequency index 65, 13.35 GHz):
121
 
122
  ```python
123
  >>> S = sparams["real"][:] + 1j * sparams["imag"][:] # (2, 2, 101)
124
- >>> S[0, 0, 65], S[1, 0, 65] # S11, S21: response at port i, port j driven
 
125
  ((-0.820-0.452j), (0.021-0.010j)) # |S11| = 0.94 (-0.6 dB), |S21| = 0.023 (-32.8 dB)
126
 
127
  >>> E = nf["E_real"][:] + 1j * nf["E_imag"][:] # (2, 101, 10000, 3)
 
128
  >>> E[0, 65, 7230] # port 1 driven, probe 7230 at (-0.68, -2.94, 0.23) mm
129
- array([ 0.7-3.1j, 1656-6613j, 969-3862j]) # (Ex, Ey, Ez) in V/m, |E| ≈ 7,900 V/m
130
- >>> abs(E[1, 65, 7230]).max() # same probe, port 2 driven
131
- 133. # 60x weaker: the ring blocks this frequency
132
  ```
133
 
134
- Probe 7230 sits just under the signal copper at the ring's edge — the field is dominated by the vertical and across-gap components, as a fringe field should be, and the port-2-driven value at the same point is what the −33 dB S21 predicts.
135
-
136
- Three properties of the data worth knowing before modelling it:
137
 
138
- - The S-parameter matrix is reciprocal: `S[0, 1, f] == S[1, 0, f]` on every board, as it must be for a passive structure. A model that predicts the full `[P, P, F]` block is not penalized for enforcing that.
139
- - These are near fields, not radiated waves. At the probe above, |E| / |H| ≈ 7,900 / 4.3 ≈ 1.8 kΩ, far from the 377 Ω of a plane wave in free space; the ratio varies by orders of magnitude across the probe cloud.
140
- - The field magnitude spans many decades within one snapshot — kilovolts per metre at trace edges, millivolts per metre away from the board, and ~0 inside copper. Relative and per-point metrics exist for this reason; see the protocol document.
141
 
142
  ### Coordinate system
143
 
144
  One right-handed frame is shared by the geometry and the field queries:
145
 
146
- - x, y: origin at the board centre; an 8 mm board spans −4 mm to +4 mm. Copper shapes in `design.json` and probe x/y in `near_field.h5` use the same axes.
147
  - z: `z = 0` at the bottom face of the bottom-most layer, +z upward — stated per file by the `z_origin = "bottom_of_stack"` attribute. `layers` in `design.json` are listed top to bottom, so the last-listed layer touches z = 0 and layer z-extents are recovered by stacking `thickness_m` upward from the bottom of the list.
148
- - A probe's field value is the total field at that point with the stated port driven.
149
 
150
  ## Ports and excitation
151
 
152
- A port's electrical definition cannot be expressed by geometry alone, so it is stated here. Every port in `design.json` has the same shape, whether its ground is the plane beneath the signal or one or more pads beside it:
153
 
154
  ```json
155
- {"name": "P1",
156
- "signal": {"position": {"x": 0.000899, "y": 0.001186}, "layer": 0, "width_m": 0.00045},
157
- "grounds": [{"position": {"x": 0.000899, "y": 0.001186}, "layer": 2, "width_m": 0.00045}]}
 
 
 
 
 
 
 
 
 
 
 
 
158
  ```
159
 
160
- - A port is a lumped port between its `signal` pin and its `grounds` pins: the excitation is applied across the gap from the ground pin(s) to the signal pin. A pin is a point on a conductor, given by `position` and `layer`; `width_m` is the port width at that pin. For a vertical launch onto a ground plane the face has the same width at both ends, so the ground pin carries the signal width; a coplanar ground pad carries its own.
161
- - In v0 every port is a vertical launch: the ground pin sits on the ground plane directly beneath the signal pin, so the excitation spans the dielectric between layer 0 and layer 2. Coplanar ports (ground pads on the same layer beside the signal) use the same schema with `grounds` on the signal's layer.
162
  - Reference impedance is 50 Ω (also an attribute on `sparams.h5`).
163
- - One port is driven at a time; every other port is terminated in the reference impedance. That excitation index is the leading axis of the field arrays: `E[k]` is the full E field everywhere with port k+1 driven. S-parameters follow the same convention: `S[i, j, f]` is the response at port i+1 with port j+1 driven.
164
- - Ports are numbered by their order in `ports`; `name` (`P1`, `P2`, …) matches that order.
165
 
166
- Anyone re-simulating a board under a different port convention will get different numbers from the same copper.
167
 
168
  ## Loading
169
 
170
- HDF5 is not a format HuggingFace's dataset viewer or `load_dataset()` can read, so the viewer is disabled and there is no `load_dataset` path. Download the files and read them directly — the same pattern [The Well](https://polymathic-ai.org/the_well/) uses for the same reason. Each benchmark needs only its own files:
171
 
172
  ```python
173
  from huggingface_hub import snapshot_download
174
  import h5py, json, pandas as pd
175
 
176
  # EMVal-SP: a few MB for the whole split
177
- root = snapshot_download(repo_id="ArenaPhysica/EMVal", repo_type="dataset",
178
- allow_patterns=["v0/public/boards/*/sparams.h5", "v0/public/index.parquet"])
 
 
 
179
  index = pd.read_parquet(f"{root}/v0/public/index.parquet") # design_id, n_ports, n_frequencies, n_probes
180
  design_id = index.design_id[0]
181
  with h5py.File(f"{root}/v0/public/boards/{design_id}/sparams.h5") as f:
@@ -184,11 +199,14 @@ with h5py.File(f"{root}/v0/public/boards/{design_id}/sparams.h5") as f:
184
  freqs = f["frequencies_hz"][:] # (F,) Hz
185
 
186
  # EMVal-NF: ~41 GB for the public split; narrow the pattern to a board id to fetch just one
187
- root = snapshot_download(repo_id="ArenaPhysica/EMVal", repo_type="dataset",
188
- allow_patterns=["v0/public/boards/*/near_field.h5", "v0/public/index.parquet"])
 
 
 
189
  with h5py.File(f"{root}/v0/public/boards/{design_id}/near_field.h5") as f:
190
  design = json.loads(f.attrs["design_json"])
191
- probes = f["probes_m"][:] # (N, 3) metres
192
  E = f["E_real"][:] + 1j * f["E_imag"][:] # (P, F, N, 3) V/m
193
  ```
194
 
@@ -196,10 +214,10 @@ Every file's SHA-256 is in `v0/public/checksums.json`, keyed by path relative to
196
 
197
  ## Uses
198
 
199
- Intended for training-free evaluation of field and S-parameter predictors. Out of scope: labels are simulation outputs, not measurements, and boards are synthetic rather than production designs.
200
 
201
- Do not train on any board in this dataset. Held-out splits in later versions exist to detect exactly that: a model that has seen the public boards scores conspicuously better on them than on a private split drawn from the same distribution. Published results carry a disclosure field.
202
 
203
  ## Distribution and maintenance
204
 
205
- A version never mutates; changes ship as a new version with a changelog. Maintained by Arena (contact pending). Licensed under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/): use and redistribution with attribution, no commercial use.
 
1
  ---
 
 
 
2
  pretty_name: "EMVal"
3
  license: cc-by-nc-4.0
4
  task_categories:
 
8
  - printed-circuit-board
9
  - surrogate-model
10
  - scientific-ml
11
+ - physics-foundation-model
12
  - physics
13
  size_categories:
14
  - n<1K
 
16
  viewer: false
17
  ---
18
 
19
+ # EMVal
 
 
20
 
21
  ## Motivation
22
 
23
+ Full-wave simulation gives electronic design its most faithful account of electromagnetic (EM) behavior, but at a cost that compounds with every geometry, material stack, port configuration, and frequency of interest. This scaling makes simulation a persistent bottleneck in design-space exploration. Physics foundation models have the potential to reduce this cost dramatically. Trained on a large and diverse set of simulated designs, they can predict responses for new designs quickly and at low cost.
24
 
25
+ EMVal is a benchmark suite designed to assess the quality of the predictions from such models. Given the three-dimensional geometry and material composition of a printed circuit board (PCB), together with a specified port excitation and frequency, a model must recover the board's complex time-harmonic response. The suite evaluates that response at two complementary levels: the electric and magnetic near fields, which expose the spatial structure of the solution, and the scattering parameters, which describe how incident waves are reflected and transmitted at the board's ports.
26
 
27
  ## Composition
28
 
29
+ The suite has two tracks over the same set of PCB structures:
30
 
31
+ | Track | Evaluation target |
32
  |---|---|
33
+ | `EMVal-NF-v0` | complex electric and magnetic near fields at three-dimensional probe locations; this is the primary foundation-model target |
34
+ | `EMVal-SP-v0` | complex S-parameters across frequencies and port pairs; this is a downstream response-prediction task |
35
 
36
+ A model can enter either track or both tracks. Each metric is first computed for one board and is then averaged across boards with equal weight. The companion evaluation repository contains `PROTOCOL.md` and the reference scorer (link pending).
37
 
38
  ### This release: v0
39
 
40
+ v0 is a public demonstration release of 500 labeled boards. It contains one split, `public`.
41
 
42
+ - **Size**: every board has an 8 mm × 8 mm footprint.
43
+ - **Stack-up**: three layers: a 35 µm copper signal layer, a 200 µm dielectric core, and a 35 µm copper ground plane. The release contains 219 boards with an FR4-class laminate ($ε_r$ = 4.6, loss tangent = 0.011) and 281 boards with a low-loss RF laminate ($ε_r$ = 3.55, loss tangent = 0.0027). Copper conductivity is 5.96 × 10^7 S/m.
44
+ - **Components**: planar copper traces and patches on the signal layer (transmission lines, filters, resonators, antennas); 103 boards have one port and 397 have two; 79 boards have plated vias to the ground plane.
45
+ - **Frequencies**: 101 points from 1 GHz to 20 GHz, the same grid for the S-parameters and the near fields.
46
+ - **Fields**: 10,000 three-dimensional probe locations per board. The sampling density is higher near metal regions, where fields are usually stronger, and a small fraction of probes lies within conductor volumes. Each probe has complex E and H vectors for every frequency and driven port.
47
 
48
  | Split | Boards | Released | Size |
49
  |---|---|---|---|
50
  | `public` | 500 | designs and labels | ~41 GB (near fields), ~7 MB (S-parameters) |
51
 
52
+ ### Evaluation
53
+
54
+ `EMVal-NF` reports three metric families for each of E and H. Global relative L2 pools all driven ports, frequencies, and probes for a board before normalization, so high-field regions contribute most strongly. Median local error first normalizes the vector error at each probe by the simulated field magnitude and then takes the median, so low- and high-magnitude regions have equal weight. Median local alignment measures agreement in vector direction and complex phase at each probe.
55
+
56
+ `EMVal-SP` reports real-and-imaginary RMSE in the complex plane, magnitude weighted-MAE in dB, and phase weighted-MAE in radians. The two weighted metrics use a sigmoid weight centered at −20 dB with a 2 dB rolloff. This weighting reduces the contribution of deep nulls, where magnitude and phase errors have limited engineering significance.
57
+
58
+ Each metric is defined for one board and then averaged across boards. Lower values are better for the error metrics. Higher values are better for median local alignment, where 1 is the optimum. The companion `PROTOCOL.md` gives the formulas and reference-scorer output names.
59
 
60
  ### Files per board
61
 
62
+ `v0/public/boards/<design_id>/` contains three files. Everything is SI — meters, Hz, V/m, A/m, S/m — with the unit in the key name (`_m`, `_hz`) or an HDF5 attribute.
63
 
64
  | File | For | Contents |
65
  |---|---|---|
66
+ | `design.json` | everyone | the geometry and material properties. ~2–5 KB of JSON |
67
  | `near_field.h5` | `EMVal-NF` | probe cloud, frequency grid, and the E/H labels. ~47–93 MB |
68
  | `sparams.h5` | `EMVal-SP` | frequency grid and the S-parameter labels. ~15 KB |
69
 
70
+ Both HDF5 files contain the exact text of `design.json` in the `design_json` root attribute. Each file is therefore a complete sample for its track. The S-parameter track does not require the near-field files.
71
 
72
  `design.json` keys:
73
 
74
  | Key | What it is |
75
  |---|---|
76
+ | `size_m` | board extent `[x, y]` in meters |
77
+ | `layers` | the stack-up, listed top to bottom: per layer its `index`, `type` (`metal`/`dielectric`), `subtype` (`signal`/`ground`/`core`), `thickness_m`, `material` (name, conductivity in S/m for metals; ε_r, loss tangent for dielectrics), and `shape`. The copper signal trace is a list of rectangles/polygons/circles in board coordinates |
78
+ | `ports` | one entry per port: `name`, a `signal` pin, and a list of `grounds` pins, each pin a `position`, `layer` and `width_m`. See "Ports and excitation" |
79
  | `vias` | plated vias: position, `diameter_m` (these are cylinders), spanned layers |
80
  | `solder_balls` | truncated-sphere solder balls (BGA boards; empty list in v0) |
81
 
82
+ The release provides geometric primitives rather than a voxel grid, raster, or padded array. A model can therefore select its own geometry representation.
83
 
84
  `near_field.h5` (flat file, no groups):
85
 
 
92
 
93
  Root attributes: `layout = "[excited_port, frequency, probe, xyz]"`, `E_units`, `H_units`, `coordinate_units`, `z_origin`, `design_id`, `design_json`, `labels_included`.
94
 
95
+ The probes form a three-dimensional point cloud rather than a plane. They extend beyond the board in x and y and occur below, within, and above the stack. One driven-port and frequency pair defines one field snapshot. A two-port board therefore contains 202 snapshots, each with 10,000 complex E and H vectors.
96
 
97
  `sparams.h5` (flat file):
98
 
 
101
  | `frequencies_hz` | `[F]` float64 | Hz | the same grid as the near fields |
102
  | `real`, `imag` | `[P, P, F]` float32 | — | layout `[port_out, port_in, frequency]` |
103
 
104
+ Root attributes: `layout`, `reference_impedance_ohm = 50.0`, `interpolated = false`, plus the same identity attributes as above.
105
 
106
  `index.parquet` lists every board with `design_id`, `n_ports`, `n_frequencies`, `n_probes`, `labels`; `checksums.json` carries a SHA-256 per published file; `export_meta.json` records the export's provenance.
107
 
108
  ### What the data looks like
109
 
110
+ Every example in the dataset is procedurally generated from a design template. The following is one example of a split-ring resonator from the `public` split (`design_id: 534a8fe5...`). The geometry view below shows the signal copper, dielectric, ground plane, and the signal and ground pins of both ports:
111
 
112
+ ![rotating board geometry](assets/board.gif)
113
 
114
+ The near-field view below shows E for the same board at 10.5 GHz with port 1 driven. The plot displays arrows at all 10,000 probes. Arrow direction follows the real field vector at zero phase. Arrow length follows the magnitude of that instantaneous vector, while the logarithmic color scale follows the complex-envelope magnitude |E|:
115
 
116
+ ![rotating near field](assets/near_field.gif)
117
 
118
+ The S-parameter view below shows magnitude and unwrapped phase in radians for S11, S21, and S22 across the simulated frequency range. The transmission response has a notch near 13.4 GHz, where |S21| reaches approximately −33 dB.
119
 
120
+ ![S-parameters](assets/sparams.png)
121
 
122
  Reading actual values from this board, at the resonance (frequency index 65, 13.35 GHz):
123
 
124
  ```python
125
  >>> S = sparams["real"][:] + 1j * sparams["imag"][:] # (2, 2, 101)
126
+
127
+ >>> S[0, 0, 65], S[1, 0, 65] # S11, S21: response at port i with port j driven
128
  ((-0.820-0.452j), (0.021-0.010j)) # |S11| = 0.94 (-0.6 dB), |S21| = 0.023 (-32.8 dB)
129
 
130
  >>> E = nf["E_real"][:] + 1j * nf["E_imag"][:] # (2, 101, 10000, 3)
131
+
132
  >>> E[0, 65, 7230] # port 1 driven, probe 7230 at (-0.68, -2.94, 0.23) mm
133
+ array([ 0.7-3.1j, 1656-6613j, 969-3862j]) # (Ex, Ey, Ez) in V/m, |E| ≈ 7,900 V/m
 
 
134
  ```
135
 
136
+ Relevant physical and numerical properties include:
 
 
137
 
138
+ - The S-parameter matrix is reciprocal: `S[0, 1, f] == S[1, 0, f]` for every board. A model can enforce this constraint when it predicts the full `[P, P, F]` array.
139
+ - These values describe near fields, not plane waves. At probe 7230, |E| / |H| is approximately 1.8 kΩ. This ratio varies across the probe cloud.
140
+ - Field magnitude can span several orders of magnitude in one snapshot. The evaluation protocol reports a global relative L2 error, which emphasizes high-field regions, and a median local relative error, which gives equal weight to each probe after local normalization.
141
 
142
  ### Coordinate system
143
 
144
  One right-handed frame is shared by the geometry and the field queries:
145
 
146
+ - x, y: origin at the board center; an 8 mm board spans −4 mm to +4 mm. Copper shapes in `design.json` and probe x/y in `near_field.h5` use the same axes.
147
  - z: `z = 0` at the bottom face of the bottom-most layer, +z upward — stated per file by the `z_origin = "bottom_of_stack"` attribute. `layers` in `design.json` are listed top to bottom, so the last-listed layer touches z = 0 and layer z-extents are recovered by stacking `thickness_m` upward from the bottom of the list.
148
+ - A probe value is the total field at that location for the specified driven port and excitation frequency.
149
 
150
  ## Ports and excitation
151
 
152
+ The port definition includes both its geometry and excitation convention. Every port in `design.json` uses the same schema, whether the reference conductor is the plane below the signal pin or one or more adjacent pads:
153
 
154
  ```json
155
+ {
156
+ "name": "P1",
157
+ "signal": {
158
+ "position": {"x": 0.000899, "y": 0.001186},
159
+ "layer": 0,
160
+ "width_m": 0.00045
161
+ },
162
+ "grounds": [
163
+ {
164
+ "position": {"x": 0.000899, "y": 0.001186},
165
+ "layer": 2,
166
+ "width_m": 0.00045
167
+ }
168
+ ]
169
+ }
170
  ```
171
 
172
+ - A port is a lumped port between its `signal` pin and its `grounds` pins. The excitation is applied from the ground pin (or pins) to the signal pin. A pin is a point on a conductor and has a `position`, `layer`, and `width_m`.
173
+ - In v0, every port is a vertical launch: the ground pin sits on the ground plane directly beneath the signal pin, so the excitation spans the dielectric between layer 0 and layer 2. Coplanar ports (ground pads on the same layer beside the signal) use the same schema with `grounds` on the signal's layer.
174
  - Reference impedance is 50 Ω (also an attribute on `sparams.h5`).
175
+ - One port is driven at a time, and each other port is terminated in the reference impedance. The driven-port index is the leading axis of each field array: `E[j]` is the electric field with port `j + 1` driven. For S-parameters, `S[i, j, f]` is the response at receiving port `i + 1` with port `j + 1` driven at frequency index `f`.
176
+ - Ports are numbered by their order in `ports`; `name` (`P1`, `P2`, ...) matches that order.
177
 
178
+ A simulation must use this port convention to reproduce the released values.
179
 
180
  ## Loading
181
 
182
+ The Hugging Face dataset viewer and `load_dataset()` do not read this HDF5 layout. The viewer is therefore disabled; you can download the files and use an HDF5 library to read them. Each track requires only its corresponding files:
183
 
184
  ```python
185
  from huggingface_hub import snapshot_download
186
  import h5py, json, pandas as pd
187
 
188
  # EMVal-SP: a few MB for the whole split
189
+ root = snapshot_download(
190
+ repo_id="ArenaPhysica/EMVal",
191
+ repo_type="dataset",
192
+ allow_patterns=["v0/public/boards/*/sparams.h5", "v0/public/index.parquet"],
193
+ )
194
  index = pd.read_parquet(f"{root}/v0/public/index.parquet") # design_id, n_ports, n_frequencies, n_probes
195
  design_id = index.design_id[0]
196
  with h5py.File(f"{root}/v0/public/boards/{design_id}/sparams.h5") as f:
 
199
  freqs = f["frequencies_hz"][:] # (F,) Hz
200
 
201
  # EMVal-NF: ~41 GB for the public split; narrow the pattern to a board id to fetch just one
202
+ root = snapshot_download(
203
+ repo_id="ArenaPhysica/EMVal",
204
+ repo_type="dataset",
205
+ allow_patterns=["v0/public/boards/*/near_field.h5", "v0/public/index.parquet"],
206
+ )
207
  with h5py.File(f"{root}/v0/public/boards/{design_id}/near_field.h5") as f:
208
  design = json.loads(f.attrs["design_json"])
209
+ probes = f["probes_m"][:] # (N, 3) meters
210
  E = f["E_real"][:] + 1j * f["E_imag"][:] # (P, F, N, 3) V/m
211
  ```
212
 
 
214
 
215
  ## Uses
216
 
217
+ EMVal is intended for evaluation of near-field and S-parameter predictors. The labels are full-wave simulation outputs (not measurements).
218
 
219
+ EMVal boards should NOT be used for model training. Published results must disclose any use of the evaluation geometries or labels during model development.
220
 
221
  ## Distribution and maintenance
222
 
223
+ A release version never mutates; changes ship as a new version with a changelog. Maintained by [Arena Physica](https://www.arenaphysica.com/). Licensed under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/): use and redistribution with attribution, no commercial use.
assets/board.gif ADDED

Git LFS Details

  • SHA256: 014577c6dc6ce881662a450013148c7ae07e30ef774323aebae8d2aeb0fc4362
  • Pointer size: 132 Bytes
  • Size of remote file: 1.93 MB
assets/board.png CHANGED

Git LFS Details

  • SHA256: b3970ae5ad0034efd03a3ffd7528681f006012201135bf78e958b68a033369f4
  • Pointer size: 131 Bytes
  • Size of remote file: 131 kB

Git LFS Details

  • SHA256: 09e9705cb044cce58f3343ca7beaaff19be28adbe377067eeacbc2c3d999159f
  • Pointer size: 131 Bytes
  • Size of remote file: 285 kB
assets/near_field.gif ADDED

Git LFS Details

  • SHA256: 1f879d642af73baf98dd1e596568d9014ad020d24d527207404c2d0f2e2a926f
  • Pointer size: 132 Bytes
  • Size of remote file: 6.77 MB
assets/near_field.png CHANGED

Git LFS Details

  • SHA256: c723c3db953ebcc90b67b8a646ee7b7dd10672d9953259422c87215ff2733d74
  • Pointer size: 131 Bytes
  • Size of remote file: 191 kB

Git LFS Details

  • SHA256: 387bb1b96b8fc901e04d439ca5b28d04b53821598e05a2090816e77dbc727794
  • Pointer size: 131 Bytes
  • Size of remote file: 1,000 kB
assets/sparams.png CHANGED

Git LFS Details

  • SHA256: b326323e5cefbe06c36cf667019c938e5c071c678031f6b16e85d8013cf0943c
  • Pointer size: 130 Bytes
  • Size of remote file: 63.3 kB

Git LFS Details

  • SHA256: 147cc7715dac43af7f0f6cca034ef7ea64278aa627f9a1d2abff3dd3a0553e22
  • Pointer size: 131 Bytes
  • Size of remote file: 333 kB