主要内容

本页采用了机器翻译。点击此处可查看英文原文。

语义分割

使用预训练 AI 模型标注真实值并执行语义分割,使用迁移学习训练 U-Net 等自定义网络

Computer Vision Toolbox™ 中的语义分割工具支持您使用预训练 AI 模型和自定义深度学习网络执行图像的像素级分类。您可以首先使用图像标注器视频标注器创建标注真实值,它们支持对图像和视频进行交互式和 AI 辅助的像素级类别标签注解。有关详细信息,请参阅Label Pixels for Semantic Segmentation

工具箱提供了预训练语义分割模型,如 BiSeNet V2。您可以直接使用这些模型进行推断,或将其适配到特定应用。您还可以使用迁移学习通过 U-Net、3D U-Net 和 DeepLab v3+ 等架构来训练自定义分割网络。有关详细信息,请参阅Get Started with Semantic Segmentation Using Deep Learning

为了准备训练数据,工具箱提供了用于加载和管理数据集以及组织和分析像素标签数据的实用工具。工具箱还支持数据增强和预处理。有关详细信息,请参阅Training Data for Object Detection and Semantic Segmentation

使用预训练或自定义模型生成预测结果后,您可以将分割预测结果与真实值进行比较,并计算轮廓匹配得分、Sørensen-Dice 相似度、Jaccard 相似度以及混淆矩阵等评估度量。有关详细信息,请参阅 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.

App

图像标注器为计算机视觉应用标注图像
视频标注器Label video for computer vision applications

函数

全部展开

bisenetv2Create BiSeNet v2 convolutional neural network for semantic segmentation (自 R2025a 起)
semanticsegSemantic image segmentation using deep learning
bisenetv2Create BiSeNet v2 convolutional neural network for semantic segmentation (自 R2025a 起)
unet创建用于语义分割的 U-Net 卷积神经网络 (自 R2024a 起)
unet3dCreate 3-D U-Net convolutional neural network for semantic segmentation of volumetric images (自 R2024a 起)
deeplabv3plus创建用于语义分割的 DeepLab v3+ 卷积神经网络 (自 R2024a 起)
focalCrossEntropyCompute focal cross-entropy loss
generalizedDiceGeneralized Sørensen-Dice similarity coefficient for image segmentation
combine合并来自多个数据存储的数据
countEachLabelCount occurrence of pixel or box labels
groundTruthGround truth label data
imageDatastore图像数据的数据存储
pixelLabelDatastoreDatastore for pixel label data
pixelLabelTrainingDataCreate training data for semantic segmentation from ground truth
balancePixelLabelsBalance pixel labels by oversampling block locations in large images
imwarp对图像应用几何变换
imcrop裁剪图像
imresize调整图像大小
transform变换数据存储
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

主题

快速入门

为语义分割创建真实值

为语义分割准备训练数据

精选示例