{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/clustertabnet-supervised-clustering-method","title":"ClusterTabNet: Supervised clustering method for table detection and table structure recognition","arxiv_id":"2402.07502","date":"2024-02-12","proceeding":null,"authors":["Marek Polewczyk","Marco Spinaci"],"abstract":"We present a novel deep-learning-based method to cluster words in documents which we apply to detect and recognize tables given the OCR output. We interpret table structure bottom-up as a graph of relations between pairs of words (belonging to the same row, column, header, as well as to the same table) and use a transformer encoder model to predict its adjacency matrix. We demonstrate the performance of our method on the PubTables-1M dataset as well as PubTabNet and FinTabNet datasets. Compared to the current state-of-the-art detection methods such as DETR and Faster R-CNN, our method achieves similar or better accuracy, while requiring a significantly smaller model.","url_abs":"https://arxiv.org/abs/2402.07502v2","url_pdf":"https://arxiv.org/pdf/2402.07502v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"clustertabnet-supervised-clustering-method","repo_url":"https://github.com/sap-samples/clustertabnet","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"clustering","task_name":"Clustering"},{"task_slug":"optical-character-recognition","task_name":"Optical Character Recognition (OCR)"},{"task_slug":"table-detection","task_name":"Table Detection"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"detr","method_name":"Detr"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"faster-r-cnn","method_name":"Faster R-CNN"},{"method_slug":"feedforward-network","method_name":"Feedforward Network"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"rpn","method_name":"RPN"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"roipool","method_name":"RoIPool"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.07502","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.07502"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/sap-samples/clustertabnet","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":14,"ran_honours":1,"ran_draft_wrong":1},"by_repo_kind":{"official":{"samples":16,"ran":16,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"aa6da43d05cfaf65","entry":"all_gather","repo":"sap-samples/clustertabnet","repo_kind":"official","path":"train/util.py","file_url":"https://github.com/sap-samples/clustertabnet/blob/HEAD/train/util.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"aa6da43d05cfaf65"}},{"code_sha256_prefix":"29033eca01a298ea","entry":"alternative_clustering","repo":"sap-samples/clustertabnet","repo_kind":"official","path":"train/table_extraction.py","file_url":"https://github.com/sap-samples/clustertabnet/blob/HEAD/train/table_extraction.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"29033eca01a298ea"}},{"code_sha256_prefix":"a36f1ea807e4020b","entry":"bounding_boxes_of_rotated_boxes","repo":"sap-samples/clustertabnet","repo_kind":"official","path":"train_data_preparation/bbox.py","file_url":"https://github.com/sap-samples/clustertabnet/blob/HEAD/train_data_preparation/bbox.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a36f1ea807e4020b"}},{"code_sha256_prefix":"5765519a06dcbdbd","entry":"collate_fn","repo":"sap-samples/clustertabnet","repo_kind":"official","path":"train/util.py","file_url":"https://github.com/sap-samples/clustertabnet/blob/HEAD/train/util.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5765519a06dcbdbd"}},{"code_sha256_prefix":"3f4039d4e717c983","entry":"compute_intersection_batch_parallel","repo":"sap-samples/clustertabnet","repo_kind":"official","path":"train_data_preparation/bbox.py","file_url":"https://github.com/sap-samples/clustertabnet/blob/HEAD/train_data_preparation/bbox.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3f4039d4e717c983"}},{"code_sha256_prefix":"f31a58bf6457ced5","entry":"convert_to_xywh","repo":"sap-samples/clustertabnet","repo_kind":"official","path":"train/coco_eval.py","file_url":"https://github.com/sap-samples/clustertabnet/blob/HEAD/train/coco_eval.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f31a58bf6457ced5"}},{"code_sha256_prefix":"c5f2f85533847d03","entry":"estimate_min_angle","repo":"sap-samples/clustertabnet","repo_kind":"official","path":"train_data_preparation/bbox.py","file_url":"https://github.com/sap-samples/clustertabnet/blob/HEAD/train_data_preparation/bbox.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c5f2f85533847d03"}},{"code_sha256_prefix":"fe0ddcc2d420c9a0","entry":"evaluate","repo":"sap-samples/clustertabnet","repo_kind":"official","path":"train/coco_eval.py","file_url":"https://github.com/sap-samples/clustertabnet/blob/HEAD/train/coco_eval.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fe0ddcc2d420c9a0"}},{"code_sha256_prefix":"c02ce6c44f07d3c6","entry":"get_angle","repo":"sap-samples/clustertabnet","repo_kind":"official","path":"utils/table.py","file_url":"https://github.com/sap-samples/clustertabnet/blob/HEAD/utils/table.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c02ce6c44f07d3c6"}},{"code_sha256_prefix":"0eac6fdc0b1a9a63","entry":"get_image_and_mask","repo":"sap-samples/clustertabnet","repo_kind":"official","path":"evaluation/debug_output/save_and_plot.py","file_url":"https://github.com/sap-samples/clustertabnet/blob/HEAD/evaluation/debug_output/save_and_plot.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0eac6fdc0b1a9a63"}},{"code_sha256_prefix":"d084e679aa5e2ce1","entry":"get_page_ids","repo":"sap-samples/clustertabnet","repo_kind":"official","path":"train_data_preparation/tables_dataset.py","file_url":"https://github.com/sap-samples/clustertabnet/blob/HEAD/train_data_preparation/tables_dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d084e679aa5e2ce1"}},{"code_sha256_prefix":"c6ac3547792b8c2f","entry":"get_side_length","repo":"sap-samples/clustertabnet","repo_kind":"official","path":"utils/table.py","file_url":"https://github.com/sap-samples/clustertabnet/blob/HEAD/utils/table.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c6ac3547792b8c2f"}},{"code_sha256_prefix":"05992505df9ef0cd","entry":"reduce_dict","repo":"sap-samples/clustertabnet","repo_kind":"official","path":"train/util.py","file_url":"https://github.com/sap-samples/clustertabnet/blob/HEAD/train/util.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"05992505df9ef0cd"}},{"code_sha256_prefix":"3486f5c9f5c57b11","entry":"rotate_based_on_exif","repo":"sap-samples/clustertabnet","repo_kind":"official","path":"evaluation/debug_output/save_and_plot.py","file_url":"https://github.com/sap-samples/clustertabnet/blob/HEAD/evaluation/debug_output/save_and_plot.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3486f5c9f5c57b11"}},{"code_sha256_prefix":"a1669488e47d595a","entry":"thumbnail","repo":"sap-samples/clustertabnet","repo_kind":"official","path":"evaluation/debug_output/save_and_plot.py","file_url":"https://github.com/sap-samples/clustertabnet/blob/HEAD/evaluation/debug_output/save_and_plot.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a1669488e47d595a"}},{"code_sha256_prefix":"29505c7172ecd328","entry":"validate_coco","repo":"sap-samples/clustertabnet","repo_kind":"official","path":"train/table_extraction.py","file_url":"https://github.com/sap-samples/clustertabnet/blob/HEAD/train/table_extraction.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"29505c7172ecd328"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}