Paper deep dive
AtlasOCR: Building the First Open-Source Darija OCR Model with Vision Language Models
Imane Momayiz, Soufiane Ait Elaouad, Abdeljalil Elmajjodi, Haitame Bouanane
Intelligence
Status: succeeded | Model: google/gemini-3.1-flash-lite-preview | Prompt: intel-v1 | Confidence: 97%
Last extracted: 4/10/2026, 4:26:49 AM
Summary
AtlasOCR is the first open-source Optical Character Recognition (OCR) model specifically designed for Darija (Moroccan Arabic dialect). It is built by fine-tuning the Qwen2.5-VL 3B Vision Language Model using QLoRA and Unsloth. The authors developed a hybrid dataset combining synthetic data from their OCRSmith toolkit with real-world samples, and introduced AtlasOCRBench for evaluation, demonstrating state-of-the-art performance for Darija OCR.
Entities (7)
Relation Signals (4)
OCRSmith → generates → Synthetic Data
confidence 100% · OCRSmith enables rapid generation of thousands of labeled images
AtlasOCR → isbasedon → Qwen2.5-VL 3B
confidence 100% · AtlasOCR, the first open-source Darija OCR model built by fine-tuning a 3B parameter Vision Language Model (VLM)... Qwen2.5-VL 3B
AtlasOCR → usestechnique → QLoRA
confidence 100% · We utilize QLoRA and Unsloth for parameter-efficient training
AtlasOCR → trainedon → AtlasOCRBench
confidence 90% · Our evaluation on the newly curated AtlasOCRBench... demonstrates state-of-the-art performance
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Darija, the Moroccan Arabic dialect, is rich in visual content yet lacks specialized Optical Character Recognition (OCR) tools. This paper introduces AtlasOCR, the first open-source Darija OCR model built by fine-tuning a 3B parameter Vision Language Model (VLM). We detail our comprehensive approach, from curating a unique Darija-specific dataset leveraging both synthetic generation with our OCRSmith library and carefully sourced real-world data, to implementing efficient fine-tuning strategies. We utilize QLoRA and Unsloth for parameter-efficient training of Qwen2.5-VL 3B and present comprehensive ablation studies optimizing key hyperparameters. Our evaluation on the newly curated AtlasOCRBench and the established KITAB-Bench demonstrates state-of-the-art performance, challenging larger models and highlighting AtlasOCR's robustness and generalization capabilities for both Darija and standard Arabic OCR tasks.
Tags
Links
- Source: https://arxiv.org/abs/2604.08070v1
- Canonical: https://arxiv.org/abs/2604.08070v1
Trouble viewing inline? Open PDF directly →
Full Text
18,065 characters extracted from source content.
Expand or collapse full text
AtlasIA2025-09-17 AtlasOCR: Building the First Open-Source Darija OCR Model with Vision Language Models Imane Momayiz, Soufiane Ait Elaouad, Abdeljalil Elmajjodi, Haitame Bouanane https://w.atlasia.ma/ https://github.com/atlasia-ma/ Abstract Darija, the Moroccan Arabic dialect, is rich in vi- sual content yet lacks specialized Optical Charac- ter Recognition (OCR) tools. This paper intro- ducesAtlasOCR, the first open-source Darija OCR model built by fine-tuning a 3B parameter Vision Language Model (VLM). We detail our comprehen- sive approach, from curating a unique Darija-specific dataset leveraging both synthetic generation with our OCRSmith library and carefully sourced real-world data, to implementing efficient fine-tuning strate- gies. We utilize QLoRA and Unsloth for parameter- efficient training of Qwen2.5-VL 3B and present com- prehensive ablation studies optimizing key hyper- parameters. Our evaluation on the newly curated AtlasOCRBench and the established KITAB-Bench demonstrates state-of-the-art performance, challeng- ing larger models and highlighting AtlasOCR’s ro- bustness and generalization capabilities for both Dar- ija and standard Arabic OCR tasks. 1 Introduction Darija, the Moroccan Arabic dialect, represents a vi- brant and visually rich linguistic landscape preva- lent in social media, informal documents, and hand- written materials. Despite its widespread use and unique characteristics, the absence of dedicated Opti- cal Character Recognition (OCR) tools for Darija has posed significant barriers for developers, researchers, and organizations working with Moroccan content. This gap hinders digital preservation efforts, limits large-scale text analysis capabilities, and impedes ac- cessibility initiatives. To address this critical need, we introduceAt- lasOCR, the first open-source OCR model specifi- cally designed for Darija. AtlasOCR is a 3-billion- parameter model developed by fine-tuning a Vision Language Model (VLM) using parameter-efficient techniques. This paper presents our comprehensive methodology, spanning data curation, model selec- tion, training strategies, and extensive evaluation. Our key contributions include: •Development ofAtlasOCR, the first open- source Darija OCR model achieving state-of-the- art performance •A comprehensive data curation strategy com- bining synthetic data generation via OCRSmith with diverse real-world Darija content •Detailed methodology for parameter-efficient fine-tuning using QLoRA and Unsloth frame- works •Extensive ablation studies optimizing key hyper- parameters and training configurations •Creation ofAtlasOCRBench, a publicly available benchmark for Darija OCR evaluation •Thorough evaluation demonstrating superior Darija performance and competitive results on standard Arabic benchmarks 2 Related Work 2.1 Arabic OCR Systems Traditional Arabic OCR systems have primarily fo- cused on Modern Standard Arabic (MSA), with lim- ited attention to dialectal variants. Recent advances in deep learning have improved Arabic text recog- nition capabilities [10], but dialectal Arabic, partic- ularly Darija, remains underexplored due to data scarcity and linguistic complexity. 2.2 Vision Language Models for OCR Vision Language Models have revolutionized docu- ment understanding by integrating visual comprehen- sion with linguistic context [1]. These models excel at zero-shot generalization and have shown promising results in multilingual OCR tasks, making them ideal candidates for low-resource language applications. 1 arXiv:2604.08070v1 [cs.CV] 9 Apr 2026 3 Background 3.1 The Importance of Darija OCR The development of Darija OCR capabilities offers substantial benefits across multiple domains: •Digital Preservation: Converting historical documents, manuscripts, and traditional texts into searchable digital formats •Social Media Analysis: Enabling large-scale analysis of public discourse and sentiment in Mo- roccan online content •Accessibility: Making visual content accessible to screen readers and assistive technologies •Research Applications: Facilitating linguistic studies, cultural heritage research, and corpus development 3.2 Vision Language Model Architec- ture Vision Language Models integrate three core compo- nents to process multimodal inputs (Figure 1): •Vision Encoder: Converts input images into high-dimensional vector embeddings capturing visual features such as colors, shapes, textures, and spatial arrangements •Modality Projection Module: Aligns visual features with the language model’s representa- tion space, ensuring semantic consistency •Language Model: Integrates aligned visual embeddings with textual prompts to generate co- herent natural language outputs Figure 1: Vision Language Model Architecture [1] For OCR applications, this architecture enables understanding both visual text layout and linguis- tic nuances, crucial for accurately recognizing Darija text across diverse fonts, styles, and backgrounds. 4 Data Curation Developing a robust Darija OCR model required cre- ating a large-scale, diverse dataset reflecting real- world variability. Our hybrid approach combined synthetic data generation with carefully curated real- world samples. 4.1 Synthetic Data Generation with OCRSmith Given the high cost and time requirements for anno- tating quality datasets in under-resourced languages, synthetic data generation provided an efficient scal- ing solution. We developedOCRSmith[2], an open- source toolkit that simulates realistic text conditions including various fonts, layouts, backgrounds, and distortions. OCRSmith enables rapid generation of thousands of labeled images complete with bounding boxes and metadata. Figure2demonstrates synthetic Darija text examples generated using this toolkit. Figure 2: Synthetic Darija Text Examples Generated with OCRSmith 4.2 Real-World Data Collection While synthetic data provided scale, real-world im- ages ensured authenticity and captured nuances dif- ficult to simulate. We curated diverse Darija text from multiple contexts: •Scanned Literature : Two key sources pro- vided approximately 700 pages of high-quality Darija text: ” ” by Mohammed El- Madlaoui El-Mounabhi and ” ” by Farouk ElMarrakchi. These were pseudo-labeled using Gemini 2.0 Flash. •Social Media Content : LinkedIn and similar platforms yielded poster-style educational mate- rials converted to images suitable for OCR train- ing. 2 •Educational Materials: Moroccan study ma- terials, particularly driving license exam prepa- rations, provided challenging samples with var- ied text quality and layouts. •Recipe Collections: Moroccan cookbooks of- fered domain-specific vocabulary and format- ting, carefully preprocessed for optimal OCR training. Figure3illustrates examples from each real-world data source. (a) Scanned Literature (b) Social Media Content (c) Educational Materials (d) Recipe Collection Figure 3: Real-World Darija Text Sources 4.3 Dataset Composition Our hybrid approach yielded the first large-scale Dar- ija OCR dataset. Table1summarizes the dataset composition, with approximately 86% synthetic and 14% real-world content, ensuring both the scale nec- essary for robust training and the authenticity re- quired for real-world applicability. Table 1: Darija OCR Dataset Overview SplitSamples Total Words Train26,1629.5M Validation 3,9301.2M Total30,09210.7M 5 Methodology 5.1 Base Model Selection Selecting an appropriate base model was critical for developing high-performance Darija OCR within computational constraints. We benchmarked several open-source vision-language models on 55 manually curated real-world Darija images: •Qwen2-VL 2B [3] •Qwen2.5-VL 3B [4] •Qari OCR 2B [5] •ArabicNougat [6] We prioritized compact architectures (2B-3B pa- rameters) for efficient training and inference. Evalu- ation results consistently showedQwen2.5-VL 3B outperforming alternatives across diverse Darija text domains, establishing it as our base model. 5.2 Parameter-Efficient Fine-Tuning Strategy We employed a parameter-efficient approach combin- ing Quantized Low-Rank Adaptation (QLoRA) with Unsloth optimization: •QLoRA[7]: Enables efficient fine-tuning by quantizing models to 4-bit precision with low- rank adapters, reducing memory requirements by up to 80% while maintaining performance. •Unsloth[8]: Accelerates LLM fine-tuning with up to 5× speed improvements and 60% memory reduction through optimized GPU kernels and memory management. This combination enabled effective 3B parameter model fine-tuning on consumer-grade GPUs, ensuring accessibility and resource efficiency. 3 6 Experimental Design 6.1 Ablation Studies We conducted comprehensive ablation studies to op- timize AtlasOCR’s performance, focusing on key hy- perparameters and training configurations. 6.1.1 LoRA Hyperparameters We explored combinations of LoRA rank (r), scaling factor (α), and dropout rate, measuring impact via minimum evaluation loss (Table2). Table 2: LoRA Hyperparameter Ablation Results rαDropout Eval Loss 32 32 0.000.2442 32 32 0.050.2456 64 64 0.050.2251 128 128 0.050.2132 Results indicate that increasing both rank and scaling factor improves performance, suggesting that additional adapter parameters enhance task-specific feature learning. The optimal configuration wasr= 128 , α = 128 , dropout=0.05. 6.1.2 Quantization Precision Impact We compared 4-bit and 16-bit precision effects during fine-tuning (Table3). Table 3: Quantization Precision Comparison Precision Min Eval Loss 4-bit0.2132 16-bit0.2124 The minimal performance difference validates 4-bit quantization for our task, offering substantial mem- ory and computational savings without compromis- ing accuracy. 6.1.3 Optimization Parameters We investigated optimal batch size and learning rate combinations with different LoRA configurations (Tables 4and5). Higher learning rates generally improved conver- gence speed when not causing instability. Increasing LoRA parameters necessitated learning rate recali- bration for optimal performance. Table 4: Optimization Results (LoRAr=α= 16) Batch Size Learning Rate Min Eval Loss 162e-40.3161 166e-40.2326 162e-34.0958 642e-40.3479 1282e-40.4086 1288e-40.2733 1282e-30.2350 5122e-40.5725 Table 5: Optimization Results (LoRAr=α= 128) Batch Size Learning Rate Min Eval Loss 166e-50.2652 162e-40.2132 1282e-40.2456 1288e-40.2165 1282e-38.2561 6.1.4 Vision Layer Fine-Tuning We evaluated the impact of freezing vision layers dur- ing training (Table 6). Table 6: Vision Layer Fine-Tuning Impact Fine-tune Vision Layers Min Eval Loss Yes0.2155 No0.3173 Fine-tuning vision layers significantly improved performance, confirming the benefit of adapting these components to Darija’s visual characteristics. 6.1.5 RSLoRA Analysis We tested Rank-Stabilized LoRA (RSLoRA) [ 9], de- signed to improve scaling behavior with increasing adapter rank (Table7). RSLoRA significantly degraded performance in our setting, indicating it may not be suitable for all model architectures or tasks. 7 Evaluation Framework 7.1 Benchmark Development We createdAtlasOCRBench, a comprehensive evalu- ation benchmark tailored for Darija, integrating: 4 Table 7: RSLoRA Impact Assessment RSLoRA Enabled Min Eval Loss No0.2132 Yes8.2561 •Scanned Darija Literature: High-quality printed text representing foundational document types •OCRSmith Synthetic Data: Controlled sam- ples testing specific OCR challenges Our benchmark creation pipeline (Figure4) em- ployed a two-step process: Figure 4: Benchmark Creation Pipeline 1.Pseudo-labeling: Using Gemini 2.0 Flash with carefully engineered prompts prioritizing human readability 2.Human Annotation: Manual review and cor- rection using Argilla for collaborative editing The finalAtlasOCRBenchcontains 251 samples, in- cluding 55 from scanned literature, ensuring compre- hensive coverage of realistic Darija OCR challenges. 7.2 Evaluation Metrics We employed standard OCR evaluation metrics: •Character Error Rate (CER): Measures character-level editing distance normalized by ground truth length. Particularly suitable for Darija due to spelling variations and lack of stan- dardized orthography. •Word Error Rate (WER): Measures word- level editing distance normalized by ground truth word count. While useful, can be mislead- ing for Darija where single character differences mark entire words as incorrect. We prioritizeCER as our primary metricgiven Darija’s linguistic characteristics and flexible spelling conventions. 7.3 Preprocessing Protocol Our evaluation ensures fairness through consistent preprocessing: 1.Text Normalization: •Arabic diacritic removal (harakat) •Line break standardization and whitespace normalization 2.Metric Calculation: •CER: Space-removed character-level com- parison •WER: Space-tokenized word-level compar- ison 8 Results and Analysis 8.1 Benchmark Performance We evaluated AtlasOCR on both KITAB-Bench [10] (a large-scale Arabic OCR benchmark with 8,800+ samples) and our AtlasOCRBench, providing com- prehensive assessment across standard Arabic and Darija tasks. Figure 5: AtlasOCRBench Results (Lower CER indi- cates better performance) Figure 6: KITAB-Bench Results (Lower CER indi- cates better performance) Figure5demonstrates AtlasOCR’s state-of-the-art performance on Darija OCR, significantly outper- forming all open-source alternatives. Figure 6shows competitive performance on standard Arabic tasks, challenging much larger models including Gemma3 (12B) [ 11] and Qwen2.5-VL (7B). 5 8.2 Comparative Analysis AtlasOCR demonstrates superior performance on Darija-specific tasks while maintaining competitive results on standard Arabic benchmarks. The model achieves state-of-the-art results on AtlasOCRBench, significantly outperforming existing open-source al- ternatives. On KITAB-Bench, AtlasOCR competes effectively with much larger models, highlighting the effectiveness of our parameter-efficient fine-tuning ap- proach. Key performance insights include: •Darija Specialization: AtlasOCR achieves the lowest CER on Darija text, validating our spe- cialized training approach •Parameter Efficiency: Competitive perfor- mance with significantly fewer parameters than larger alternatives •Cross-lingual Transfer: Strong generalization to standard Arabic despite Darija-focused train- ing 9 Discussion 9.1 Key Findings Our experimental results reveal several important in- sights: •Parameter Efficiency: AtlasOCR achieves su- perior performance with fewer parameters than competing models, demonstrating the effective- ness of our fine-tuning strategy •Cross-lingual Generalization: Strong perfor- mance on standard Arabic benchmarks indicates robust generalization capabilities •Data Strategy Validation: Our hybrid synthetic-real approach proved highly effective for low-resource language OCR development 9.2 Limitations and Challenges Despite strong performance, AtlasOCR has certain limitations: •Diacritic Handling: Limited capability for recognizing and reconstructing Arabic diacritics when present •Complex Layout Processing: Performance may degrade on highly complex or artistic doc- ument structures •Domain Specificity: Training data bias to- ward specific Darija domains may affect perfor- mance on underrepresented text types 10 Conclusion and Future Di- rections AtlasOCR represents a significant advancement in Darija OCR, providing the first open-source solution addressing a critical gap for Moroccan content pro- cessing. Through careful dataset curation, efficient fine-tuning strategies, and comprehensive evaluation, we demonstrate that high-performance OCR mod- els can be developed for under-resourced languages within reasonable computational constraints. 10.1 Future Research Directions Our ongoing work focuses on: •Dataset Enhancement: Expanding coverage of handwritten text, diacritized content, and di- verse document types •Model Compression: Developing sub-3B pa- rameter variants for mobile and edge deployment •Layout Understanding: Enhancing capabili- ties for complex document structures and mixed content •Multilingual Extension: Adapting our methodology for other North African Arabic di- alects 10.2 Broader Impact AtlasOCR’s development demonstrates the feasibil- ity of creating high-quality language technology for under-resourced languages. Our open-source ap- proach and detailed methodology provide a blueprint for similar initiatives, potentially catalyzing develop- ment of specialized tools for other dialectal variants and low-resource languages. Acknowledgments We thank the Moroccan Arabic language community for their support in data collection and validation. Special recognition goes to contributors who helped identify and digitize historical Darija texts, making this work possible. References [1]Hugging Face Team.NanoVLM: Ex- ploring Vision-Language Models. https: //huggingface.co/blog/nanovlm, 2024. 6 [2]AtlasIA Team. OCRSmith: Synthetic OCR Data Generation Toolkit.https://github. com/atlasia-ma/OCRSmith, 2024. [3]Qwen Team.Qwen2-VL-2B-Instruct. https://huggingface.co/Qwen/ Qwen2-VL-2B-Instruct, 2024. [4]Qwen Team.Qwen2.5-VL-3B-Instruct. https://huggingface.co/Qwen/Qwen2. 5-VL-3B-Instruct, 2024. [5]NAMAA-Space Team.Qari-OCR- v0.3-VL-2B-Instruct.https:// huggingface.co/NAMAA-Space/Qari-OCR-v0. 3-VL-2B-Instruct, 2024. [6]Mohamed Rashad. ArabicNougat: Ara- bic Document Understanding Model. https://huggingface.co/MohamedRashad/ arabic-large-nougat, 2024. [7]Tim Dettmers, Artidoro Pagnoni, Ari Holtz- man, and Luke Zettlemoyer. QLoRA: Efficient Finetuning of Quantized LLMs.arXiv preprint arXiv:2305.14314, 2023. [8]Unsloth Team. Unsloth: 5x Faster LLM Fine- tuning. https://unsloth.ai, 2024. [9]Damjan Kalajdzievski et al. RSLoRA: Rank- Stabilized LoRA for Fine-tuning Large Lan- guage Models.arXiv preprint, 2024. [10]Ahmed Attia et al. KITAB-Bench: A Com- prehensive Benchmark for Arabic OCR and Document Understanding.arXiv preprint arXiv:2402.14949, 2024. [11]Gemma Team. Gemma: Open Models Based on Gemini Research and Technology.arXiv preprint arXiv:2403.08295, 2024. 7