Alif Ba! - Arabic Letter Recognition Using a Convolutional Neural Network
May 11, 2019 01:47pm
by Thomas Tran


Alif Ba! sends your drawing to an internal Django REST Framework API that is on a remote Google Cloud server. It then parses and normalizes your drawing and feeds that to the machine learning algorithm, which then outputs a prediction of an Arabic letter in its isolated form. A vertical bar graph is also included to display the algorithm's confidence in its prediction. To begin using Alif Ba! please start drawing on the canvas below. The Arabic letters in their isolated forms are also included for your convenience in the horizontal list below the canvas.


Alif Ba! is a character recognition system built with the Convoluted Neural Network (CNN) and the Adam gradient-based optimization machine learning algorithms. The system is built to recognize isolated Arabic alphabet characters. It is not meant to recognize any other character forms such as initial, medial, or final.

Alif Ba! is not perfect, but it is always improving. Be sure to check back in the future to see its improvement over time. To operate it, please draw on the canvas below and then click the "Submit" button. To clear the canvas, simply click the "Clear" button.

The following table shows the printed Arabic alphabet:
The following table shows the handwritten Arabic alphabet:

The underlying implementation of Alif Ba! is essentially the Adam optimization algorithm that is an alternative to the traditional stochastic gradient descent procedure. It is based on adaptive estimates of lower-order moments. This optimization was used because it is computationally efficient, has little memory requirements, is invariant to diagonal rescaling of the gradients, and is well suited for problems that are large in terms of data and parameters. The optimization algorithm updates network weights iteratively based on training data and finds the optimal weight after all subsequent iterations. The iterations are controlled by the neural network. The forward propagation routine through the network updates the weights and the back propagation then optimizes those weights.

The CNN architecture used in this project was inspired by and implemented from the same architecture mentioned in the following research paper: Ciresan, Dan, Meier, Ueli, Masci, Jonathan, Gambardella, Luca, and Schmidhuber, Jürgen. "Flexible, High Performance Convolutional Neural Networks for Image Classification" International Joint Conference on Artificial Intelligence (2011). Web. 15 May 2019.



See the source code for the Alif Ba! machine learning model at: https://github.com/tranindigo/alifba-model. The source code for the Alif Ba! app and API is available at https://github.com/tranindigo/alifba-app.

And, as always, if you see any mistakes or if you have ideas that you think will improve the neural network model, API, or app, please feel free to contact me at tranindigo@gmail.com. Thank you!