Objective of this work was to write the Convolutional Neural Network
without using any Deep Learning Library to gain insights of what is actually happening and thus the algorithm is not optimised enough and hence is slow on large dataset like CIFAR-10.
This piece of code could be used for learning purpose
and could be implemented with trained parameter available in the respective folders for any testing applications like Object Detection
and Digit recognition
.
It's Accuracy on MNIST test set is above 97%.
INPUT - CONV1 - RELU - CONV2 - RELU- MAXPOOL - FC1 - OUT
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Numpy - Multidimensioanl Mathematical Computing
- Matplotlib - Used to plot Graph
- Pickle - Used to save trained models/object
- MNIST Dataset - Dataset for Digit Recognition
- CIFAR-10 Dataset - Dataset for Object Recognition
Followings are also required if working/testing on the app.py
- Flask - A microframework for Python
- Gunicorn - A Python WSGI HTTP Server for UNIX
- OpenCV - An open-source library that includes several hundreds of computer vision algorithms
- Clone the repository
git clone https://github.com/zishansami102/CNN-from-Scratch
- Downlad the dataset and copy that to it's corresponding folder(CIFAR-10/MNIST).
- Move into the required directory (/CNN-from-Scratch/MNIST or /CNN-from-Scratch/CIFAR-10) and then run the following command to start training model
python train.py
Output:
- To load pre-trained models, change the pickle filename from 'output.pickle' to 'trained.pickle' in run.py:
line No. - 30-31
and comment out the training part form the code in run.py:line No. - 42-111
- In the the directory /CNN-from-Scratch run the following command.
python app.py
App will start running on the local server http://127.0.0.1:5000 as shown below :
Mail me at [email protected] if you want to contribute to this project
- CS231n.stanford.edu - Most of the theorotical concepts are taken from here
- dorajam - Used to gain more concepts
- Mathematical Concepts - Still need to be implemented, but helpful to gain insight
Makeweb.ai - Build websites with AI, publish in seconds EazySEO.co - Automate your SEO start to end