# SMedDV v5 generation recipe This note describes the synthetic text-line generation process and its biases. SMedDV contains **line crops only**; it does not contain full ID-card photographs, real people, or authentic personal records. ## Pipeline overview 1. **Language configuration.** YAML language definitions draw character sets from Unicode CLDR 48.2.3, with project-maintained script overrides. The family contains 53 language IDs across RTL and Latin scripts, plus a separate MRZ stream. 2. **Text/value sampling.** A global seed of `0` and stable sample indices feed deterministic per-index sampling. Source-backed names and places are mixed with generated dates, synthetic identifier-like numbers, short labels, authority labels, mixed-script values, generic text, coverage lines, and MRZ lines. The source table and licences are in [`../ATTRIBUTION.md`](../ATTRIBUTION.md). 3. **Coverage supplement.** The first 3.5M requested indices were followed by a deterministic source-backed coverage supplement. The final request range is 3,528,113 indices; 155 indices without a source-backed value are explicitly listed in the source `skips.jsonl`, leaving 3,527,958 rendered samples. Coverage targets are recorded in the source coverage plans. 4. **Rendering.** A script-eligible font is chosen only after character coverage checks. Pillow/RAQM shapes RTL and Latin text; generated card-stock backgrounds use flat, gradient, noise, guilloche, CC0 security-pattern, and CC0 material-texture layers. Per-line degradation is assigned to clean/light/medium/heavy tiers, then rendered at 48 px high with proportional width. 5. **Encoding and labels.** The original v5 images are WebP q85, method 6. Canonical `text` is logical Unicode order; `text_visual` is the separately stored visual left-to-right order used by the Paddle lists. The dictionary contains 503 non-space code points. 6. **Split.** A fixed index manifest selects exactly 141,118 of 3,527,958 rows for validation. Selection begins with a deterministic 3.5% hash base, then fills coverage/group requirements and the remaining budget up to 4%. The manifest is shipped at [`../splits/validation_indices.json`](../splits/validation_indices.json). It is not a text-disjoint split. 7. **HF packaging.** Each Parquet row stores the unmodified WebP bytes as an HF-compatible `Image` struct and retains both logical and visual labels. Train and validation shards are split by the fixed manifest; shard checksums and a whole-package checksum accompany the files. ## Composition controls and biases - Category and language proportions are generator targets, **not estimates of real document-field prevalence**. The dataset intentionally gives substantial weight to Arabic-script examples, MRZ, rare characters, coverage rows, and longer text. - A language may have far fewer rows than another. See the measured per-language train/validation table in the README. - Wikipedia-derived spans are short (one to six words before normalization/filtering). Row-level article IDs and URLs were not retained, so attribution is at the source-dataset/shard level; this limitation is disclosed in `ATTRIBUTION.md`. - Name/place corpora, curated document headings, identifier formats, and language-specific alphabets produce source and vocabulary biases. Synthetic identifier-like values are not real IDs and are not guaranteed to match every issuer's unpublished validation rule. - Backgrounds and fonts are generated or permissively licensed assets. They do not model the full range of real camera capture, lighting, lamination, wear, glare, document layouts, or jurisdiction-specific design. No real-card images were used. - Validation uses the same synthetic generation family. It is useful for controlled OCR comparisons and regression tests, but not a substitute for an independent, consented real-world evaluation set. - In the stored 10,000-example RTL round-trip QA, 17 rows (0.17%) were mismatches, all Arabic generic examples with digit spans/ranges or punctuation. See `VALIDATION.md`. ## Reproducing the source generation Exact recorded commands, seeds, run logs, source-file hashes, the relevant source-code commit, and packaging command are summarized in [`reproducibility.json`](reproducibility.json). The original generation run used seed `0`, 12 workers, 10,000-row chunks, 48 px output, WebP q85, and the v5 realism profile. The data source is read-only for this release workflow; do not regenerate or alter files under `data/synth/v5/` while packaging. Training models is outside the scope of this release package.