A TensorFlow-based Convolutional Neural Network (CNN) model that achieves 99% accuracy in handwritten digit classification. This project also includes interactive applications to test predictions using custom handwritten inputs or webcam data.
CNN Architecture:
- Convolutional layer with ReLU activation
- MaxPooling layer
- Convolutional layer with ReLU activation
- MaxPooling layer
- Flattening layer
- 2 Fully-connected Dense layers
Interactive Tools:
- 'app.py': Opens a window for users to handwrite their own digits and see predictions in real-time.
- 'webcam.py': Uses the webcam to capture handwritten digits for prediction. (Currently under improvement)
- TensorFlow: For building and training the CNN model.
- OpenCV: For webcam data capture and image processing.
1. Get the CNN Model
Run the training notebook recreate the model:
- 'mnist.ipynb'
Or use the pre trained one:
- 'mnist.h5'
2. Handwriting Interface
Launch the handwriting window:
python app.py
Draw a digit in the window to see the model's prediction.
3. Webcam Digit Capture (Under Development)
Test the webcam interface:
python webcam.py
- The script will capture frames from your webcam and attempt to predict handwritten digits.
- Note: Prediction accuracy needs further enhancement in this module.
- User writes the digit '5'.
- Model predicts: '5'.
Training Performance:
- Achieved 99% accuracy on the MNIST dataset.
- π οΈ Improve the accuracy of the 'webcam.py' predictions.
- π Add support for multi-digit recognition.
- π¨ Enhance the UI for better usability.
Enjoy exploring the world of digit recognition! β¨