Skip to content

Created a CNN model to identify handwritten number using PyTorch based on MNIST Dataset

Notifications You must be signed in to change notification settings

ajaywanekar/Number-Recognition-using-PyTorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Number Recognition using PyTorch

This project demonstrates the implementation of the LeNet-5 convolutional neural network for handwritten digit recognition using the MNIST dataset.

Project Structure

The project is organized as follows:

  • main.py: Contains the main script to train and evaluate the LeNet-5 model.
  • model.py: Defines the LeNet-5 model architecture.
  • utils.py: Provides utility functions for data loading, preprocessing, and evaluation.
  • requirements.txt: Lists the required dependencies for running the project.

Usage

  1. Prepare the dataset:
  • Download the MNIST dataset and place it in the appropriate directory.
  • Ensure the dataset is properly split into training and validation sets.
  1. Train the model:
  • Adjust the data_path argument according to the location of your dataset.
  • Optionally, specify other training parameters such as learning rate, batch size, etc.
  1. Evaluate the model:
  • Adjust the data_path argument according to the location of your dataset.
  1. Predict using the trained model:
  • Modify the inference() function in utils.py to accept and process the input image.
  • Use the modified function to make predictions on new images.

Results

  • For a given input image, the model predicted the digit as 8 with a probability of 99%. predicted: 8, prob: 99.9998927116394 %

Acknowledgements

  • The MNIST dataset is used for training and evaluation.

🔗 Links

linkedin

Github

About

Created a CNN model to identify handwritten number using PyTorch based on MNIST Dataset

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published