CNN - Convolutional neural network class

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


Updated 24 Oct 2012

View License

NOTE: Next versions of this library is hosted at
The reason is that now it's rather C++/CUDA library with Matlab front-end than a Matlab library.

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.

Further information about the library can be found here:
and here:

Cite As

Mihail Sirotenko (2023). CNN - Convolutional neural network class (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: myCNN

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

readMNIST.m script improved to explicitly check if MNIST library is exist and located in MNIST folder.

Description changed: added the notice about future versions of library.

Matlab 2012a compatibility issues resolved. Dependency from NN toolbox removed.

Compatibility with Matlab 2010 issue fixed (Thanks to Silvio Filipe)

Fixed bug with extra output error in non-cuda training example

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.