Source-linked AI summary
MinerU: An Open-Source Solution for Precise Document Content Extraction
Bin Wang, Chao Xu, Xiaomeng Zhao, Linke Ouyang, Fan Wu, Zhiyuan Zhao, Rui Xu, Kaiwen Liu, Yuan Qu, Fukai Shang, Bo Zhang, Liqun Wei, Zhihao Sui, Wei Li, Botian Shi, Yu Qiao, Dahua Lin, Conghui He
TL;DR
Existing open-source document extraction methods struggle to maintain quality across diverse document types and content. MinerU combines PDF-Extract-Kit models with tailored preprocessing and post-processing, and reports high-quality extraction across diverse documents while acknowledging scope and evaluation gaps.
Problem
Existing open-source solutions struggle to consistently deliver high-quality extraction because document types and content are diverse.
Method
MinerU uses PDF-Extract-Kit models trained on diverse real-world documents together with tailored preprocessing and post-processing workflows.
Results
MinerU reports excellent extraction results on diverse documents after removing noise and stitching model outputs during post-processing.
Takeaways & Limitations
MinerU provides an open-source, all-in-one tool designed for high-quality extraction across diverse document types.
Takeaways & Limitations
MinerU currently processes only Chinese and English documents, and the authors identify further improvement needs in components, usability, speed, and benchmarking.
Abstract
from arXiv · showhide
Document content analysis has been a crucial research area in computer vision. Despite significant advancements in methods such as OCR, layout detection, and formula recognition, existing open-source solutions struggle to consistently deliver high-quality content extraction due to the diversity in document types and content. To address these challenges, we present MinerU, an open-source solution for high-precision document content extraction. MinerU leverages the sophisticated PDF-Extract-Kit models to extract content from diverse documents effectively and employs finely-tuned preprocessing and postprocessing rules to ensure the accuracy of the final results. Experimental results demonstrate that MinerU consistently achieves high performance across various document types, significantly enhancing the quality and consistency of content extraction. The MinerU open-source project is available at https://github.com/opendatalab/MinerU.
1 Introduction
Document diversity and growing demand from LLM and RAG applications expose limitations in existing open-source extraction approaches. MinerU addresses this with diverse-document models and tailored processing for accurate, readable outputs.
- Document data is increasingly important for LLM training, while RAG intensifies demand for high-quality document extraction.
- Existing OCR and library-based parsing introduce noise or fail on documents containing images, tables, formulas, and other elements.
- Multi-module parsing can produce high-quality results in principle, but existing open-source models often perform poorly beyond academic papers.
- MinerU uses PDF-Extract-Kit models trained on diverse real-world documents, followed by tailored processing to improve extraction accuracy.
- MinerU supports diverse layouts, filters irrelevant regions, merges paragraphs across columns and pages, and distinguishes formulas, tables, images, text, and captions.
2 MinerU Framework
MinerU converts input PDFs into machine-readable formats through preprocessing, content parsing, post-processing, and format conversion. Its parsing combines specialized recognition models with layout-aware result assembly.
- MinerU processes user-input PDFs into Markdown or JSON through four workflow stages.
- Document Preprocessing: Preprocessing reads PDFs, filters unprocessable files, and extracts metadata such as parseability, language, and page dimensions.
- Document Content Parsing: Content parsing uses layout and formula detection, then applies OCR to text and titles, formula recognition to formulas, and table recognition to tables.
- Document Content Post-Processing: Post-processing removes invalid regions and stitches content using regional positions to recover positioning, content, and sorting information.
- Format Conversion: Format conversion generates user-required outputs such as Markdown from the post-processed document results.
2.1 Document Preprocessing
Document preprocessing filters files that cannot be processed and gathers metadata needed downstream. It also determines language, text encoding condition, scan status, and page information to select extraction handling.
- PDF preprocessing filters non-PDF, encrypted, and password-protected files, then obtains metadata for subsequent processing.
- MinerU currently identifies and processes only Chinese and English documents, with other-language processing quality not guaranteed.
- Garbled text-based PDFs are identified so OCR can be used for subsequent text recognition.
- Scanned PDFs are identified from image and text characteristics, enabling OCR instead of direct PyMuPDF text extraction.
- Page metadata extraction records total page count, page dimensions, and other relevant attributes.
2.2 Document Content Parsing
MinerU’s document parsing stage combines PDF-Extract-Kit models with specialized recognition for layouts, formulas, tables, and text. These components are trained or applied to diverse documents to improve extraction quality and preserve reading order.
- Document Content Parsing: PDF-Extract-Kit detects document regions and applies OCR, formula recognition, and table recognition to their contents.MinerU5 uses five models covering layout detection, formula detection, table recognition, formula recognition, and OCR.
- Layout Analysis: Diverse layout data enables MinerU to recognize varied document regions, including textbooks, academic literature, and financial reports.The training data includes scientific papers, books, textbooks, exam papers, magazines, PPTs, and research reports, with approximately 21K annotated training points.
- Formula Detection: 24,157 inline formulas and 1,829 displayed formulas were annotated across 2,890 Chinese and English document pages for formula detection.The annotations also include an ignore class for visually ambiguous regions such as percentages, chemical formulas, and date ranges.
- Formula Detection: MinerU uses a YOLO-based formula detector and UniMERNet formula recognizer to handle varied printed, scanned, complex, and handwritten formulas.The formula detector is described as performing well in speed and accuracy across various documents.
- Table Recognition: Table recognition uses TableMaster and StructEqTable to produce Table-to-LaTex or Table-to-HTML outputs, including for complex tables.TableMaster decomposes recognition into structural and text-related subtasks, while StructEqTable operates end to end.
- OCR: Region-based OCR avoids incorrect column ordering, while masking and reinserting inline formulas preserves formulas in OCR text.OCR is applied to layout-detected titles and text paragraphs rather than the entire page, and formula coordinates guide masking and reintegration.
2.3 Document Content Post-Processing
MinerU post-processes detected regions to resolve bounding-box conflicts and reconstruct document reading order. It removes or adjusts overlapping regions, then segments pages into single-column groups sorted top to bottom and left to right.
- Document Content Post-Processing: Post-processing resolves overlaps among text, images, tables, formulas, and OCR text lines before sorting document elements.Bounding-box relationships are handled because overlapping regions can make content ordering difficult.
- Bounding-Box Relationships: Contained formulas and text blocks are removed when they lie inside image, table, or formula regions.This addresses containment relationships among bounding boxes.
- Bounding-Box Relationships: Partially overlapping text boxes are shrunk horizontally and vertically to prevent mutual coverage while preserving their position and content.For text overlapping tables or images, the method temporarily ignores the non-text regions to preserve text integrity.
- Region Sorting: MinerU segments pages into regions containing at most one column, then sorts elements according to the human reading order: top to bottom, left to right.The segmentation supports line-by-line reading and determines each PDF element’s final order.
2.4 Format Conversion
MinerU stores processed PDF data in an intermediate JSON structure and converts it into Markdown or custom JSON outputs, with elements crop-able during conversion.
- MinerU stores processed PDF data in a large intermediate JSON structure to support varying output-format requirements.The structure’s important fields are listed in Table 1.
- MinerU converts the intermediate structure into Markdown and custom JSON formats.
- Images, tables, and other elements can be cropped during format conversion.
3 MinerU Quality Assessment
MinerU evaluates its parsing modules and final extraction quality on diverse documents. The reported results show strong performance for layout detection, formula detection, formula recognition, and assembled Markdown outputs.
- MinerU’s quality assessment covers layout detection, formula detection, formula recognition, and final extraction results.The evaluation combines standalone module assessment, a diverse document dataset, and manual quality checks.
- Formula Detection: The formula detection model fine-tuned on diverse data significantly outperforms previous open-source models on papers and other document types.The evaluation dataset includes pages from academic papers and varied sources.
- Formula Recognition: UniMERNet’s formula recognition capability far surpasses other open-source models and is comparable to commercial software like Mathpix.Formula recognition is evaluated with the CDM metric, which is described as unaffected by formula-representation diversity.
- Models trained on diverse document sources significantly outperform open-source models designed for single document types.The paper concludes that this supports the accuracy of MinerU’s parsing results.
- Final Extraction Results: MinerU’s post-processing removes noise and stitches model outputs, producing readable and accurate extraction results across diverse documents.Figure 7 visualizes layout detection, span results, and final Markdown results; the reported spans indicate satisfactory formula and OCR detection.
4 Conclusion and Future Work
MinerU is presented as a one-stop PDF extraction tool that delivers high-quality results on diverse document types through model inference and preprocessing and post-processing operations. Future work targets core components, usability and speed, and systematic benchmarking.
- Conclusion: MinerU is introduced as a one-stop PDF document extraction tool for diverse document types.
- Conclusion: High-quality model inference and meticulous preprocessing and post-processing operations support MinerU’s extraction results on diverse documents.
- Future Work: Future core-component work includes updating PDF-Extract-Kit models and adding table-recognition and reading-order models.
- Future Work: Future usability work focuses on improving processing speed, usability, and efficient online inference services for real-time needs.
- Future Work: Future benchmarking work will establish a systematic evaluation benchmark for diverse documents and compare MinerU with state-of-the-art open-source methods.