• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to footer

GitopsCentral

  • Home
  • Courses
  • Roadmap
  • About
  • Log In
  • Sign Up

Deep Learning: Image classification using Alexnet

February 28, 2019 by shaik zillani

In this blog post we will discuss how to do image classification using MATLAB, Let’s begin.

deep learning vs machine learning

What is deep learning?

Deep learning is a subset of machine learning in Artificial Intelligence (AI) that has networks capable of learning unsupervised from data that is unstructured or unlabeled. Also known as Deep Neural Learning or Deep Neural Network.

Prerequisites

  • Deep learning tool box
  • Alexnet add-on

Installing Alexnet Add-on

You can install this add-on from the menu, home->addons and search for alexnet and click on install.

Image classification using Alexnet

Alexnet is a CNN (Convolution Neural Network) designed in 2012 at University of Toronto, read more about it here

Matlab’s deep learning toolbox has this built-in function which can be used for image classification, consider the example below,

Create a new script from the menu, New -> Script and copy the following snippet in the script and execute it using runicon.

Make sure that the image is present in the directory where the script is saved, if not you can define in a more concrete manner like $User/Pictures/monkey.jpegfor linux and –E:/monkey.jpegdepending on where you have it saved. So, let’s create the script from the snippet below and save it to say, alexExample.m

net=alexnet;
I = imread('monkey.jpeg');
I = imresize(I, [227,227]);
sz = net.Layers(1).InputSize;
I = I(1:sz(1),1:sz(2),1:sz(3));
figure
imshow(I)
label = classify(net,I)

Please note that the size of picture should be equal to the network in order for it to evaluate. This is a condition, so we need to resize & crop it to that size. The image size here 227 x 227 is hard-coded based on the size of the neural network.

Result

label = 

  categorical

     macaque 

Finally, as we can see that the output displays the resized image with the classification result macaque

Please make sure that you have deep learning toolbox and alexnet addon already installed on your matlab before starting this example.

matlab deep learning,  matlab

Primary Sidebar

en English
ar Arabiczh-CN Chinese (Simplified)nl Dutchen Englishfr Frenchde Germanhi Hindiid Indonesianit Italianja Japanesems Malaypt Portugueseru Russianes Spanishte Telugu

Course Tags

concurrency free go golang

Recent Posts

  • Roadmap to Mastery
  • Increase SSH connection timeout
  • Check Certificate expiry in Kubernetes
  • space invaders in golang
  • creating kubernetes cluster using eksctl
  • Facebook
  • GitHub
  • YouTube

Contact

Navigation

  • goacademy pro

Footer

  • Facebook
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter

info@gitopscentral.com


+91 8341443220

© Copyright 2016-2024 gitopscentral · All Rights Reserved ·