Skip to content

A convolutional nerual network trained from scratch (yes, even backprop) on the CIFAR 10 image dataset

License

Notifications You must be signed in to change notification settings

SamKirkiles/CNN-CIFAR10

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CNN-CIFAR10 From Scratch

A convolutional nerual net trained from scratch in pure python/numpy on the CIFAR 10 image dataset. I was able to achieve 70% accuracy on both validation and test sets trained with a shallow architecture on my 2013 Macbook's CPU (yikes).

CIFAR-10

I used Tensorboard without Tensorflow for graphing accuracy and cost during training. This information is written to the out.graph file.

Clone the repository and run python main.py after installing dependencies. The CIFAR 10 dataset should download into the correct folder automatically. There are some boolean variables at the top of the main.py which can be set to switch between training and testing.

Here is a list of some features I implemented for faster training:

  • Adam optimization algorithm
  • Batchnorm after every convolution
  • Xavier weight initialization (essential)
Layer Details
Conv Stride: 1 Pad: 1 Weight: 3x3x16
Batchnorm
Relu
Pool Stride:2 Width/Height: 2
Conv Stride: 1 Pad: 1 Weight: 3x3x16
Batchnorm
Relu
Pool Stride:2 Width/Height: 2
Conv Stride: 1 Pad: 1 Weight: 3x3x16
Batchnorm
Relu
Pool Stride:2 Width/Height: 2
Fully Connected Reshape to column vector
Softmax

Example Classification

About

A convolutional nerual network trained from scratch (yes, even backprop) on the CIFAR 10 image dataset

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages