In this project, I used the MNIST dataset, which is a dataset of handwritten digits which is mostly use for learning about classification algorithms in both Machine Learning and Deep Learning applications. My framework on choice for this project is PyTorch, an open source Deep Learning library.
Here, I compare two simple Deep Learning approaches for classification, one being a straightforward Neural Network architecture and another being a Convolutional Neural Network architecture which we know is better when dealing with images as its filters can detect features which makes it an easier job for classification.
As we can see with both of these models, the CNN architecture performs better for the same data.
Since the accuracy on the testing data is high too, we can say that our model has generalized very well. The bias vs variance tradeoff is balanced in both the architectures. We haven't over-trained the data and avoided the common pitfalls that arise from such practices.
- Clone the repo to your local machine
git clone https://github.com/HemanthJoseph/MNIST-Classifier-NN-vs-CNN.git
- Open the folder in and code editor and then navigate to the src directory
cd MNIST-Classifier-NN-vs-CNN/src/
- Run the code
python Neural_Networks.py
python Convolutional_Neural_Networks.py
- Python version - Python 3.11.3
- PyTorch Version - torch Version: 2.0.1
- NVIDIA-SMI GPU - CUDA Version: 12.0