MNIST CNN Classifier

  • Adapted from Pytorch Examples

Model Overview

  • Model Name: MNIST CNN Classifier
  • Model Type: Convolutional Neural Network (CNN)
  • Dataset: MNIST (Modified National Institute of Standards and Technology)
    • A dataset of 70,000 handwritten digits (28x28 grayscale images) of digits 0-9.
  • Task: Image classification (Digit recognition)
  • Framework: PyTorch
  • Preprocessing:
    • Images are normalized and transformed before feeding into the model (e.g., scaling pixel values to a [0, 1] range).

Model Architecture

  • Input Layer: 28x28 grayscale images.
  • Convolutional Layers:
    • Conv1: 32 filters of size 3x3, applied to the input image (1 channel).
    • Conv2: 64 filters of size 3x3, applied to the output of Conv1.
  • Activation Functions:
    • ReLU activations after each convolutional layer.
  • Pooling Layer:
    • Max pooling with a 2x2 window after Conv2.
  • Dropout:
    • Dropout rate of 25% after the first convolutional layer and 50% after the fully connected layer to prevent overfitting.
  • Fully Connected Layers:
    • fc1: A fully connected layer with 128 neurons.
    • fc2: A fully connected layer with 10 output units (one for each digit).
  • Output:
    • Log-softmax activation applied to the final layer to produce log-probabilities for the 10 classes.

Training Details

  • Batch Size: (60000)
  • Epochs: (14)
  • Learning Rate: (1.0 Adadelta)
  • Hardware Used: (Google Colab T4 GPU)

Performance Metrics

  • Training Accuracy: (99%)
  • Training Loss: (0.0273)

Usage Instructions

  • How to Use:
    • Clone the repo
    • Dependencies:
    • pip install transformers torch torchvision==0.20.0
    • python app.py

Model Limitations

  • This model may struggle with noise or distorted images and is trained on relatively clean data.
  • The model is limited to the MNIST digit set and may not perform well on other datasets or noisy, out-of-distribution data.
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API: The model has no library tag.