Hardware and Software Co-Design of Arabic Alphabets Recognition Platform for Blind and Visually Impaired Persons

Brahim Sabir1, *, Yassine Khazri1, Mohamed Moussetad1, Bouzekri Touri2
1 LIMAT Lab, Physics Department, Faculty of Science Ben M'Sik - Physics Casablanca, Casablanca, Morocco
2 LAPSTICE Lab, Language and Communication Department, Faculty of Science Ben M'Sik - Physics Casablanca, Casablanca, Morocco

Article Metrics

CrossRef Citations:
Total Statistics:

Full-Text HTML Views: 904
Abstract HTML Views: 555
PDF Downloads: 858
ePub Downloads: 748
Total Views/Downloads: 3065
Unique Statistics:

Full-Text HTML Views: 545
Abstract HTML Views: 331
PDF Downloads: 283
ePub Downloads: 171
Total Views/Downloads: 1330

© 2017 Sabir et al.

open-access license: This is an open access article distributed under the terms of the Creative Commons Attribution 4.0 International Public License (CC-BY 4.0), a copy of which is available at: https://creativecommons.org/licenses/by/4.0/legalcode. This license permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.

* Address correspondence to this author LAPSTICE Lab, Language and Communication Department Faculty of Science Ben M’Sik, Casablanca, Morocco; Tel: 00212-650352972; E-mail: Sabir.brahim@hotmail.com



Optical character Recognition (OCR) is a technic that converts scanned or printed text images into editable text. Many OCR solutions have been proposed and used for Latin and Chinese alphabets.

However not much can be found about OCRs for the handwriting scripts Arabic Alphabets, and especially to be used for blind and visually impaired persons.

This paper has been an attempt towards the development of an OCR for Arabic Alphabets dedicated to blind and visually impaired persons.


The proposed Optical Arabic Alphabets Recognition algorithm includes binarization of the inputted image, segmentation, feature extraction and a classification based on neural networks to match read Arabic alphabets with trained pattern.

The proposed algorithm has been developed using Matlab, and the solution was designed to be implemented on hardware platform and can be customized for mobile phones.


The presented method has the benefit that the accuracy of recognition is comparable to other OCR algorithms.

Keywords: Artificial Neural Network, OCR, Arabic Alphabets, HDL coder, Blind.


Arabic language is a cursive language, which has 28 alphabets Fig. (1), written from right to left, and each character has different form according to its position in the word [1].

For these reasons, Optical character recognition (OCR) of Arabic alphabets is more complicated than the recognition of the other languages (Latin, Chinese…)

The characteristics of Arabic do not allow direct implementation of many algorithms used for other Languages like English or Chinese. This is mainly because Arabic characters are always connected even when typewritten [1].

The automatic recognition has large commercial importance. It has applications in cheque reading, collecting data from scanned documents, e-books producing. And dealing with the methods used for OCR, Artificial neural networks (ANNs) offer parallel processing of data in

ccontrast to the conventional sequential processing computing systems.

The ANN has been used in a wide variety of applications such as character recognition. Most of these applications are software-based [2].

Software implementations of the optical character recognition (OCR) systems have been reported extensively

In the research literature. Off-line printed and hand-written text recognition has been done using ANNs and other

Technologies such hidden Markov models (HMMs) [3].

A hardware-based ANN can take up different architectural forms such as perceptron, feed-forward multilayer Perceptron, radial basis function, etc [3].

The scope of this paper is optical character recognition of Arabic alphabets, dedicated to blind and visually impaired persons.

In this paper, after reviewing the state of the art in Section 2, the recognition process is explained in Section 3.

The hardware design of the solution is then described in Section 4; and section 5 is dedicated to the experimental results of the proposed solution.

Finally, conclusions are drawn in the last section, and directions for future works are presented.

Fig. (1). Arabic Alphabets.


Many approaches are used to recognize Arabic alphabets such as Grapheme-based approach [4], global features obtained with a spatial–temporal transform (wavelets) [5], directional/angular distributions [6, 7], word/phrase measurements [6, 8], statistical features, such as texture measurements [6, 7], grapheme distributions [6], gray-level statistics [9, 10], cross-correlation distributions [11, 12], Dynamic time Wrap [13], Artificial neural networks(ANN) [14] [15], or Kernel methods [16] such as Support Vector Machines (SVM).

And dealing with the rates of recognition, a rate of 97% was obtained by Dynamic Time Warp (DTW) algorithm [13]; a Multi-Layer Perceptron (MLP) based classifier yields an average recognition rate of 94.93% [17], Grapheme-based has been a rate of 96% [4]; recurrent neural network word recognition rate is 94.76% by Abandah et al. [17]

Hidden Markov Models (HMM) with a rate above 90% [18].

Statistical model yields a rate of 99.4% [19] [20] [21]. Recognition accuracies was 79% by Pal and Sarkar [22], and 97.8% by Shamsher et al. [23].

Khan et al. achieved a rate of 96.2% [24], however Sabbour and Safiat yield a recognition rate of 91% [25].

The ANN achieved 93% correct character recognition [14].


MATLAB 7.10.0 R2010a Version /64-bit software is used to implement the proposed Arabic OCR algorithm on an Dell Intel Core CPU M640@2.8GHZ, RAM 4Go, machine running a 64-bit operating, system -MS Windows 7.

The Cyclone II FPGA board is used to implement the VHDL code generated for matlab files.

The software ModelSim-Intel FPGA-2016 was used to simulate hardware design of our OCR.


Fig. (2) shows The main steps To build an Optical character recognition (OCR) which will offer blind and visually impaired persons the capacity to scan printed text and then speak it back in synthetic speech.

Fig. (2). Main steps of proposed method.

In optical character recognition step, we followed: training procedure, image acquisition, preprocessing, segmentation, feature extraction and classification [26].

The speech synthesizer tool step is not on the scope of the present paper.

The following sections explain these steps and the used techniques in the experiments of this paper.

4.1. Preprocessing

Preprocessing steps include: Binarization, filtering and smoothing.

The input image will be preprocessed in order to perform noise cleaning.

Convert to gray scale, binary image, remove salt and paper noise.

A Color, a graylevel, or a binary image of Arabic alphabet will be binarized based on:

For each point (x,y), X is random variable [0,254]:

If I (x,y) < X: level of the selected point = 1.

If I (x,y) > X: level of the selected point = 0.

4.2. Training Procedure

In order to build our artificial neural network, we used The Backpropagation Algorithm which has as input the segmented alphabets (matrix 35 * 35) and as outputs (vector column of 28 alphabets).

The training begins with random weights, and the goal is to adjust them so that the error will be minimal.

We note, A: Activation function, x input and w the weight:

Sigmoidal output (O) function:


The goal of the training process is to obtain a desired output when certain Inputs (Matrix of Arabic Alphabet) are given.

Since the error is the difference between the actual and the desired output, the error depends on the weights, and we need to adjust the weights in order to minimize the error E (difference between Output function and the distance):


The error of the network will be the sum of the errors of all the neurons in the output layer:


The error will generate confusion rates mentioned in tables of experimental results section.

The input to the training process is a set of Arabic alphabets’ images which ultimately produce the weight matrix of the recognizer’s neural network.

4.3. Image Acquisition

The alphabets are scanned or captured during the step of image acquisition. The saved image file format is GIF, bmp or jpeg.

4.4. Segmentation

The segmentation algorithm will extract each part as separate characters. Fig. 3 shows segmentation of the alphabet "Sin".

The non-cursive characteristic of the Arabic Alphabets facilitates the preprocessing step.

The segmentation step will be achieved in order to construct the input matrix (35 * 35).

Fig. 3. Segmentation step of the alphabets sin (س).

4.5. Classification

The classification assigns an unknown feature into a predefined class (character shape). A number of classification methods are used for Arabic text recognition for examples: Template Matching, Statistical Techniques, Syntactic Techniques, Neural Networks and Hidden Markov Model [27].

In this paper, the neural network classifier will be used to classify the inputted Arabic alphabets.


We opted for hardware implementation, in order to improve the speed of ANN, compared with software implementation.

An ANN’s structural details include number of inputs and outputs, and the number of layers, and activation functions (AFs).

We Implement the individual VHDL modules: adder, multiplier, shifter (divider), and AF (ramp, and piece-wise linear approximation of a sigmoid); for a single neuron.

Table 1. Sixty four adders of different sizez (bit widths) are needed to implement one hidden neuron.
Adder Size (Bits) Adder Count
12 1
13 3
14 5
15 10
16 20
17 25
18 30
Total 94

5.1. Activation Function Implementation

All the neurons in the entire ANN employ the same AF (activation function), but the output layer may use a different AF type.

There are several ways of approximating the sigmoid function [28], We opted for the combinational approximation.

The AF output ranges from -94 to 94.

In order to reduce the cost we replace the division operation with simple right shifts: 2-bit shifting for division-by-4, and 6-bit shifting for division by- 64.

5.2. Threshold Function Implementation

The threshold function in our neurons outputs ‘0’ if the input is less than or equal to zero; else the output is ‘1’.

The hardware implementation of this function simply comprises of a most-significant bit comparator.

5.3. Model Simulation and Analysis

The proposed VHDL models were simulated using ModelSim-Intel FPGA-2016.

We opted for the input samples which are made up of 35x35 grids which is the matrix generated from Arabic alphabets’ segmentation.


The Table 2 summarizes the recognition rates of proposed algorithm on software hardware platform.

Tests were done using images of size 2500*2500 pixels.

The recognition rate of software based solution is higher than the recognition rates of the one implemented in hardware platform; however the time consumption of hardware platform is reduced by 86%.

The higher error rate in hardware platform could be mainly attributed to the following factors:

  • The Approximation of the sigmoid AF.
  • The use of large grid, however it will lead to higher hardware implementation cost.
Table (2). recognition rates, error rates and time consumption.
Method Recognition Rates-same Font Type(%) Error Rates(%) Time Consumption
(28 alphabets)
Proposed Algorithm
-Software only
96.4% 3.6% 2.2 seconds
Proposed Algorithm on Hardware 85.7% 14.3% 0.3 seconds


In this paper, we present an OCR for Arabic alphabets. The OCR system has been quite successful in the recognition of input images. The experimental result shows us that with the test image (matrix of 35*35) with same font type the accuracy rate is 96.4% on software implementation.

Searches and comparisons are time consuming, however the accuracy of proposed method is high compared to other OCRs

A comparison study of proposed algorithm on hardware platform is carried out with proposed algorithm (software only).

Future work for the alphabets with high rates of confusion a multiple classifier will be implemented, Additional training samples could improve the ANN learning ability, hence improving the prediction accuracy. This may not affect the ANN hardware configuration.

In this paper the hardware implementation of the ANN had lower accuracy than its software counterpart.

The hardware’s character recognition accuracy is still significantly high at 85.7%.

One reason for reduced accuracy is the approximation of non-linear sigmoid Activation Function.

Further improvements are possible without significantly altering the hardware, for example, by using a larger dataset for training, and possible implementation of proposed design using synthesis tools (such as Synopsys Design Compiler) in order to save on adder hardware (inside a neuron) .

The proposed solution can be customized to be implemented in mobile phones.


Not applicable.


The author (editor) declares no conflict of interest, financial or otherwise.


I would like to thank Mrs. Maida Bermudez her valuable contribution.


[1] Djeddi C, Souici-Meslati L. A texture based approach for arabic writer identification and verification In: 2010 International Conference on Machine and Web Intelligence (ICMWI). Algiers, Algeria: IEEE 2010; pp. 115-20.
[2] Khader A, Saudagar J, Mohammed HV. Concatenation Technique for Extracted Arabic Characters for,Efficient Content-based Indexing and Searching In: Proceedings of the Second International Conference on,Computer and Communication Technologies. Hyderabad, India: Advances in Intelligent Systems and Computing 2015; pp. 24-6.
[3] Nidhal Abdi M, Khemakhem M. A model-based approach to offline text independent Arabic writer identification and Verification. Pattern Recognit 2015; 48: 1890-903.
[4] Malik H, Fahiem MA. Segmentation of printed Urdu scripts using structural features Proc 2nd International Conference in Visualisation (VIZ’09). 191-5.
[5] Gazzah S, Ben Amara N. Arabic handwriting texture analysis for writer identification using the DWT-lifting scheme In: The Ninth International Conference on Document Analysis and Recognition (ICDAR 2007). Curitiba, Parana, Brazil: IEEE 2007; 2: pp. 1133-7.
[6] Bulacu M, Schomaker L, Brink A. Text-independent writer identification and verification on offline arabic handwriting in: Document Analysis and Recognition. In: ICDAR 2007. Ninth International Conference on, vol. 2, IEEE,; Curitiba, Parana, Brazil. 2007; pp. 769-73.
[7] Abdi MN, Khemakhem M, Ben-Abdallah H. A novel approach for off-line arabic writer identification based on stroke feature combination In: The 24th International Symposium on Computer and Information Sciences (ISCIS 2009). Guzelyurt, Northern Cyprus: IEEE 2009; pp. 597-600.
[8] Ghoniemy S, Fadel S, Asif M. A multipurpose Multi-Agent System based on a loosely coupled architecture to speedup the DTW algorithm for Arabic In: International Journal of informatics and medical data processing (JIMDP). 2016; 1, 2: pp. 14-21.
[9] Das N, Mollah AF, Saha S. Handwritten Arabic Numeral Recognition using a Multi Layer Perceptron. In: Proceeding National Conference on Recent Trends in Information Systems. 2006; pp. 200-3.
[10] Khemakhem M, Belghiti A. Towards A Distributed Arabic OCR Based on the DTW Algorithm: Performance Analysis. Int Arab J Inf Technol 2009.
[11] Hasan AU, Ahmed SB, Rashid F, Shafait F, Breuel TM. "Offline printed Urdu Nastaleeq script recognition with Bidirectional LSTM networks", 12th International Conference on Document Analysis and Recognition (ICDAR’13), 2012 pp. 1061-1065.
[12] Al-Ma’adeed S, Mohammed E, Al Kassis D. Writer identification using edgebased directional probability distribution features for arabic words. In: in: IEEE/ACS International Conference on Computer Systems and Applications (AICCSA 2008). Doha, Qatar: IEEE 2008; pp. 582-90.
[13] Shah ZA. Ligature based optical character recognition of Urdu-Nastaleeq Font Proc 6th International Multitopic IEEE Conference (INMIC’02). 25-5.
[14] Abdi MN, Khemakhem M, Ben-Abdallah H. Off-line text-independent arabic writer identification using contour-based features. Int J Signal Image Process 2010; 1: 4-11.
[15] Zidouri A. Oran: A basis for an arabic OCR system. Arab J Sci Eng 2005; 31(1B)
[16] Sari T, Mokhtar LS, Sellami M. Off-line handwritten Arabic character, segmentation algorithm: ACSA Proceedings of the Eighth International Workshop on Frontiers in Handwriting Recognition (IWFHR’02).
[17] Abandah G a, Jamour F T, Qaralleh E a. Recognizing handwritten Arabic words using grapheme segmentation and recurrent neural networks International Journal on Document Analysis and Recognition (IJDAR) Mar 2014.
[18] Witten IH, Frank E. Data Mining., 2nd ed Morgan Kaufman Publishers: San Francisco, CA, 2005.
[19] Abdi N, Khemakhem M. Arabic writer identification and verification using template matching analysis of texture In: 2012 IEEE 12th International Conference on Computer and Information Technology (CIT). Chengdu, China: IEEE 2012; pp. 592-7.
[20] Djeddi C, Souici-Meslati L. "Artificial immune recognition system for arabic writer identification", 2011 Fourth International Symposium on Innovation in Information & Communication Technology (ISIICT), 2011 pp. 159-165
[21] Graves A, Liwicki M, Fernández S, Bertolami R, Bunke H, Schmidhuber J. A novel connectionist system for unconstrained handwriting recognition. IEEE Trans Pattern Anal Mach Intell 2009; 31(5): 855-68.
[22] Pal U, Sarkar A. Recognition of printed Urdu script Proceedings of the Seventh International Conference on Document Analysis and Recognition (ICDAR’03).
[23] Shamsher I, Ahmad Z, Orakzai JK, Adnan A. OCR for printed Urdu script using feed forward neural network. Proceedings of World Academy of Science, Engineering and Technology 2007; 23: 172-5.
[24] Khan K, Ullah R, Khan NA, Naveed K. Urdu character recognition using principal component analysis. Int J Comput Appl 2012; 60.
[25] Sabbour N, Shafait F. A segmentation-free approach to Arabic and Urdu OCR In: Proceeding of SPIE International Society for Optics and Photonics. International Society for Optics and Photonics. 2012; 86580.
[26] Al-Shatnawi A, Al-Zawaideh F, Al-Salaimeh S, Omar K. “Offline Arabic Test Recognition – An Overview,” Irbid National,University, Jordan. Conf 2011; 1(5): 184-92. [WCSIT].
[27] Beg A. An Efficient Realization of an OCR System Using HDL In: International Conference on Artificial Intelligence (ICAI'08). United States: Las Vegas, NV 2008.
[28] Sabir B, Jadir A, Khazri Y, Touri B, Moussetad M. Multiple Classifiers Combination Applied to OCR of Tifinagh Alphabets. Int J Eng Innovat Technol 2014; 4(5): 1-8. [IJEIT].