Deep Learning with Images
Create new deep networks for image classification and regression tasks by defining the network architecture and training the network from scratch. You can also use transfer learning to take advantage of the knowledge provided by a pretrained network to learn new patterns in new data. Fine-tuning a pretrained image classification network with transfer learning is typically much faster and easier than training from scratch. Using pretrained deep networks enables you to quickly learn new tasks without defining and training a new network, having millions of images, or having a powerful GPU.
After defining the network architecture, you must define training
parameters using the
trainingOptions function. You
can then train the network using
trainNetwork. Use the trained
network to predict class labels or numeric responses.
You can train a convolutional neural network on a CPU, a GPU, multiple
CPUs or GPUs, or in parallel on a cluster or in the cloud. Training on a GPU
or in parallel requires Parallel Computing Toolbox™. Using a GPU requires a supported GPU device (for information
on supported devices, see GPU Support by Release (Parallel Computing Toolbox)).
Specify the execution environment using the
|Deep Network Designer||Design, visualize, and train deep learning networks|
|SqueezeNet convolutional neural network|
|GoogLeNet convolutional neural network|
|Inception-v3 convolutional neural network|
|DenseNet-201 convolutional neural network|
|MobileNet-v2 convolutional neural network|
|ResNet-18 convolutional neural network|
|ResNet-50 convolutional neural network|
|ResNet-101 convolutional neural network|
|Xception convolutional neural network|
|Pretrained Inception-ResNet-v2 convolutional neural network|
|Pretrained NASNet-Large convolutional neural network|
|Pretrained NASNet-Mobile convolutional neural network|
|Pretrained ShuffleNet convolutional neural network|
|DarkNet-19 convolutional neural network|
|DarkNet-53 convolutional neural network|
|EfficientNet-b0 convolutional neural network|
|AlexNet convolutional neural network|
|VGG-16 convolutional neural network|
|VGG-19 convolutional neural network|
|Image input layer|
|3-D image input layer|
|Feature input layer|
Convolution and Fully Connected Layers
|2-D convolutional layer|
|3-D convolutional layer|
|2-D grouped convolutional layer|
|Transposed 2-D convolution layer|
|Transposed 3-D convolution layer|
|Fully connected layer|
|Rectified Linear Unit (ReLU) layer|
|Leaky Rectified Linear Unit (ReLU) layer|
|Clipped Rectified Linear Unit (ReLU) layer|
|Exponential linear unit (ELU) layer|
|Hyperbolic tangent (tanh) layer|
Normalization, Dropout, and Cropping Layers
|Batch normalization layer|
|Group normalization layer|
|Instance normalization layer|
|Layer normalization layer|
|Channel-wise local response normalization layer|
|2-D crop layer|
|3-D crop layer|
Pooling and Unpooling Layers
|Average pooling layer|
|3-D average pooling layer|
|2-D global average pooling layer|
|3-D global average pooling layer|
|Global max pooling layer|
|3-D global max pooling layer|
|Max pooling layer|
|3-D max pooling layer|
|Max unpooling layer|
|Depth concatenation layer|
|Graph of network layers for deep learning|
|Plot neural network layer graph|
|Add layers to layer graph|
|Remove layers from layer graph|
|Replace layer in layer graph|
|Connect layers in layer graph|
|Disconnect layers in layer graph|
|Directed acyclic graph (DAG) network for deep learning|
|Create 2-D residual network|
|Create 3-D residual network|
|Check equality of deep learning layer graphs or networks|
|Check equality of deep learning layer graphs or networks ignoring
|Classify data using trained deep learning neural network|
|Predict responses using trained deep learning neural network|
|Compute deep learning network layer activations|
|Create confusion matrix chart for classification problem|
|Sort classes of confusion matrix chart|
|ConfusionMatrixChart Properties||Confusion matrix chart appearance and behavior|
Examples and How To
Use Pretrained Networks
- Classify Image Using GoogLeNet
This example shows how to classify an image using the pretrained deep convolutional neural network GoogLeNet.
- Classify Webcam Images Using Deep Learning
This example shows how to classify images from a webcam in real time using the pretrained deep convolutional neural network GoogLeNet.
- Transfer Learning with Deep Network Designer
Interactively fine-tune a pretrained deep learning network to learn a new image classification task.
- Train Deep Learning Network to Classify New Images
This example shows how to use transfer learning to retrain a convolutional neural network to classify a new set of images.
- Extract Image Features Using Pretrained Network
This example shows how to extract learned image features from a pretrained convolutional neural network and use those features to train an image classifier.
- Transfer Learning Using Pretrained Network
This example shows how to fine-tune a pretrained GoogLeNet convolutional neural network to perform classification on a new collection of images.
- Pretrained Deep Neural Networks
Learn how to download and use pretrained convolutional neural networks for classification, transfer learning and feature extraction.
Create New Deep Network
- Create Simple Deep Learning Network for Classification
This example shows how to create and train a simple convolutional neural network for deep learning classification.
- Build Networks with Deep Network Designer
Interactively build and edit deep learning networks in Deep Network Designer.
- Train Convolutional Neural Network for Regression
This example shows how to fit a regression model using convolutional neural networks to predict the angles of rotation of handwritten digits.
- 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
Generate MATLAB code to recreate designing and training a network in Deep Network Designer.
- Train Residual Network for Image Classification
This example shows how to create a deep learning neural network with residual connections and train it on CIFAR-10 data.
- Train Network on Image and Feature Data
This example shows how to train a network that classifies handwritten digits using both image and feature input data.
- 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.
- Train Generative Adversarial Network (GAN)
This example shows how to train a generative adversarial network to generate images.
- 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.
- 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.
- Convert Classification Network into Regression Network
This example shows how to convert a trained classification network into a regression network.
- 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.