High-resolution aerial imagery benchmark for remote sensing road extraction, based on the canonical Massachusetts Roads dataset introduced by Volodymyr Mnih (2013).
Dataset Card
By Lam Tran, published under mit, revision 7300d99726d4.
Massachusetts Roads Benchmark Dataset
High-resolution aerial imagery benchmark for remote sensing road extraction, based on the canonical Massachusetts Roads dataset introduced by Volodymyr Mnih (2013).
Dataset Overview
The Massachusetts Roads Dataset covers diverse urban, suburban, coastal, and forested rural environments throughout the Commonwealth of Massachusetts.
- Image Resolution: $1500 \times 1500$ pixels per tile.
- Ground Sampling Distance (GSD): $1.0\text{ m/pixel}$.
- Channels: 3-channel RGB optical imagery (*_sat.jpg).
- Ground Truth: Binary road segmentation masks (*_mask.png), where pixel value 255 (or 1) denotes road corridors rasterized from OpenStreetMap with an approximate line width of 7 pixels, and 0 denotes background.
Benchmark Partition
Standard benchmark partition for road extraction research:
| Split | Tiles | Images | Binary Masks | Description |
|---|---|---|---|---|
| Training (train) | 540 | 540 | 540 | Training set partitioned from the standard 600-image training pool (seed 42) |
| Validation (val) | 60 | 60 | 60 | Held-out validation split for model selection & threshold calibration |
| Testing (test) | 178 | 178 | 178 | Standard official evaluation benchmark |
| Total | 778 | 778 | 778 | Full benchmark corpus |
Directory Structure
massachusetts/
├── metadata.csv # Complete index (split, tile_id, image_path, mask_path, resolution)
├── train/
│ ├── images/ # 540 aerial tiles (*_sat.jpg)
│ └── masks/ # 540 road masks (*_mask.png)
├── val/
│ ├── images/ # 60 aerial tiles (*_sat.jpg)
│ └── masks/ # 60 road masks (*_mask.png)
└── test/
├── images/ # 178 aerial tiles (*_sat.jpg)
└── masks/ # 178 road masks (*_mask.png)
Quick Start & Usage
1. Fast Download via Python (huggingface_hub)
import zipfile
from huggingface_hub import hf_hub_download
# Download the complete benchmark archive (~530 MB)
zip_file = hf_hub_download(
repo_id="lammtfkday/massachusetts-roads",
filename="datasetmassa.zip",
repo_type="dataset"
)
# Extract into local data folder
with zipfile.ZipFile(zip_file, "r") as zf:
zf.extractall("./data")
2. Downloading Individual Splits
from huggingface_hub import hf_hub_download
train_zip = hf_hub_download(repo_id="lammtfkday/massachusetts-roads", filename="train.zip", repo_type="dataset")
val_zip = hf_hub_download(repo_id="lammtfkday/massachusetts-roads", filename="val.zip", repo_type="dataset")
test_zip = hf_hub_download(repo_id="lammtfkday/massachusetts-roads", filename="test.zip", repo_type="dataset")
3. PyTorch Dataset Loader
import cv2
import torch
from pathlib import Path
from torch.utils.data import Dataset
class MassachusettsRoadDataset(Dataset):
def __init__(self, root_dir, split="train", transform=None):
self.img_dir = Path(root_dir) / split / "images"
self.mask_dir = Path(root_dir) / split / "masks"
self.images = sorted(list(self.img_dir.glob("*_sat.jpg")))
self.transform = transform
def __len__(self):
return len(self.images)
def __getitem__(self, idx):
img_path = self.images[idx]
mask_path = self.mask_dir / img_path.name.replace("_sat.jpg", "_mask.png")
image = cv2.cvtColor(cv2.imread(str(img_path)), cv2.COLOR_BGR2RGB)
mask = cv2.imread(str(mask_path), cv2.IMREAD_GRAYSCALE)
mask = (mask > 127).astype("float32")
if self.transform:
augmented = self.transform(image=image, mask=mask)
image, mask = augmented["image"], augmented["mask"]
return torch.tensor(image).permute(2, 0, 1) / 255.0, torch.tensor(mask).unsqueeze(0)
Citations
If you use this dataset in your research, please cite:
@phdthesis{mnih2013aerial,
title={Machine Learning for Aerial Image Labeling},
author={Mnih, Volodymyr},
year={2013},
school={University of Toronto}
}
Details
- Repository
- lammtfkday/massachusetts-roads
- Publisher
- Lam Tran
- Task category
- Image segmentation
- Tags
- remote-sensing, road-extraction, aerial-imagery
- Size category
- n<1K
- Languages
- en
- Revision
- 7300d99726d4ad618af85ff2d13d5338cd291bdd
- Last updated
- 2026-09-25
Files
19 files, 1.1 GB in total.
Every file
| File | Type | Size | SHA-256 |
|---|---|---|---|
| datasetmassa.zip | Data | 539.5 MB | 895f6f5fcc53 |
| metadata.csv | Data | 69.2 KB | — |
| test.zip | Data | 123.7 MB | 2df4bcc73f13 |
| train.zip | Data | 373.1 MB | f61dd06beb77 |
| val.zip | Data | 42.6 MB | d38f1dd69260 |
| README.md | Documentation | 4.7 KB | — |
| samples/10078675_mask.png | Other | 11.9 KB | 105e46237716 |
| samples/10078675_sat.jpg | Other | 614.3 KB | 989d21cf3fda |
| samples/10228675_mask.png | Other | 10.9 KB | 9b2986717b59 |
| samples/10228675_sat.jpg | Other | 563.1 KB | 75b44dccde43 |
| samples/10228735_mask.png | Other | 20.5 KB | 1d19f260c186 |
| samples/10228735_sat.jpg | Other | 619.3 KB | 08c8acf16b80 |
| samples/23429140_mask.png | Other | 31.9 KB | c5dbc9acdde5 |
| samples/23429140_sat.jpg | Other | 724.4 KB | d96d081adcb2 |
| samples/24629215_mask.png | Other | 36.5 KB | 24848f338340 |
| samples/24629215_sat.jpg | Other | 684.3 KB | aaca6c5ba286 |
| samples/27028720_mask.png | Other | 35.3 KB | 146a8b2ad118 |
| samples/27028720_sat.jpg | Other | 630.8 KB | f63decfc411d |
| .gitattributes | Repository | 2.5 KB | — |
License and Download
- License
- mit
- Access
- No access gate
Released by Lam Tran through its official repository on Hugging Face. Read the license.