Character Recognition of Arabic Handwritten Characters Using Deep Learning

Optical character recognition (OCR) is used to digitize texts in printed documents and camera images. The most basic step in the OCR process is character recognition. The Arabic language is more complex than other alphabets, as the cursive is written in cursive and the characters have different spellings. Our research has improved a character recognition model for Arabic texts with 28 different characters. Character recognition was performed using Convolutional Neural Network models, which are accepted as effective in image processing and recognition. Three different CNN models have been proposed. In the study, training and testing of the models were carried out using the Hijja data set. Among the proposed models, Model C with a 99.3% accuracy rate has obtained results that can compete with the studies in the literature.


Introduction
Arabic handwriting recognition is so important in many parts in many applications, three decades ago handwriting recognition has been increasing in use in many applications [1]. Latin language recognition and Arabic language recognition have been researched by many researchers during the last three decades.
The inputs of handwriting recognition can be from many resources such as on image handwritten, on a paper written, and many other resources.
This study aims to recognize children's handwriting recognition. The main difficulty in recognizing Arabic handwriting is that the handwriting is different from one person to another and from age to another.
Recognizing children's handwriting is much more difficult than adults the only research that is done for recognizing children's handwriting is an Arabic handwriting recognition system using a convolutional neural network [2]. The accuracy of the research was 97% and the accuracy that I achieved is 99.3% on the same dataset, Hijja. Hijja dataset is written by children whose ages are between 7 to 12 years. The hijja dataset contains 47,434 characters, and this dataset was created by 591 students. The Hijja dataset is divided into training and testing. In this research, we developed 4 models for recognizing characters depending on the dataset, and the highest accuracy that we achieved from the proposed models was 99.3%. There are many different methods, including image processing-based methods. Machine learning is the ability to use the most appropriate algorithm to transform a dataset into a model [3] and Deep learning is a machine learning method that consists of multiple layers that portend outcomes with the available dataset. Deep learning, machine learning, and artificial intelligence have different meanings and can be abstract as a sub-substation of artificial intelligence [4]. In recent years, deep learning algorithms have been claimed as the most up-to-date method.

Related Works
The methods found in the literature regarding the study are summarized in this section. For Arabic handwrite recognition there are some datasets for example: Database IFN/ENIT [5] has been developed by für Nachrichtentechnik and the Ecole Nationale d'Ingénieurs de Tunis institute. The dataset was written by 411 people and it contains 26,549 images of Tunisian villages and towns.
Arabic handwriting dataset (AHDB) [6] consists of pictures of words that describe depict numbers and amounts in checks machine Intelligence and the pattern recognition center has some Arabic character's databases, such as Arabic handwrite recognition dataset [7]. Authors in addition presented a dataset that contains 16,800 Arabic characters. There have been many efforts for addressing Arabic handwriting recognition.
Ashiquzzaman et al. [8] proposed two strategies for improving the performance of Arabic numerals.
Firstly, two changes they made to the MLP-based model [9] the rectified linear unit changed, and they used a trained back-propagation CNN algorithm. They get 93.8% accuracy in the first change and 97.4% in the second change.
Latif et al. [10] in 2018 designed a CNN architecture for the recognition of numerals of multi-languages: Urdu, Persian, Devanagari, Eastern, and Western Arabic. The overall accuracy he gets was 99.29% and individual language accuracy was 99.32%.
Ashiquzzaman et al. [8] recently the function of activation from ReLU to ELU they changed and augmentation data to CMARERDB 3.3.1 dataset has been used. The method they designed achieved an accuracy of 99.4%. In this research we designed a CNN architecture with Relu and softmax activation, the structure I used is sequential with 9 hidden layers and I used Adam optimization to achieve 99.1% accuracy and I tested my model on the Hijja dataset. We also designed two more models which are model B with Gradient descent optimization and Relu + softmax activation and sequential with 3 hidden layers structure I also tested it on the Hijja dataset to achieve overall 85% accuracy.

Hijja dataset
The important part of a computer vision system is datasets. Datasets help to compare machine learning techniques quickly. The dataset I used is the Hijja dataset, this dataset contains Arabic handwritten letters.
Hijja is an open-source dataset collected in Riyadh, Saudi Arabia by students from classes 1-6. Hijja consists of 47,434 characters written by 591 students.

Methodology
The methodology of my work consists of three main phases as below: In our study, we are focusing on Arabic handwritten character recognition. This is shown in the flow chart given below: in which 80% of data was allocated to the train data and 20% for test data.

Pre-Process
In the preprocessing phase, I import my data as CSV files which are divided into two train and test files. The train consists of 13440 rows where the test has 3360 rows, each row is a sample that has a 32X32 structure of 0-255 grayscale pixel. In other words, we have a total of 16800 samples representing Arabic hand-written letters. For this matter they are labeled in 28 different classes with each class representing a letter in the Arabic language; some of the images are shown in the below illustration. In the first step of our approach, the data 0-255 is normalized to 0-1 as NumPy-floats, representing the whole data as NumPy arrays. This mechanism helps the neural networks to deal with the data in a better shape.

Initial Model
A state of the art approach to modeling for this purpose will include a default sequential method that has the following layers: • 2D convolution layer activated with Rectified Linear Unit (ReLU).
• A-Max pooling operation for the 2D spatial data layer.
• A Flattens layer the input which does not affect the batch size.
• Two dense layers, which are neural network layers that are connected deeply.
The model is accompanied by a Gradient descent (with momentum) optimizer; afterward, it is compiled with Adam Optimizer with categorical cross-entropy loss function. The accuracy of this basic model reaches 81%, namely known as Model A.

Complex Models
Our approach combines different models and observes the accuracy of each one of them, the below

Results
As a result, deep learning algorithms may perform differently. Therefore, in the case of creating different combinations of optimization algorithms, activation functions, and neuron numbers while creating a model in deep learning, a more suitable architecture for the data set will be obtained. Our models were tested on the Hijja dataset and 16 core and 32 GB ram Linux server and below are the results.

Model D 93%
In Table 4, the results obtained in similar studies and the results obtained in the models we suggested in our study are given. As can be seen, the results obtained with our model are at a level that can compete with other studies in the literature However, in the Ashiquzzaman et al. [8] study, which was more successful than the proposed method, a different data set was used. More successful results were obtained from the study of Najwa Altwaijry using the same data set.

Conclusion
In this article, new deep learning models are proposed for the recognition of Arabic characters. The models proposed with the Hijja dataset were trained and tested. Competitive results have been obtained with similar studies. It can be used for the Arabic OCR system of the proposed models. In the future, we aim to have our dataset and also, I want to include Kurdish handwrite recognition and test our model on it.
However, It's beneficial to study new machine learning models and test them on the presented dataset.