图像深度学习
您可以通过定义网络架构并从头开始训练网络,来创建新的用于图像分类和回归任务的深度网络。您还可以使用迁移学习以利用预训练网络所提供的知识来学习新数据中的新模式。通常来说,使用迁移学习对预训练的图像分类网络进行微调比从头开始训练更快更容易。使用预训练的深度网络,您可以快速学习新任务,而无需定义和训练新网络,也不需要使用数百万个图像或强大的 GPU。
定义网络架构后,必须使用 trainingOptions
函数定义训练参数。然后,您可以使用 trainNetwork
训练网络。使用经过训练的网络预测类标签或数值响应。
您可以在一个 CPU、一个 GPU、多个 CPU 或 GPU 上训练卷积神经网络,或者在集群中并行训练或在云中训练。在 GPU 上训练或并行训练需要 Parallel Computing Toolbox™。使用 GPU 需要支持的 GPU 设备(有关受支持设备的信息,请参阅GPU Support by Release (Parallel Computing Toolbox))。使用 trainingOptions
函数指定执行环境。
App
深度网络设计器 | 设计、可视化和训练深度学习网络 |
函数
模块
属性
ConfusionMatrixChart Properties | Confusion matrix chart appearance and behavior |
示例和操作指南
使用预训练网络
- 使用 GoogLeNet 对图像进行分类
此示例说明如何使用预训练的深度卷积神经网络 GoogLeNet 对图像进行分类。 - 使用深度学习对网络摄像头图像进行分类
此示例说明如何使用预训练的深度卷积神经网络 GoogLeNet 实时对来自网络摄像头的图像进行分类。 - 使用深度网络设计器进行迁移学习
以交互方式微调预训练的深度学习网络以学习新的图像分类任务。 - 训练深度学习网络以对新图像进行分类
此示例说明如何使用迁移学习来重新训练卷积神经网络以对新图像集进行分类。 - 使用预训练网络提取图像特征
此示例说明如何从预训练的卷积神经网络中提取已学习的图像特征,并使用这些特征来训练图像分类器。特征提取是使用预训练深度网络的表征能力的最简单最快捷的方式。例如,您可以使用fitcecoc
(Statistics and Machine Learning Toolbox™) 基于提取的特征来训练支持向量机 (SVM)。由于特征提取只需要遍历一次数据,因此如果没有 GPU 来加速网络训练,则不妨从特征提取开始。 - 使用预训练网络进行迁移学习
此示例说明如何微调预训练的 GoogLeNet 卷积神经网络以对新的图像集合执行分类。 - 预训练的深度神经网络
了解如何下载和使用预训练的卷积神经网络进行分类、迁移学习和特征提取。
创建新的深度网络
- 创建简单的深度学习网络以用于分类
此示例说明如何创建和训练简单的卷积神经网络来进行深度学习分类。卷积神经网络是深度学习的基本工具,尤其适用于图像识别。 - 使用深度网络设计器构建网络
在深度网络设计器中以交互方式构建和编辑深度学习网络。 - 针对回归训练卷积神经网络
此示例说明如何使用卷积神经网络拟合回归模型来预测手写数字的旋转角度。 - 深度学习层列表
探索 MATLAB® 中的所有深度学习层。 - 指定卷积神经网络的层
了解卷积神经网络 (ConvNet) 的层,以及它们在 ConvNet 中出现的顺序。 - Generate MATLAB Code from Deep Network Designer
Generate MATLAB code to recreate designing and training a network in Deep Network Designer. - 训练残差网络进行图像分类
此示例说明如何创建包含残差连接的深度学习神经网络,并针对 CIFAR-10 数据对其进行训练。残差连接是卷积神经网络架构中的常见元素。使用残差连接可以改善网络中的梯度流,从而可以训练更深的网络。 - Train Network with Numeric Features
This example shows how to create and train a simple neural network for deep learning feature data classification. - Multiple-Input and Multiple-Output Networks
Learn how to define and train deep learning networks with multiple inputs or multiple outputs. - 训练生成对抗网络 (GAN)
此示例说明如何训练生成对抗网络来生成图像。 - Train Conditional Generative Adversarial Network (CGAN)
This example shows how to train a conditional generative adversarial network to generate images. - Train Fast Style Transfer Network
This example shows how to train a network to transfer the style of an image to a second image. - Image Captioning Using Attention
This example shows how to train a deep learning model for image captioning using attention. - Train Network Using Custom Training Loop
This example shows how to train a network that classifies handwritten digits with a custom learning rate schedule. - Train Network with Multiple Outputs
This example shows how to train a deep learning network with multiple outputs that predict both labels and angles of rotations of handwritten digits. - Train a Siamese Network to Compare Images
This example shows how to train a Siamese network to identify similar images of handwritten characters. - Import Custom Layer into Deep Network Designer
This example shows how to import a custom classification output layer with the sum of squares error (SSE) loss and add it to a pretrained network in Deep Network Designer. - Image-to-Image Regression in Deep Network Designer
This example shows how to use Deep Network Designer to construct and train an image-to-image regression network for super resolution.
概念
- 在 MATLAB 中进行深度学习
通过使用卷积神经网络进行分类和回归来探索 MATLAB 的深度学习能力,包括预训练网络和迁移学习,以及在 GPU、CPU、集群和云上进行训练。
- 设置参数并训练卷积神经网络
了解如何为卷积神经网络设置训练参数。
- 预处理图像以进行深度学习
了解如何调整图像大小以进行训练、预测和分类,以及如何使用数据增强、变换和专用数据存储对图像进行预处理。
- 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.
- Data Sets for Deep Learning
Discover data sets for various deep learning tasks.
- Import Data into Deep Network Designer
Import and visualize data in Deep Network Designer.