A PDF drawing data extraction method and system based on intelligent identification

CN121686504BActive Publication Date: 2026-10-27TAIZHOU HUAWEI INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511497913.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-20
Publication Date
2026-10-27
Estimated Expiration
2045-10-20

AI Technical Summary

Technical Problem

[0003]然而,在现有的PDF图纸电子化审查流程中,系统无法在视觉层面看懂并验证具体的修改内容,因此只能退回到最原始的文件级操作

Benefits of technology

1.通过获取包括图名、图号和比例尺的图纸元数据,并结合所述图纸元数据中的比例尺,对所述构件元素执行几何尺寸计算,换算出构件元素的实际尺寸和实际位置坐标,解决了现有技术仅停留在像素级识别而无法获取真实世界物理尺寸的难点。通过设立独立的文字与元数据提取模型,将比例尺作为关键信息,实现了从图像像素到工程单位的换算。最终生成的结构化的图纸分析结果不仅包含了构件的类型和位置,更包含了其可用于工程量计算、成本估算和BIM建模的真实物理尺寸,使提取的数据具备了直接的工程应用价值。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121686504B_ABST
    Figure CN121686504B_ABST
Patent Text Reader

Abstract

The present application relates to the field of drawing recognition, in particular to a PDF drawing data extraction method and system based on intelligent recognition. The method comprises reading the internal structure of a PDF engineering drawing to obtain a native text stream, a vector path and a raster image; identifying the native text stream through a shunt preprocessing framework to form structured text data; rendering the vector path and the raster image to obtain a background image; using an intelligent recognition model to analyze the structured text data through a character recognition and extraction sub-model, obtain drawing metadata and record the position, and obtain a character recognition result; analyzing the background image through a graphic element recognition and classification sub-model, recognizing and classifying component elements, and obtaining a graphic recognition result; and fusing according to a visual space correspondence relationship to combine into a drawing analysis result. The present application improves the adaptability to engineering drawings with diverse sources and varying qualities through the shunt preprocessing framework and the intelligent recognition model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of drawing recognition, specifically to a method and system for extracting PDF drawing data based on intelligent recognition. Background Technology

[0002] In recent years, with the continuous development of information technology, the review of architectural construction drawings has gradually moved away from the traditional offline paper-based review method and turned to online electronic document review, such as reviewing architectural construction drawings in PDF format, in order to significantly improve the efficiency of review and management level.

[0003] However, in the existing electronic review process for PDF drawings, the system cannot visually understand and verify specific modifications, thus reverting to the most basic file-level operations. This method increases the workload of design units, as well as the workload of review agencies in signing and the complexity of document version management. The core limitation of existing electronic drawing review systems lies in treating PDF drawing files essentially as a collection of pixels or vector instructions, failing to apply image pattern recognition technology to understand their inherent professional design language, lacking a deep understanding of the geometric information, text annotations, and symbols within the drawings, unable to understand the spatial topological relationships and design intentions between these objects, and unable to directly locate and identify specific visual changes by comparing image features. To solve the problem of inefficiency and lay the foundation for future higher-level intelligent review, it is urgent to introduce intelligent recognition technology.

[0004] In summary, there is currently a lack of a method to process image data from PDF engineering drawings of architectural construction, and to accurately and effectively integrate visual graphic information with key textual metadata to extract semantic engineering component data with real-world physical dimensions, even when the internal structure of the PDF engineering drawings is unreliable or missing.

[0005] To address this, a method and system for extracting PDF drawing data based on intelligent recognition are proposed. Summary of the Invention

[0006] The purpose of this invention is to provide a method and system for extracting PDF drawing data based on intelligent recognition, so as to solve the problems mentioned in the background art.

[0007] To achieve the above objectives, the present invention provides the following technical solution: a method for extracting PDF drawing data based on intelligent recognition, comprising: The PDF parsing model is used to extract the internal structure of PDF engineering drawings, resulting in the original text stream, vector paths, and raster images. The text portions in the original text stream, which are in the form of curves and vector paths, are subjected to optical character recognition and reconstruction through a split preprocessing framework to form structured text data. The vector paths and raster images are then rendered to obtain the background image. A deep learning-based intelligent recognition model is constructed. Through the text recognition and extraction sub-model, content analysis and matching are performed on structured text data to obtain drawing metadata, including drawing title, drawing number, and scale, and record the location to obtain text recognition results. Through the graphic element recognition and classification sub-model, pixel-level analysis is performed on the background image to identify and classify component elements, including walls, beams, and columns. Combined with the scale, geometric dimensions are calculated to determine the type, size, and location of component elements to obtain graphic recognition results. The text recognition results and image recognition results are fused together based on the visual spatial correspondence, combined into a structured drawing analysis result, and output in a standardized data format.

[0008] Preferably, the PDF parsing model specifically includes: The PDF parsing model includes a PDF parsing sub-model and a preprocessing sub-model. The PDF parsing sub-model is used to parse the internal structure of PDF engineering drawings to obtain the original text stream, vector path and raster image. The preprocessing sub-model uses a split preprocessing framework to perform optical character recognition on the text portions in the original text stream that exist in the form of curves, restore them to character encoding, and form structured text data; the vector path and raster image are enhanced, denoised, and normalized to obtain a standardized background image.

[0009] Preferably, the specific process of the offloading preprocessing framework includes: For text represented by a large number of short vector line segments, an optical character recognition engine is applied to recognize it, converting it into a text string and the corresponding bounding box coordinates to obtain the corresponding character encoding; the corresponding character encoding is merged with the original text stream to form structured text data; a blank canvas with a preset resolution is created, and drawing is performed on the canvas according to the drawing instructions of the vector path; the raster image is placed on the canvas according to the coordinates; the generated canvas image is enhanced, denoised, and normalized to obtain a standardized background image.

[0010] Preferably, the specific process for generating the text recognition result includes: Based on pre-defined drawing layout specifications, layout analysis is performed on PDF engineering drawings to locate the coordinate range of the metadata area, including the title block and drawing frame. Text entries whose coordinates fall within the coordinate range of the metadata area are filtered from the structured text data. Using pre-defined drawing metadata keywords and their regular expressions, the filtered text entries are matched to extract the drawing metadata of the PDF engineering drawing, including the drawing name, drawing number, and scale. The image position coordinates corresponding to the identified drawing name, drawing number, and scale are recorded to form the text recognition result.

[0011] Preferably, the specific process for obtaining the image recognition result includes: The background image is processed using an object detection algorithm to identify and locate candidate component elements. A convolutional neural network classification model is used to filter the bounding box set, generating a bounding box set containing candidate component elements. A pre-trained visual feature classifier is used to classify each candidate component element into a specific type, and graphic elements that do not belong to the predetermined component list are filtered out to obtain the component elements. The geometric dimensions of the component elements are calculated using the scale in the drawing metadata. Based on the pixel size and position coordinates of the component elements in the background image, the actual size and actual position coordinates of the component elements are calculated. The determined component element type, actual size, and actual position coordinates are encoded into visual object descriptors containing geometric and category attributes. Each visual object descriptor corresponds to a component element entity, which together constitute the graphic recognition result.

[0012] Preferably, the specific process for generating the structured drawing analysis results includes: Based on the position coordinates and actual position coordinates in the text recognition results and the image recognition results, a visual spatial correspondence is established between component elements and related text annotations; the structured text data describing the size, material, and number of the component elements is semantically associated with the corresponding component elements according to the visual spatial correspondence to complete attribute annotation and obtain composite component elements; the composite component elements are organized into structured drawing analysis results; the structured drawing analysis results include a drawing metadata root node and a component list root node.

[0013] A PDF drawing data extraction system based on intelligent recognition, comprising: Drawing Image Module: Utilizes a PDF parsing model to extract the internal structure of PDF engineering drawings, obtaining the original text stream, vector paths, and raster images; uses a split preprocessing framework to perform optical character recognition and reconstruction on the text portions existing in the form of curves and vector paths in the original text stream, forming structured text data; renders the vector paths and raster images to obtain the background image; Drawing Content Visual Recognition Module: Constructs a deep learning-based intelligent recognition model. Through the text recognition and extraction sub-model, it performs content analysis and matching on structured text data to obtain drawing metadata, including drawing title, drawing number, and scale, and records the location, thus obtaining the text recognition result. Through the graphic element recognition and classification sub-model, it performs pixel-level analysis on the background image, identifies and classifies component elements, including walls, beams, and columns, and calculates geometric dimensions based on the scale to determine the type, size, and location of component elements, thus obtaining the graphic recognition result. Information Spatial Association Module: This module fuses text recognition results and graphic recognition results based on visual spatial correspondence, combining them into structured drawing analysis results and outputting them in a standardized data format.

[0014] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. By acquiring drawing metadata, including drawing title, drawing number, and scale, and combining this metadata with the scale, geometric dimension calculations are performed on the component elements to determine their actual dimensions and coordinates. This overcomes the limitation of existing technologies that only achieve pixel-level recognition and cannot capture real-world physical dimensions. By establishing an independent text and metadata extraction model, using the scale as key information, conversion from image pixels to engineering units is achieved. The resulting structured drawing analysis not only includes the component type and location but also its actual physical dimensions, which can be used for quantity surveying, cost estimation, and BIM modeling, giving the extracted data direct engineering application value.

[0015] 2. By rendering vector paths and raster images, a standardized background image is obtained. This background image is then directly analyzed to identify and classify structural elements, including walls, beams, and columns. This establishes a technical approach that does not rely on the internal layer structure of PDF drawings. Regardless of whether the layer information of the drawings is standardized or clear, this invention can unify them into a standard image for visual recognition, ensuring the effectiveness of identifying specialized components. Simultaneously, it improves the adaptability and processing success rate of various engineering drawings from diverse sources and of varying quality in the real world.

[0016] 3. By fusing the recognized text and image results based on visual spatial correspondence, particularly by semantically associating textual descriptions of component element dimensions, materials, and numbers with corresponding component elements to complete attribute annotation and obtain composite component elements, a deep multimodal information fusion is achieved. Components and attributes are treated as two independent but equally important information streams. After each undergoes high-precision recognition, they are matched through spatial location logic to create composite component elements containing geometric information and engineering attributes. This fusion method ensures that the output dataset is no longer a collection of fragmented information, but rather generates structured data with complete structure and rich attributes for subsequent intelligent drawing review or automated design applications. Attached Figure Description

[0017] Figure 1 A flowchart illustrating a PDF drawing data extraction method based on intelligent recognition, as proposed in an embodiment of this invention application; Figure 2 This is a structural diagram of a PDF drawing data extraction system based on intelligent recognition, as proposed in an embodiment of this invention application. Figure 3 This is a schematic diagram of the intelligent recognition and data extraction results proposed in an embodiment of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] Please see Figures 1-3 The present invention provides a method for extracting PDF drawing data based on intelligent recognition, the specific steps of which are as follows: The PDF parsing model is used to extract the internal structure of PDF engineering drawings, resulting in the original text stream, vector paths, and raster images. The text portions in the original text stream, which are in the form of curves and vector paths, are subjected to optical character recognition and reconstruction through a split preprocessing framework to form structured text data. The vector paths and raster images are then rendered to obtain the background image. A deep learning-based intelligent recognition model is constructed. Through the text recognition and extraction sub-model, content analysis and matching are performed on structured text data to obtain drawing metadata, including drawing title, drawing number, and scale, and record the location to obtain text recognition results. Through the graphic element recognition and classification sub-model, pixel-level analysis is performed on the background image to identify and classify component elements, including walls, beams, and columns. Combined with the scale, geometric dimensions are calculated to determine the type, size, and location of component elements to obtain graphic recognition results. The text recognition results and image recognition results are fused together based on the visual spatial correspondence, combined into a structured drawing analysis result, and output in a standardized data format.

[0020] The technical solution of the present invention will be further described in detail below with reference to specific embodiments.

[0021] Example 1 This application discloses a method for extracting PDF drawing data based on intelligent recognition. (See attached document.) Figure 1 The specific steps proposed in this invention include: S1. Extracting the internal structure of PDF engineering drawings using a PDF parsing model to obtain the original text stream, vector paths, and raster images; S2. Performing optical character recognition and restoration on the text portions existing in the form of curves and vector paths in the original text stream using a split preprocessing framework to form structured text data; rendering the vector paths and raster images to obtain a background image; S3. Performing content analysis and matching on the structured text data using a text recognition and extraction sub-model to obtain drawing metadata including drawing name, drawing number, and scale, and recording the location to obtain text recognition results; S4. Performing pixel-level analysis on the background image using a graphic element recognition and classification sub-model to identify and classify component elements including walls, beams, and columns, calculating geometric dimensions in conjunction with the scale, determining the type, size, and position of component elements to obtain graphic recognition results; S5. Merging the text recognition results and graphic recognition results according to the visual spatial correspondence to combine them into a structured drawing analysis result, and outputting it in a standardized data format.

[0022] Furthermore, the internal structure of the PDF engineering drawing is extracted using a PDF parsing model to obtain the original text stream, vector paths, and raster images; corresponding to step S1 above; the specific implementation process includes: The PDF parsing model aims to transform unstructured PDF drawing files into standardized, structured data for use as input to deep learning models. The model consists of a PDF parsing sub-model and a preprocessing sub-model.

[0023] The PDF parsing sub-model undertakes the low-level deconstruction task of the original PDF engineering drawings, distinguishing and extracting the digital content of the drawings. The PDF parsing sub-model first reads and deeply parses the internal encoding structure of the original PDF engineering drawings. During the reading process, the PDF parsing sub-model accesses the PDF engineering drawings and parses the file header information and cross-reference table to locate all low-level objects in the PDF engineering drawings, such as the page dictionary, content stream, and resource dictionary. In the deep parsing stage, the PDF parsing sub-model performs instruction-level analysis on the content stream pointed to by the PDF page dictionary. The content stream contains a series of PDF rendering instructions, which control the drawing of drawing elements, the placement of text, and the display of images. By recognizing and processing these rendering instructions, the PDF parsing sub-model deconstructs the internal geometric and textual information of the drawings. Based on the results of the above deep parsing, the PDF parsing sub-model further distinguishes and extracts three types of original digital elements in the PDF drawings: native text stream, vector paths, and raster images. For raw text extraction, the PDF parsing sub-model identifies PDF instructions (e.g., TJ) used for text manipulation, as well as font information and character encoding in the content stream. The extraction operation separates this raw character data, its position on the page, and font information to form the raw text stream. For vector path extraction, the PDF parsing sub-model identifies geometric instructions (e.g., m (move), l (straight line), c (curve), S (stroke), f (fill)) used for path construction and drawing in the content stream. The extraction operation separates the mathematical descriptions (i.e., coordinate point sequences, line widths, and colors) of the lines and geometric shapes that constitute the primitives to form vector paths. For raster image extraction, the PDF parsing sub-model identifies external image objects referenced in the content stream. The extraction operation separates the embedded raw pixel data and mask information in JPEG, PNG, or other formats to form raster images. The differentiation operation categorizes the extracted data into three main categories: text, vector, or raster, based on the type of objects in the PDF engineering drawing structure and the rendering instructions used in the content stream.

[0024] By clearly dividing the PDF parsing process into a PDF parsing sub-model and a preprocessing sub-model, a clear and modular processing architecture is constructed methodologically. This layered design ensures that data from different sources, such as raw text streams, vector paths, and raster images, can be subjected to targeted and independent preliminary processing, laying an orderly foundation for subsequent complex analysis tasks.

[0025] Furthermore, the text portions existing in the form of curves and vector paths in the original text stream are subjected to optical character recognition and reconstruction using a split preprocessing framework to form structured text data; the vector paths and raster images are then rendered to obtain the background image; this corresponds to step S2 above; the specific process includes: The preprocessing sub-model initiates a split preprocessing framework, receiving the raw text stream, vector paths, and raster images, and processing them through two parallel paths.

[0026] The graphic information processing path utilizes the PyMuPDF library to render vector paths and raster images in a unified manner. This process draws all vector lines and shapes on a blank canvas with a preset resolution (for example, usually set to no less than 300 DPI to ensure detail clarity) according to the original coordinates, and places raster images (such as badge logos) in the corresponding positions, ultimately generating a complete high-resolution pixel matrix, i.e., the background image.

[0027] Subsequently, to improve image quality and reduce the processing difficulty of subsequent recognition models, efficient numerical operations were performed on the background image using the NumPy library, and a series of depth enhancement processes were applied to the background image using OpenCV image processing functions. Specifically, this included using Gaussian blur (cv2.GaussianBlur) to remove minor noise, binarization using adaptive thresholding (cv2.adaptiveThreshold) to highlight lines, and adjusting contrast. In particular, for common line breakage or adhesion problems in scanned drawings, morphological operations were applied, such as opening operations (cv2.erode followed by dilation) to eliminate isolated noise, or closing operations (cv2.dilate followed by dilation) to connect broken lines. The processed image was then uniformly scaled to a preset size, such as 2048x2048 pixels, to serve as the standard input for subsequent deep learning models. After these steps, a standardized background image suitable for subsequent recognition was finally obtained.

[0028] During the enhancement process, a differentiated rendering mechanism based on engineering drawing semantics is used to standardize the mapping of vector path attributes. According to a pre-defined rule base, different semantic graphic elements are assigned different visual characteristics during rendering. Specific colors and paths representing the main structural outlines in the design specifications are uniformly mapped to high-contrast black solid lines; colors representing auxiliary information such as dimensions and grid lines, and paths with thinner line widths, are mapped to thinner lines with lower grayscale values. This rule base is based on the national standard "Unified Standard for Building Construction Drawings" (GB / T). The rules are set according to 50001-2017 and industry practices. The content is not exhaustive. Those skilled in the art can expand it according to the actual drawing specifications. Typical implementation examples of the rule library include: 1) Main structural outline rules: Any path whose RGB color values ​​of R, G, and B are all less than 64 (value range 0-255) and whose path width is greater than 0.5pt is identified as the main structural outline (wall, column, beam) and uniformly mapped to a high-contrast pure black (RGB value [0, 0, 0]) solid line during rendering; 2) Auxiliary information rules: Any path whose color is red (RGB value close to [255, 0, 0]) or green (RGB value close to [0, 128, 0]) and whose path width is less than or equal to 0.25pt is identified as auxiliary information such as dimension annotations and grid lines and mapped to a thin line with a lower gray value (such as RGB value [128, 128, 128]) during rendering. In this way, visual interference caused by non-critical information is successfully eliminated, allowing the geometric shape of the core components to stand out in the generated background image. This provides higher-quality and more discriminative image input for subsequent graphic element recognition and classification sub-model analysis.

[0029] Regarding the text information processing approach, for text originally presented in standard character encoding within the raw text stream, its character content, font attributes, and position are directly extracted. For vector text that has been converted into a large number of short vector line segments or curves due to design software export settings (such as "exploding text") or scanning processes, pre-clustering of vector paths is performed. The DBSCAN algorithm is used to group closely arranged and similarly oriented short vector line segments into candidate text clusters based on the spatial proximity and directional consistency of the vector line segment endpoints. Specifically, the neighborhood radius (ε) of DBSCAN is set to 0.5 times the average character height, and the minimum number of samples (MinPts) is set to 3. The aspect ratio of its bounding rectangle, the density of internal line segments (defined as the ratio of the total length of all line segments in the cluster to the area of ​​its bounding rectangle), and the statistical features of stroke complexity (defined as the number of corner points with an angle less than 90 degrees formed by the endpoints of all line segments in the cluster) are calculated. These features are then input into a lightweight support vector machine (SVM) classifier to determine whether the cluster is text or graphics. For vector clusters classified as "text," the framework invokes the Optical Character Recognition (OCR) engine, namely Tesseract, for recognition. Other vector paths not recognized as text then enter the graphic information processing path. For raster text naturally occurring in scanned drawings, the OCR engine is directly applied to the rendered standardized background image within the graphic information processing path of this solution for recognition.

[0030] The vector text is rendered on a blank canvas with a resolution of at least 400 DPI to generate a temporary grayscale image. A Gaussian blur operation with a kernel size of (3, 3) is then applied to this image to remove minor noise. Next, an adaptive Gaussian thresholding method is used for binarization, resulting in clearer character edges. The processed binarized image is then fed into the Tesseract OCR engine, with the page segmentation mode explicitly configured as single-line text mode (PSM_SINGLE_LINE), and a custom language data package for the GB / T 2312 character set and commonly used engineering symbols is loaded.

[0031] The process of constructing a custom language data package first requires identifying the target "commonly used engineering symbols," which should include at least rebar symbols (such as Φ for Grade I steel, Φ for Grade II steel, and Φ for Grade III steel), diameter symbols (Ø), triangle symbols used for architectural and structural elevations, and professional terms (such as common abbreviations and combinations like "KL," "KZ," and "C30"). After identifying the target symbols, image slices containing these symbols are collected from architectural and structural drawings of different projects through screenshots or rendering. Data augmentation techniques are used to augment the collected image slices, automatically generating synthetic image samples with variations in font, font size, rotation angle, and background noise. Specific augmentation parameters include using common engineering design fonts such as SimSun_GB2312, SimHei, and vector fonts commonly used in CAD software such as hztxt.shx and tssdeng.shx; random scaling within the range of 8pt to 24pt; random rotation within the range of -15° to +15°; and adding Gaussian noise with a standard deviation of 0.5 to 1.5, or simulating salt-and-pepper noise generated by drawing scanning. This ultimately forms a training sample set with sufficient diversity.

[0032] The second step is sample annotation. Open-source annotation tools (such as jTessBoxEditor) are used to draw bounding boxes for characters or symbols in each image sample and assign correct text labels. The third step is model training. The annotated sample set is input into the Tesseract training process, and incremental training is performed using its command-line tools based on the standard Simplified Chinese language pack (chi_sim), with the key parameter learning rate set to 1.0x10. -4 The iteration count is set to 20,000. The fourth step is packaging and generating the data. After training, the newly generated model file is merged with the base language package, ultimately generating a custom language data package file named eng_custom.traineddata. This data package is loaded via the Tesseract API during OCR recognition.

[0033] An R-tree spatial index is built for the bounding boxes of all text entries in the raw text stream. For each text entry recognized by OCR, its bounding box is used to search the R-tree index for the raw text entries that spatially overlap with it. The intersection-over-union (IoU) ratio between the bounding box of the OCR-recognized text entry and each overlapping raw text bounding box is calculated. If the maximum IoU value is greater than 0.85, the text entry recognized by OCR is considered a duplicate. Text entries identified as duplicates are discarded, prioritizing the retention of the corresponding entries in the raw text stream. Text entries identified as non-duplicates (i.e., whose maximum IoU value with all raw text is no greater than 0.85) are added as new text entries to the structured text dataset. This results in a complete, unique structured text dataset containing all text content and location information.

[0034] Through refined processing techniques, text represented by numerous short vector line segments is specifically processed, losslessly restoring this pseudo-graphic information into structured text, effectively avoiding the risk of losing crucial textual information. By drawing and placing elements on a blank canvas with a preset resolution, the generated background image is ensured to be a high-fidelity reproduction of the original graphic content. This control over preprocessing details guarantees the integrity and accuracy of the data, providing a key technological guarantee for achieving high-precision recognition results.

[0035] Furthermore, through the text recognition and extraction sub-model, content analysis and matching are performed on the structured text data to obtain drawing metadata, including drawing title, drawing number, and scale, and the location is recorded to obtain the text recognition result; corresponding to step S3 above; the specific implementation process includes: The intelligent recognition model employs a dual-stream parallel processing architecture to process text and graphic data separately. The text recognition and extraction sub-model, as the text processing stream, uses a pre-trained language model based on BERT (Bidirectional Encoder Representations from Transformers); the graphic element recognition and classification sub-model, as the image processing stream, uses a ResNet-50 with a Feature Pyramid Network (FPN) as the backbone network. The specific workflow of the intelligent recognition model is as follows: The text recognition and extraction sub-model is invoked to process the input structured text data, generating text recognition results containing drawing metadata. After processing, the model outputs and temporarily stores the extracted key parameters, especially the scale and image rendering DPI value. Subsequently, the graphic element recognition and classification sub-model is invoked to process the background image. In the post-processing stage of this sub-model—that is, after completing the pixel size and position recognition of the components but before calculating the geometric dimensions—the scale and DPI parameters temporarily stored in the previous stage are read to complete the conversion from pixel units to actual physical dimensions. This design decouples text metadata extraction and graphical component recognition, enabling the two independent models to work together through explicit parameter passing, thus forming an intelligent recognition model.

[0036] During the training phase of the text recognition and extraction sub-model, the Adam optimizer was used for parameter optimization, with the initial learning rate set between 1e-4 and 1e-5 and the batch size set to 8. The model was first pre-trained on publicly available architectural drawing datasets such as CubiCasa5K, and then fine-tuned on a finely annotated engineering drawing dataset, for a total of 100 training epochs. This fine-tuning dataset should contain at least 800 structural construction drawings covering various building types (such as residential and public buildings), and the annotated objects should be clearly defined as core components, including but not limited to walls (including shear walls and masonry walls), columns (including structural columns and frame columns), and beams (including frame beams and secondary beams). During the annotation process, the principle of independent annotation was followed. For irregularly shaped columns, the smallest bounding rectangle that completely covers their outer contour was used for annotation; for the connection between beams and columns, the beam's bounding box should extend to the edge of the column. Two-person cross-validation was used to sample more than 20% of the samples to ensure the quality of the annotated data. For example, when a column is partially embedded in a wall, the column and the wall should be labeled as two separate entities, and the labeling information should include the component's category label (such as wall, column, beam).

[0037] The text recognition and extraction submodel takes the received structured text data containing all text strings on the drawing and their corresponding bounding box coordinates as the only input, and feeds it into the fine-tuned BERT model for judgment. Obtain the total width W and total height H of the drawing page. Based on the drawing layout specifications, the coordinate range of the metadata area is defined as a rectangular area at the bottom right corner of the page, and its specific coordinate range is calculated as: the coordinates of the top-left corner of the rectangular area are (W*0.6, H*0.8), and the coordinates of the bottom-right corner are (W, H). Through this calculation, a defined area covering the last 40% of the drawing width and the bottom 20% of the page is obtained. Then, all text entries whose bounding boxes are completely contained within this coordinate range are filtered out from the structured text data. If all preset core metadata (such as drawing name and scale) are not successfully matched in this area, the system will automatically extend the search range to the entire drawing page to be compatible with drawings of non-standard layouts and ensure the success rate of key information extraction.

[0038] According to the filtering result of the BERT model, the following preset metadata keywords and their corresponding regular expressions are applied to the text entries in the title block area for matching and extraction. This process first establishes a dictionary containing keywords and their variants, and the system traverses the filtered text entries to find texts that completely match or partially match any keyword in the dictionary. For example, for the metadata type "drawing name", its keyword list may include "drawing name", "project name", "item name" and "drawing title"; for "drawing number", its list may include "drawing number", "drawing identification number" and "file number"; for "scale", its list may include "scale", "ratio" and "SCALE".

[0039] Once a keyword is matched in a text entry, the corresponding regular expression is applied for value extraction in this text entry itself and its adjacent text entries on the right or below (the search range is a circular area with the keyword as the center and a radius of 50 pixels) according to the metadata type. The extraction logic varies for different types of metadata: for the "drawing name" with diverse formats, no fixed expression is used, and its extraction logic is to obtain all subsequent texts in the line where the text entry containing the drawing name keyword is located as the drawing name content; for the "drawing number", the regular expression ([A-Z]+-[0-9]+) is applied to match the string composed of uppercase letters, numbers and optional hyphens; for the "scale", the regular expression 1\s*[:比]\s*(\d+) is applied to match the format such as "1:100" or "1 to 100", and capture the two numbers before and after the colon.

[0040] All successfully extracted metadata (as shown in the figure "First Floor Column Layout Plan"), along with its original text content and bounding box coordinates, are organized into a structured key-value pair collection (e.g., a JSON object). In this collection, the keys are standardized metadata field names (e.g., drawing_name, drawing_number, scale), and the values ​​are objects containing the extracted text content and its location information. This uniformly formatted collection constitutes the text recognition result.

[0041] By utilizing pre-defined drawing layout specifications to limit the recognition area (such as the title block), global scanning of the entire drawing is avoided, significantly reducing computational load and interference from irrelevant text. Combining Natural Language Processing (NLP) and regular expression techniques for keyword matching enables rapid and accurate extraction of key metadata such as drawing title, drawing number, and scale, providing a reliable basis for subsequent drawing dimension calculations and data archiving.

[0042] Furthermore, through a graphic element recognition and classification sub-model, pixel-level analysis is performed on the background image to identify and classify component elements including walls, beams, and columns. Geometric dimensions are calculated using a scale to determine the type, size, and location of the component elements, thus obtaining the graphic recognition result; this corresponds to step S4 above. The specific implementation process includes: The graphic element recognition and classification sub-model receives the background image as the primary visual analysis input, uses YOLOv5 for rapid localization, and then performs accurate classification using a ResNet-50 model. The classification head of the YOLOv5 model is a convolutional neural network classification model used to filter detected bounding boxes. To better adapt to the characteristics of thin lines and large scale variations in engineering drawings, the default configuration of the YOLOv5 model has been optimized: the input image is uniformly scaled to 1280x1280 pixels. Statistical analysis of the component annotation boxes in the training set was performed, generating nine custom anchor boxes using the K-means clustering algorithm. The aspect ratios of these anchor boxes better match the characteristics of slender beams (e.g., 1:8, 1:10) and square columns (e.g., 1:1, 1:1.2). The model's detection head output layer was modified to include N component categories (e.g., N=3 in this embodiment, representing walls, columns, and beams), along with the confidence score and bounding box coordinates for each category. During training, the FocalLoss loss function is used to address the imbalance between positive and negative samples, and the Adam optimizer is employed with an initial learning rate set to 1e. -4 .

[0043] Subsequently, a separate visual feature classifier based on the ResNet-50 architecture is used to classify the graphics within each bounding box generated by YOLOv5. The input to this model is a component bounding box image uniformly scaled to 224x224 pixels after affine transformation. The fully connected layer at the end of its network structure is replaced with a classification layer with N output units, where N is the total number of predefined component types (e.g., walls, columns, beams, etc.), and a Softmax activation function is used to output the probability of each category. The model is trained using the standard cross-entropy loss function and employs data augmentation strategies including random rotation (-15° to +15°), random scaling (0.9 to 1.1 times), and the addition of Gaussian noise. During recognition, the category with the highest confidence is adopted as the final classification result for the graphic within that bounding box.

[0044] Through a verification and correction process based on geometric and topological rules, each type of component element is checked against a preset engineering knowledge base. For initially identified component elements, the system automatically verifies whether their geometric shape conforms to the preset geometric shape, whether their aspect ratio is within the reasonable range of conventional design, and whether their center position is aligned with the identified building grid or within the allowable deviation range. If a component fails verification, its type is corrected based on the connection relationship with adjacent components. The engineering knowledge base consists of a series of coded, hard rules, including the following: Rule 1 (Column Geometric Verification): For components initially identified as "columns," the system calculates the aspect ratio of their bounding box. If this aspect ratio is not within the preset range of 0.7 to 1.5, it is judged as a misidentification and is discarded. Rule 2 (Beam Topological Verification): For an identified slender component in the horizontal or vertical direction (with an aspect ratio greater than 5.0), the system checks the two endpoint regions of the bounding box. If the bounding boxes of the two end regions intersect the bounding boxes of two components already identified as "columns" in terms of pixel distance, or the shortest distance is less than 10 pixels, then the category of the component will be forcibly corrected or identified as a "beam". Rule 3 (Wall Connection Correction): After completing the preliminary size conversion based on the extracted scale, if a component is initially identified as a "beam", but its length exceeds a preset threshold (e.g., corresponding to an actual size of 2000mm), and one of its long sides continuously overlaps with the bounding box of another component already identified as a "wall" (overlap rate exceeding 80%), then the system will correct its category to "wall". This process effectively filters out abnormal recognition results caused by image noise, occlusion, or model misjudgment, improving the accuracy and reliability of the final component element list. The construction principle of the engineering knowledge base is to simulate the review logic of structural engineers, transforming the universal requirements of national architectural drawing standards (such as GB / T 50001-2017) and structural design codes regarding component dimensions, positional relationships, and connection methods into deterministic logical rules that can be executed by a computer. The expansion of rules can follow this principle, continuously refining new verification logic and adding it to the knowledge base in response to typical identification errors that occur in practical applications.

[0045] After component classification is completed, the model enters the crucial geometric dimension calculation stage. Three key inputs are essential in this stage: 1) the drawing scale value extracted from the text recognition results (e.g., 100); 2) the pixel dimensions of the currently classified component on the background image (its bounding box width and height); and 3) the resolution set during image rendering (DPI, e.g., 300). The component's pixel dimensions and position coordinates are converted to their real-world physical dimensions and positions using the formula: Actual Size (mm) = (Pixel Size / Image DPI) × 25.4 × Scale Value.

[0046] Finally, the type, calculated actual size, and actual position coordinates of each component are encoded into a visual object descriptor containing geometric and category attributes. Each visual object descriptor corresponds to a component element entity, which together constitute the graphic recognition result.

[0047] The reliability of component identification is ensured by using object detection algorithms and convolutional neural network classification models. Combined with the scale in the drawing metadata, the geometric dimensions of the component elements are calculated, and the pixel units are converted into actual dimensions and actual position coordinates. This transforms the identification results into structured data that contains real-world measurements and can be directly used for engineering calculations.

[0048] Furthermore, the text recognition results and image recognition results are fused based on the visual spatial correspondence to form a structured drawing analysis result, which is then output in a standardized data format; this corresponds to step S5 above; the specific implementation process includes: The model receives image recognition results and structured text data as primary inputs and associates images with text through spatial proximity analysis. Specifically, the model traverses each component entity in the "image recognition results" and uses its position coordinates to search for spatially neighboring text entries in the structured text data. This search is achieved by calculating the Euclidean distance between the component's bounding box and the text's bounding box. Text with a distance less than a preset threshold is considered to be initially associated with the component element. The threshold is set to half the diagonal length of the component's bounding box, which effectively filters out most irrelevant annotations while ensuring recall.

[0049] Further, a visual spatial correspondence determination mechanism based on multi-factor association scoring is used to comprehensively evaluate the association strength between each component element and its surrounding candidate text annotations within a certain range. This comprehensively considers direction, layout rules, and semantic consistency. The text layout position is evaluated according to drafting standards to determine if it conforms to conventional practices, and a preliminary analysis is performed to determine whether the text content and component recognition type semantically match. The association score is calculated as follows: Association Score = Weight 1 × Distance Factor + Weight 2 × Direction Factor + Weight 3 × Semantic Factor. Where: 1) The distance factor is the Euclidean distance D between the center point (Cx, Cy) of the component bounding box and the center point (Tx, Ty) of the text bounding box. To eliminate the influence of drawing size differences, this distance is normalized using the diagonal length L of the component bounding box to obtain the normalized distance D. norm =D / L. Distance factor F dist Defined as the reciprocal of the normalized distance, with an upper limit set to avoid excessively large scores when the distances are too close, i.e., F dist =min(1.0, 1 / (D)) norm +ϵ)), where ϵ is a small constant to prevent the denominator from being zero (e.g., 10). −6); 2) The direction factor is set according to the engineering drawing specifications. Taking the center of the component boundary box as the origin, the relative orientation of the center point of the text boundary box is determined. If it is located directly below or to the right of the component, the direction factor is 1. If it is located in the internal area of ​​the component, the value is 0.8. If it is located in other positions, the value is 0.1; 3) The semantic factor is calculated through the built-in component-keyword association rule library. The rule library is stored in the form of a dictionary. The key is the component category and the value is the list of corresponding keyword regular expressions. Example: rule_base={beam: [KL, L, XJ, DL], column: [KZ, Z, GZ], wall: [Q, JQ]}; During calculation, the first letter of the text annotation is extracted as the content to be matched (such as extracting "KL" from "KL7(2A)"). Then, the rule base is traversed. If the content to be matched successfully matches any item in the keyword list corresponding to the component identification type (such as "beam"), the semantic factor F_semantic is set to 1.0; if the text content is not directly related to the component type but belongs to a general engineering term (such as concrete grade "C30"), the value is 0.5; if there is no match at all, the value is 0.1. Each text annotation is scored one by one with the surrounding component elements, and the text is further bound to the component element with the highest score and a total score greater than 0.7. The weight coefficients are set to ensure that the text annotations that are spatially closest and reasonably laid out are prioritized for association. Therefore, the distance factor is the strongest indicator of association; the direction factor is based on the drawing specifications and is an auxiliary judgment basis; the semantic factor is used to verify and eliminate ambiguity. In this embodiment, weight 1 is set to 0.5, weight 2 is set to 0.3, and weight 3 is set to 0.2. Those skilled in the art will understand that when dealing with drawings with unique annotation styles, adjustments can be made based on this reference configuration. For example, for drawings with irregular annotation positions, weight 2 can be appropriately reduced, while weights 1 and 3 can be increased accordingly to adapt to the specific situation. This matching strategy effectively resolves potential fuzzy correspondences between annotation information and component entities, ensuring the accuracy of attribute associations.

[0050] After initial association, the system applies a rule- and pattern-matching semantic parsing engine to the candidate text. This engine incorporates annotation specifications for different component types. Taking a typical frame beam annotation text, “KL7(2A); 300x700; N2Φ25; G4Φ14; Φ10@100 / 200(2)”, as an example, the engine's parsing process is step-by-step. First, by applying the regular expression ([AZ]+)(\d+)\s*\(?([\dA-Z]+)\)?\s*(\d+)x(\d+) to match the beginning of the text, the basic information of the component is parsed, successfully capturing the component type as “KL” (frame beam), number as “7”, span as “(2A)”, and cross-sectional dimensions as 300mm x 700mm. Next, using semicolons as delimiters, the remaining rebar annotation string is divided into multiple information segments, and its specific attributes are determined based on the starting character and keywords of each segment. For example, for the steel reinforcement description "N2Φ25" which begins with "N" (indicating torsion resistance) or a number, the regular expression (N?)(\d+)Φ(\d+) can be used to parse that it has torsion resistance, 2 bars, and a diameter of 25mm; for "G4Φ14" which begins with "G" (construction reinforcement), it can be parsed as side construction reinforcement, 4 bars, and a diameter of 14mm; for the stirrup information "Φ10@100 / 200(2)" which contains the "@" symbol, the regular expression Φ(\d+)@(\d+) / ?(\d+)?\((\d+)\) can be used to parse that the stirrup diameter is 10mm, the spacing in the reinforced zone is 100mm, the spacing in the unreinforced zone is 200mm, and the number of legs is 2. Finally, all the parsed information is integrated into a structured data object, which clearly records the type, number, size, and reinforcement information of the component, including detailed parameters such as torsion reinforcement, side reinforcement, and stirrups, and binds it as the final attribute to the corresponding beam entity. This forms a composite component element that is complete in information and rich in semantics.

[0051] All associated composite component elements are integrated into a unified, hierarchical data model to generate the final structured drawing analysis results. The drawing analysis results are usually output in JSON format, containing two main root nodes: 1) the drawing metadata root node, whose content (such as drawing name, drawing number, and scale) is generally derived from the text recognition results; 2) the component list root node, which contains a detailed list of all composite component elements. Each component element is an independent object that clearly records its type, actual physical dimensions, spatial coordinates, and all engineering attributes bound through semantic association.

[0052] Based on this structured drawing analysis, a standardized data interface, a RESTful API, is provided. This interface allows external third-party systems (such as BIM platforms, project management software, or compliance review systems) to obtain, query, and verify all structured data of the drawings by sending HTTP requests.

[0053] By using spatial proximity analysis, independent text annotations are semantically bound to their corresponding graphic element entities, ultimately forming a unified data model that is complete and hierarchically clear. More importantly, by providing standardized API interfaces, this structured data is made available to third-party systems, greatly enhancing data reusability and system integration capabilities, and breaking down data barriers between design, review, and construction.

[0054] This invention provides a method for extracting PDF drawing data based on intelligent recognition. Through a complete workflow encompassing parsing preprocessing, intelligent recognition, and fusion output, it successfully transforms PDF engineering drawings, considered static images, into machine-readable, analyzable, and usable structured drawing analysis results. This constructs a complete end-to-end automated processing flow independent of the internal structure of the drawings. By splitting the PDF drawings into structured text and standardized images, and extracting metadata such as scale bars and identifying component elements separately, the actual physical dimensions of the components are calculated, giving the output data direct engineering application value. Secondly, by rendering vector paths and raster images, a standardized background image is obtained as the basis for recognition, reducing reliance on variable structures such as internal layers of the PDF drawings. This method demonstrates good robustness and universality for drawings from various sources with varying quality. Finally, by fusing processing based on visual spatial correspondences, isolated graphic and textual information is associated, achieving an improvement from simple content recognition to deep engineering semantic understanding.

[0055] Example 2 This embodiment aims to specifically illustrate the workflow of the drawing visualization module in the application of architectural construction review; see reference Figure 2 and Figure 3 The specific implementation method is as follows: The system received a drawing file named SZ-JG-01.pdf. The drawing image module started and executed step S1: its internal PDF parsing sub-model used the PyMuPDF library to perform low-level parsing of the file and successfully extracted three types of raw data: 1) raw text stream, including characters such as "First Floor Column Plan", "Structure-01", "1:100" in the title bar and the text label "KZ-1 (500x500)" in the drawing, as well as their initial position information; 2) vector paths, which are the mathematical descriptions of geometric objects such as straight lines and curves that make up all structural columns, grid lines and dimension lines; 3) raster images, such as the institute logo that may exist in the drawing.

[0056] The raw data is preprocessed in a split manner: For the graphics processing path, the extracted vector paths and raster images are rendered to generate a high-resolution background image with a resolution of 300 DPI and a pixel size of 10033x7096. Then, OpenCV is used to perform a series of enhancement operations on this background image, including denoising and binarization, and line optimization is implemented on the structural column outlines to ensure their geometric integrity. For the text processing path, the native text stream is processed simultaneously. If there is text that was converted to curves during PDF export, the module will call the OCR engine to recognize and restore it. The recognized text, along with its corresponding coordinates, is merged with the original native text stream, and duplicate content is removed, ultimately forming a complete structured text data, which is a list containing multiple text objects. An example is as follows: {text: KZ-1(500x500), bbox: [x1, y1, x2, y2], font_size: 12.0, source: native}.

[0057] The module outputs two independent and structured datasets: one dataset contains all the visual information, i.e., the background image; while the other dataset covers all the text-related information and is presented in the form of structured text.

[0058] Example 3 This embodiment builds upon the output of the previous embodiment, specifically illustrating how the drawing content visual recognition module processes background images and structured text data; see reference Figure 3 The specific implementation method is as follows: The module first sends the structured text data and background image into the corresponding sub-models for processing.

[0059] The text recognition and extraction submodel first receives "structured text data". It intelligently limits the recognition range to a specific area at the bottom right corner of the image in accordance with the specifications for the title block position in the national standard "Technical Drawings". Within this area, the model uses NLP technology for keyword matching, for example, to locate text labels such as "drawing name" and "scale". Once a label is found, the corresponding regular expression rule is triggered for extraction. For example, near the "scale" label, a regular expression is applied to capture the key value "1:100". After processing, all metadata is integrated, and a text recognition result is finally output, which is in JSON format, a structured set of key-value pairs that clearly records the drawing metadata and its page position: {drawing_name: {text: First-floor Column Layout Plan, bbox: [x1, y1, x2, y2]}, drawing_number: {text: Structure-01, bbox: [x1, y1, x2, y2]}, scale: {value: 100, text: 1:100, bbox: [x1, y1, x2, y2]}}. While outputting this result, the extracted scale value (for example, 100) and the image rendering DPI value (for example, 300) are used as parameters and immediately transmitted to the graphics element recognition and classification submodel that is processed in parallel.

[0060] Meanwhile, the graphic element recognition and classification sub-model begins processing the "background image." This sub-model employs a convolutional neural network (CNN) based on the YOLOv5 architecture and pre-trained deep on a large architectural drawing dataset. The network efficiently scans the entire image, quickly identifying the rectangular geometric features of all suspected components and generating candidate bounding boxes. Thanks to custom anchor boxes optimized for engineering drawings and the Focal Loss loss function, the model can effectively detect components of different sizes. Subsequently, the classifier analyzes the image slices within each bounding box and outputs a vector containing the category and confidence score. For example, the column graphic corresponding to "KZ-1" in the image is identified as "[column, 0.98]", indicating that the model has a 98% confidence that it is a column. All recognition results with a confidence score higher than a preset threshold (e.g., 0.8) are retained, and their pixel size (e.g., 60x60 pixels) and position on the background image are recorded. Based on the scale "1:100" in the text recognition results and the image DPI value (300), the size of the components in the graphic recognition results is converted. For example, for a column with a pixel size of 60x60 pixels, its actual physical size is calculated as (60 / 300)*25.4*100≈508mm. The system matches the calculated size with a standard size table. Automatic correction is performed only when the error between the calculated value and a certain standard value is within a preset tolerance threshold (e.g., ±5%), resulting in a final size of 500mm. If the error exceeds this threshold, the original calculated value is retained, and the component is marked for manual review. The "standard size table" is a key-value pair database associated with component categories. Its data structure is as follows: the component category (e.g., "column" or "beam") is the primary key, and the values ​​are a list sorted by size from smallest to largest, containing common standard sizes (unit: mm) for that category. For example, for a "column," the corresponding list is [200, 250, 300, 400, 500, 600, ...]; for a "beam," the width list is [200, 250, 300, 350, ...], and the height list is [400, 500, 600, 700, ...]. The matching and correction process is as follows: First, select the corresponding standard size list based on the identified component category. Then, compare the calculated component dimensions (e.g., width W_calc, height H_calc) with the standard values ​​in the list. For the width W_calc, find the standard value W_std with the smallest absolute difference in the list. If |W_calc-W_std| / W_std is less than a preset tolerance threshold (e.g., 5%), the final width of the component is corrected to W_std. The correction process for the height is the same. If the error of any dimension exceeds the threshold, no correction is performed.Ultimately, the image recognition result output by this sub-model is a visual object descriptor containing the actual physical size and location, for example: {category: column, confidence: 0.98, actual_dimensions: 500mmx500mm, actual_coordinates: [x, y]}.

[0061] Example 4 This embodiment is the final step in the entire process, detailing how the information space association module transforms the results of the previous stage into the final application data; see reference Figure 3 The specific implementation method is as follows: After the module receives the text recognition result and the graphic recognition result, it immediately starts data fusion processing. First, the module performs matching work in terms of space and semantics. By specifically calculating the proximity of coordinates, it detects that the text label KZ-1(500x500) is closely adjacent to the bounding box of the column, and then binds the number KZ-1 and the dimension 500x500 as attributes to the entity corresponding to the column. After traversing all components, the module successfully constructs a unified and hierarchical structured drawing analysis result. This object has a metadata root node for storing information such as drawing name, drawing number, and scale; there is also a component list root node, whose list contains detailed information of all columns, for example, in the format of {Type: Column, Number: KZ-1, Actual Dimension: 500mmx500mm, Position Coordinate: [x, y]}. Based on this complete and structured drawing analysis result, the module encapsulates it and provides a standardized RESTful API interface. Third-party BIM software or engineering quantity statistics systems can directly obtain the data of all columns on the drawing by sending a request to call this interface. Example: {metadata: {source_file: SZ-JG-01.pdf, drawing_name: First Floor Column Position Plan, drawing_number: Structure-01, scale: 100, render_dpi: 300}, components: [{id: comp_uuid_001, category: Column, label: KZ-1, bbox_pixel: [1520, 3150, 1580, 3210], location_world_mm: {center_x: 13136.6, center_y: 26987.5}, dimensions_world_mm: {width: 500, height: 500}, attributes: {dimension_text: 500x500, related_texts: [{text: KZ-1(500x500), bbox_pixel: [1500, 3165, 1750, 3195]}]}]}}. In this example, the metadata node stores the global metadata of the drawing. The components array contains all identified component objects.Each object has a unique id; category is the component type; label is the main number associated with it; bbox_pixel is the pixel bounding box of the component on a 300 DPI background image; location_world_mm and dimensions_world_mm are the real-world physical coordinates (center point) and dimensions obtained by converting the scale; the attributes node is used to store all detailed attributes bound by semantic associations.

[0062] The drawing visualization module acts as the data source, and its parsing and image enhancement functions provide complete and high-quality standardized data for subsequent processing. This standardized data enters the drawing content visual recognition module, where the deep learning models have clear divisions of labor, extracting textual metadata and graphic component data respectively, achieving the key transformation from visual information to preliminary structured data. The information spatial association module intelligently integrates the results of the first two modules at the spatial and semantic levels, forming a unified data object, and seamlessly connects this engineering-valued data to third-party systems through standard API interfaces. This modular design ensures that each part of the system has clear responsibilities, can be independently optimized and iterated, and also ensures the smooth and efficient data processing flow. The parsing preprocessing module is responsible for ensuring input quality, the intelligent recognition module extracts information in parallel, and the data fusion module completes the integration and semantic processing of the data. This collaborative system architecture ensures that the conversion from the original PDF drawings to the final semantic dataset can be automated, efficient, and stable and reliable.

[0063] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for extracting PDF drawing data based on intelligent recognition, characterized in that, include: The PDF parsing model is used to extract the internal structure of PDF engineering drawings, resulting in the original text stream, vector paths, and raster images. The preprocessing framework uses a split-processing approach to perform optical character recognition (OCR) on the text portions of the original text stream that exist in the form of curves and vector paths. For text represented by a large number of short vector line segments, an OCR engine is applied to recognize the characters, converting them into text strings and corresponding bounding box coordinates to obtain the corresponding character codes. The corresponding character codes are then merged with the original text stream to form structured text data. A blank canvas with a preset resolution is created, and the vector paths and raster images are rendered. Drawing is performed on the canvas according to the drawing instructions of the vector paths. The raster image is placed on the canvas according to the coordinates. The generated canvas image is then processed to obtain the background image. A deep learning-based intelligent recognition model is constructed. Through a text recognition and extraction sub-model, content analysis and matching are performed on structured text data to obtain drawing metadata, including drawing title, drawing number, and scale, and the location is recorded to obtain the text recognition results. The extracted scale value and image rendering resolution parameters are output and temporarily stored. Through a graphic element recognition and classification sub-model, pixel-level analysis is performed on the background image to identify and classify component elements, including walls, beams, and columns. The temporarily stored scale value and image rendering resolution parameters are read and converted to obtain preliminary actual dimensions. Geometric dimensions are calculated based on the scale, and a preset standard dimension table for the corresponding component element type is simultaneously called to perform tolerance matching on the preliminary actual dimensions: when the error between the preliminary actual dimensions and a certain standard dimension in the standard dimension table is within a preset tolerance threshold, automatic correction is performed, and the standard dimension is used as the actual dimension. When the error exceeds the preset tolerance threshold, the preliminary actual size is retained; Determine the type, size, and component element positions to obtain the graphic recognition results; The text recognition results and image recognition results are fused based on the visual spatial correspondence. The spatial distance between the component bounding box and the text bounding box is calculated. Text with a distance less than a preset distance threshold is considered to be initially associated with the component element. For the initially associated text, an association score is calculated based on the weighted sum of distance factor, direction factor, semantic factor, and corresponding weights. The text is then bound to the component element with the highest score and a total score greater than a preset score threshold to complete attribute annotation and obtain composite component elements. The composite component elements are combined into structured drawing analysis results and output in a standardized data format.

2. The method for extracting PDF drawing data based on intelligent recognition according to claim 1, characterized in that, The PDF parsing model specifically includes: The PDF parsing model includes a PDF parsing sub-model and a preprocessing sub-model. The PDF parsing sub-model is used to parse the internal structure of PDF engineering drawings to obtain the original text stream, vector path and raster image. The preprocessing sub-model uses a split preprocessing framework to perform optical character recognition on the text portions in the original text stream that exist in the form of curves, restore them to character encoding, and form structured text data; the vector path and raster image are enhanced, denoised, and normalized to obtain a standardized background image.

3. The method for extracting PDF drawing data based on intelligent recognition according to claim 1, characterized in that, The specific process for generating the text recognition results includes: Based on pre-defined drawing layout specifications, layout analysis is performed on PDF engineering drawings to locate the coordinate range of the metadata area, including the title block and drawing frame. Text entries whose coordinates fall within the coordinate range of the metadata area are filtered from the structured text data. Using pre-defined drawing metadata keywords and their regular expressions, the filtered text entries are matched to extract the drawing metadata of the PDF engineering drawing, including the drawing name, drawing number, and scale. The image position coordinates corresponding to the identified drawing name, drawing number, and scale are recorded to form the text recognition result.

4. The method for extracting PDF drawing data based on intelligent recognition according to claim 1, characterized in that, The specific process for obtaining the image recognition result includes: The background image is processed using an object detection algorithm to identify and locate candidate component elements. A convolutional neural network classification model is used to filter the bounding box set, generating a bounding box set containing candidate component elements. A pre-trained visual feature classifier is used to classify each candidate component element into a specific type, and graphic elements that do not belong to the predetermined component list are filtered out to obtain the component elements. The geometric dimensions of the component elements are calculated using the scale in the drawing metadata. Based on the pixel size and position coordinates of the component elements in the background image, the actual size and actual position coordinates of the component elements are calculated. The determined component element type, actual size, and actual position coordinates are encoded into visual object descriptors containing geometric and category attributes. Each visual object descriptor corresponds to a component element entity, which together constitute the graphic recognition result.

5. The method for extracting PDF drawing data based on intelligent recognition according to claim 1, characterized in that, The specific process for generating the structured drawing analysis results includes: Based on the position coordinates and actual position coordinates in the text recognition results and the image recognition results, a visual spatial correspondence is established between component elements and related text annotations; the structured text data describing the size, material, and number of the component elements is semantically associated with the corresponding component elements according to the visual spatial correspondence to complete attribute annotation and obtain composite component elements; the composite component elements are organized into structured drawing analysis results; the structured drawing analysis results include a drawing metadata root node and a component list root node.

6. A PDF drawing data extraction system based on intelligent recognition, characterized in that, include: Drawing Image Conversion Module: This module extracts the internal structure of PDF engineering drawings using a PDF parsing model, obtaining the original text stream, vector paths, and raster images. A preprocessing framework is used to perform optical character recognition (OCR) on the text portions of the original text stream that appear as curves and vector paths. For text represented by numerous short vector line segments, an OCR engine is applied to recognize the characters, converting them into text strings and corresponding bounding box coordinates, resulting in the corresponding character codes. These character codes are then merged with the original text stream to form structured text data. A blank canvas with a preset resolution is created, and the vector paths and raster images are rendered. Drawing is performed on the canvas according to the vector path drawing instructions. The raster image is placed on the canvas according to its coordinates. The generated canvas image is then processed to obtain the background image. Drawing Content Visual Recognition Module: Constructs a deep learning-based intelligent recognition model. Through a text recognition and extraction sub-model, it performs content analysis and matching on structured text data, obtains drawing metadata including drawing title, drawing number, and scale, and records the location to obtain text recognition results. It outputs and temporarily stores the extracted scale value and image rendering resolution parameters. Through a graphic element recognition and classification sub-model, it performs pixel-level analysis on the background image, identifies and classifies component elements including walls, beams, and columns, reads the temporarily stored scale value and image rendering resolution parameters, performs numerical conversion to obtain preliminary actual dimensions, and performs geometric dimension calculations in conjunction with the scale. Simultaneously, it calls the preset standard dimension table for the corresponding component element type to perform tolerance matching on the preliminary actual dimensions: when the error between the preliminary actual dimensions and a certain standard dimension in the standard dimension table is within the preset tolerance threshold, it performs automatic correction and uses the standard dimension as the actual dimension. When the error exceeds the preset tolerance threshold, the preliminary actual size is retained; Determine the type, size, and component element positions to obtain the graphic recognition results; Information Spatial Association Module: The text recognition results and image recognition results are fused according to the visual spatial correspondence, the spatial distance between the component bounding box and the text bounding box is calculated, and the text with a distance less than a preset distance threshold is regarded as initially associated with the component element; For the initially associated text, an association score is calculated based on the weighted sum of distance factor, direction factor, semantic factor, and corresponding weights. The text is then bound to the component element with the highest score and a total score greater than a preset score threshold to complete attribute annotation and obtain composite component elements. The composite component elements are combined into structured drawing analysis results and output in a standardized data format.

Citation Information

Patent Citations

  • Method for realizing efficient semantic understanding of PDF (Portable Document Format) text by using deep learning

    CN119360398A