5.0

5.0 | 1 rating Rate this file 175 downloads (last 30 days) File Size: 674.15 KB File ID: #24291

CNN - Convolutional neural network class

by Mihail Sirotenko

 

28 May 2009 (Updated 09 Feb 2010)

Code covered by the BSD License  

This project provides matlab class for implementation of convolutional neural networks.

Download Now | Watch this File

File Information
Description

This project provides matlab class for implementation of convolutional neural networks. This networks was developed by Yann LeCun and have sucessfully used in many practical applications, such as handwritten digits recognition, face detection, robot navigation and others (see references for more info). Because of some architectural features of convolutional networks, such as weight sharing it is imposible to implement it using Matlab Neural Network Toolbox without it's source modifications. That's why this class works almost independently from NN toolbox (coming soon full independence).

This release includes sample of handwritten digits recognition using CNN. If you just want to try it run cnet_tool. You'll see a simple GUI. It loads pretrained convolutional neural net from cnet.mat and recognizes image of digit either painted in painting area or downloaded from MNIST database.

The significant improovement in this version is support of nVidia CUDA technology, which speeds up the training up to 44 times. You'll need a CUDA-capable graphic card and CUDA SDK (especially cudart.dll and cublas.dll). Currently only stochastic gradient is supported by CUDA-training, but Hessian approximation is going to be soon also.
IMPORTANT:since matlabcentral is not allows to include mex-files into submission, you need to download cudacnn.mex (mex32 or mex64) from https://sites.google.com/site/mihailsirotenko/projects/convolutional-neural-network-class for full functionality.
Though without cudacnn.mex this software is also functional in usual way.
To run CUDA-based training use cutrain_cnn.m
The source of cudacnn.mex is not included by now, but I plan to do It in future.
See readme.txt for more details.

Acknowledgements
This submission has inspired the following:
myCNN
Required Products Neural Network Toolbox
MATLAB release MATLAB 7.4 (R2007a)
Other requirements You'll need a CUDA SDK and to download mex-files from external link (see description) in order to enable CUDA features.
Zip File Content  
Other Files
@cnn/adapt_dw.m,
@cnn/calchx.m,
@cnn/calcje.m,
@cnn/calcMCR.m,
@cnn/check_finit_dif.m,
@cnn/cnn.m,
@cnn/cnn_size.m,
@cnn/cutrain.m,
@cnn/init.m,
@cnn/sim.m,
@cnn/subsasgn.m,
@cnn/subsref.m,
@cnn/train.m,
back_conv2.m,
back_subsample.m,
changelog.txt,
cnet.mat,
cnet_tool.m,
cnn2singlestruct.m,
cnn_gui.fig,
cnn_gui.m,
cucalcMCR.m,
cudacnn.mexw32,
cudacnn.mexw64,
cutrain_cnn.m,
fastFilter2.m,
license.txt,
preproc_data.m,
preproc_image.m,
rand_std.m,
readme.txt,
readMNIST.m,
readMNIST_image.m,
rot180.m,
singlestruct2cnn.m,
subsample.m,
tansig_mod.m,
test_dgt.m,
train_cnn.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
28 May 2009 Mihail Sirotenko

New version coming soon. It will include:
1. Trained network for experements.
2. Simple GUI, visualising digits recognition.
3. Improoved performance.
4. Independence from NN Toolbox.

30 Sep 2009 Nikolay Chumerin

Well done! Good job. I think this is the first publicly available implementation of CNN training in Matlab. The source code is written in a pretty good style with extensive comments, which are really useful for such complex classes. This submission is an asset for computer vision Matlab community.

22 Nov 2009 Grigory

22.10.2009 - in current Ver_0.72
- in file train_cnn.m Conv. Layer 4 should have 16 kernels not 6 (sinet.CLayer{4}.numKernels = 6 ) or sinet.CLayer{4}.ConMap shouldn't be 6x16 in size.
- net training result doesn't return "minimal error" net state. I.e. I can see lover error during training than final is. However I apply CNN to different task with my own image set.

23 Nov 2009 Mihail Sirotenko

Thanks a lot for the valuable comment. First bug is a result of merging different versions of CNN used in my experements. About second bug, the problem is in the error calculation. In the new version I'll fix these bugs.

Please login to add a comment or rating.
Updates
09 Feb 2010

1. Support of CUDA-accelerated simulation and training of convolutional neural networks;
2. GUI added, providing RMSE, MCR plots;
3. Ability to choose from 3 training modes added.
See changelog.txt for more.

 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com