--- license: mit task_categories: - object-detection tags: - image - computer-vision - document-analysis - financial-documents - table-detection - yolo - synthetic-data pretty_name: Synthetic Bank Statement Table Detection Dataset size_categories: - 10K 🔑 **In one sentence:** fake bank statements + auto-generated YOLO labels for table localization, designed for training document layout and table-detection models. --- ## At a Glance | | | |---|---| | **Task** | Object Detection → Table Detection | | **Format** | Parquet shards with embedded PNG images + inline bounding-box annotations (Hugging Face `datasets` format) | | **Classes** | 1 (`0` = Table) | | **Total images** | 15,187 | | **Splits** | None yet — single unsplit `train` set | | **Source** | 100% synthetic, generated with Python + ReportLab | | **Real data?** | ❌ No real bank statements, customers, or financial records | | **License** | MIT | --- ## Why This Dataset Exists Table detection is the first stage of many document AI pipelines. Before OCR, table structure recognition, or information extraction can begin, the document's table must first be accurately localized. This dataset models **clean, digitally-generated bank statement PDFs** — the kind produced directly by a bank's own statement-generation system and downloaded as a native PDF (not a scanned paper document). Instead of manually drawing bounding boxes after generation, the table coordinates are captured directly from the ReportLab rendering engine as each document is created. Because every annotation is produced during rendering, the resulting labels are pixel-perfect and free from manual annotation errors. The dataset is intended for pretraining, benchmarking, or augmenting table detection models before fine-tuning on real financial documents. --- ## What's Inside Each sample consists of: - A synthetic bank statement image (embedded directly in the parquet row) - An inline `objects` field holding the bounding box(es) and class(es) - A bounding box surrounding the complete transaction table ### Layout diversity The generator produces a wide variety of layouts, including: - Portrait and landscape orientations - Multiple banking templates - Different table widths and positions - Bordered, borderless, and zebra-striped tables - Variable row counts - Multi-page statements - Randomized customer information and transaction histories --- ## Folder Structure ```text bank-statement-detection/ └── data/ ├── train-00000-of-00008.parquet ├── train-00001-of-00008.parquet ├── ... └── train-00007-of-00008.parquet ``` There are no loose image/label files in this repo — every sample (image + its annotation) lives inline in these parquet shards, loadable directly with the `datasets` library (see below). Each row has two fields: - `image` — the rendered statement page (decoded to a PIL image) - `objects` — a struct with `bbox` (list of `[x_center, y_center, width, height]`, normalized) and `category` (list of class ids) Multi-page statements are stored as separate rows, one per page. --- ## Label Format Each row's `objects` field uses standard YOLO-style coordinates, stored inline rather than as a separate `.txt` file: ```text objects.category[i] = class_id objects.bbox[i] = [center_x, center_y, width, height] ``` - `class_id`: `0` (Table) - Coordinates are normalized to the image width and height. | Class ID | Label | Description | |:--------:|-------|-------------| | `0` | Table | Bounding box surrounding the complete transaction table | --- ## Data Example Loading a single row shows the image and its inline annotation together: ```python from datasets import load_dataset ds = load_dataset("Panhapich/bank-statement-detection", split="train") sample = ds[0] sample["image"] # PIL.Image, the rendered statement page sample["objects"] # {'bbox': [[0.503, 0.548, 0.856, 0.701]], 'category': [0]} ``` Each image typically contains one bounding box representing the entire transaction table. ---
Load with the Hugging Face Hub ```python from datasets import load_dataset ds = load_dataset("Panhapich/bank-statement-detection", split="train") print(ds) ```
Train with Ultralytics YOLO YOLO expects images and `.txt` labels as loose files, so export the parquet rows to disk first: ```python from pathlib import Path from datasets import load_dataset ds = load_dataset("Panhapich/bank-statement-detection", split="train") img_dir, lbl_dir = Path("table_detection/images"), Path("table_detection/labels") img_dir.mkdir(parents=True, exist_ok=True) lbl_dir.mkdir(parents=True, exist_ok=True) for i, sample in enumerate(ds): sample["image"].save(img_dir / f"{i:06d}.png") lines = [ f"{cls} {' '.join(map(str, bbox))}" for bbox, cls in zip(sample["objects"]["bbox"], sample["objects"]["category"]) ] (lbl_dir / f"{i:06d}.txt").write_text("\n".join(lines)) ``` Then train as usual: ```yaml path: ./table_detection train: images val: images nc: 1 names: - table ``` ```python from ultralytics import YOLO model = YOLO("yolov8n.pt") model.train( data="data.yaml", epochs=50, imgsz=1024 ) ```
--- ## Annotation Methodology Every annotation is generated automatically during document creation: 1. A synthetic bank statement is procedurally generated. 2. ReportLab renders the transaction table. 3. The exact table coordinates are captured during rendering. 4. The coordinates are converted into normalized YOLO format and stored inline as the row's `objects` field. Because annotations originate directly from the rendering engine, they provide pixel-perfect ground truth with zero manual labeling. --- ## Compatible Models - YOLOv5 - YOLOv8 - YOLOv9 - YOLOv10 - RT-DETR - DETR - Faster R-CNN - Table Transformer (table localization stage) - Other object detection architectures --- ## Intended Applications - Table Detection - Document Layout Analysis - Intelligent Document Processing (IDP) - OCR preprocessing - Financial document understanding - Table extraction pipelines - Document AI benchmarking --- ## Limitations & Intended Use - Models clean, digitally-generated bank statement PDFs only. - Does not simulate scanned or photographed paper documents. - Synthetic templates cannot fully represent the diversity of real bank statement layouts. - Contains no real customer information or financial records. - Single unsplit dataset. **Best used for:** pretraining, benchmarking, or data augmentation before fine-tuning on real bank statement documents. --- ## Dataset Origin This dataset is entirely synthetic. Every document was procedurally generated using Python and ReportLab. No real bank statements, customer information, financial records, proprietary templates, or institution-specific branding are included. --- ## Citation ```bibtex @dataset{synthetic_bank_statement_table_detection, title = {Synthetic Bank Statement Table Detection Dataset}, author = {Uk, Panhapich}, year = {2026}, note = {Synthetically generated for table detection research} } ``` ## License Released under the **MIT License**.