Skip to content

Tensorflow/Keras convolutional neural network that is trained on MNIST number images to identify pictures of greyscale numbers.

Notifications You must be signed in to change notification settings

Ritesh-Sivanathan/mnist-classification-cnn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

MNIST Convolutional Neural Network (CNN)

Overview:

This project implements a Convolutional Neural Network (CNN) to classify handwritten digits from the MNIST dataset. The model is trained on a subset of the MNIST dataset consisting of 60,000 training images and tested on 12,000 test images.

image

Requirements:

  • Python 3.10.0 ( any other version may work, try at your own discretion )
  • TensorFlow 2.15.0
  • Keras 2.15.0 ( separate from Tensorflow, issue on my side)
  • Numpy 1.26.3

Installation:

  1. Clone this repository to your local machine:

    git clone https://github.com/Ritesh-Sivanathan/mnist-classification-cnn.git
  2. Navigate to the project directory:

    cd mnist-classification-cnn
  3. Install the required dependencies:

    pip install -r requirements.txt

Usage:

  1. Navigate to the code directory

    cd code
  2. Train the model:

    python train.py

    This will train the CNN model using the MNIST training data.

  3. Change to the model directory

    cd ../model
  4. Evaluate the model:

    python evaluate.py

    This will evaluate the trained model on the MNIST test data and display accuracy metrics.

Results:

After training and evaluating the model in model/evalulate.py, you'll be shown the model accuracy. Feel free to tweak anything and everything to maximize the accuracy.

Some suggestions:

  • Changing batch_size line 20 - train.py
  • Changing filter sizes in model lines [25-34] - train.py
  • Adding more image augmentation lines [21 - ...] - preprocessor.py

Model Architecture:

The CNN architecture used in this project consists of:

  • Input layer (1)
  • Convolutional layers (3, Conv2D)
  • Max pooling layers (2, MaxPooling2D)
  • Flatten layer (1)
  • Dense layers (2, relu and softmax activations)
  • Output layer

About

Tensorflow/Keras convolutional neural network that is trained on MNIST number images to identify pictures of greyscale numbers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages