Paper medical record digitization archiving method and system based on enhanced image recognition
Patent Information
- Application Number
- CN202611140599.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-11-03
AI Technical Summary
Existing technologies for digitizing paper-based medical records suffer from problems such as low accuracy in text recognition, low efficiency in structured processing, insufficient storage optimization, and difficulty in ensuring compliance and traceability.
It employs enhanced image recognition technology, improves text recognition accuracy through Gaussian filtering for noise reduction and text line hash mask correction, combines multi-type differentiated verification mechanisms and hierarchical dynamic storage to optimize access efficiency, and is equipped with a full-link tamper-proof lineage mechanism.
It significantly improved the accuracy of text recognition, increased the efficiency of structured processing, optimized storage resource allocation, and achieved full-process compliance and traceability.
Smart Images

Figure CN123033639A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical information technology and digital record processing, and more specifically to a method and system for digital archiving of paper medical records based on enhanced image recognition. Background Technology
[0002] With the deepening of medical informatization, the digital archiving of medical records such as paper medical records, billing receipts, and laboratory reports is a core foundation for hospital medical record management, medical insurance settlement auditing, and regional medical data sharing. Currently, the digitization of paper medical records mostly adopts a processing mode of general optical character recognition technology combined with manual review, which has many technical shortcomings in practical applications.
[0003] First, paper archives often suffer from quality issues such as creases, stains, and uneven lighting. Conventional preprocessing only performs basic noise reduction, which is insufficient to address problems like text line overlap and geometric distortion. This leads to a significant decrease in the accuracy of text recognition for low-quality archives and insufficient error tolerance. Second, medical archives encompass various heterogeneous documents, including free-text medical records and structured invoices. Existing solutions often use uniform recognition and parsing rules, which cannot adapt to the differentiated structured verification logic based on the archive type. Issues such as field mismatches and format anomalies are difficult to screen in a timely manner, resulting in low efficiency in structured processing. Third, archival storage generally uses a uniform storage architecture, which cannot dynamically optimize storage efficiency based on the access frequency of patient records. Furthermore, the entire process lacks an immutable lineage traceability mechanism, making it difficult to guarantee the compliance and traceability of the archive digitization process.
[0004] Therefore, there is an urgent need for a digital archiving solution for paper medical records that combines high recognition accuracy, intelligent classification and verification, hierarchical and efficient storage, and end-to-end traceability capabilities to meet the actual needs of high-quality digital management of medical records. Summary of the Invention
[0005] In view of this, the present invention provides a method and system for digital archiving of paper medical records based on enhanced image recognition. It improves the accuracy of text recognition in low-quality paper records by image enhancement and text line hash mask correction, ensures the quality of structured data by combining multi-type differentiated verification, optimizes access efficiency by hierarchical dynamic storage based on patient activity, and realizes full-process traceability by supporting an immutable bloodline mechanism. It comprehensively improves the efficiency, accuracy and compliance of digital archiving of medical records.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: A method for digitizing and archiving paper medical records based on enhanced image recognition, comprising: S1. Collect the original images of paper archives, obtain standardized images after preprocessing, and then output enhanced images after Gaussian filtering to remove noise. S2. Generate a text line hash mask with pixel coordinates based on the enhanced image, process the text line hash mask to obtain the corrected text feature map, and use a dual-branch CNN model to perform text recognition on the corrected text feature map lines to output the original text. S3. Preset medical record keyword dictionary and invoice template dictionary to verify the original text and distinguish between standard files and files to be reprocessed; S4. Check the resolution and field compliance of the enhanced image in sequence. If it is not qualified, roll back and re-collect. After all are qualified, store it in the main database for archiving. S5. Named entity extraction is performed on the text of the standardized archives through natural language processing to construct a health graph. The activity level of patients is confirmed based on the health graph, and the data is dynamically stored in layers according to the activity level of patients.
[0007] Preferably, the preprocessing process in S1 includes: sequentially performing image correction, irrelevant background cropping, standard size filling, and ticket selection reverse cropping on the original image of the paper archive to obtain a standardized image; the ticket selection reverse cropping includes: calling a preset original ticket size border library to match the ticket specifications, selecting a single target ticket in the filled image, and reverse cropping to remove the pasted blank background to obtain an independent standardized image.
[0008] Preferably, the step S2 to obtain the corrected text feature map specifically includes: The standardized image is input into the OCR engine to generate an initial text line mask, and a pixel hash table is built. The key of the hash table is the pixel coordinate and the value is the set of the text line label to which it belongs. Traverse the hash table. If the same pixel corresponds to multiple text line labels, it is determined to be a conflicting pixel. The conflicting pixel label is reset to an undefined label, and the separated text line mask is output. Set the number of shrinkage iterations and the noise threshold, cyclically identify weak noise pixels on the mask edge and remove them layer by layer, and output a clean core text line segmentation mask; Thin plate spline transformation corrects the geometric deformation of text lines, outputting a regular rectangular text feature map, thus obtaining the corrected text feature map.
[0009] Preferably, in step S3, the verification of the original text includes performing table cell mapping matching, keyword-related text extraction, and invoice field format verification on the original text according to the file type, and distinguishing between standard files and files to be reprocessed based on the verification results.
[0010] Preferably, in step S5, a pre-defined treatment type weight dictionary and a disease severity grading table are used to calculate patient activity based on each treatment record associated with a patient vertex in the health graph, combined with the corresponding type basic weight and disease severity coefficient. An activity threshold is set, and the storage structure is determined according to the activity threshold. If the activity is less than or equal to the threshold, it is stored in a shared non-uniform compressed memory array; if the activity is greater than the threshold, it is stored in a high-frequency optimized block-linked skip list. Configure an activity delay monitoring and cooling migration mechanism to filter short-term activity fluctuations and then perform cross-structure data migration; implement an uneven rebalancing strategy for compressed arrays to dynamically allocate storage gaps; and have a built-in automatic maintenance mechanism for block splitting and merging in the block-linked skip list.
[0011] Preferably, the high-frequency optimized block-linked skip list construction method includes: The system stores ordered archive records using memory blocks as linked list nodes, and sets the maximum number of records to be stored in a single block to MAX_BLOCK_SIZE. It constructs a multi-level probabilistic skip list index to achieve logarithmic search efficiency. The system automatically splits when the memory block is full and automatically merges when the storage is sparse. When inserting a new record, the system quickly locates the target block through a high-level index and performs precise insertion using binary search within the block.
[0012] Preferably, the delay monitoring and cooling migration mechanism includes: continuously monitoring patient activity, starting a timer when the activity exceeds the limit; and performing cross-storage data migration when the duration of the activity exceeding the threshold reaches the delay threshold and the time since the last data migration exceeds the structure cooling cycle.
[0013] Preferably, it also includes real-time collection and storage of tamper-proof end-to-end lineage data throughout the entire process from S1 to S5. The lineage data includes data source information, image processing parameter information, storage change operation information, and quality inspection and archiving audit information. Data source information includes file number, acquisition device, original image storage path, acquisition time, and file type; image processing information includes image preprocessing parameters, number of separation and shrinkage iterations, OCR model version, and single-character recognition confidence; storage change information includes initial allocated storage type, data migration time, rebalancing / block splitting operation records, and memory logical address changes; archive audit information includes quality inspection results, manual review records, warehousing time, and operator identification.
[0014] Preferably, a paper-based medical record digitization archiving system based on enhanced image recognition includes: Standardized image acquisition and preprocessing module: used to acquire the original images of paper archives, obtain standardized images after preprocessing, and then output enhanced images after Gaussian filtering for noise reduction; Enhanced text segmentation and recognition module: Generates a text line hash mask with pixel coordinates based on the enhanced image, processes the text line hash mask to obtain the corrected text feature map, and uses a two-branch CNN model to perform text recognition on the corrected text feature map lines, and outputs the original text; Multi-type archive structured verification module: It is used to preset medical record keyword dictionary and invoice template dictionary, and can automatically distinguish the type based on the title; it performs cell mapping matching, keyword post-text association and invoice field format verification on the original text respectively, and distinguishes between standard archives and archives to be reprocessed; Knowledge graph and hierarchical dynamic storage module: Named entity extraction is performed on the text of the standardized archives through natural language processing to construct a health graph. The activity level of patients is determined based on the health graph, and hierarchical dynamic storage is performed based on the activity level of patients. The end-to-end data lineage management module is used to collect operation logs from each module in real time, and has a built-in tamper-proof lineage database and a full-process traceability retrieval unit. Unified archiving storage module: Used to sequentially check the resolution and field compliance of enhanced images; if they fail to meet the requirements, they are rolled back and re-sampled; once all images pass the test, they are stored in the main database for archiving.
[0015] As can be seen from the above technical solutions, compared with the prior art, this invention discloses a method and system for digitizing and archiving paper medical records based on enhanced image recognition. This invention has the following beneficial effects: By using a pixel hash table to remove conflicting pixels in text lines and shrink edge noise, combined with thin-plate spline geometric correction and dual-branch CNN recognition, it effectively solves the problems of text line adhesion and geometric deformation in low-quality paper records such as those with creases and stains, significantly improving the accuracy and robustness of text recognition in complex scenarios. A dual-system classification and verification mechanism using a medical record keyword dictionary and a document template dictionary is adopted, with differentiated verification logic for adapting free text medical records and structured documents, accurately screening for field mismatches and format anomalies, greatly improving the efficiency of structured record processing and reducing manual review costs. Based on a medical and health knowledge graph to calculate patient activity, a hierarchical storage architecture using non-uniform compressed arrays and block-linked skip lists is adopted, along with a delayed cooling migration mechanism, balancing the efficiency of high-frequency record access with the storage cost of low-frequency records, achieving dynamic optimization of storage resources. The end-to-end tamper-proof lineage data mechanism covers the entire digital process, enabling full traceability of operations and effectively ensuring the compliance and credibility of medical record data. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0017] Figure 1 The method flowchart provided by the present invention.
[0018] Figure 2 A flowchart of the hierarchical dynamic storage method provided by the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] like Figure 1 As shown, this invention discloses a method for digitizing and archiving paper medical records based on enhanced image recognition, comprising: S1. Collect the original images of paper archives, obtain standardized images after preprocessing, and then output enhanced images after Gaussian filtering to remove noise. S2. Generate a text line hash mask with pixel coordinates based on the enhanced image, process the text line hash mask to obtain the corrected text feature map, and use a dual-branch CNN model to perform text recognition on the corrected text feature map lines to output the original text. S3. Preset medical record keyword dictionary and invoice template dictionary to verify the original text and distinguish between standard files and files to be reprocessed; S4. Check the resolution and field compliance of the enhanced image in sequence. If it is not qualified, roll back and re-collect. After all are qualified, store it in the main database for archiving. S5. Named entity extraction is performed on the text of the standardized archives through natural language processing to construct a health graph. The activity level of patients is confirmed based on the health graph, and the data is dynamically stored in layers according to the activity level of patients.
[0021] Specifically, the preprocessing process in S1 includes: sequentially performing image correction, irrelevant background cropping, standard size filling, and reverse cropping of the ticket selection frame to obtain a standardized image; the reverse cropping of the ticket selection frame includes: calling a preset original ticket size border library to match the ticket specifications, selecting a single target ticket in the filled image, and reverse cropping to remove the pasted blank background to obtain an independent standardized image.
[0022] In a specific embodiment of the present invention, a 300 DPI high-definition scanning device is used to acquire the original color image of the paper archive. Preprocessing and enhancement processing are then performed on the original image sequentially to obtain an enhanced image. The specific process is as follows: Image skew correction: By detecting the text lines and file edge lines in the image through Hough transform, the overall tilt angle is calculated, and rotation correction is performed on the image to control the tilt angle within ±0.5°.
[0023] Irrelevant background cropping: Extract the outer contour of the paper document using Canny edge detection, and crop out irrelevant backgrounds such as desktop and backing paper outside the contour, while retaining the main area of the document.
[0024] Standard format filling: The cropped archive image is uniformly scaled and filled to the pixel size of 2480×3508 pixels corresponding to the A4 standard format. The missing edge areas are filled with white pixels to obtain a preliminary standardized image with uniform format.
[0025] Reverse cropping of invoice selection: When the file is identified as an invoice, the preset original invoice size and border library is called. The library stores the specifications, dimensions and border features of 5 types of standard medical billing invoices. The specifications and position of the current invoice are determined by feature matching. The target invoice area is selected in the filled image and the blank background of the pasted invoice is removed by reverse cropping to obtain an independent standardized image of the invoice.
[0026] Denoising and Enhancement: A Gaussian filter is applied to the normalized image using a 5×5 Gaussian convolution kernel (σ=1.2) to remove paper fiber noise and scanning noise; then contrast enhancement is performed using Limit Contrast Adaptive Histogram Equalization (CLAHE), with the block size set to 8×8 pixels and the contrast limit threshold set to 2.0, to enhance the contrast between text strokes and background, and output the final enhanced image.
[0027] Specifically, the corrected text feature map obtained in S2 includes: The standardized image is input into the OCR engine to generate an initial text line mask, and a pixel hash table is built. The key of the hash table is the pixel coordinate and the value is the set of the text line label to which it belongs. Traverse the hash table. If the same pixel corresponds to multiple text line labels, it is determined to be a conflicting pixel. The conflicting pixel label is reset to an undefined label, and the separated text line mask is output. Set the number of shrinkage iterations and the noise threshold, cyclically identify weak noise pixels on the mask edge and remove them layer by layer, and output a clean core text line segmentation mask; Thin plate spline transformation corrects the geometric deformation of text lines, outputting a regular rectangular text feature map, thus obtaining the corrected text feature map.
[0028] In a specific embodiment of the present invention, the enhanced image is input into the DBNet text detection model, and the output is an initial binary mask of text lines with unique labels, each text line corresponding to an independent label ID.
[0029] Establish a pixel hash table, where the key is the pixel's 2D coordinates (x, y) and the value is the set of text line labels to which that pixel belongs. Iterate through all text line masks, storing the coordinates and corresponding labels of each foreground pixel into the hash table. Traverse the hash table; if the label set corresponding to the same pixel contains two or more different labels, it is determined to be a conflicting pixel with overlapping text lines. The text line label of that pixel is reset to an undefined background label, and the resulting text line mask is output.
[0030] The preset number of shrinkage iterations is 3, and the noise pixel threshold is 0.4. In each iteration, all edge pixels of the text line mask are traversed, and the proportion of the same label text line pixels in its 3×3 neighborhood is counted. If the proportion is lower than the noise threshold, it is judged as a weak noise pixel and removed as background. After completing 3 iterations, a core text line segmentation mask with smooth boundaries and no burrs is obtained.
[0031] For each core text line mask, feature control points at the top and bottom edges of the text line are extracted. The text line baseline is fitted by Thin Plate Spline Transform (TPS) to map the deformed text lines caused by paper wrinkles and bending into regular rectangular text feature maps, thus completing geometric correction.
[0032] A dual-branch CNN model is used to perform character recognition on the corrected text feature map. The model includes a main feature extraction branch and an attention enhancement branch. The main branch uses a ResNet18 network to extract basic text visual features, while the attention branch introduces a channel attention mechanism to enhance key stroke features. The two features are concatenated and fused and then input into the CTC decoding layer to output the original recognized text, as well as the recognition confidence of each character.
[0033] Specifically, in S3, the verification of the original text includes performing table cell mapping matching, keyword-related text extraction, and invoice field format verification on the original text according to the file type, and distinguishing between standard files and files to be reprocessed based on the verification results.
[0034] In a specific embodiment of the present invention, a medical record keyword dictionary and a bill template dictionary are pre-constructed. The medical record keyword dictionary contains 216 medical record field keywords such as name, gender, age, hospital number, chief complaint, diagnosis, and present medical history. The bill template dictionary contains field layouts, format rules, and numerical verification templates for 5 types of standard medical bills.
[0035] First, the first line title of the identified text is extracted and matched with title keywords in the dictionary. If the matching degree is ≥80%, it is automatically determined to be the corresponding file type. Then, differential verification is performed based on the file type: For tabular documents (inspection reports, payment receipts), cell mapping matching is performed: based on enhanced image detection of table horizontal and vertical lines, the cell grid coordinate matrix is restored; the center pixel coordinates of each recognized text are mapped to the corresponding cell, and it is checked whether the text spans multiple rows and columns, and whether the table header and body are aligned. If misalignment exists, the text is corrected according to the table lines; at the same time, it is checked that the core required cells are not empty.
[0036] For free text archives (outpatient / inpatient medical records), perform keyword-related text extraction: match the field keywords in the medical record keyword dictionary, extract the text from the keyword to the next field keyword as the corresponding field value; validate the validity of field values, for example, the gender field is limited to "male / female" and the age field is a valid value from 1 to 120.
[0037] For fee receipts, additional field format validation is performed: The receipt number must be a 12-digit numeric code, the amount field must retain two decimal places, and the date must conform to the YYYY-MM-DD format. Simultaneously, a numerical reconciliation validation is performed, requiring that the difference between the sum of the detailed item amounts and the total amount be ≤0.01 yuan, and that the sum of the itemized payment amounts matches the total amount. Receipts that pass all core validation items are considered standard documents. Receipts with missing core fields, ≥3 format errors, or a low-confidence text percentage >10% are considered pending reprocessing and transferred to the manual review queue.
[0038] Furthermore, a dual compliance check is performed on the standardized archives. The effective resolution of the enhanced image is verified, requiring a minimum of 300 DPI. If it falls below this threshold, a rollback instruction is generated, returning to S1 to re-acquire the image. The format of core medical fields is verified to conform to medical data standards, such as the patient's ID number being an 18-digit valid code and the diagnosis name matching the ICD-10 disease coding library. If any check item fails, the process is rolled back to the corresponding stage for reprocessing; if all check items pass, the data enters the tiered storage stage.
[0039] Specifically, such as Figure 2As shown, in S5, a pre-defined treatment type weight dictionary and a disease severity grading table are used to calculate the patient activity level based on each treatment record associated with the patient vertex in the health graph, combined with the corresponding type basic weight and the disease severity coefficient. An activity level threshold is set, and the storage structure is determined according to the activity level threshold. If the activity level is ≤ the threshold, it is stored in a shared non-uniform compressed memory array; if the activity level is > the threshold, it is stored in a high-frequency optimized block-linked skip list. Configure an activity delay monitoring and cooling migration mechanism to filter short-term activity fluctuations and then perform cross-structure data migration; implement an uneven rebalancing strategy for compressed arrays to dynamically allocate storage gaps; and have a built-in automatic maintenance mechanism for block splitting and merging in the block-linked skip list.
[0040] In a specific embodiment of the present invention, if the activity level is less than or equal to a threshold, it is stored in a shared non-uniform compressed memory array; if the activity level is greater than the threshold, it is stored in a high-frequency optimized block-linked skip list. An activity delay monitoring and cooling migration mechanism is configured to filter short-term activity fluctuations and then perform cross-structure data migration. A non-uniform rebalancing strategy is applied to the compressed array to dynamically allocate storage gaps. The block-linked skip list has a built-in automatic block splitting and merging maintenance mechanism.
[0041] The diagnosis and treatment type weight dictionary assigns differentiated basic weights to four categories of diagnosis and treatment entities: diagnosis, examination, surgery, and medication. The disease severity grading table classifies diagnostic records into severity levels based on ICD-10 disease codes and sets corresponding weight coefficients. The weight value of a single diagnostic record is the product of the corresponding type's basic weight and the disease severity coefficient. The weight value of a single non-diagnostic record is the corresponding type's basic weight. The patient activity level is the sum of the weight values of all associated diagnosis and treatment records for that patient.
[0042] Furthermore, the preset treatment type weight dictionary and disease severity classification table include: The treatment type weight dictionary assigns basic weights to four types of treatment entities: diagnosis, examination, surgery, and medication. The basic weight for surgery is 4.0, for diagnosis it is 2.0, for examination it is 1.5, and for medication it is 1.0. The disease severity classification table classifies diagnoses into four levels: mild, moderate, severe, and critical, based on ICD-10 disease codes. The corresponding weight coefficients are 1.0, 1.5, 3.0, and 5.0, respectively. For example, upper respiratory tract infection (common cold) is classified as mild with a coefficient of 1.0, and malignant tumor is classified as severe with a coefficient of 3.0.
[0043] For each patient entity, iterate through all the medical records associated with it in the health graph: the weight of a single diagnosis record is (basic weight of diagnosis × corresponding disease severity coefficient), and the weight of a single examination, surgery, or medication record is the basic weight of the corresponding type; sum the weights of all associated records to calculate the patient's weighted activity.
[0044] The preset activity threshold is 120, and differentiated storage is performed based on the patient's weighted activity level. It should be noted that the hierarchical dynamic storage architecture is implemented based on general-purpose computing and storage hardware, and access performance is optimized through software-level data structure design and scheduling strategies.
[0045] Furthermore, multi-dimensional weighted coefficients are set for diagnostic records, covering three dimensions: visit type, diagnosis priority, and disease severity. Specifically, the visit type coefficient is configured in stages: inpatient 1.5, emergency 1.2, outpatient 1.0, and physical examination 0.6; the diagnosis priority coefficient is configured in stages: primary diagnosis 1.5, secondary diagnosis 0.8, and suspected diagnosis 0.5; the disease severity coefficient is based on ICD-10 disease codes, divided into four levels: critical, severe, moderate, and mild, with corresponding coefficients of 5.0, 3.0, 1.5, and 1.0, respectively. The final weight value of a single diagnostic record is the product of the basic diagnostic weight and the above three coefficients, and the patient activity is the sum of the weight values of all associated medical records.
[0046] In another optional embodiment, a self-optimizing weighting mechanism is invoked. Every quarter, the access logs of the past six months are retrieved. Using the actual number of times a single diagnosis's corresponding file is accessed as a label, features such as visit type, diagnosis priority, and disease severity are extracted. A multiple linear regression model is used to fit the correlation between these features and access frequency to determine the optimal combination of weighting coefficients. The optimized weighting coefficients are then manually verified and confirmed by medical record management personnel before taking effect. Upper and lower limits are set for each coefficient to ensure that the weights conform to business logic. Through adaptive weighting optimization, the system can adapt to the business access characteristics of different medical institutions, further improving the resource matching degree of tiered storage.
[0047] Specifically, the high-frequency optimized block-linked skip list construction method includes: The system stores ordered archive records using memory blocks as linked list nodes, and sets the maximum number of records to be stored in a single block to MAX_BLOCK_SIZE. It constructs a multi-level probabilistic skip list index to achieve logarithmic search efficiency. The system automatically splits when the memory block is full and automatically merges when the storage is sparse. When inserting a new record, the system quickly locates the target block through a high-level index and performs precise insertion using binary search within the block.
[0048] Specifically, the delay monitoring and cooling migration mechanism includes: continuously monitoring patient activity, starting a timer when the activity exceeds the limit; and performing cross-storage data migration when the duration of the activity exceeding the threshold reaches the delay threshold and the time since the last data migration exceeds the structure cooling cycle.
[0049] Specifically, it also includes real-time collection and storage of tamper-proof end-to-end lineage data throughout the entire process from S1 to S5. The lineage data includes data source information, image processing parameter information, storage change operation information, and quality inspection and archiving audit information. Data source information includes file number, acquisition device, original image storage path, acquisition time, and file type; image processing information includes image preprocessing parameters, number of separation and shrinkage iterations, OCR model version, and single-character recognition confidence; storage change information includes initial allocated storage type, data migration time, rebalancing / block splitting operation records, and memory logical address changes; archive audit information includes quality inspection results, manual review records, warehousing time, and operator identification.
[0050] Furthermore, the lineage data is stored using a hash chain, with each lineage record containing a hash digest of the previous record. The hash chain is updated in conjunction with the generation of a new record. Key operation records are attached with the digital signatures of the operators. Tampering with any node will cause the hash chain to break, thus achieving immutability of the entire operation chain.
[0051] In a specific embodiment of the present invention, the BERT-NER model, which is finely tuned in the medical field, is used to perform named entity extraction on the text of the standardized archives, and five types of medical entities are extracted: patient, diagnosis, medicine, examination, and surgery. The patient entity includes attributes of name, ID number, and hospitalization number, and the diagnosis entity includes attributes of disease name and ICD code.
[0052] A medical and health knowledge graph is constructed, with five types of medical entities—patients, diagnoses, drugs, examinations, and surgeries—as the vertices of the graph, and the medical relationships between entities as the edges. The types of edges include patient-having-diagnosis, patient-using-drugs, patient-receiving-examination, and patient-receiving-surgery. The patient entity is the core node, which is associated with all diagnosis and treatment-related entities of the patient to form a personal health sub-graph.
[0053] The total number of edges associated with each patient entity (i.e., the number of valid medical records) is counted, and this value is defined as the patient activity level.
[0054] The preset activity threshold is 50, and differentiated storage is performed based on the patient's activity level. Low-frequency patient records with activity levels ≤ a threshold are stored in a shared non-uniform compressed memory array: the LZ77 lossless compression algorithm is used to store the record data, and the compression ratio is dynamically set according to the activity level, with a higher compression ratio for lower activity levels; a non-uniform rebalancing strategy is executed periodically to merge contiguous storage fragments, dynamically allocate storage gaps, and optimize storage space utilization.
[0055] For high-frequency patient records with activity levels exceeding a threshold, a high-frequency optimized block-linked skip list is used: memory blocks are used as linked list nodes to store ordered record information, with a maximum block size of MAX_BLOCK_SIZE=100; a 3-level probabilistic skip list index is constructed to achieve O(log n) level logarithmic search efficiency; when a memory block contains 100 records, it is automatically split into two equal-sized memory blocks; when the sum of records in two adjacent memory blocks is less than 60, they are automatically merged; when inserting a new record, the target memory block is quickly located using the high-level skip list index, and the precise insertion position is determined within the block using binary search.
[0056] Configure an activity delay monitoring and cooldown migration mechanism to continuously monitor the activity of each patient; when a patient's activity exceeds the threshold, a timer is started. If the duration of the activity exceeding the threshold reaches a delay threshold of 7 days, and the time interval from the last data migration reaches a structural cooldown cycle of 30 days, then a cross-storage structure data migration is performed; otherwise, when the activity is continuously below the threshold and the conditions are met, reverse migration is performed; this is to filter out frequent data migrations caused by short-term activity fluctuations.
[0057] Specifically, a digitization archiving system for paper medical records based on enhanced image recognition includes: Standardized image acquisition and preprocessing module: used to acquire the original images of paper archives, obtain standardized images after preprocessing, and then output enhanced images after Gaussian filtering for noise reduction; Enhanced text segmentation and recognition module: Generates a text line hash mask with pixel coordinates based on the enhanced image, processes the text line hash mask to obtain the corrected text feature map, and uses a two-branch CNN model to perform text recognition on the corrected text feature map lines, and outputs the original text; Multi-type archive structured verification module: It is used to preset medical record keyword dictionary and invoice template dictionary, and can automatically distinguish the type based on the title; it performs cell mapping matching, keyword post-text association and invoice field format verification on the original text respectively, and distinguishes between standard archives and archives to be reprocessed; Knowledge Graph and Hierarchical Dynamic Storage Module: Natural language processing is used to perform named entity extraction on the text of the standardized archives, extracting five types of medical entities: patients, diagnoses, drugs, examinations, and surgeries, and constructing a health graph with patients as vertices and diagnoses, drugs, examinations, and surgeries as edges. Based on the health graph, patient activity is determined, and hierarchical dynamic storage is performed according to patient activity. The end-to-end data lineage management module is used to collect operation logs from each module in real time, and has a built-in tamper-proof lineage database and a full-process traceability retrieval unit. Unified archiving storage module: Used to sequentially check the resolution and field compliance of enhanced images; if they fail to meet the requirements, they are rolled back and re-sampled; once all images pass the test, they are stored in the main database for archiving.
[0058] In another optional embodiment of the present invention, for conventional medical billing documents with fixed formats and high standardization, an end-to-end hybrid processing architecture is adopted to improve processing efficiency: an end-to-end layout parsing model finely tuned to medical bill data (such as a medical-specific layout model finely tuned based on the LayoutLM series or DocVQA type models) is used as input, and the pre-processed and enhanced bill image is directly output to directly output the text recognition result with field category labels, replacing the original step-by-step process of text line mask generation, segmentation correction, and line-by-line recognition, reducing manual preset layout rules and reducing the processing time of a single standardized bill; this hybrid architecture retains the front-end image preprocessing stage, and eliminates the impact of quality problems such as paper wrinkles and uneven lighting on the end-to-end model recognition accuracy through Gaussian filtering for noise reduction, perspective correction, and contrast enhancement; at the same time, it retains the back-end multi-type archive structure verification module, which performs format verification, numerical verification, and mandatory field checks on the fields output by end-to-end. Bills that fail the verification are automatically reverted to the original step-by-step enhancement recognition process for secondary processing, which not only improves the processing efficiency of standardized bills, but also ensures the overall recognition accuracy and data compliance.
[0059] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0060] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for digitizing and archiving paper medical records based on enhanced image recognition, characterized in that, include: S1. Collect the original images of paper archives, obtain standardized images after preprocessing, and then output enhanced images after Gaussian filtering to remove noise. S2. Generate a text line hash mask with pixel coordinates based on the enhanced image, process the text line hash mask to obtain the corrected text feature map, and use a dual-branch CNN model to perform text recognition on the corrected text feature map lines to output the original text. S3. Preset medical record keyword dictionary and invoice template dictionary to verify the original text and distinguish between standard files and files to be reprocessed; S4. Check the resolution and field compliance of the enhanced image in sequence. If it is not qualified, roll back and re-collect. After all are qualified, store it in the main database for archiving. S5. Named entity extraction is performed on the text of the standardized archives through natural language processing to construct a health graph. The activity level of patients is confirmed based on the health graph, and the data is dynamically stored in layers according to the activity level of patients.
2. The method for digitizing and archiving paper medical records based on enhanced image recognition according to claim 1, characterized in that, The preprocessing process in S1 includes: sequentially performing image correction, irrelevant background cropping, standard size filling, and ticket selection reverse cropping on the original image of the paper archive to obtain a standardized image; the ticket selection reverse cropping includes: calling a preset original ticket size border library to match the ticket specifications, selecting a single target ticket in the filled image, and reverse cropping to remove the pasted blank background to obtain an independent standardized image.
3. The method for digitizing and archiving paper medical records based on enhanced image recognition according to claim 1, characterized in that, The corrected text feature map obtained in S2 specifically includes: The standardized image is input into the OCR engine to generate an initial text line mask, and a pixel hash table is built. The key of the hash table is the pixel coordinate and the value is the set of the text line label to which it belongs. Traverse the hash table. If the same pixel corresponds to multiple text line labels, it is determined to be a conflicting pixel. The conflicting pixel label is reset to an undefined label, and the separated text line mask is output. Set the number of shrinkage iterations and the noise threshold, cyclically identify weak noise pixels on the mask edge and remove them layer by layer, and output a clean core text line segmentation mask; Thin plate spline transformation corrects the geometric deformation of text lines, outputting a regular rectangular text feature map, thus obtaining the corrected text feature map.
4. The method for digitizing and archiving paper medical records based on enhanced image recognition according to claim 1, characterized in that, In step S3, the verification of the original text includes performing table cell mapping matching, keyword-related text extraction, and invoice field format verification on the original text according to the file type, and distinguishing between standard files and files to be reprocessed based on the verification results.
5. The method for digitizing and archiving paper medical records based on enhanced image recognition according to claim 1, characterized in that, In S5, a pre-defined treatment type weight dictionary and a disease severity grading table are used. Based on each treatment record associated with the patient vertex in the health graph, the patient activity is calculated by weighting the corresponding type basic weight and the disease severity coefficient. An activity threshold is set, and the storage structure is determined according to the activity threshold. If the activity is less than or equal to the threshold, it is stored in a shared non-uniform compressed memory array. If the activity is greater than the threshold, it is stored in a high-frequency optimized block-linked skip list. Configure an activity delay monitoring and cooling migration mechanism to filter short-term activity fluctuations and then perform cross-structure data migration; implement an uneven rebalancing strategy for compressed arrays to dynamically allocate storage gaps; and have a built-in automatic maintenance mechanism for block splitting and merging in the block-linked skip list.
6. The method for digitizing and archiving paper medical records based on enhanced image recognition according to claim 5, characterized in that, The high-frequency optimized block-linked skip list construction method includes: The system stores ordered archive records using memory blocks as linked list nodes, and sets the maximum number of records to be stored in a single block to MAX_BLOCK_SIZE. It constructs a multi-level probabilistic skip list index to achieve logarithmic search efficiency. The system automatically splits when the memory block is full and automatically merges when the storage is sparse. When inserting a new record, the system quickly locates the target block through a high-level index and performs precise insertion using binary search within the block.
7. The method for digitizing and archiving paper medical records based on enhanced image recognition according to claim 5, characterized in that, The delay monitoring and cooling migration mechanism includes: continuously monitoring patient activity, starting a timer when activity exceeds the limit; and performing cross-storage data migration when the duration of activity exceeding the threshold reaches the delay threshold and the time since the last data migration exceeds the structure cooling cycle.
8. The method for digitizing and archiving paper medical records based on enhanced image recognition according to claim 1, characterized in that, It also includes real-time collection and storage of tamper-proof end-to-end lineage data throughout the entire process from S1 to S5. The lineage data includes data source information, image processing parameter information, storage change operation information, and quality inspection and archiving audit information. Data source information includes file number, acquisition device, original image storage path, acquisition time, and file type; image processing information includes image preprocessing parameters, number of separation and shrinkage iterations, OCR model version, and single-character recognition confidence; storage change information includes initial allocated storage type, data migration time, rebalancing / block splitting operation records, and memory logical address changes; archive audit information includes quality inspection results, manual review records, warehousing time, and operator identification.
9. A digital archiving system for paper medical records based on enhanced image recognition, characterized in that, include: Standardized image acquisition and preprocessing module: used to acquire the original images of paper archives, obtain standardized images after preprocessing, and then output enhanced images after Gaussian filtering for noise reduction; Enhanced text segmentation and recognition module: Generates a text line hash mask with pixel coordinates based on the enhanced image, processes the text line hash mask to obtain the corrected text feature map, and uses a two-branch CNN model to perform text recognition on the corrected text feature map lines, and outputs the original text; Multi-type archive structured verification module: used to preset medical record keyword dictionary and invoice template dictionary, and can automatically distinguish the type based on the title; Perform cell mapping matching, keyword-after-text association, and invoice field format validation on the original text respectively to distinguish between standardized files and files to be reprocessed; Knowledge graph and hierarchical dynamic storage module: Named entity extraction is performed on the text of the standardized archives through natural language processing to construct a health graph. The activity level of patients is determined based on the health graph, and hierarchical dynamic storage is performed based on the activity level of patients. The end-to-end data lineage management module is used to collect operation logs from each module in real time, and has a built-in tamper-proof lineage database and a full-process traceability retrieval unit. Unified archiving storage module: Used to sequentially check the resolution and field compliance of enhanced images; if they fail to meet the requirements, they are rolled back and re-sampled; once all images pass the test, they are stored in the main database for archiving.
