Coder Social home page Coder Social logo

alexnet-forwardpath's Introduction

This is a forward-path implementation of the CNN AlexNet. Starting in the ILSVRC 2012 competition, Convolutional Neural Networks (CNNs) are the state-of-the-art algorithm for image classification and detection. The straight-forward Matlab implementation of this CNN's forward path doesn't rely on any 3rd-party library.

Detect images

In your Matlab console, type

alexNetForward

This will run AlexNet in forward path to detect a cat.

Understanding Forward Propagation

There are lots of highly optimized deep learning tools out there, like Berkeley's Caffe, Torch or Alex Krizhevsky's cuda-convnet2. Those tools will help you train and test your CNNs at high speed. However if you are new to deep learning, those tools won't help you much to understand the forward path of a CNN.

The goal of this project is to show you how forward-propagation works exactly in a quick and easy-to-understand way.

Every CNN is a concatenation of different layers. For more details about the different layers of AlexNet, please refer to my post on our research group's web page.

Implementation details

The network is implemented as in the Caffe definition. The data between the layers is stored similar to Matcaffe. Each layer converts a 3d matrix (or 2d matrix for dense layers) bottom into the output top. The data between the layers is stored in width W x height H x channels N matrices. All network parameters are stored in 4d matrices.

Network parameters from Matcaffe

The network parameters are not included in this repository. Before running, please make sure you download the pretrained model from Caffe's Model Zoo. Instructions of the Caffe installation can be found here. More information about Caffe's Matlab wrapper is here: Matcaffe. Once you downloaded the trained weights (bvlc_reference_caffenet.caffemodel) from the Model Zoo, use Matcaffe to extract the weights as *.mat file. In your Matlab console, type:

caffe('init','<caffe-repo>/models/bvlc_reference_caffenet/deploy.prototxt','bvlc_reference_caffenet.caffemodel','test');
weights = caffe('get_weights');
save('alexnet-weights.mat','weights');

When you run AlexNet in forward path, you will be prompted to select the file with those weights.

Resource Files

  • cat.jpg: The detection runs on this image.
  • ilsvrc_2012_mean.mat: The average of the ILSVRC image data base.
  • synset_words.txt: The 1000 ILSVRC image classes.

Citing

Please kindly cite this forward implementation of AlexNet if it helps your research:

Mohammad Motamedi, Philipp Gysel, Venkatesh Akella and Soheil Ghiasi, “Design Space Exploration of FPGA-Based Deep Convolutional Neural Network”, IEEE/ACM Asia-South Pacific Design Automation Conference (ASPDAC), January 2016.

alexnet-forwardpath's People

Contributors

pmgysel avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.