CoolFace
Datasetpublic

riotu-lab/SARD-Extended

SARD: Synthetic Arabic Recognition Dataset Overview SARD (Synthetic Arabic Recognition Dataset) is a large-scale, synthetically generated dataset designed for training and evaluating Optical Character Recognition (OCR) models for Arabic text. This dataset addresses the critical need for comprehensive Arabic text recognition resources by providing controlled, diverse, and scalable training data that simulates real-world book layouts. Key Features… See the full description on the dataset page: https://huggingface.co/datasets/riotu-lab/SARD-Extended.

sourceHugging Facecc-by-nc-nd-4.0updated 4mo agoView on Hugging Face
9likes290downloads
Dataset Card

SARD: Synthetic Arabic Recognition Dataset

![Hugging Face Datasets](https://huggingface.co/datasets/riotu-lab/SAND-Extended) ![GitHub](https://github.com/riotu-lab/sard)

Overview

SARD (Synthetic Arabic Recognition Dataset) is a large-scale, synthetically generated dataset designed for training and evaluating Optical Character Recognition (OCR) models for Arabic text. This dataset addresses the critical need for comprehensive Arabic text recognition resources by providing controlled, diverse, and scalable training data that simulates real-world book layouts.

Key Features

  • —Massive Scale: 2,621,075 document images containing 794.6 million words
  • —Extensive Typographic Diversity: Ten distinct Arabic fonts covering a wide range of styles
  • —Structured Formatting: Designed to mimic real-world book layouts with consistent typography
  • —Clean Data: Synthetically generated with no scanning artifacts, blur, or distortions
  • —Content Diversity: Text spans multiple domains including culture, literature, Shariah, social topics, and more

Dataset Structure

The dataset is divided into ten splits based on font name:

  • —Amiri: Classical Naskh typeface inspired by early 20th century typography
  • —Sakkal Majalla: Widely used font in contemporary Arabic publishing
  • —Arial: Modern sans-serif font common in digital publications
  • —Calibri: Microsoft's default font representing contemporary digital typography
  • —Scheherazade New: Traditional-style font based on classical manuscript styles
  • —Jozoor Font: Decorative Arabic font with more stylized character forms
  • —Lateef: Extended Arabic script font designed for readability at small sizes
  • —Noto Naskh Arabic UI: Part of Google's Noto family, designed for user interfaces
  • —Thabit: Monospaced Arabic font for technical documentation
  • —Al Jazeera Arabic Regular: Based on the typography used by Al Jazeera media
  • —Traditional Arabic: Is a TrueType Arabic font with a regular style and installable embedding

📋 Sample Images <div align="center"> <table> <tr> <td><img src="https://cdn-uploads.huggingface.co/production/uploads/64e8eb21233101ed99b204c8/gwF9jkkkpzRSzrP9GCEl.png" width="300" alt="Sample 1 - Amiri Font"/></td> <td><img src="https://cdn-uploads.huggingface.co/production/uploads/64e8eb21233101ed99b204c8/dsqWoCh5x31eGq-u-PqPS.png" width="300" alt="Sample 2 - Arial Font"/></td> </tr> <tr> <td><img src="https://cdn-uploads.huggingface.co/production/uploads/64e8eb21233101ed99b204c8/2XK9Ey6k6HSDXKXCxmVRG.png" width="300" alt="Sample 3 - Calibri Font"/></td> <td><img src="https://cdn-uploads.huggingface.co/production/uploads/64e8eb21233101ed99b204c8/CxKITKvc3EnDIuqnNybV.png" width="300" alt="Sample 4 - Scheherazade Font"/></td> </tr> </table> </div>

Each split contains data specific to a single font with the following attributes:

  • —image_name: Unique identifier for each image
  • —chunk: The text content associated with the image
  • —font_name: The font used in text rendering
  • —image_base64: Base64-encoded image representation
  • —sample_id: Unique ID
  • —article_link: Link of the source article

Content Distribution

CategoryNumber of Articles
Culture13,253
Fatawa & Counsels8,096
Literature & Language11,581
Bibliography26,393
Publications & Competitions1,123
Shariah46,665
Social8,827
Translations443
Muslim's News16,724
Total Articles133,105

Font Specifications

FontWords Per PageFont SizeCharacteristics
Sakkal Majalla50–30014 ptContemporary publishing style
Arial50–50012 ptModern sans-serif
Calibri50–50012 ptContemporary digital document
Amiri50–30012 ptClassical Naskh typeface
Scheherazade New50–25012 ptTraditional manuscript style
Noto Naskh Arabic UI50–40012 ptClear UI rendering
Lateef50–35014 ptOptimized for small sizes
Al-Jazeera-Arabic50–25012 ptMedia/journalistic style
Thabit50–24012 ptMonospaced technical font
Jozoor Font50–20012 ptDecorative with stylization
Traditional Arabic50–35014 pt

Page Layout

SpecificationMeasurement
Page SizeA4 (8.27 × 11.69 in)
Left Margin0.9 in
Right Margin0.9 in
Top Margin1.0 in
Bottom Margin1.0 in
Gutter Margin0.2 in
Resolution300 DPI
Color ModeGrayscale
Page DirectionRight-to-Left
Text AlignmentRight
Line Spacing1.15

Usage Example

python
from datasets import load_dataset
import base64
from io import BytesIO
from PIL import Image
import matplotlib.pyplot as plt

# Load dataset with streaming enabled
ds = load_dataset("riotu-lab/SARD-Extended", streaming=True)
print(ds)

# Iterate over a specific font dataset (e.g., Amiri)
for sample in ds["Amiri"]:
    image_name = sample["image_name"]
    chunk = sample["chunk"]  # Arabic text transcription
    font_name = sample["font_name"]
    
    # Decode Base64 image
    image_data = base64.b64decode(sample["image_base64"])
    image = Image.open(BytesIO(image_data))

    # Display the image
    plt.figure(figsize=(10, 10))
    plt.imshow(image)
    plt.axis('off')
    plt.title(f"Font: {font_name}")
    plt.show()

    # Print the details
    print(f"Image Name: {image_name}")
    print(f"Font Name: {font_name}")
    print(f"Text Chunk: {chunk}")
    
    # Break after one sample for testing
    break

Working with Multiple Fonts

To train or evaluate models across different font styles:

python
from datasets import load_dataset
import random

# Load the dataset
ds = load_dataset("riotu-lab/SARD")

# Select a balanced sample from multiple fonts
fonts_to_use = ["Amiri", "Arial", "Scheherazade_New", "Thabit", "Noto_Naskh_Arabic_UI"]
samples_per_font = 1000
combined_samples = []

for font in fonts_to_use:
    # Get random samples from this font
    font_samples = ds[font].shuffle(seed=42).select(range(samples_per_font))
    combined_samples.extend([(sample, font) for sample in font_samples])

# Shuffle the combined samples
random.shuffle(combined_samples)

# Now you can use these samples for training or evaluation
for sample, font in combined_samples[:5]:  # Just show first 5 as example
    print(f"Font: {font}, Image: {sample['image_name']}")

Applications

SAND is designed to support various Arabic text recognition tasks:

  • —Training and evaluating OCR models for Arabic text
  • —Developing vision-language models for document understanding
  • —Fine-tuning existing OCR models for better Arabic script recognition
  • —Benchmarking OCR performance across different fonts and layouts
  • —Research in Arabic natural language processing and computer vision
  • —Developing font-adaptive OCR systems that generalize across typographic styles

Acknowledgments

The authors thank Prince Sultan University for their support in developing this dataset.

Citation

If you use SARD in your work, please cite the following paper:

APA:

Nacar, O., Al-Habashi, Y., Sibaee, S., Ammar, A., & Boulila, W. (2025). SARD: A Large-Scale Synthetic Arabic OCR Dataset for Book-Style Text Recognition. arXiv preprint arXiv:2505.24600.
https://arxiv.org/abs/2505.24600

BibTeX:

@misc{nacar2025sard,
      title={SARD: A Large-Scale Synthetic Arabic OCR Dataset for Book-Style Text Recognition}, 
      author={Omer Nacar and Yasser Al-Habashi and Serry Sibaee and Adel Ammar and Wadii Boulila},
      year={2025},
      eprint={2505.24600},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2505.24600}, 
}

Usage Note:

This dataset includes text sourced from Alukah. Use is limited to non-commercial purposes in accordance with the source terms. Redistribution, republication, or commercial use is not permitted without permission and proper attribution to the original source and author.