Giter Site home page Giter Site logo

convolutional_neural_network's Introduction

Convolution_Neural_Network

This is an implementation of the CNN, for handwritten character recognition (a-z, A-Z, 0-9), after referring from various online tutorials and codes. This is just a test implementation to understand the working of the CNN. It has been implemented using Tensorflow and is not structured to be used directly. You can refer to this model and device it in your own way.
I have averaged its performance over the test set in the form of batches, and it has a 92.8% accuracy (quite low). Though it has been trained only 12 epochs. You can train it more no. of times from the main program.
The new_train_CNN.py is the main program to start from. It has options where it asks yoou to 1. train, 2. test, 3. predict.
It is based on the Extended-MNIST dataset, which is available for download from Kaggle. You can head over to Kaggle for more options regarding the choice of dataset related to handwritten character recognition. I had the emnist-letter-train.csv and emnist-letter-test.csv where the no. of classes were 37.
Note: This is not some structured implementation of CNN for easy reuse. This is just to get the idea of the working of the CNN.
File description:
ConvolutionNetwork.py --> Include the code definig each component of the convolution block. The code for the structure of the Conv Layer, Pooling Layer, Activation Layer, Dense Layer and the Softmax function is defined here.
Simple_CNN.py --> It is a simple CNN with three Convolution Block: [5X5 32 filters] -> [5X5 64 filters] -> [5X5 128 filters] -> [200 nodes Dense Layer] -> [200 nodes Dense Layer] -> Softmax Layer.
new_train_CNN.py --> Contains the code for training, testing of the network and predicting of character. It is more-or-less commented to help you understand the working sequence.
Dataset_Generator.py --> Helps to read the data from .csv files. I have the code to read the dataset fromt the .csv file and store it in as array, so that during re-traininng or re-testing, I don't have to read from the .csv file again and store in an array. Thus the files: train_data_file.py, train_lable_file.py and test_data_file.py, test_label_file.py will be created only once.
image_preprocess_wCV2.py --> This include all the preprocessing needed to be done to the image to be predicted, using the CV2 library.
Thats probably all of it.
There are some other simple implementation of the CNN that might be easier to understand. But this implementation is more regarding understanding the steps of working of the CNN. If there is any problem, you can mail me your question.

convolutional_neural_network's People

Contributors

crazylazylife avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.