# Recognition of Urdu Handwritten Characters Using Convolutional Neural Network
## 6 Experimental Setup and Results  
In order to evaluate the accuracy of our proposed model (see Figure 11, we used CNN to classify both the Urdu handwritten characters and numerals in two different experiments. In order to classify the Urdu handwritten numerals, \(3/4\) of the 8000 data was selected as training data and \(1/4\) as test data. The same proportion was used for classifying the Urdu handwritten character dataset in the second set of experiments. While training CNN having four convolutional layers for both the experiments, we considered the learning rate, the number of hidden neurons, and the batch size as parameters. It was observed from the results that CNN worked efficiently by increasing the network scale with one major drawback of the problem of over-fitting due to a longer time incurred while training. On the other hand, it is possible to get the optimal state of the model by tuning the batch size. The rule of thumb is that the model cannot be trained when the batch size is increased to some certain value [64]. Furthermore, the batch size was also dependent on the available memory. The effect of both the batch size and learning rate on accuracy is shown in Figure 14. In order to avoid the issues mentioned above, we trained the model in a controlled environment using a momentum value of 0.8. This specific value of momentum helped with obtaining the optimal results. Figure 13: Inside architecture of our proposed CNN for Urdu handwritten character recognition system. In order to achieve the optimal state of the network, we had to increase the number of convolutional cores gradually since the increase all at once would cause the problem of overfitting. In the case of batch size, relatively large numbers were needed to achieve the global gradient. We chose the learning rate of 0.0025 with a batch size of 132. The confusion matrices with efficiency graphs using the different numbers of hidden neurons for the Urdu handwritten numerals are shown in Figure 15 with an average accuracy rate of 98.03%. The diagonal values show the classification accuracy of individual Urdu numeral, while the overall accuracy achieved in each experiment is highlighted in a box (bottom right) in the corresponding confusion matrix. Furthermore, the off-diagonal cells correspond to incorrectly classified observations. Both the number of observations and the percentage of the total number of observations are shown in each cell. The column on the far right of the matrix shows the percentages of all the correctly and incorrectly predicted examples belong to each class. It is clear from the performance graphs that the number of epochs increased with the number of hidden neurons in order to achieve higher accuracy. Here, hidden neurons are not representing the number of classes. In practice, the number of hidden neurons in each new hidden layer equals the number of connections to be made. It is also mentioned in the structure of CNN (Figure 13) that the internal layer may be comprised of different numbers of hidden neurons. These neurons help in choosing the features of the input image as deeply as possible. It is pertinent to mention that adding to the number of neurons may increase the complexity, but it helps achieve a higher accuracy rate. The output class here was the labels of the Urdu handwritten character, i.e., from 0-9 in case of numeral recognition. The same set of experiments was performed with the dataset of Urdu handwritten characters. In this experiment, the model of CNN was modified by increasing the number of outputs from 10 to 12 since the Urdu characters were grouped into 12 classes based on the shape similarity (see Figure 10). Similarly, the same set of parameters with different values was applied for this set of experiments. We chose a learning rate of 0.08 with a starting batch size of 40. The confusion matrices with efficiency graphs using the different number of hidden neurons for the Urdu handwritten numerals and isolated characters are shown in Figures 15 and 16, respectively.