Skip to content

In this project, I implement my own kNN classifier from scratch to classify images of handwritten digits using the MNIST dataset. I also use the classifier to classify my own digits using Gradio.

License

Notifications You must be signed in to change notification settings

ahsanjahangirmir/classify-handwritten-digits-using-kNNs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

classify-handwritten-digits-using-kNNs

In this project, I implement my own kNN classifier from scratch to classify images of handwritten digits using the MNIST dataset. I also use the classifier to classify my own digits using Gradio.

About the Dataset

The MNIST (Modified National Institute of Standards and Technology) dataset is one of the most well-known and widely used datasets in the field of machine learning and computer vision. It consists of a large collection of handwritten digits that have been normalized and centered in a fixed-size image, making it a benchmark dataset for evaluating image processing systems.

Key Features:

  • Dataset Composition: The MNIST dataset contains a total of 70,000 images of handwritten digits.
  • Training Set: 60,000 images
  • Test Set: 10,000 images
  • Image Size: Each image is 28x28 pixels, resulting in a total of 784 pixels per image.
  • Grayscale Images: The images are in grayscale, with pixel values ranging from 0 (black) to 255 (white).
  • Classes: The dataset includes ten classes, representing the digits 0 through 9.
  • Format: The images are provided in a standardized format, with the digits centered and size-normalized.

Link to the dataset: https://www.kaggle.com/datasets/hojjatk/mnist-dataset

About Gradio (the library that I use for testing my own handwritten digits on my kNN implementation)

Gradio is an open-source Python library that allows developers to quickly create and share user interfaces for machine learning models. It provides an intuitive interface for building web-based demos and applications that can showcase the capabilities of machine learning models interactively.

Key Features:

  • Ease of Use: Gradio allows for the rapid creation of interactive interfaces with minimal coding.
  • Integration: It integrates seamlessly with popular machine learning frameworks like TensorFlow, PyTorch, and Scikit-Learn.
  • Real-Time Interaction: Users can interact with models in real-time, making it easier to visualize and understand model predictions and behavior.
  • Sharing: Gradio applications can be easily shared via unique URLs, allowing for collaborative development and demonstration.

For any queries, feel free to reach out to me at 25100325@lums.edu.pk

About

In this project, I implement my own kNN classifier from scratch to classify images of handwritten digits using the MNIST dataset. I also use the classifier to classify my own digits using Gradio.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published