Main Content

Build Networks with Deep Network Designer

Build and edit deep learning networks interactively using the Deep Network Designer app. Using this app, you can:

  • Import and edit networks.

  • Build new networks from scratch.

  • Add new layers and create new connections.

  • View and edit layer properties.

  • Combine networks.

  • Import custom layers.

  • Generate MATLAB® code to create the network architecture.


Starting with a pretrained network and fine-tuning it with transfer learning is usually much faster and easier than training a new network from scratch. For an example showing how to perform transfer learning with a pretrained network, see Transfer Learning with Deep Network Designer.

Open App and Import Networks

To open Deep Network Designer, on the Apps tab, under Machine Learning and Deep Learning, click the app icon. Alternatively, you can open the app from the command line:


If you want to modify or copy an existing pretrained network, you can select it from the Deep Network Designer Start Page. From the Start Page, you can also select an untrained sequence network, load a network from the workspace, or build a network from scratch.

After you select a network, Deep Network Designer opens the network and displays a zoomed-out view.

The Designer pane of Deep Network Designer is where you can construct, edit, and analyze your network. In the app, you can use any of the built-in layers to build a network. You can also work with a custom layer by creating it at the command line and then importing it into the app. For an example of constructing a network in Deep Network Designer with a custom output layer, see Import Custom Layer into Deep Network Designer. For a list of available layers and examples of custom layers, see List of Deep Learning Layers.

Return to the Start Page from the Designer tab by clicking New.

Create and Edit Network

Assemble a network by dragging blocks from the Layer Library and connecting them.

You can also add layers from the workspace to the network in the Designer pane.

  1. Click New.

  2. Pause on From Workspace and click Import.

  3. Choose the layers or network to import and click OK.

  4. Click Add to add the layers or network to the Designer pane.

  5. Connect the new layers.

You can also combine pretrained networks by clicking New and selecting them from the start page.

To view and edit layer properties, select a layer. Click the help icon next to the layer name for information on the layer properties.

For information on all layer properties, click the layer name in the table on the List of Deep Learning Layers page. For tips on selecting a suitable network architecture, see Deep Learning Tips and Tricks.

You can work with blocks of layers at a time. Select multiple layers, then copy and paste or delete. For example, you can use blocks of layers to create multiple copies of groups of convolution, batch normalization, and ReLU layers. You can add layers to the end of pretrained networks to make them deeper. Alternatively, you can edit a pretrained network to simplify it. For example, you can create a simpler network by deleting units of layers, such as inception modules, from a GoogLeNet network.

For trained networks, copying layers also copies the weights and the biases.

Check Network

To check the network and examine the layers in further detail, on the Designer tab, click Analyze. Investigate problems and examine the layer properties to resolve size mismatches in the network. Return to Deep Network Designer to edit layers, then check the results by clicking Analyze again. If Deep Learning Network Analyzer reports zero errors, then the edited network is ready for training.

Train Network

You can import data and train the network using Deep Network Designer. On the Data tab, select the data on which you want to train the network. Select Import Data > Import Image Data to import an ImageDatastore object from the workspace, or a folder containing subfolders of images by class. Select Import Data > Import Datastore to import a built-in or custom datastore from the workspace. For more information, see Import Data into Deep Network Designer.

After you import your data, train the network by selecting the Training tab and clicking Train. Deep Network Designer copies the network you construct in the Designer pane and then trains the network using the imported data. If you want greater control over the training, modify the training options by clicking Training Options. For more information on importing data and training a network constructed in Deep Network Designer, see Transfer Learning with Deep Network Designer.


Deep Network Designer can train networks on image data or datastore objects. For an example showing how to export a network and train it for sequence classification problems, see Create Simple Sequence Classification Network Using Deep Network Designer.

Export Network

To export the untrained network to the workspace for training, on the Designer tab, click Export. Deep Network Designer exports the network to a new variable containing the edited network layers.

For command-line examples showing how to set training options and assess trained network accuracy, see Create Simple Deep Learning Network for Classification and Train Residual Network for Image Classification.

To export the trained network to the workspace, on the Training tab, click Export. The exported network has layers with weights trained by Deep Network Designer.

Generate MATLAB Code

Using Deep Network Designer, you can generate MATLAB code to recreate the network construction and training performed in the app.

For an example showing how to generate MATLAB code that recreates the network architecture, see Generate MATLAB Code to Recreate Network Layers.

For an example showing how to generate MATLAB code that recreates the network architecture and the network training, see Generate MATLAB Code to Train Network.

See Also

Related Topics