A Neural Network built from scratch. The model was trained on the MNIST Fashion Dataset. Project is based on the Book: "Neural Network from Scratch in Python"
MNNLibrary.py: Contains base functions such as Dense Layers, Activation functions, Loss functions, Accuracy functions, Optimizer functions and an all encompassed Model function.
train.py: Trains the model on a preset small architecture([1,256]->[256,256]->[256,10] Subject to Change)
predict.py: Predicts an input image on a give model
evaluate.py: Evaluates a given model on the test set data for MNIST Fashion dataset
show.py: Displays the input image in a 28 by 28 pixel grayscaled ratio.
I was able to obtain a model with a 89% accuracy on the test model.
Here something interesting outputs I would like to share
Shirt 1: Here is a picture I picked downloaded on the internet of a shirt.
Terminal:
$ python3 predict.py shirt1.jpg fashion_mnist_89
>> T-shrit/top
Shirt 1 is a success! However.....
Shirt 2: Picture I took.
Terminal:
$ python3 predict.py shirt2.jpg fashion_mnist_89
>> Bag
That does not seem right... However if we use the method show.py, we can get some insight about what is going on.
Terminal:
$ python3 show.py shirt2.jpg
Can you tell if that is a shirt? I can't. This shows the importance of good data.
Shirt 3: Second picture I took.
Terminal:
$ python3 predict.py shirt3.jpg fashion_mnist_89
>> T-shrit/top
Bingo! And lets see the it in a 28x28 grayscale
Looks kind of like a shirt. However lets change the shirt slightly
Shirt 3: The previous shirt changed slightly near the arm holes
Terminal:
$ python3 predict.py shirt3_2.jpg fashion_mnist_89
>> Bag
Another bag......... Lets check the show.py file.
I can see the resemblance to a bag. Since this is a Neural Network not a Convolutional neural network, the model is examining each pixel rather than looking for features on the images themselves such as lines and curves which leads to this issue.
Finally,
Coat 1: A picture of a coat I took.
Terminal:
$ python3 predict.py coat1.jpg fashion_mnist_89
>> Coat
Looks Good! Lets check the show.py file