Recognition method of check report form, electronic equipment and storage medium
Through deep learning models and fuzzy matching algorithms, the structured data in medical test reports are solved, and the problems of insufficient identification accuracy and poor template matching flexibility in the prior art are achieved, and efficient and accurate data extraction and processing are achieved.
Patent Information
- Application Number
- CN202411674607.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-11
AI Technical Summary
The prior art is difficult to automatically identify and extract structured data from complex medical test reports, resulting in insufficient identification accuracy, poor template matching flexibility, and poor handling of abnormal situations.
Advanced deep learning models are used to identify the text boxes and their position coordinates in the table, and the associated text boxes are determined in combination with the fuzzy matching algorithm, and then the result data is identified. This method does not need to rely on predefined format templates, can handle reports in multiple formats, and has a mechanism to handle exceptions.
It significantly improves the accuracy and reliability of structured data extraction, and can efficiently and accurately process inspection reports in multiple formats, greatly improving the degree of automation and accuracy of data processing.
Smart Images

Figure CN119600629A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of word processing, and in particular relates to a method for recognizing an inspection report form, an electronic device and a storage medium. Background Art
[0002] In the process of medical testing and diagnosis, test report sheets are important documents that record and communicate the health status of patients. These reports usually contain a large number of test indicators and corresponding data. For doctors and other medical professionals, interpreting this information is an important part of their daily work. However, traditional report sheet processing methods mostly rely on manual inspection and manual entry, which is not only time-consuming and labor-intensive, but also prone to errors.
[0003] In the related art, there are some technologies and products based on optical character recognition (OCR) for automatic recognition of text information. These technologies can extract text content from scanned documents, but when processing complex medical test reports, it is difficult to automatically recognize the data in the test reports because the data in the test reports are often complex in structure and contain a variety of different test indicators and their corresponding reference ranges, result data and other information. Summary of the invention
[0004] In view of this, the present invention provides a method for identifying a medical examination report form, an electronic device and a storage medium to solve the problem in the prior art that it is difficult to identify a medical examination report form.
[0005] In a first aspect, the present invention provides a method for identifying an inspection report form, comprising: identifying all text boxes in the form; obtaining text box information corresponding to each of the text boxes, the text box information including the text content in the text box and the corresponding position coordinates; based on a fuzzy matching algorithm, determining associated text boxes according to the text box information; and identifying corresponding result data according to the associated text boxes.
[0006] In some implementations, based on a fuzzy matching algorithm, associated text boxes are determined according to the text box information, specifically including: based on a fuzzy matching algorithm, a corresponding main text box is determined according to the text content; and all associated text boxes associated with the main text box are calculated by string similarity.
[0007] In some embodiments, based on a fuzzy matching algorithm, the corresponding main text box is determined according to the text content, specifically including: using a fuzzy matching algorithm to calculate the similarity between the text content corresponding to each of the text boxes and each item in the keyword list or pattern library; assigning a similarity score to each similarity; determining the text box with the highest matching degree according to the similarity score; if the similarity score between the text content corresponding to the text box with the highest matching degree and an item in the keyword list or pattern library exceeds a similarity threshold, then determining the main text box.
[0008] In some implementations, obtaining the text box information corresponding to each of the text boxes specifically includes: obtaining the position coordinates corresponding to each of the text boxes; obtaining the text content in each of the text boxes; and associating the position coordinates with the text content to obtain the text box information.
[0009] In some embodiments, any one of the methods for recognizing an inspection report form further includes: preprocessing the text content.
[0010] In some embodiments, the preprocessing includes removing extra spaces, punctuation marks, and special characters.
[0011] In some implementations, identifying corresponding result data based on the associated text boxes specifically includes: determining a straight line based on all text boxes in the associated text boxes; calculating the text box closest to the straight line; and identifying result data based on the text box closest to the straight line.
[0012] In some implementations, determining a straight line based on all text boxes in the associated text boxes specifically includes: obtaining the center coordinates of each text box in the associated text boxes; and fitting all the center coordinate points to determine a straight line equation.
[0013] In a second aspect, the present invention also provides an electronic device, comprising: at least one processor; 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 so that the at least one processor can: identify all text boxes in a table; obtain text box information corresponding to each of the text boxes, the text box information including the text content in the text box and the corresponding location coordinates; based on a fuzzy matching algorithm, determine associated text boxes according to the text box information; and identify corresponding result data according to the associated text boxes.
[0014] In a third aspect, the present invention provides a storage medium storing a computer program, wherein when the computer program is executed by a processor, any one of the methods for identifying an inspection report form is implemented. In some embodiments,
[0015] The beneficial effects of the present invention are:
[0016] The present invention adopts an advanced deep learning model, which is trained with a large amount of training data to accurately identify the text content and location coordinates in the text box, and then uses a fuzzy matching algorithm to determine the associated text box based on the text box information, which significantly improves the accuracy of structured data extraction. The corresponding result data is then determined based on the associated text box, ensuring the accuracy and reliability of the match. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A flowchart of a method for identifying an inspection report form according to an embodiment of the present invention;
[0019] Figure 2 This is a recognition effect diagram of a method for recognizing an inspection report form according to an embodiment of the present invention;
[0020] Figure 3 The figure is a block diagram of an electronic device according to an embodiment of the present invention.
[0021] Description of reference numerals:
[0022] 110. Processor;
[0023] 120. Memory. DETAILED DESCRIPTION
[0024] In the related technology, some common OCR systems include Tesseract, Google Vision OCR, PaddleOCR, etc.
[0025] The basic principle of Optical Character Recognition (OCR) technology is to convert printed or handwritten text into machine-readable text through scanning or image processing technology. These technologies mainly include the following steps:
[0026] Preprocessing: including denoising, binarization, tilt correction, etc. to improve image quality.
[0027] Text Detection: Identify text regions in images.
[0028] Text Recognition: Convert detected text areas into digital characters.
[0029] Post-processing: including spelling correction, formatting, etc. to improve the accuracy of recognition results.
[0030] Table recognition technology is developed based on OCR and is used to recognize and extract table data in images. The main steps include:
[0031] Table Detection: Identify table structures in images, including rows, columns, and cells.
[0032] Table parsing: extract text and data from tables.
[0033] Data structuring: Organize the extracted data into a structured form, such as an Excel table or database records.
[0034] Although existing OCR and form recognition technologies have achieved certain results in some simple applications, they have the following major disadvantages when processing complex inspection reports:
[0035] a. Insufficient recognition accuracy
[0036] Existing OCR technology has low recognition accuracy when processing complex table structures. For example, in the inspection report, the names of different test indicators, reference ranges and result data are often arranged irregularly. Existing technology is difficult to accurately distinguish and associate these contents, which easily leads to recognition errors and data confusion.
[0037] b. Template matching has poor flexibility
[0038] Template matching-based methods rely on predefined report form templates. Although they work well when processing documents with fixed formats, they are less flexible and adaptable to reports with diverse formats. Report forms from different medical institutions and different test items have different formats, and template matching methods are difficult to cope with these diversities, limiting their practical application scope. For example, OCR products such as Adobe Acrobat require manual intervention to adjust templates when processing tables of different formats, which is inefficient.
[0039] c. Poor handling of abnormal situations
[0040] In actual applications, there may be text box position shifts, missing content or other abnormalities in the report. The existing technology lacks an effective processing mechanism for these abnormalities, which easily leads to recognition and extraction errors. For example, when some text boxes in the report are shifted or part of the data is missing, the existing OCR technology often cannot handle it correctly, resulting in inaccurate final recognition results.
[0041] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0042] Combine the following Figures 1 to 3 , describing an embodiment of the present invention.
[0043] like Figure 1 As shown, according to an embodiment of the present invention, on the one hand, a method for identifying an inspection report form is provided, comprising the following steps:
[0044] Step S101: Identify all text boxes in a table.
[0045] Step S103: Acquire text box information corresponding to each text box, where the text box information includes text content in the text box and corresponding position coordinates.
[0046] Step S105: Based on the fuzzy matching algorithm, determine the associated text boxes according to the text box information.
[0047] Step S107: Identify corresponding result data according to the associated text box.
[0048] In this embodiment, an advanced deep learning model is used. After being trained with a large amount of training data, the model can accurately identify the text content and location coordinates in the text box. Then, a fuzzy matching algorithm is used to determine the associated text boxes based on the text box information. For example, for an inspection report, the reference range and abbreviation text boxes associated with each "full name of inspection indicator" are determined, which significantly improves the accuracy of structured data extraction. Then, the corresponding result data is determined based on the associated text boxes, ensuring the accuracy and reliability of the match.
[0049] Furthermore, step S105, based on a fuzzy matching algorithm, determines the associated text box according to the text box information, specifically including the following steps:
[0050] Step S1051: Based on the fuzzy matching algorithm, determine the corresponding main text box according to the text content;
[0051] Step S1053: Calculate all associated text boxes associated with the main text box through string similarity.
[0052] Through fuzzy matching, the main text box corresponding to a certain text content is determined. For example, the main text box is the text box corresponding to the text content of "full name of inspection indicator", and then the string similarity calculation is performed to determine the "reference range" text box and "abbreviation" text box associated with the main text box "full name of inspection indicator". That is, through the string similarity calculation, the text boxes of "reference range of inspection indicator" and "abbreviation of inspection indicator" corresponding to each text box of "full name of inspection indicator" can be determined, and the associated text boxes can be obtained, which significantly improves the accuracy of structured data extraction. This method can handle slight differences in text content and ensure the accuracy and reliability of matching.
[0053] Furthermore, step S1051: based on the fuzzy matching algorithm, determining the corresponding main text box according to the text content specifically includes the following steps:
[0054] Step S10511: using a fuzzy matching algorithm to calculate the similarity between the text content corresponding to each text box and each item in the keyword list or pattern library;
[0055] Step S10513: assigning a similarity score to each similarity;
[0056] Step S10515: determining the text box with the highest matching degree according to the similarity score;
[0057] Step S10517: If the similarity score between the text content corresponding to the text box with the highest matching degree and an item in the keyword list or pattern library exceeds the similarity threshold, the main text box is determined.
[0058] In this embodiment, a fuzzy matching algorithm is used, including Levenshtein distance, Jaccard similarity coefficient or Cosine similarity, to calculate the similarity between the text content of each text box and each item in the keyword list or pattern library, and then a similarity score is assigned to each text content, and the text box with the highest matching degree is determined based on the similarity score. A similarity threshold is set. If the similarity score between the text content and an item in the keyword list or pattern library exceeds the threshold, it can be determined that the text content belongs to the main text box. For example, if the similarity score between the text content "full name of the inspection indicator" and an item in the keyword list or pattern library exceeds the threshold, it can be determined that the text content belongs to the main text box, that is, the text box corresponding to the text content "full name of the inspection indicator".
[0059] Further, based on step S103, the text box information corresponding to each text box is obtained, which specifically includes the following steps:
[0060] Step S1031: Obtain the position coordinates corresponding to each text box;
[0061] Step S1033: Obtain the text content in each text box;
[0062] Step S1035: Associating the position coordinates with the text content to obtain text box information.
[0063] In this embodiment, the inspection report form is used as input and processed by a deep learning model to identify all text boxes in the form. For each identified text box, the coordinate information corresponding to the position of the text box is extracted, and these coordinate information can be used for subsequent text box sorting and matching operations. Next, a text recognition operation is performed on each identified text box to extract the text content in the text box. These text contents include information such as "full name of the inspection indicator", "reference range of the inspection indicator", and "abbreviation of the inspection indicator". Finally, the extracted position coordinate information and text content are associated to form a complete text box information. This information contains the position coordinates of the text box and the text content therein, which ensures the integrity and accuracy of the data and lays the foundation for subsequent processing and analysis.
[0064] Furthermore, a method for recognizing an inspection report form also includes a step of preprocessing text content.
[0065] Specifically, preprocessing includes removing extra spaces, punctuation marks, and special characters.
[0066] Further, based on step S107, corresponding result data is identified according to the associated text box, specifically including the following steps:
[0067] Step S1071: determining a straight line according to all text boxes in the associated text boxes;
[0068] Step S1073: Calculate the text box closest to the straight line;
[0069] Step S1075: Identify the result data based on the text box that is closest.
[0070] In this embodiment, all the associated text boxes are connected into a straight line, and the text box closest to the straight line is the text box closest to the straight line. The text content in the text box is recognized, which is the result data.
[0071] A straight line is determined by identifying the "full name of the inspection indicator" text box, the "reference range of the inspection indicator" text box and the "abbreviation of the inspection indicator" text box, and the text box closest to the straight line is calculated to obtain the result data corresponding to the "inspection indicator".
[0072] Furthermore, based on step S1071, a straight line is determined according to all text boxes in the associated text boxes, specifically including the following steps:
[0073] Step S10711: obtaining the center coordinates of each text box in the associated text boxes;
[0074] Step S10713: Fit all the center coordinate points to determine a straight line equation.
[0075] The linear regression algorithm is used to fit the three central coordinate points by the least square method to determine the equation of a straight line;
[0076] In this embodiment, the result data corresponding to the "test index" is taken as an example. The description is as follows:
[0077] Get the center coordinates of the "Full Name of Test Indicator" text box, the "Reference Range of Test Indicator" text box, and the "Abbreviation of Test Indicator" text box. Use the linear regression algorithm to fit these three center coordinate points by the least squares method to determine the equation of a straight line. Record the final straight line equation to be used in the subsequent steps to calculate the distance from other text boxes to the straight line. Calculate the text box closest to the straight line, and determine the text box containing the "result" content through the vertical coordinate of the "result" column.
[0078] In another embodiment, the implementation process of the algorithm is introduced by taking the detection and identification of the indicator "potassium" as an example.
[0079] An inspection report form recognition algorithm based on text detection and recognition includes the following steps:
[0080] (1) Use text detection and recognition algorithms to identify the location coordinates and text content of all text boxes, which are obtained based on the inspection report form.
[0081] In step (1), a text detection and recognition algorithm is used to identify the position coordinates and text contents of all text boxes, such as Figure 2 As shown, including:
[0082] It uses an advanced deep learning model that has been trained with a large amount of training data and can accurately identify the text content and location coordinates in the text box;
[0083] The inspection report form is used as input and processed by the deep learning model to identify all text boxes in the form;
[0084] For each identified text box, extract its position coordinate information, which can be used for subsequent text box sorting and matching operations;
[0085] For each identified text box, perform text recognition operation to extract the text content in the text box, which includes information such as "full name of inspection indicator", "reference range of inspection indicator", and "abbreviation of inspection indicator";
[0086] The extracted position coordinate information and text content are associated to form a complete text box information, which includes the position coordinates of the text box and the text content therein.
[0087] (2) Determine the text box whose text content belongs to the "full name of inspection indicator" through fuzzy matching.
[0088] In step (2), the text box whose text content belongs to "full name of inspection indicator" is determined through fuzzy matching, such as Figure 2 As shown, including:
[0089] Preprocess the content of each recognized text box to remove extra spaces, punctuation marks and special characters to standardize the text content;
[0090] Use fuzzy matching algorithms (Levenshtein distance, Jaccard similarity coefficient, or Cosine similarity) to calculate the similarity between the content of each text box and the items in the keyword list or pattern library;
[0091] Assign a similarity score to each text box content, and determine the text box with the highest matching degree based on the score;
[0092] Set a similarity threshold. When the similarity score between the text box content and an item in the keyword list or pattern library exceeds the threshold, the text box content is determined to belong to the "full name of the inspection indicator";
[0093] Among them, the Chinese name "Potassium" is identified as the main text box, which is the "full name of the test indicator".
[0094] (3) According to the existing correspondence between "full name of test index", "reference range of test index" and "abbreviation of test index", the text boxes of "reference range of test index" and "abbreviation of test index" corresponding to each text box of "full name of test index" are determined by string similarity calculation. Among them, according to the identified "potassium", the abbreviation "K" and the reference range "3.50-5.50" are determined.
[0095] In step (3), based on the existing correspondence between the "full name of the test indicator", "reference range of the test indicator" and "abbreviation of the test indicator", the text boxes of "reference range of the test indicator" and "abbreviation of the test indicator" corresponding to each text box of the "full name of the test indicator" are determined by string similarity calculation, such as Figure 2 As shown, including:
[0096] Combine the "Template" and the identified "Full Name of Inspection Indicator" text box to determine the corresponding "Reference Range of Inspection Indicator" and "Abbreviation of Inspection Indicator";
[0097] Use fuzzy matching algorithm (Levenshtein distance, Jaccard similarity coefficient or Cosine similarity) to match to the "Test index reference range" and "Test index abbreviation" text boxes;
[0098] (4) Determine a straight line through the corresponding "Test Index Abbreviation" text box, "Test Index Reference Range" text box, and "Test Index Abbreviation" text box. The straight line connects "Potassium", "K" and the reference range "3.50-5.50". The text box "4.20" closest to the straight line is the inspection result.
[0099] In step (4), a straight line is determined through the corresponding "Test Index Abbreviation" text box, "Test Index Reference Range" text box, and "Test Index Abbreviation" text box, such as Figure 2 As shown, including:
[0100] Get the center coordinates of the "full name of inspection index" text box, the "reference range of inspection index" text box, and the "abbreviation of inspection index" text box;
[0101] The linear regression algorithm is used to fit the three central coordinate points by the least square method to determine the equation of a straight line;
[0102] Record the final straight line equation, which will be used to calculate the distance from other text boxes to the straight line in subsequent steps;
[0103] Calculate the text box that is closest to this straight line and obtain the result data corresponding to the "test indicator".
[0104] The present invention proposes a test report form recognition algorithm based on text detection and recognition, aiming to solve the deficiencies in the above-mentioned prior art. The algorithm combines advanced text detection and recognition technology, as well as fuzzy matching and string similarity calculation methods to achieve accurate recognition and extraction of test indicators, reference ranges and result data in the report. Compared with the prior art, the present invention can process test reports in various formats more efficiently and accurately, greatly improving the automation and accuracy of data processing, and providing a solid foundation for further analysis and utilization of medical data.
[0105] like Figure 3 As shown, according to an embodiment of the present invention, on the other hand, an electronic device is provided, comprising: at least one processor 110; a memory 120 communicatively connected to the at least one processor, wherein the memory 120 stores instructions executable by the at least one processor 110, and the instructions are executed by the at least one processor 110 so that the at least one processor 110 can:
[0106] Identify all text boxes in the table;
[0107] Get the text box information corresponding to each text box, the text box information includes the text content in the text box and the corresponding position coordinates;
[0108] Based on the fuzzy matching algorithm, the associated text boxes are determined according to the text box information;
[0109] Identify the corresponding result data according to the associated text box.
[0110] According to an embodiment of the present invention, on the other hand, there is further provided a storage medium storing a computer program, which implements any one of the inspection report form recognition methods when executed by a processor.
[0111] Computers execute instructions that:
[0112] Identify all text boxes in the table;
[0113] Get the text box information corresponding to each text box, the text box information includes the text content in the text box and the corresponding position coordinates;
[0114] Based on a fuzzy matching algorithm, determining an associated text box according to the text box information;
[0115] The corresponding result data is identified according to the associated text box.
[0116] The present invention can determine the reference range and abbreviation text box corresponding to each "full name of inspection index" through fuzzy matching and string similarity calculation, significantly improving the accuracy of structured data extraction. This method can handle slight differences in text content and ensure the accuracy and reliability of matching.
[0117] The present invention does not need to rely on predefined format templates, has high flexibility and adaptability, and can process reports with diverse formats. No matter how the layout of the report changes, the present invention can accurately identify and extract the required data.
[0118] During the recognition and extraction process, the present invention has a mechanism for handling abnormal situations such as text box position offset and content missing, thereby ensuring reliability and accuracy in complex practical applications.
[0119] Through these improvements and advantages, the present invention significantly improves the efficiency and accuracy of test report form recognition and data extraction, overcomes the shortcomings of the prior art, and provides a solid foundation for further analysis and utilization of medical data.
[0120] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0121] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for identifying an inspection report form, characterized in that: include: Identify all text boxes in the table; Obtaining text box information corresponding to each of the text boxes, the text box information including text content in the text box and corresponding position coordinates; Based on a fuzzy matching algorithm, determining an associated text box according to the text box information; The corresponding result data is identified according to the associated text box.
2. The method for identifying an inspection report form according to claim 1, characterized in that: Based on the fuzzy matching algorithm, the associated text box is determined according to the text box information, specifically including: Based on the fuzzy matching algorithm, the corresponding main text box is determined according to the text content; All the associated text boxes associated with the main text box are calculated by character string similarity.
3. The method for identifying an inspection report form according to claim 2, characterized in that: Based on the fuzzy matching algorithm, the corresponding main text box is determined according to the text content, including: A fuzzy matching algorithm is used to calculate the similarity between the text content corresponding to each text box and each item in the keyword list or pattern library; assigning a similarity score to each of said similarities; Determining the text box with the highest matching degree according to the similarity score; If the similarity score between the text content corresponding to the text box with the highest matching degree and an item in the keyword list or pattern library exceeds a similarity threshold, the main text box is determined.
4. A method for identifying an inspection report form according to any one of claims 1 to 3, characterized in that: Obtaining the text box information corresponding to each of the text boxes specifically includes: Obtain the position coordinates corresponding to each of the text boxes; Obtain the text content in each of the text boxes; The position coordinates are associated with the text content to obtain the text box information.
5. A method for identifying an inspection report form according to any one of claims 1 to 3, characterized in that: Also includes: The text content is preprocessed.
6. A method for identifying an inspection report form according to claim 5, characterized in that: The preprocessing includes removing extra spaces, punctuation marks and special characters.
7. A method for identifying an inspection report form according to any one of claims 1 to 3, characterized in that: Identifying corresponding result data according to the associated text box specifically includes: Determine a straight line according to all the text boxes in the associated text boxes; Calculate the text box closest to the straight line; According to the text box closest to the distance, the result data is identified.
8. The method for identifying an inspection report form according to claim 7, characterized in that: Determining a straight line according to all the text boxes in the associated text box specifically includes: Get the center coordinates of each text box in the associated text boxes; All the central coordinate points are fitted to determine a straight line equation.
9. An electronic device, characterized in that: include: at least one processor (110); a memory (120) communicatively coupled to the at least one processor (110); The memory (120) stores instructions executable by the at least one processor (110), and the instructions are executed by the at least one processor (110) so that the at least one processor (110) can identify all text boxes in the table; Obtaining text box information corresponding to each of the text boxes, the text box information including text content in the text box and corresponding position coordinates; Based on a fuzzy matching algorithm, determining an associated text box according to the text box information; The corresponding result data is identified according to the associated text box.
10. A storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, a method for identifying an inspection report form according to any one of claims 1 to 8 is implemented.