Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

MATLAB’s Deep Network Designer lets you build or adapt deep-learning networks visually, inspect their structure, and generate MATLAB code. It reduces the amount of network-construction code you need to write, but it does not choose good data, architecture, or evaluation methods for you. For image classification, a practical workflow is to prepare labeled folders, load a pretrained network, adapt its final layers, analyze and train it, then evaluate it on data held out from training.

The named tutorial, Training Deep Neural Networks using a low-code app in MATLAB, was published in 2021. Its examples—a tabular diabetes classifier and a six-class medical-image classifier—remain useful illustrations, but MATLAB’s app and recommended training workflow have since evolved.

What “low-code” means in MATLAB

Deep Network Designer is a visual environment for creating, editing, analyzing, and preparing deep-learning networks. You can start with a blank network, a template, a pretrained image-classification model, or an imported network. The app can help expose layer connections and dimensions that are hard to reason about in code alone, and it can generate MATLAB code from a designed network.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Low-code does not mean decision-free or universally no-code. You still need to select the input representation, architecture, class count, data split, preprocessing and augmentation, optimizer, learning rate, batch size, training duration, validation method, and hardware. Complex tabular, multimodal, custom-loss, or custom-loop workflows commonly require MATLAB code and datastores even if the network itself is designed visually.

Products and release notes

The central requirements are MATLAB and Deep Learning Toolbox. Other products depend on the task: Parallel Computing Toolbox may be useful for GPU acceleration; image or computer-vision toolboxes can help with specialized preprocessing and vision workflows; Statistics and Machine Learning Toolbox may be relevant to some tabular workflows. Deployment targets may require additional products. Do not assume every toolbox is needed for every model.

The original File Exchange project specifies MATLAB R2021a or later and identifies Parallel Computing Toolbox as necessary for GPU training in that example. Those are project-specific notes, not a guarantee that the interface or every command is identical across releases. Current documentation includes R2026a changes, including a Customize Pretrained Network dialog. In earlier documented workflows, users manually unlocked and edited the final learnable layer. Check the documentation for the MATLAB release installed on your machine.

Two examples—and what they do not prove

The 2021 tutorial demonstrates a fully connected binary classifier using tabular diabetes data and transfer learning for six-way image classification using MedNIST. Its image classes are Hand, AbdomenCT, CXR, ChestCT, BreastMRI, and HeadCT. The examples teach a workflow; they are not a clinical validation study, and the project describes its hyperparameters as illustrative.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The diabetes example is an educational exercise, not a diagnostic tool. A result on a tutorial dataset does not establish clinical utility, fairness, calibration, external validity, or regulatory acceptability. Likewise, classifying an image by modality is not the same task as detecting disease. A model could learn acquisition or dataset-specific artifacts rather than medically meaningful features.

Prepare image data before opening the app

For ordinary image classification, arrange images in one folder per class. MATLAB can infer labels from those folder names:

dataset/
├── class_A/
├── class_B/
└── class_C/

Create an image datastore, inspect the labels and counts, and reserve separate training, validation, and test data. The following split is only an example; choose proportions and a splitting method appropriate to the amount and structure of your data.

imds = imageDatastore("dataset", ...
    IncludeSubfolders=true, ...
    LabelSource="foldernames");

countEachLabel(imds)

[imdsTrain, imdsValidation, imdsTest] = splitEachLabel( ...
    imds, 0.70, 0.15, "randomized");

Check that every split contains the expected classes and that class counts are not badly skewed. A random image-level split can be misleading when several images come from the same patient, person, scene, or acquisition session: related images may land in both training and test sets. In those cases, split by subject or group to reduce leakage. Also check for duplicate and near-duplicate files.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Pretrained networks expect particular input dimensions and channel counts. Use the chosen network’s documented input size or inspect its input layer rather than assuming every model accepts the same shape. To resize images and optionally augment training examples:

inputSize = [224 224 3]; % Example only; use the selected network's input size

augmenter = imageDataAugmenter( ...
    RandXReflection=true, ...
    RandXTranslation=[-30 30], ...
    RandYTranslation=[-30 30]);

augimdsTrain = augmentedImageDatastore( ...
    inputSize(1:2), imdsTrain, ...
    DataAugmentation=augmenter);

augimdsValidation = augmentedImageDatastore( ...
    inputSize(1:2), imdsValidation);

augimdsTest = augmentedImageDatastore( ...
    inputSize(1:2), imdsTest);

These dimensions and augmentation settings are examples, not universal defaults. Augmentation should represent plausible variation. Reflection or rotation can be harmful when orientation matters—for example, text, medical laterality, directional road scenes, or scientific imagery. Keep validation and test inputs representative of real use; do not augment them as though they were training examples.

MathWorks documents folder-based labels, data import, and augmentation in its Deep Network Designer data-import guide. Nonstandard image formats and preprocessing may call for transformed or combined datastores.

Open Deep Network Designer

  1. In MATLAB, run deepNetworkDesigner.
  2. Choose a pretrained image-classification network, template, blank network, or network to import.
  3. Import image data in the app, or prepare datastores in MATLAB and use the supported workflow for your release.
  4. Set up preprocessing and validation data, then adapt the network to the task.
  5. Use Analyze to check the architecture before training.

The exact choices and menu labels vary by release. The app supports visual editing and analysis, but the image-classification import dialog is not a universal interface for every kind of data.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build from scratch or use transfer learning?

A small network built from an image input layer, convolution or fully connected layers, nonlinearities, and an output appropriate to the task can be useful for learning the basics. Its input dimensions and final output must match the data and classification problem. Building from scratch gives you control, but it also means you must choose and tune the architecture and may need more data and training than when adapting a suitable pretrained model.

Transfer learning starts from a network trained on a larger source dataset. Early layers often encode reusable visual features; task-specific final layers are changed to predict the new classes. MathWorks notes that this can make training easier and faster and can be useful with smaller datasets, but success is not guaranteed. It generally works best when the new images resemble the pretraining images. A large domain gap may require unfreezing and fine-tuning more layers, more representative data, or a different approach.

In the app, load a pretrained image-classification network and set the final learnable/output layers for the number of target classes. In R2026a, use the Customize Pretrained Network dialog when available to adjust class count and learning-rate settings. In older documented workflows, select and unlock the final learnable layer, change its output size (or number of filters, as applicable), and raise its weight and bias learning-rate factors so the new task-specific parameters can adapt. Then analyze the edited network.

Do not change the class count alone and assume the model is ready. Confirm that the output layer and loss are appropriate, the labels map to the intended class order, preprocessing matches the pretrained model’s expectations, and the architecture accepts the actual image channels and dimensions. The transfer-learning guide and network-building guide describe the app workflow.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Train: app workflow or generated MATLAB code

You can use the app-centered workflow where it supports the task, or generate code and continue in MATLAB. For current workflows, MathWorks recommends training a dlnetwork with trainnet; current documentation marks trainNetwork as not recommended. trainnet was introduced in R2023b. This matters if you are following a 2021 example verbatim: old scripts and UI instructions should not be treated as the current recommended path.

A representative modern training pattern for a classification network is:

options = trainingOptions("adam", ...
    MaxEpochs=10, ...
    MiniBatchSize=32, ...
    ValidationData=augimdsValidation, ...
    ValidationFrequency=20, ...
    Plots="training-progress", ...
    Metrics="accuracy");

net = trainnet(augimdsTrain, net, "crossentropy", options);

This is a pattern, not a drop-in script for every exported network. Check the installed release’s trainnet documentation and the exported network’s output and target conventions; the loss and data format must fit that network and task. Use validation data during training to monitor generalization, not as a substitute for a final, untouched test set.

GPU training is optional, not automatic. Availability depends on compatible hardware, drivers, MATLAB release, and licensing. For a small demonstration, CPU training may be sufficient. If memory is exhausted, reduce the batch size or input resolution, use a smaller network, or train on a suitable machine. The Deep Learning Toolbox release notes document changes to current workflows.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Evaluate beyond training accuracy

Training accuracy describes fit to the training data; validation accuracy and loss help identify overfitting while tuning; test performance estimates behavior on held-out examples when the test set has not influenced model or parameter choices. Report how the data were split and avoid repeatedly tuning against the test set.

  • Inspect a confusion matrix and per-class precision, recall, and F1, especially when classes are imbalanced.
  • Review misclassified examples for label errors, preprocessing problems, or systematic weaknesses.
  • Check whether confidence scores are reliable enough for the intended use; accuracy alone does not measure calibration.
  • Evaluate on data from a different source or acquisition process when deployment will encounter that variation.
  • For grouped or medical data, ensure that related subjects or sessions do not cross split boundaries.

The File Exchange tutorial does not provide a current, independently verified benchmark that should be presented as a general performance promise. Results depend on the split, preprocessing, architecture, training settings, and data quality.

Tabular data and other problem types

Ordinary numeric tables are less naturally handled by the image-classification import dialog. The diabetes example’s lesson is that tabular predictors and labels must be converted into forms the chosen network and training workflow can consume. MathWorks documents approaches using arrays and datastores such as arrayDatastore and CombinedDatastore. A visually designed fully connected network may be part of the workflow, but preparing and validating table inputs generally takes code.

Deep Network Designer can also be used with supported custom or imported networks, and MATLAB supports importing models from TensorFlow, Keras, PyTorch, ONNX, and Caffe subject to support-package and compatibility constraints. Some regression, segmentation, sequence, and multimodal workflows are possible, but they may require specialized data handling or code. For time-series-specific work, the separate Time Series Modeler app may be more relevant. The app is not a point-and-click replacement for every training loop, custom loss, data format, or deployment pipeline.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Generate code and preserve the workflow

Use Export → Generate Network Code to create a MATLAB live script that recreates the network. When preserving pretrained parameters, the generated workflow can also include a MAT file with initial weights and biases. Running generated code provides a more repeatable artifact than relying on an app session alone. Record the MATLAB release, relevant toolbox versions, data split, preprocessing, training settings, and hardware alongside the script. See MathWorks’ code-generation guide.

Training and deployment are separate steps. MATLAB supports multiple deployment pathways, but generating code in the app does not automatically make a model ready for a CPU, GPU, Simulink, embedded target, or FPGA. Confirm layer and target compatibility and any additional product or licensing requirements for the intended deployment.

Troubleshooting common failures

Analyze reports dimension or connection errors

Check input height, width, and channel count; layer connectivity; output class count; and whether the final learnable and classification layers match the task. For imported models, inspect import warnings and unsupported or automatically generated layers. The app’s analyzer is intended to identify structural problems before training.

Labels are missing or incorrect

Verify folder names, the LabelSource="foldernames" setting, class counts, and the contents of each split. Check for hidden or non-image files and ensure every expected class appears where it should.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Training is unstable or validation performance stalls

Check labels and duplicates first. Then consider lowering the learning rate, reducing batch size, normalizing inputs consistently, freezing more pretrained layers, or adjusting validation frequency. Add augmentation only when its transformations reflect plausible data variation.

GPU is unavailable or memory runs out

Use CPU training if practical, reduce the batch size or image dimensions, or choose a smaller network. For GPU work, check hardware and software compatibility for your MATLAB release rather than assuming installation of the app guarantees acceleration.

An imported framework model behaves differently

Review the import report and verify input preprocessing, normalization, class ordering, and output meaning against the source framework. Unsupported operations or differing preprocessing conventions can change predictions. MathWorks documents external model workflows in its external-platform import guide.

When MATLAB is the right fit

Deep Network Designer is a natural choice when you already work in MATLAB, want visual network inspection, are adapting a conventional pretrained image model, or need to connect deep learning with MATLAB analysis, engineering workflows, Simulink, or MATLAB deployment tooling. It can also serve as an accessible bridge from visual design to generated code.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

PyTorch or TensorFlow may be preferable when you need a research architecture or open-source implementation not yet supported in your MATLAB release, a highly customized training loop, or a workflow centered on a Python ecosystem. The choice need not be permanent: MathWorks supports importing models from several external frameworks, though imported preprocessing and operators still require validation.

Before you trust a model

  • Confirm labels, class counts, image dimensions, channels, and preprocessing.
  • Use a split that prevents subject, scene, or session leakage where relevant.
  • Analyze the network and verify its output matches the task.
  • Keep validation separate from a final held-out test set.
  • Review per-class errors and test beyond accuracy.
  • Export code and record the release, data, settings, and hardware.
  • Document limitations; do not present an educational or modality-classification result as clinical validation.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.