Welcome to the Arabic Handwriting Recognition project! This repository consolidates all the code and data used in our endeavor to create an effective OCR (Optical Character Recognition) system for Arabic script.
This project is proudly made by:
Names | |
---|---|
Ahmed Taha | Ayman Saber |
Ahmed Nagah | Abanoub Aied |
Kerollos Samir | Mohamed Abdelfattah |
Mohamed Fathi | Nada Asran |
Nada Mahmoud | Rawan Gamal |
Reem Fouad |
Arabic Handwriting Recognition is a project aimed at developing a robust system to accurately recognize and digitize Arabic handwritten text. This repository groups together all the scripts, models, and datasets used throughout the development process.
To get started, clone the repository and install the required dependencies:
git clone https://github.com/AHR-OCR2024/Arabic-Handwriting-Recognition.git
cd Arabic-Handwriting-Recognition/Application
pip install -r requirements.txt
npm i
Download the pretrained models from here , Put them in Application/Backend/Models
To use the OCR system, follow these steps:
To Run the application, run each of these commands in a separate terminial
python ./Backend/Backend.py
npm run dev
The dataset used in this project is included in the repository. It contains a variety of Arabic handwritten samples to train and evaluate the model. To use the dataset:
Data.rar
file.Preprocessing is a critical stage in the development of our Arabic handwriting recognition system. The goal is to enhance the quality of the input data to ensure accurate recognition. Here are the main steps involved in our preprocessing pipeline:
Image Acquisition: We collect images of handwritten Arabic text from various sources, including scanned documents and photos taken by digital cameras.
Geometric Correction: We correct distortions and warping in the images. Techniques like Hough Line Transform and DocTr (Document Image Transformer) are used to straighten the text lines.
Noise Removal: We apply filters to remove noise and enhance the clarity of the text. This includes techniques like Gaussian blur and median filtering.
Unwarped and filtered image
Segmentation: We segment the images into paragraphs, lines, and individual characters. This involves methods like histogram projection and CRAFT (Character Region Awareness for Text Detection).
Segmented text using CRAFT
Normalization: We normalize the images to a fixed size (64x64) and rescale the pixel values to the range [0, 1] by dividing by 255.0.
Final Results
The AI training phase involves developing and training deep learning models to recognize and digitize handwritten Arabic text. Here are the key components of our AI training process:
Architecture | CER | Accuracy |
---|---|---|
EfficientNet-B1 | 7.3% | 92.7% |
VGG19 | 5.4% | 94.6% |
ResNet152 | 2.96% | 97.04% |
ResNet152 Performance Throughout the Epochs
Dataset Preparation We use a combination of the Arabic Alphabet Character dataset and the KHATT dataset. The combined final dataset includes 108,619 samples.
Data Augmentation To improve the robustness of our model, we apply various data augmentation techniques, such as rotation, translation, and scaling.
Model Architecture We utilize the ResNet50V2 model, pre-trained on the Arabic Alphabet Character dataset. We then continue training on the KHATT dataset using advanced techniques.
ResNet50V2 Performance on Alphabet Dataset
Training Techniques
Evaluation Metrics We use Character Error Rate (CER) and accuracy as our primary evaluation metrics. Our final model achieved a CER of 3% and an accuracy of 97% on the test set.
ResNet50V2 (Pre-Trained on Alphabet) Performance Throughout the Epochs
The Flow of Our System
Our application provides a variety of services and models:
Main Page of Our Application
Handwriting OCR Model
Exam Grader Model
Contributions are welcome! Please follow these steps to contribute:
git checkout -b feature/your-feature
).git commit -m 'Add some feature'
).git push origin feature/your-feature
).This project is licensed under the MIT License - see the LICENSE file for details.
We would like to thank all contributors and the community for their support and feedback. Special thanks to the authors of the datasets and tools used in this project.
Feel free to reach out with any questions or feedback. Let's make Arabic handwriting recognition more accessible and accurate together!
🌟 Happy Coding! 🌟
🚧 This repo is still incomplete and is under construction 🚧