Datasets:
dataset_info:
features:
- name: page_filename
dtype: string
- name: pdf_filename
dtype: string
- name: image
dtype: image
struct:
- name: bytes
dtype: binary
- name: path
dtype: string
- name: ocr_text
dtype: string
- name: params
dtype: string
license: apache-2.0
task_categories:
- text-generation
language:
- fr
- en
tags:
- military
- defense
size_categories:
- 10K<n<100K
OCR-PDF-Degraded Dataset
Overview
This dataset contains synthetically degraded document images paired with their ground truth OCR text. It addresses a critical gap in OCR model training by providing realistic document degradations that simulate real-world conditions encountered in production environments.
Purpose
Most OCR models are trained on relatively clean, perfectly scanned documents. However, in real-world applications, especially in the military/defense sector, documents may be poorly scanned, photographed in suboptimal lighting conditions, or degraded due to environmental factors. This dataset aims to:
- Enable the training of more robust OCR models that can handle imperfect document inputs
- Establish a standardized benchmark for evaluating OCR performance under various degradation conditions
- Bridge the gap between lab performance and real-world deployment for document processing systems
Domain Focus
This first iteration focuses specifically on military/defense sector documents. These documents:
- Contain specialized terminology and formatting
- Often include tables, diagrams, and structured information
- May include mission-critical information where accurate OCR is essential
- Represent a sector where document digitization processes may not always be ideal
Dataset Creation Process
The dataset was created through a systematic process of degrading clean PDF documents:
The process includes:
- Starting with clean military/defense PDF documents
- Extracting individual pages
- Performing OCR on the clean pages to establish ground truth text
- Applying various degradation effects to simulate real-world conditions
- Recording both the degraded images and the corresponding degradation parameters
Degradation Parameters
The dataset includes various degradation types:
- Noise: Random pixel noise at different intensities
- Lighting: Uneven illumination effects with varying intensities and positions
- Perspective: Distortions simulating non-flat document captures
- Artifacts: Lines, spots, and other common scanner/camera artifacts
- Image Quality: Variations in blur, brightness, contrast, and JPEG compression
Each image in the dataset includes specific parameter values, allowing for targeted evaluation and training.
Usage Examples
This dataset is ideal for:
# Example: Loading and using the dataset
from datasets import load_dataset
import json
dataset = load_dataset("racineai/ocr-pdf-degraded", split="train")
# Access a sample
sample = dataset[0]
# Get the degraded image
image = sample["image"]
# Get the ground truth OCR text
text = sample["ocr_text"]
# Access degradation parameters (for targeted training/evaluation)
params = json.loads(sample["params"])
noise_level = params["noise_level"]
print(noise_level)
Limitations and Future Work
- Current iteration focuses only on military/defense documents
- Further domain expansion planned for legal, medical, and financial sectors
- Future versions may include handwritten text degradations
- Working on expansion to include multi-page document context
Citation
If you use this dataset in your research, please cite:
@misc{racineai_ocr_pdf_degraded,
author = {RacineAI},
title = {OCR-PDF-Degraded: Synthetically Degraded Documents for Robust OCR},
year = {2025},
url = {https://huggingface.co/datasets/racineai/ocr-pdf-degraded}
}
License
Apache 2.0
