SignConnect Wiki
ArSL-CNN: Recognising the Arabic Sign Language Alphabet from a Webcam
Amr Bedir
Nov 27, 2026
**Published:** November 27, 2026 **Category:** Computer Vision / AI Models / Open Source **Repository:** [github.com/SignConnect-EG/ArSL-CNN](https://github.com/SignConnect-EG/ArSL-CNN) (MIT License) **Trained models:** [Release v1.0](https://github.com/SignConnect-EG/ArSL-CNN/releases/tag/v1.0) **Images:** charts and diagrams made by the SignConnect team from our own measurements; sample hand images come from the public ArASL2018 and ArSL21L datasets (CC BY 4.0). > This article tells the story of our computer-vision track: four models we built one after the other to recognise the 32 letters of the Arabic Sign Language alphabet from a normal webcam. It covers what each version does, the real accuracy of each one (re-measured for this article), why the first three were not good enough, and what finally worked. It is written for students and researchers who want to start a sign-language recognition project without repeating our mistakes.  *The final model (v4) running live on a laptop webcam. The user holds the sign inside the red box and the detected letter appears above the image.* --- ## 1. The Short Version - **Goal:** recognise the **32 static hand shapes** of the Arabic Sign Language (ArSL) alphabet from a webcam, in real time. - **Final model (v4):** a **ResNet-18** pre-trained on ImageNet and fine-tuned on colour photos. - **Result:** **90.02% accuracy** on **15 people the model never saw during training** (macro F1 0.899). - **Everything is open:** code, trained weights, evaluation scripts, and full documentation in English and Arabic.  --- ## 2. Why We Built It SignConnect's main product is a smart glove that reads finger movement. Alongside it, we wanted to know how far a **camera alone** can go: no hardware, just a laptop or a phone. The alphabet is the natural first step. It is a fixed set of 32 hand shapes, there are public datasets for it, and it is the base for spelling names and words that have no sign of their own. These are the 32 letters, with the names we use in code:  `ain, al, aleff, bb, dal, dha, dhad, fa, gaaf, ghain, ha, haa, jeem, kaaf, khaa, la, laam, meem, nun, ra, saad, seen, sheen, ta, taa, thaa, thal, toot, waw, ya, yaa, zay` --- ## 3. Results at a Glance All numbers below were measured again on November 27, 2026 with the released models and the scripts in the repository.  | Version | Approach | Data | Evaluated on | Accuracy | | :--- | :--- | :--- | :--- | :--- | | v1 | Hand landmarks + Random Forest | 90 self-recorded sequences, 3 signs | 18 test sequences | 100% (too small to mean much) | | v2 | Hand landmarks + LSTM | ArASL2018, 32 signs | 282 test sequences | 4.6% (random guess = 3.1%) | | v3 | CNN from scratch, 64×64 grayscale | ArASL2018, 54,049 images | 10,797 validation images | 87.4% | | v3 | same model | ArSL21L colour photos | 4,247 images, 15 signers | **6.2%** | | **v4** | **ResNet-18 transfer learning, 416×416 colour** | **ArSL21L, 14,202 images** | **4,247 images, 15 unseen signers** | **90.02%** | --- ## 4. The Four Versions ### v1: Hand landmarks + Random Forest (October 9, 2025) Our first prototype did not look at pixels at all. Google's **MediaPipe Hands** finds 21 points on the hand (the wrist and every finger joint) and gives their x, y, z positions. We recorded **30-frame sequences** of these points from the webcam, which is 30 × 21 × 3 = 1,890 numbers per sequence, and trained a **Random Forest** (scikit-learn, 100 trees) on them. - `collect_data.py` shows a small menu on the camera feed: `A` records 30 new sequences for the current letter, `S` skips it, `Q` quits. - `realtime_recognition.py` keeps a sliding window of the last 30 frames and shows the letter when the model is more than 80% sure. It worked, but only for the **3 letters we had time to record** (Alif, Ba, Ta). Recording 30 sequences per letter, for 32 letters and many different people, was clearly not going to scale. ### v2: Hand landmarks + LSTM (October 18, 2025) To get data for all 32 letters, we turned to **ArASL2018**, a public dataset of 54,049 photos. `convert_dataset.py` ran MediaPipe on every photo and grouped each 30 photos of the same letter into one "sequence", then a 3-layer **LSTM** (TensorFlow/Keras) was trained on those sequences. When we re-measured it for this article, the LSTM scored **4.6%**, barely above random guessing (3.1%). The reason was hidden in the data: - **MediaPipe found no hand in 97.96% of the images** (41,377 of 42,240). ArASL2018 photos are tiny 64×64 grayscale close-ups, which MediaPipe was not designed for. Every missed frame was saved as 63 zeros, so the model trained almost entirely on empty input, and nothing warned us. - **There was no real motion.** Each "sequence" was 30 different still photos stacked together. An LSTM looks for patterns over time, and there was no time to learn from. We kept this version in the repository on purpose, because the lesson is valuable. `convert_dataset.py` now prints how many images had no detected hand. ### v3: CNN from scratch (October 19, 2025) Next we skipped landmarks and classified the **image itself** with a small convolutional network (three Conv + MaxPool blocks, then Dense layers) trained on ArASL2018 at 64×64 grayscale. A second real-time script uses MediaPipe only to find and crop the hand, then classifies the crop. On ArASL2018's own validation split it reaches **87.4%**. That looked good until we tested it on real colour photos of other people from the ArSL21L dataset: **6.2%**.  The gap between training (98.9%) and validation (87.4%) already showed overfitting. The collapse on real photos shows the deeper problem: ArASL2018 images are small, grayscale and taken against plain backgrounds, while a real camera sees colour, furniture, clothes and changing light.  *Left: ArASL2018, what v3 was trained on. Middle: ArSL21L, a real photo in a real room. Right: the same photo shrunk to 64×64 grayscale, which is all v3 gets to see.* ### v4: ResNet-18 transfer learning (October 23, 2025) The final version changed four things at once: 1. **Better data:** **ArSL21L**, 14,202 colour photos of the 32 letters from **50 different people**, taken in ordinary rooms. 2. **Transfer learning:** instead of training from zero, we started from **ResNet-18 pre-trained on ImageNet**, which already knows edges, textures and shapes from millions of images. We froze the early layers and fine-tuned only `layer3`, `layer4` and a new 32-class output layer. 3. **Bigger, colour input:** 416×416 RGB instead of 64×64 grayscale. 4. **A fair test:** we split the data **by person**. 35 people are used for training and **15 different people** for validation, with no overlap. | Setting | Value | | :--- | :--- | | Framework | PyTorch | | Input | 416×416 RGB, ImageNet normalisation | | Augmentation | random rotation ±15°, horizontal flip, brightness/contrast jitter | | Optimiser | Adam, learning rate 1e-4, batch size 32 | | Scheduler | halve the learning rate after 3 epochs without improvement | | Early stopping | stop after 5 epochs without improvement (max 40) | | Split | 9,955 training images (35 people) / 4,247 validation images (15 other people) | **Result: 90.02% accuracy and 0.899 macro F1 on the 15 unseen people.**  --- ## 5. A Closer Look at v4 Most letters are recognised above 90%. Four letters fall below 80%, and **gaaf** is the hardest at 64.2%.  The confusion matrix shows which letters get mixed up. Each row is the true letter and each column is what the model predicted; a perfect model would only have numbers on the diagonal.  The most common mistakes are between letters whose hand shapes really are close: | True letter | Predicted as | Times | | :--- | :--- | :--- | | gaaf | fa | 26 | | dha | taa | 12 | | ta | thaa | 12 | | dhad | saad | 11 | | fa | saad | 10 | These pairs are the best place to improve the model next. --- ## 6. What We Learned 1. **Start from public data.** Recording your own dataset is slow; use it to fill gaps, not to start. 2. **Check what your feature extractor produces before training.** v2 failed silently because MediaPipe returned nothing for 98% of the images. 3. **Don't model time when there is no time.** Static letters don't need an LSTM; still photos don't contain motion. 4. **Lab images don't transfer to real cameras.** v3 scored 87.4% on its own dataset and 6.2% on real photos. Always test on data that looks like real use. 5. **Transfer learning plus realistic data wins.** A pre-trained ResNet-18 on colour photos from 50 people reached 90.02%. 6. **Split by person, not by image.** If the same person appears in training and testing, the score looks better than reality. Our 90.02% is measured on people the model has never seen. --- ## 7. Try It Yourself ```bash git clone https://github.com/SignConnect-EG/ArSL-CNN.git cd ArSL-CNN/v4-resnet18-pytorch pip install -r requirements.txt # download best_arsl_cnn_model.pth from the v1.0 release into this folder python infer-matplot.py ``` Hold your hand inside the red box. The letter and its confidence appear when the model is more than 90% sure. Python 3.10 is recommended; a GPU is only needed for training. To reproduce our numbers, place the ArSL21L images in `data/sign_data/` and run `python evaluate.py`. It prints accuracy, macro F1, per-letter accuracy and the top confusions, and saves the confusion matrix. Every version has its own folder, README and `requirements.txt`, so each one can be run and studied separately. --- ## 8. Limitations - **Letters only.** The models recognise the 32 static alphabet shapes, not words, sentences, or signs that need movement. - **Fixed position.** In v4 the hand has to be inside the centre box; there is no hand detection or tracking. - **Similar letters.** gaaf, dal, fa and bb are below 80%. - **No separate test set.** The 15 validation signers were also used to pick the best epoch. - **Regional variation.** Sign languages differ between Arab countries; the models follow the alphabet in the datasets. --- ## 9. Ideas for Students and Researchers - **Use the bounding boxes.** ArSL21L includes hand boxes. Train a detector (such as YOLO) to find the hand, then classify the crop, so the hand can be anywhere in the frame. - **Fix the confusing pairs** with targeted data or augmentation (gaaf/fa, dha/taa, ta/thaa, dhad/saad). - **Compare backbones** (EfficientNet, ConvNeXt, MobileNetV3 for phones) using the same person-based split. - **Revisit landmarks** with real colour webcam video, where MediaPipe works well. - **Move to words and sentences** with video models. - **Export** to ONNX or TensorFlow Lite for mobile and web. --- ## 10. Datasets and Credits | Dataset | Used by | Content | License | Link | | :--- | :--- | :--- | :--- | :--- | | ArSL21L: Arabic Sign Language Letter Dataset | v4 | 14,202 colour images, 32 letters, 50 signers, with hand bounding boxes | CC BY 4.0 | [Mendeley Data](https://data.mendeley.com/datasets/8hrn3bvdvk/1) | | ArASL2018: Arabic Alphabets Sign Language Dataset | v2, v3 | 54,049 grayscale 64×64 images, 32 letters, 40+ signers | CC BY 4.0 | [Mendeley Data](https://data.mendeley.com/datasets/y7pckrw6z2/1) | - G. Latif, N. Mohammad, J. Alghazo, R. AlKhalaf and R. AlKhalaf, "ArASL: Arabic Alphabets Sign Language Dataset," *Data in Brief*, vol. 23, 103777, 2019. doi:10.1016/j.dib.2019.103777 - G. Batnasan, M. Gochoo, M.-E. Otgonbold, F. Alnajjar and T. K. Shih, "ArSL21L: Arabic Sign Language Letter Dataset Benchmarking and an Educational Avatar for Metaverse Applications," *IEEE EDUCON*, 2022. If our code or models help your work, please cite the repository (GitHub's "Cite this repository" button) and the dataset you used. --- ## 11. Quick Reference | Item | Value | | :--- | :--- | | Repository | [SignConnect-EG/ArSL-CNN](https://github.com/SignConnect-EG/ArSL-CNN) | | License | MIT (code); datasets CC BY 4.0 | | Classes | 32 Arabic Sign Language letters | | Best model | v4, ResNet-18, PyTorch, 45 MB | | Accuracy | 90.02% on 15 unseen signers, macro F1 0.899 | | Hardest letter | gaaf (64.2%), often read as fa | | Input | webcam frame, centre 416×416 crop | | Python | 3.10 recommended | | Documentation | English README and Arabic README in the repository | --- ## Contact Need help running the code, using the models in a project or thesis, or want to collaborate? Write to us at **[info@signconnect.digital](mailto:info@signconnect.digital)** or **[amrbedir@std.mans.edu.eg](mailto:amrbedir@std.mans.edu.eg)**, or open an issue on the [GitHub repository](https://github.com/SignConnect-EG/ArSL-CNN/issues).