Datasets:
STEMGym: Benchmarking Sequential Decision-Making under Dose Budgets in Autonomous Electron Microscopy
STEMGym is a benchmark for sequential decision-making under dose budgets in autonomous electron microscopy. This repository provides simulated specimen worlds, analyst checkpoints, and a reproducible reference evaluation.
Authors: Can Polat, Mustafa Kurban, Erchin Serpedin, and Hasan Kurban.
Code snapshot · Preserved results · Pinned data revision
Release and scientific scope
The reference data revision is aa12b7380fed7a4362a18aa67df1ea135f7e15ff. Download this pinned revision to reproduce the reference study. File hashes identify the exact world and checkpoint bytes.
The release has 15 material worlds across five systems and three difficulty tiers. The benchmark core comprises 13 coordinate-bounds-consistent worlds and 13,600 overlapping tiles. Hard SrTiO3 and hard Pt/C are retained as additional records with annotations outside the declared field bounds. The two synthetic test/replay fixtures are separate from benchmark results. The size category above counts image tiles, not independent specimens or atom annotations.
Coordinate bounds do not establish physical calibration. The preserved image audit records sampling and registration issues, including repeated zero-intensity bands. Use the calibration audit and release validation when interpreting these records. Projected crystalline annotations retain per-atom lateral coordinates and can coincide along a column; they are not necessarily separately resolvable image peaks. Pt/C records represent particle centroids and particle attributes.
Material inventory
Grid sizes and fields below are stored metadata. Dimensions use height × width; fields are in nominal nanometers.
Filename prefix under worlds/ |
Material | Grid | Tiles per world | Nominal field (nm) | Core tiers |
|---|---|---|---|---|---|
srtio3_clustered |
SrTiO3 | 40 × 40 | 1600 | 99.96 × 99.96 | easy, medium |
batio3_interface |
BaTiO3 | 40 × 40 | 1600 | 99.82 × 99.82 | easy, medium, hard |
sige_gradient_clustered |
SiGe | 20 × 20 | 400 | 49.96 × 49.96 | easy, medium, hard |
gan |
GaN | 20 × 20 | 400 | 49.78 × 50.26 | easy, medium, hard |
pt_nanoparticles |
Pt/C | 40 × 40 | 1600 | 100.00 × 100.00 | easy, medium |
Each prefix has _easy.h5, _medium.h5, and _hard.h5 files. All material tiles are 128 × 128 pixels, with 4-pixel overlap and 124-pixel stride. Stored material intensities are normalized to [0, 1]; the runtime applies dose-dependent Poisson noise. Dose units in the benchmark should not be read as independently validated physical fluence.
release_inventory.csv lists the 15 worlds, two fixtures, and three reference checkpoints with byte sizes, SHA-256 hashes, roles, and immutable download URLs. release_manifest.json is the original full release manifest; it also records historical files outside the reference evaluation.
Checkpoints and historical experiments
The reference evaluation uses checkpoints/atom_finder.pt, checkpoints/defect_classifier.pt, and checkpoints/phase_identifier.pt. The runtime can fall back to heuristic analysis when a trained head degenerates; see the code and preserved evaluation records for that behavior.
The existing DQN/PPO/SAC navigation checkpoints and checkpoints/transfer/ directories are historical experimental assets. They are retained at their existing paths for compatibility and are outside the reference comparison. Their training metadata does not describe the current evaluation protocol.
HDF5 layout
/metadata # HDF5 group attributes: pixel_size_nm, tile_size_px,
# overlap_px, grid_shape, fov_nm, world_shape_px,
# scenario, difficulty
/overview # low-resolution context image
/tiles/{row}_{col} # individual 128 × 128 image datasets
/ground_truth/ # atom_positions, atom_species, atom_types,
# defect_mask, defect_types; material-specific fields
/valid_region # spatial validity mask
Optional ground-truth arrays include phase maps, composition fields, and particle attributes. Read each file's actual dtypes, shapes, and labels rather than assuming a uniform annotation schema. HDF5 world containers and PyTorch checkpoints are consumed by STEMGym; the automatic tabular Dataset Viewer is disabled.
Usage with uv
Install uv, then use the pinned code snapshot:
git clone https://github.com/KurbanIntelligenceLab/STEMGym.git
cd STEMGym
git checkout 7b7da6a026ee64a0672df88c900d229be85b33c4
uv sync --locked
uv run --locked stemgym-download
uv run --locked python reproducibility/validate_release.py
uv run --locked python reproducibility/verify_reference.py
The downloader checks SHA-256 hashes and pins the reference data revision. stemgym-download --worlds, --checkpoints, or --test-only select subsets. The downloaded files go under data/ and checkpoints/. Existing mismatched files are rejected rather than overwritten.
Reference study and new evaluations
The preserved study has 220 episodes: five configurations on four easy crystalline worlds with ten seeds each, plus trained raster on medium and hard BaTiO3 with ten seeds each. The configurations are raster with heuristic analysis, raster with trained analysis, random with trained analysis, GP intensity with trained analysis, and GP defect guidance with trained analysis. Each episode acquires 50 distinct tiles for 5,000 dose units, with scoring every five acquisitions.
Original JSON results, their integrity manifest, the historical evaluator, and frozen source are in the code repository. The refactored runtime fixes acquisition ordering, resets, and coordinate handling. Its new runs carry separate provenance and do not replace the original study.
# Rebuild figures and tables from the preserved results.
uv run --locked python reproducibility/build_figures.py
uv run --locked python reproducibility/verify_reference.py --artifacts-dir development/generated
# Run the current implementation into a new result file.
uv run --locked python reproducibility/evaluate_reference.py --output development/runs/reference.json
Fresh evaluation outputs are stored under ignored development/; the preserved results can be verified directly from the code repository.
License and citation
@misc{stemgym2026,
title = {STEMGym: Benchmarking Sequential Decision-Making under Dose Budgets in Autonomous Electron Microscopy},
author = {Polat, Can and Kurban, Mustafa and Serpedin, Erchin and Kurban, Hasan},
year = {2026},
url = {https://huggingface.co/datasets/kurbanintelligencelab/stemgym}
}
- Downloads last month
- 168