A standalone desktop application that recognizes handwritten letters (A-Z, a-z) and digits (0-9) in real-time using a Convolutional Neural Network (CNN). Works completely offline with 93%+ accuracy.
The project should be organized with the following folder and file structure. Do not rename the data files.
deep-learning-handwritten-recognition/
│
├── app/
│ └── app.py
│
├── assets/
| ├── 6.png
| └── L.png
|
├── training/
| └── brain.py
|
├── handwriting_model.py
├── README.md
└── requirements.txt
| Requirement | Details |
|---|---|
| Python Version | 3.10 or above (Crucial for compatibility) |
| Operating System | Windows / Linux / macOS |
| Internet Access | Required only for initial library installation |
Follow these steps to set up the project, train the models, and run the visualization application.
It is essential to use the specified Python version for library compatibility.
-
Download Python 3.10.0 from the official website: https://www.python.org/downloads/
-
During the installation process, ensure you check the box for
Add Python to PATH. -
Verify the installation by opening a terminal or command prompt and running:
python --version
The output should confirm the version:
Python 3.10.0.
```bash
git clone https://github.com/AreebaGhaffar/deep-learning-handwritten-recognition.git
cd deep-learning-handwritten-recognition
```
Ensure the requirements.txt file is present in the root directory.
-
Upgrade
pipand install all required libraries:pip install --upgrade pip pip install -r requirements.txt
Wait for all packages to install successfully.
Both the digit and letter classification models must be trained before running the application. Training may take a few minutes depending on your CPU.
Run the following command to train the CNN on EMNIST data:
python brain.pyThis script will load the EMNIST dataset, train the classification model, and save the weights (e.g., as handwriting_model.h5).
Once model is trained and saved, you can launch the interactive visualization application.
python app.pyit will automatically open the application.
- 📝 Real-time Recognition: Draw any character and get instant predictions
- 🌐 Fully Offline: No internet connection required after setup
- 🔊 Text-to-Speech: Optional voice output for predictions
- 🎨 Clean GUI: Modern interface built with CustomTkinter
- 🧠 Custom CNN: Model trained from scratch on EMNIST dataset
- 🖱️ Easy to Use: Simple drawing canvas with clear controls
User Draws → Canvas → Preprocessing → CNN Model → Prediction → Display/Speak (Tkinter) (PIL/NumPy) (TensorFlow) (Tkinter/pyttsx3)

