Phitran21/synthetic-ocr-en-det-rec-120k
Synthetic English OCR Detection and Recognition 240K π Current dataset size: 240,000 paired OCR samples The current v2.0 release contains exactly 240,000 detector images and 240,000 matching recognition crops. Each sample ID corresponds to: one full image for text detection; one cropped text image for text recognition; one detector JSONL record; one recognizer JSONL record. Therefore, the dataset contains 240,000 aligned OCR pairs and 480,000 JPEG files inβ¦ See the full description on the dataset page: https://huggingface.co/datasets/Phitran21/synthetic-ocr-en-det-rec-120k.
Synthetic English OCR Detection and Recognition 240K
## π Current dataset size: 240,000 paired OCR samples The current v2.0 release contains exactly 240,000 detector images and 240,000 matching recognition crops. Each sample ID corresponds to: - one full image for text detection; - one cropped text image for text recognition; - one detector JSONL record; - one recognizer JSONL record. Therefore, the dataset contains 240,000 aligned OCR pairs and 480,000 JPEG files in total. The detector image and recognition crop are two representations of the same OCR sample, not 480,000 independent texts. The repository identifier still ends in synthetic-ocr-en-det-rec-120k because that was the name of the original release. The old repository name is intentionally retained to preserve existing links, citations, download scripts, and bookmarks. The repository name is legacy; the current dataset size is 240K.A large synthetic English OCR dataset containing 240,000 full detector images, 240,000 cropped text images, polygon-based text annotations, and aligned transcription labels.
This dataset is designed for training and evaluating:
- OCR text detection
- OCR text recognition
- End-to-end OCR systems
- Scene text recognition
- Document text extraction
- Polygon-based text localization
- Lightweight mobile and ONNX OCR models
The dataset includes two aligned subsets:
- Detector dataset for locating text regions in full images.
- Recognizer dataset for converting cropped text images into English text.
Both subsets use the same numeric sample IDs. For example, images/en_00000001.jpg and crops/en_00000001.jpg belong to the same OCR sample and share the same ground-truth transcription.
Dataset Summary
The images contain English text rendered using different fonts, positions, sizes, rotations, backgrounds, colors, and visual styles.
The goal is to provide a practical OCR training resource for researchers and developers building text detection and recognition systems.
Repository Name Notice
The Hugging Face repository URL remains:
Phitran21/synthetic-ocr-en-det-rec-120kThe 120k suffix refers to the original release size. The dataset was expanded in place to 240,000 paired samples so that existing users would not lose access through old links or citations.
Use the following values when describing the current release:
Current title: Synthetic English OCR Detection and Recognition 240K
Current version: v2.0
Current paired samples: 240,000
Legacy repository slug: synthetic-ocr-en-det-rec-120kRepository Structure
synthetic-ocr-en-det-rec-120k/
βββ detector/
β βββ detector.jsonl
β βββ images/
β βββ part_001.zip
β βββ part_002.zip
β βββ part_003.zip
β βββ part_004.zip
β βββ part_005.zip
β βββ part_006.zip
β βββ part_007.zip
β βββ part_008.zip
β βββ part_009.zip
β βββ part_010.zip
β
βββ recognizer/
βββ recognizer.jsonl
βββ crops/
βββ part_001.zip
βββ part_002.zip
βββ part_003.zip
βββ part_004.zip
βββ part_005.zip
βββ part_006.zip
βββ part_007.zip
βββ part_008.zip
βββ part_009.zip
βββ part_010.zipThe ZIP archives are divided into approximately equal parts to make downloading, storage, verification, and extraction easier.
The v2.0 extension is stored in part_006.zip through part_010.zip:
File Descriptions
detector/detector.jsonl
This file contains annotations for training a text detection model.
Each JSON line represents one full image and includes:
- Image path
- Image width and height
- Text polygon coordinates
- Ground-truth transcription
- Language
- Text direction
- Confidence
- Background information
- Font information
- Synthetic-data indicator
Example:
{
"image": "images/en_00000001.jpg",
"width": 960,
"height": 640,
"items": [
{
"polygon": [
[676, 144],
[682, 146],
[688, 149]
],
"text": "Example English text.",
"lang": "en",
"direction": "horizontal",
"confidence": 1.0
}
],
"synthetic": true
}The complete polygon contains multiple coordinate points that describe the text boundary more precisely than a simple rectangular bounding box.
Use this file together with:
detector/images/part_*.zipAfter extraction, the image paths have the following structure:
images/en_00000001.jpg
images/en_00000002.jpg
...
images/en_00240000.jpgrecognizer/recognizer.jsonl
This file contains annotations for training a text recognition model.
Each JSON line represents one cropped text image and includes:
- Crop image path
- Ground-truth text
- Language
- Text direction
- Original source image
- Original source polygon
- Crop box
- Rotation angle
Example:
{
"image": "crops/en_00000001.jpg",
"text": "Example English text.",
"lang": "en",
"direction": "horizontal",
"source_image": "images/en_00000001.jpg",
"source_polygon": [
[676, 144],
[682, 146],
[688, 149]
],
"crop_box": [39, 92, 767, 314],
"rotation": -3.257
}Use this file together with:
recognizer/crops/part_*.zipAfter extraction, the crop paths have the following structure:
crops/en_00000001.jpg
crops/en_00000002.jpg
...
crops/en_00240000.jpgPair Alignment
Detector and recognizer records are aligned by their numeric IDs:
Detector image: images/en_00012345.jpg
Recognizer crop: crops/en_00012345.jpg
Detector record: detector JSONL record for ID 00012345
Recognizer record: recognizer JSONL record for ID 00012345
Ground-truth text: identical in both recordsThis alignment allows the two subsets to be trained independently or combined in an end-to-end OCR pipeline.
Detection Dataset Format
The detector subset follows this relationship:
Full image
β
Polygon annotation
β
Text region localizationTraining input:
images/en_XXXXXXXX.jpgTraining target:
items[].polygonOptional transcription information is available in:
items[].textThe detector annotations are suitable for:
- DBNet
- Differentiable Binarization OCR
- CRAFT-style detectors
- EAST-style detectors
- Segmentation-based OCR detection
- Polygon regression models
- Custom object detection pipelines
Some frameworks require four-point quadrilaterals or rectangular boxes. In that case, polygon coordinates can be converted during preprocessing.
Recognition Dataset Format
The recognizer subset follows this relationship:
Cropped text image
β
OCR recognition model
β
English transcriptionTraining input:
crops/en_XXXXXXXX.jpgTraining target:
textThis subset can be used with:
- CRNN
- CTC-based OCR
- Transformer OCR
- Attention-based recognition
- SVTR
- PARSeq-style systems
- PaddleOCR recognition models
- ONNX Runtime OCR pipelines
- Mobile OCR applications
Downloading the Dataset
Using Git
git lfs install
git clone \
https://huggingface.co/datasets/Phitran21/synthetic-ocr-en-det-rec-120kUsing the Hugging Face CLI
pip install -U huggingface_hub
hf download \
Phitran21/synthetic-ocr-en-det-rec-120k \
--repo-type dataset \
--local-dir synthetic-ocr-en-det-rec-240kThe local directory may use 240k even though the stable remote repository slug still uses 120k.
Extracting the Detector Images
Linux or Ubuntu:
mkdir -p extracted_detector
for file in detector/images/part_*.zip; do
unzip "$file" -d extracted_detector
doneResult:
extracted_detector/
βββ images/
βββ en_00000001.jpg
βββ en_00000002.jpg
βββ ...
βββ en_00240000.jpgThe corresponding annotation file is:
detector/detector.jsonlExtracting the Recognition Crops
mkdir -p extracted_recognizer
for file in recognizer/crops/part_*.zip; do
unzip "$file" -d extracted_recognizer
doneResult:
extracted_recognizer/
βββ crops/
βββ en_00000001.jpg
βββ en_00000002.jpg
βββ ...
βββ en_00240000.jpgThe corresponding annotation file is:
recognizer/recognizer.jsonlQuick JSONL Inspection
Inspect the first detector samples:
head -n 5 detector/detector.jsonlInspect the first recognition samples:
head -n 5 recognizer/recognizer.jsonlValidate JSONL using Python:
import json
from pathlib import Path
def validate_jsonl(path: str) -> int:
count = 0
with Path(path).open("r", encoding="utf-8") as file:
for line_number, line in enumerate(file, start=1):
try:
json.loads(line)
count += 1
except json.JSONDecodeError as error:
raise ValueError(
f"Invalid JSON at line {line_number}: {error}"
) from error
return count
print(
"Detector records:",
validate_jsonl("detector/detector.jsonl"),
)
print(
"Recognizer records:",
validate_jsonl("recognizer/recognizer.jsonl"),
)Expected result for v2.0:
Detector records: 240000
Recognizer records: 240000Python Loading Example
Load recognition annotations:
import json
from pathlib import Path
annotation_path = Path("recognizer/recognizer.jsonl")
samples = []
with annotation_path.open("r", encoding="utf-8") as file:
for line in file:
samples.append(json.loads(line))
print("Number of samples:", len(samples))
print("First sample:", samples[0])Load detector annotations:
import json
from pathlib import Path
annotation_path = Path("detector/detector.jsonl")
with annotation_path.open("r", encoding="utf-8") as file:
first_sample = json.loads(next(file))
print("Image:", first_sample["image"])
print("Width:", first_sample["width"])
print("Height:", first_sample["height"])
print("Text items:", len(first_sample["items"]))
print("First polygon:", first_sample["items"][0]["polygon"])Suggested Train, Validation, and Test Split
The dataset is currently distributed as one complete collection.
A recommended split is:
Split by filename or record index using a fixed random seed to ensure reproducibility.
Example:
import json
import random
from pathlib import Path
random.seed(42)
source = Path("recognizer/recognizer.jsonl")
with source.open("r", encoding="utf-8") as file:
rows = [json.loads(line) for line in file]
random.shuffle(rows)
total = len(rows)
train_end = int(total * 0.90)
validation_end = int(total * 0.95)
splits = {
"train": rows[:train_end],
"validation": rows[train_end:validation_end],
"test": rows[validation_end:],
}
for split_name, split_rows in splits.items():
output = Path(f"recognizer_{split_name}.jsonl")
with output.open("w", encoding="utf-8") as file:
for row in split_rows:
file.write(
json.dumps(row, ensure_ascii=False) + "\n"
)
print(split_name, len(split_rows))When creating detector and recognizer splits, use the same sample IDs for both subsets so that pair alignment is preserved.
Intended Uses
This dataset is intended for:
- Academic OCR research
- Non-commercial OCR model training
- OCR benchmarking
- Text detection experiments
- Text recognition experiments
- Synthetic-data research
- Document AI research
- Mobile OCR development
- ONNX and ONNX Runtime experiments
- Educational projects
- Personal non-commercial projects
Out-of-Scope Uses
The dataset must not be used for:
- Commercial use without written permission
- Illegal surveillance
- Privacy-invasive identification systems
- Misleading or fraudulent applications
- Applications that violate applicable laws
- Claiming the dataset was manually collected or manually annotated
- Redistributing the dataset under incompatible terms
Limitations
This is a synthetic dataset and does not fully represent all real-world OCR conditions.
Possible limitations include:
- Synthetic fonts and rendering patterns
- Limited background diversity
- Limited handwriting coverage
- Limited severe blur and compression artifacts
- Limited curved or highly distorted text
- Possible unnatural source sentences
- Possible differences from photographs taken by real cameras
- Possible imbalance among fonts, rotations, text lengths, and backgrounds
- Primarily horizontal English text
- No guarantee of perfect semantic or grammatical quality in every sentence
Models trained exclusively on this dataset may require fine-tuning on real-world OCR data before production use.
For stronger generalization, consider combining this dataset with legally compatible real-image datasets.
Data Quality Notes
The annotations were generated automatically as part of the synthetic rendering process.
Because the text, polygon, crop, and transcription originate from the same generation pipeline, labels are expected to align closely with their corresponding images.
The v2.0 release was packaged with:
- Aligned detector and recognizer IDs
- Matching detector and recognizer text
- Continuous IDs from
00000001through00240000 - JSONL syntax validation
- Missing-file checks
- Duplicate-ID checks
- Duplicate-text checks for the newly generated extension
- ZIP path and CRC verification
Users should still perform their own validation before training production systems.
Recommended checks include:
- ZIP integrity
- Missing file detection
- Duplicate file detection
- JSONL parsing
- Image readability
- Polygon coordinate bounds
- Empty transcription detection
- Train and test leakage detection
License
This dataset is licensed under the:
Creative Commons Attribution-NonCommercial 4.0 International License CC BY-NC 4.0
You may:
- Use the dataset for research
- Use the dataset for education
- Use the dataset for personal projects
- Modify and adapt the dataset
- Train non-commercial models
- Redistribute permitted adaptations with attribution
You must:
- Credit the original creator
- Link or refer to this dataset repository
- Clearly indicate significant modifications
- Keep attribution information visible
- Comply with the CC BY-NC 4.0 license
You may not:
- Use the dataset commercially without prior written permission
- Sell the dataset or access to the dataset
- Include the dataset in a paid commercial product without permission
- Use the dataset to provide a paid OCR service without permission
- Re-license the original dataset under incompatible terms
- Claim ownership of the original dataset
Commercial Licensing
Commercial use is not included under the public CC BY-NC 4.0 license.
For commercial use, enterprise use, paid products, paid APIs, paid applications, commercial model training, or commercial redistribution, prior written permission is required.
Please contact the creator to discuss a separate commercial license.
Attribution
Suggested citation:
Synthetic English OCR Detection and Recognition 240K
Version 2.0
Created by TrαΊ§n Phi
Hugging Face: Phitran21/synthetic-ocr-en-det-rec-120k
License: CC BY-NC 4.0Suggested attribution for model cards:
This model was trained using the Synthetic English OCR Detection
and Recognition 240K dataset (v2.0), created by TrαΊ§n Phi:
https://huggingface.co/datasets/Phitran21/synthetic-ocr-en-det-rec-120kThe repository URL contains the legacy 120k identifier, while the current release contains 240,000 paired samples.
Creator
TrαΊ§n Phi
Hugging Face:
https://huggingface.co/Phitran21
Contact
For dataset questions, issue reports, collaboration, or commercial licensing:
- Email: phihhhhhhhhhh@gmail.com
- Facebook: https://www.facebook.com/share/1PqDzPQJYf/
- Website: https://toren.io.vn
Email responses may be limited or delayed. For public technical questions, using the Hugging Face Community tab is recommended.
Reporting Issues
When reporting a problem, please include:
- Affected file name
- ZIP part name
- JSONL line number
- Description of the issue
- Minimal reproduction steps
- Screenshot or sample when appropriate
Please use the Community tab of this repository for public bug reports and technical discussions.
Version History
v2.0 β Current
- 240,000 detector images
- 240,000 recognition crops
- 240,000 aligned detector/recognizer pairs
- 480,000 JPEG files in total
- Detector JSONL annotations
- Recognition JSONL annotations
- Ten detector ZIP archives
- Ten recognizer ZIP archives
- Continuous sample IDs through
en_00240000.jpg
v1.0 β Legacy 120K release
- Initial approximately 120K paired OCR release
- Five detector ZIP archives
- Five recognizer ZIP archives
- Original repository name established as
synthetic-ocr-en-det-rec-120k
The repository name was retained for backward compatibility when v2.0 expanded the dataset to 240K.
Acknowledgements
Thank you to the open-source OCR, computer vision, Python, font, and machine-learning communities whose tools and research make synthetic dataset creation possible.
If this dataset is useful in your research or project, please consider giving the repository a like and citing the dataset.
