DomainSeg - Roadwork Scene Segmentation
Roadwork scenes and construction objects present a challenging edge-case scenario for self-driving cars. Construction objects can be placed dynamically, repositioned at a moment's notice by workers, and used to artificially narrow the driving corridor or guide vehicles to merge lanes. DomainSeg addresses this perception gap by delivering robust roadwork scene segmentation across urban driving scenarios, highways, and unstructured roads. It adapts to challenging weather conditions such as snow and low light, and handles edge cases such as knocked-over traffic cones.
Originally developed as part of the AutoSeg perception pipeline for the VisionPilot project (VisionPilot 0.9), DomainSeg follows an Encoder-Context-Decoder architecture that reuses a frozen road-pretrained SceneSegNetwork upstream trunk (EfficientNet-B0 Backbone β SceneContext MLP with Residual Attention β SceneNeck Progressive Upsampling Decoder with Skip Connections) paired with a trainable lightweight segmentation decoder (DomainSegHead) outputting a full-resolution binary segmentation mask at 640px Γ 320px.
During inference, DomainSeg estimates a binary segmentation mask identifying a single unified roadwork objects super-class, covering movable construction-zone objects including:
- Traffic cones
- Traffic barrels / drums
- Tubular markers / vertical panels
- Temporary construction barriers
Performance Results
DomainSeg was trained on the ROADWork dataset by Carnegie Mellon University (7.25K training samples and 150 validation samples), optimizing a binary cross-entropy loss (BCEWithLogitsLoss) on the unified roadwork foreground class.
Validation Set Performance (640Γ320)
| Dataset | Metric | Score |
|---|---|---|
| ROADWork (Validation) | mIoU | 46.6 |
Inference Speed
Benchmarked on a laptop GPU (RTX 3060 Mobile / AMD Ryzen 7 5800H, 223.43 GFLOPs) at 640Γ320 input resolution.
| Precision | FPS |
|---|---|
| FP32 | 14.3 |
| FP16 | 23.9 |
Model weights
| Variant | Input frame | Output resolution | PyTorch | Traced PyTorch | ONNX FP32 |
|---|---|---|---|---|---|
| DomainSeg | 640x320 (2:1) | 320x640 (1 channel) | model weights | model weights | model weights |
Quick start
PyTorch (DomainSegNetworkInfer)
Clone the DomainSeg GitHub repository, install dependencies (pip install -r requirements.txt huggingface_hub), and run:
import sys
from PIL import Image
from huggingface_hub import hf_hub_download
sys.path.append("Models")
from Models.inference.domain_seg_infer import DomainSegNetworkInfer
repo_id = "AutowareFoundation/domain_seg"
ckpt = hf_hub_download(repo_id, "models/domainseg.pth")
model = DomainSegNetworkInfer(ckpt) # uses CUDA if available
test_img = hf_hub_download(repo_id, "assets/highway.jpg")
img = Image.open(test_img).convert("RGB").resize((640, 320))
mask = model.inference(img) # binary mask, shape: (320, 640, 1)
print(mask.shape, mask.sum())
ONNX Runtime (standalone)
import numpy as np
import onnxruntime as ort
from PIL import Image
from huggingface_hub import hf_hub_download
repo_id = "AutowareFoundation/domain_seg"
onnx_path = hf_hub_download(repo_id, "models/domainseg_fp32.onnx")
test_img = hf_hub_download(repo_id, "assets/highway.jpg")
img = Image.open(test_img).convert("RGB").resize((640, 320))
x = np.asarray(img, dtype=np.float32) / 255.0
mean = np.array([0.485, 0.456, 0.406], dtype=np.float32)
std = np.array([0.229, 0.224, 0.225], dtype=np.float32)
x = ((x - mean) / std).transpose(2, 0, 1)[None, ...]
session = ort.InferenceSession(onnx_path, providers=["CUDAExecutionProvider", "CPUExecutionProvider"])
logits = session.run(None, {"input": x})[0] # shape: (1, 1, 320, 640)
mask = (logits > 0).astype(np.uint8)
print(mask.shape, mask.sum())
Citation
@software{autoware_domain_seg_2026,
author = {The Autoware Foundation},
title = {DomainSeg: Roadwork scene semantic segmentation model},
year = {2026},
url = {https://github.com/autowarefoundation/domain_seg},
note = {Checkpoints: https://huggingface.co/AutowareFoundation/domain_seg}
}
Model tree for AutowareFoundation/domain_seg
Base model
google/efficientnet-b0