A disease type prediction method and system based on medical ticket and pseudo label mechanism
By using a pseudo-labeling mechanism based on medical invoices, combined with a dynamic reasoning knowledge base and a large language model, a set of pseudo-labeled diseases is generated, solving the problem of disease prediction with unlabeled data and achieving highly accurate and reliable disease prediction.
Patent Information
- Application Number
- CN202511790806.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-06-16
- Estimated Expiration
- 2045-12-01
AI Technical Summary
Existing technologies struggle to effectively utilize unlabeled medical invoice data for disease prediction, particularly in addressing complex relationships between multiple drugs and diseases, cross-institutional data discrepancies, and contextual semantic understanding.
By using a pseudo-labeling mechanism based on medical invoices, combined with a dynamic reasoning knowledge base and a large language model, a set of pseudo-labeled diseases is generated. Disease reasoning is then performed through rule-based reasoning and semantic understanding, ultimately training a multi-label disease classification model.
It significantly improves the accuracy and reliability of disease prediction, solves the bottleneck of unlabeled data utilization, and achieves high-quality disease prediction.
Smart Images

Figure CN121215148B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, specifically to a method and system for predicting diseases based on medical invoices and pseudo-labeling mechanisms. Background Technology
[0002] In the field of medical informatics, disease prediction methods based on electronic medical records and medical insurance data have been widely used. These methods typically rely on structured data containing explicit diagnostic labels, using supervised learning to identify disease risk and support clinical decision-making. However, in the context of medical invoice data processing, traditional supervised learning methods are difficult to apply directly due to the lack of disease labeling fields on the invoices themselves. Although invoice data has a wide coverage, high standardization, and contains rich information on patient behavior, its unlabeled nature presents a data utilization bottleneck for existing prediction technologies. Existing research attempts to infer diseases through rule mapping or knowledge base matching, but these methods have limitations in dealing with complex relationships between multiple drugs and diseases, cross-institutional data differences, and contextual semantic understanding, making it difficult to achieve accurate and generalizable disease prediction. How to effectively utilize unlabeled medical invoice data to build a reliable disease prediction model has become a key problem that needs to be solved in the current field of medical artificial intelligence. Summary of the Invention
[0003] In view of the above problems, the present invention provides a disease prediction method and system based on medical invoices and pseudo-labeling mechanisms.
[0004] To achieve the above objectives, in a first aspect, this application provides a disease prediction method based on medical invoices and pseudo-labeling mechanisms, comprising:
[0005] Obtain the set of medical bills for the target patient. The set of medical bills contains structured data of at least one medical visit record. The structured data includes a list of medications, the department visited, and patient profile information.
[0006] The data in the medical invoice set is preprocessed to standardize and generate standardized invoice data, which includes normalized drug name sequences and department information.
[0007] Standardized invoice data is input into a pre-built dynamic reasoning knowledge base, which stores the mapping relationship between drugs and diseases and dynamic weight adjustment rules based on context information.
[0008] Based on the output of the dynamic reasoning knowledge base, a weighted logical operation is performed on a single ticket through a rule-based reasoning engine to generate the first set of pseudo-labeled diseases and their confidence levels.
[0009] Standardized invoice data is input into a pre-trained large language model. The model is guided to perform disease inference through semantic understanding prompt word templates, generating a second set of pseudo-labeled diseases.
[0010] The first set of pseudo-labeled diseases and the second set of pseudo-labeled diseases are merged to generate a merged pseudo-label.
[0011] Feature vectors are constructed based on standardized invoice data, and a multi-label disease classification model is trained with the goal of fusing pseudo-labels.
[0012] The medical bill data to be predicted is preprocessed and then input into the trained multi-label disease classification model, which outputs the predicted disease and its probability corresponding to the medical bill data.
[0013] Furthermore, standardized invoice data is input into a pre-built dynamic reasoning knowledge base. This knowledge base stores the mapping relationship between drugs and diseases, as well as dynamic weight adjustment rules based on context information, including:
[0014] By integrating multiple medical data sources, including authoritative drug instruction databases and clinical medical knowledge bases, a basic mapping relationship between drug and indication information is obtained.
[0015] Based on a large language model, the indication information of missing or ambiguous drugs is generated and completed to produce a set of candidate indications.
[0016] The basic mapping relationships and candidate indication sets are normalized and manually reviewed to form a standardized drug-disease mapping dictionary;
[0017] In the drug-disease mapping dictionary, each drug-disease mapping relationship is assigned a basic weight, which is distinguished according to the primary and secondary levels of the indication;
[0018] A context-aware rule set is constructed, which defines the dynamic adjustment logic of patient profile information and department information on basic weights;
[0019] A dynamic reasoning knowledge base is constructed based on a drug-disease mapping dictionary, basic weights, and a context-aware rule set.
[0020] Furthermore, a context-aware rule set is constructed, which defines the dynamic adjustment logic of patient profile information and department information on basic weights, including:
[0021] Based on historical medical bill data and the experience of medical experts, a contextual influencing factor database was constructed, which includes age groups, gender, department of visit, and level of medical institution.
[0022] Establish an association matrix between contextual influencing factors and drug-disease mapping relationships. The association matrix defines the weight adjustment coefficients for each drug-disease mapping relationship under different contextual environments.
[0023] Dynamic weight adjustment rules are generated based on the correlation matrix. These dynamic weight adjustment rules include:
[0024] When the patient's age group is children and the department they visit is pediatrics, the weighting coefficient of antibiotic drugs for respiratory infections is increased.
[0025] When the department visited is dentistry, the weighting coefficient of antibacterial drugs for oral inflammatory diseases is increased;
[0026] The dynamic weight adjustment rules are stored in the form of executable logic, forming a context-aware rule set.
[0027] Furthermore, based on the output of the dynamic reasoning knowledge base, a weighted logical operation is performed on a single ticket using a rule-based reasoning engine to generate a first set of pseudo-labeled disease types and their confidence levels, including:
[0028] Extract contextual information from standardized invoice data. The contextual information includes at least patient profile information and department information.
[0029] The drug name sequence and context information in the standardized invoice data are input into the dynamic reasoning knowledge base for querying, and the context-aware disease weight set corresponding to each drug is obtained.
[0030] Perform a weighted aggregation operation on the context-aware disease weight set corresponding to all drugs in a single invoice to generate candidate diseases and candidate disease aggregation weights;
[0031] Candidate diseases are sorted and screened based on their aggregation weights. The top-ranked candidate diseases or those with aggregation weights exceeding a preset aggregation threshold are selected to form the first set of pseudo-labeled diseases.
[0032] The confidence score is generated by normalizing the aggregated weights of each candidate disease in the first set of pseudo-labeled diseases.
[0033] Furthermore, standardized invoice data is input into a pre-trained large language model. The model is then guided by semantic understanding prompt word templates to perform disease inference, generating a second set of pseudo-labeled diseases, including:
[0034] Based on the drug name sequence, department information and patient profile information in standardized invoice data, dynamically construct appropriate semantic understanding prompts;
[0035] Input semantic understanding prompts into a pre-trained large language model to guide the large language model to perform disease inference tasks and output initial inference results;
[0036] The initial inference results are processed through multiple rounds of generation and result fusion to generate a frequency statistic of candidate diseases after deduplication. The frequency of the candidate diseases includes high frequency, low frequency and medium frequency.
[0037] The frequency statistics of candidate diseases were standardized and synonyms were merged to form a standard disease list.
[0038] Based on the list of standard diseases and the frequency statistics of candidate diseases, several high-frequency standard diseases or standard diseases with a frequency exceeding a preset frequency threshold are selected to form the second set of pseudo-labeled diseases.
[0039] Furthermore, the initial inference results undergo multiple rounds of generation and result fusion processing to generate duplicate candidate disease frequency statistics, including:
[0040] By using different random seeds or semantically equivalent diverse prompt word templates, multiple large language model calls are performed on the same standardized invoice data to obtain multiple independent sets of initial inference results;
[0041] Perform a union operation on multiple independent sets of initial inference results, and count the total frequency of each disease name in all sets of initial inference results.
[0042] Based on a preset frequency classification threshold, the statistically analyzed diseases are divided into high-frequency diseases, medium-frequency diseases, and low-frequency diseases.
[0043] The frequency statistics of candidate diseases are composed of high-frequency diseases, medium-frequency diseases, and low-frequency diseases and their corresponding frequencies.
[0044] Furthermore, the first set of pseudo-labeled diseases and the second set of pseudo-labeled diseases are merged to generate a fused pseudo-label, including:
[0045] The first disease and its corresponding confidence level in the first pseudo-label disease set are combined with the second disease in the second pseudo-label disease set to generate a candidate fusion disease pool.
[0046] Based on a preset fusion strategy, each candidate fusion disease in the candidate fusion disease pool is weighted to obtain the final weight. The preset fusion strategy includes, but is not limited to, confidence-weighted average, source consistency priority, or voting mechanism.
[0047] Based on the final assigned weight of each candidate fusion disease, the candidate fusion diseases in the candidate fusion disease pool are sorted and screened, and the screened candidate fusion diseases are determined as fusion pseudo-labels.
[0048] Furthermore, feature vectors are constructed based on standardized invoice data, and a multi-label disease classification model is trained with the goal of fusing pseudo-labels, including:
[0049] Feature extraction is performed on standardized invoice data to generate structured feature vectors and drug sequence semantic feature vectors;
[0050] The structured feature vector is concatenated and fused with the semantic feature vector of the drug sequence to generate a joint feature vector;
[0051] Construct a multi-label classification neural network model that includes an embedding layer, a sequence encoder, and a fully connected output layer;
[0052] Using joint feature vectors as model input and fused pseudo-labels as supervision signals, a multi-label loss function is used to train a multi-label classification neural network model end-to-end.
[0053] By monitoring the model performance on the validation set and adopting an early stopping strategy, a trained multi-label classification neural network model is obtained, which is the multi-label disease classification model.
[0054] Furthermore, the data in the medical invoice set undergoes standardized preprocessing to generate standardized invoice data. This standardized invoice data includes normalized drug name sequences and department information, including:
[0055] Text cleaning and normalization are performed on the original drug names in the drug list to remove dosage form, specification and brand information, retain the generic name of the drug, and generate a normalized drug name sequence;
[0056] A standard department dictionary is constructed, and the original department names are mapped to standard department terms based on a string similarity matching algorithm;
[0057] For missing or abnormal department names that cannot be classified by string matching, a pre-trained text classification model is used to predict and fill in the department category.
[0058] Based on the processed drug names and department information, combined with patient profile information, standardized invoice data is constructed.
[0059] In a second aspect, the present invention also provides a disease prediction system based on medical invoices and a pseudo-label mechanism, applicable to the method described in the first aspect. The system includes a data acquisition and preprocessing module, a dynamic reasoning knowledge base module, a rule-based reasoning engine module, a large language model reasoning module, a pseudo-label fusion module, a model training module, and a disease prediction module. The data acquisition and preprocessing module is used to acquire a set of medical invoices for the target patient and perform standardized preprocessing to generate standardized invoice data. The dynamic reasoning knowledge base module stores the mapping relationship between drugs and diseases and dynamic weight adjustment rules based on context information. The rule-based reasoning engine module is used to predict diseases based on the dynamic reasoning knowledge base module. The output of the system performs weighted logical operations on a single invoice to generate a first set of pseudo-labeled diseases and their confidence levels. The large language model reasoning module guides the large language model to perform disease reasoning through semantic understanding prompt word templates, generating a second set of pseudo-labeled diseases. The pseudo-label fusion module merges the first and second sets of pseudo-labeled diseases to generate fused pseudo-labels. The model training module constructs feature vectors based on standardized invoice data and trains a multi-labeled disease classification model with the fused pseudo-labels as the target. The disease prediction module inputs the preprocessed medical invoice data to the trained multi-labeled disease classification model and outputs the predicted diseases and their probabilities.
[0060] Unlike existing technologies, the above-mentioned technical solution provides a method and system for disease prediction based on medical invoices and a pseudo-labeling mechanism. First, a set of medical invoices containing drug lists, visiting departments, and patient profiles is acquired. After standardized preprocessing, standardized invoice data is generated. This standardized invoice data is then input into a dynamic reasoning knowledge base and a pre-trained large language model. A first set of pseudo-labeled diseases is generated through a rule-based reasoning engine, while a second set of pseudo-labeled diseases is generated guided by semantic understanding prompts. The two sets of pseudo-labeled diseases are then merged to obtain a fused pseudo-label. This fused pseudo-label is used to train a multi-labeled disease classification model, ultimately achieving disease prediction for the medical invoice data to be predicted. This invention effectively solves the technical problem of the lack of real disease labels in medical invoice data by integrating rule-based reasoning and a large language model for dual pseudo-label generation, significantly improving the accuracy and reliability of disease prediction and providing an innovative solution for the in-depth utilization of medical invoice data.
[0061] The above description of the invention is merely an overview of the technical solution of this application. In order to enable those skilled in the art to better understand the technical solution of this application and to implement it based on the description and drawings, and to make the above-mentioned objectives and other objectives, features and advantages of this application easier to understand, the following description is provided in conjunction with the specific embodiments and drawings of this application. Attached Figure Description
[0062] The accompanying drawings are only used to illustrate the principles, implementation methods, applications, features, and effects of specific embodiments of the present invention and other related contents, and should not be considered as limitations on this application.
[0063] In the accompanying drawings of the instruction manual:
[0064] Figure 1 This is a schematic diagram illustrating steps S101 to S108 of the method described in the specific implementation embodiment;
[0065] Figure 2 This is a schematic diagram illustrating steps S201 to S206 of the method described in a specific implementation.
[0066] Figure 3 This is a schematic diagram illustrating steps S301 to S303 of the method described in a specific implementation.
[0067] Figure 4 This is a schematic diagram illustrating steps S401 to S405 of the method described in a specific embodiment;
[0068] Figure 5 This is a schematic diagram of the disease prediction system described in a specific implementation.
[0069] The reference numerals used in the above figures are explained as follows:
[0070] 1. Disease prediction system;
[0071] 11. Data Acquisition and Preprocessing Module;
[0072] 12. Dynamic Reasoning Knowledge Base Module;
[0073] 13. Rule-based reasoning engine module;
[0074] 14. Large Language Model Inference Module;
[0075] 15. Pseudo-tag fusion module;
[0076] 16. Model training module;
[0077] 17. Disease prediction module. Detailed Implementation
[0078] To illustrate the possible application scenarios, technical principles, implementable specific solutions, and achievable objectives and effects of this application in detail, the following description, in conjunction with the listed specific embodiments and accompanying drawings, provides a detailed explanation. The embodiments described herein are merely illustrative of the technical solutions of this application and are therefore intended to limit the scope of protection of this application.
[0079] In this document, the term "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The term "embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment, nor does it specifically limit its independence or connection with other embodiments. In principle, in this application, as long as there are no technical contradictions or conflicts, the technical features mentioned in each embodiment can be combined in any way to form corresponding implementable technical solutions.
[0080] Unless otherwise defined, the technical terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the use of related terms herein is merely for the purpose of describing particular embodiments and is not intended to limit this application.
[0081] In the description of this application, the term "and / or" is used to describe the logical relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A exists, B exists, and A and B exist simultaneously. Additionally, the character " / " in this document generally indicates that the preceding and following objects have an "or" logical relationship.
[0082] In this application, 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 actual quantity, hierarchy or order relationship between these entities or operations.
[0083] Without further limitations, the use of terms such as “comprising,” “including,” “having,” or other similar open-ended expressions in this application is intended to cover non-exclusive inclusion, which does not exclude the presence of additional elements in a process, method, or product that includes the stated elements, such that a process, method, or product that includes a list of elements may include not only those defined elements but also other elements not expressly listed, or elements inherent to such a process, method, or product.
[0084] As understood in the Examination Guidelines, in this application, expressions such as "greater than," "less than," and "exceeding" are understood to exclude the stated number; expressions such as "above," "below," and "within" are understood to include the stated number. Furthermore, in the description of the embodiments in this application, "multiple" means two or more (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups" and "multiple times," unless otherwise explicitly specified.
[0085] In the description of the embodiments of this application, the space-related expressions used, such as "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "vertical," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential," indicate the orientation or positional relationship based on the orientation or positional relationship shown in the specific embodiments or drawings. They are only for the purpose of describing the specific embodiments of this application or for the reader's understanding, and do not indicate or imply that the device or component referred to must have a specific position, a specific orientation, or be constructed or operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of this application.
[0086] The processor described in the embodiments of this application can be implemented by hardware, firmware, software, or a combination thereof. It can be a circuit, one or more of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field-programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, or a microprocessor. It also includes other physical, biological, or chemical structures that can implement the same or equivalent functions as the processors listed above, such as biological neurons, quantum computing units, DNA computing units, etc., so that the processor can execute some or all of the steps in the computer program or method involved in the various embodiments of this application, or any combination of the steps mentioned therein.
[0087] The computer program involved in the embodiments can be stored in a computer device readable storage medium, which includes, but is not limited to, disks, magnetic tapes, magnetic cards, floppy disks, flash memory, optical disks, optical cards, read-only memory (ROM), random access memory (RAM), erasable programmable ROM (EPROM), and electrically erasable programmable ROM (EEPROM), etc., and also includes other biological, physical, or chemical structures that can achieve the same or equivalent functions as the storage media listed above, such as DNA, RNA, proteins, and other units with information storage capabilities. In specific embodiments, the storage medium involved can be one of the above-mentioned media types, or a combination of the above-mentioned media types. In different embodiments, the computer program involved in the embodiments can be centrally stored in a single medium, or distributed and stored in multiple media. The memory containing the computer device readable storage medium can be non-volatile memory or random access memory. These computer device readable storage media can be built into the device, or can be connected to the device involved in the embodiments as an external device or part of an external device. In some embodiments, the memory having a computer device readable storage medium is deployed locally; in other embodiments, the memory may be deployed remotely from the processor, for example, as a network-attached memory accessed via RF circuitry or an external port and a communication network, wherein the communication network may be the Internet, one or more intranets, a local area network (LAN), a wide area network (WLAN), a storage area network (SAN), or a suitable combination thereof, as long as computer device access to the memory is enabled. Furthermore, the computer program involved in the embodiments may be stored in plaintext / ciphertext form, or it may be designed as training data, integrated and recombined through model training and implicitly stored in the parameter states of a deep neural network or other machine learning model.
[0088] Please see Figure 1 In a first aspect, this embodiment provides a disease prediction method based on medical invoices and a pseudo-labeling mechanism, including:
[0089] S101. Obtain the medical bill set of the target patient. The medical bill set contains structured data of at least one medical visit record. The structured data includes a drug list, the department visited, and patient profile information.
[0090] S102. Perform standardized preprocessing on the data in the medical invoice set to generate standardized invoice data, which includes normalized drug name sequences and department information.
[0091] S103. Input the standardized invoice data into the pre-built dynamic reasoning knowledge base. The dynamic reasoning knowledge base stores the mapping relationship between drugs and diseases and the dynamic weight adjustment rules based on context information.
[0092] S104. Based on the output of the dynamic reasoning knowledge base, the rule reasoning engine performs weighted logical operations on a single ticket to generate the first set of pseudo-labeled diseases and their confidence levels.
[0093] S105. Input the standardized invoice data into the pre-trained large language model, and guide the large language model to perform disease inference through semantic understanding prompt word templates to generate a second set of pseudo-labeled diseases.
[0094] S106. Merge the first set of pseudo-labeled diseases with the second set of pseudo-labeled diseases to generate a merged pseudo-label;
[0095] S107. Construct feature vectors based on standardized invoice data, and train a multi-label disease classification model with the goal of fusing pseudo-labels;
[0096] S108. After preprocessing, the medical bill data to be predicted is input into the trained multi-label disease classification model, and the predicted disease and its probability corresponding to the medical bill data to be predicted are output.
[0097] In step S101, the medical bill set refers to the data set containing patient medical records obtained from the medical institution's information system. This data is stored in a structured format for easy processing by the computer system. The drug list records information on various medications prescribed during the patient's visit, the department indicates the specific department where the patient received treatment, and the patient profile information contains data reflecting the patient's basic characteristics. The data originates from the hospital's electronic medical record system or medical insurance settlement platform and can be collected and integrated through standard data interfaces. This step systematically collects multi-dimensional medical data, laying the data foundation for subsequent disease prediction and analysis.
[0098] In step S102, standardization preprocessing refers to the technical process of standardizing and cleaning the original medical invoice data. Normalized drug name sequences are the result of removing non-core information such as drug brand names, dosage forms, and specifications, retaining the generic drug names, and standardizing them according to a unified standard. Standardization of department information aims to eliminate differences in department naming among different medical institutions, forming a unified department classification system. The preprocessing also includes data quality checks and outlier handling. This step, by establishing unified data standards, ensures the consistency and comparability of data in subsequent processing.
[0099] In step S103, the dynamic reasoning knowledge base is a specially constructed medical knowledge storage system that systematically organizes the relationships between drugs and diseases. It not only includes basic drug-disease correspondences but also introduces a weight adjustment mechanism based on specific factors, enabling knowledge reasoning to adapt to different application scenarios. The construction of the dynamic reasoning knowledge base fully considers the authority and timeliness of medical knowledge, ensuring that the provided knowledge support is reliable and effective. This step, by introducing a professional medical knowledge base, provides a solid theoretical foundation for rule-based disease reasoning.
[0100] In step S104, the rule-based reasoning engine is a software module that performs reasoning calculations based on preset logical rules, capable of automatically performing logical judgments and reasoning analysis based on input data. Weighted logical operations refer to a calculation method that assigns different weights to each factor based on its importance when comprehensively considering multiple factors. The first set of pseudo-labeled diseases is a list of candidate diseases generated through rule-based reasoning, and the confidence level quantifies the reliability of each candidate disease. This step, through systematic rule-based reasoning, provides disease prediction results with clear medical evidence.
[0101] In step S105, the pre-trained large language model refers to a deep learning model pre-trained on large-scale text data, possessing powerful natural language understanding and generation capabilities. Semantic understanding prompt word templates are used to guide the large language model to perform disease inference tasks according to specific requirements. The second set of pseudo-labeled diseases is the disease prediction result generated by the large language model based on its understanding and reasoning ability regarding medical knowledge. This step utilizes language model technology to provide disease prediction based on semantic understanding from another dimension.
[0102] In step S106, pseudo-label fusion refers to the process of integrating prediction results from different sources. This process leverages the advantages of various methods to improve the accuracy and reliability of the final result. During the fusion process, factors such as the confidence level and consistency of each prediction result are considered, and a specific fusion algorithm is used to generate the final fused pseudo-label. Preferably, a fusion strategy based on weight allocation or a voting mechanism is adopted to ensure the scientific validity and effectiveness of the fusion process.
[0103] Preferably, the pseudo-label fusion process employs a collaborative strategy that prioritizes confidence-weighted averaging and source consistency. This dual verification mechanism significantly reduces the error rate of pseudo-labels, effectively improving their accuracy and reliability, and providing high-quality supervision signals for subsequent model training. This step, through an intelligent fusion mechanism, achieves complementary advantages from multi-source prediction results.
[0104] In step S107, feature vector construction refers to the process of converting standardized invoice data into numerical feature representations that can be processed by a machine learning model. The multi-label disease classification model is a machine learning model capable of simultaneously predicting multiple disease labels. Its training process uses the fusion of pseudo-labels as the learning objective, and continuously adjusts the model parameters through optimization algorithms. Appropriate validation mechanisms are employed during model training to monitor training effectiveness and prevent overfitting. This step effectively transfers pseudo-label knowledge to the prediction model through supervised learning.
[0105] In step S108, the medical invoice data to be predicted refers to the newly added medical invoice data for which disease prediction is required. This data undergoes the same preprocessing process as the training data. The trained multi-label disease classification model maps the processed data to the predicted probabilities of each disease. These probability values reflect the strength of the association between the invoice data and each disease. The final prediction results are output in a structured form, providing a reference for medical decision-making. This step realizes the deployment and use of the trained prediction model in practical application scenarios.
[0106] This embodiment proposes a dual pseudo-label generation mechanism that integrates rule-based reasoning and a large language model. It generates high-quality pseudo-labels for model training on medical invoice data completely devoid of real disease labels. Unlike methods that use future actual disease outcomes as supervision signals, this scheme, under the dual label-free dilemma (lacking both current and future disease labels), achieves accurate inference of the current disease by working collaboratively between the rule-based path of a dynamic reasoning knowledge base and the semantic understanding path of a pre-trained large language model.
[0107] This embodiment addresses the challenge of insufficient disease labeling in medical invoice data by constructing a complete pseudo-label generation and model training process. The collaborative application of rule-based reasoning and a large language model ensures both the medical rationality of the prediction results and fully leverages the reasoning capabilities of advanced AI technology. The multi-source pseudo-label fusion mechanism effectively improves label quality, providing a reliable training target for supervised learning. This embodiment reduces reliance on labeled data while ensuring the accuracy and reliability of disease prediction, providing an effective technical path for the intelligent analysis of medical invoice data.
[0108] Please see Figure 2 In some embodiments, standardized invoice data is input into a pre-built dynamic reasoning knowledge base. This knowledge base stores the mapping relationship between drugs and diseases, as well as dynamic weight adjustment rules based on context information, including:
[0109] S201. Integrate multiple medical data sources, including authoritative drug instruction databases and clinical medical knowledge bases, to obtain the basic mapping relationship between drug and indication information;
[0110] S202. Based on the large language model, assist in generating and completing the indication information of missing or ambiguous drugs to generate a set of candidate indications.
[0111] S203. Normalize and manually review the basic mapping relationships and candidate indication sets to form a standardized drug-disease mapping dictionary;
[0112] S204. In the drug-disease mapping dictionary, assign a basic weight to each drug-disease mapping relationship. The basic weight is distinguished according to the primary and secondary levels of the indication.
[0113] S205. Construct a context-aware rule set. The context-aware rule set defines the dynamic adjustment logic of the basic weights based on patient profile information and department information.
[0114] S206, based on a drug-disease mapping dictionary, basic weights, and a context-aware rule set, together constitute a dynamic reasoning knowledge base.
[0115] In step S201, the multi-source medical data sources are medical knowledge databases obtained from different authoritative channels, including drug instruction manual databases and clinical practice guideline databases published by the National Medical Products Administration. The integration process employs data fusion technology, using the generic name of the drug as a key field for association and matching to establish a basic mapping relationship between drugs and indications. Preferably, a semantic similarity-based matching algorithm is used to handle differences in disease name descriptions from different data sources. This step, by integrating multi-source authoritative data, constructs a comprehensive and reliable drug-indication knowledge foundation.
[0116] In step S202, missing drugs refer to new drugs or special preparations not included in existing medical data sources, while ambiguous drugs include compound preparations or drugs with unclear generic names. The large language model-assisted generation uses specific prompt word templates, such as "Please list the main indications of drug [drug name]", and obtains a set of candidate indications through multiple rounds of generation and result aggregation. Preferably, multiple large language models are used for parallel generation, and a voting mechanism is used to filter frequently occurring indications. This step utilizes the medical knowledge reasoning capabilities of the large language model to effectively supplement the coverage blind spots of traditional knowledge bases.
[0117] In step S203, normalization includes operations such as disease name standardization, synonym merging, and hierarchical structure unification. Manual review is performed by professionals with medical backgrounds, focusing on the clinical rationality of the content generated by the large language model and confirming or correcting any controversial mapping relationships. The standardized mapping relationships are stored in a unified format, forming a structured drug-disease mapping dictionary. This step, through a combination of automated processing and manual review, ensures the accuracy and standardization of the knowledge base.
[0118] In step S204, the basic weighting is differentiated based on the importance of the indication in clinical practice. The primary indication typically refers to the first-line indication explicitly stated in the drug's package insert and is assigned a higher weight; secondary indications include other applicable situations or clinical experience-based use as stated in the package insert and are assigned a relatively lower weight. Preferably, the weight values can be further refined and graded according to the recommendation level of the indication in clinical guidelines. This step, through a weighting differentiation mechanism, reflects the differences in the importance of different indications in disease reasoning.
[0119] In step S205, the context-aware rule set defines the influence of patient characteristics and the medical environment on the strength of the drug-disease association. Preferably, when pediatric patients use antibiotics, the weight of respiratory infections may be increased accordingly; in the context of dental visits, the weight of oral-related diseases will be enhanced. The rule set is implemented through conditional statements, triggering corresponding weight adjustment coefficients when specific contextual conditions are met. This step, by introducing a context-aware mechanism, makes knowledge reasoning more closely aligned with actual clinical applications.
[0120] In step S206, the construction of the dynamic reasoning knowledge base involves the systematic integration of the standardized mapping dictionary, basic weighting system, and context adjustment rules generated in the preceding steps. The knowledge base is stored using a graph database or relational database, supporting efficient query and reasoning operations. A knowledge base maintenance mechanism ensures regular updates, promptly incorporating the latest medical knowledge and clinical experience. This step, through the systematic integration of multi-dimensional knowledge elements, constructs a medical knowledge base system with dynamic reasoning capabilities.
[0121] This embodiment details the construction process of a dynamic reasoning knowledge base. Through multi-source data integration and the assistance of a large language model, a comprehensive drug-disease mapping relationship is established. The introduction of basic weight grading and context-aware rules enables the knowledge base to adapt to different clinical scenarios. The construction process of the dynamic reasoning knowledge base balances the authority and practicality of knowledge, providing reliable knowledge support for rule-based disease reasoning, while enhancing the system's adaptability through a flexible weight adjustment mechanism.
[0122] Please see Figure 3In some embodiments, a context-aware rule set is constructed, which defines the dynamic adjustment logic of patient profile information and department information on basic weights, including:
[0123] S301. Based on historical medical bill data and medical expert experience, construct a contextual impact factor library, which includes age segmentation, gender, department of visit and level of medical institution.
[0124] S302. Establish the correlation matrix between contextual influencing factors and drug-disease mapping relationship. The correlation matrix defines the weight adjustment coefficients of each drug-disease mapping relationship under different contextual environments.
[0125] S303. Dynamic weight adjustment rules are generated based on the correlation matrix. The dynamic weight adjustment rules include:
[0126] When the patient's age group is children and the department they visit is pediatrics, the weighting coefficient of antibiotic drugs for respiratory infections is increased.
[0127] When the department visited is dentistry, the weighting coefficient of antibacterial drugs for oral inflammatory diseases is increased;
[0128] The dynamic weight adjustment rules are stored in the form of executable logic, forming a context-aware rule set.
[0129] In step S301, the contextual influencing factor database is a feature set constructed by analyzing a large amount of historical medical invoice data and combining it with the experience of medical experts. Age segments are divided into infants, children, adults, and the elderly according to clinical conventions; gender includes both males and females; the departments visited adopt a standard departmental classification system; and the medical institution level is divided into three levels and ten grades according to the evaluation standards of the National Health Commission. Preferably, data mining techniques are used to statistically analyze the distribution patterns of each influencing factor from historical invoices, and key influencing factors and their value ranges are determined in conjunction with expert interviews. This step systematically identifies and organizes the key factors influencing disease inference, providing basic data support for establishing a dynamic adjustment mechanism.
[0130] In step S302, the association matrix is a multidimensional data structure where rows represent different combinations of contextual influencing factors, columns represent specific drug-disease mapping relationships, and matrix elements store corresponding weight adjustment coefficients. The weight adjustment coefficients are determined based on the statistical significance of drug-disease associations under different contextual environments in historical data. Preferably, statistical methods such as chi-square tests or relative risk ratios are used to quantify the association strength. The construction process of the association matrix also includes coefficient normalization to ensure comparability of coefficients between different factors. This step provides a mathematical basis for dynamic weight adjustment by establishing quantified association relationships.
[0131] In step S303, the dynamic weight adjustment rules are the process of transforming the statistical regularities in the association matrix into executable logic. The first rule targets common scenarios of respiratory infections in children. When both the age group is classified as "child" and the department visited is pediatric, the system automatically increases the weight coefficient of antibiotics corresponding to respiratory infections. The increase is determined based on the association strength in historical data for this scenario. The second rule targets dental visits. When the department visited is dentistry, the weight coefficient of antibiotics corresponding to inflammatory oral diseases is increased accordingly. These rules are implemented through conditional statements, preferably using decision trees or rule engines for efficient execution. Rule storage uses a structured rule description language, supporting dynamic loading and updating. This step, by transforming statistical regularities into executable rules, achieves context-based intelligent weight adjustment.
[0132] This embodiment details the construction process of the context-aware rule set. Through systematic influence factor analysis, association matrix construction, and rule transformation, an intelligent weight adjustment mechanism based on clinical scenarios is established. This embodiment fully considers the impact of different patient characteristics and treatment environments on the strength of drug-disease association, making the disease inference process closer to clinical practice. Through quantified weight adjustment coefficients and clear execution rules, both the standardization of the inference process and flexible adaptability are ensured, effectively improving the accuracy and practicality of disease prediction.
[0133] Please see Figure 4 In some embodiments, based on the output of the dynamic reasoning knowledge base, a rule-based reasoning engine performs weighted logical operations on a single ticket to generate a first set of pseudo-labeled diseases and their confidence levels, including:
[0134] S401. Extract contextual information from standardized invoice data. The contextual information includes at least patient profile information and department information.
[0135] S402. Input the drug name sequence and context information from the standardized invoice data into the dynamic reasoning knowledge base for querying, and obtain the context-aware disease weight set corresponding to each drug.
[0136] S403. Perform a weighted aggregation operation on the context-aware disease weight set corresponding to all drugs in a single invoice to generate candidate diseases and candidate disease aggregation weights.
[0137] S404. Based on the aggregation weight of candidate diseases, sort and filter the candidate diseases, and form the first set of pseudo-labeled diseases by selecting the top-ranked candidate diseases or the candidate diseases whose aggregation weight exceeds the preset aggregation threshold.
[0138] S405. Normalize the aggregated weights of each candidate disease in the first pseudo-label disease set to generate confidence scores.
[0139] In step S401, contextual information is environmental features extracted from standardized invoice data to aid in disease-specific reasoning. Patient profile information includes basic features such as age and gender, while department information specifies the particular department visited. This information has been standardized during the preprocessing stage to ensure a consistent format. The extraction of contextual information is achieved through data parsing technology, directly reading the corresponding fields from the structured invoice data. This step, by extracting key contextual features, provides the necessary input for subsequent personalized reasoning.
[0140] In step S402, the context-aware disease weight set is obtained by querying a dynamic reasoning knowledge base. This set reflects the strength of the association between drugs and diseases in a specific context. The query process takes the drug name and contextual information as input, and the knowledge base returns the corresponding disease weight set based on preset weight adjustment rules. Preferably, the query process adopts a parallel processing approach, simultaneously retrieving knowledge base data from multiple drugs to improve processing efficiency. This step, by combining specific contextual environments, achieves personalized assessment of drug-disease association.
[0141] In step S403, the weighted aggregation operation is a process of fusing and calculating the disease weights corresponding to multiple drugs. For each candidate disease, the system accumulates the weight values of that disease in all drug weight sets, taking into account the importance of the drug in the prescription. Preferably, a weighted summation algorithm based on drug frequency or drug importance is used to ensure that commonly used or key drugs have a greater impact on the final result. The output of the aggregation operation includes a list of candidate diseases and their corresponding aggregated weight values. This step, through the intelligent fusion of multiple drug weights, forms a comprehensive disease evaluation result.
[0142] In step S404, candidate diseases are ranked from highest to lowest based on their aggregated weight values. The screening process can employ two strategies: selecting the top N diseases or selecting diseases whose weights exceed a preset threshold. The preset aggregated threshold is determined based on the distribution characteristics of disease weights in historical data; preferably, it can be calculated using statistical analysis methods to ensure that the selected diseases are sufficiently representative. The screened diseases constitute the first set of pseudo-labeled diseases, serving as the final output of rule-based reasoning. This step, through a scientific screening mechanism, ensures the quality and reliability of the output results.
[0143] In step S405, normalization converts the aggregated weights of candidate diseases into confidence values between 0 and 1. Preferably, a softmax function or a min-max normalization method is used to ensure that the sum of the confidence scores for all candidate diseases is 1. The confidence calculation process also considers the characteristics of the weight distribution and performs appropriate smoothing on extreme values. The generated confidence scores reflect the relative reliability of each disease in the rule-based reasoning results. This step, through standardization, makes the prediction results between different diseases comparable.
[0144] This embodiment provides a detailed process for generating the first set of pseudo-labeled diseases based on a rule-based reasoning engine. Through effective utilization of contextual information, intelligent aggregation of multi-drug weights, and a scientific screening mechanism, reliable disease prediction results are formed. The introduction of confidence levels provides an important quality assessment basis for subsequent pseudo-label fusion. This embodiment retains the interpretability advantages of rule-based methods while improving the accuracy of prediction results through a quantitative evaluation mechanism, laying a solid foundation for subsequent model training.
[0145] In some embodiments, standardized invoice data is input into a pre-trained large language model, and the large language model is guided to perform disease inference through semantic understanding prompt word templates to generate a second set of pseudo-labeled diseases, including:
[0146] Based on the drug name sequence, department information and patient profile information in standardized invoice data, dynamically construct appropriate semantic understanding prompts;
[0147] Input semantic understanding prompts into a pre-trained large language model to guide the large language model to perform disease inference tasks and output initial inference results;
[0148] The initial inference results are processed through multiple rounds of generation and result fusion to generate a frequency statistic of candidate diseases after deduplication. The frequency of the candidate diseases includes high frequency, low frequency and medium frequency.
[0149] The frequency statistics of candidate diseases were standardized and synonyms were merged to form a standard disease list.
[0150] Based on the list of standard diseases and the frequency statistics of candidate diseases, several high-frequency standard diseases or standard diseases with a frequency exceeding a preset frequency threshold are selected to form the second set of pseudo-labeled diseases.
[0151] In this embodiment, the dynamic construction of semantic understanding prompts is the process of transforming key information from standardized ticket data into text instructions that the large language model can understand. The prompt template typically includes a fixed instruction section and a variable parameter section, such as "Infer the possible disease based on the following information: The patient is [age] [gender], visited [department], and used [drug list]". The parameter section is dynamically filled based on the specific ticket data, ensuring that each query is targeted. Preferably, the prompt design considers the logic of medical reasoning, guiding the model to think systematically. This step, through a carefully designed prompt template, effectively stimulates the medical reasoning ability of the large language model.
[0152] The pre-trained large language model is a specialized model fine-tuned on large-scale medical texts, possessing a rich reserve of medical knowledge. Upon receiving prompts, the model understands the input information through its internal multi-layered attention mechanism and generates disease inference results based on pre-trained knowledge. The initial inference results are output in natural language form, typically containing multiple possible disease names and brief descriptions. Preferably, length limits and temperature parameters can be set to control the diversity and accuracy of the output. This step leverages the powerful semantic understanding capabilities of the large language model to provide deep learning-based disease inference results.
[0153] Multi-round generation is a process of performing multiple independent inferences on the same ticket data by changing the random seed or slightly adjusting the prompt word description. Result fusion integrates the outputs from multiple rounds and counts the frequency of each disease name. High-frequency diseases are those that appear consistently in multiple rounds of generation, medium-frequency diseases appear intermittently, and low-frequency diseases appear occasionally. Preferably, the frequency classification threshold can be set proportionally to the total number of generation rounds, such as setting the high-frequency threshold to above 70% of the total number of rounds. This step effectively reduces the impact of randomness in a single generation through multiple independent inferences and result aggregation.
[0154] Standardization unifies disease names with different expressions but the same meaning; for example, "upper respiratory tract infection" and "URTI" are merged into a standard term. Synonym merging is based on medical dictionaries and terminology standards, achieved through string matching and semantic similarity calculation. Preferably, a semantic mapping method based on medical knowledge graphs is used to ensure the accuracy of merging. The processed standard disease list eliminates terminological ambiguity, providing a clear foundation for subsequent screening. This step, through terminology standardization, solves the problem of inconsistent expression in natural language generation.
[0155] The screening process comprehensively considers disease frequency and ranking to ensure the selection of the most representative diseases. The preset frequency threshold is set based on historical validation data; optimal thresholds can be determined using precision-recall curves. The top-ranking criteria typically select the top 3-5 diseases with the highest frequency; the specific number can be adjusted according to actual needs. The selected diseases constitute the second pseudo-label disease set, serving as the final output of the large language model inference. This step, through a scientific screening mechanism, ensures the quality and practicality of the output results.
[0156] This embodiment details the complete process of generating a second set of pseudo-labeled diseases using a large language model. Through key technologies such as dynamic prompt word construction, multi-round generation fusion, and terminology standardization, it fully leverages the advantages of large language models in medical reasoning. The multi-round generation mechanism effectively improves the stability of the results, while terminology standardization ensures the consistency of the output. This embodiment retains the reasoning capabilities of the large language model while ensuring the reliability of the results through a systematic post-processing mechanism, providing an important supplementary source of information for disease prediction.
[0157] In some embodiments, the initial inference results are processed through multiple rounds of generation and result fusion to generate duplicate candidate disease frequency statistics, including:
[0158] By using different random seeds or semantically equivalent diverse prompt word templates, multiple large language model calls are performed on the same standardized invoice data to obtain multiple independent sets of initial inference results;
[0159] Perform a union operation on multiple independent sets of initial inference results, and count the total frequency of each disease name in all sets of initial inference results.
[0160] Based on a preset frequency classification threshold, the statistically analyzed diseases are divided into high-frequency diseases, medium-frequency diseases, and low-frequency diseases.
[0161] The frequency statistics of candidate diseases are composed of high-frequency diseases, medium-frequency diseases, and low-frequency diseases and their corresponding frequencies.
[0162] In this embodiment, different random seeds alter the initial state of the random numbers generated during the model generation process, resulting in differentiated outputs for each call. Semantically equivalent diversified prompt word templates refer to variations of prompt words with different expressions but the same semantic meaning, such as "inferring a possible disease diagnosis" and "speculating on the patient's disease." Multiple large language model calls are processed in parallel, initiating multiple inference requests simultaneously on the same ticket data, with each request using a different random seed or prompt word template. Preferably, the number of calls can be set between 3 and 5 based on actual needs, ensuring result diversity while controlling computational costs. This step, by introducing randomness and prompt word diversity, effectively avoids accidental biases that may occur in a single inference.
[0163] The union operation merges all disease names from multiple initial inference result sets to form a complete set containing all occurrences of a disease. The frequency statistics process counts the number of times each disease name appears in all result sets; the statistical value reflects the stability of that disease across multiple independent inferences. Preferably, the statistical process ignores differences in capitalization and punctuation, but retains basic terminological differences for subsequent processing. This step, through systematic frequency statistics, quantifies the occurrence patterns of each disease across multiple inferences.
[0164] The frequency grading threshold is set proportionally based on the total number of calls. For example, the threshold for high-frequency diseases can be set to above 70% of the total calls, the threshold for medium-frequency diseases to be 30%-70%, and the threshold for low-frequency diseases to be below 30%. The threshold setting considers a balance between accuracy and coverage; high-frequency diseases have higher confidence levels, while low-frequency diseases may contain valuable marginal information. Preferably, the threshold parameters can be optimized and adjusted based on the validation set performance. This step, through scientific frequency grading, provides a quantitative basis for subsequent screening decisions.
[0165] The candidate disease frequency statistics are a structured dataset recording the name, frequency, and classification result of each disease. This statistical result not only includes basic information about the diseases but also reflects the reliability of different diseases through frequency classification. Preferably, the statistical results are stored in a standardized JSON or XML format for easy subsequent processing and analysis. This step, through systematic result organization, provides a structured intermediate representation for the inference output of the large language model.
[0166] This embodiment details the specific implementation mechanism of multi-round generation and result fusion in a large language model. By employing diverse techniques such as random seeds and prompt words, the stability and reliability of the inference results are effectively improved; frequency statistics and hierarchical processing provide a scientific quantitative basis for subsequent screening decisions. This embodiment retains the advantages of large language models while ensuring the quality of the output results through a systematic fusion mechanism, providing important technical support for the reliable application of large language models in the medical field.
[0167] In some embodiments, the first set of pseudo-labeled diseases and the second set of pseudo-labeled diseases are merged to generate a merged pseudo-label, including:
[0168] The first disease and its corresponding confidence level in the first pseudo-label disease set are combined with the second disease in the second pseudo-label disease set to generate a candidate fusion disease pool.
[0169] Based on a preset fusion strategy, each candidate fusion disease in the candidate fusion disease pool is weighted to obtain the final weight. The preset fusion strategy includes, but is not limited to, confidence-weighted average, source consistency priority, or voting mechanism.
[0170] Based on the final assigned weight of each candidate fusion disease, the candidate fusion diseases in the candidate fusion disease pool are sorted and screened, and the screened candidate fusion diseases are determined as fusion pseudo-labels.
[0171] In this embodiment, the candidate fusion disease pool is a unified set of diseases formed by merging prediction results from two sources. The first disease comes from the output of the rule-based inference engine, along with a confidence score based on aggregation weights; the second disease comes from the inference results of the large language model. The union operation retains all unique disease names and marks diseases that appear in both sources. Preferably, the union operation process records the original source information for each disease, providing a reference for subsequent fusion strategies. This step, through systematic result merging, lays the foundation for intelligent fusion of multi-source prediction results.
[0172] The preset fusion strategy is a weight allocation scheme designed for different application scenarios. The confidence-weighted average strategy calculates a weighted average by combining the confidence of rule-based reasoning with the frequency information of the large language model; preferably, the weight ratio can be adjusted based on the validation set performance. The source consistency priority strategy assigns higher weights to diseases jointly predicted by two sources, reflecting the degree of consistency in the prediction results. The voting mechanism is based on a simple majority principle, increasing the weight of a disease when multiple prediction sources support it. This step, through a flexible fusion strategy, achieves an optimized combination of multi-source prediction results.
[0173] The final weight calculation comprehensively considers the output results of each fusion strategy. The sorting process proceeds from highest to lowest weight, and the selection can employ either a fixed number of diseases or a dynamic threshold. The fixed number method selects the top N diseases with the highest weights, while the dynamic threshold method selects all diseases with weights exceeding a preset threshold. Preferably, the threshold is determined based on the statistical characteristics of weight distribution in historical data. The selected diseases serve as the final fusion pseudo-labels for subsequent model training. This step, through a scientific selection mechanism, ensures the quality and reliability of the fusion results.
[0174] This embodiment details the implementation process of multi-source pseudo-label fusion. Through systematic union operations, flexible fusion strategies, and a scientific screening mechanism, it effectively integrates the advantages of rule-based reasoning and large language models. The fusion process considers the reliability differences among various prediction sources and reflects the importance of different diseases through weight assignment. This embodiment significantly improves the quality of pseudo-labels through an intelligent fusion mechanism, providing a high-quality labeled data foundation for subsequent supervised learning training.
[0175] In some embodiments, feature vectors are constructed based on standardized invoice data, and a multi-label disease classification model is trained with the goal of fusing pseudo-labels, including:
[0176] Feature extraction is performed on standardized invoice data to generate structured feature vectors and drug sequence semantic feature vectors;
[0177] The structured feature vector is concatenated and fused with the semantic feature vector of the drug sequence to generate a joint feature vector;
[0178] Construct a multi-label classification neural network model that includes an embedding layer, a sequence encoder, and a fully connected output layer;
[0179] Using joint feature vectors as model input and fused pseudo-labels as supervision signals, a multi-label loss function is used to train a multi-label classification neural network model end-to-end.
[0180] By monitoring the model performance on the validation set and adopting an early stopping strategy, a trained multi-label classification neural network model is obtained, which is the multi-label disease classification model.
[0181] In this embodiment, the feature extraction process transforms standardized invoice data into a numerical representation that can be processed by a machine learning model. The structured feature vector includes one-hot encoded representations of categorical features such as patient age, gender, and department visited, as well as standardized representations of numerical features such as drug quantity and number of visits. The drug sequence semantic feature vector maps the drug name sequence into a low-dimensional dense vector using word embedding technology; preferably, it is obtained using a pre-trained drug embedding model or trained based on algorithms such as Word2Vec. This step, through multi-dimensional feature extraction, fully leverages the rich information contained in the invoice data.
[0182] Concatenation and fusion is the operation of connecting different types of feature vectors along their feature dimensions. Structured feature vectors provide a quantitative representation of basic patient information and the medical environment, while drug sequence semantic feature vectors capture the semantic information of drug combinations. Preferably, before concatenation, the dimensions of each feature component can be normalized to avoid excessive influence on the model due to excessively large numerical ranges of certain features. The concatenated joint feature vector serves as the unified input feature of the model. This step, through feature fusion, achieves effective integration of multi-source information.
[0183] The multi-label classification neural network model employs a hierarchical architecture. The embedding layer maps discrete features to dense vector representations, the sequence encoder uses a recurrent neural network or Transformer structure to process the temporal information of the drug sequences, and the fully connected output layer generates the predicted probabilities for each disease. Preferably, the output layer uses the sigmoid activation function, ensuring that the prediction results for each disease are independent. The model parameter size is reasonably configured based on the amount of data and the complexity of the task. This step, through a deep neural network architecture, provides powerful modeling capabilities for complex multi-label classification tasks.
[0184] The end-to-end training process uses fused pseudo-labels as supervision signals, and the multi-label loss function typically employs binary cross-entropy loss to calculate the prediction error for each disease category. Gradient descent is used to optimize model parameters during training, and the learning rate is dynamically adjusted according to the training progress. Preferably, a class weight mechanism can be introduced to alleviate the problem of imbalanced sample sizes for different diseases in the training data. This step effectively transfers pseudo-label knowledge to the neural network model through supervised learning.
[0185] Validation set monitoring periodically evaluates the model's performance on independent datasets during training, with key monitoring metrics including accuracy, recall, and F1 score. An early stopping strategy automatically terminates training when validation set performance no longer improves, preventing overfitting. Ideally, the parameters of the model with the best validation set performance are saved as the final model. The trained model is capable of predicting multiple diseases simultaneously, outputting the predicted probability for each disease. This step, through a scientific training monitoring mechanism, ensures the generalization performance of the final model.
[0186] This embodiment details the construction and training process of a multi-label disease classification model. Through multi-dimensional feature extraction, a deep neural network architecture, and an end-to-end training mechanism, accurate mapping from medical invoice data to disease prediction is achieved. During model training, the supervisory information provided by fused pseudo-labels is fully utilized, combined with a scientific training strategy, ensuring the model's practicality and reliability. This embodiment provides an effective technical means for the intelligent analysis of medical invoice data, significantly improving the automation level of disease prediction.
[0187] In some embodiments, the data in the medical invoice set is preprocessed to standardize and generate standardized invoice data. The standardized invoice data includes normalized drug name sequences and department information, including:
[0188] Text cleaning and normalization are performed on the original drug names in the drug list to remove dosage form, specification and brand information, retain the generic name of the drug, and generate a normalized drug name sequence;
[0189] A standard department dictionary is constructed, and the original department names are mapped to standard department terms based on a string similarity matching algorithm;
[0190] For missing or abnormal department names that cannot be classified by string matching, a pre-trained text classification model is used to predict and fill in the department category.
[0191] Based on the processed drug names and department information, combined with patient profile information, standardized invoice data is constructed.
[0192] In this embodiment, text cleaning and normalization includes removing non-generic components from drug names. For example, "Ceftriaxone Sodium for Injection 1g" retains the core component "Ceftriaxone Sodium" after processing. The processing employs regular expression-based pattern matching technology to identify and remove dosage form descriptions, specifications, and trade name information. Preferably, a drug thesaurus is established to handle cases where different trade names correspond to the same generic name, ensuring name consistency. The normalized drug name sequence is arranged according to its original order of appearance in the prescription, preserving the contextual information of drug use. This step, through systematic drug name normalization, provides standardized input data for subsequent drug semantic analysis.
[0193] The standard department dictionary is built based on the medical institution department setting standards issued by the National Health Commission, containing standard department names applicable to medical institutions at all levels. The string similarity matching algorithm uses edit distance to calculate the similarity between the original department name and the standard terminology; automatic mapping is performed when the similarity exceeds a preset threshold. Preferably, mapping rules are established for synonyms such as "cardiology" and "heart disease" based on the semantic features of the department names to improve matching accuracy. This step, through automated string matching, achieves standardization of most department names.
[0194] The pre-trained text classification model is built using deep learning methods and trained with a large amount of labeled department name data. The model receives the original department name text as input and outputs the corresponding standard department classification probability. For cases where the department name is missing, the model can combine auxiliary information such as consultation time and drug type for comprehensive inference. Preferably, the model is fine-tuned using pre-trained language models such as BERT to fully utilize their powerful semantic understanding capabilities. This step effectively solves complex situations that traditional string matching methods struggle to handle through machine learning.
[0195] The standardized invoice data integrates various standardized data dimensions. Drug name sequences provide a standardized description of the treatment plan, department information reflects the specialty of the visit, and patient profile information includes demographic characteristics. Preferably, the data is organized using a unified JSON or XML format to ensure consistency and scalability of the data structure. The standardization process preserves the relationships between the original data, facilitating subsequent traceability analysis. This step, through systematic data integration, forms a complete and standardized representation of invoice data.
[0196] This embodiment details the specific technical implementation of standardized preprocessing for medical invoice data. Through text cleaning of drug names, intelligent mapping of department information, and machine learning completion of missing values, a high-quality standard data foundation is established. The preprocessing process fully considers the professional characteristics of medical data, achieving data standardization while maintaining information integrity. This provides reliable data support for subsequent disease prediction and analysis, ensuring the accuracy and stability of the algorithm model.
[0197] Please see Figure 5 In a second aspect, this embodiment also provides a disease prediction system 1 based on medical invoices and a pseudo-label mechanism, applicable to the method described in the first aspect. The system includes a data acquisition and preprocessing module 11, a dynamic reasoning knowledge base module 12, a rule reasoning engine module 13, a large language model reasoning module 14, a pseudo-label fusion module 15, a model training module 16, and a disease prediction module 17. The data acquisition and preprocessing module 11 is used to acquire a set of medical invoices for the target patient and perform standardized preprocessing to generate standardized invoice data. The dynamic reasoning knowledge base module 12 stores the mapping relationship between drugs and diseases and dynamic weight adjustment rules based on context information. The rule reasoning engine module 13 is used to predict diseases based on dynamic reasoning... The output of the knowledge base module 12 performs weighted logical operations on a single invoice to generate a first set of pseudo-labeled diseases and their confidence levels; the large language model reasoning module 14 guides the large language model to perform disease reasoning through semantic understanding prompt word templates to generate a second set of pseudo-labeled diseases; the pseudo-label fusion module 15 fuses the first and second sets of pseudo-labeled diseases to generate fused pseudo-labels; the model training module 16 constructs feature vectors based on standardized invoice data and trains a multi-labeled disease classification model with the fused pseudo-labels as the target; the disease prediction module 17 inputs the preprocessed medical invoice data to the trained multi-labeled disease classification model and outputs the predicted diseases and their probabilities.
[0198] In this embodiment, the disease prediction system 1 achieves disease prediction based on medical invoices through the collaborative work of various modules. The data acquisition and preprocessing module 11 is responsible for collecting raw invoice data from the medical information system and performing standardized processing. The dynamic reasoning knowledge base module 12 stores the drug-disease mapping relationship integrated from multiple sources of medical knowledge. The rule-based reasoning engine module 13 performs logical reasoning based on the mapping rules and weight adjustment mechanism in the knowledge base. The large language model reasoning module 14 uses the semantic understanding capability of a pre-trained language model to infer disease types. The pseudo-label fusion module 15 intelligently integrates the results of rule-based reasoning and language model reasoning. The model training module 16 uses the fused pseudo-label data to train a multi-label classification model. The disease prediction module 17 inputs the preprocessed new data into the trained model and outputs the final disease prediction result.
[0199] It is important to note that this system is designed to infer the current disease type from medical bill data, which is fundamentally different from technologies that predict future disease risks based on historical data.
[0200] This system achieves a complete process from data acquisition to disease prediction through modular design. The data acquisition and preprocessing module 11 ensures the standardization of input data; the dynamic reasoning knowledge base module 12 provides reliable medical knowledge support; the rule-based reasoning engine and the large language model reasoning module 14 generate prediction results from both rule and semantic dimensions; the pseudo-label fusion module 15 integrates the advantages of various methods to form high-quality training labels; the model training module 16 builds an accurate classification model based on the fused labels; and finally, the disease prediction module 17 achieves automated disease inference for new invoice data. This system effectively solves the problem of lack of disease labeling on medical invoices, providing reliable auxiliary decision support for clinical diagnosis.
[0201] By adopting the above technical solution, this invention differs from existing technologies and possesses the following beneficial effects: By constructing a dual pseudo-label generation mechanism that integrates rule-based reasoning and a large language model, it effectively solves the problem of lacking disease labeling in medical invoice data. First, a rule-based reasoning engine based on a dynamic reasoning knowledge base, combined with a context-aware weight adjustment mechanism, generates a first set of pseudo-labeled diseases with clear medical evidence. Simultaneously, a pre-trained large language model uses semantically understood prompt word templates to perform disease reasoning, generating a second set of pseudo-labeled diseases. Through an intelligent fusion strategy, the advantages of both are complemented to form high-quality fused pseudo-labels, which are then used as supervisory signals to train a multi-label disease classification model. This technical solution fully utilizes structured data such as drug lists, visiting departments, and patient profiles in medical invoices, achieving accurate disease prediction without manual labeling, significantly reducing data labeling costs, while ensuring the clinical rationality and reliability of the prediction results, providing a reliable technical path for the in-depth utilization of medical invoice data.
[0202] Finally, it should be noted that although the above embodiments have been described in the text and drawings of this application, this should not limit the scope of patent protection of this application. Any technical solutions that are based on the essential concept of this application and utilize the content described in the text and drawings of this application, resulting in equivalent structural or procedural substitutions or modifications, as well as the direct or indirect application of the technical solutions of the above embodiments to other related technical fields, are all included within the scope of patent protection of this application.
Claims
1. A disease prediction method based on medical invoices and pseudo-labeling mechanisms, characterized in that, include: Obtain a set of medical bills for the target patient, the set of medical bills containing structured data of at least one medical visit record, the structured data including a drug list, the department visited and patient profile information; The data in the medical invoice set is preprocessed to standardize and generate standardized invoice data, which includes a normalized sequence of drug names and department information. The standardized invoice data is input into a pre-built dynamic reasoning knowledge base, which stores the mapping relationship between drugs and diseases and dynamic weight adjustment rules based on context information. Based on the output of the dynamic reasoning knowledge base, a weighted logical operation is performed on a single ticket through a rule-based reasoning engine to generate a first set of pseudo-labeled diseases and their confidence levels. The standardized invoice data is input into a pre-trained large language model, and the large language model is guided to perform disease inference through semantic understanding prompt word templates to generate a second set of pseudo-labeled diseases. The first set of pseudo-labeled diseases and the second set of pseudo-labeled diseases are merged to generate a fused pseudo-label; Based on the standardized invoice data, feature vectors are constructed, and a multi-label disease classification model is trained with the fused pseudo-labels as the target. The medical bill data to be predicted is preprocessed and then input into the trained multi-label disease classification model, which outputs the predicted disease and its probability corresponding to the medical bill data to be predicted.
2. The disease prediction method based on medical invoices and pseudo-labeling mechanism according to claim 1, characterized in that, The standardized invoice data is input into a pre-built dynamic reasoning knowledge base, which stores the mapping relationship between drugs and diseases and dynamic weight adjustment rules based on context information, including: By integrating multiple medical data sources, including authoritative drug instruction databases and clinical medical knowledge bases, a basic mapping relationship between drug and indication information is obtained. Based on a large language model, the indication information of missing or ambiguous drugs is generated and completed to produce a set of candidate indications. The basic mapping relationship and the candidate indication set are normalized and manually reviewed to form a standardized drug-disease mapping dictionary; In the drug-disease mapping dictionary, each drug-disease mapping relationship is assigned a basic weight, which is distinguished according to the primary and secondary levels of the indication; A context-aware rule set is constructed, which defines the dynamic adjustment logic of the basic weights based on patient profile information and department information. The dynamic reasoning knowledge base is composed of the drug-disease mapping dictionary, the basic weights, and the context-aware rule set.
3. The disease prediction method based on medical invoices and pseudo-labeling mechanism according to claim 2, characterized in that, A context-aware rule set is constructed, which defines the dynamic adjustment logic of patient profile information and department information on the basic weights, including: Based on historical medical bill data and the experience of medical experts, a contextual influencing factor database is constructed, which includes age segmentation, gender, department of visit, and level of medical institution. Establish an association matrix between contextual influencing factors and drug-disease mapping relationships, wherein the association matrix defines the weight adjustment coefficients of each drug-disease mapping relationship under different contextual environments; Dynamic weight adjustment rules are generated based on the correlation matrix, and the dynamic weight adjustment rules include: When the patient's age group is children and the department they visit is pediatrics, the weighting coefficient of antibiotic drugs for respiratory infections is increased. When the department visited is dentistry, the weighting coefficient of antibacterial drugs for oral inflammatory diseases is increased; The dynamic weight adjustment rules are stored in the form of executable logic to form the context-aware rule set.
4. The disease prediction method based on medical invoices and pseudo-labeling mechanism according to claim 1, characterized in that, Based on the output of the dynamic reasoning knowledge base, a weighted logical operation is performed on a single ticket using a rule-based reasoning engine to generate a first set of pseudo-labeled diseases and their confidence levels, including: Extract contextual information from the standardized invoice data, wherein the contextual information includes at least the patient profile information and the department information; The drug name sequence in the standardized invoice data and the context information are input into the dynamic reasoning knowledge base for querying to obtain the context-aware disease weight set corresponding to each drug. Perform a weighted aggregation operation on the context-aware disease weight set corresponding to all drugs in a single invoice to generate candidate diseases and candidate disease aggregation weights; The candidate diseases are sorted and filtered according to the aggregation weight of the candidate diseases. The top-ranked candidate diseases or candidate diseases whose aggregation weight exceeds the preset aggregation threshold are selected to form the first set of pseudo-labeled diseases. The confidence score is generated by normalizing the aggregated weights of each candidate disease in the first set of pseudo-labeled diseases.
5. The disease prediction method based on medical invoices and pseudo-labeling mechanism according to claim 1, characterized in that, The standardized invoice data is input into a pre-trained large language model. The model is then guided by semantic understanding prompt word templates to perform disease inference, generating a second set of pseudo-labeled diseases, including: Based on the drug name sequence, department information, and patient profile information in the standardized invoice data, dynamically construct appropriate semantic understanding prompts; The semantic understanding prompts are input into the pre-trained large language model to guide the large language model to perform a disease inference task and output the initial inference result. The initial inference results are processed through multiple rounds of generation and result fusion to generate duplicate candidate disease frequency statistics. The frequency of the candidate disease frequency statistics includes high frequency, low frequency and medium frequency. The frequency statistics of the candidate diseases are standardized and synonyms are merged to form a standard disease list; Based on the standard disease list and the frequency statistics of the candidate diseases, select a number of high-frequency standard diseases or standard diseases with a frequency exceeding a preset frequency threshold to form the second pseudo-label disease set.
6. The disease prediction method based on medical invoices and pseudo-labeling mechanism according to claim 5, characterized in that, The initial inference results are processed through multiple rounds of generation and result fusion to generate duplicate candidate disease frequency statistics, including: By employing different random seeds or semantically equivalent diverse prompt word templates, multiple large language model calls are performed on the same standardized invoice data to obtain multiple independent sets of initial inference results; Perform a union operation on the multiple independent initial inference result sets, and count the total frequency of each disease name appearing in all initial inference result sets; Based on a preset frequency classification threshold, the statistically analyzed diseases are divided into high-frequency diseases, medium-frequency diseases, and low-frequency diseases. The high-frequency diseases, medium-frequency diseases, and low-frequency diseases, along with their corresponding frequencies, together constitute the frequency statistics of the candidate diseases.
7. The disease prediction method based on medical invoices and pseudo-labeling mechanism according to claim 1, characterized in that, The first set of pseudo-labeled diseases and the second set of pseudo-labeled diseases are merged to generate a fused pseudo-label, including: The first disease and its corresponding confidence level in the first pseudo-label disease set are combined with the second disease in the second pseudo-label disease set to generate a candidate fusion disease pool. Based on a preset fusion strategy, each candidate fusion disease in the candidate fusion disease pool is weighted to obtain the final weight. The preset fusion strategy includes confidence-weighted average, source consistency priority, or voting mechanism. Based on the final assigned weight of each candidate fusion disease, the candidate fusion diseases in the candidate fusion disease pool are sorted and filtered, and the filtered candidate fusion diseases are determined as the fusion pseudo-labels.
8. The disease prediction method based on medical invoices and pseudo-labeling mechanism according to claim 1, characterized in that, Based on the standardized invoice data, feature vectors are constructed, and a multi-label disease classification model is trained using the fused pseudo-labels as the target, including: Feature extraction is performed on the standardized invoice data to generate structured feature vectors and drug sequence semantic feature vectors; The structured feature vector is concatenated and fused with the drug sequence semantic feature vector to generate a joint feature vector; Construct a multi-label classification neural network model that includes an embedding layer, a sequence encoder, and a fully connected output layer; Using the joint feature vector as the model input and the fused pseudo-label as the supervision signal, the multi-label loss function is used to train the multi-label classification neural network model end-to-end. By monitoring the model performance using a validation set and employing an early stopping strategy, a trained multi-label classification neural network model is obtained, which is the multi-label disease classification model.
9. The disease prediction method based on medical invoices and pseudo-labeling mechanism according to claim 1, characterized in that, The data in the medical invoice set is preprocessed for standardization to generate standardized invoice data. This standardized invoice data includes normalized drug name sequences and department information, including: The original drug names in the drug list are cleaned and normalized to remove dosage form, specification and brand information, retain the generic name of the drug, and generate the normalized drug name sequence. A standard department dictionary is constructed, and the original department names are mapped to standard department terms based on a string similarity matching algorithm; For missing or abnormal department names that cannot be classified by string matching, a pre-trained text classification model is used to predict and fill in the department category. Based on the processed drug name and department information, combined with the patient profile information, the standardized invoice data is constructed.
10. A disease prediction system based on medical invoices and pseudo-labeling mechanisms, characterized in that, The system applicable to the method of any one of claims 1 to 9 comprises: The data acquisition and preprocessing module is used to acquire the set of medical bills for the target patient and perform standardized preprocessing to generate standardized bill data. The dynamic reasoning knowledge base module stores the mapping relationship between drugs and diseases, as well as dynamic weight adjustment rules based on context information. The rule reasoning engine module is used to perform weighted logical operations on a single ticket based on the output of the dynamic reasoning knowledge base module, and generate a first set of pseudo-labeled diseases and their confidence levels. The large language model reasoning module is used to guide the large language model to perform disease inference through semantic understanding prompt word templates, and generate a second set of pseudo-labeled diseases. The pseudo-label fusion module is used to fuse the first set of pseudo-label diseases and the second set of pseudo-label diseases to generate fused pseudo-labels; The model training module is used to construct feature vectors based on the standardized invoice data and train a multi-label disease classification model with the fused pseudo-labels as the target. The disease prediction module is used to input the preprocessed medical bill data to the trained multi-label disease classification model and output the predicted disease and its probability.
Citation Information
Patent Citations
Method and electronic device for predicting corresponding relation between drugs and diseases
CN107391927A
Medication accuracy determination method and device, electronic device and storage medium
CN112199493A
