Create U-Net layers for semantic segmentation
returns a U-Net network. lgraph
= unetLayers(imageSize
,numClasses
)unetLayers
includes a pixel classification layer
in the network to predict the categorical label for every pixel in an input image.
Use unetLayers
to create the U-Net network architecture. You must
train the network using the Deep Learning Toolbox™ function trainNetwork
(Deep Learning Toolbox).
[
also returns the size of the output size from the U-Net network.lgraph
,outputSize
] = unetLayers(imageSize
,numClasses
)
___ = unetLayers(
specifies options using one or more name-value pair arguments. Enclose each property name in
quotes. For example,
imageSize
,numClasses
,Name,Value
)unetLayers(imageSize,numClasses,'NumFirstEncoderFilters',64)
additionally sets the number of output channels to 64
for the first
encoder stage.
Use 'same'
padding in convolution layers to maintain the same data
size from input to output and enable the use of a broad set of input image sizes.
Use patch-based approaches for seamless segmentation of large images. You can extract
image patches by using the randomPatchExtractionDatastore
function in Image Processing Toolbox™.
Use 'valid'
padding to prevent border artifacts while you use
patch-based approaches for segmentation.
You can use the network created using unetLayers
function for GPU
code generation after training with trainNetwork
(Deep Learning Toolbox). For details and examples, see Deep Learning Code Generation (Deep Learning Toolbox).
[1] Ronneberger, O., P. Fischer, and T. Brox. "U-Net: Convolutional Networks for Biomedical Image Segmentation." Medical Image Computing and Computer-Assisted Intervention (MICCAI). Vol. 9351, 2015, pp. 234–241.
[2] He, K., X. Zhang, S. Ren, and J. Sun. "Delving Deep Into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification." Proceedings of the IEEE International Conference on Computer Vision. 2015, 1026–1034.
pixelClassificationLayer
| DAGNetwork
(Deep Learning Toolbox) | layerGraph
(Deep Learning Toolbox)deeplabv3plusLayers
| evaluateSemanticSegmentation
| fcnLayers
| segnetLayers
| semanticseg
| trainNetwork
(Deep Learning Toolbox)