{"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/mathnet-a-data-centric-approach-for-printed","title":"MathNet: A Data-Centric Approach for Printed Mathematical Expression Recognition","arxiv_id":"2404.13667","date":"2024-04-21","proceeding":null,"authors":["Felix M. Schmitt-Koopmann","Elaine M. Huang","Hans-Peter Hutter","Thilo Stadelmann","Alireza Darvishy"],"abstract":"Printed mathematical expression recognition (MER) models are usually trained and tested using LaTeX-generated mathematical expressions (MEs) as input and the LaTeX source code as ground truth. As the same ME can be generated by various different LaTeX source codes, this leads to unwanted variations in the ground truth data that bias test performance results and hinder efficient learning. In addition, the use of only one font to generate the MEs heavily limits the generalization of the reported results to realistic scenarios. We propose a data-centric approach to overcome this problem, and present convincing experimental results: Our main contribution is an enhanced LaTeX normalization to map any LaTeX ME to a canonical form. Based on this process, we developed an improved version of the benchmark dataset im2latex-100k, featuring 30 fonts instead of one. Second, we introduce the real-world dataset realFormula, with MEs extracted from papers. Third, we developed a MER model, MathNet, based on a convolutional vision transformer, with superior results on all four test sets (im2latex-100k, im2latexv2, realFormula, and InftyMDB-1), outperforming the previous state of the art by up to 88.3%.","url_abs":"https://arxiv.org/abs/2404.13667v1","url_pdf":"https://arxiv.org/pdf/2404.13667v1.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":"mathnet-a-data-centric-approach-for-printed","repo_url":"https://github.com/felix-schmitt/MathNet","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"CC-BY-4.0"}}],"tasks":[],"methods":[],"datasets_introduced":[{"slug":"realformula","name":"RealFormula","full_name":""},{"slug":"im2latexv2","name":"im2latexv2","full_name":""}],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2404.13667","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.13667"}},"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/felix-schmitt/MathNet","reach":{"status":"ok","spdx":"CC-BY-4.0"}}],"summary":{"ran":4,"ran_fixture":1,"ran_draft_wrong":1},"by_repo_kind":{"official":{"samples":6,"ran":6,"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":6,"samples":[{"code_sha256_prefix":"7723237bdf97f354","entry":"create_mask","repo":"felix-schmitt/MathNet","repo_kind":"official","path":"model_parts/utils.py","file_url":"https://github.com/felix-schmitt/MathNet/blob/HEAD/model_parts/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"CC-BY-4.0","inline_ok":false,"mcp_get_code":{"code_sha256":"7723237bdf97f354"}},{"code_sha256_prefix":"763a04c2a58bc1b0","entry":"generate_square_subsequent_mask","repo":"felix-schmitt/MathNet","repo_kind":"official","path":"model_parts/utils.py","file_url":"https://github.com/felix-schmitt/MathNet/blob/HEAD/model_parts/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"CC-BY-4.0","inline_ok":false,"mcp_get_code":{"code_sha256":"763a04c2a58bc1b0"}},{"code_sha256_prefix":"8de4d7bd941a5807","entry":"positionalencoding2d","repo":"felix-schmitt/MathNet","repo_kind":"official","path":"model_parts/CNNEncoder.py","file_url":"https://github.com/felix-schmitt/MathNet/blob/HEAD/model_parts/CNNEncoder.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"CC-BY-4.0","inline_ok":false,"mcp_get_code":{"code_sha256":"8de4d7bd941a5807"}},{"code_sha256_prefix":"f9fd6241d935f07b","entry":"window_partition","repo":"felix-schmitt/MathNet","repo_kind":"official","path":"model_parts/focal_transformer.py","file_url":"https://github.com/felix-schmitt/MathNet/blob/HEAD/model_parts/focal_transformer.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"CC-BY-4.0","inline_ok":false,"mcp_get_code":{"code_sha256":"f9fd6241d935f07b"}},{"code_sha256_prefix":"eb8623dc7c37757f","entry":"window_partition_noreshape","repo":"felix-schmitt/MathNet","repo_kind":"official","path":"model_parts/focal_transformer.py","file_url":"https://github.com/felix-schmitt/MathNet/blob/HEAD/model_parts/focal_transformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"CC-BY-4.0","inline_ok":false,"mcp_get_code":{"code_sha256":"eb8623dc7c37757f"}},{"code_sha256_prefix":"fb32094c6dbece71","entry":"window_reverse","repo":"felix-schmitt/MathNet","repo_kind":"official","path":"model_parts/focal_transformer.py","file_url":"https://github.com/felix-schmitt/MathNet/blob/HEAD/model_parts/focal_transformer.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"CC-BY-4.0","inline_ok":false,"mcp_get_code":{"code_sha256":"fb32094c6dbece71"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}