FSSDataBase / README.md
kkking789's picture
add README.md
f45a112
|
Raw History Blame Contribute Delete
18.8 kB
metadata
license: apache-2.0
pretty_name: FSSDataBase - Frequency-Selective Surface Simulation Dataset
size_categories:
  - 1K<n<10K
tags:
  - electromagnetics
  - frequency-selective-surfaces
  - s-parameters
  - hfss
  - simulation-data
  - scientific-computing
  - tabular

FSSDataBase

A data-only collection of 5,607 simulated frequency-selective surface (FSS) unit cells, with structural metadata, per-metal-layer masks, and frequency-dependent reflection and transmission responses.

The dataset connects randomly generated single- and multilayer structures with HFSS electromagnetic responses. It includes both TE- and TM-labelled co-polarized S-parameter magnitudes and phases, supporting forward-response modelling, structural representation learning, polarization/angle comparisons, and response-based retrieval.

This release contains numerical data rather than rendered figures: no PNG/JPG plots, screenshots, or HFSS project files are included. HFSS and PyAEDT are not required to read the exported files.

Quality notice: This is a preserved simulation archive, not a fully cleaned benchmark. Some records contain nonfinite values, incomplete angle coverage, or unusually large S-parameter magnitudes. Read Data Quality and Limitations before training models or interpreting device performance.

Dataset at a Glance

The following statistics describe the database-registered samples in the data-only export dated 2026-09-14, inspected on 2026-09-15.

Property Content
Registered structures 5,607
Sample metadata files 5,607 JSON files
Raw response files / label files 5,607 / 5,607 headerless CSV files
Metal-layer masks 8,920 CSV files; producer resolution 500 x 500
Observed metal-mask counts 1 layer: 2,716 samples; 2 layers: 2,469; 3 layers: 422
Frequency grid in raw responses 10-20 GHz, 101 points per recorded angle, 0.1 GHz spacing
Recorded angles 0 degrees in 5,607 samples; 30 degrees in 5,521 samples
Raw channels S11-TE, S11-TM, S21-TE, S21-TM; magnitude and phase for each
Stored unit.size parameter 5 mm for all samples; see the geometry convention below
Total substrate thickness 1 mm: 1,896 samples; 2 mm: 3,711 samples
Used substrate material F4BM348; other materials may appear in the metadata catalogue
Stored wire-width parameter Approximately 0.4000-0.6000 mm
SQLite tables samples: 5,607 rows; responses: 22,256; responses_angle: 22,256
Legacy cache 221 NPZ files; 21,928 rows covering 5,522 distinct sample IDs
Data size 4,831,636,373 bytes, approximately 4.83 GB / 4.50 GiB, for database/ and datasets/
Recorded generation dates 2026-08-16 to 2026-09-09, from stored timestamps
Predefined train/validation/test splits None

The 5,607 structures are the sample population. Frequency rows, polarization channels, masks, and cache rows are not additional independent structures. Layer counts above refer to saved mask files, not an independent CAD reconstruction.

Repository Layout

FSSDataBase/
  README.md
  .gitattributes
  database/
    DataBase.db
  datasets/
    <sample_id>/
      data.json
      raw_result.csv
      label_result.csv
      mask_0.csv
      mask_1.csv          # only when another metal mask is present
      mask_2.csv          # only when another metal mask is present
    cache/
      cache_00000.npz
      ...

Use samples.id as the authoritative index and join it to datasets/<sample_id>/. Keep IDs as strings: legacy IDs resemble decimal timestamps, while newer IDs contain underscores. Do not convert IDs to floating-point numbers.

samples.sample_path is relative to the repository root, not to database/ or the current working directory. For example, datasets/1786866648.2374983 resolves below the downloaded repository root.

Data Generation and Scope

The FSSDataBase generation pipeline creates randomized metal geometries and layer stacks, constructs a periodic HFSS unit-cell model, solves the configured frequency/angle conditions, and exports the responses and structural records. The generator provides three procedural families: centrally connected patterns (group1), loop-like patterns (group2), and filled patterns (group3). These family names describe generation methods, not performance classes.

The available modelling code uses periodic boundaries and top/bottom Floquet ports. In the producer's channel convention, Floquet mode 1 is labelled TE and mode 2 TM. S11 denotes reflection at the top port; S21 denotes transmission from the top to the bottom port. The archived CSVs contain the corresponding co-polarized channels, not a complete multimode scattering matrix.

The collection is limited to the actual recorded conditions; it is not a general sweep over arbitrary materials, frequencies, angles, or manufacturing tolerances. Generation and file retention introduce selection effects, so random generation does not imply uniform sampling of all possible FSS designs.

The exported metadata does not record a per-sample solver version, random seed, full meshing history, or achieved convergence criterion. A later version of the generator is therefore not, by itself, evidence of exact reproducibility of every archived sample.

File and Field Definitions

Structural Metadata: data.json

All published sample JSON files use the legacy field layout below.

Field Meaning
idx Original sample identifier; may be numeric in legacy JSON. Use the database/folder string ID for joins.
time Producer timestamp; no explicit timezone offset is stored.
author Producer-supplied attribution field.
material Material catalogue with relative permittivity, relative permeability, and dielectric loss tangent. Inclusion does not mean a material was used.
sub Actual substrate layers, such as sub1 and sub2, with material name and thickness h in mm.
unit Two-element array [wire_width, size], in mm.
range_freq Requested frequency configuration [start_GHz, stop_GHz, point_count].
range_angle Legacy requested angle configuration. Use the actual CSV angle column to determine available results.
build Recorded geometry-building operations, including geometry expressions and coordinate-system operations.

Geometry convention: samples.size stores the generator's Unit.size, not the full lateral cell span. The available generator code constructs the substrate with d = 2 * Unit.size, corresponding to a 10 mm lateral span when size = 5. Use the producer's coordinate and scaling conventions when interpreting geometry; do not assume that the stored value 5 means a 5 mm period.

Angle convention: all sample metadata contains range_angle = [[0, 30, 2]], but the stored data contains 0 and 30 degrees only, with 86 samples containing 0 degrees only. Do not interpret this release as measurements every 2 degrees or manufacture missing intermediate angles.

There is no explicit per-metal-layer group field, canonical metal-height table, geometry field, or schema_version field in this legacy release. Layer heights and family assignments inferred from build require a separate, checked interpretation; they should not be presented as supplied ground-truth labels. Treat geometry-expression strings as data rather than executing them with unrestricted eval.

Continuous Responses: raw_result.csv

This is the preferred source for quantitative S-parameter analysis. Files have no header, 10 columns, and either 101 rows (0 degrees only) or 202 rows (0 and 30 degrees). Numeric values are serialized to six decimal places.

Column, zero-based Name Unit
0 angle_deg degrees
1 frequency_GHz GHz
2 S11_TE_dB dB
3 S11_TM_dB dB
4 S21_TE_dB dB
5 S21_TM_dB dB
6 S11_TE_phase_deg degrees
7 S11_TM_phase_deg degrees
8 S21_TE_phase_deg degrees
9 S21_TM_phase_deg degrees

Magnitudes are 20 * log10(abs(S)), not linear amplitudes. Reconstruct a stored complex coefficient with 10**(magnitude_db / 20) * exp(1j * deg2rad(phase_deg)). Phases are wrapped angular values; compare phase differences circularly rather than subtracting values across the wrap boundary without correction.

Threshold Labels: label_result.csv

The shape and column order match raw_result.csv. Columns 0-1 retain angle/frequency, columns 6-9 retain phase, and columns 2-5 contain:

+1  if the producer's unrounded magnitude is greater than -5 dB
-1  otherwise

These are thresholded responses, not human annotations or universal passband/stopband judgements. For example, a high S11 label indicates stronger reflection, not necessarily desirable transmission. The threshold is applied before CSV rounding.

A label of -1 is not a validity flag. The producer's comparison can also assign -1 to a nonfinite raw magnitude. Always inspect the corresponding raw response before using labels as training targets.

Metal Masks: mask_<n>.csv

Each headerless CSV stores a two-dimensional numerical occupancy mask: 1 for metal, 0 for background. The producer writes 500 x 500 masks. The suffix is a zero-based metal-mask index, not a substrate index or sample ID.

Retain masks as separate layers and preserve their order. Do not merge layers into one mask when the task depends on stack arrangement. These numerical masks are included even though rendered image files have been removed; raster boundaries are a representation of geometry, not independent manufacturing metrology.

SQLite Database: database/DataBase.db

Table Key and fields Interpretation
samples id, sample_path, size, height Master index and basic geometric parameters; height is total substrate thickness in mm.
responses (id, direct, angle), p000 ... p299 300-point TE threshold-label representation, not raw dB amplitude.
responses_angle (id, direct, angle), p000 ... p299 Corresponding stored TE phase representation in degrees.

direct = 0 means S11 and direct = 1 means S21. It does not distinguish TE from TM: the producer's database path uses TE columns only. Use the raw/label CSVs for TM data or both polarizations.

The producer's legacy normalization uses np.linspace(1, 30, 300, dtype=np.float32) and previous-node sampling. The raw solved band is only 10-20 GHz. A 300-column database row is therefore not 300 solved points over 10-20 GHz, and it is not evidence of a simulated 1-30 GHz band. Zero labels outside the represented band are sentinels; unavailable phases can be SQL NULL. Phase values passed through float16 storage before insertion, so SQLite's REAL type does not restore raw CSV precision.

The 30-degree condition may be stored as 29.999999999999996 in SQLite. Use a tolerance, such as ABS(angle - 30.0) < 1e-6, instead of exact float equality.

Legacy NPZ Cache: datasets/cache/

Files contain ids, directs, angles, Sparameters, and phase. Typically Sparameters has shape (N, 300) and dtype int8, and phase has shape (N, 300) and dtype float16. Their meanings follow the database's TE-only discretized representation, despite the generic name Sparameters. Frequency coordinates are not stored as a separate array.

The preserved cache is not a complete replacement for the database or sample files: it contains 5,522 distinct IDs, leaving 85 registered sample IDs without cache coverage. Use samples as the master index, check joins explicitly, and load NPZ files with allow_pickle=False.

Download and Read

Reading requires Python and NumPy; downloading with the example below additionally requires huggingface_hub. SQLite support is part of Python's standard library. No simulator is launched.

Download the Archive

The Hub client supports repository downloads and optional file filtering; see the official download guide.

from huggingface_hub import snapshot_download

snapshot_download(
    repo_id="kkking789/FSSDataBase",
    repo_type="dataset",
    local_dir="FSSDataBase",
    max_workers=4,
    # revision="<full commit hash>",  # Pin a real revision for reproducible work.
    # ignore_patterns=["datasets/cache/*"],  # Optional: omit the legacy cache.
)

This is a heterogeneous file archive, not one rectangular table. Do not concatenate every CSV into a single dataset: mask matrices, continuous responses, and threshold labels have different semantics.

Load One Registered Sample

from pathlib import Path
import json
import sqlite3
import numpy as np

root = Path("FSSDataBase").resolve()
database = root / "database" / "DataBase.db"
connection = sqlite3.connect(database.as_uri() + "?mode=ro", uri=True)
try:
    sample_id, relative_path, size, height = connection.execute(
        "SELECT id, sample_path, size, height FROM samples ORDER BY id LIMIT 1"
    ).fetchone()
finally:
    connection.close()

sample_dir = (root / relative_path).resolve()
if not sample_dir.is_relative_to(root):
    raise ValueError("Sample path is outside the dataset root")
with (sample_dir / "data.json").open(encoding="utf-8") as handle:
    metadata = json.load(handle)
raw = np.loadtxt(sample_dir / "raw_result.csv", delimiter=",", ndmin=2)
labels = np.loadtxt(sample_dir / "label_result.csv", delimiter=",", ndmin=2)
mask_paths = sorted(
    sample_dir.glob("mask_*.csv"),
    key=lambda path: int(path.stem.rsplit("_", 1)[1]),
)
masks = [np.loadtxt(path, delimiter=",", dtype=np.uint8) for path in mask_paths]

assert raw.shape[1] == 10 and labels.shape == raw.shape
print("Sample:", sample_id, "substrate thickness (mm):", height)
print("Angles (degrees):", np.unique(raw[:, 0]))
print("Mask shapes:", [mask.shape for mask in masks])
print("All raw entries finite:", bool(np.isfinite(raw).all()))

# Example: inspect the complete recorded 0-degree TE transmission trace.
trace = raw[np.isclose(raw[:, 0], 0.0, rtol=0, atol=1e-6)]
trace = trace[np.argsort(trace[:, 1])]
if trace.shape[0] != 101 or not np.isfinite(trace).all():
    raise ValueError("This example requires a complete finite 0-degree trace")
frequency_ghz = trace[:, 1]
s21_te_db = trace[:, 4]
s21_te_phase_deg = trace[:, 8]
s21_te_complex = 10 ** (s21_te_db / 20) * np.exp(1j * np.deg2rad(s21_te_phase_deg))

This example selects a condition for illustration; it does not define an official clean subset or silently repair rejected values.

Data Quality and Limitations

Observed Quality of This Release

A read-only scan of the 5,607 registered samples found:

Check Result
SQLite PRAGMA quick_check ok
Presence of data.json, raw/label CSVs, and mask_0.csv Present for all 5,607 samples
Entire raw file finite 5,498 samples
At least one nonfinite raw entry 109 samples; 75,136 nonfinite cells in total
Both 0- and 30-degree rows recorded 5,521 samples, including records with nonfinite values
Only 0-degree rows recorded 86 samples
Complete finite 0-degree condition 5,604 samples
Complete finite 30-degree condition 5,414 samples
All-finite samples with any stored magnitude above +0.1 dB 81 samples
Label disagreements with the -5 dB rule on finite saved magnitudes 0 cells

The all-finite population is a numerical eligibility subset, not a physically certified subset. Some stored magnitudes exceed +30 dB. Such values require investigation of solver settings, normalization, interpolation, or convergence before physical interpretation; this archive does not establish the cause. The available co-polarized channels alone are insufficient for a full multimode energy-balance assessment.

The data-only export retained the database records and numerical files without imputation, clipping, relabelling, or removal of numerical outliers. Export verification compared the source and copied file hashes and database values; only the copied sample_path values were made relative. Copy integrity is distinct from scientific validation. The presence check above also does not independently prove that every intended CAD layer has a saved mask.

Statistics from broader working directories can differ because those directories included samples absent from the database. Counts in this card refer only to this release's 5,607 registered structures.

Appropriate Use

  • Define and report numerical/physical screening criteria before model training or comparative evaluation. Do not replace NaNs or missing conditions with successful-looking responses.
  • Split at the structure/sample-ID level, keeping all angles, polarizations, layers, and derived records of a structure together. Otherwise, train/test leakage can occur. Also consider checking near-duplicate geometries.
  • Use the observed frequency grids and actual angle coverage. Do not infer intermediate-angle behaviour from two angle values, or extrapolate the solved band from the database's padded representation.
  • Use circular phase comparisons. Phase near deep transmission/reflection nulls can be sensitive and should not be treated as a robust device objective without amplitude constraints.
  • This release does not include measured prototypes, a universal convergence certificate, fabrication-tolerance sweeps, finite-array validation, cross-polarized channels, or official baseline model scores. It is not evidence of experimentally verified device performance or superiority over other datasets.

License, Citation, and Contact

The repository declares Apache-2.0 in its dataset metadata. See the Apache License 2.0 for the license text. Proprietary solver software and third-party material/product names are not distributed with this dataset.

For reproducible use, cite the dataset and record the exact downloaded repository commit. The following is a dataset citation, not a claim of an associated peer-reviewed publication:

@misc{fssdatabase2026,
  author = {{kkking789}},
  title = {{FSSDataBase}: Frequency-Selective Surface Simulation Dataset},
  year = {2026},
  url = {https://huggingface.co/datasets/kkking789/FSSDataBase},
  note = {Data-only export dated 2026-09-14}
}

For questions or data-quality reports, use the repository's Community discussions. Include the sample ID, file, angle, channel, and dataset revision so that the record can be checked.