Deep learning algorithms can learn discriminative features directly from data such as images, text, and signals. These algorithms can be used to build highly accurate classifiers when trained on large labeled training data sets. Neural Network Toolbox™ supports training convolutional neural network and autoencoder deep learning algorithms for image classification and feature learning tasks.
Convolutional neural networks (CNNs) eliminate the need for manual feature extraction by removing features directly from raw images. This automated feature extraction makes CNN models highly accurate for computer vision tasks such as object classification. Neural Network Toolbox provides functions for constructing and training CNNs, as well as making predictions with a trained CNN model.
Autoencoders can be used for unsupervised feature transformation by extracting low-dimensional features from your data set. You can also use autoencoders for supervised learning by training several encoders and stacking them as a deep network to increase classification accuracy.
A CNN model learns feature representations from your data during the training process. You can visualize what the learned features look like by using
deepDreamImage to generate images that strongly activate a particular channel of the network layers.
You can speed up neural network training and simulation of large data sets by using Neural Network Toolbox with Parallel Computing Toolbox™. Training and simulation involve many parallel computations, which can be accelerated with multicore processors, CUDA-enabled NVIDIA graphics processing units (GPUs), and computer clusters with multiple processors and GPUs. A GPU is required to train deep convolutional neural networks.
For deep neural networks, Neural Network Toolbox in conjunction with Parallel Computing Toolbox offers built-in GPU support to minimize training time. Training deep networks is computationally intensive, and you can usually accelerate training by using high-performance GPUs. You can train a convolutional neural network on either a single GPU, multiple GPUs, or in parallel on a GPU cluster. MATLAB® supports most CUDA-enabled NVIDIA GPUs with compute capability 3.0 or higher for training deep neural networks. You can also use MATLAB to perform deep learning in the cloud using Amazon EC2® with new P2 instances.
You can speed up deep learning by using the Cloud Center to run MATLAB on Amazon EC2 machines. The above plot shows that the parallel performance of these GPU instances scales well with the number of workers.
For classical neural networks, Parallel Computing Toolbox enables Neural Network Toolbox simulation and training to be parallelized across the multiprocessors and cores of a general-purpose GPU. GPUs are highly efficient on parallel algorithms such as neural networks. You can achieve higher levels of parallelism by using multiple GPUs or GPUs and processors together. With MATLAB Distributed Computing Server™ you can harness all the processors and GPUs on a network cluster of computers for neural network training and simulation. Learn more about GPU computing with MATLAB.
Parallel Computing Toolbox lets neural network training and simulation run across multiple processor cores on a single PC, or across multiple processors on multiple computers on a network using MATLAB Distributed Computing Server. Using multiple cores can speed up calculations. Using multiple computers enables you to solve problems using data sets too big to fit within the system memory of any single computer. The only limit to problem size is the total system memory available across all computers.
Neural Network Toolbox includes command-line functions and apps for creating, training, and simulating neural networks. The apps make it easy to develop neural networks for tasks such as classification, regression (including time series regression), and clustering. After creating your networks in these tools, you can automatically generate MATLAB code to capture your work and automate tasks.
Neural Network Toolbox supports a variety of supervised and unsupervised network architectures. With the toolbox’s modular approach to building networks, you can develop custom network architectures for your specific problem. You can view the network architecture including all inputs, layers, outputs, and interconnections.
Supervised neural networks are trained to produce desired outputs in response to sample inputs, making them particularly well suited for modeling and controlling dynamic systems, classifying noisy data, and predicting future events. Neural Network Toolbox includes four types of supervised networks: feedforward, radial basis, dynamic, and learning vector quantization.
Feedforward networks have one-way connections from input to output layers. They are most commonly used for prediction, pattern recognition, and nonlinear function fitting. Supported feedforward networks include feedforward backpropagation, cascade-forward backpropagation, feedforward input-delay backpropagation, linear, and perceptron networks.
Radial basis networks provide an alternative, fast method for designing nonlinear feedforward networks. Supported variations include generalized regression and probabilistic neural networks.
Dynamic networks use memory and recurrent feedback connections to recognize spatial and temporal patterns in data. They are commonly used for time series prediction, nonlinear dynamic system modeling, and control systems applications. Prebuilt dynamic networks in the toolbox include focused and distributed time-delay, nonlinear autoregressive (NARX), layer-recurrent, Elman, and Hopfield networks. The toolbox also supports dynamic training of custom networks with arbitrary connections.
Learning vector quantization (LVQ) networks use a method for classifying patterns that are not linearly separable. LVQ lets you specify class boundaries and the granularity of classification.
Unsupervised neural networks are trained by letting the network continually adjust itself to new inputs. They find relationships within data and can automatically define classification schemes. Neural Network Toolbox includes two types of self-organizing, unsupervised networks: competitive layers and self-organizing maps.
Competitive layers recognize and group similar input vectors, enabling them to automatically sort inputs into categories. Competitive layers are commonly used for classification and pattern recognition.
Self-organizing maps learn to classify input vectors according to similarity. Like competitive layers, they are used for classification and pattern recognition tasks; however, they differ from competitive layers because they are able to preserve the topology of the input vectors, assigning nearby inputs to nearby categories.
Training and learning functions are mathematical procedures used to automatically adjust the network's weights and biases. The training function dictates a global algorithm that affects all the weights and biases of a given network. The learning function can be applied to individual weights and biases within a network.
Neural Network Toolbox supports a variety of training algorithms, including several gradient descent methods, conjugate gradient methods, the Levenberg-Marquardt algorithm (LM), and the resilient backpropagation algorithm (Rprop). The toolbox’s modular framework lets you quickly develop custom training algorithms that can be integrated with built-in algorithms. While training your neural network, you can use error weights to define the relative importance of desired outputs, which can be prioritized in terms of sample, time step (for time series problems), output element, or any combination of these. You can access training algorithms from the command line or via apps that show diagrams of the network being trained and provide network performance plots and status information to help you monitor the training process.
A suite of learning functions, including gradient descent, Hebbian learning, LVQ, Widrow-Hoff, and Kohonen is also provided.
Preprocessing the network inputs and targets improves the efficiency of neural network training. Postprocessing enables detailed analysis of network performance. Neural Network Toolbox provides preprocessing and postprocessing functions and Simulink® blocks that enable you to:
Improving the network’s ability to generalize helps prevent overfitting, a common problem in neural network design. Overfitting occurs when a network has memorized the training set but has not learned to generalize to new inputs. Overfitting produces a relatively small error on the training set but a much larger error when new data is presented to the network.
Neural Network Toolbox provides two solutions to improve generalization:
Neural Network Toolbox provides two separate ways to deploy a trained network to production. One way is to use MATLAB Coder™ to generate C and C++ code, allowing you to simulate a trained network on PC hardware and embedded devices. Another way is to use MATLAB Compiler™ and MATLAB Compiler SDK™ products to deploy trained networks as C/C++ shared libraries, Microsoft® .NET assemblies, Java® classes, and Python® packages from MATLAB programs.
By using Neural Network Toolbox with MATLAB Coder and MATLAB Compiler products, you can prepare your trained network for deployment to a wide range of production environments.
Neural Network Toolbox provides a set of blocks for building neural networks in Simulink. All blocks are compatible with Simulink Coder™. These blocks are divided into four libraries:
Alternatively, you can create and train your networks in the MATLAB environment and automatically generate network simulation blocks for use with Simulink. This approach also enables you to view your networks graphically.
You can apply neural networks to the identification and control of nonlinear systems. The toolbox includes descriptions, examples, and Simulink blocks for three popular control applications:
You can incorporate neural network predictive control blocks included in the toolbox into your Simulink models. By changing the parameters of these blocks, you can tailor the network's performance to your application.