This project implements a convolutional neural network (CNN) for recognizing handwritten Devanagari characters and digits. The repository contains the training and evaluation code that achieves high accuracy on the test set. Collaborators are welcome for working on upcoming iterations of this project :)
Devanagari is an abugida writing system used in India and Nepal. It is the main script for languages such as Hindi, Marathi, Nepali, and Sanskrit. This project recognizes 36 Devanagari consonants and 10 digits.
The model is trained using TensorFlow 2.15.1. The training code is structured for clarity and reusability, making it suitable for educational purposes and as a starting point for similar recognition tasks.
The CNN architecture consists of:
The model achieves over 95% accuracy on the test set.
Training and Validation Curves Confusion Matrix on Test Set Sample Test Set PredictionsThe model is trained on the Devanagari Handwritten Character Dataset, which contains:
The trained model demonstrates excellent performance on the test dataset:
Download the Devanagari Handwritten Character Dataset and extract it to the project directory.
Install the required Python dependencies:
pip install tensorflow==2.15.1 numpy==1.25.2 opencv-python matplotlib scikit-learn tqdm
Run the training script:
This will:
After training, run the test script:
This will:
The Devanagari Handwritten Character Dataset contains:
The preprocessing ensures consistent input for the model:
This standardization is crucial for model performance and allows the CNN to focus on learning the distinctive features of each character rather than adapting to different scales or formats.
Model Architecture DetailsThe CNN architecture consists of:
Input Layer: 32x32x1 (grayscale images)
Convolutional Blocks:
Fully Connected Layers:
Training Configuration:
This architecture provides a good balance between model complexity and performance for this recognition task.
WTFPL
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4