Project: Neural Network

This project was my summer challenge which I created because I was and still am excited about neural networks, how they work and what can you do with them.

I wanted to create my first working neural network from scratch and don’t use any libraries which have neural network already implemented. I knew I would need lot of detailed explaining and because of this I decided to find my source of information.

Besides programmers who share their works and ideas on websites, YouTube etc. I decided to find relatively easy to go by book which explains some basics principles. I found a book called Make Your Own Neural Network by Tariq Rashid, who explains Neural Networks in such a way that is easy to follow and has also a lot of examples you can learn from.

After reading this book I built up some basic understanding and in the and programmed my own Neural Network in python using mathematical libraries as NumPy for matrix multiplication and matplotlib for plotting and visualizing inputs/outputs.

I followed the book and focused on creating neural network for digit recognition using MNIST dataset, which contains thousands of hand-written digits stored as a numbers of pixel values in black and white spectrum from 0-255.

After different ways of training I could get some interesting success rates which were over 90% on the training dataset. I was really happy that I could create something like this and so can anybody. I can now use my basic understanding to continue extending my knowledge in this area.

I continued using my camera as an import device for the network so I could recognize numbers in real time. I used openCV library and it was simply cropping middle part of the camera input, smoothing it out, clearing the bacground using threshold function and then convert it to the desired input which is a picture of a size 28x28.

My neural network isnt too robust one way to improve it would be to add biases. This neural network should consist of a series of linear functions y = ax + b but my neural network consist of just a more simpler version y = ax.

Another great way to improve this neural network would be to combine independently trained neural networks, f.e one neural network would be responsible for detection of the numbers I had problem with (4,6,7,8,9) or any other group of numbers, maybe the numbers that are similar like (3,5,6,8,9). With those 2 groups, I would create neural network which can make distinction if the number is from one or the other group. If the number would be from group with numbers (3,5,6,8,9), another trained neural network would follow which could determine digit and would be solely trained on those numbers. If they were from the other group (1,2,4,7) its the same idea.