Deep Learning in 11 Lines of MATLAB Code » File Exchange Pick of the Week

Want to try out #deeplearning? Here’s a step-by-step guide to getting started

  • If you are  interested in learning more about deep learning or trying out some of latest deep learning research in MATLAB this blog post will walk you through the first steps to getting started.
  • The entry on File Exchange provides everything you need to download one of the most popular deep neural networks and use it to classify images using live video from a webcam.
  • This post covers how to download a pre-trained deep convolutional neural network and use it to classify images in a live video stream.
  • The AlexNet model is available as a support package in MATLAB, you can learn more about the AlexNet support package from this blog post.
  • Now that we’ve tried the deep learning image classifier on a single image lets try doing the same with a live video stream.

Avi’s pick of the week is Deep Learning in 11 Lines of MATLAB Code by the MathWorks Neural Networks Toolbox Team. This post is follow up to this post by Jiro

@MATLAB: Want to try out #deeplearning? Here’s a step-by-step guide to getting started

Avi’s pick of the week is Deep Learning in 11 Lines of MATLAB Code by the MathWorks Neural Networks Toolbox Team. This post is follow up to this post by Jiro and provides a more detailed explanation.

If you are  interested in learning more about deep learning or trying out some of latest deep learning research in MATLAB this blog post will walk you through the first steps to getting started. The entry on File Exchange provides everything you need to download one of the most popular deep neural networks and use it to classify images using live video from a webcam. Before you read through the rest of this post, I would highly recommend you watch this video by Joe Hicklin (pictured below) that illustrates what I will explain in more detail.

This post covers how to download a pre-trained deep convolutional neural network and use it to classify images in a live video stream.

The pre-trained model I’ll use in this post is known as AlexNet. This model was trained to recognize 1000 different categories of objects in images, and was trained using over a million images. The AlexNet model is available as a support package in MATLAB, you can learn more about the AlexNet support package from this blog post. Now let’s load the pre-trained network into MATLAB.

Now let us take a look at the structure of AlexNet model. Notice that the first layer requires a 227×227 RGB image, and the last layer classifies 1000 different objects.

Before we connect a webcam and try classifying images on a live stream, lets try classifying a single test image.

To classify the input image we use the ‘classify’ function. Since AlexNet expects the input image to be 227×227 let’s resize the input image.

You’ll see that the network accurately classifies the image as a bell pepper. You can also see the prediction score or confidence of the prediction for each of the 1000 classes by outputing the score from the classify method.

Now that we’ve tried the deep learning image classifier on a single image lets try doing the same with a live video stream. We connect to a webcam using the webcam object in MATLAB.

To learn more about deep learning in MATLAB take a look at this page.

Deep Learning in 11 Lines of MATLAB Code » File Exchange Pick of the Week