The Arabic Font Recognition System is designed to classify Arabic text in an image into one of four specific fonts. The fonts are:
- Scheherazade New
- Marhey
- Lemonada
- IBM Plex Sans Arabic
This system handles various image variations to ensure accurate font recognition. It comprises a complete machine learning pipeline, including preprocessing, feature extraction/selection, model selection and training, and performance analysis.
The preprocessing module addresses different paragraph formats in images. It ensures that the text is correctly aligned and standardized for the following stages in the pipeline. It handles:
- Text alignment
- Text size/weight
- Image blur
- Brightness variation
- Text color
- Text rotation
- Salt and pepper noise
In this module, significant features from the preprocessed images are extracted and selected for model training. These features are crucial for distinguishing between different fonts.
This module involves selecting the appropriate machine learning model and training it using the extracted features. It includes:
- Choosing the right algorithm
- Training the model on the training dataset
- Fine-tuning hyperparameters
The performance analysis module evaluates the trained model to ensure its effectiveness and accuracy. It involves:
- Measuring accuracy
- Analyzing the model’s performance on validation and test datasets
- Fine-tuning based on performance metrics
The system includes a server that accepts POST requests at the endpoint /predict
. An image is attached to the request, and a prediction is returned.
The dataset used to train and evaluate the model is available on Kaggle: Arabic Fonts Dataset.
The dataset is divided into:
- Training set: Used to train the model.
- Validation set: Used to tune hyperparameters and choose between models.
Ensure you have the following installed:
- Python 3.x
- Necessary libraries: openCV, numpy, sklearn, joblib, matplotlib, flask
- Clone the repository:
git clone https://github.com/abotaha23/Arabic-fonts-detector.git
- Navigate to the project directory:
cd Arabic-fonts-detector
The system classifies the text into one of the four fonts with high accuracy, handling various image distortions and text variations effectively. The model achieves an accuracy of 98.7%.
This project is licensed under the MIT License - see the LICENSE file for details.
- Kaggle for the dataset: Arabic Fonts Dataset.