Skip to content

A simple and extensible image recognition neural network framework

Notifications You must be signed in to change notification settings

VectorFist/MicroNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MicroNet

A simple and extensible neural network framework, which be used for image classification and image generation. lenet5 gans

In this repository, I implemented a simple and extensible neural network framework with c++, which can be used flexibly to build image recognition neural networks and sample Generative Adversarial Networks(Gans). It is easy to extend this MicroNet to new data sets and new network structures, as long as you provider new datasets and custom network structure(just like keras). Four optimization algorithms are implemented: SGD, Adam, AdaGrad, RMSProb.

As a test experiment of this framework, I implemented a simple Lenet5 network.The experimental results of the four optimization algorithms are as follows. It can be seen that Adam has achieved the best test accuracy 99.25% (99.05% in Lecun's original paper Gradient-Based Learning Applied to Document Recognition). This also reflects the superiority of the Adam algorithm, which is less sensitive to the choice of optimizing superparameters.I also implemented a network with the same configuration using tensorflow. Adam algorithm is used to train the network. The final test accuracy is 99.1%, and the training speed is 28ms/iter(batch size 32), which is faster than my implementation (30ms/iter).

In addition, I also implemented a simple generated adversarial network for generating mnist data. Experimental result shows, the GansNet is implemented correctly and training is stable.

LeNet5

accuracy accuracy loss loss

Gans

loss train loss fake mnist images

fake mnist images

Requirements

  • g++ >= 4.7

Usage

Step 1. Clone this repository with git.

$ git clone https://github.com/VectorFist/MicroNet.git
$ cd MicroNet

Step 2. Download the MNIST dataset, extract it into data directory.

$ sh get_mnist.sh

Step 3. Build and train.

$ make
$ ./lenet5

About

A simple and extensible image recognition neural network framework

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages