All guides
Local OCR/

A Border-Aware Pipeline for Local Image to Table Recognition

Explore how a browser-local table recognition pipeline classifies bordered and borderless tables, then uses specialized models to recover their structure and cells.

imgtotable Editorial Team3 min read

Tables generally fall into two categories: bordered and borderless. Each provides different visual clues for identifying rows, columns, and individual cells.

Bordered (wired) tables

Bordered tables use visible lines to separate rows and columns. These lines help define cell boundaries, including cells that span multiple rows or columns, as shown below.

bordered-table-with-complex-structure.jpg

Borderless (wireless) tables

Borderless tables rely mainly on text alignment and spacing to organize data, rather than a full grid of cell borders. Financial statements often use this layout, as illustrated by the NVIDIA financial summary below.

non-gaap-q2-fiscal-2027.png

A Border-aware Pipeline for Local Table Recognition

The General pipeline uses SLANet+ to predict table structure, but it can struggle with some layouts. The Border-aware pipeline offers an alternative that selects models based on the table's border style.

It first classifies the table as bordered or borderless, then runs the structure recognition and cell detection models trained for that table type. All processing takes place in the browser without uploading the image.

Rendering diagram…

flowchart TD
    A["Image"] --> B{"Classify table<br>PP-LCNet_x1_0_table_cls"}
    B -->|"Bordered / wired"| C["Recognize structure<br>SLANeXt_wired"]
    C --> G["Detect cells<br>RT-DETR-L_wired_table_cell_det"]
    B -->|"Borderless / wireless"| D["Recognize structure<br>SLANeXt_wireless"]
    D --> I["Detect cells<br>RT-DETR-L_wireless_table_cell_det"]
    G --> K
    I --> K["Assemble HTML table"]

Comparing Results on a Complex Bordered Table

The example below compares the General (default) and Border-aware pipelines on the same bordered table with a complex structure.

Source image of a bordered table with a complex cell structure

General Pipeline Result

General pipeline result showing errors in the recovered table structure

The General pipeline does not fully recover the table structure in this example.

Border-aware Pipeline Result

Border-aware pipeline result showing the correct table structure with one text recognition error

The Border-aware pipeline recovers the table structure correctly, though one cell contains a minor text recognition error.

For complex bordered tables like this one, try the Border-aware pipeline if the General pipeline does not recover the structure correctly.