# Recognition of Cursive Pashto Optical Digits and Characters with Trio Deep Learning Neural Network Models

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

- To develop a Benchmark Handwritten Pashto digits dataset.
- To build a Deep Convolutional Neural Network having seven sets of Convolution, ReLU, and Maxpooling function for the classification of Pashto digits, Pashto characters, and combined Pashto digit and characters datasets.
- To check the performance of the trio deep learning Convolutional Neural Network, i.e., CNN, LeNet, and DCNN in terms of parameters such as accuracy, loss, precision, recall, and f-measure.

## 2. Related Work

## 3. The Proposed Methodology

#### 3.1. Data Collections

#### 3.2. Data Preprocessing

**Data Partitioning:**The whole dataset could not be used in training. The dataset were split between testing and training, then training data was be used to train the model and testing data was used to predict the unseen data. In this study, training and testing data were split into 80 and 20 percent, respectively.

**Deep Neural Network Models:**This paper uses the Adagrad optimization function in CNN, LeNet, and Deep CNN models, with each model having different sets of convolutions, max pooling, and ReLU activation layers. The deep convolutional neural network provided the ability to train and gave close to real world approximations. The final fully connected layer in CNN used the SoftMax function to calculate the probabilities of the predicted values in a multiclass classification problem. So, the importance of the SoftMax activation function in the final layer cannot be ruled out. In simple CNN, only one set of convolutional, max pooling, and ReLU activation layers were used with only two layers fully connected and the final layer as the SoftMax classifier. In LeNet, two sets of convolutional, max pooling, and ReLU activation layers were used with only two layers fully connected and the SoftMax classifier as the last layer. In the Deep CNN model, four sets of convolutional, ReLU activation, batch normalization, max pooling, and dropout layers were used having two layers fully connected and the final layer as the SoftMax classifier.

#### 3.3. Performance Parameters

## 4. Results and Discussion

#### 4.1. Preliminaries

#### 4.2. Experiments

#### 4.3. Pashto Character Dataset

#### 4.4. Pashto Digit Dataset

#### 4.5. Combined Pashto Digit and Character Dataset

## 5. Conclusions and Future Work

## Author Contributions

## Funding

## Acknowledgments

## Conflicts of Interest

## References

- Schantz, H.F. Ocr Recognition Systems. Inf. Syst. Manag.
**1992**, 9, 4. [Google Scholar] [CrossRef] - Baldominos, A.; Saez, Y.; Isasi, P. A survey of handwritten character recognition with MNIST and EMNIST. Appl. Sci.
**2019**, 9, 3169. [Google Scholar] [CrossRef][Green Version] - Ahlawat, S.; Choudhary, A. Hybrid CNN-SVM Classifier for Handwritten Digit Recognit. Procedia Computer Sci.
**2020**, 167, 2554–2560. [Google Scholar] [CrossRef] - Al-Badr, B.; Mahmoud, S.A. Survey and bibliography of Arabic optical text recognition. Signal Process.
**1995**, 41, 49–77. [Google Scholar] [CrossRef] - Mantas, J. An overview of character recognition methodologies. Pattern Recognit.
**1986**, 19, 425–430. [Google Scholar] [CrossRef] - Junker, M.; Hoch, R. Evaluating OCR and non-OCR text representations for learning document classifiers. In Proceedings of the International Conference on Document Analysis and Recognition, Ulm, Germany, 18–20 August 1997; Volume 2. [Google Scholar]
- Tsai, C. Recognizing Handwritten Japanese Characters Using Deep Convolutional Neural Networks; University Stanford: Stanford, CA, USA, 2016; pp. 405–410. [Google Scholar]
- Sharma, M.K.; Dhaka, V.P. Segmentation of english Offline handwritten cursive scripts using a feedforward neural network. Neural Comput. Appl.
**2016**, 27, 1369–1379. [Google Scholar] [CrossRef] - Gaur, S.; Sonkar, S.; Roy, P.P. Generation of synthetic training data for handwritten Indic script recognition. In Proceedings of the International Conference on Document Analysis and Recognition, Tunis, Tunisia, 3–26 August 2015. [Google Scholar]
- Dutoit, T. High Quality Text-to-Speech Synthesis of the FRENCH Language. Ph.D. Thesis, Faculte Polytechnique de Mons, Mons, Belgium, 1993. [Google Scholar]
- Ahmad, R. Deepashto: An End-to-End OCR System for Pashto Cursive Script: A Pioneering Study; Technische Universität Kaiserslautern: Kaiserslautern, Germany, 2018. [Google Scholar]
- Rabi, M.; Amrouch, M.; Mahani, Z. Recognition of Cursive Arabic Handwritten Text Using Embedded Training Based on Hidden Markov Models. Int. J. Pattern Recognit. Artif. Intell.
**2018**, 32, 1. [Google Scholar] [CrossRef] - Harouni, M.; Rahim, M.S.M.; Al-Rodhaan, M.; Saba, T.; Rehman, A.; Al-Dhelaan, A. Online Persian/Arabic script classification without contextual information. Imaging Sci. J.
**2014**, 62, 437–448. [Google Scholar] [CrossRef] - Memon, N.; Abbasi, F.; Zardari, S. Glyph Identification and Character Recognition for Sindhi OCR. Mehran Univ. Res. J. Eng. Technol.
**2017**, 36, 933–940. [Google Scholar] [CrossRef][Green Version] - Naseer, A.; Zafar, K. Comparative analysis of raw images and meta feature based Urdu OCR using CNN and LSTM. Int. J. Adv. Comput. Sci. Appl.
**2018**, 9, 1. [Google Scholar] [CrossRef][Green Version] - Uddin, I. Pashto Handwritten Characters Dataset. GitHub
**2019**. 2021. Available online: https://github.com/imrandin1976/pashto_handwritten_dataset (accessed on 1 February 2021). - Das, D.; Nayak, D.R.; Dash, R.; Majhi, B. An empirical evaluation of extreme learning machine: application to handwritten character recognition. Multimedia Tools Appl.
**2019**, 78, 19495–19523. [Google Scholar] [CrossRef] - Ahmad, R.; Naz, S.; Afzal, M.Z.; Amin, S.H.; Breuel, T. Robust optical recognition of cursive Pashto script using scale, rotation and location invariant approach. PLoS ONE
**2015**, 10, e0133648. [Google Scholar] - Decerbo, M.; MacRostie, E.; Natarajan, P. The BBN Byblos Pashto OCR system. In Proceedings of the HDP 2004: Proceedings of the First ACM Hardcopy Document Processing Workshop, Washington, DC, USA, 12 November 2004. [Google Scholar]
- Ahmad, R.; Afzal, M.Z.; Rashid, S.F.; Liwicki, M.; Breuel, T. Scale and rotation invariant OCR for Pashto cursive script using MDLSTM network. In Proceedings of the International Conference on Document Analysis and Recognition, Tunis, Tunisia, 3–26 August 2015. [Google Scholar]
- Ahmed, S.B.; Naz, S.; Razzak, M.I.; Yusof, R.; Breuel, T.M. Balinese character recognition using bidirectional LSTM classifier. In Lecture Notes in Electrical Engineering; Springer: Melaka, Malaysia, 2016; Volume 387. [Google Scholar]
- Dasgupta, J.; Bhattacharya, K.; Chanda, B. A holistic approach for Off-line handwritten cursive word recognition using directional feature based on Arnold transform. Pattern Recognition Lett.
**2016**, 79, 73–79. [Google Scholar] [CrossRef] - Khan, N.H.; Adnan, A.; Basar, S. Urdu ligature recognition using multi-level agglomerative hierarchical clustering. Clust. Comput.
**2017**, 21, 503–514. [Google Scholar] [CrossRef] - Ahmad, R.; Naz, S.; Afzal, M.Z.; Rashid, S.F.; Liwicki, M.; Dengel, A. The Impact of Visual Similarities of Arabic-Like Scripts Regarding Learning in an OCR System. In Proceedings of the International Conference on Document Analysis and Recognition, Kyoto, Japan, 9–15 November 2017. [Google Scholar]
- Zahoor, S.; Naz, S.; Khan, N.H.; Razzak, M.I. Deep optical character recognition: a case of Pashto language. J. Electron. Imaging
**2020**, 29, 023002. [Google Scholar] [CrossRef] - Khan, S.; Ali, H.; Ullah, Z.; Minallah, N.; Maqsood, S.; Hafeez, A. KNN and ANN-based Recognition of Handwritten Pashto Letters using Zoning Features. Int. J. Adv. Comput. Sci. Appl.
**2018**, 9, 570–577. [Google Scholar] [CrossRef]

**Figure 10.**Accuracy Comparison of CNN, LeNet, and the Proposed DCNN on the Pashto Characters Dataset.

**Figure 12.**Precision, Recall, and F

_{1}-Score Comparison of CNN, LeNet, and the Proposed DCNN on the Pashto Characters Dataset.

**Figure 15.**Accuracy Comparison of CNN, LeNet, and the Proposed DCNN on the Combined Pashto Digit and Character Dataset.

**Figure 16.**Loss Comparison of CNN, LeNet, and the Proposed DCNN on the Combined Pashto Digit and Character Dataset.

**Figure 17.**Precision, Recall, and F

_{1}-Score Comparison of CNN, LeNet, and the Proposed DCNN on the Combined Pashto Digit and Character Dataset.

خ | ح | چ | ج | ث | ټ | ت | پ | ب | ا |

ژ | ﺯ | ړ | ﺭ | د | ﺫ | ډ | د | ځ | څ |

غ | ع | ظ | ط | ض | ص | ښ | ش | س | ږ |

ه | و | ڼ | ن | م | ل | ګ | ک | ق | |

ئ | ۍ | ې | ی | ي | ۀ |

**Table 2.**Accuracy and Loss Comparison of CNN, LeNet, and Deep CNN Models on the Pashto Character Dataset.

Accuracy/MSE | CNN | LeNet | Deep CNN |
---|---|---|---|

Accuracy | 98.3 | 99.25 | 99.4 |

MSE | 0.057 | 0.027 | 0.020 |

**Table 3.**Precision, Recall, and F

_{1}-Score Comparison of CNN, LeNet, and Deep CNN Models of the Pashto Character Dataset.

Parameters | CNN | LeNet | Deep CNN |
---|---|---|---|

Precision | 98.3 | 99.2 | 99.4 |

Recall | 98.2 | 99.2 | 99.4 |

F-Score | 98.3 | 99.2 | 99.4 |

**Table 4.**Accuracy and Loss Comparison of CNN, LeNet, and Deep CNN Models on the Pashto Character Dataset.

Accuracy/MSE | CNN | LeNet | Deep CNN |
---|---|---|---|

Accuracy | 98.7 | 91.9 | 99.1 |

MSE | 0.031 | 0.021 | 0.019 |

**Table 5.**Precision, Recall, and F

_{1}-Score Comparison of CNN, LeNet, and Deep CNN Models on the Pashto Character Dataset.

Parameters | CNN | LeNet | Deep CNN |
---|---|---|---|

Precision | 93.5 | 95.5 | 95.7 |

Recall | 93.5 | 95.7 | 95.7 |

F-Score | 93.5 | 95.6 | 95.7 |

**Table 6.**Accuracy and Loss Comparison of CNN, LeNet, and Deep CNN Models on the Combined Pashto Digit and Character Dataset.

Accuracy/MSE | CNN | LeNet | Deep CNN |
---|---|---|---|

Accuracy | 66.5 | 69.8 | 70.6 |

MSE | 0.307 | 0.031 | 0.303 |

**Table 7.**Precision, Recall, and F

_{1}-Score Comparison of CNN, LeNet, and Deep CNN Models on the Combined Pashto Digit and Character Dataset.

Parameters | CNN | LeNet | Deep CNN |
---|---|---|---|

Precision | 49.1 | 60.2 | 62.0 |

Recall | 48.7 | 53.6 | 53.9 |

F-Score | 48.7 | 56.8 | 57.7 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Rehman, M.Z.; Mohd. Nawi, N.; Arshad, M.; Khan, A.
Recognition of Cursive Pashto Optical Digits and Characters with Trio Deep Learning Neural Network Models. *Electronics* **2021**, *10*, 2508.
https://doi.org/10.3390/electronics10202508

**AMA Style**

Rehman MZ, Mohd. Nawi N, Arshad M, Khan A.
Recognition of Cursive Pashto Optical Digits and Characters with Trio Deep Learning Neural Network Models. *Electronics*. 2021; 10(20):2508.
https://doi.org/10.3390/electronics10202508

**Chicago/Turabian Style**

Rehman, Muhammad Zubair, Nazri Mohd. Nawi, Mohammad Arshad, and Abdullah Khan.
2021. "Recognition of Cursive Pashto Optical Digits and Characters with Trio Deep Learning Neural Network Models" *Electronics* 10, no. 20: 2508.
https://doi.org/10.3390/electronics10202508