---
title: 'Hijja: Arabic Children''s Handwriting Dataset'
url: https://www.emergentmind.com/topics/hijja
type: topic
---

# Hijja: Arabic Children's Handwriting Dataset

Hijja, often stylized as HIJJA in later benchmarking work, is a children-focused Arabic handwritten character dataset introduced by Altwaijry and Al‑Turaiki to support research on Arabic handwriting recognition under the specific difficulties posed by school-aged writers. Its significance derives from the conjunction of Arabic’s semi‑cursive script, high visual similarity among letters, the discriminative role of dot diacritics, and the markedly high intra-class variability of children’s writing. In subsequent work, Hijja has been used both as a primary benchmark for custom deep CNN pipelines and as a stress test for transfer learning with lightweight mobile-enabled CNNs, where it is consistently described as more difficult than adult-handwriting benchmarks such as AHCD [2211.02119] [2509.05019].

## 1. Corpus definition and label granularity

Hijja was collected from 591 kids aged roughly 7–12 in Arabic-speaking schools in Riyadh, Saudi Arabia. It contains 47,434 labeled character images and covers the full Arabic alphabet plus the isolated form of Hamza. In the characterization used by the 2022 CNN study, this yields 29 classes, with both isolated and connected forms represented, making the corpus suitable for recognizers that must cope with positional shape variation. The same study treats the images as grayscale at \(32\times 32\) resolution and consumes labels as one-hot vectors for multi-class classification [2211.02119].

A later transfer-learning study uses the same corpus under a different task definition. There, the original dataset is described as containing 108 classes corresponding to different letter shapes, including isolated, initial, medial, and final forms, and all shapes of each Arabic letter are consolidated into a single class, yielding 28 classes. The total number of images remains 47,434, and each image is \(32\times 32\) pixels [2509.05019].

| Aspect | Reported configuration |
|---|---|
| Collection population | 591 kids aged roughly 7–12 in Riyadh |
| Total images | 47,434 |
| Image size | \(32\times 32\) |
| Labeling in one use | 29 classes: 28 letters plus isolated Hamza |
| Labeling in another use | 108 positional-form labels collapsed to 28 letter categories |

This dual description is a recurrent point of confusion in the literature. The discrepancy is not a contradiction in sample count, but a consequence of different recognition targets: one formulation retains a 29-way character inventory, while another collapses positional-form variation into letter-level categories.

## 2. Experimental protocols and data handling

The 2022 study employs 5-fold stratified cross-validation using `StratifiedKFold` with `n_splits=5` and shuffling enabled, selecting the fold with highest validation accuracy. Evaluation is performed on a held-out test set per dataset, and the reported metrics are accuracy, precision, recall, and F1. Preprocessing is deliberately minimal: resizing is unnecessary because images are already \(32\times 32\); all inputs are color-inverted to have a black background and white foreground; binarization, noise removal, and deskewing are not reported; segmentation is unnecessary because the dataset already provides pre-segmented character images; and conventional geometric augmentation such as rotation, zoom, shift, and scale is not used. Instead, the authors increase stylistic diversity by merging Hijja with AHCD, an adult Arabic handwriting corpus [2211.02119].

The 2025 transfer-learning study preserves the predefined split supplied by the dataset creators: 80% training, corresponding to 37,933 images, and 20% testing, corresponding to 9,500 images. Within the training split it again applies 5-fold cross-validation, using 80% train and 20% validation in each fold, and tests the checkpoint with highest validation accuracy. Its preprocessing policy differs sharply from the earlier CNN study: the authors state that they strictly used the original dataset images without any preprocessing, except for resizing to match model input dimensions. Augmentation is included at a high level, with transformations such as rotation and flipping. The same study also performs a robustness analysis under Gaussian perturbations using 100 perturbations at noise level \(\sigma=0.01\) and 200 perturbations at \(\sigma=0.1\) [2509.05019].

Beyond standard classification accuracy, the transfer-learning study evaluates calibration and noise sensitivity through
$$
ECE = \sum_{m=1}^{M} \frac{|B_m|}{N} \cdot | acc(B_m) - conf(B_m) |
$$
and
$$
\text{Sensitivity} = \frac{1}{N} \sum_{i=1}^{N} Var(\hat{y}_i \mid x_i + \epsilon), \qquad \epsilon \sim \mathcal{N}(0,\sigma^2),
$$
thereby treating Hijja not only as a recognition benchmark but also as a testbed for uncertainty behavior under perturbation [2509.05019].

## 3. Custom CNN modeling and stroke-based decomposition

A central line of work on Hijja uses a custom deep CNN composed of four convolutional blocks followed by a three-layer feedforward classifier and a softmax output. The network receives \(32\times 32\times 1\) grayscale input. The four convolutional blocks use filters \([64,128,256,384]\) and conv-layer counts \([2,2,3,3]\); each convolutional stage uses LeakyReLU with negative slope \(0.3\), followed by \(2\times 2\) max pooling and batch normalization. The final feature map is \(4\times 4\times 384\), flattened to 6,144 units. The classifier consists of Dense \(256 \rightarrow 128 \rightarrow 64\), again with LeakyReLU\((0.3)\), dropout \(p=0.3\), and HeUniform initialization for all convolutional and dense weights. The output layer is a dense softmax with 29 logits for Hijja [2211.02119].

Training uses Adam with initial learning rate \(0.001\), batch size 128, and 30 epochs. A custom callback multiplies the learning rate by \(\exp(-0.01)\) after each epoch, in addition to Adam’s internal adaptivity, and the study reports that this empirically improved performance. Weight decay or \(L_2\) regularization are not reported [2211.02119].

A distinctive extension is the stroke-based multi-model strategy. In that framework, a stroke is defined as the continuous trace from the moment the pen or stylus touches the writing surface until it lifts, with dots and secondary marks counted as separate strokes if written with pen lifts. Letters are grouped into four sets according to typical numbers of strokes in basic Naskh handwriting and other common styles, and four separate CNNs with the same architecture are trained, one per group. The grouping is manual rather than algorithmic: it is determined a priori from script conventions and observed styles. The paper explicitly notes ambiguous cases such as Sheen \((\text{ش})\) and Yaa \((\text{ي})\), which may fall into different groups depending on whether dots are written as separate points or merged marks. At inference time, the proposed deployment route is to pass each input to a single model on the basis of stroke-count routing; the system does not merge probabilities across models [2211.02119].

This formulation makes an important distinction between online and offline recognition. For online handwriting, stroke count can be measured directly from pen lifts. For offline scans, automatic stroke inference would be required, but it is not implemented in the study.

## 4. Empirical performance and characteristic error modes

On Hijja alone, the custom CNN reaches 91% overall accuracy, improving over the Hijja authors’ baseline CNN reported at 87%. Precision, recall, and F1 macro averages are around \(0.90\). The appendix-level per-class results show strong performance for letters such as Alif, Seen, Sheen, and Yaa, while recall is comparatively lower for letters with subtle diacritic differences or difficult medial shapes, including Daal/Dhaal, Aayn/Ghayn, and Faa/Qaaf in noisy scans. Typical misclassifications include Qaaf \((\text{ق})\) versus Faa \((\text{ف})\) when dots are faint or missing, and confusions among connected forms such as Baa \((\text{ب})\) versus Miim \((\text{م})\) or Taa \((\text{ت})\) versus Seen \((\text{س})\) when stroke configurations resemble one another. A formal confusion matrix and significance tests are not reported in that study [2211.02119].

When Hijja is merged with AHCD, using pandas to concatenate CSV files and transposing AHCD images with NumPy to correct orientation prior to merging, the single-model CNN improves from 91% to 93% accuracy. The stroke-based multi-model approach on the merged Hijja-AHCD dataset reaches an averaged prediction accuracy of 96%. The reported interpretation is that stylistic diversity from adult handwriting and reduced class confusion through stroke-based routing both contribute to the gain [2211.02119].

The later lightweight-CNN study confirms that Hijja remains difficult even under stronger transfer-learning baselines. On Hijja, training as a fixed feature extractor underperforms across all tested mobile-enabled architectures, with accuracies of 0.48 for MobileNet, 0.43 for MnasNet, 0.54 for ShuffleNet, and 0.47 for SqueezeNet. Training from scratch is substantially stronger, at 0.90, 0.90, 0.91, and 0.88 respectively. Full fine-tuning, denoted training as weight initializer, produces the best overall result: ShuffleNet reaches 0.92 accuracy, 0.92 precision, 0.92 recall, and 0.92 F1, while MobileNet attains 0.90, MnasNet 0.85, and SqueezeNet 0.91 [2509.05019].

The same study shows that Hijja also stresses calibration and robustness. Under full fine-tuning, entropies remain low, but the calibration error lies in the \(0.13\)–\(0.19\) range. ShuffleNet’s performance illustrates a trade-off between peak accuracy and high-noise robustness: under the higher-noise setting, its sensitivity reaches 0.0772, whereas MobileNet’s is 0.0011 [2509.05019].

## 5. Lightweight transfer learning and mobile deployment considerations

The transfer-learning literature positions Hijja as a benchmark for resource-efficient Arabic Handwritten Character Recognition. Four lightweight mobile-suitable CNNs are evaluated: MobileNetV3\_small with approximately 2.5M parameters and approximately 0.02 GFLOPs, ShuffleNet V2 \(\times 0.5\) with approximately 1.4M parameters and approximately 0.013 GFLOPs, MnasNet 0.5 with approximately 2.2M parameters and approximately 0.31 GFLOPs, and SqueezeNet 1.1 with approximately 1.2M parameters and approximately 0.36 GFLOPs. The study emphasizes low parameter counts and FLOPs for memory efficiency and low-latency inference on resource-constrained devices, and highlights ShuffleNet and MobileNet as especially strong in the accuracy-efficiency trade-off [2509.05019].

Training in that work is conducted on a Google Colab VM with 12.7 GB RAM, 15 GB VRAM, and 78.2 GB disk. Hyperband is used for hyperparameter optimization with early termination of poor trials, and a Cosine Annealing learning-rate scheduler decays learning rates smoothly. Training runs for up to 50 epochs, with best-epoch checkpoint selection, and model weights are saved after each epoch as `.pt` files. The average training time per epoch across databases is reported as 200 seconds on Hijja, with inference of approximately 0.006 seconds per batch of 32. Across datasets, full fine-tuning shows the shortest average training time overall at 97 seconds per epoch [2509.05019].

These results matter because Hijja is not merely a classification benchmark but also a deployment benchmark. A model that performs well on Hijja must simultaneously tolerate children’s handwriting variability, low-resolution \(32\times 32\) inputs, high inter-class similarity, and the practical constraints of mobile or embedded inference. A plausible implication is that HIJJA functions as a discriminating benchmark for architectures whose early-stage feature extraction must resolve fine diacritic structure under severe parameter budgets.

## 6. Limitations, unresolved issues, and research directions

The dominant difficulty in Hijja is the interaction of writer age, script structure, and acquisition artifacts. Children’s handwriting exhibits high intra-class variability, unstable stroke counts, and nonstandard letter formation, especially in connected forms. Arabic letters frequently differ only by dot number or placement, and in children’s scans dots may be faint, merged, misplaced, or omitted. Minimal preprocessing, while operationally simple, leaves avoidable errors attributable to degraded dots and tails in the scanned images [2211.02119].

Several methodological limitations remain explicit in the literature. In the stroke-aware CNN study, there is no algorithmic stroke estimator for offline images, no explicit diacritic enhancement, no synthetic augmentation for class rebalancing, and no disclosure of stride, padding, or certain other low-level implementation details. In the transfer-learning study, the authors note limited preprocessing and limited architectural change in order to preserve a fair baseline; they also report no specific code repository or seed values, and the data-availability statement indicates that data will be made available on request [2211.02119] [2509.05019].

The proposed future directions are correspondingly specific. They include deployment in an online setting where stroke counts are directly observable from pen lifts; creation and release of an online children’s Arabic dataset; diacritic detection and enhancement; augmentation tailored to handwriting rather than generic image transformations; class-balanced sampling; architectural modifications such as batch normalization, deeper early feature extractors, and optimal dropout; in-depth dataset feature analysis; advanced sensitivity analysis; and lightweight architectures for on-device inference [2211.02119] [2509.05019].

Taken together, these studies establish Hijja as a benchmark whose difficulty is not exhausted by higher headline accuracy. It remains challenging because the hardest cases arise from fine-grained structural ambiguity rather than coarse category separation. This suggests that Hijja occupies a distinct position in Arabic handwriting recognition research: it is a corpus for studying positional-form variability, children-specific penmanship irregularity, dot-diacritic fragility, and the gap between offline image recognition and stroke-informed handwriting modeling.

Source: https://www.emergentmind.com/topics/hijja