Inferensys

Glossary

Segmentation Mask

A binary or multi-class label map that classifies each voxel in a volumetric image as belonging to a specific anatomical structure or lesion.
Developer demonstrating multi-agent tool use, agent tool selection interface on laptop, casual tech demo moment.
VOLUMETRIC LABEL MAP

What is a Segmentation Mask?

A segmentation mask is a voxel-wise classification map that assigns every element in a 3D medical image to a specific anatomical structure, lesion, or background class.

A segmentation mask is a discrete label map—binary or multi-class—spatially aligned with a source volumetric image where each voxel is assigned an integer value denoting its tissue class. In a binary mask, voxels are classified as either foreground (e.g., tumor) or background; in a multi-class mask, distinct integers differentiate organs like the liver, kidney, and spleen within a single volume. This dense, per-voxel annotation serves as the ground truth for training 3D U-Net architectures and is the primary output of medical image segmentation models.

The quality of a predicted mask is quantified against a ground truth mask using spatial overlap metrics like the Dice Similarity Coefficient (DSC) and boundary distance metrics like the Hausdorff Distance. Segmentation masks enable downstream clinical tasks including volume rendering, surgical planning, and radiomics feature extraction. They are stored as DICOM Segmentation objects or NIfTI files, preserving the original geometry and enabling multi-planar reconstruction of labeled structures.

ANATOMY OF A LABEL MAP

Key Characteristics of Segmentation Masks

A segmentation mask is a pixel-wise or voxel-wise classification map that partitions a medical image into distinct anatomical regions. The following properties define its structure, encoding, and clinical utility.

01

Binary vs. Multi-Class Encoding

Masks encode anatomical labels as integer values at each spatial coordinate. Binary masks use 0 (background) and 1 (foreground) to isolate a single structure, such as a tumor. Multi-class masks assign unique integers to each anatomical region—e.g., 1 for liver, 2 for spleen, 3 for kidney—enabling simultaneous segmentation of multiple structures in a single volume. This encoding directly impacts loss function selection during training, with binary cross-entropy used for single-class tasks and categorical cross-entropy or Dice loss variants applied to multi-class problems.

0/1
Binary Mask Values
N+1
Multi-Class Channels
02

Spatial Correspondence with Source Data

A segmentation mask maintains exact spatial correspondence with its source image, sharing identical dimensions and origin coordinates. For a CT volume of size 512×512×300 voxels, the mask occupies the same grid. This one-to-one mapping is encoded in the DICOM header via shared Frame of Reference UID and Image Position (Patient) tags. Any resampling, cropping, or affine transformation applied to the source image must be identically applied to the mask to preserve alignment—a critical requirement for training supervised deep learning models.

1:1
Voxel Correspondence
03

Label Semantics and Ontologies

Integer labels in a mask derive meaning from an associated ontology or coding scheme. Common standards include:

  • SNOMED CT codes for anatomical structures
  • RadLex terms for radiology-specific findings
  • TNM staging labels for oncology masks Without explicit semantic mapping, a label value of '3' is ambiguous across datasets. Production-grade medical AI systems store label-to-ontology mappings in structured metadata, enabling interoperability across institutions and compliance with FHIR and DICOM Segmentation IOD standards.
04

Probabilistic vs. Hard Masks

Segmentation outputs exist on a spectrum of certainty. Hard masks assign a single discrete class to each voxel via argmax thresholding, producing the final clinical delineation. Probabilistic masks retain per-class probability values (e.g., 0.87 probability of 'tumor' at voxel i,j,k), preserving model uncertainty. Probabilistic masks are essential for:

  • Uncertainty quantification and risk stratification
  • Ensemble model agreement analysis
  • Deformable registration where soft boundaries improve convergence Clinical workflows typically store hard masks, while research pipelines retain probabilities for downstream analysis.
0.0–1.0
Probability Range
05

Overlap Metrics and Mask Validation

Mask quality is quantified by comparing predicted segmentations against ground truth annotations. The Dice Similarity Coefficient (DSC) measures volumetric overlap, while Hausdorff Distance (HD) captures boundary accuracy by computing the maximum surface-to-surface distance. For clinical acceptance, DSC values above 0.85 are typically required for large organs, while small lesions demand stricter HD thresholds. Surface Dice at a tolerance (e.g., 2mm) has emerged as a clinically intuitive metric that correlates with radiologist-perceived quality better than voxel-wise measures alone.

>0.85
Clinical DSC Threshold
<2mm
Surface Dice Tolerance
06

Temporal and Multi-Modal Mask Alignment

In longitudinal studies and multi-modal fusion, masks from different time points or modalities (CT, MRI, PET) must be co-registered into a common coordinate space. Deformable registration warps masks to account for patient positioning changes, organ deformation, and tumor growth between scans. The resulting aligned masks enable:

  • Tracking lesion volume changes over treatment cycles
  • Fusing functional PET masks with anatomical CT masks
  • Building 4D atlases for radiation therapy planning Misalignment errors propagate directly into downstream quantitative analysis, making registration accuracy a critical quality gate.
SEGMENTATION MASK

Frequently Asked Questions

Clear, technically precise answers to the most common questions about segmentation masks in medical imaging and diagnostic AI.

A segmentation mask is a pixel-level or voxel-level label map that classifies each element of an image as belonging to a specific category, such as an anatomical structure or lesion. In medical imaging, it works by assigning a discrete integer value to every voxel in a 3D volume—0 for background, 1 for liver, 2 for tumor, and so on—creating a dense, spatially aligned overlay. This differs fundamentally from object detection, which only provides bounding boxes. The mask is generated by a trained model, often a 3D U-Net or nnU-Net, that performs semantic segmentation. The output is a volumetric array of identical dimensions to the input scan, enabling precise quantification of volume, shape, and spatial relationships critical for surgical planning and radiotherapy target delineation.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.