# Analysis of Recent Deep Learning Techniques for Arabic Handwritten-Text OCR and Post-OCR Correction
## 6 Analysis of Recent Works
### OCR Deep-Learning Works
#### 6.1.3 GANs-Based Works [57; 58; 59; 60]  
[PERSON] et al. [57] proposed a model to recognize Arabic handwritten characters using the generative adversarial network (GAN), followed by CNN. The GAN model is made of two components: a generator CNN of 10 layers that generates new images that appear similar to real images of Arabic characters and words and attempts to fool the discriminator, which is the other part, which tries to distinguish real images from the generated images and has nine layers. Sparse categorical cross-entropy was the loss used. Real data are fed to the discriminator, and the output of the discriminator is fed back to the generator to be used as data to generate new images. The dataset that was used was the Arabic Handwritten Characters Dataset (AHCD), which has 16,800 characters, written by 60 writers. The third model (CNN) was further trained on this generated dataset and the original dataset. The results of the testing showed that the model achieved an accuracy of 99.78% when the GAN was used, whereas, when the GAN was not used, the model had a 96.28% accuracy. [PERSON] et al. [58] developed a GAN model based on the ScrabbleGAN model to address the issue of the imbalance in the frequency of generated handwritten Arabic characters in Arabic handwritten-text recognition. Their system's architecture consists of an adaptive data-augmentation algorithm to unify the distributions of the characters, followed by a GAN model working to generate the synthesized words, followed by 200 blocks of BiLSTM to recognize the input words. The adaptive data-augmentation mechanism cuts off overly used characters, such as Alif, and balances characters for which fewer samples are available by generating more versions of these characters. To generate the data in the GAN model, the generator and discriminator work together; one generates false data that seem as real as possible, while the other tries to detect whether the data are false or real. To evaluate the performance of the GAN model, two metrics were evaluated: Frechet inception distance (FID) and geometry score (GS). The FID calculates the distance between the vectors of real and generated images; the shorter this distance, the better. The GS calculates the quality of the samples generated by detecting the mode collapse, which occurs when the generator is not able to generate samples as diversely as the real-world data distribution, so it generates very similar, redundant, and identical samples. The datasets used to generate the images were the IFN/ENIT and AHDB datasets. For the AHDB dataset, the researchers achieved 27.70 for the FID and a GS of 0.0114; for the IFN/ENIT dataset, they achieved 38.79 for the FID and a GS of 0.01887. To evaluate the recognizer, the word-recognition rate (WRR) was calculated. When evaluated using the generated text only for AHDB, the researchers achieved 85.16% WRR, while for IFN/ENIT, they achieved 61.09% WRR as the average set (e). When evaluated using generated text in addition to the original text, the results were better, with 99.30% WRR for AHDB and 95.87% WRR on the average set (e) of IFN/ENIT. [PERSON] et al. [59] proposed a deep convolutional generative adversarial network (CDCGAN) model to generate isolated handwritten Arabic characters in a guided manner. The results, which were scored using mean multiscale structural similarity (MS-SSIM), reached 0.635 in the generated samples, compared to 0.614 in the real samples. The used dataset was the AHCD dataset, which contains 16,800 isolated handwritten Arabic characters classified into 28 classes, representing each character uniquely. Furthermore, to assess the adaptability of this generated dataset with machine-learning models, it was trained further and tested using a CNN model (LeNet5), showing a gap of 10% between the accuracy obtained while using the generated set and the real set, which achieved 94.99 on the Arabic set. Moreover, an accuracy of 95.08 was achieved on an augmented set containing elements from both sets.