Ocr visual perception and structured analysis method, device, equipment and medium
By preprocessing, partitioning, and recognizing differentiated characters in industrial purchase orders, combined with table topology parsing and adaptive strategies, the problem of recognition accuracy and adaptability in the processing of complex documents by existing OCR technology is solved, and efficient structured data output is achieved.
Patent Information
- Application Number
- CN202611142471.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2046-07-30
AI Technical Summary
Existing OCR technology cannot effectively handle the interference features, layout features, and business features in complex industrial procurement documents, resulting in low recognition accuracy, content disorder, and insufficient adaptive capabilities, and is unable to output standardized structured data.
By preprocessing and visually enhancing document images, performing layout awareness and regional partitioning, recognizing differentiated characters in different regions, and performing complex table topology parsing on standard and borderless table areas, the final result is global content logic reorganization and business structured output, combined with adaptive strategy control.
It has achieved the repair of image interference such as seals and stains, solved the problem of parsing disorder in multi-column layout and frameless/page-crossing tables, adapted to multilingual documents, automatically verified data and marked field credibility, reduced manual processing costs, and supported batch high-concurrency processing of industrial procurement documents.
Smart Images

Figure CN122657908B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to an OCR visual perception and structured analysis method, apparatus, device and medium. Background Technology
[0002] Currently, mainstream document parsing solutions in the industry fall into three categories: PP-OCR-VL, a lightweight visual language general-purpose model; MinerU, an open-source document parsing framework; and traditional general-purpose OCR recognition algorithms. PP-OCR-VL and MinerU both adopt a general end-to-end integrated model architecture, equipped only with general image preprocessing logic, relying on a globally unified recognition strategy to complete text extraction, and using basic geometric line detection to restore standard-format tables. Traditional general-purpose OCR only has basic character detection and recognition capabilities, lacking layout partitioning and table parsing logic. All three existing solutions can only output Markdown, HTML-formatted text, or unordered pure text streams, lacking dedicated optimization logic for vertical industry documents, and lacking an integrated customized processing chain for document interference, special tables, and structured business output.
[0003] Current mainstream technologies are all designed for general document parsing, without building dedicated processing chains for the interference characteristics, layout characteristics, and business characteristics of complex industrial procurement documents. Regarding image anti-interference, existing solutions use general image preprocessing logic, without specific optimization for document-specific issues such as red stamp obscuring, scan color distortion, paper creases, stains, and glare from photographs. Stamps covering key fields commonly result in missing characters, misspellings, and garbled characters, and low-quality scanned documents show a significant decrease in recognition accuracy. Regarding page layout, existing solutions use a globally unified recognition mode, which easily leads to text order disorder, content interleaving, and layout illusions when dealing with multi-column mixed layouts, interlaced text and images, and cross-page layouts. Regarding table parsing, existing solutions only adapt to standard, well-organized tables, and suffer from row and column disorder, cell content splitting, and severe logical loss when dealing with borderless implicit tables, cross-page split tables, and tables with incomplete lines. In terms of adaptive capabilities, existing solutions all use fixed inference parameters and cannot dynamically adjust processing strategies based on document business type, layout features, language features, and interference features. When faced with mixed documents of multiple categories, multiple layouts, and multiple languages, different models can only be switched or parameters can be manually adjusted.
[0004] Therefore, how to implement an integrated and customized OCR visual perception and structured parsing system for complex industrial procurement documents has become an urgent problem to be solved. Summary of the Invention
[0005] The main purpose of this application is to provide an OCR visual perception and structured analysis method, device, equipment and medium, aiming to solve the technical problem of how to construct an integrated OCR visual perception and structured analysis system.
[0006] To achieve the above objectives, this application proposes an OCR visual perception and structured parsing method, comprising: The input document image is preprocessed and visually enhanced to obtain the enhanced document image. The enhanced document image is subjected to layout awareness and region partitioning to obtain a set of partitioned regions, wherein the set of regions includes text regions, standard table regions, borderless table regions, stamp interference regions, and blank redundant regions. The region set is subjected to region-specific character recognition to obtain recognition text data with location attributes; Based on the identified text data, complex table topology parsing is performed on the standard table region and the borderless table region in the region set to obtain structured table data; The structured table data and the recognized text data are globally reorganized and associated with fields to obtain the logically reorganized content data; The logically reorganized content data is subjected to adaptive strategy control and business structured output to obtain standardized business structured data.
[0007] In one embodiment, the step of performing layout awareness and region partitioning on the enhanced document image to obtain a set of partitioned regions includes: The enhanced document image is divided into pixel-level regions based on visual feature clustering and layout rules to obtain an initial region set. The initial set of regions is analyzed for multi-column layout and mixed layout to obtain the coordinates, hierarchical order and reading priority of each region. The initial set of regions is marked with cross-page features based on region boundary characteristics and content continuity to obtain cross-page association identifiers and page connection codes; Based on the coordinates, hierarchical order, and reading priority of each region, as well as the cross-page association identifier and page connection code, the regions are integrated and sorted to obtain a set of partitioned regions.
[0008] In one embodiment, the step of performing region-specific differentiated character recognition on the region set to obtain recognition text data with location attributes includes: Based on the language type distribution of each region in the region set, the proportion of multilingual characters is calculated to obtain the language proportion analysis results. Based on the language proportion analysis results, the recognition weight and character library configuration of each region are dynamically adjusted to obtain differentiated recognition parameters; Based on the differential recognition parameters, language adaptation recognition is performed on the text regions in the region set to obtain the first recognized text data; Based on the differential recognition parameters, table-specific character recognition is performed on the standard table area and the borderless table area in the region set to obtain the second recognition text data; Based on the differential recognition parameters, anti-interference enhancement recognition is performed on the stamp interference regions in the region set to obtain third recognition text data; The first, second, and third identified text data are bound to the corresponding region coordinates, region type, page order, and cross-page identifier to obtain identified text data with location attributes.
[0009] In one embodiment, the step of performing complex table topology parsing on the standard table regions and borderless table regions in the region set based on the identified text data to obtain structured table data includes: Based on the cell text spacing, alignment rules, and content density in the identified text data, virtual lines are intelligently filled in the borderless table area to obtain the completed table data. Based on the line distribution characteristics and the relationship between adjacent cells in the identified text data, the missing lines in the standard table area are repaired to obtain repaired table data. Based on the identified text data and cross-page association identifier, the cross-page split table is seamlessly spliced and aligned with rows and columns to obtain spliced table data; Perform table geometry topology verification on the completed table data, repaired table data, and spliced table data to obtain the geometry topology verification result. The table geometry topology verification operation includes cell boundary closure, row and column alignment consistency, and grid structure integrity verification. Based on the semantic types of fields, business rule constraints, and table header field mapping relationships in the identified text data, the geometric topology verification results are subjected to business semantic topology verification to obtain business semantic topology verification results. The business semantic topology verification operations include field logical consistency, numerical range compliance, and cross-cell business association verification. Based on the geometric topology verification results and the business semantic topology verification results, the table areas with topological conflicts are adaptively corrected and rearranged to obtain structured table data.
[0010] In one embodiment, the step of performing global content logical reorganization and field association on the structured table data and the recognized text data to obtain logically reorganized content data includes: The identified text data is sorted according to the original page layout, area hierarchy, and reading priority to obtain ordered text data; Global content concatenation is performed based on the ordered text data and the structured table data to obtain semantically ordered reorganized data; Based on the cross-page association identifier and page connection code, the semantic order reorganization data is connected and merged across pages to obtain the content data after cross-page merging; Perform cross-page table data consistency verification on the content data after cross-page merging to obtain the consistency verification result; Based on the consistency verification results, the cross-page table content with data conflicts is corrected and completed to obtain the corrected content data. The corrected content data is then subjected to business field differentiation, semantic association mapping, and field association to obtain logically reorganized content data.
[0011] In one embodiment, the step of adaptively adjusting and structurally outputting the logically reorganized content data based on the core features of the document to obtain standardized business structured data includes: The document feature input data is obtained by acquiring six core features: document business type, page structure, language type, table format, seal location, and core field type. Based on the document feature input data, the image preprocessing parameters, page layout strategy, recognition weight and table parsing logic are dynamically adjusted to obtain the adjusted processing parameters. Based on the adjusted processing parameters, the logically reorganized content data is labeled with business field credibility levels to obtain field data with credibility levels. Risk source tracing and location are performed based on the low-confidence fields and abnormal fields in the field data with confidence levels to obtain risk source tracing information; Based on the risk tracing information, the field data with the credibility level is corrected with a prompt mark and credibility downgraded to obtain the corrected field data; The modified field data is standardized and encapsulated according to the business field specifications, and a multi-level business semantic tree structure is output to obtain standardized business structured data.
[0012] In one embodiment, the step of standardizing and encapsulating the modified field data according to the business field specification and outputting it as a multi-level business semantic tree structure to obtain standardized business structured data includes: Based on the business field specifications, the revised field data is categorized by field type and standardized in format to obtain standardized field data. Based on the business hierarchy and field dependency rules in the document business metadata, a multi-level business semantic tree framework is constructed to obtain a semantic tree structure template. The standardized field data is input into the corresponding node of the semantic tree structure template according to the business semantic relationship to obtain the initial business semantic tree data; Perform node integrity verification and hierarchical logic consistency verification on the initial business semantic tree data to obtain the semantic tree verification result; Based on the semantic tree verification results, missing nodes and logically conflicting nodes are adaptively completed and corrected to obtain optimized business semantic tree data. The optimized business semantic tree data is standardized and packaged for output, and the batch document features and corresponding optimal parameters are stored in the parameter optimization library to obtain standardized business structured data.
[0013] Furthermore, to achieve the above objectives, this application also proposes an OCR visual perception and structured analysis device, which includes: The processing module is used to preprocess and visually enhance the input document image to obtain the enhanced document image. The partitioning module is used to perform layout awareness and region partitioning on the enhanced document image to obtain a set of partitioned regions, wherein the set of regions includes text regions, standard table regions, borderless table regions, stamp interference regions, and blank redundant regions. The recognition module is used to perform regional differentiated character recognition on the set of regions to obtain recognition text data with location attributes; The parsing module is used to perform complex table topology parsing on the standard table area and the borderless table area in the region set based on the identified text data, so as to obtain structured table data; The reorganization module is used to perform global content logical reorganization and field association on the structured table data and the recognized text data to obtain logically reorganized content data; The results module is used to adaptively adjust the content data after logical reorganization and output it in a business structured manner to obtain standardized business structured data.
[0014] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the OCR visual perception and structured parsing method described above.
[0015] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the OCR visual perception and structured parsing method described above.
[0016] This application achieves character recognition by sequentially enhancing document image preprocessing, finely partitioning multiple layout types, and differentiating characters by region; it then performs topological parsing on various tables based on the recognized data, reorganizing global content and associating it with business fields; and it adaptively adjusts all process parameters based on document characteristics to output standardized structured data. It can repair image interference such as stamps and stains, resolve parsing errors in multi-column layouts and borderless / page-crossing tables, adapt to multilingual documents, automatically verify data and label field credibility, eliminating the need for manual parameter adjustment and reducing the labor cost of document digitization, and supporting high-concurrency batch processing of industrial procurement documents. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating the first embodiment of the OCR visual perception and structured analysis method of this application; Figure 2 This is a flowchart illustrating the second embodiment of the OCR visual perception and structured analysis method of this application; Figure 3 This is a schematic diagram of the module structure of the OCR visual perception and structured analysis device of this application; Figure 4 This is a schematic diagram of the device structure of the hardware operating environment involved in the OCR visual perception and structured analysis method in the embodiments of this application.
[0019] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0020] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0021] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0022] Industrial procurement scenarios often involve numerous bilingual business documents with obscured seals, blurred text due to creases, mixed multi-column layouts, and borderless / spread-out tables. The industry commonly uses PP-OCR-VL, MinerU, and traditional general-purpose OCR for parsing. These general solutions require specialized preprocessing to remove seals, and multi-column documents are prone to readability issues. Relying solely on geometric lines to parse tables fails to correct topological errors in borderless or spread-out tables. Furthermore, the models use fixed inference parameters, making them unsuitable for adapting to multiple document types, and only output formatted text, necessitating extensive manual proofreading and editing.
[0023] Based on the above, this application also provides an OCR visual perception and structured parsing method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the OCR visual perception and structured parsing method of this application. This embodiment uses industrial purchase orders as a specific application scenario for explanation. Industrial purchase orders include purchase orders, supplier quotations, goods receipt and acceptance slips, warehouse entry slips, and account reconciliation statements, and are widely used in supply chain management in industries such as manufacturing, energy, chemicals, and construction. These documents typically contain core fields such as supplier information, material codes, specifications, quantity, unit price, amount, delivery date, and payment terms, and generally exhibit complex and interfering features such as seals across the binding, handwritten annotations, tables spanning multiple pages, and multi-copy forms.
[0024] In this embodiment, the OCR visual perception and structured parsing method includes steps S10 to S60: Step S10: Preprocess and visually enhance the input document image to obtain the enhanced document image.
[0025] It should be noted that preprocessing refers to a multi-level repair mechanism built to address image defects specific to industrial purchase orders (stamp obstruction, creases, color cast, low resolution), which differs from the fixed preprocessing logic of general optical character recognition. Visual enhancement refers to the process of improving image quality through geometric correction, noise suppression, and contrast stretching, laying the foundation for subsequent high-precision recognition.
[0026] Further, step S10 includes: First, performing pre-detection of image defects on the input document image to identify geometric distortion, noise interference, seal coverage, blurring and degradation, and color cast areas, and obtaining defect detection results. Specifically, first, geometric distortion detection is performed on the input document image. Image edges are extracted using the Canny edge detection operator with a Gaussian kernel size of 3×3, and low and high thresholds of 50 and 150, respectively. Hough transform is used to detect straight line segments and calculate the tilt angle distribution. When the tilt angle variance exceeds 5° or there are obvious perspective distortion features, geometric distortion is determined to exist. Next, noise interference detection is performed. The image is divided into local windows of 32×32 to 64×64 pixels, and the local variance and Laplacian response value of each window are calculated. When the local variance is less than 100 and the Laplacian response value is less than 50, the defect is considered to exist. The system first determines if noise interference or blurring / degradation exists in the area. Then, it performs stamp coverage detection by thresholding the red channel in the HSV color space, with hue ranges of 0 to 10 and 170 to 180, saturation greater than 0.3, and brightness greater than 0.2. The percentage of pixels meeting the conditions is counted, and stamp coverage is determined when the percentage exceeds 0.05. Finally, color cast detection is performed by calculating the mean distribution of the image in the RGB three channels. Color cast is determined when the deviation between the mean of a certain channel and the mean of grayscale exceeds 20 grayscale levels. The types, locations, and severity scores of various defects are summarized into the defect detection results.
[0027] Secondly, based on the defect detection results, differentiated enhancement strategies and processing priorities are determined, resulting in preprocessing scheduling parameters. Specifically, firstly, the combination and severity of defect types in the defect detection results are analyzed to establish a defect priority matrix. Geometric distortion and stamp coverage have a significant impact on recognition accuracy and are given high priority; color cast and blurring degradation have a moderate impact and are given medium priority; and general noise interference has a relatively small impact and is given low priority. Next, the processing order is determined based on the priority matrix. When multiple defects exist simultaneously, the processing is performed in the following order: geometric correction, noise suppression, stamp repair, and finally sharpening enhancement, to avoid secondary damage caused by improper processing order. Then, a corresponding processing algorithm and parameter template are matched for each defect type: geometric distortion corresponds to perspective transformation algorithm, noise interference corresponds to adaptive median filtering or bilateral filtering, stamp coverage corresponds to color channel separation and pixel repair, blurring degradation corresponds to deconvolution or sharpening enhancement, and color cast corresponds to white balance correction or color channel equalization. Finally, the processing order, algorithm selection, and parameter configuration are encapsulated into preprocessing scheduling parameters, including execution flags (0 or 1), algorithm identifiers, and core parameter values for each stage.
[0028] Next, the input document image is geometrically corrected and subjected to multi-level noise suppression based on the preprocessing scheduling parameters to obtain the corrected and denoised document image. Specifically, firstly, the system determines whether to perform geometric correction based on the geometric correction flag in the preprocessing scheduling parameters. If the flag is 1, the document's quadrilateral boundaries are extracted through contour detection, and the perspective transformation matrix of the four corner points is calculated to map the image to a standard rectangular viewpoint, with the output resolution uniformly set to 300 DPI. Next, a filtering strategy is selected based on the noise type identification results. Adaptive median filtering is used for scanning noise and paper particles, with the filtering window size dynamically adjusted according to the noise density. The minimum window size is 3×3, and the maximum window size is 7×7. Window expansion stops when the difference between the median pixel and the center pixel within the window is less than 20 gray levels. Bilateral filtering is used for creases and stains, with a spatial domain standard deviation of 5 and a value domain standard deviation of 50, smoothing noise while preserving edge information. Then, the quality of the filtered image is evaluated by calculating the Laplacian variance to measure sharpness. When the variance value is below 100, it is marked as a blurred and degraded area for subsequent sharpening. Finally, the corrected and denoised document image is output, and the image quality indicators meet the basic requirements of the subsequent recognition process.
[0029] Then, based on the seal's color features, transparency features, coverage area, and text occlusion degree, the denoised document image is subjected to four-category differential layering repair of the seal and restoration of the underlying text, resulting in the document image after seal repair. It should be noted that four-category differential layering repair of the seal refers to a processing mechanism that classifies the seal into four categories based on its different attribute characteristics and applies corresponding repair strategies. In this example, the four categories include: high transparency with shallow coverage (transparency greater than 0.5, coverage area less than 0.1), low transparency with deep coverage (transparency less than 0.5, coverage area less than 0.1), large area with full coverage (coverage area greater than 0.1), and blurred edges (edge gradient less than 50). Specifically, the stamp area is first jointly analyzed in RGB and HSV dual color spaces. The proportion of red components is calculated in the RGB space, and hue, saturation, and brightness distribution are extracted in the HSV space. A stamp pixel classification model is established to distinguish the stamp area from the text area. Next, the stamp transparency features are calculated. The transparency parameter is estimated by analyzing the blending mode between the stamp area and the underlying text. When the stamp is in a semi-transparent overlay mode, a linear blending equation is solved based on background and foreground estimations, with the transparency parameter ranging from 0.3 to 0.8. Then, the proportion of the stamp-covered area to the total document area is statistically analyzed, and the degree of text occlusion is assessed. The degree of occlusion is determined by the stroke breakage rate and connectivity of the text within the covered area. Domain fragmentation is measured, and a fragmentation rate higher than 0.4 is considered severe occlusion. Differentiated repair is performed based on the four-class classification results. For high-transparency, shallow-coverage types, color suppression and contrast enhancement are used to reduce the saturation of the red channel and increase the contrast of the luminance channel. For low-transparency, deep-coverage types, pixel replacement and texture synthesis are used to generate replacement pixels based on the texture of neighboring text. For large-area full-coverage types, layer peeling and stroke reconstruction are used to first separate the stamp layer and then reconstruct the text based on the stroke direction field. For edge-blurred types, edge sharpening and deblurring are used to restore edge clarity through deconvolution. Finally, consistency is checked on the repaired area to ensure that the repaired text strokes are coherent, the structure is complete, and the style is consistent with the surrounding uncovered areas.
[0030] Finally, adaptive sharpening and contrast stretching are performed on the stamp-restored document image to obtain the enhanced document image. Specifically, firstly, local sharpness assessment is performed on the stamp-restored document image. The image is divided into 64×64 pixel local windows, and the Laplacian variance and mean gradient magnitude of each window are calculated to establish a sharpness distribution map. Then, adaptive sharpening parameters are determined based on the sharpness distribution map. For areas with sharpness below 100, the Unsharp Mask algorithm is used for enhancement, with a radius parameter of 1 to 3 pixels and a quantity parameter dynamically adjusted according to the degree of sharpness loss, ranging from 50% to 150%. The lower the sharpness, the higher the quantity parameter. For areas with sharpness above 200, the sharpening intensity is reduced or sharpening is skipped to avoid over-enhancement. Then, contrast stretching is performed using contrast-limited adaptive histogram equalization with a block size of 8×8 and a contrast limit crop value of 2.0, which enhances local contrast while suppressing noise amplification. Finally, a global quality assessment is performed on the enhanced image to ensure that the histogram distribution is reasonable and there are no oversaturated areas, and the enhanced document image is output.
[0031] Step S20: Perform layout awareness and region partitioning on the enhanced document image to obtain a set of partitioned regions.
[0032] It should be noted that the region set includes text regions, standard table regions, borderless table regions, stamp interference regions, and blank redundant regions. A text region refers to a region containing pure text content arranged in continuous lines. A standard table region refers to a table region with a clearly defined border structure. A borderless table region refers to an implicit table region where text is arranged in an array but lacks visible borders. A stamp interference region refers to a region covered by a stamp or where a stamp is located. A blank redundant region refers to a blank area or page margin area that does not contain valid information.
[0033] Further, step S20 includes: First, dividing the enhanced document image into pixel-level regions based on visual feature clustering and layout rules to obtain an initial region set. It should be noted that visual feature clustering refers to a method of grouping regions based on the color, texture, and shape features of image pixels. Layout rules refer to region classification criteria set based on prior knowledge of document layout. Specifically, the enhanced document image is first divided into pixel-level regions. After converting the image to grayscale, Otsu thresholding is used for binarization to separate the foreground and background. Discrete regions are extracted through connected component analysis. The area, aspect ratio, compactness, and edge density of each region are calculated. Regions with an area less than 100 pixels are filtered as noise. Regions with an aspect ratio greater than 10 are identified as line-like regions. Regions with a compactness less than 0.1 are identified as blank or redundant regions. Regions with an edge density greater than 0.3 and uniform internal texture are identified as stamp interference regions. Regions with a grid-like internal texture are identified as standard table regions. Regions with text arranged in rows and regular line spacing are identified as plain text content regions. Regions with text blocks distributed in an array but lacking obvious borders are identified as borderless table regions. This yields the initial region set.
[0034] Next, the initial set of regions is analyzed for multi-column and mixed layout, yielding the coordinates, hierarchical order, and reading priority of each region. It should be noted that multi-column layout refers to a layout structure where document content is divided into multiple independent reading columns horizontally. Mixed layout refers to a layout where images and text are interspersed. The original layout refers to the spatial distribution of regions within the document image on a two-dimensional plane. Region hierarchy refers to the hierarchical relationship of regions determined based on the importance of the document structure. Reading priority refers to the weight of the region reading order determined according to layout rules. Specifically, the initial set of regions is analyzed for multi-column and mixed layout, detecting the horizontal position distribution of each region. When multiple regions overlap vertically and the horizontal spacing is greater than 5 times the average character width, it is determined to be a multi-column layout. The left and right boundaries and reading order of each column are recorded. For mixed image and text regions, the hierarchical order is determined based on the enclosure relationship between the image and text regions. When an image region is above a text region, it has priority in hierarchy; when a text region is to the left of an image region, it has priority in reading. This yields the coordinates, hierarchical order, and reading priority of each region.
[0035] Then, based on the region boundary features and content continuity, the initial region set is marked with cross-page features to obtain cross-page association identifiers and page connection codes. Specifically, cross-page feature marking is performed based on region boundary features and content continuity. This includes detecting whether there is a table region truncation at the bottom of the current page (i.e., incomplete table bottom rows or unclosed cells), detecting whether there are unfinished sentences at the end of text paragraphs (using syntactic analysis to determine if the ending punctuation is a period or a terminator), and detecting whether there is a duplicate table header at the top of the next page with a similar table structure to the bottom of the current page (confirmed by header field similarity matching). Regions that meet the cross-page conditions are marked with cross-page association identifiers, a unique identifier is assigned to the cross-page content, and page connection codes are generated to record the association relationship between the current page and the pages before and after.
[0036] Finally, the regions are integrated and sorted based on their coordinates, hierarchical order, reading priority, cross-page association identifiers, and page connection codes to obtain a set of partitioned regions. Specifically, regions are integrated and sorted according to their coordinates, hierarchical order, reading priority, cross-page association identifiers, and page connection codes. Regions within the same level are arranged from high to low reading priority. Cross-page related regions are marked and merged to ensure that cross-page content is logically considered as a continuous whole, and the set of partitioned regions is output.
[0037] Step S30: Perform regional differentiated character recognition on the region set to obtain recognition text data with location attributes.
[0038] It should be noted that step S30 includes: First, calculating the proportion of multilingual characters based on the language type distribution of each region in the region set, and obtaining the language proportion analysis results. It is important to understand that language type distribution refers to the proportion of characters contained in each region of the region set in terms of language dimension. The multilingual character proportion refers to the ratio of the number of characters of different languages in a statistical region to the total number of characters. Specifically, first, the multilingual character proportion is calculated based on the language type distribution of each region in the region set. The image patches of each region are input into the language detection model, and the distribution of characters within the Unicode encoding range is statistically analyzed. Chinese characters are concentrated in the CJK Unified Ideograph segment (U+4E00 to U+9FFF), English characters are concentrated in the Basic Latin segment (U+0041 to U+007A), and numeric characters are concentrated in the Basic Latin segment (U+0030 to U+0039). The proportion is calculated based on the number of characters of each language, and the language proportion analysis results are obtained.
[0039] Secondly, based on the language proportion analysis results, the recognition weight and character library configuration of each region are dynamically adjusted to obtain differentiated recognition parameters. When the proportion of a single language exceeds 0.7, the recognition model for that language is switched to a specific model. When the proportion of both languages exceeds 0.2, the bilingual mixed recognition mode is enabled. The recognition weight of numbers and monetary symbols in the table region is strengthened, with a weight coefficient of 1.5 to 3.0. The anti-interference enhancement branch is enabled in the seal interference region. The input is the repaired image block, and the output is the character category probability distribution.
[0040] Next, language adaptation recognition is performed on the text regions in the region set according to the differential recognition parameters to obtain the first recognized text data. A deep convolutional network model matching the language type of the region is adopted. The input image block size is a preset value (32×32 to 64×64 pixels), and the output is a character category probability sequence.
[0041] Next, based on the differentiated recognition parameters, table-specific character recognition is performed on the standard table area and the borderless table area in the region set to obtain the second recognition text data. The weight coefficients of key fields such as numbers, amounts, and dates are added to the loss function to reduce the misrecognition rate caused by dense table layout. At the same time, the recognition results are spatially verified based on the table cell position constraints.
[0042] Then, based on the differential recognition parameters, anti-interference enhancement recognition is performed on the stamp interference region in the region set to obtain the third recognition text data. A deep convolutional network structure based on residual connections is adopted to increase the number of channels in the feature extraction layer. The number of channels is a preset value (256 to 512) to enhance the feature learning ability of blurred and occluded text.
[0043] Finally, the first, second, and third identified text data are bound to the corresponding region coordinates, region type, page order, and cross-page identifier to obtain identified text data with location attributes. The region coordinates record the bounding box coordinates of the region where the identified text is located, the region type records the region category, the page order records the page number index in the multi-page document, and the cross-page identifier records whether it belongs to cross-page continuation content.
[0044] Through the above steps, the character recognition accuracy in multilingual mixed scenarios is improved, the misrecognition rate of densely formatted tables is reduced, the recognition capability of stamp interference areas is enhanced, and the computational power consumption is reduced by skipping invalid areas, providing structured recognition results with positional attributes for subsequent table parsing and content reorganization.
[0045] Step S40: Perform complex table topology parsing on the standard table regions and borderless table regions in the region set based on the identified text data to obtain structured table data.
[0046] It should be noted that step S40 includes: First, based on the cell text spacing, alignment rules, and content density in the identified text data, virtual lines are intelligently used to complete the borderless table area, resulting in completed table data. It's important to understand that cell text spacing refers to the spatial distance between adjacent cell text blocks within the borderless table area. Alignment rules refer to the horizontal or vertical alignment pattern of the table cell content. Content density refers to the density of text distribution within the table area. Virtual line intelligent completion refers to the processing mechanism that infers and generates missing table borders based on the text position distribution characteristics. Specifically, the projection histograms of the text block in the horizontal and vertical directions are calculated. The projection peak positions correspond to the potential table line positions. The peak spacing is 0.8 to 1.5 times the average character width. Virtual lines are fitted at the peak positions. When the ratio of the horizontal projection peak spacing to the vertical projection peak spacing is greater than the preset threshold (3), it is determined to be a horizontal table header structure. When the ratio is less than the preset threshold (0.3), it is determined to be a vertical table header structure. When the ratio is between 0.3 and 3, it is determined to be a matrix structure. The extension direction and connection rules of the virtual lines are adjusted according to the determination results to construct a complete invisible grid structure.
[0047] Secondly, based on the line distribution characteristics and adjacent cell relationships in the identified text data, the missing lines in the standard table area are repaired to obtain the repaired table data. It's important to understand that line distribution characteristics refer to the position, length, and direction attributes of visible borders within the standard table area. Adjacent cell relationships refer to the cell connections established based on spatial proximity and content relevance. A split-page table refers to a table structure where content spans multiple pages. Specifically, the direction of the broken line is detected using Hough transform, and the line is extended 20 to 50 pixels along that direction. Adjacent cell relationships are matched by calculating cell content similarity and positional proximity. The similarity threshold is 0.6, and the proximity threshold is 1.5 times the average cell spacing. If a match is successful, the missing line is completed. When the content types of the cells on both sides of the broken line are the same (e.g., both are numbers or both are text), completion is prioritized; when the content types are inconsistent, the completion priority is reduced.
[0048] Next, based on the identified text data and cross-page association identifiers, the cross-page split tables are seamlessly spliced and aligned in rows and columns to obtain spliced table data. Specifically, the header fields are matched by calculating string similarity (edit distance or cosine similarity), with a similarity threshold of 0.85. Row and column dimensions are matched by comparing the number of columns and rows in the table. Cell position relationships are matched by coordinate alignment verification. When the number of columns in the cross-page segments is inconsistent, the missing columns are filled with empty cells based on the maximum number of columns. When the number of rows is inconsistent, alignment is performed based on the number of rows in the header, thus achieving seamless splicing, row and column alignment, and content merging of cross-page tables.
[0049] Next, perform a geometric topology check on the completed, repaired, and concatenated table data to obtain the geometric topology check results. The table geometric topology check operations include cell boundary closure check (checking for the existence of unclosed cell boundaries), row and column alignment consistency check (checking whether the cell boundaries in the same row or column are aligned), and grid structure integrity check (checking whether there are missing or broken grids in the table). When the cell boundary closure check fails, it is marked as a topology abnormal area. When the row and column alignment consistency deviation exceeds a preset threshold (5 pixels), it is marked as an alignment abnormal area.
[0050] Then, based on the semantic types of fields, business rule constraints, and mapping relationships of header fields in the identified text data, business semantic topology verification is performed on the geometric topology verification results to obtain the business semantic topology verification results. The business semantic topology verification operations include field logical consistency verification (checking whether the field content conforms to the preset business logic, such as whether the amount field is a numeric type), numeric range compliance verification (checking whether the numeric field is within the preset business range, such as whether the date field is within the valid date range), and cross-cell business association verification (checking the logical consistency between associated fields, such as whether the product of quantity and amount equals the total price). When the field semantic type does not match the preset template, it is marked as a semantic anomaly; when the value exceeds the preset range, it is marked as a numeric anomaly; and when the cross-cell association verification fails, it is marked as an association anomaly.
[0051] Finally, based on the geometric topology verification results and the business semantic topology verification results, the table areas with topological conflicts are adaptively corrected and rearranged to obtain structured table data. Specifically, when the geometric topology verification finds that the cell boundaries are not closed, the boundaries are extended or contracted based on the positions of adjacent cell boundaries. When the business semantic topology verification finds that the field types do not match, the field types are corrected or reclassified based on contextual semantic inference. When there are conflicts in the verification results, the business semantic topology verification result is given priority for correction. After correction, the table structure is rearranged to ensure that the row and column alignment and cell correspondence are correct, and the structured table data is output.
[0052] Step S50: Perform global content logical reorganization and field association on the structured table data and the recognized text data to obtain the logically reorganized content data.
[0053] It should be noted that step S50 includes: First, sorting the recognized text data according to the original layout, region hierarchy, and reading priority to obtain ordered text data. Specifically, regions within the same level are arranged from high to low reading priority. High-priority regions include titles and core field areas, while low-priority regions include notes and comments areas. For multi-column layouts, the left column is sorted before the right column; for mixed text and image layouts, the text is sorted before the images. The recognized text data is then reorganized according to the sorted region order to output ordered text data.
[0054] Secondly, global content concatenation is performed based on ordered text data and structured table data to obtain semantically ordered reorganized data. Specifically, text paragraphs in ordered text data and table content in structured table data are interleaved and concatenated according to their regional positional relationship. When a text paragraph is above a table, the text is output first and then the table; when a text paragraph is below a table, the table is output first and then the text. For tables nested within text, table content is inserted at the corresponding positions.
[0055] Next, based on the cross-page association identifier and page connection code, the semantically ordered reorganized data is combined and merged across pages to obtain the merged content data. Specifically, regions with the same cross-page association identifier are identified, cross-page text paragraphs are concatenated according to the order of page connection codes, and cross-page table data is merged according to the row and column alignment results. For cross-page tables, the first page header is used as the reference, and duplicate headers are removed from subsequent pages, and data rows are appended to the corresponding column positions.
[0056] Next, the content data after cross-page merging is subjected to cross-page table data consistency verification to obtain the consistency verification results. Specifically, header field matching is performed to compare the similarity of the header fields of the cross-page fragments, with a similarity threshold of 0.85. Numerical logic consistency verification is performed to check whether the numerical changes of the same fields in the cross-page fragments conform to business rules, such as whether the sum of the amounts equals the total price. Row and column dimension alignment verification is performed to compare whether the number of columns and rows in the cross-page fragments are consistent.
[0057] Then, based on the consistency check results, errors and completion are performed on the cross-page table content with data conflicts to obtain the corrected content data. Specifically, when the header field fails to match, the header with the highest similarity is used as the benchmark, and the differing fields are replaced or merged. When the numerical logical consistency check fails, abnormal values are marked and manual review is prompted. When the row and column dimensions are inconsistent, the missing columns are filled with empty cells based on the maximum number of columns, and the content of redundant columns is truncated or merged.
[0058] Finally, the corrected content data is differentiated by business fields, semantically mapped, and associated with fields to obtain logically reorganized content data. Specifically, business fields are differentiated based on document business type characteristics. For example, industrial purchase orders are differentiated by fields such as purchasing unit, sales unit, and amount. Semantic association mapping is performed based on a keyword library, mapping keywords such as "Total Amount" and "Amount Due" to the amount field, and keywords such as "Date of Issue" and "EffectiveDate" to the date field. Field association is performed based on location rules and contextual semantics to establish the correspondence between fields and business dimensions. For example, the contract number is associated with the signing date to the basic contract information dimension, and the product name is associated with the quantity and unit price to the goods details dimension.
[0059] Step S60 involves adaptively adjusting the content data after logical reorganization and outputting it in a structured business manner to obtain standardized structured business data.
[0060] It should be noted that adaptive strategy control refers to a processing mechanism that dynamically adjusts the processing parameters of each stage based on the core features of the document, which is different from the fixed inference parameter mode. Standardized business structured data refers to standardized data formats that are encapsulated according to business field specifications and can be directly read by business systems.
[0061] Specifically, firstly, six key features are extracted from the document: business type, layout structure, language type, table format, seal location, and core field type. These features are then combined with business metadata such as document number and upload channel to dynamically adjust the end-to-end processing parameters for image preprocessing, layout partitioning, character recognition, and table parsing, adapting to different document scenarios. Next, based on recognition confidence levels, each business field is assigned a confidence level. For low-confidence and abnormal fields, risk tracing is performed, marking sources of interference such as seal obstruction and image blurring, and providing confidence downgrade and correction prompts for the corresponding fields. Then, field formats are standardized and field types are categorized according to business specifications. A multi-level business semantic tree is built based on business hierarchy and field dependencies. Text and table data are filled into the corresponding semantic nodes, and the integrity of semantic tree nodes and hierarchical logical conflicts are simultaneously verified and automatically corrected. After completing the processing of a single batch of documents, the document characteristics and the optimal processing parameters are automatically stored in the local parameter optimization library. Subsequent documents of the same type can directly reuse the optimal strategy, and finally output standardized structured data with regular hierarchy and credibility and risk labels. This data can be directly connected to the business system for storage, greatly reducing the workload of manual proofreading, field organization and table reconstruction.
[0062] This embodiment sequentially enhances document image preprocessing, refines the partitioning of various layout types, and achieves differentiated character recognition across regions. Based on the recognized data, it performs topological parsing on various tables, reconstructs global content, and associates business fields. It adaptively adjusts all process parameters according to document characteristics, outputting standardized structured data. It can repair image interference such as stamps and stains, resolve parsing errors in multi-column layouts and borderless / page-crossing tables, adapt to multilingual documents, automatically verify data and label field credibility, eliminating the need for manual parameter adjustment and reducing the labor costs of document digitization. It also supports high-concurrency batch processing of industrial procurement documents.
[0063] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in Embodiment 1 above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 The OCR visual perception and structured parsing method step S60 further includes steps S201~S206: Step S201: Obtain the six core features of the document: business type, layout structure, language type, table format, seal location, and core field type, to obtain the document feature input data.
[0064] Specifically, the business type is determined by matching keywords in the document title or by page layout features. The page layout is determined by the number of areas and the arrangement pattern; the language type is determined by the distribution statistics of character encoding; the table format is determined by the proportion of table areas and line features; the seal position is determined by the distribution statistics of seal area coordinates; and the core field type is matched by the field keyword library.
[0065] Step S202: Dynamically adjust the image preprocessing parameters, page layout strategy, recognition weight and table parsing logic according to the document feature input data to obtain the adjusted processing parameters.
[0066] Specifically, when a document with mixed Chinese and English text is identified, a bilingual enhancement strategy is enabled; when a table without borders is identified, the number of iterations for virtual line completion logic is increased to 3 to 5; when a large area of stamp occlusion is identified, the image repair weight is increased to 1.2 to 2.0; and when a document spanning multiple pages is identified, the cross-page splicing link is enabled.
[0067] Step S203: Based on the adjusted processing parameters, the business field credibility level is marked on the logically reorganized content data to obtain field data with credibility level.
[0068] Specifically, the credibility level is determined based on the field identification confidence level, layout matching degree, and business rule compliance degree. When the identification confidence level is higher than 0.9, the layout matching degree is higher than 0.85, and the business rule is met, it is judged as high credibility. When the identification confidence level is between 0.7 and 0.9 or the layout matching degree is between 0.6 and 0.85, it is judged as medium credibility. When the identification confidence level is lower than 0.7, the layout matching degree is lower than 0.6, or the business rule is not met, it is judged as low credibility.
[0069] Step S204: Based on the low-confidence fields and abnormal fields in the field data with confidence levels, risk source tracing is performed to locate the source and obtain risk source information.
[0070] Specifically, the low-confidence field is traced back to the original image region, the specific location of the field in the image is marked, the recognition process is traced back to the recognition stage, the recognition model and parameter configuration used for the field are recorded, the parameter control stage is traced back to the parameter control stage, the value of the control parameter during the processing of the field is recorded, and the anomaly types are analyzed, including numerical anomalies, format anomalies and logical anomalies.
[0071] Step S205: Based on the risk tracing information, the field data with credibility level is marked with correction prompts and the credibility is downgraded to obtain the corrected field data.
[0072] Specifically, correction prompts are added to low-confidence fields, with the marking content including risk type, source location, and suggested handling method. Fields with numerical or logical anomalies are downgraded in confidence, from high confidence to medium confidence or from medium confidence to low confidence.
[0073] Step S206: Based on the business field specifications, the corrected field data is standardized and encapsulated, and a multi-level business semantic tree structure is output to obtain standardized business structured data.
[0074] It should be noted that business field specifications refer to the set of conventional field naming rules, data type requirements, and format standards in the industrial procurement and finance field. Multi-level business semantic tree structured output refers to an encapsulation method that organizes field data into a tree structure according to business hierarchy and outputs it. Following the business field specifications, fields are categorized into core categories such as amount, date, account number, currency, shipping information, contract terms, and settlement conditions. A multi-level business semantic tree is constructed based on the business hierarchy, field data is input to the corresponding nodes, and standardized, directly readable data is output.
[0075] Further, step S206 includes: First, classifying and standardizing the format of the corrected field data according to the business field specifications to obtain standardized field data. Specifically, the field content is divided into core categories such as amount, date, account, currency, shipping information, contract terms, and settlement conditions according to business attributes. The amount field is uniformly converted to a numeric format with two decimal places, the date field is uniformly converted to the "YYYY-MM-DD" format, the account field has spaces and separators removed to retain pure numbers, and the currency field is mapped to the ISO 4217 standard currency code. Fields that do not meet the format requirements are marked and prompted.
[0076] Secondly, based on the business hierarchy and field dependency rules in the document's business metadata, a multi-level business semantic tree framework is constructed to obtain a semantic tree structure template. Specifically, the first layer contains basic document information, the second layer contains business entity information, the third layer contains detailed item information, and the fourth layer contains summary settlement information. Field dependency rules include constraints such as the product of quantity and unit price equaling the amount, and the issuance date being earlier than the validity period.
[0077] Next, the standardized field data is input into the corresponding nodes of the semantic tree structure template according to the business semantic relationship to obtain the initial business semantic tree data. Specifically, the fields are input into the corresponding nodes according to the field keyword matching results. For example, fields containing the keywords "Total" or "Amount" are input into the amount node, and fields containing the keywords "Date" or "Time" are input into the date node. When there are multiple candidate nodes for a field, ambiguity is resolved according to the position rules and contextual semantics.
[0078] Next, the initial business semantic tree data is subjected to node integrity verification and hierarchical logical consistency verification to obtain the semantic tree verification results. Specifically, the node integrity verification checks whether the required fields of each level exist, such as whether the product name, quantity, and unit price of the detailed item information level are complete. The hierarchical logical consistency verification checks the numerical relationship between adjacent levels, such as whether the sum of the detailed amounts of the third level is equal to the total amount of the fourth level, and whether the issuance date is earlier than the expiration date.
[0079] Then, based on the semantic tree validation results, missing nodes and logically conflicting nodes are adaptively completed and corrected to obtain optimized business semantic tree data. Specifically, missing nodes are filled with null values or set to default values according to business rules. For example, when the currency field is missing, it is set to "CNY" or "USD" by default according to the business type. Logically conflicting nodes are corrected according to field dependency rules. For example, when the product of quantity and unit price is not equal to the amount, the quantity or unit price is corrected by working backward from the amount field, and a correction mark is added.
[0080] Finally, the optimized business semantic tree data is standardized and encapsulated for output, and the features of batch documents and their corresponding optimal parameters are stored in the parameter optimization library to obtain standardized business structured data. Specifically, the encapsulation format is JSON, which includes field names, field values, credibility levels, risk tracing information, and hierarchical paths. During parameter storage, a mapping relationship is established between the six core features of the current document and the optimal parameters used in the processing, and stored in the parameter optimization library for reuse in subsequent similar documents.
[0081] This embodiment achieves adaptive processing parameters through document core feature acquisition and dynamic adjustment. Data quality is ensured through credibility-level labeling, risk tracing, and correction marking. Finally, standardized business structured data is output in a multi-level semantic tree structure according to business specifications. This improves the adaptability to multiple scenarios and the reliability of the output data. Credibility-level labeling and risk tracing guarantee data quality, and the multi-level business semantic tree structured output enables direct integration with business systems, reducing manual processing and maintenance costs.
[0082] Based on the first embodiment of this application, this application also provides an OCR visual perception and structured analysis device, please refer to... Figure 3 The device includes: The processing module 10 is used to preprocess and visually enhance the input document image to obtain the enhanced document image.
[0083] The partitioning module 20 is used to perform layout awareness and region partitioning on the enhanced document image to obtain a set of partitioned regions, which includes text regions, standard table regions, borderless table regions, stamp interference regions, and blank redundant regions.
[0084] The recognition module 30 is used to perform regional differentiated character recognition on the region set to obtain recognition text data with location attributes.
[0085] The parsing module 40 is used to perform complex table topology parsing on the standard table area and the borderless table area in the region set based on the recognized text data, so as to obtain structured table data.
[0086] The reorganization module 50 is used to perform global content logical reorganization and field association on structured table data and recognized text data to obtain logically reorganized content data.
[0087] Result module 60 is used to adaptively adjust the content data after logical reorganization and output the business structured data to obtain standardized business structured data.
[0088] The OCR visual perception and structured analysis device provided in this application, employing the OCR visual perception and structured analysis method in the above embodiments, can solve the technical problem of how to construct an integrated OCR visual perception and structured analysis system. Compared with the prior art, the beneficial effects of the OCR visual perception and structured analysis device provided in this application are the same as those of the OCR visual perception and structured analysis method provided in the above embodiments, and other technical features in the OCR visual perception and structured analysis device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0089] This application provides an OCR visual perception and structured analysis device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the OCR visual perception and structured analysis method in the first embodiment described above.
[0090] The following is for reference. Figure 4 This document illustrates a structural diagram of an OCR visual perception and structured analysis device suitable for implementing embodiments of this application. The OCR visual perception and structured analysis device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The OCR visual perception and structured analysis device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0091] like Figure 4As shown, the OCR visual perception and structured analysis device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the OCR visual perception and structured analysis device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the OCR visual perception and structured analysis device to communicate wirelessly or wiredly with other devices to exchange data. Although various OCR visual perception and structured analysis devices are shown in the figures, it should be understood that it is not required to implement or possess all of them. More or fewer may be implemented alternatively.
[0092] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0093] The OCR visual perception and structured analysis device provided in this application, employing the OCR visual perception and structured analysis method described in the above embodiments, can solve the technical problem of how to construct an integrated OCR visual perception and structured analysis system. Compared with the prior art, the beneficial effects of the OCR visual perception and structured analysis device provided in this application are the same as those of the OCR visual perception and structured analysis method provided in the above embodiments, and other technical features in this OCR visual perception and structured analysis device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0094] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0095] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0096] This application provides a computer-readable medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the OCR visual perception and structured parsing method in the above embodiments.
[0097] The computer-readable medium provided in this application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor devices, or any combination thereof. More specific examples of computer-readable media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable medium may be any tangible medium containing or storing a program that can be executed by instructions, used by a device, or used in conjunction with it. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0098] The aforementioned computer-readable medium may be included in the OCR visual perception and structured analysis device; or it may exist independently and not be assembled into the OCR visual perception and structured analysis device.
[0099] The aforementioned computer-readable medium carries one or more programs that, when executed by the OCR visual perception and structured analysis device, enable the OCR visual perception and structured analysis device to write computer program code for performing the operations of this application in one or more programming languages or a combination thereof. These programming languages include object-oriented programming languages—such as Java, Smalltalk, and C++—and conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0100] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of this application. In this regard, all blocks in the flowcharts or block diagrams may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that all blocks in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using dedicated hardware-based implementations that perform the specified functions or operations, or using a combination of dedicated hardware and computer instructions.
[0101] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0102] The readable medium provided in this application is a computer-readable medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-described OCR visual perception and structured analysis methods, and can solve the technical problem of how to construct an integrated OCR visual perception and structured analysis system. Compared with the prior art, the beneficial effects of the computer-readable medium provided in this application are the same as the beneficial effects of the OCR visual perception and structured analysis methods provided in the above embodiments, and will not be repeated here.
[0103] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the OCR visual perception and structured parsing method described above.
[0104] The computer program product provided in this application can solve the technical problem of how to construct an integrated OCR visual perception and structured analysis system. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the OCR visual perception and structured analysis method provided in the above embodiments, and will not be repeated here.
[0105] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. An OCR visual perception and structured parsing method, characterized in that, The method includes: The input document image is preprocessed and visually enhanced to obtain the enhanced document image. The enhanced document image is subjected to layout awareness and region partitioning to obtain a set of partitioned regions, wherein the set of regions includes text regions, standard table regions, borderless table regions, stamp interference regions, and blank redundant regions. The region set is subjected to region-specific character recognition to obtain recognition text data with location attributes; Based on the identified text data, complex table topology parsing is performed on the standard table region and the borderless table region in the region set to obtain structured table data; The structured table data and the recognized text data are globally reorganized and associated with fields to obtain the logically reorganized content data; The document feature input data is obtained by acquiring six core features: document business type, page structure, language type, table format, seal location, and core field type. Based on the document feature input data, the image preprocessing parameters, page layout strategy, recognition weight and table parsing logic are dynamically adjusted to obtain the adjusted processing parameters. Based on the adjusted processing parameters, the logically reorganized content data is labeled with business field credibility levels to obtain field data with credibility levels. Risk source tracing and location are performed based on the low-confidence fields and abnormal fields in the field data with confidence levels to obtain risk source tracing information; Based on the risk tracing information, the field data with the credibility level is corrected with a prompt mark and credibility downgraded to obtain the corrected field data; The modified field data is standardized and encapsulated according to the business field specifications, and a multi-level business semantic tree structure is output to obtain standardized business structured data. The step of standardizing and encapsulating the corrected field data according to the business field specifications and outputting it as a multi-level business semantic tree structure to obtain standardized business structured data includes: Based on the business field specifications, the revised field data is categorized by field type and standardized in format to obtain standardized field data. Based on the business hierarchy and field dependency rules in the document business metadata, a multi-level business semantic tree framework is constructed to obtain a semantic tree structure template. The standardized field data is input into the corresponding node of the semantic tree structure template according to the business semantic relationship to obtain the initial business semantic tree data; Perform node integrity verification and hierarchical logic consistency verification on the initial business semantic tree data to obtain the semantic tree verification result; Based on the semantic tree verification results, missing nodes and logically conflicting nodes are adaptively completed and corrected to obtain optimized business semantic tree data. The optimized business semantic tree data is standardized and packaged for output, and the batch document features and corresponding optimal parameters are stored in the parameter optimization library to obtain standardized business structured data.
2. The method as described in claim 1, characterized in that, The step of performing layout awareness and region partitioning on the enhanced document image to obtain a set of partitioned regions includes: The enhanced document image is divided into pixel-level regions based on visual feature clustering and layout rules to obtain an initial region set. The initial set of regions is analyzed for multi-column layout and mixed layout to obtain the coordinates, hierarchical order and reading priority of each region. The initial set of regions is marked with cross-page features based on region boundary characteristics and content continuity to obtain cross-page association identifiers and page connection codes; Based on the coordinates, hierarchical order, and reading priority of each region, as well as the cross-page association identifier and page connection code, the regions are integrated and sorted to obtain a set of partitioned regions.
3. The method as described in claim 1, characterized in that, The step of performing region-specific character recognition on the region set to obtain recognition text data with location attributes includes: Based on the language type distribution of each region in the region set, the proportion of multilingual characters is calculated to obtain the language proportion analysis results. Based on the language proportion analysis results, the recognition weight and character library configuration of each region are dynamically adjusted to obtain differentiated recognition parameters; Based on the differential recognition parameters, language adaptation recognition is performed on the text regions in the region set to obtain the first recognized text data; Based on the differential recognition parameters, table-specific character recognition is performed on the standard table area and the borderless table area in the region set to obtain the second recognition text data; Based on the differential recognition parameters, anti-interference enhancement recognition is performed on the stamp interference regions in the region set to obtain third recognition text data; The first, second, and third identified text data are bound to the corresponding region coordinates, region type, page order, and cross-page identifier to obtain identified text data with location attributes.
4. The method as described in claim 1, characterized in that, The step of performing complex table topology parsing on the standard table regions and borderless table regions in the region set based on the identified text data to obtain structured table data includes: Based on the cell text spacing, alignment rules, and content density in the identified text data, virtual lines are intelligently filled in the borderless table area to obtain the completed table data. Based on the line distribution characteristics and the relationship between adjacent cells in the identified text data, the missing lines in the standard table area are repaired to obtain repaired table data. Based on the identified text data and cross-page association identifier, the cross-page split table is seamlessly spliced and aligned with rows and columns to obtain spliced table data; Perform table geometry topology verification on the completed table data, repaired table data, and spliced table data to obtain the geometry topology verification result. The table geometry topology verification operation includes cell boundary closure, row and column alignment consistency, and grid structure integrity verification. Based on the semantic types of fields, business rule constraints, and table header field mapping relationships in the identified text data, the geometric topology verification results are subjected to business semantic topology verification to obtain business semantic topology verification results. The business semantic topology verification operations include field logical consistency, numerical range compliance, and cross-cell business association verification. Based on the geometric topology verification results and the business semantic topology verification results, the table areas with topological conflicts are adaptively corrected and rearranged to obtain structured table data.
5. The method as described in claim 1, characterized in that, The step of performing global content logical reorganization and field association on the structured table data and recognized text data to obtain logically reorganized content data includes: The identified text data is sorted according to the original page layout, area hierarchy, and reading priority to obtain ordered text data; Global content concatenation is performed based on the ordered text data and the structured table data to obtain semantically ordered reorganized data; Based on the cross-page association identifier and page connection code, the semantic order reorganization data is connected and merged across pages to obtain the content data after cross-page merging; Perform cross-page table data consistency verification on the content data after cross-page merging to obtain the consistency verification result; Based on the consistency verification results, the cross-page table content with data conflicts is corrected and completed to obtain the corrected content data. The corrected content data is then subjected to business field differentiation, semantic association mapping, and field association to obtain logically reorganized content data.
6. An OCR visual perception and structured analysis device, characterized in that, The device is applied to the OCR visual perception and structured analysis method as described in any one of claims 1 to 5, and the device comprises: The processing module is used to preprocess and visually enhance the input document image to obtain the enhanced document image. The partitioning module is used to perform layout awareness and region partitioning on the enhanced document image to obtain a set of partitioned regions, wherein the set of regions includes text regions, standard table regions, borderless table regions, stamp interference regions, and blank redundant regions. The recognition module is used to perform regional differentiated character recognition on the set of regions to obtain recognition text data with location attributes; The parsing module is used to perform complex table topology parsing on the standard table area and the borderless table area in the region set based on the identified text data, so as to obtain structured table data; The reorganization module is used to perform global content logical reorganization and field association on the structured table data and the recognized text data to obtain logically reorganized content data; The results module is used to acquire six core features of a document: business type, layout structure, language type, table format, seal location, and core field type, to obtain document feature input data. Based on the document feature input data, image preprocessing parameters, layout partitioning strategy, recognition weights, and table parsing logic are dynamically adjusted to obtain adjusted processing parameters. Based on the adjusted processing parameters, the logically reorganized content data is labeled with business field credibility levels to obtain field data with credibility levels. Low-credibility fields and abnormal fields in the field data with credibility levels are used for risk tracing and location to obtain risk tracing information. Based on the risk tracing information, the field data with credibility levels is corrected with correction prompts and credibility downgrade processing to obtain corrected field data. Finally, the corrected field data is standardized, encapsulated, and output as a multi-level business semantic tree structure according to business field specifications to obtain standardized business structured data.
7. An OCR visual perception and structured analysis device, characterized in that, The device includes: a memory, a processor, and an OCR visual perception and structured parsing program stored in the memory and running on the processor, the OCR visual perception and structured parsing program being configured to implement the steps of the OCR visual perception and structured parsing method as described in any one of claims 1 to 5.
8. A storage medium, characterized in that, The storage medium stores an OCR visual perception and structured parsing program, which, when executed by a processor, implements the steps of the OCR visual perception and structured parsing method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Financial document intelligent verification method and system
CN121505641A
Multi-page document intention analysis and structuring method, system and equipment based on hybrid expert routing and storage medium
CN121683805A
