A method, system, device and medium for calibrating text recognition results in electronic drawings.
By splicing, clustering, and summarizing the text recognition results of electronic drawings, and using a similar-looking text element library and unsupervised learning algorithms for calibration, the problem of low text recognition accuracy in electronic drawings has been solved, achieving higher recognition accuracy and automated business support.
Patent Information
- Application Number
- CN202310317569.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-28
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2043-03-28
AI Technical Summary
Existing text recognition technologies have low recognition rates in electronic drawings, especially in cases where there is no semantic meaning or the semantic meaning differs greatly from that of conventional communication language, which can easily lead to misrecognition and affect business results.
By acquiring the recognition results of electronic drawings, we perform single text element splicing, clustering, and pattern summarization, use a similar text element database for calibration, and combine unsupervised learning algorithms to correct misidentifications.
It improves the accuracy of text recognition in electronic drawings, reduces the need for human correction, and enhances the accuracy and efficiency of automated processes.
Smart Images

Figure CN116386053B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of text recognition technology, specifically relating to a method, system, device, and medium for calibrating text recognition results on electronic drawings. Background Technology
[0002] Character recognition (CR) is now widely used, playing a crucial role in supporting business operations and streamlining processes across numerous industries. CR applications typically involve performing reasoning analysis on optically imaged text (mostly pictures) and outputting recognition results. However, existing CR technologies and engineering practices primarily involve recognizing individual text elements (characters, letters, digits, etc.) and combining them to reconstruct semantically meaningful words. This process also includes semantically correcting any misidentified text elements to ultimately form sentences. While this method yields good results when the text possesses semantic meaning, it struggles with text that lacks meaning or whose semantic meaning differs significantly from standard communicative language. The inability to correct misidentified text elements at the semantic level, coupled with the potential for cascading effects from misidentified elements in subsequent recognition processes, leads to poor performance or even failure to obtain accurate results, thus impacting business operations. Summary of the Invention
[0003] In order to overcome the shortcomings of the prior art, the purpose of this invention is to provide a method, system, device and medium for calibrating text recognition results in electronic drawings, so as to solve the technical problem of low text recognition in electronic drawings, inspire the summarization of text patterns, and thus improve its large-scale application in the automated business of text recognition in electronic drawings.
[0004] To achieve the above objectives, the present invention employs the following technical solution:
[0005] In a first aspect, the present invention provides a method for calibrating the text recognition results of electronic drawings, comprising:
[0006] Obtain the results of electronic drawing recognition;
[0007] Several numbers are obtained by splicing together single text elements in the electronic drawing recognition results;
[0008] Cluster all the numbers to obtain several categories; summarize the inherent patterns of the numbers in each category to obtain the summarized inherent patterns of the numbers in each category;
[0009] Based on the categories and the inherent patterns of the summarized category numbers, text calibration is performed on the electronic drawing recognition results to obtain calibrated electronic drawing recognition results.
[0010] Furthermore, before text calibration, similarity clustering is performed on letters, numbers, and special symbols under different font sizes, fonts, and colors. Combinations of text elements with similarity higher than 80% are used to form a control group. The control groups are then merged to create a library of similar text elements.
[0011] Furthermore, the step of obtaining the electronic drawing recognition result specifically includes: the electronic drawing text recognition system recognizes the provided electronic drawing text through a library of similar-looking text elements to obtain the electronic drawing recognition result.
[0012] Furthermore, the text calibration of the electronic drawing recognition results specifically includes: comparing and calibrating the text with the text in the created similar text element library by summarizing the inherent rules of each category number.
[0013] Furthermore, the summary of inherent patterns includes a summary of the number of digits, a summary of the numbering printing font and color, and a summary of the numbering compilation patterns.
[0014] Furthermore, the process of splicing together single text elements in the electronic drawing recognition results includes result preprocessing;
[0015] The result preprocessing involves splicing together the position and size of each individual text element's pixel coordinates to create numbered words. Combining this with text color and font ensures correct splicing and yields the spliced result.
[0016] Furthermore, the text calibration includes performing calibration;
[0017] The calibration process involves concatenating numbered words, combining text color and font, and summarizing the underlying patterns in the results.
[0018] Secondly, the present invention also provides an electronic drawing text recognition result calibration system, comprising:
[0019] Recognition module: used to obtain the recognition results of electronic drawings;
[0020] Reading module: Used to stitch together single text elements in the electronic drawing recognition results to obtain several numbers;
[0021] Modeling module: Used to cluster each number to obtain several categories; and to summarize the inherent patterns of the numbers in each category;
[0022] Calibration module: Used to perform text verification of electronic drawing recognition results according to the categories and the inherent rules of the summarized category numbers, and obtain calibrated electronic drawing recognition results.
[0023] Thirdly, the present invention provides an electronic device, including a processor and a storage device, wherein the processor is configured to execute a computer program in the storage device to implement any of the described electronic drawing text recognition result calibration methods.
[0024] Fourthly, the present invention provides a computer-readable storage medium, wherein the computer is capable of running any of the electronic drawing text recognition result calibration methods described in the present invention.
[0025] The present invention has at least the following beneficial effects:
[0026] 1. This invention provides a method, system, device, and medium for calibrating text recognition results in electronic drawings. The method includes: acquiring electronic drawing recognition results; concatenating single text elements from the electronic drawing recognition results to obtain several numbers; clustering each number to obtain several categories; summarizing the inherent patterns of the numbers in each category; and calibrating the text of the electronic drawing recognition results according to the categories and the summarized inherent patterns of the numbers in each category, thereby obtaining calibrated electronic drawing recognition results. This improves accuracy by ensuring accurate text recognition in electronic drawings.
[0027] 2. This invention provides a method, system, device, and medium for calibrating electronic drawing text recognition results. The method involves obtaining the electronic drawing recognition results through a cyclical process using an electronic drawing text system to recognize the provided text. This cyclical process allows for text calibration, reducing the need for manual correction. Attached Figure Description
[0028] The accompanying drawings, which form part of this specification, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:
[0029] Figure 1 This is a schematic diagram of the overall process of the electronic drawing text recognition result calibration method, system, equipment and medium of the present invention;
[0030] Figure 2 This is a schematic diagram of text splicing in an electronic drawing text recognition result calibration method, system, device and medium according to the present invention;
[0031] Figure 3 This is a schematic diagram summarizing the patterns of the electronic drawing text recognition result calibration method, system, equipment, and medium of the present invention;
[0032] Figure 4 This is a schematic diagram illustrating text correction for an electronic drawing text recognition result calibration method, system, device, and medium according to the present invention.
[0033] The process includes: 1. Creating a library of similar text elements; 2. Obtaining the recognition results of electronic drawings; 3. Text splicing; 4. Summarizing patterns; 401. Number of characters; 402. Font and color; 403. Compiling patterns; 404. Summarizing patterns; 5. Text verification; 501. Pattern style; 502. Current style; A1. First recognition result; A2. Second recognition result. Detailed Implementation
[0034] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0035] The following detailed description is exemplary and intended to provide further detailed explanation of the invention. Unless otherwise specified, all technical terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this invention is for describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention.
[0036] Please see Figure 1-4 As shown, Example 1:
[0037] To address the problem of recognizing and calibrating non-descriptive text in electronic drawings, this invention proposes an electronic drawing text recognition result calibration system based on heuristic text pattern summarization. The system's workflow consists of three stages:
[0038] (1) Phase 1: Obtaining the results of electronic drawing recognition 2:
[0039] (2) Phase Two: Summarizing the inherent patterns of the text Summary 4:
[0040] (3) Phase 3: Text verification of text content based on the inherent rules of the text 5;
[0041] The system performs the above three-stage steps on each input electronic drawing to achieve accurate recognition of numbered text in the electronic drawing.
[0042] The system's workflow is explained below.
[0043] The system first initializes to provide the necessary similar-looking texts for text correction, creating a similar-looking text element library 1. This library can be created using existing publicly available similar-looking text element libraries or by creating a new one. Currently available similar-looking text element libraries primarily target Chinese characters and letters, mainly addressing the correction of single text elements in semantically meaningful texts, and are not suitable for the scenario addressed in this invention. Therefore, this invention chooses to create its own similar-looking text element library 1. Because numbered texts lack inherent meaning, this similar-looking text element library cannot be built using conventional expert methods. Instead, it employs machine learning, where the machine clusters several letters (including Latin, Greek, and Cyrillic letters), numbers (Arabic and Roman numerals), and special symbols (underscores and hyphens, etc.) based on similarity across various font sizes, styles, and even colors. Text elements with a similarity exceeding 80% are grouped into similar-looking groups, and a large number of these groups constitute the similar-looking text element library.
[0044] After initialization, the system begins operation. The system continuously runs a loop, attempting to acquire the input electronic drawing during the loop. When a user actually invokes the system and provides an electronic drawing, the system performs the actual calibration work for the electronic drawing recognition result 2 within this loop. Because this invention is responsible for calibrating the recognition result, rather than recognizing the text itself, the input content actually received by the system in one loop is the already recognized electronic drawing recognition result 2. The text result should contain the following information for the system to calibrate the text result:
[0045] (1) The recognition results of each individual text element, including what the text is, what color it is, and what font it uses;
[0046] (2) The location of each individual text element within the drawing is given in the form of pixel coordinates;
[0047] (3) The size of each individual text element is identified, measured by horizontal and vertical lengths, and given in the form of pixel coordinates.
[0048] Based on the text recognition results, the system calibrates the text. The calibration process consists of two stages: result preprocessing and calibration execution.
[0049] During the result preprocessing stage, the system splices together each individual text element based on its pixel coordinate position and size to form words (i.e., the various numbers on the drawing), and combines information such as text color and font to assist the splicing process and ensure correct splicing.
[0050] After the assembly is completed, the calibration phase begins.
[0051] During the calibration phase, the system uses the already assembled serial numbers as the basic processing unit, and summarizes the inherent patterns of the serial numbers based on an unsupervised learning algorithm. These inherent patterns include:
[0052] (1) Summary of number character length 401: Numbers of the same type must have the same number of digits;
[0053] (2) Numbering Printing Font and Color 402 Summary: Numbers of the same type must have the same font and color;
[0054] (3) Summary of numbering rules 403: For example, the nth position is an Arabic numeral, letter or other symbol, etc.
[0055] Unsupervised learning methods (such as K-means) abstract the features of each number using the three points mentioned above. Based on this, unsupervised learning is performed without setting an upper limit for the number of categories, allowing the machine to perform unsupervised classification (clustering) of each number in the electronic drawing and summarize the inherent patterns of each number category.
[0056] The final step in the calibration phase is to perform text verification of the recognition results according to the pre-defined categories and the inherent patterns of the various numbering systems.
[0057] The correction process essentially involves finding elements in each individual text element of each number that do not conform to the current pattern, comparing them with elements in the similar element database built by the system, finding elements that conform to the current pattern, and replacing them.
[0058] Example 2:
[0059] 1. Creating a library of similar-looking text elements
[0060] The similar-looking text element library collects several groups of single text elements that are similar in shape, serving as the foundation for the system to correct misidentified single text elements. Because text recognition in electronic drawings is based on visual information—that is, the morphological information of each individual text element—erroneous recognition results are often similar in shape to correct recognition results. The similar-looking text element library records potentially misidentified text elements and their similar elements, enabling rapid searching of similar text elements in misidentified text, thus supporting the correction process.
[0061] This invention addresses the creation of a library of similar-looking text elements for numbered text and its individual text elements, and includes two standards:
[0062] (1) What are the basic single text elements included?
[0063] (2) How to find similar text elements to each individual text element and organize them.
[0064] Regarding the first standard, this invention includes three common types of single text elements found in numbered texts:
[0065] (1) Letters: including Latin letters, Greek letters and Cyrillic letters;
[0066] (2) Numbers: including Arabic numerals and Roman numerals;
[0067] (3) Special symbols: including special symbols used for connecting, such as underscores and hyphens;
[0068] For the second criterion, this invention uses an unsupervised learning method (such as K-Means) to perform unsupervised classification of each individual text element in the first criterion. For each individual text element, a similarity group is created for the remaining individual text elements whose similarity reaches a specified value (depending on the unsupervised learning method used). All similarity groups are combined to form a library of similar text elements.
[0069] 2. Text concatenation
[0070] Text concatenation 3 is the process by which the system combines the identified individual text elements and obtains a unique number. These numbers are then used in subsequent pattern summarization and correction processes.
[0071] The specific execution process of text concatenation is as follows:
[0072] The system identifies each single text element as follows:
[0073] (1) First determine whether it has been merged with other single text elements. If it has been merged, stop processing the single text element.
[0074] (2) If the single text element has not yet been merged, then find the adjacent single text elements above, below, left and right of it;
[0075] (3) Find the nearest adjacent single text element that is the same size in the horizontal or vertical direction, and continue to search for single text elements in the same direction as the original single text element.
[0076] (4) If the above steps cannot find any adjacent single text elements, then the above single text elements are grouped into a number in order, and all single text elements that participate in the numbering are marked as having been merged.
[0077] The system continues to perform the above steps until there are no more single text elements that have not yet been merged. In this way, the stitching of all the text in an electronic drawing is completed.
[0078] 3. Summary of the inherent patterns in numbered texts
[0079] The process of summarizing the inherent patterns of numbered texts involves unsupervised classification of the numbered texts obtained during text splicing, and summarizing the patterns of each text category. After this process, the system can check for texts that do not conform to the inherent patterns of each type of text and correct individual text elements within the text, thus completing the calibration. The following is a detailed explanation of the process of summarizing the inherent patterns of numbered texts.
[0080] First, unsupervised classification (e.g., K-Means) is performed on all numbered texts. This process does not specify an upper limit for the number of categories (or the user can set a limit based on prior knowledge), and an appropriate similarity threshold is set according to the specific unsupervised learning algorithm used. Before this process, the features participating in the unsupervised classification must be specified. The features are defined as follows:
[0081] (1) The number of characters in the number is 401;
[0082] (2) The font and color of the printed number 402;
[0083] (3) The numbering system follows the rule 403, such as the nth position being an Arabic numeral, letter, or other symbol;
[0084] Unsupervised classification is performed based on the above features, and several pre-classified classes are obtained.
[0085] For the categories that have already been sorted above, perform the following operations:
[0086] (1) Based on the above three types of features, feature confirmation is carried out one by one;
[0087] (2) In this category, if the texts are inconsistent on a certain feature, a voting mechanism shall be adopted, and the pattern that is consistent in most texts shall be identified as the pattern of that feature in the texts of that category.
[0088] Finally, the patterns of all classes were summarized.
[0089] 4. Text Correction
[0090] Text verification 5 utilizes the existing internal patterns of numbered texts to summarize the patterns of 404 errors, and combines this with a database of similar-looking text elements to correct each numbered text.
[0091] The correction process for each type of numbered text is as follows:
[0092] (1) For each text in this type of text, check whether it satisfies the first recognition result A1 of the rule of this type. If it does, check the next text.
[0093] (2) If a text does not meet the rules of this type, then identify the location of the single text element that does not meet the rules.
[0094] (3) In the similar text element library, check the similar elements of the single text element, and check whether the similar elements meet the rules of the class one by one;
[0095] (4) If there is only one similar-looking element, directly replace the original single text element second recognition result A2 with it;
[0096] (5) If there are multiple similar elements, replace the one with the highest similarity to the original single text element;
[0097] (6) After replacing all individual text elements in the text that do not conform to the pattern, the text correction is complete;
[0098] (7) After replacing all the text in this class, the correction of this class is complete;
[0099] Once all categories have been corrected, the text correction process ends, and the system has completed the correction of the electronic drawing.
[0100] This method uses heuristic text pattern summarization 4 and applies it to a semantically neutral text result calibration method. It automatically creates a library of similar-looking text elements and, based on this, processes each electronic drawing in three stages:
[0101] (1) The identified individual text elements are spliced together to obtain texts of each numbered category;
[0102] (2) Summarize text patterns through unsupervised learning methods;
[0103] (3) Based on the results of stage (2), the text element library with similar shapes is used to complete the correction of each numbered text.
[0104] This process automates text correction, requiring no human intervention in most cases. This frees up manpower and provides crucial support for numerous business scenarios that previously relied on text recognition technology, improving system accuracy and reducing operational costs.
[0105] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0106] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0107] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0108] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for calibrating text recognition results on electronic drawings, characterized in that, include: Creating a similar text element library includes: clustering letters, numbers, and special symbols based on similarity under different font sizes, fonts, and colors; forming similar groups for text element combinations with similarity higher than 80%; and constructing the similar text element library from all similar groups. The letters include Latin letters, Greek letters, and Cyrillic letters; the numbers include Arabic numerals and Roman numerals; and the special symbols include underscores and hyphens. Obtaining electronic drawing recognition results includes: receiving electronic drawing recognition results containing the recognition results of each individual text element and its color, font, position coordinates and size information; The process involves splicing individual text elements from the electronic drawing recognition results to obtain several numbers. This includes: preprocessing the electronic drawing recognition results, which involves splicing the pixel coordinates and size of each individual text element to generate numbered words, and combining the text color and font to ensure correct splicing and obtain the splicing result; and based on the position coordinates and size information of each individual text element, combined with its color and font, and through adjacent element search and merging, splicing the individual text elements to form several numbers. Cluster all the numbers to obtain several categories; summarize the inherent patterns of the numbers in each category to obtain the summarized inherent patterns of the numbers in each category, including: performing unsupervised clustering on all the numbers to obtain several categories; summarizing the character length, printing font and color, and compilation pattern characteristics of the numbers in each category to obtain the inherent patterns of the numbers in each category; wherein the compilation pattern includes the character type at a specified position in the number; According to the categories and the inherent rules of the summarized category numbers, the text calibration of the electronic drawing recognition results is performed to obtain the calibrated electronic drawing recognition results. This includes: based on the inherent rules of the summarized category numbers, for numbers that do not conform to the rules, locating the position of the single text element that does not conform to the rules, searching for similar elements that conform to the rules in the similar text element library and replacing them, to obtain the calibrated electronic drawing recognition results.
2. The method for calibrating text recognition results in electronic drawings according to claim 1, characterized in that, The steps for obtaining the electronic drawing recognition result specifically include: the electronic drawing text recognition system recognizes the provided electronic drawing text through a library of similar-looking text elements to obtain the electronic drawing recognition result.
3. The method for calibrating text recognition results in electronic drawings according to claim 1, characterized in that, The text calibration of the electronic drawing recognition results specifically includes: comparing and calibrating the text with the text in the created similar text element library by summarizing the inherent rules of each category number.
4. The method for calibrating text recognition results in electronic drawings according to claim 1, characterized in that, The summary of inherent patterns includes a summary of the number of digits, a summary of the font and color used in numbering, and a summary of the numbering compilation patterns.
5. The method for calibrating text recognition results in electronic drawings according to claim 1, characterized in that, The text calibration includes performing calibration; The calibration process involves concatenating numbered words, combining text color and font, and summarizing the underlying patterns in the results.
6. An electronic drawing text recognition result calibration system, used to implement the method of claim 1, characterized in that, include: Recognition module: used to obtain the recognition results of electronic drawings; Reading module: Used to stitch together single text elements in the electronic drawing recognition results to obtain several numbers; Modeling module: Used to cluster each number to obtain several categories; and to summarize the inherent patterns of the numbers in each category; Calibration module: Used to perform text verification of electronic drawing recognition results according to the categories and the inherent rules of the summarized category numbers, and obtain calibrated electronic drawing recognition results; Before text calibration, similarity clustering is performed on letters, numbers, and special symbols under different font sizes, fonts, and colors. Combinations of text elements with similarity higher than 80% are used to form a control group. The control groups are then merged to create a library of similar text elements.
7. An electronic device, characterized in that, It includes a processor and a storage unit, the processor being configured to execute a computer program in the storage unit to implement the electronic drawing text recognition result calibration method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer can run the electronic drawing text recognition result calibration method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Convolutional neural network-based character recognition method
CN108596066A
Medical bill image structuring method and device and computer readable medium
CN112926577A