Contenido principal

Semantic Segmentation

Label ground truth and perform semantic segmentation using pretrained AI models, train custom networks like U-Net with transfer learning

Semantic segmentation tools in Computer Vision Toolbox™ enable you to perform pixel-level classification of images using both pretrained AI models and custom deep learning networks. You can start by creating labeled ground truth using the Image Labeler and Video Labeler apps, which support interactive and AI-assisted pixel-level annotation in images and videos with class labels. For more information, see Label Pixels for Semantic Segmentation.

The toolbox provides pretrained semantic segmentation models such as BiSeNet V2. You can use these models directly for inference, or adapt them to specific applications. You can also train custom segmentation networks using transfer learning with architectures like U-Net, 3D U-Net, and DeepLab v3+. For more information, see Get Started with Semantic Segmentation Using Deep Learning.

To prepare training data, the toolbox offers utilities for loading and managing data sets along with organizing and analyzing label distributions. The toolbox also supports data augmentation and preprocessing. For more information, see Training Data for Object Detection and Semantic Segmentation.

After you generate predictions using pretrained or custom models, you can evaluate segmentation predictions against the ground truth, and compute evaluation metrics like the contour matching score, Sørensen-Dice similarity, Jaccard similarity, and confusion matrix. For more information, see evaluateSemanticSegmentation.

Input image of a seascape, then a series of cubes representing a deep learning network, and a semantically segmented output image of the input image.

Apps

Image LabelerLabel images for computer vision applications
Video LabelerLabel video for computer vision applications

Functions

expand all

bisenetv2Create BiSeNet v2 convolutional neural network for semantic segmentation (Since R2025a)
semanticsegSemantic image segmentation using deep learning
bisenetv2Create BiSeNet v2 convolutional neural network for semantic segmentation (Since R2025a)
unetCreate U-Net convolutional neural network for semantic segmentation (Since R2024a)
unet3dCreate 3-D U-Net convolutional neural network for semantic segmentation of volumetric images (Since R2024a)
deeplabv3plusCreate DeepLab v3+ convolutional neural network for semantic image segmentation (Since R2024a)
focalCrossEntropyCompute focal cross-entropy loss
generalizedDiceGeneralized Sørensen-Dice similarity coefficient for image segmentation
combineCombine data from multiple datastores
countEachLabelCount occurrence of pixel or box labels
groundTruthGround truth label data
imageDatastoreDatastore for image data
pixelLabelDatastoreDatastore for pixel label data
pixelLabelTrainingDataCreate training data for semantic segmentation from ground truth
balancePixelLabelsBalance pixel labels by oversampling block locations in large images
imwarpApply geometric transformation to image
imcropCrop image
imresizeResize image
transformTransform datastore
randomAffine2dCreate randomized 2-D affine transformation
randomWindow2dRandomly select rectangular region in image
centerCropWindow2dCreate rectangular center cropping window
evaluateSemanticSegmentationEvaluate semantic segmentation data set against ground truth
bfscoreContour matching score for image segmentation
diceSørensen-Dice similarity coefficient for image segmentation
jaccardJaccard similarity coefficient for image segmentation
segmentationConfusionMatrixConfusion matrix of multi-class pixel-level image segmentation
semanticSegmentationMetricsSemantic segmentation quality metrics
labeloverlayOverlay label matrix regions on 2-D image
volshowDisplay volume
insertObjectMask Insert masks in image or video stream

Topics

Get Started

Create Ground Truth for Semantic Segmentation

Prepare Training Data for Semantic Segmentation

Featured Examples