Skip to content

This project implements a Convolutional Neural Network (CNN) to classify handwritten digits using the MNIST dataset. The model is trained to recognize digits (0-9) from 28x28 pixel grayscale images, achieving high accuracy in prediction. The project includes data preprocessing, model training, evaluation, and visualization of results.

Notifications You must be signed in to change notification settings

KashifMoin1410/Digit-Classification-with-Convolutional-Neural-Networks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Digit Classification with Convolutional Neural Networks

Overview

This project implements a Convolutional Neural Network (CNN) to accurately classify handwritten digits using the MNIST dataset. The model is designed to efficiently analyze and process visual data, leveraging advanced algorithms and image processing techniques to identify and predict numbers within images.

Dataset

  • Source: Kaggle - Digit Recognizer
  • Description: The dataset consists of 28x28 grayscale images of handwritten digits (0-9). Each image is labeled with the correct digit it represents.

Objective

Develop a deep learning model capable of classifying handwritten digits with high accuracy, utilizing the MNIST dataset for training and evaluation.

Methodology

1. Data Preprocessing

  • Normalized pixel values to the range [0, 1].

  • Reshaped images to include a single channel for compatibility with CNN input requirements.

  • Converted labels to one-hot encoded vectors for multiclass classification.

    2. Model Architecture

  • Input Layer: Accepts 28x28x1 input images.

  • Convolutional Layers: Extract features using filters and activation functions.

  • Pooling Layers: Reduce spatial dimensions to minimize overfitting.

  • Fully Connected Layers: Interpret features and output probabilities for each class.

  • Output Layer: Uses softmax activation to produce a probability distribution over the 10 digit classes.

    3. Training

  • Compiled the model with categorical cross-entropy loss and the Adam optimizer.

  • Trained the model over multiple epochs with a defined batch size.

  • Validated the model on a separate validation set to monitor performance.

    4. Evaluation

  • Assessed model accuracy on the test dataset.

  • Analyzed confusion matrix to identify misclassifications.

  • Evaluated precision, recall, and F1-score for each class.

    Results

  • Test Accuracy: Achieved high accuracy on the test set, demonstrating the model's effectiveness in digit classification tasks.

    Dependencies

  • Python 3.

  • TensorFlow

  • Keras

  • NumPy

  • Matplotlib

Note: Install the dependencies using the following command:

Future Work

About

This project implements a Convolutional Neural Network (CNN) to classify handwritten digits using the MNIST dataset. The model is trained to recognize digits (0-9) from 28x28 pixel grayscale images, achieving high accuracy in prediction. The project includes data preprocessing, model training, evaluation, and visualization of results.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published