Warwick-STEM / README.md
cgeorgiaw's picture
cgeorgiaw HF Staff
Add files using upload-large-folder tool
1a03077 verified
---
license: cc-by-4.0
task_categories:
- image-to-image
- unconditional-image-generation
tags:
- microscopy
- electron-microscopy
- STEM
- materials-science
- webdataset
size_categories:
- 10K<n<100K
configs:
- config_name: default
data_files:
- split: train
path: "train-*.tar"
---
# Warwick STEM Dataset (WebDataset)
A collection of 19,769 experimental scanning transmission electron microscopy (STEM) images from the University of Warwick, spanning hundreds of diverse materials projects collected between 2010 and 2018.
## Dataset Description
This dataset contains experimental STEM images originally published as part of the [Warwick Electron Microscopy Datasets](https://github.com/Jeffrey-Ede/datasets) by Jeffrey Ede. The images cover a wide range of materials and imaging conditions, making them useful for self-supervised pre-training of microscopy foundation models.
## Format
WebDataset format: 170 TAR shards (~1 GB each), 160 GB total.
Each sample in a shard contains:
- `{idx:06d}.tif` — 32-bit float TIFF image
- `{idx:06d}.json` — metadata
### Metadata Fields
| Field | Type | Description |
|-------|------|-------------|
| `original_filename` | string | Original filename from the Warwick dataset |
| `width` | int | Image width in pixels |
| `height` | int | Image height in pixels |
| `dtype` | string | Pixel data type (float32) |
| `min_value` | float | Minimum pixel intensity |
| `max_value` | float | Maximum pixel intensity |
| `mean_value` | float | Mean pixel intensity |
| `std_value` | float | Standard deviation of pixel intensity |
### Image Properties
- **Count:** 19,769
- **Format:** 32-bit float TIFF
- **Resolutions:** Mixed — 2048x2048 (40%), 1024x1024 (34%), 512x512 (16%), other (10%)
- **Modality:** STEM (various detector configurations)
- **Instruments:** Multiple instruments at the University of Warwick (2010–2018)
## Usage
```python
import webdataset as wds
from torch.utils.data import DataLoader
url = "path/to/warwick_stem_wds/train-{0000..0169}.tar"
dataset = wds.WebDataset(url).decode().shuffle(1000)
dataloader = DataLoader(dataset, batch_size=32, num_workers=4)
for sample in dataloader:
image = sample[".tif"]
metadata = sample[".json"]
```
## Source
Original data from [Jeffrey-Ede/datasets](https://github.com/Jeffrey-Ede/datasets) on GitHub. Please cite the original work if you use this dataset.
## License
CC-BY-4.0