本页对应的英文页面已更新,但尚未翻译。 若要查看最新内容,请点击此处访问英文页面。

图像深度学习

从头开始训练卷积神经网络或使用预训练的网络快速学习新任务

您可以通过定义网络架构并从头开始训练网络,来创建新的用于图像分类和回归任务的深度网络。您还可以使用迁移学习以利用预训练网络所提供的知识来学习新数据中的新模式。通常来说,使用迁移学习对预训练的图像分类网络进行微调比从头开始训练更快更容易。使用预训练的深度网络,您可以快速学习新任务,而无需定义和训练新网络,也不需要使用数百万个图像或强大的 GPU。

定义网络架构后,必须使用 trainingOptions 函数定义训练参数。然后,您可以使用 trainNetwork 训练网络。使用经过训练的网络预测类标签或数值响应。

您可以在一个 CPU、一个 GPU、多个 CPU 或 GPU 上训练卷积神经网络,或者在群集中并行训练或在云中训练。在 GPU 上训练或并行训练需要 Parallel Computing Toolbox™。使用 GPU 训练需要具有 3.0 或更高计算能力的支持 CUDA® 的 NVIDIA® GPU。使用 trainingOptions 函数指定执行环境。

App

Deep Network DesignerEdit and build deep learning networks

函数

全部展开

trainingOptionsOptions for training deep learning neural network
trainNetworkTrain neural network for deep learning
analyzeNetworkAnalyze deep learning network architecture
alexnetPretrained AlexNet convolutional neural network
vgg16Pretrained VGG-16 convolutional neural network
vgg19Pretrained VGG-19 convolutional neural network
squeezenetPretrained SqueezeNet convolutional neural network
googlenetPretrained GoogLeNet convolutional neural network
inceptionv3Pretrained Inception-v3 convolutional neural network
densenet201Pretrained DenseNet-201 convolutional neural network
mobilenetv2Pretrained MobileNet-v2 convolutional neural network
resnet18Pretrained ResNet-18 convolutional neural network
resnet50Pretrained ResNet-50 convolutional neural network
resnet101Pretrained ResNet-101 convolutional neural network
xceptionPretrained Xception convolutional neural network
inceptionresnetv2Pretrained Inception-ResNet-v2 convolutional neural network
imageInputLayerImage input layer
image3dInputLayer3-D image input layer
convolution2dLayer2-D convolutional layer
convolution3dLayer3-D convolutional layer
groupedConvolution2dLayer2-D grouped convolutional layer
transposedConv2dLayerTransposed 2-D convolution layer
transposedConv3dLayerTransposed 3-D convolution layer
fullyConnectedLayerFully connected layer
reluLayerRectified Linear Unit (ReLU) layer
leakyReluLayerLeaky Rectified Linear Unit (ReLU) layer
clippedReluLayerClipped Rectified Linear Unit (ReLU) layer
eluLayerExponential linear unit (ELU) layer
tanhLayerHyperbolic tangent (tanh) layer
batchNormalizationLayerBatch normalization layer
crossChannelNormalizationLayer Channel-wise local response normalization layer
dropoutLayerDropout layer
averagePooling2dLayerAverage pooling layer
averagePooling3dLayer3-D average pooling layer
maxPooling2dLayerMax pooling layer
maxPooling3dLayer3-D max pooling layer
maxUnpooling2dLayerMax unpooling layer
additionLayerAddition layer
concatenationLayerConcatenation layer
depthConcatenationLayerDepth concatenation layer
softmaxLayerSoftmax layer
classificationLayerClassification output layer
regressionLayerCreate a regression output layer
augmentedImageDatastoreTransform batches to augment image data
imageDataAugmenterConfigure image data augmentation
augmentApply identical random transformations to multiple images
layerGraphGraph of network layers for deep learning
plotPlot neural network layer graph
addLayersAdd layers to layer graph
removeLayersRemove layers from layer graph
replaceLayerReplace layer in layer graph
connectLayersConnect layers in layer graph
disconnectLayersDisconnect layers in layer graph
DAGNetworkDirected acyclic graph (DAG) network for deep learning
classifyClassify data using a trained deep learning neural network
activationsCompute deep learning network layer activations
predictPredict responses using a trained deep learning neural network
confusionchartCreate confusion matrix chart for classification problem
ConfusionMatrixChart PropertiesConfusion matrix chart appearance and behavior
sortClassesSort classes of confusion matrix chart

示例和操作指南

使用预训练网络

使用 GoogLeNet 对图像进行分类

此示例说明如何使用预训练的深度卷积神经网络 GoogLeNet 对图像进行分类。

使用深度学习对网络摄像机图像进行分类

此示例说明如何使用预训练的深度卷积神经网络 GoogLeNet 实时对来自网络摄像机的图像进行分类。

Transfer Learning with Deep Network Designer

Interactively fine-tune a pretrained deep learning network to learn a new image classification task.

训练深度学习网络以对新图像进行分类

此示例说明如何使用迁移学习来重新训练卷积神经网络以对新图像集进行分类。

使用预训练网络提取图像特征

此示例说明如何从预训练的卷积神经网络中提取已学习的图像特征,并使用这些特征来训练图像分类器。特征提取是使用预训练深度网络的表征能力的最简单最快捷的方式。例如,您可以使用 fitcecoc(Statistics and Machine Learning Toolbox™) 基于提取的特征来训练支持向量机 (SVM)。由于特征提取只需要遍历一次数据,因此如果没有 GPU 来加速网络训练,则不妨从特征提取开始。

使用 AlexNet 进行迁移学习

此示例说明如何微调预训练的 AlexNet 卷积神经网络以对新的图像集合执行分类。

Pretrained Deep Neural Networks

Learn how to download and use pretrained convolutional neural networks for classification, transfer learning and feature extraction.

创建新的深度网络

创建简单的深度学习网络以用于分类

此示例说明如何创建和训练简单的卷积神经网络来进行深度学习分类。卷积神经网络是深度学习的基本工具,尤其适用于图像识别。

Build Networks with Deep Network Designer

Interactively build and edit deep learning networks.

针对回归训练卷积神经网络

此示例说明如何使用卷积神经网络拟合回归模型来预测手写数字的旋转角度。

List of Deep Learning Layers

Discover all the deep learning layers in MATLAB®.

Specify Layers of Convolutional Neural Network

Learn about the layers of a convolutional neural network (ConvNet), and the order they appear in a ConvNet

Generate MATLAB Code from Deep Network Designer

Recreate a network created or edited in Deep Network Designer by generating MATLAB code.

训练残差网络进行图像分类

此示例说明如何创建包含残差连接的深度学习神经网络,并针对 CIFAR-10 数据对其进行训练。残差连接是卷积神经网络架构中的常见元素。使用残差连接可以改善网络中的梯度流,从而可以训练更深的网络。

概念

Deep Learning in MATLAB

Discover deep learning capabilities in MATLAB using convolutional neural networks for classification and regression, including pretrained networks and transfer learning, and training on GPUs, CPUs, clusters, and clouds.

Set Up Parameters and Train Convolutional Neural Network

Learn how to set up training parameters for a convolutional neural network

Preprocess Images for Deep Learning

Learn how to resize images for training, prediction, and classification, and how to preprocess images using data augmentation, transformations, and specialized datastores.

Preprocess Volumes for Deep Learning

Read and preprocess volumetric image and label data for 3-D deep learning.

Datastores for Deep Learning

Learn how to use datastores in deep learning applications.

将分类网络转换为回归网络

此示例说明如何将经过训练的分类网络转换为回归网络。

Deep Learning Tips and Tricks

Learn how to improve the accuracy of deep learning networks.

特色示例