Coder Social home page Coder Social logo

mnist-classification-cnn's Introduction

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

mnist-classification-cnn's People

Contributors

ritesh-sivanathan avatar

Stargazers

 avatar

Watchers

Kostas Georgiou avatar  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.