Skip to content

augustoafleal/machine-learning-mnist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MNIST Digit Recognition with Machine Learning

Digit recognition project using CNN (Convolutional Neural Networks) and KNN (K-Nearest Neighbors) models.

The models are used to recognize handwritten digits using the MNIST dataset, and it can be viewed on Streamlit app

MNIST Dataset

The MNIST dataset is widely used in the field of image recognition, containing 60,000 training images and 10,000 test images of digits from 0 to 9.

Models Used

Convolutional Neural Networks (CNN)

CNNs are neural networks designed to process data with a grid-like structure, such as images. Typically, three convolutional layers are used to extract features from the images:

  • Convolutional Layers: use filters to identify patterns in the images.
  • Pooling Layers: reduce dimensionality while preserving important features.
  • Fully Connected Layers: perform the final classification.

K-Nearest Neighbors (KNN)

KNN is a supervised learning algorithm that classifies new samples based on the majority vote of their k-nearest neighbors (7 neighbors provided the best results in the tests and was the value used). A distance metric is used to identify the nearest neighbors (we used Euclidean distance in the model), and classification is based on the most common class among the k-nearest neighbors.

Results

CNN: Achieved an accuracy of 98.97%

KNN: Despite being simpler, the model also achieved a good result with 96.94% accuracy.

Presentation

References

MNIST database: MNIST database

CNN: Convolutional Neural Networks Explained

KNN: Machine Learning Basics with the K-Nearest Neighbors Algorithm

About

Explore CNN and KNN models for handwritten digit recognition using the MNIST dataset. Compare performance and accuracy between these two machine learning approaches.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors