File size: 3,845 Bytes
75cc41b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
license: cc-by-4.0
task_categories:
  - reinforcement-learning
tags:
  - stem-microscopy
  - electron-microscopy
  - materials-science
  - gymnasium
  - benchmark
  - dose-efficiency
pretty_name: STEMGym
size_categories:
  - 1K<n<10K
---

# STEMGym: Benchmark Data for Dose-Efficient Autonomous STEM Microscopy

This dataset accompanies the [STEMGym](https://github.com/KurbanIntelligenceLab/STEMGym) benchmark — a Gymnasium-based environment for evaluating autonomous dose-efficient scanning transmission electron microscopy (STEM) agents.

## Dataset Description

STEMGym provides simulated STEM specimens as HDF5 world files. Each world contains:

- **Overview image**: Low-magnification survey of the full specimen
- **Tile grid**: High-resolution STEM images (128×128 px tiles, 4px overlap, stride=124) arranged in an 8×8 grid
- **Ground truth annotations**: Atom positions, defect types, and phase maps for scoring
- **Metadata**: Pixel size, accelerating voltage, detector geometry, material parameters

### Materials

| Material | Description | Defect Types |
|----------|-------------|-------------|
| SrTiO₃ | Perovskite oxide | O vacancies, Sr vacancies, Ti antisites |
| BaTiO₃ | Ferroelectric perovskite | O vacancies, Ba vacancies, domain boundaries |
| SiGe | Semiconductor alloy | Ge substitutions, strain fields |

### Difficulty Levels

Each material is provided at three difficulty levels (easy, medium, hard) controlling defect density, noise level, and spatial distribution.

## Files

### Simulated Worlds (`worlds/`)

| File | Material | Difficulty | Size |
|------|----------|-----------|------|
| `test_world.h5` | Synthetic (Gaussian blobs) | — | ~5 MB |
| `srtio3_easy.h5` | SrTiO₃ | Easy | ~50 MB |
| `srtio3_medium.h5` | SrTiO₃ | Medium | ~50 MB |
| `srtio3_hard.h5` | SrTiO₃ | Hard | ~50 MB |
| `batio3_easy.h5` | BaTiO₃ | Easy | ~50 MB |
| `batio3_medium.h5` | BaTiO₃ | Medium | ~50 MB |
| `batio3_hard.h5` | BaTiO₃ | Hard | ~50 MB |
| `sige_easy.h5` | SiGe | Easy | ~50 MB |
| `sige_medium.h5` | SiGe | Medium | ~50 MB |
| `sige_hard.h5` | SiGe | Hard | ~50 MB |

### Model Checkpoints (`checkpoints/`)

| File | Model | Description | Size |
|------|-------|-------------|------|
| `atom_finder.pt` | AtomFinderUNet | Atomic column detection ensemble (3 members) | ~88 MB |
| `defect_classifier.pt` | DefectClassifierCNN | Defect type classification | ~1.4 MB |
| `phase_identifier.pt` | PhaseIdentifierResNet | Material phase identification | ~7.4 MB |

## HDF5 World Format

Each world file follows this layout:

```
/metadata/
    pixel_size_nm          # Physical pixel size
    tile_size_px           # Tile dimensions (128)
    tile_overlap_px        # Overlap between tiles (4)
    grid_rows, grid_cols   # Grid dimensions
    accelerating_voltage   # Beam energy (keV)
    convergence_angle      # Probe convergence (mrad)
    detector_inner/outer   # HAADF detector angles (mrad)
/overview                  # Low-magnification survey image
/tiles/{row}_{col}         # High-resolution tile images
/ground_truth/
    atom_positions         # (N, 3) array: x, y, atomic_number
    defect_types           # (M, 4) array: x, y, type_id, severity
    phase_map              # 2D array: phase labels per pixel
/valid_region              # Boolean mask of valid scan area
```

## Usage

```bash
# Install STEMGym
pip install -e .

# Download this data
python scripts/download_data.py

# Run a benchmark
stemgym run --agent raster_equipped --task defect_census --world srtio3_medium --seeds 3
```

## License

This dataset is released under the [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/) license.

## Citation

```bibtex
@inproceedings{stemgym2026,
  title={STEMGym: A Benchmark for Dose-Efficient Autonomous STEM Microscopy},
  author={Polat, John},
  year={2026}
}
```