Method for establishing medical consumable original code intelligent analysis model based on deep learning
By automatically parsing the original code of medical consumables using a deep learning model, the problems of low efficiency of manual data entry and low accuracy of traditional OCR recognition in existing technologies have been solved, achieving efficient and secure management and traceability of consumables.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN EYE HOSPITAL
- Filing Date
- 2026-03-06
- Publication Date
- 2026-06-19
AI Technical Summary
The current technology for parsing the original code of medical consumables relies on manual input, which is inefficient and prone to errors. Traditional OCR technology has difficulty recognizing original codes that combine graphics and characters, resulting in low recognition accuracy, high cost of secondary code pasting, and security risks.
A deep learning-based intelligent parsing model for medical consumable source code is adopted. By integrating CNN spatial feature extraction and LSTM temporal modeling, a multi-category consumable source code dataset is constructed. The model is iteratively trained and optimized. Combined with format verification and QR code generation, automated parsing and seamless integration with hospital information systems are achieved.
It significantly improves the accuracy and robustness of original code parsing for medical consumables, reduces labor and material costs, avoids errors in secondary code labeling, and achieves efficient, safe, and transparent full-process traceability for consumable management.
Smart Images

Figure CN122245665A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical consumables technology, specifically to a method for establishing a deep learning-based intelligent parsing model for medical consumables source code. Background Technology
[0002] In the process of digital transformation in the healthcare industry, the refined management of medical consumables throughout the entire process is a key link in improving medical quality, controlling medical costs, and ensuring medical safety. Medical consumables are diverse, covering multiple major categories such as disposable sterile devices, implantable consumables, medical dressings, and laboratory reagents. Different types of medical consumables, produced by different manufacturers, are marked with unique original codes. These codes contain core information such as the consumable name, specifications, manufacturer, production date, expiration date, and batch number, serving as crucial evidence for consumable traceability, inventory management, billing calculation, and clinical use supervision.
[0003] Currently, hospitals primarily rely on manual input or traditional Optical Character Recognition (OCR) technology to parse the original codes of medical consumables. Manual input is inefficient and prone to errors and omissions due to human negligence, failing to meet the management needs of hospitals managing massive quantities of consumables. While traditional OCR technology can automatically recognize some characters, the types of original codes for medical consumables are diverse. Besides regular character-based codes, there are numerous composite codes combining graphics and characters. These codes have interwoven graphic and character elements, making it difficult for traditional OCR technology to effectively distinguish and recognize them. Furthermore, the accuracy rate is low due to factors such as the printing quality of the original code, the shooting angle, and lighting conditions. To address the shortcomings of existing parsing technologies, some hospitals are attempting to compensate for the deficiencies in original code parsing by manually re-attaching standardized barcodes or QR codes to medical consumables. However, this method presents significant cost and security issues: on the one hand, secondary labeling requires substantial labor and material costs; on the other hand, the secondary labeling process is prone to errors such as labeling errors, omissions, and duplicate labeling, and manual operation may damage the packaging of consumables, increasing the risk of contamination. Furthermore, the information in the secondary label may differ from the original label, leading to traceability confusion, billing errors, and other security risks, failing to fundamentally guarantee the accuracy and security of medical consumable management. Therefore, this method does not meet current needs. To address this, we propose a deep learning-based intelligent parsing model for medical consumable original labels. Summary of the Invention
[0004] The purpose of this invention is to provide a method for establishing an intelligent parsing model for medical consumable source code based on deep learning. This method effectively improves the generalization ability of the model, enabling it to adapt to the parsing needs of medical consumable source code in different scenarios. It can effectively identify various types of medical consumable source code, such as character-based and graphic-based combinations, significantly improving parsing accuracy and robustness. This ensures the accuracy and standardization of the parsing results and achieves seamless integration of the parsing results with the hospital's existing management system without additional manual intervention, significantly improving the efficiency of medical consumable management. By converting standardized parsing information into QR codes, it facilitates the full-process traceability management of medical consumables. Medical staff and managers can quickly obtain core information about consumables by scanning the codes, improving the convenience and transparency of consumable management and solving the problems mentioned in the background technology.
[0005] To achieve the above objectives, the present invention provides the following technical solution: A method for establishing a deep learning-based intelligent parsing model for medical consumable source code includes the following steps: S1: Collect source code samples of medical consumables from multiple categories and manufacturers, and complete the preprocessing, labeling, and dataset partitioning of the source code samples of medical consumables. S2: Construct an analytical model that integrates CNN spatial feature extraction and LSTM temporal modeling; S3: Iteratively train the analytical model based on the partitioned dataset to obtain the optimized analytical model; S4: Utilize the optimized analytical model to intelligently parse the preprocessed original image of medical consumables; S5: Perform format and logic checks on the parsed results, process abnormal data, and then standardize and organize the parsed content. S6: Establish a standardized mapping rule base between parsed content and core fields of the hospital information system to seamlessly connect the parsed data with the hospital management system; S7: Call the QR code generation algorithm to convert standardized parsed information into traceable QR codes, and complete quality inspection and associated storage.
[0006] Preferably, the preprocessing, labeling, and dataset partitioning of the medical consumable source code samples specifically include: The collected original code samples of medical consumables were processed into grayscale, and an adaptive threshold segmentation algorithm was used to binarize the images to remove background noise. Geometric correction was then performed on the binarized images. The corrected samples are normalized in size using a bilinear interpolation algorithm, and then data augmentation is performed on the normalized samples. The LabelImg annotation tool was used to annotate the preprocessed medical consumable source code samples. After annotation, the label information was converted into an XML file in VOC format, with one XML label file corresponding to each medical consumable source code sample. The preprocessed and labeled source code sample dataset is divided into training set, validation set and test set in a ratio of 7:2:1.
[0007] Preferably, the training and optimization of the analytical model specifically includes: The divided training set is input into the constructed analytical model for iterative training. After training, the validation set is input into the analytical model for validation. After validation, optimization is performed. The partitioned test set is input into the optimized parsing model, and the parsing accuracy, recall, F1 score, and parsing speed of the model are calculated as performance evaluation indicators.
[0008] Preferably, the training and optimization of the parsing model further includes a balanced performance evaluation of the parsing model based on parsing accuracy, recall, F1 score, and parsing speed, including: Three model testing environments are set up, including an ideal benchmark environment, a normal interference environment, and a batch processing environment. The environmental conditions of the ideal reference environment are as follows: Image conditions: High-resolution source images after S2 step correction and normalization are used; Load conditions: The model runs in single-image inference mode without batch processing; System conditions: There are no other competing processes when running on the test server, and the CPU utilization, memory utilization, and GPU utilization are all below the preset utilization threshold. The environmental conditions of the conventional interference environment are as follows: Image conditions: Gaussian noise interference simulating the actual acquisition process is applied to the original image, and the standard deviation of Gaussian noise σ ranges from 0.01 to 0.02; Load conditions: The model runs in single-image inference mode without batch processing; System conditions: There are no other competing processes when running on the test server, and the CPU utilization, memory utilization, and GPU utilization are all lower than the preset utilization threshold. The environmental conditions of the extreme quality environment are as follows: Image conditions: High-resolution original images after S2 step correction and normalization are used; Load conditions: The model performs inference according to a fixed batch image size to simulate the business scenario of continuously scanning images for storage. The fixed batch is 16 or 32 images; System conditions: There are no more than 3 other competing processes when running on the test server, and at least one of the CPU utilization, memory utilization, and GPU utilization is lower than the preset utilization threshold. The parsing accuracy, recall, F1 score, and parsing speed of the parsing model under three model testing environments are used to obtain the balanced timeliness index. The performance of the parsing model is then evaluated using the balanced timeliness index corresponding to the parsing model under the three model testing environments.
[0009] Preferably, the parsing accuracy, recall, F1 score, and parsing speed of the parsing model under three model testing environments are used to obtain the balanced timeliness index. The performance of the parsing model is then evaluated using the balanced timeliness index corresponding to the parsing model under the three model testing environments, including: The parsing model was run twice in each test environment, and the parsing accuracy, recall, F1 score and parsing speed of the parsing model were obtained for each run in each test environment. Retrieve the parsing accuracy, recall, F1 score, and parsing speed of the parsing model for each run of the test in each test environment; The equilibrium efficiency index of the parsing model for each run of the test in each test environment is obtained by using the parsing accuracy, recall, F1 score and parsing speed of the parsing model for each run of the test in each test environment. The absolute difference of the equilibrium time efficiency index of the analytical model in two runs under the same test environment is processed to obtain the absolute difference of the equilibrium time efficiency index of the analytical model in two runs under the same test environment. The equilibrium timeliness evaluation parameters of the analytical model are obtained by using the absolute difference of the equilibrium timeliness index of two runs of the analytical model in the same test environment under three test environments and the average value of the equilibrium timeliness index in the same test environment. The balanced time-efficiency evaluation parameters of the analytical model are compared with preset parameter thresholds. If the balanced time-efficiency evaluation parameters are lower than the preset parameter thresholds, the analytical model is retrained.
[0010] Preferably, S4 specifically includes: Obtain the original image of the medical consumable to be parsed, and preprocess the original image of the medical consumable to be tested to obtain a standardized image to be parsed; The standardized image to be analyzed is input into the optimized analytical model, which then extracts the spatial features from the image. Temporal modeling and semantic association analysis are performed on the feature sequence, and the preliminary parsing results of the original code to be parsed are finally output.
[0011] Preferably, the process of format verification and standardization of the parsed results specifically includes: Construct a format verification rule base for the source code parsing results, and verify each of the initial parsing results based on the verification rule base; The abnormal parsing results of the tags are classified and processed. If the error is due to a format error, regular expressions are used to correct the format of the abnormal field. If data is missing, it can be completed by magnifying a portion of the original image or by combining the original code format of consumables from the same manufacturer and of the same type. If there is a logical conflict, an error message will be output for manual verification and correction. The validated and corrected parsing results are organized in a standardized format according to a preset standardization method. After the standardization process is completed, a standardized parsing dataset is generated.
[0012] Preferably, the standardization process of mapping the parsed content to the fields of the hospital information system specifically includes: Establish a mapping relationship between the fields of the standardized parsed dataset and the core fields of the hospital information system. For fields with one-to-one mapping, directly establish mapping rules. The standardized parsed dataset is written into the database of the hospital information system according to the mapping relationship in the field mapping rule base. During the mapping process, the uniqueness of the field values is checked. The mapped data is validated. If mapping errors are found, the field mapping rules are readjusted and the mapping process is re-executed.
[0013] Preferably, the process of calling the QR code generation algorithm to convert standardized information into a QR code specifically includes: The selected QR code generation algorithm converts the generated standardized parsed dataset into a JSON format string, which is then used as the storage data for the QR code. The qrcode library in Python is used to generate QR codes, producing QR code images containing standardized information. The generated QR code image undergoes quality inspection. Once the quality inspection is passed, the QR code image is associated with and stored along with the corresponding medical consumable information.
[0014] Preferably, the process of performing quality detection on the generated QR code image specifically includes: The image sharpness evaluation algorithm is used to calculate the sharpness value of the QR code image, the contrast of the QR code image is calculated using the contrast calculation formula, and random occlusion test is performed on the QR code image. If the quality inspection fails, adjust the version, size, or error correction level of the QR code and regenerate the QR code; After passing quality inspection, the QR code image is associated with and stored with the corresponding medical consumable information for subsequent traceability and management of the consumables.
[0015] Compared with the prior art, the beneficial effects of the present invention are: This invention constructs a dataset of medical consumable source codes covering multiple categories, manufacturers, and types, providing ample and comprehensive data support for training the parsing model. This dataset can adapt to the parsing needs of medical consumable source codes in different scenarios. The parsing model is built using a CNN and LSTM fusion architecture, effectively recognizing various types of medical consumable source codes, including character-based and graphic-based codes. The parsing accuracy and robustness are significantly improved, fundamentally avoiding the low accuracy problem of traditional parsing techniques. This eliminates the need for secondary code pasting to compensate for parsing defects, greatly reducing the labor, material, and equipment costs required for secondary code pasting in hospitals. Furthermore, the model is optimized through transfer learning and hyperparameter optimization, further enhancing its feature extraction capabilities and generalization performance, ensuring stable operation even in complex environments. By constructing a verification rule base, comprehensive verification of the parsed results is achieved. Combined with regular expressions and manual verification, anomaly handling methods ensure the accuracy and standardization of the parsed results, avoiding problems such as labeling errors, omissions, and information deviations that are prone to occur during secondary labeling. This eliminates security risks such as contamination and traceability confusion caused by secondary labeling. The standardized parsed content can be directly mapped to fields in the hospital information system, achieving seamless integration between the parsed results and the hospital's existing management system without additional manual intervention. This significantly improves the efficiency of medical consumables management. Converting standardized parsed information into QR codes facilitates full-process traceability management of medical consumables. Medical staff and managers can quickly obtain core information about consumables by scanning the codes, improving the convenience and transparency of consumables management. Attached Figure Description
[0016] Figure 1 A diagram illustrating the method for establishing a deep learning-based intelligent parsing model for medical consumables source code in this invention; Figure 2 This is a flowchart illustrating the analysis of the source code for the medical consumables of this invention. Figure 3 Flowchart for quality inspection of QR code images in this invention. Detailed Implementation
[0017] 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.
[0018] To address the issues of low efficiency, error-proneness, and inaccuracy in manual data entry, which hinders the management of massive amounts of consumables and makes it difficult to effectively recognize complex original codes combining graphics and characters, resulting in low accuracy, please refer to [link to relevant documentation]. Figures 1-3 This embodiment provides the following technical solution: A method for establishing a deep learning-based intelligent parsing model for medical consumable source code includes the following steps: S1: Collect source code samples of medical consumables from multiple categories and manufacturers, and complete the preprocessing, labeling, and dataset partitioning of the source code samples of medical consumables. S2: Construct an analytical model that integrates CNN spatial feature extraction and LSTM temporal modeling; S3: Iteratively train the analytical model based on the partitioned dataset to obtain the optimized analytical model; S4: Utilize the optimized analytical model to intelligently parse the preprocessed original image of medical consumables; S5: Perform format and logic checks on the parsed results, process abnormal data, and then standardize and organize the parsed content. S6: Establish a standardized mapping rule base between parsed content and core fields of the hospital information system to seamlessly connect the parsed data with the hospital management system; S7: Call the QR code generation algorithm to convert standardized parsed information into traceable QR codes, and complete quality inspection and associated storage.
[0019] Preprocessing, labeling, and dataset partitioning of medical consumable source code samples, specifically including: The collected original code samples of medical consumables were processed into grayscale, and an adaptive threshold segmentation algorithm was used to binarize the images to remove background noise. Geometric correction is performed on the binarized image. During the correction process, Hough transform is used to detect straight line edges in the image, determine the tilt angle of the original code region, and perform rotation correction based on the tilt angle. The corrected samples are normalized by using a bilinear interpolation algorithm, scaling all original samples of medical consumables to a uniform pixel size. Finally, data augmentation is performed on the normalized samples. Data augmentation methods include random flipping, random rotation, random scaling, brightness adjustment, and contrast adjustment. The LabelImg annotation tool was used to annotate the preprocessed medical consumable source code samples. The annotation content included the bounding box coordinates of the source code area and the corresponding semantic information, including the consumable name, specifications, manufacturer, production date, expiration date, product batch number, and product registration certificate number. For graphic combination source codes, the type, position, and relationship with character elements of the graphic elements were additionally annotated. After annotation, the label information was converted into a VOC format XML file, with one XML tag file corresponding to each medical consumable source code sample. The preprocessed and labeled source code sample dataset is divided into training set, validation set and test set in a ratio of 7:2:1.
[0020] The analytical model based on the fusion architecture of CNN and LSTM consists of an input layer, a CNN feature extraction module, a feature sequence transformation module, an LSTM sequence modeling module, a fully connected layer, and an output layer, connected sequentially. The specific structure of each module is as follows: The input layer is used to receive pre-processed original code samples of medical consumables; The CNN feature extraction module reduces the dimensionality of the feature map while retaining key features. After processing by the CNN feature extraction module, the output feature map has a dimension of 8×32×512. It adopts a structure of alternating 4 convolutional layers, 4 batch normalization layers, 4 activation function layers, and 2 max pooling layers. Each convolutional layer is followed by a batch normalization layer to accelerate model training convergence and suppress overfitting. The batch normalization layer is followed by a ReLU activation function layer to enhance the non-linear expressive power of the model. The second and fourth activation function layers are followed by max pooling layers, respectively. The feature sequence transformation module is used to transform the 8×32×512 dimension feature map output by the CNN feature extraction module into a 32×4096 dimension feature sequence, where 32 is the sequence length and 4096 is the feature dimension of each sequence node. During the transformation, the height direction of the feature map is used as the time step dimension of the sequence, and the channel dimension and width dimension of the feature map are flattened to obtain the feature vector corresponding to each time step. The LSTM sequence modeling module utilizes a two-layer bidirectional LSTM network structure, with each layer containing 1024 hidden units. The first layer receives a 32×4096-dimensional feature sequence from the feature sequence transformation module, performs forward and backward temporal modeling on the feature sequence, and outputs a 32×2048-dimensional bidirectional feature sequence. The second layer further extracts temporal features and models semantic associations from the bidirectional feature sequence output by the first layer, outputting a final 32×2048-dimensional temporal feature sequence. A Dropout layer with a probability of 0.5 is placed between the two LSTM layers to suppress model overfitting. The fully connected layer receives the 32×2048-dimensional temporal feature sequence output by the LSTM sequence modeling module and maps the 2048-dimensional feature vector of each sequence node to a preset category space. The category space contains all possible character categories, graphic categories, and semantic field categories in the original code. The output dimension of the fully connected layer is 32×N, where N is the total number of categories. The output layer is used to normalize the probability of the fully connected layer's output using the Softmax activation function, obtaining the probability distribution of each sequence node for each category, and finally outputting the parsing results of the original code. The parsing results include the recognition results of each character in the original code, the recognition results of graphic elements, and the extraction results of each semantic field.
[0021] Training and optimization of the analytical model specifically includes: The initial learning rate of the analytical model was set to 0.001. The Adam optimizer was used as the optimization algorithm for the model, and the cross-entropy loss function was used to measure the difference between the analytical model's prediction results and the true labels. The divided training set is input into the constructed analytical model for iterative training. The batch size is set to 32, and the number of training iterations is set to 100 epochs. After each epoch, the validation set is input into the analytical model, and the loss value and analytical accuracy of the analytical model on the validation set are calculated. If the validation set loss value of the current epoch decreases by more than 0.001 compared to the previous epoch, training continues. If the validation set loss value does not decrease for 5 consecutive epochs, and the analytical accuracy does not improve, a learning rate decay strategy is adopted, and the learning rate is adjusted to 0.5 times the current learning rate, and training continues. An early stopping strategy is employed to prevent overfitting. Training is stopped when the validation set loss value does not decrease for 10 consecutive epochs, and the model with the smallest validation set loss value at this point is saved as the initial training model. Transfer learning optimization is then performed on the initial training model. The convolutional layer parameters of a pre-trained ResNet50 model are introduced to initialize the first two convolutional layers of the CNN feature extraction module. The parameters of the first two convolutional layers are frozen, and only the parameters of the remaining layers are trained, further improving the model's feature extraction capability and generalization performance. Finally, a grid search method is used to optimize the model's hyperparameters. The hyperparameters to be optimized include the number of LSTM hidden layer units, Dropout probability, and learning rate. The hyperparameter search range is: 800-1200 LSTM hidden layer units, 0.3-0.7 Dropout probability, and 0.0001-0.001 learning rate. The hyperparameter combination with the highest validation set resolution accuracy is selected as the final hyperparameters of the model. The divided test set is input into the optimized parsing model, and the parsing accuracy, recall, F1 score, and parsing speed are calculated as performance evaluation indicators. Parsing accuracy = (number of correctly parsed source code samples / total number of test set samples) × 100%; recall = (number of correctly parsed semantic fields / total number of semantic fields in the source code of the test set) × 100%; F1 score = 2 × parsing accuracy × recall / (parsing accuracy + recall); parsing speed = total number of test set samples / total time required for the model to parse the test set. When parsing accuracy ≥ 98%, recall ≥ 97%, F1 score ≥ 97.5%, and parsing speed ≥ 10 frames / second, the model is deemed to meet the practical application requirements. If not, the training parameters are readjusted or the model is returned to S1 to supplement source code sample data and re-construct the dataset and retrain the model.
[0022] Specifically, the training and optimization of the analytical model further includes a balanced performance evaluation of the analytical model based on parsing accuracy, recall, F1 score, and parsing speed, including: Three model testing environments are set up, including an ideal benchmark environment, a normal interference environment, and a batch processing environment. The environmental conditions of the ideal reference environment are as follows: Image conditions: High-resolution source images after S2 step correction and normalization are used; Load conditions: The model runs in single-image inference mode without batch processing; System conditions: There are no other competing processes when running on the test server, and the CPU utilization, memory utilization, and GPU utilization are all below the preset utilization threshold. The environmental conditions of the conventional interference environment are as follows: Image conditions: Gaussian noise interference simulating the actual acquisition process is applied to the original image, and the standard deviation of Gaussian noise σ ranges from 0.01 to 0.02; Load conditions: The model runs in single-image inference mode without batch processing; System conditions: There are no other competing processes when running on the test server, and the CPU utilization, memory utilization, and GPU utilization are all lower than the preset utilization threshold. The environmental conditions of the extreme quality environment are as follows: Image conditions: High-resolution original images after S2 step correction and normalization are used; Load conditions: The model performs inference according to a fixed batch image size to simulate the business scenario of continuously scanning images for storage. The fixed batch is 16 or 32 images; System conditions: There are no more than 3 other competing processes when running on the test server, and at least one of the CPU utilization, memory utilization, and GPU utilization is lower than the preset utilization threshold. The parsing accuracy, recall, F1 score, and parsing speed of the parsing model under three model testing environments are used to obtain the balanced time efficiency index. The performance of the parsing model is then evaluated using the balanced time efficiency index corresponding to the parsing model under the three model testing environments.
[0023] This embodiment establishes a hierarchical testing environment system covering three typical scenarios: ideal benchmark, normal interference, and batch processing. It balances basic model performance verification, anti-interference capability testing, and batch business adaptability testing, overcoming the limitations of a single testing environment. This allows the evaluation results to better reflect the complex application scenarios of actual business, comprehensively exploring the model's performance under different operating conditions. Simultaneously, it selects multi-dimensional evaluation indicators such as parsing accuracy, recall, F1 score, and parsing speed, focusing on both parsing accuracy and inference efficiency, achieving a dual consideration of accuracy and speed. This avoids performance imbalances caused by single-indicator evaluation, ensuring that the evaluation results reflect the model's overall performance. Furthermore, by calculating a balanced timeliness index to integrate the evaluation results from multiple environments and indicators, it achieves a quantitative evaluation of the model's balanced timeliness performance. This provides a clear quantitative standard for model performance, offering precise and practical guidance for training and optimizing the parsing model, and enabling targeted improvement of the model's performance weaknesses in specific scenarios. Meanwhile, the evaluation system proposed in this embodiment runs through the entire process of model training and optimization. It can effectively screen out analytical models that meet the accuracy requirements in the benchmark scenario, have strong robustness in the interference scenario, and have stable efficiency in the batch scenario. This greatly improves the model's adaptability to actual applications and ensures that the model can maintain stable and balanced timeliness performance in real business scenarios, whether facing a single high-definition image, a noisy actual acquired image, or a batch of continuous scanned images.
[0024] Specifically, the parsing accuracy, recall, F1 score, and parsing speed of the parsing model under three model testing environments are used to obtain the balanced timeliness index. The balanced timeliness index corresponding to the parsing model under the three model testing environments is then used to evaluate the balanced timeliness performance of the parsing model, including: The parsing model was run twice in each test environment, and the parsing accuracy, recall, F1 score and parsing speed of the parsing model were obtained for each run in each test environment. Retrieve the parsing accuracy, recall, F1 score, and parsing speed of the parsing model for each run of the test in each test environment; The equilibrium efficiency index of the parsing model for each run of the test in each test environment is obtained by using the parsing accuracy, recall, F1 score and parsing speed of the parsing model for each run of the test in each test environment. The equilibrium efficiency index of the analytical model for each run of the test in each test environment is obtained by the following formula: EEI=[(P×R×F1)1 / 3 ]×exp[λ×(S / S ref -1)] Wherein, EEI represents the balanced time-efficiency index of the parsing model for each run of the test in each test environment. The balanced time-efficiency index is a comprehensive quantitative indicator of the accuracy and efficiency of the parsing model in a single scenario, used to measure the balanced performance of parsing and processing speed of the model in a specific test environment; P represents the parsing accuracy of the parsing model for each run of the test in each test environment; R represents the recall of the parsing model for each run of the test in each test environment; F1 represents the F1 score of the parsing model for each run of the test in each test environment; S represents the parsing speed of the parsing model for each run of the test in each test environment; S ref This represents the preset baseline parsing speed that meets the minimum real-time requirements of the business; λ represents the sensitivity coefficient, with a value range of 1.15-1.43. The absolute difference of the equilibrium time efficiency index of the analytical model in two runs under the same test environment is processed to obtain the absolute difference of the equilibrium time efficiency index of the analytical model in two runs under the same test environment. The equilibrium timeliness evaluation parameters of the analytical model are obtained by using the absolute difference of the equilibrium timeliness index of two runs of the analytical model in the same test environment under three test environments and the average value of the equilibrium timeliness index in the same test environment. The equilibrium time-efficiency evaluation parameters of the analytical model are obtained through the following formula: Where EEP represents the equilibrium performance evaluation parameter of the analytical model, which is a comprehensive quantitative index of the overall performance stability and equilibrium of the analytical model, used to evaluate the overall performance and performance fluctuation of the analytical model in all test environments; m represents the total number of test environments; E pi E represents the average equilibrium timeliness index under the i-th test environment, which is the average of the equilibrium timeliness indices obtained from two test runs under that test environment; ci This represents the absolute difference of the equilibrium timeliness index under the i-th test environment, which is the absolute difference of the equilibrium timeliness index obtained from two test runs under this test environment. The balanced time-efficiency evaluation parameters of the analytical model are compared with preset parameter thresholds. If the balanced time-efficiency evaluation parameters are lower than the preset parameter thresholds, the analytical model is retrained.
[0025] This embodiment achieves a multi-dimensional quantitative evaluation of the parsing model's performance. By integrating parsing accuracy, recall, F1 score, and parsing speed to calculate the equilibrium timeliness index, it considers both the model's parsing accuracy and inference efficiency. Furthermore, it introduces benchmark speed and sensitivity coefficients, ensuring the evaluation results align with the actual real-time requirements of the business, avoiding the bias of a single indicator. Secondly, this embodiment effectively improves the stability and reliability of the evaluation results. By executing two runs in each test environment, calculating the absolute difference and average of the equilibrium timeliness index, and then generating the final equilibrium timeliness evaluation parameters using a combination formula of geometric mean and exponential penalty, it effectively reduces the randomness error of a single test, more accurately reflecting the model's true performance fluctuations in different scenarios. In addition, this solution establishes a closed-loop model optimization mechanism. By comparing the equilibrium timeliness evaluation parameters with preset thresholds, triggering model retraining when parameters fail to meet the standards, a closed-loop evaluation mechanism of evaluation, feedback, and optimization is formed. This allows for continuous iterative improvement of the model's equilibrium timeliness performance in complex business scenarios, ensuring the model always adapts to the dynamic needs of real-world business. Finally, the above technical solution has strong scenario adaptability. By integrating a tiered testing environment with multiple indicators, the model's basic performance under ideal conditions was verified, as well as its robustness and efficiency under interference and batch scenarios. This makes the evaluation results more consistent with the complex working conditions of actual business, providing a scientific and reliable basis for decision-making in the actual deployment and application of the model.
[0026] S4 specifically includes: The original image of the medical consumables to be parsed is obtained, and the original image of the medical consumables is processed by grayscale conversion, binarization, geometric correction and size normalization to obtain a standardized image to be parsed. The standardized image to be analyzed is input into the trained and optimized analytical model, which then extracts the spatial features from the image. Temporal modeling and semantic association analysis are performed on the feature sequence, and the preliminary parsing results of the original code to be parsed are finally output. The preliminary parsing results include character recognition results, image recognition results, and semantic field extraction results.
[0027] The process of format validation and standardization of the parsed results specifically includes: A format validation rule base for the source code parsing results is constructed. The initial parsing results are validated one by one according to this rule base. The format rules are as follows: production date and expiration date are in the format "YYYY-MM-DD"; product batch number is a combination of letters and numbers, with a length of 6-12 digits; product registration certificate number is in the format "National Medical Device Registration Certificate + Year + Number" or "National Medical Device Registration Certificate + Province Abbreviation + Year + Number"; data type rules are as follows: consumable name and manufacturer are string types; specifications and model are string types or string + number combinations; production date and expiration date are date types; product batch number and product registration certificate number are string types with a specific format; logical consistency rules are as follows: the expiration date must be later than the production date, and the year of the product registration certificate number must be earlier than the production date. The initial parsing results are checked one by one according to the verification rule base, and abnormal parsing results that do not conform to the verification rules are marked. The abnormal parsing results of the tags are classified and processed. If the error is due to a format error, regular expressions are used to correct the format of the abnormal field. If data is missing, it can be completed by magnifying a portion of the original image or by combining the original code format of consumables from the same manufacturer and of the same type. If there is a logical conflict, an error message will be output for manual verification and correction. The validated and corrected parsing results are organized in a standardized format according to a preset standardization format. After the standardization process is completed, a standardized parsing dataset is generated. The standardized format includes four parts: field name, field type, field length, and field value.
[0028] The process of standardizing the parsed content and mapping it to the fields of the hospital information system specifically includes: This study identifies core fields related to medical consumables in the hospital information system, including consumable ID, consumable name, specifications, manufacturer ID, manufacturer name, production date, expiration date, batch number, product registration certificate number, warehousing time, and inventory quantity. It establishes a mapping relationship between the fields in the standardized parsed dataset and the core fields of the hospital information system. For fields with one-to-one mappings, mapping rules are directly established. For fields with one-to-many or many-to-one mappings, an intermediate mapping table is used to establish the association. For example, the manufacturers in the standardized parsed dataset correspond to the manufacturer ID and manufacturer name in the hospital information system; the association mapping between the two is established through the manufacturer information table. The standardized parsed dataset is written into the hospital information system's database according to the mapping relationship in the field mapping rule base using Structured Query Language (SQL), achieving seamless integration between the parsed content and the hospital information system. During the mapping process, the uniqueness of field values is checked to avoid duplicate data entry; if duplicate data exists, the corresponding field value in the database is updated. Verify the mapped data, check whether the standardized parsed content is accurately written into the corresponding fields of the hospital information system, and verify the integrity and consistency of the data; if there are mapping errors, readjust the field mapping rules and re-execute the mapping process.
[0029] The process of converting standardized information into a QR code by calling a QR code generation algorithm includes: A QR code generation algorithm was selected that supports storage of multiple data formats. The error correction level was set to H level to ensure that the QR code can still be recognized normally even if it is partially damaged. The generated standardized parsing dataset was converted into a JSON format string as the storage data of the QR code. The JSON format string contains all standardized semantic fields and their corresponding field values. The qrcode library in Python is used to generate QR codes, producing QR code images containing standardized information. The generated QR code images undergo quality inspection, with inspection indicators including QR code clarity, contrast, and error correction capability. After passing the quality inspection, the QR code images are associated with and stored with the corresponding medical consumable information for subsequent traceability and management of the consumables.
[0030] The process of performing quality checks on the generated QR code image specifically includes: An image sharpness evaluation algorithm is used to calculate the sharpness value of the QR code image. When the sharpness value is ≥0.8, it is judged as sharp. Calculate the gradient magnitude of each pixel and the variance of the gradient magnitudes of all pixels. This variance is the sharpness value of the QR code image. The larger the variance, the sharper the image. The contrast of the QR code image is calculated using a contrast calculation formula. If the contrast is ≥3, it is considered qualified. If a QR code image can still be accurately identified when the occlusion area does not exceed 15%, its error correction capability is considered qualified. If the quality inspection fails, adjust the version, size, or error correction level of the QR code and regenerate the QR code; After passing quality inspection, the QR code image is associated with and stored with the corresponding medical consumable information for subsequent traceability and management of the consumables.
[0031] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0032] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention.
Claims
1. A method for establishing an intelligent parsing model of medical consumable source code based on deep learning, characterized in that, Includes the following steps: S1: Collect source code samples of medical consumables from multiple categories and manufacturers, and complete the preprocessing, labeling, and dataset partitioning of the source code samples of medical consumables. S2: Construct an analytical model that integrates CNN spatial feature extraction and LSTM temporal modeling; S3: Iteratively train the analytical model based on the partitioned dataset to obtain the optimized analytical model; S4: Utilize the optimized analytical model to intelligently parse the preprocessed original image of medical consumables; S5: Perform format and logic checks on the parsed results, process abnormal data, and then standardize and organize the parsed content. S6: Establish a standardized mapping rule base between parsed content and core fields of the hospital information system to seamlessly connect the parsed data with the hospital management system; S7: Call the QR code generation algorithm to convert standardized parsed information into traceable QR codes, and complete quality inspection and associated storage.
2. The method for establishing a deep learning-based intelligent parsing model for medical consumable source code as described in claim 1, characterized in that, The preprocessing, labeling, and dataset partitioning of the medical consumable source code samples specifically include: The collected original code samples of medical consumables were processed into grayscale, and an adaptive threshold segmentation algorithm was used to binarize the images to remove background noise. Geometric correction was then performed on the binarized images. The corrected samples are normalized in size using a bilinear interpolation algorithm, and then data augmentation is performed on the normalized samples. The LabelImg annotation tool was used to annotate the preprocessed medical consumable source code samples. After annotation, the label information was converted into an XML file in VOC format, with one XML label file corresponding to each medical consumable source code sample. The preprocessed and labeled source code sample dataset is divided into training set, validation set and test set in a ratio of 7:2:
1.
3. The method for establishing a deep learning-based intelligent parsing model for medical consumable source code as described in claim 1, characterized in that, The training and optimization of the analytical model specifically includes: The divided training set is input into the constructed analytical model for iterative training. After training, the validation set is input into the analytical model for validation. After validation, optimization is performed. The partitioned test set is input into the optimized parsing model, and the parsing accuracy, recall, F1 score, and parsing speed of the model are calculated as performance evaluation indicators.
4. The method for establishing a deep learning-based intelligent parsing model for medical consumable source code as described in claim 3, characterized in that, The training and optimization of the analytical model further includes a balanced performance evaluation of the analytical model based on parsing accuracy, recall, F1 score, and parsing speed, including: Three model testing environments are set up, including an ideal benchmark environment, a normal interference environment, and a batch processing environment. The environmental conditions of the ideal reference environment are as follows: Image conditions: High-resolution source images after S2 step correction and normalization are used; Load conditions: The model runs in single-image inference mode without batch processing; System conditions: There are no other competing processes when running on the test server, and the CPU utilization, memory utilization, and GPU utilization are all below the preset utilization threshold. The environmental conditions of the conventional interference environment are as follows: Image conditions: Gaussian noise interference simulating the actual acquisition process is applied to the original image, and the standard deviation of Gaussian noise σ ranges from 0.01 to 0.02; Load conditions: The model runs in single-image inference mode without batch processing; System conditions: There are no other competing processes when running on the test server, and the CPU utilization, memory utilization, and GPU utilization are all lower than the preset utilization threshold. The environmental conditions of the extreme quality environment are as follows: Image conditions: High-resolution original images after S2 step correction and normalization are used; Load conditions: The model performs inference according to a fixed batch image size to simulate the business scenario of continuously scanning images for storage. The fixed batch is 16 or 32 images; System conditions: There are no more than 3 competing processes on the test server, and at least one of the CPU utilization, memory utilization, and GPU utilization is lower than the preset utilization threshold. The parsing accuracy, recall, F1 score, and parsing speed of the parsing model under three model testing environments are used to obtain the balanced time efficiency index. The performance of the parsing model is then evaluated using the balanced time efficiency index corresponding to the parsing model under the three model testing environments.
5. The method for establishing a deep learning-based intelligent parsing model for medical consumable source code as described in claim 4, characterized in that, The parsing accuracy, recall, F1 score, and parsing speed of the parsing model under three model testing environments are used to obtain the balanced timeliness index. The performance of the parsing model is then evaluated using the balanced timeliness index corresponding to the parsing model under the three model testing environments, including: The parsing model was run twice in each test environment, and the parsing accuracy, recall, F1 score and parsing speed of the parsing model were obtained for each run in each test environment. Retrieve the parsing accuracy, recall, F1 score, and parsing speed of the parsing model for each run of the test in each test environment; The equilibrium efficiency index of the parsing model for each run of the test in each test environment is obtained by using the parsing accuracy, recall, F1 score and parsing speed of the parsing model for each run of the test in each test environment. The absolute difference of the equilibrium time efficiency index of the analytical model in two runs under the same test environment is processed to obtain the absolute difference of the equilibrium time efficiency index of the analytical model in two runs under the same test environment. The equilibrium timeliness evaluation parameters of the analytical model are obtained by using the absolute difference of the equilibrium timeliness index of two runs of the analytical model in the same test environment under three test environments and the average value of the equilibrium timeliness index in the same test environment. The balanced time-efficiency evaluation parameters of the analytical model are compared with preset parameter thresholds. If the balanced time-efficiency evaluation parameters are lower than the preset parameter thresholds, the analytical model is retrained.
6. The method for establishing a deep learning-based intelligent parsing model for medical consumable source code as described in claim 1, characterized in that, S4 specifically includes: Obtain the original image of the medical consumable to be parsed, and preprocess the original image of the medical consumable to be tested to obtain a standardized image to be parsed; The standardized image to be analyzed is input into the optimized analytical model, which then extracts the spatial features from the image. Temporal modeling and semantic association analysis are performed on the feature sequence, and the preliminary parsing results of the original code to be parsed are finally output.
7. The method for establishing a deep learning-based intelligent parsing model for medical consumable source code as described in claim 1, characterized in that, The process of format verification and standardization of the parsed results specifically includes: Construct a format verification rule base for the source code parsing results, and verify each of the initial parsing results based on the verification rule base; The abnormal parsing results of the tags are classified and processed. If the error is due to a format error, regular expressions are used to correct the format of the abnormal field. If data is missing, it can be completed by magnifying a portion of the original image or by combining the original code format of consumables from the same manufacturer and of the same type. If there is a logical conflict, an error message will be output for manual verification and correction. The validated and corrected parsing results are organized in a standardized format according to a preset standardization method. After the standardization process is completed, a standardized parsing dataset is generated.
8. The method for establishing a deep learning-based intelligent parsing model for medical consumable source code as described in claim 1, characterized in that, The standardization process of mapping the parsed content to fields in the hospital information system specifically includes: Establish a mapping relationship between the fields of the standardized parsed dataset and the core fields of the hospital information system. For fields with one-to-one mapping, directly establish mapping rules. The standardized parsed dataset is written into the database of the hospital information system according to the mapping relationship in the field mapping rule base. During the mapping process, the uniqueness of the field values is checked. The mapped data is validated. If mapping errors are found, the field mapping rules are readjusted and the mapping process is re-executed.
9. The method for establishing a deep learning-based intelligent parsing model for medical consumable source code as described in claim 1, characterized in that, The process of calling the QR code generation algorithm to convert standardized information into QR codes specifically includes: The selected QR code generation algorithm converts the generated standardized parsed dataset into a JSON format string, which is then used as the storage data for the QR code. The qrcode library in Python is used to generate QR codes, producing QR code images containing standardized information. The generated QR code image undergoes quality inspection. Once the quality inspection is passed, the QR code image is associated with and stored along with the corresponding medical consumable information.
10. The method for establishing a deep learning-based intelligent parsing model for medical consumable source code as described in claim 9, characterized in that, The process of performing quality detection on the generated QR code image specifically includes: The image sharpness evaluation algorithm is used to calculate the sharpness value of the QR code image, the contrast of the QR code image is calculated using the contrast calculation formula, and random occlusion test is performed on the QR code image. If the quality inspection fails, adjust the version, size, or error correction level of the QR code and regenerate the QR code; After passing quality inspection, the QR code image is associated with and stored with the corresponding medical consumable information for subsequent traceability and management of the consumables.