File Exchange Pick of the Week

Our best user submissions

Deep Learning in 11 Lines

Posted by Jiro Doke,

Jiro‘s pick this week is Deep Learning in 11 Lines of MATLAB Code by the MathWorks Neural Network Toolbox Team.

This is for anyone who would like to dabble in deep learning with minimal effort. There’s also a short video of this in action by one of our senior developers. Note that this sample code requires R2016b or newer, the Neural Network Toolbox, and the Image Processing Toolbox. Neural Network Toolbox is a must to use the trained network, but Image Processing Toolbox is used for image resizing in this example. In addition, you need to download/install the freely available packages for connecting to a webcam and a pre-trained convolutional neural network (CNN) called AlexNet. Both of these can be easily obtained from the Add-On Explorer.

With R2016b, you get some really nice features in the area of deep learning.

  1. CNNs used to require a supported GPU, but now you can run a trained network to extract features, make predictions, and classify on a CPU. GPU is still recommended for a much better performance.
  2. Training a network is a lot of work and time-consuming. Now, you can download a pre-trained network, called AlexNet, to extract features or to adapt to your own problem set, which is referred to as transfer learning.

Just as this entry promises, I was able to do some deep learning on a live image coming in from my webcam, just in 11 lines of MATLAB code.

Seems like I have a coffee mug! :)


Give it a try and let us know what you think here or leave a comment for the NNet Team.

Get the MATLAB code


Comments are closed.