Large medical model data enhancement method and device, electronic equipment and storage medium

By performing vector embedding and medical knowledge graph enhancement on historical clinical data, combined with a multi-module structured autoregressive model and medical rules, a logical sequence of clinical events is generated, which solves the problems of heterogeneity, concurrency and insufficient evolution of disease stages in traditional methods, and improves the generation quality and training efficiency of the model.

CN120636831APending Publication Date: 2025-09-12WEDOC CLOUD (HANGZHOU) HLDG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510732105.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-03
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Traditional medical big model data generation methods are unable to effectively model the heterogeneity, concurrency and disease stage evolution of clinical events, lack the inference and modeling of potential medical causal mechanisms, lack medical rule constraints, and have insufficient coverage of rare events and high-value disease pathways.

Method used

A multi-module structure-enhanced clinical event autoregressive model is adopted. By performing vector embedding representation on historical clinical data, a medical knowledge graph is constructed. A multi-module structure-enhanced clinical event autoregressive model is introduced. Combined with medical rule templates and rare event sampling mechanisms, clinical event autoregressive and rationality scoring are performed to generate a clinical event sequence that conforms to medical logic.

Benefits of technology

It significantly improves the medical usability and training efficiency of the generated clinical event sequences, solves the problems of logical inconsistency and insufficient coverage of rare events in the generated sequences in traditional methods, and improves the generalization ability of the model in complex clinical environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120636831A_ABST
    Figure CN120636831A_ABST
Patent Text Reader

Abstract

The invention provides a medical large model data enhancement method and device, electronic equipment and a storage medium, and relates to the technical field of medical artificial intelligence. In the method, a clinical event autoregression model enhanced by a multi-module structure performs comprehensive modeling for heterogeneity, concurrency, periodicity and latent factors of clinical events; and a medical rule template and a rare event sampling mechanism are introduced, so that the medical availability and training benefits of the generated target clinical event sequence are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical artificial intelligence, and in particular to a method, device, electronic device and storage medium for enhancing large medical model data. Background Art

[0002] Modeling and generating medical clinical events (i.e., medical big model data) is crucial for improving the training effectiveness and generalization capabilities of big medical models (such as disease prediction, risk assessment, and personalized treatment recommendation systems). This is particularly useful for supplementing and enhancing data quality in medical scenarios where real-world data is limited, rare disease samples are insufficient, and data distribution shifts are significant.

[0003] Among traditional methods for modeling and generating large medical data models, some studies employ simple random sampling or language models (such as traditional RNN and LSTM models) to generate clinical event sequences. Specifically, standard RNNs are used to model medical record time series and predict future clinical events. While these methods can learn basic time series patterns, they fail to adequately model the heterogeneity of medical events (different types of diagnoses, treatments, and examinations), concurrency (co-occurrence of multiple events), and the phased evolution of the disease course. Consequently, the generated clinical event sequences often lack medical logical consistency, failing to guarantee clinical rationality and usability.

[0004] On the other hand, some recent studies have introduced simple Transformer-based generative models (such as Med-BERT derivatives) and attempted to incorporate some medical ontologies at the encoding level (such as pre-trained embeddings of disease ICD codes). However, these methods primarily focus on static feature modeling or classification tasks, lacking autoregressive generation mechanisms for complete dynamic clinical pathways (especially continuous multi-step event sequences), and do not incorporate medical rule constraints, disease stage control, or latent cause modeling, making it difficult to effectively simulate the implicit mechanisms and pathway rationality of complex disease evolution.

[0005] In summary, existing technologies have achieved modeling or event prediction of large medical model data to a certain extent, but they still have obvious shortcomings in simulating the actual course of disease and generating clinical event sequences that conform to medical logic and have a reasonable structure. The main manifestations are as follows:

[0006] First, the use of traditional recurrent neural networks (such as Doctor AI) for event sequence modeling processes clinical data only through a single time series sequence, lacking the ability to model the heterogeneity of medical events. Different types of events, such as diagnosis, treatment, examination, and medication, have fundamentally different medical meanings and mechanisms of action. RNN structures are unable to effectively distinguish and specialize the semantics of different event types, resulting in highly mixed sequences and poor clinical rationality. Furthermore, RNN-based methods are susceptible to short-term dependency issues, making it difficult to model the complex associations in long-term disease evolution, further impacting the integrity and coherence of the generated sequences.

[0007] Secondly, although some Transformer-based models (such as Med-BERT) have introduced pre-trained representations of medical codes, improving the prediction of single-step clinical events, these methods are mainly targeted at static or single-step classification tasks and lack a mechanism for generating continuous multi-step events. In addition, while the existing Transformer structure can capture long-range dependencies, it does not explicitly model concurrent relationships in medical events (such as combined medications) or characteristics of disease stages (such as the natural segmentation of diagnosis-treatment-review), nor does it introduce modeling of potential pathological mechanisms. This makes the generated event sequence lack the characteristics of medical stage evolution in the overall disease course structure, making it difficult to truly simulate the clinical pathway.

[0008] Third, existing technologies generally lack explicit medical rule constraints for sequence generation. Whether using RNN or Transformer-based models, event generation relies entirely on implicit learning from training data, which can easily lead to logical conflicts and medical errors (such as failure to perform preoperative medical checks or incorrect medication sequence). The lack of effective path constraints and medical rationality assessments results in unstable data quality, making it difficult to directly use for training and optimizing large-scale medical models.

[0009] Finally, existing methods generally perform well in modeling common diseases and high-frequency pathways, but are less capable of learning rare disease pathways and low-frequency, important events. This is because data distribution naturally favors high-frequency samples, and there is a lack of specialized mechanisms to prioritize rare, clinically important disease pathways during the generation process. This limits the model's generalization and risk identification capabilities in complex clinical settings.

[0010] In summary, the traditional method has the following main defects:

[0011] Unable to effectively model the heterogeneity, concurrency, and evolution of clinical events;

[0012] Lack of inference and modeling of potential medical causal mechanisms (potential causes);

[0013] The generation lacks medical rule constraints, which can easily lead to clinical logic errors;

[0014] The coverage of rare events and high-value disease pathways is insufficient, and the data enhancement effect is limited. Summary of the Invention

[0015] In view of this, the purpose of the present invention is to provide a method, device, electronic device and storage medium for enhancing medical big model data, so as to alleviate the technical problems that traditional methods for generating medical big model data cannot effectively model the heterogeneity, concurrency and evolution of clinical events, lack the inference and modeling of potential medical causal mechanisms (potential causes), lack medical rule constraints, and have insufficient coverage of rare events and high-value disease path paths.

[0016] In a first aspect, an embodiment of the present invention provides a method for enhancing large medical model data, comprising:

[0017] Performing vector embedding representation on the acquired historical clinical data to obtain a vector embedding representation of each clinical event, and structurally enhancing the vector embedding representation of each clinical event based on a medical knowledge graph constructed from the historical clinical data to obtain a graph-enhanced representation of each clinical event;

[0018] A multi-module structure-enhanced clinical event autoregressive model is used to perform clinical event autoregression on the graph-enhanced representation of each clinical event to obtain the next clinical event and the probability corresponding to the next clinical event, wherein the multi-module structure-enhanced clinical event autoregressive model includes: a heterogeneous event attention module, a concurrent graph structure module, a stage gating module, a medical latent cause modeling module and a multi-task event prediction decoder connected in sequence, and the stage gating module is also connected to the output of the heterogeneous event attention module;

[0019] Using a medical rule template library to constrain the next clinical event, obtaining the next clinical event that meets the constraint and the probability corresponding to the next clinical event that meets the constraint;

[0020] Adopting a rare event sampling mechanism to adjust the probability corresponding to the next clinical event that meets the constraints, and determining a target next clinical event based on the adjusted probability and the next clinical event that meets the constraints corresponding to the adjusted probability;

[0021] Taking the target next clinical event as historical clinical data, returning to the step of performing vector embedding representation on the acquired historical clinical data, thereby obtaining a clinical event sequence consisting of multiple target next clinical events;

[0022] The multiple clinical event sequences obtained are scored for rationality, and a target clinical event sequence is determined based on the rationality score of each clinical event sequence, and then the target clinical event sequence is converted into structured enhanced data for training a large medical model.

[0023] Furthermore, the acquired historical clinical data is vector-embedded to obtain a vector-embedded representation of each clinical event, and the vector-embedded representation of each clinical event is structurally enhanced based on the medical knowledge graph constructed from the historical clinical data to obtain a graph-enhanced representation of each clinical event, including:

[0024] Extract clinical events from the historical clinical data, wherein the clinical events include: event, time and type;

[0025] converting the events and types in the clinical events into standard medical coding representations through a standardized mapping function;

[0026] The standard medical coding representation is mapped into a vector embedding representation using the constructed embedding matrix, thereby obtaining a vector embedding representation of each clinical event, wherein different types correspond to different embedding matrices;

[0027] Constructing a medical knowledge graph for the historical clinical data, wherein the medical knowledge graph includes: nodes of clinical events, and edges with relationship types connecting nodes of different clinical events;

[0028] Vectorizing each node in the medical knowledge graph to obtain a graph convolutional embedding representation of the clinical event corresponding to each node;

[0029] Performing causal attention weighting on the multi-hop paths of each node in the medical knowledge graph based on the graph convolutional embedding representation of each clinical event to obtain a multi-hop causal enhanced representation of the clinical event corresponding to each node;

[0030] The graph enhancement representation of each clinical event is determined based on the vector embedding representation of each clinical event, the graph convolution embedding representation of each clinical event, and the multi-hop causal enhancement representation of each clinical event.

[0031] Furthermore, causal attention weighting is performed on the multi-hop paths of each node in the medical knowledge graph based on the graph convolutional embedding representation of each clinical event, including:

[0032] Determine a multi-hop path for each node, and concatenate the graph convolution embedding representations of the nodes in each multi-hop path to obtain a multi-hop path vector representation of each multi-hop path;

[0033] The attention weight of each multi-hop path to the corresponding node is calculated through the multi-head self-attention mechanism of the Transformer structure;

[0034] The attention weight of each multi-hop path to the corresponding node and the multi-hop path vector representation of each multi-hop path are weightedly fused to obtain a multi-hop causal enhancement representation of the corresponding node, and then obtain a multi-hop causal enhancement representation of each clinical event.

[0035] Furthermore, a multi-module structure-enhanced clinical event autoregressive model is used to perform clinical event autoregressive on the enhanced graph representation of each clinical event, including:

[0036] Inputting the graph-enhanced representation of each clinical event into the heterogeneous event attention module, and outputting the heterogeneous event enhanced representation of each clinical event, wherein the heterogeneous event attention module is used to perform attention aggregation on each clinical event using the graph-enhanced representation of all clinical events in the entire clinical event sequence;

[0037] Inputting the heterogeneous event enhanced representation of each clinical event into the concurrent graph structure module, and outputting an enhanced concurrent event graph representation of each clinical event, wherein the concurrent graph structure module constructs a concurrent event co-occurrence graph based on the concurrent events of each clinical event, and then processes the concurrent event co-occurrence graph and the heterogeneous event enhanced representation of each clinical event to obtain an enhanced concurrent event graph representation of each clinical event;

[0038] Inputting the heterogeneous event enhanced representation of each clinical event and the concurrent event graph enhanced representation of each clinical event into the stage gating module to obtain a stage-aware gated representation of each clinical event, wherein the stage gating module calculates a gate value for the stage feature vector corresponding to each clinical event through a gating network, and adjusts the corresponding heterogeneous event enhanced representation and concurrent event graph enhanced representation of the clinical event according to the calculated gate value to obtain a stage-aware gated representation of each clinical event;

[0039] Inputting the stage-aware gated representation of each clinical event into the medical latent modeling module, and outputting a medical latent enhanced representation of each clinical event, wherein the medical latent modeling module extracts the latent distribution parameters of the stage-aware gated representation of each clinical event through a latent variable encoder, calculates the latent variable based on the latent distribution parameters, and then decodes the latent variable and the corresponding stage-aware gated representation of the clinical event through a latent fusion decoder to obtain the medical latent enhanced representation of each clinical event;

[0040] The medical potential enhanced representation of each clinical event is input into a multi-task event prediction decoder, and the next clinical event and the probability corresponding to the next clinical event are output.

[0041] Furthermore, a medical rule template library is used to constrain the next clinical event, including:

[0042] constructing an initial clinical event sequence according to the next clinical event and the clinical events corresponding to the historical clinical data;

[0043] matching the initial clinical event sequence with the medical rule templates in the medical rule template library;

[0044] If the initial clinical event sequence matches any medical rule template in the medical rule template library, the next clinical event in the initial clinical event sequence is the next clinical event that meets the constraint.

[0045] Furthermore, a rare event sampling mechanism is used to adjust the probability corresponding to the next clinical event that meets the constraints, including:

[0046] Using the probability adjustment formula The probability corresponding to the next clinical event that meets the constraint is adjusted to obtain the adjusted probability, where P adjusted (e t+1 ) represents the adjusted probability, represents the normalized probability of the next clinical event that meets the constraint, f(e t+1 ) represents the next clinical event e t+1 The frequency of all clinical events corresponding to the historical clinical data, γ represents the rare event sampling intensity coefficient.

[0047] Furthermore, the rationality of the obtained multiple clinical event sequences was scored, including:

[0048] Each clinical event sequence is input into a potential cause discriminator, and a rationality score of each clinical event sequence is output, wherein the potential cause discriminator is a binary classification network trained based on the real clinical event sequence and the generated clinical event sequence.

[0049] In a second aspect, an embodiment of the present invention further provides a device for enhancing large medical model data, comprising:

[0050] a structure enhancement unit, configured to perform vector embedding representation on the acquired historical clinical data to obtain a vector embedding representation of each clinical event, and to perform structural enhancement on the vector embedding representation of each clinical event based on a medical knowledge graph constructed from the historical clinical data to obtain a graph-enhanced representation of each clinical event;

[0051] a clinical event autoregressive unit, configured to perform clinical event autoregression on the graph-enhanced representation of each clinical event using a multi-module structure-enhanced clinical event autoregressive model to obtain the next clinical event and the probability corresponding to the next clinical event, wherein the multi-module structure-enhanced clinical event autoregressive model comprises: a heterogeneous event attention module, a concurrent graph structure module, a stage gating module, a medical latent cause modeling module, and a multi-task event prediction decoder connected in sequence, and the stage gating module is further connected to the output of the heterogeneous event attention module;

[0052] a constraint unit, configured to constrain the next clinical event using a medical rule template library, and obtain a next clinical event that meets the constraint and a probability corresponding to the next clinical event that meets the constraint;

[0053] a probability adjustment unit, configured to adjust the probability corresponding to the next clinical event that meets the constraints by adopting a rare event sampling mechanism, and determine a target next clinical event based on the adjusted probability and the next clinical event that meets the constraints corresponding to the adjusted probability;

[0054] a loop unit, configured to use the target next clinical event as historical clinical data, return to execute the step of performing vector embedding representation on the acquired historical clinical data, and thereby obtain a clinical event sequence consisting of multiple target next clinical events;

[0055] The rationality scoring and determination unit is used to perform rationality scoring on the multiple clinical event sequences obtained, and determine the target clinical event sequence based on the rationality scores of each clinical event sequence, and then convert the target clinical event sequence into structured enhanced data for training a large medical model.

[0056] In a third aspect, an embodiment of the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the methods described in the first aspect when executing the computer program.

[0057] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to execute any method described in the first aspect above.

[0058] In an embodiment of the present invention, a method for enhancing medical large model data is provided, including: performing vector embedding representation on the acquired historical clinical data to obtain a vector embedding representation of each clinical event, and structurally enhancing the vector embedding representation of each clinical event based on a medical knowledge graph constructed based on the historical clinical data to obtain a graph-enhanced representation of each clinical event; performing clinical event autoregression on the graph-enhanced representation of each clinical event using a multi-module structure-enhanced clinical event autoregressive model to obtain the next clinical event and the probability corresponding to the next clinical event, wherein the multi-module structure-enhanced clinical event autoregressive model includes: a heterogeneous event attention module, a concurrent graph structure module, a stage gating module, a medical latent cause modeling module and a multi-task event prediction decoder connected in sequence, and the stage gating module is also connected to the output of the heterogeneous event attention module ; A medical rule template library is used to constrain the next clinical event, and the next clinical event that meets the constraints and the probability corresponding to the next clinical event that meets the constraints are obtained; a rare event sampling mechanism is used to adjust the probability corresponding to the next clinical event that meets the constraints, and the target next clinical event is determined based on the adjusted probability and the next clinical event that meets the constraints corresponding to the adjusted probability; the target next clinical event is used as historical clinical data, and the step of vector embedding representation of the acquired historical clinical data is returned to obtain a clinical event sequence consisting of multiple target next clinical events; a rationality score is performed on the multiple clinical event sequences obtained, and a target clinical event sequence is determined based on the rationality score of each clinical event sequence, and the target clinical event sequence is converted into structured enhanced data for training large medical models. From the above description, it can be seen that in the medical big model data enhancement method of the present invention, the multi-module structure enhanced clinical event autoregressive model comprehensively models the heterogeneity, concurrency, stage and potential of clinical events, and introduces medical rule templates and rare event sampling mechanisms, thereby significantly improving the medical usability and training benefits of the generated target clinical event sequence, and alleviating the technical problems that the traditional medical big model data generation method cannot effectively model the heterogeneity, concurrency and disease stage evolution of clinical events, lacks the inference and modeling of potential medical causal mechanisms (potential causes), lacks medical rule constraints, and has insufficient coverage of rare events and high-value disease path paths. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0060] Figure 1A flowchart of a method for enhancing large medical model data provided by an embodiment of the present invention;

[0061] Figure 2 A schematic diagram of a device for enhancing large medical model data provided by an embodiment of the present invention;

[0062] Figure 3 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0063] The following will clearly and completely describe the technical solutions of the present invention in conjunction with the embodiments. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0064] Traditional methods for generating medical big model data cannot effectively model the heterogeneity, concurrency, and evolution of disease stages of clinical events, lack the inference and modeling of potential medical causal mechanisms (potential causes), lack medical rule constraints, and have insufficient coverage of rare events and high-value disease pathways.

[0065] Based on this, in the enhancement method of the medical big model data of the present invention, the multi-module structure enhanced clinical event autoregressive model comprehensively models the heterogeneity, concurrency, stage and potential of clinical events, and introduces medical rule templates and rare event sampling mechanisms, thereby significantly improving the medical usability and training benefits of the generated target clinical event sequence.

[0066] To facilitate understanding of this embodiment, a method for enhancing large medical model data disclosed in an embodiment of the present invention is first introduced in detail.

[0067] Example 1:

[0068] According to an embodiment of the present invention, an embodiment of a method for enhancing large medical model data is provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system, such as a set of computer-executable instructions, and although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown.

[0069] Figure 1 FIG. 1 is a flow chart of a method for enhancing large medical model data according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps:

[0070] Step S102: Perform vector embedding on the acquired historical clinical data to obtain a vector embedding representation of each clinical event, and perform structural enhancement on the vector embedding representation of each clinical event based on the medical knowledge graph constructed based on the historical clinical data to obtain a graph-enhanced representation of each clinical event.

[0071] Specifically, in real medical scenarios, the course of a patient's illness is composed of heterogeneous clinical events, including:

[0072] Diagnostic events (Dx): such as diagnosis of diabetes and hypertension;

[0073] Examination events (Ex): such as CT, blood routine, liver function;

[0074] Treatment events (Tx): such as surgery and physical therapy;

[0075] Drug events (Rx): such as prescription of insulin, aspirin, etc.

[0076] These clinical events often occur in an uneven, nonlinear temporal manner, while having clear medical semantics and logical order.

[0077] Traditional sequence modeling encodes these clinical events in a mixed manner, losing their heterogeneity, multi-channel nature, and medical structural logic. Therefore, the goal of multi-channel structured encoding of clinical events (including vector embedding representation) is to transform historical clinical data into a structured, standardized, multi-channel, and time-aligned tensor form for use in subsequent steps.

[0078] The multi-channel structured coding of clinical events in the present invention significantly improves the ability of the clinical event autoregressive model to capture the internal logic of medical data by constructing an input tensor with multi-channel expression, time-dependent modeling and medical semantic embedding capabilities. It helps the clinical event autoregressive model to more accurately understand the disease evolution path, staged treatment mode and the synergistic relationship between concurrent events. It is a key prerequisite for achieving accurate prediction, high-quality generation and medical rationality control.

[0079] The process of multi-channel structured coding of clinical events involves extracting historical clinical data from electronic medical record systems, semantically classifying them according to event type (e.g., diagnosis, examination, treatment, medication), and mapping them to standard medical coding systems (e.g., ICD-10, LOINC, and ATC). Separate embeddings are then constructed for each type of clinical event, and sine and cosine positional encoding is performed based on the temporal characteristics of the clinical events. Finally, all clinical events are aligned and padded in chronological order to construct a unified multi-channel time series tensor. This tensor fully preserves the semantic information, temporal dependencies, and structural types of clinical events, providing a clear and informative input data foundation for subsequent autoregressive modeling.

[0080] Furthermore, clinical events often have clear causal chains and complex semantic structures, making it difficult for traditional sequence models to capture this structural knowledge. Introducing a medical knowledge graph, combined with a multi-hop causal path attention mechanism, not only mines multi-level causal relationships such as cause-symptom-examination-treatment, but also identifies critical paths with decision-making value in specific disease scenarios, effectively improving the medical consistency and clinical applicability of generated samples (i.e., the next clinical event).

[0081] The process of structural enhancement aims to use the medical knowledge graph to perform structural enhancement modeling of clinical events. By integrating the entity relationships and path information in the graph, an embedded representation with semantic, structural and causal characteristics is constructed for each clinical event, thereby improving the downstream model's (such as the clinical event autoregressive model) ability to understand the complex relationships between clinical events and enhancing the medical rationality and predictive ability of the generated model.

[0082] The structural enhancement step is based on the constructed medical knowledge graph. First, the relational graph neural network (R-GCN) is used to obtain the structured representation of the node of each clinical event. Further, through multi-hop path sampling and attention mechanism, the high-order causal path representation of the clinical event in the knowledge graph is extracted and weightedly integrated into the clinical event representation. Finally, a composite clinical event vector that integrates "local context + graph embedding + multi-hop causal path" is formed as the input of the autoregressive generative model, realizing the efficient injection of structural information into the model's learning ability.

[0083] The above process will be described in detail below and will not be repeated here.

[0084] Step S104: using a multi-module structure-enhanced clinical event autoregressive model to perform clinical event autoregression on the enhanced graph representation of each clinical event to obtain the next clinical event and the probability corresponding to the next clinical event, wherein the multi-module structure-enhanced clinical event autoregressive model includes: a heterogeneous event attention module, a concurrent graph structure module, a stage gating module, a medical latent cause modeling module, and a multi-task event prediction decoder connected in sequence, and the stage gating module is also connected to the output of the heterogeneous event attention module;

[0085] Specifically, clinical event sequences are different from ordinary text sequences and have the following complex structural features:

[0086] Event heterogeneity: Multiple types of heterogeneous events such as diagnosis, treatment, examination, and medication occur alternately;

[0087] Staged evolution: The disease progression presents a multi-stage structure of "initial diagnosis → treatment → follow-up → prognosis";

[0088] Concurrent association: multiple clinical events often occur concurrently at the same time point (such as multiple combined medications);

[0089] Pathological potential: Certain disease process nodes are driven by underlying medical mechanisms rather than overt events.

[0090] Traditional autoregressive modeling methods are generally based on language or behavioral sequences, making it difficult to effectively express complex structural information in clinical events, such as the alternation of cross-type events, the concurrence of multiple clinical events at the same time, the switching of disease evolution stages, and unobservable pathological mechanisms. This results in the generated data lacking clinical authenticity and medical logical consistency. This invention introduces a multi-module structural enhancement strategy that fully integrates medical knowledge structure and clinical practice experience, enabling the clinical event autoregressive model to have stronger structural expression capabilities and medical rationality in the process of generating the next clinical event, providing key support for solving the problems of data scarcity and insufficient generalization ability of large models.

[0091] The present invention aims to construct an autoregressive generative model with multi-structure perception capabilities (i.e., a multi-module structure-enhanced clinical event autoregressive model) based on the medically specific structural characteristics of clinical event sequences, such as heterogeneity, stage, concurrency, and potential causality. By integrating heterogeneous event encoding (i.e., heterogeneous event attention module), concurrent graph structure modeling (i.e., concurrent graph structure module), disease stage perception mechanism (stage gating module), and potential causal reasoning capability (medical potential causal modeling module), the present invention can achieve accurate modeling and reasonable generation of complex medical pathways, thereby providing high-quality enhanced samples for downstream medical large models.

[0092] The present invention uses a clinical event embedding representation (i.e., a graph-enhanced representation of clinical events) that integrates a knowledge graph and a multi-hop causal path as input, and sequentially performs deep feature modeling through five structural enhancement submodules: First, the heterogeneous event attention module (HEM) implements semantic difference modeling of different clinical event types; second, the concurrent graph structure module (CEG) characterizes the collaborative relationship between clinical events at the same time point based on the graph attention mechanism; then, the stage gating module (SGM) introduces the disease stage perception vector to control the activation of event information flow; further, the medical latent cause modeling module (CLVM) models potential pathological driving factors through variational inference; finally, the multi-task event prediction decoder combines the main task with the multi-task prediction head to jointly output the next clinical event and its related attributes. Each module works together to form an end-to-end medical specialized autoregressive generation system, effectively improving the structural expression ability and medical consistency of the generated clinical event sequence.

[0093] Step S106, using the medical rule template library to constrain the next clinical event, and obtaining the next clinical event that meets the constraints and the probability corresponding to the next clinical event that meets the constraints;

[0094] Specifically, this process generates high-quality clinical event sequences using a multi-module structure-enhanced clinical event autoregressive model (a multi-module structure-enhanced CEAT++ model) to address the challenges of insufficient training data and unbalanced data distribution in large medical models. Although the model already possesses powerful structural modeling capabilities, including heterogeneous event attention, concurrent structure capture, disease stage perception, and latent variable modeling, to ensure the medical rationality and safety of the synthesized clinical event sequences, steps S106 and S108 specifically introduce medical rule constraints and a rare event sampling mechanism to enhance data generation.

[0095] Based on the trained multi-module structure-enhanced CEAT++ model, the joint prediction distribution output by its multi-task event prediction decoder is utilized in combination with medical rule templates to generate highly reliable and high-quality clinical event sequences.

[0096] Step S108, using a rare event sampling mechanism to adjust the probability corresponding to the next clinical event that meets the constraints, and determining a target next clinical event based on the adjusted probability and the next clinical event that meets the constraints corresponding to the adjusted probability;

[0097] Specifically, in the medical event sequence, rare but important clinical events are very important for large model training. In order to enhance the model's ability to predict low-frequency, high-risk clinical events, this step introduces a rare event sampling mechanism. By adjusting the priority sampling weights of rare events based on the probability corresponding to the next clinical event predicted by the clinical event autoregressive model, the target next clinical event e is generated. t+1 .

[0098] Step S110, taking the target next clinical event as historical clinical data, returning to execute the step of performing vector embedding representation on the acquired historical clinical data, thereby obtaining a clinical event sequence consisting of multiple target next clinical events;

[0099] Specifically, repeat the above steps to gradually generate a complete clinical event sequence:

[0100] Finally, a set of clinical event sequences is obtained:

[0101] In step S112, the rationality scores of the obtained multiple clinical event sequences are performed, and a target clinical event sequence is determined based on the rationality scores of each clinical event sequence, and the target clinical event sequence is then converted into structured enhanced data for training a large medical model.

[0102] Specifically, to ensure that the clinical event sequence set X obtained by the rare event sampling mechanism is candidate Safety and medical rationality in clinical logic require further quality screening:

[0103] Performing rationality scores on the obtained multiple clinical event sequences to obtain the rationality score of each clinical event sequence;

[0104] Next, a rationality threshold θ is set. In the present invention, θ=0.75 is set, and only target clinical event sequences with rationality scores exceeding the rationality threshold are retained:

[0105] After this step, the target clinical event sequence with strict quality control is finally obtained.

[0106] The target clinical event sequence is then converted into data that can be used by the medical big model.

[0107] The target clinical event sequence Converted into a structured enhanced data set that can be directly used for training large medical models Ensure that its format, structure, and labels are completely consistent with the actual training set to achieve the true implementation of data enhancement.

[0108] The conversion process includes:

[0109] Unified structured fields and formats: Each target clinical event is converted into a structured dictionary format, and all target clinical event sequences are converted into structured sequences to form a standard data sample.

[0110] Missing field completion: If some target clinical events are missing time information or the confidence level of stage prediction is low, strategic completion is used to interpolate the values ​​based on the sequence context mean. This ensures that each sample has a complete structure: event + time + stage.

[0111] Sample number and metadata annotation: Add a unique sample ID to each synthetic sequence, and annotate metadata such as the generated model version, generation time, and scoring value for future quality traceability and auditing.

[0112] Sample verification and import into the enhanced set: All structured candidate samples are uniformly verified for data integrity (complete fields, consistent format, no illegal symbols, etc.), and are officially included in the enhanced training set after passing the final review.

[0113] Finally, we obtain a structured, standardized, and validated enhanced dataset that can be used for large medical models.

[0114]

[0115] Normalize(·) is a structural normalization function (field completion, stage label structuring, event vector formatting); QualityCheck(·) is a completeness and availability check function.

[0116] In an embodiment of the present invention, a method for enhancing medical large model data is provided, including: performing vector embedding representation on the acquired historical clinical data to obtain a vector embedding representation of each clinical event, and structurally enhancing the vector embedding representation of each clinical event based on a medical knowledge graph constructed based on the historical clinical data to obtain a graph-enhanced representation of each clinical event; performing clinical event autoregression on the graph-enhanced representation of each clinical event using a multi-module structure-enhanced clinical event autoregressive model to obtain the next clinical event and the probability corresponding to the next clinical event, wherein the multi-module structure-enhanced clinical event autoregressive model includes: a heterogeneous event attention module, a concurrent graph structure module, a stage gating module, a medical latent cause modeling module and a multi-task event prediction decoder connected in sequence, and the stage gating module is also connected to the output of the heterogeneous event attention module ; A medical rule template library is used to constrain the next clinical event, and the next clinical event that meets the constraints and the probability corresponding to the next clinical event that meets the constraints are obtained; a rare event sampling mechanism is used to adjust the probability corresponding to the next clinical event that meets the constraints, and the target next clinical event is determined based on the adjusted probability and the next clinical event that meets the constraints corresponding to the adjusted probability; the target next clinical event is used as historical clinical data, and the step of vector embedding representation of the acquired historical clinical data is returned to obtain a clinical event sequence consisting of multiple target next clinical events; a rationality score is performed on the multiple clinical event sequences obtained, and a target clinical event sequence is determined based on the rationality score of each clinical event sequence, and the target clinical event sequence is converted into structured enhanced data for training large medical models. From the above description, it can be seen that in the medical big model data enhancement method of the present invention, the multi-module structure enhanced clinical event autoregressive model comprehensively models the heterogeneity, concurrency, stage and potential of clinical events, and introduces medical rule templates and rare event sampling mechanisms, thereby significantly improving the medical usability and training benefits of the generated target clinical event sequence, and alleviating the technical problems that the traditional medical big model data generation method cannot effectively model the heterogeneity, concurrency and disease stage evolution of clinical events, lacks the inference and modeling of potential medical causal mechanisms (potential causes), lacks medical rule constraints, and has insufficient coverage of rare events and high-value disease path paths.

[0117] The above content briefly introduces the method for enhancing large medical model data of the present invention. The specific contents involved are described in detail below.

[0118] In an optional embodiment of the present invention, vector embedding representation is performed on the acquired historical clinical data to obtain a vector embedding representation of each clinical event, and the vector embedding representation of each clinical event is structurally enhanced based on the medical knowledge graph constructed based on the historical clinical data to obtain a graph-enhanced representation of each clinical event. Specifically, the following steps are included:

[0119] (1) Extract clinical events from historical clinical data, where clinical events include: event, time and type;

[0120] Specifically, structured data (i.e., clinical events) are extracted from the hospital information system (HIS) and the electronic medical record system (EMR). For each patient p, the visit event is defined as: in, represents the ICD-10 diagnosis code of the i-th clinical event (i.e., event), for example, “E11.9” represents type 2 diabetes; Indicates the timestamp (time) of the clinical event; Indicates the type of clinical event (such as diagnosis, examination, treatment, medication); N p represents the total number of clinical events for the patient.

[0121] (2) converting the events and types in clinical events into standard medical coding representations through standardized mapping functions;

[0122] Specifically, the clinical events i Mapping to the standard medical coding system, where ICD-10 codes are used for diagnostic events; LOINC codes are used for examination items; SNOMED and ATC codes are used for drugs and treatments, etc., and standardized mapping functions are defined: in It is a semantic mapping table based on the type of clinical events.

[0123] (3) Using the constructed embedding matrix, the standard medical coding representation is mapped into a vector embedding representation, thereby obtaining the vector embedding representation of each clinical event, where different types correspond to different embedding matrices;

[0124] Specifically, for each type of event c∈{Dx,Ex,Tx,Rx}, construct an independent embedding matrix: E (c) The vector embedding is represented as:

[0125] In addition, clinical events have non-uniform intervals and non-fixed lengths of time, and need to be aligned to a timeline structure. Time normalization and coding:

[0126] First, all clinical events are sorted by time:

[0127] Next, calculate the relative time difference: And perform numerical normalization. Then use sine and cosine position encoding to map:

[0128] Where k represents the number of frequency dimensions of the temporal position encoding.

[0129] Assign the same patient events to independent channels by type, and each channel forms its corresponding time series input sequence tensor: Where T p is the maximum time step after time alignment for patient p. is a vector concatenation operation.

[0130] If a channel has no event at a certain time, an empty vector is used to fill in zeros. Parallel alignment is done using a unified alignment time grid so that multi-channel inputs are aligned at a unified time step T. p .

[0131] The final output is a standardized multi-channel time series tensor: Z (p) =[X (p,Dx) ,X (p,Tx) ,X (p,Ex) ,X (p ,Rx) ].

[0132] (4) Constructing a medical knowledge graph based on historical clinical data, wherein the medical knowledge graph includes: nodes of clinical events and edges with relationship types connecting nodes of different clinical events;

[0133] Specifically, a multi-relational heterogeneous medical knowledge graph was constructed:

[0134] in, It is a collection of entity nodes, including diseases, symptoms, examinations, drugs, treatment operations, etc.

[0135] is a set of relationship types, such as "cause", "treat", "is_a", "exam_for", "interact", etc.

[0136] Represents a set of edges with a relationship type.

[0137] Each clinical event i There are corresponding nodes in the graph

[0138] (5) Vectorize each node in the medical knowledge graph to obtain the graph convolution embedding representation of the clinical events corresponding to each node;

[0139] Specifically, for each node Initialize the feature vector, use the relational graph convolutional network to learn the node embedding, and finally output the vector embedding expression of the node (i.e. clinical event)

[0140] (6) Based on the graph convolutional embedding representation of each clinical event, causal attention weighting is performed on the multi-hop paths of each node in the medical knowledge graph to obtain the multi-hop causal enhanced representation of the clinical event corresponding to each node;

[0141] Specifically, in order to further enhance the vector embedding representation so that it not only contains the neighbor information of the current node but also can model the structure and directionality of the multi-hop path in the causal chain, the present invention adopts a multi-hop causal path attention mechanism.

[0142] The process of causal attention weighting includes the following steps:

[0143] (61) Determine the multi-hop path of each node, and concatenate the graph convolution embedding representations of the nodes in each multi-hop path to obtain a multi-hop path vector representation of each multi-hop path;

[0144] Specifically, for a certain clinical event node v i , we can find all the medical knowledge graphs from v i Starting from, there is a directed path of length k (there can be multiple).

[0145] Clinical events i The corresponding node v i , define its k-hop path (i.e. multi-hop path) set as:

[0146]

[0147] Each multi-hop path Corresponding to a set of nodes v i →v1→v2→…→v k , then the multi-hop path can be represented by concatenating the graph convolutional embedding representations of these nodes:

[0148]

[0149] For example:

[0150] Assume v i It is "diabetes", and two 2-hop paths are found in the medical knowledge graph:

[0151] Path j = 1: Diabetes → Diabetic Retinopathy → Blindness

[0152] Path j = 2: Diabetes → Kidney Disease → Dialysis

[0153] So:

[0154]

[0155] (62) The attention weight of each multi-hop path to the corresponding node is calculated through the multi-head self-attention mechanism of the Transformer structure;

[0156] Specifically, after obtaining the multi-hop path, a path attention module is designed to calculate the importance of each multi-hop path to the current clinical event.

[0157] Attention weighting of causal paths in the present invention It is obtained by calculating the Transformer structure. Specifically, after encoding each multi-hop path, the self-attention mechanism is introduced to model its global semantics and path importance, thereby generating the attention distribution of each multi-hop path.

[0158] (63) The attention weights of each multi-hop path to the corresponding node and the multi-hop path vector representations of each multi-hop path are weightedly fused to obtain the multi-hop causal enhancement representation of the corresponding node, and then the multi-hop causal enhancement representation of each clinical event is obtained.

[0159] Specifically, based on the multi-hop path representation, the Transformer's multi-head self-attention mechanism is used to uniformly model and weight all multi-hop paths to obtain path-level causal representation and automatically identify the pathological causal chain that has the greatest impact on the current clinical event.

[0160] The weighted multi-hop causal enhancement representation is obtained:

[0161] (7) Determine the graph enhancement representation of each clinical event based on the vector embedding representation of each clinical event, the graph convolution embedding representation of each clinical event, and the multi-hop causal enhancement representation of each clinical event.

[0162] Specifically, the atlas enhancement represents the fusion of three parts:

[0163] Vector embedding representation: x i

[0164] Graph convolutional embedding representation:

[0165] Multi-hop causal enhancement representation:

[0166] By concatenating the three vectors As the input of the subsequent autoregressive model. Splicing method:

[0167]

[0168] In an optional embodiment of the present invention, a multi-module structure enhanced clinical event autoregressive model is used to perform clinical event autoregressive on the enhanced representation of the graph of each clinical event, specifically comprising the following steps:

[0169] (1) Inputting the graph-enhanced representation of each clinical event into the heterogeneous event attention module, and outputting the heterogeneous event enhanced representation of each clinical event, wherein the heterogeneous event attention module is used to perform attention aggregation on each clinical event using the graph-enhanced representation of all clinical events in the entire clinical event sequence;

[0170] Specifically, the heterogeneous event attention module is designed to handle the differences in expression and semantic structure of different clinical events. Clinical events include: diagnosis events (Dx); examination events (Ex); treatment events (Tx); and medication events (Rx).

[0171] Enhance the graph representation of each clinical event As input, it is fed into the heterogeneous event attention module, where Graph-augmented representation of clinical events at the Tth time step.

[0172] In this module, each clinical event type is fed into a type-specific attention head:

[0173]

[0174] in, Represents the graph enhancement representation of all clinical events from the 1st to the Tth time step in the current clinical sequence, Atten (type) This is a Transformer-based multi-head self-attention mechanism designed specifically for diagnosis, treatment, and medication. This formula uses all clinical event representations from the entire clinical event sequence (1 to T) as context for the i-th clinical event, aggregates attention, and obtains a type-specific representation for that clinical event (i.e., a heterogeneous event enhanced representation).

[0175] Assume that the length of the clinical event sequence is T = 5, and the current focus is on the i = 3 clinical event, which is "taking aspirin" (drug type). We want the model to understand its relationship with the previous and next clinical events, for example:

[0176] e1: Diagnosis of "acute myocardial infarction"

[0177] e2: Check the electrocardiogram

[0178] e3: Drug "Aspirin"

[0179] e4: Drug "Clopidogrel"

[0180] e5: Check platelet count

[0181] Then what is performed in the heterogeneous event attention module is:

[0182]

[0183] Let the model learn to focus on the most relevant context (such as e1, e2) to strengthen the encoding representation of clinical event e3.

[0184] In the Heterogeneous Event Attention Module (HEM), each clinical event uses the full clinical event sequence as the attention context to capture long-range structural dependencies within or across types.

[0185] The present invention implements an attention mechanism for each type, including diagnostic events (Dx), examination events (Ex), treatment events (Tx), and drug events (Rx). (type) , respectively These different types of representations are then concatenated in the channel dimension to obtain a unified representation:

[0186]

[0187] Concatenate multiple attention representations of different types The heterogeneous events are concatenated together to form a richer representation (i.e., heterogeneous event enhanced representation). This is one of the core innovations of the Heterogeneous Event Attention Module (HEM).

[0188] (2) inputting the heterogeneous event enhanced representation of each clinical event into a concurrent graph structure module, and outputting an enhanced concurrent event graph representation of each clinical event, wherein the concurrent graph structure module constructs a concurrent event co-occurrence graph based on the concurrent events of each clinical event, and then processes the concurrent event co-occurrence graph and the heterogeneous event enhanced representation of each clinical event to obtain an enhanced concurrent event graph representation of each clinical event;

[0189] Specifically, the concurrent graph structure module aims to address the difficulty in modeling the synergistic interactions between clinical events when multiple clinical events occur concurrently at the same time step. For example, in cardiovascular disease treatment, aspirin and clopidogrel are often prescribed at the same time, and they exhibit a synergistic antiplatelet effect. If the model is treated solely as a single linear sequence, it would be difficult to express the synergistic, reinforcing, or mutually restrictive relationships between concurrent events.

[0190] Therefore, this module specifically introduces a graph structure mechanism to model the structural dependencies between concurrent events, making up for the shortcomings of the linear attention mechanism in modeling concurrent events.

[0191] Enhance the representation of heterogeneous events output by the heterogeneous event attention module (HEM) As input, it is input into the concurrent graph structure module. The present invention constructs the concurrent event set of each time step t as a unit:

[0192]

[0193] Among them, C t represents all clinical events occurring simultaneously within time step t, n represents the number of concurrent events, and each event Enhanced representation of heterogeneous events

[0194] In this module, a concurrent event graph is first constructed for the concurrent event set, and its adjacency matrix is ​​defined as:

[0195]

[0196] Then, the concurrent event co-occurrence graph is input into the publicly available Graph Attention Network (GAT) to update the node embedding:

[0197]

[0198] This formula indicates that for the lth clinical event, the graph attention information is aggregated through the co-occurring events at the same time (i.e., other clinical events that co-occur at the same time) to obtain the concurrent event graph enhancement representation

[0199] Taking cardiovascular therapy as an example, clear examples are as follows:

[0200] Assume that the current time is t=3, and the concurrent events are as follows:

[0201] The drug "Aspirin"

[0202] The drug "clopidogrel"

[0203] Check the platelet count

[0204] First, these three events are respectively enhanced by heterogeneous event representations through the heterogeneous event attention module (HEM):

[0205]

[0206] These events together constitute the concurrent event set C3. They have the following structure:

[0207] Aspirin and clopidogrel have a synergistic effect.

[0208] Platelet count is used to assess the effectiveness of antiplatelet drug therapy.

[0209] Construct the adjacency matrix A3 (i.e., concurrent event co-occurrence graph):

[0210]

[0211] The heterogeneous event enhanced representations of these events are input into the publicly available Graph Attention Network (GAT) to obtain the concurrent event graph enhanced representation:

[0212]

[0213] This enables the model to understand the synergistic relationships and mutual regulatory effects among these events.

[0214] Finally, a concurrent event graph is generated for each clinical event. The concurrent event graphs of multiple clinical events are pooled together to form a holistic representation of the time step:

[0215]

[0216] This representation will serve as the structural enhancement encoding for this time step and be input to the next module (stage gating module).

[0217] The core innovation of this module is: constructing multiple concurrent events in the same time step into graph structure modeling; using the graph attention mechanism to explicitly learn the semantic collaboration, therapeutic interaction and functional complementarity between concurrent events; filling the structural gaps of traditional Transformer in processing concurrent events, and achieving a more clinically reasonable event representation.

[0218] (3) Inputting the heterogeneous event enhanced representation of each clinical event and the concurrent event graph enhanced representation of each clinical event into the stage gating module to obtain the stage-aware gated representation of each clinical event, wherein the stage gating module calculates the gate value of the stage feature vector corresponding to each clinical event through the gating network, and adjusts the corresponding heterogeneous event enhanced representation and concurrent event graph enhanced representation of the clinical event according to the calculated gate value to obtain the stage-aware gated representation of each clinical event;

[0219] Specifically, this module addresses the differences in clinical event sequences across different disease stages. Clinical stages include: initial diagnosis; treatment; reassessment; and prognosis management.

[0220] Enhance the representation of heterogeneous events output by the heterogeneous event attention module (HEM) Enhanced representation of concurrent event graph output by concurrent graph structure module (CEG) As input, where represents the enhanced representation of the concurrent event graph at the T-th time step, Enhance the representation for the corresponding heterogeneous events.

[0221] In the stage-aware gating module, each clinical event is assigned a stage label: s t ∈{InitialDiagnosis,Treatment,Reassessment,PrognosisManagement}

[0222] Used to indicate the stage of the disease course in which the clinical event occurs.

[0223] The specific operation of the stage gating module is as follows: First, the stage label s corresponding to each clinical event is t Perform one-hot encoding and express it as a stage feature vector:

[0224] Then, the feature vector of this stage is input into a gating network. The specific formula is: Where σ(·) is the sigmoid activation function, which constrains the gate value to the range [0, 1]; W s and b s is the learnable weight parameter in the gating module at this stage.

[0225] Finally, the gating value is used to adjust the information flow of the clinical event representation (including the heterogeneous event enhanced representation and concurrent event graph enhanced representation of clinical events) to obtain the stage-specific event representation (i.e., the stage-aware gated representation):

[0226]

[0227] Embodying enhanced representation of heterogeneous events;

[0228] Embodying enhanced representation of concurrent event graphs;

[0229] By the gate value g t The two are dynamically fused at different stages to obtain a specialized event representation for that stage (i.e., the stage-aware gated representation).

[0230] Assume that the length of the clinical event sequence is T=5, and the current focus is on the t=4th event, which is "recheck blood creatinine test" and belongs to the "reassessment phase". The course context events are as follows:

[0231] e1: Initial Diagnosis event: "Diagnosed with acute kidney injury"

[0232] e2: Treatment phase event: "Use of diuretics"

[0233] e3: Treatment phase event: "Use of antihypertensive drugs"

[0234] e4: Reassessment phase event: "Recheck blood creatinine test"

[0235] e5: Prognosis Management Event: "Recovery Follow-up"

[0236] The operations performed in the stage gate module are:

[0237] First, the phase feature vector of event e4 is:

[0238] Corresponding to four stages {Initial Diagnosis, Treatment, Reassessment, Prognosis Management}

[0239] Then, the gating value is obtained through the gating network: g4=σ(W s [0,0,1,0] T +b s ).

[0240] Finally, the gating value is used to regulate the information flow of clinical event representation (heterogeneous event enhancement representation and concurrent event graph enhancement representation):

[0241]

[0242] This design enables the event representation (i.e., the obtained stage-aware gated representation) to not only have heterogeneous information but also capture the collaborative information of concurrent events, and dynamically adjust the information flow distribution according to specific disease stages, accurately expressing the unique clinical semantic structure of each stage.

[0243] This step allows the model to clearly distinguish the semantic differences between the "Reassessment" stage events and the events in different stages before and after (such as initial diagnosis, treatment and prognosis stages), dynamically control the information flow, and enhance the differentiated expression of events in different stages of the disease process.

[0244] The present invention constructs a stage-specific gating function for each clinical stage, including the initial diagnosis stage, the treatment stage, the reassessment stage, and the prognosis management stage, calculates the respective stage gating values, and then adjusts the information flow of the event representation to obtain a stage-specific event representation (i.e., the stage-aware gated representation).

[0245] The core innovation of the Stage Gating Module (SGM) lies in explicitly modeling the differences between different stages of the clinical pathway and utilizing a stage-specific gating mechanism to achieve dynamic information flow regulation, thereby enabling the model to accurately express the stage structure characteristics of the clinical event sequence and significantly improving the model's ability to fit the real medical pathway.

[0246] (4) The stage-perceptual gated representation of each clinical event is input into the medical latent modeling module, and the output is the medical latent enhanced representation of each clinical event. The medical latent modeling module extracts the latent distribution parameters of the stage-perceptual gated representation of each clinical event through the latent variable encoder, calculates the latent variable based on the latent distribution parameters, and then decodes the latent variable and the corresponding stage-perceptual gated representation of the clinical event through the latent fusion decoder to obtain the medical latent enhanced representation of each clinical event.

[0247] Specifically, the Medical Latent Factor Modeling module aims to address the difficulty in directly observing and explicitly modeling potential medical factors, such as disease progression mechanisms or disease outcomes, in clinical event sequences. In actual clinical practice, disease progression is driven not only by explicitly documented events (such as medications and diagnostic tests), but also by many implicit factors that are not explicitly documented (such as the intrinsic evolution of the disease, individual patient differences, and differences in treatment response).

[0248] Traditional autoregressive models only model explicit clinical event sequences while ignoring the underlying medical mechanisms described above, limiting their ability to accurately model the evolution of complex diseases. Therefore, this module specifically introduces latent dependent variables and explicitly models the underlying medical factors in clinical sequences through variational inference. This allows for a more accurate depiction of the underlying disease evolution, improving the model's generalization and medical plausibility.

[0249] The Medical Latent Modeling Module is represented by the output of the Stage Gating Module (SGM) - the stage-aware gated representation is the input, where represents the stage-aware gated representation of the T-th time step.

[0250] The specific operations of the medical latent factor modeling module are as follows:

[0251] First, a specially designed encoding network (latent encoder) is used to parameterize the latent variable of the post-gated representation of each clinical event to obtain the latent distribution parameters, including the mean and variance:

[0252]

[0253] Among them, μ t is the mean vector of the parameters of the latent distribution; is the variance vector of the latent distribution parameters; MLP enc It is a specialized multilayer perceptron encoding network (MLP) in the medical latent factor modeling module.

[0254] Assume that the current clinical sequence length is T=5, and the current focus is on the t=4th event representation (stage-aware gated representation) The meaning of the above formula is: according to the stage perception gate, Calculate the mean and variance (latent distribution parameters) of the potential medical factors behind it.

[0255] Next, based on the latent distribution parameters calculated above, the reparameterization trick is used to sample the latent variable:

[0256]

[0257] Where,∈ is random noise sampled from a standard Gaussian distribution; represents element-wise multiplication, is the latent dependent variable.

[0258] The latent dependent variable obtained by this sampling It can effectively represent the hidden medical mechanism behind the event.

[0259] For example, the potential sampling operation for the event "recheck blood creatinine test" is:

[0260]

[0261] This latent dependent variable represents a latent pathological state such as potential disease outcome or treatment response.

[0262] After completing the latent variable sampling, the latent variable is fused with the stage-perceptual gated representation and sent to the latent fusion decoder to predict the clinical event at the next moment. Specifically, it is expressed as:

[0263]

[0264] in, It is a vector concatenation operation, and Decoder is a specially designed latent decoding network. It is a medical potential enhancement statement.

[0265] This operation enables the model to not only focus on explicit events, but also capture the underlying pathological evolutionary characteristics.

[0266] The core innovations of the CLVM are:

[0267] Explicitly modeling potential medical mechanisms: innovatively introducing variational latent dependent variables to explicitly represent the implicit medical mechanisms behind clinical event sequences;

[0268] Specialized latent encoding and decoding architecture: Design specialized latent variable encoders and latent fusion decoders to ensure that latent variables can be efficiently integrated into the explicit event modeling process;

[0269] Variational inference mechanism constraints: KL divergence regularization in the variational autoencoder framework is used to ensure the controllability and interpretability of the latent variable expression;

[0270] Accurate clinical course prediction: Explicit modeling of latent variables enables this module to more accurately characterize the course evolution of complex diseases, significantly improving the modeling accuracy and generalization performance of clinical pathways.

[0271] (5) The medical potential enhanced representation of each clinical event is input into the multi-task event prediction decoder, and the next clinical event and the corresponding probability of the next clinical event are output.

[0272] Specifically, the multi-task event prediction decoder aims to leverage the enriched medical latent representations of clinical events output by the aforementioned modules to predict the next clinical event in a clinical event sequence. This module not only predicts the event itself, but also simultaneously predicts multiple clinically relevant tasks, such as the time interval between events and the phase of the clinical course, thereby building a complete and practical multi-task clinical event sequence prediction system.

[0273] The input of the multi-task event prediction decoder comes from the medical latent enhancement representation of the medical latent modeling module (CLVM):

[0274]

[0275] in, It is the enhanced representation of medical latent factors obtained by the medical latent factor modeling module at the Tth time step. It contains explicit event information, heterogeneous event types, concurrent event structure, stage difference characteristics, and implicit medical latent factor information, and has very rich clinical semantics.

[0276] To achieve accurate prediction of multiple aspects of clinical events, a multi-task event prediction decoder is specially designed. It includes the following three task prediction heads:

[0277] Event Type Prediction Head

[0278] Time Interval Prediction Head

[0279] Clinical Stage Prediction Head

[0280] The specific operations are as follows:

[0281] Event prediction head:

[0282] Using the Transformer structure decoder, the medical potential of the current clinical event is enhanced to predict the clinical event at the next time step. The specific formula is as follows:

[0283]

[0284] Where W e ,b e are the learnable parameters in the event prediction head;

[0285] Event types include diagnosis (Dx), examination (Ex), treatment (Tx), and medication (Rx).

[0286] Time interval prediction header:

[0287] The time interval between clinical events is important for predicting the course of disease and assessing patient risk. This module designs a specialized time interval prediction head:

[0288]

[0289] Among them, W t ,b t is a learnable parameter in the time interval prediction head;

[0290] △t t+1 The time interval for the next predicted event to occur.

[0291] Disease stage prediction head:

[0292] The present invention explicitly models the evolution of disease stages and designs a disease stage prediction head to predict the disease stage at the next moment (initial diagnosis, treatment, follow-up, prognosis):

[0293]

[0294] Among them, W s ,b s are the learnable parameters in the stage prediction head;

[0295] s t+1 The clinical course stage where the next event occurs.

[0296] Assume that the clinical event sequence and course context events at the current time step t=4 are as follows:

[0297] e1: Initial Diagnosis event: "Diagnosed with acute kidney injury"

[0298] e2: Treatment phase event: "Use of diuretics"

[0299] e3: Treatment phase event: "Use of antihypertensive drugs"

[0300] e4: Reassessment phase event: "Recheck blood creatinine test"

[0301] e5: Prognosis Management Event: "Recovery Follow-up"

[0302] At this time, the module input is Predicting the next event:

[0303] Event prediction:

[0304] Time interval prediction:

[0305] Stage prediction:

[0306] Through this multi-task decoding method, the model can accurately predict the event "recovery follow-up", its occurrence time and the stage to which it belongs (prognosis management stage), thereby fully expressing the evolutionary logic of the clinical course.

[0307] The core innovations of the multi-task event prediction decoder are:

[0308] Multi-task clinical prediction system: Simultaneously predict events, time intervals, and disease stages;

[0309] High integration of information representation between modules: Fully utilize the output information of the aforementioned modules to ensure high-quality clinical predictions;

[0310] Explicitly assisted prediction of variational latent variables: Explicit latent mechanism modeling provides implicit medical mechanism information, improving the ability to predict disease evolution;

[0311] End-to-end multi-task joint training: Achieve collaborative optimization of clinical sequence prediction tasks, effectively improving model prediction performance and generalization capabilities.

[0312] Overall:

[0313]

[0314] In an optional embodiment of the present invention, a medical rule template library is used to constrain the next clinical event, specifically comprising the following steps:

[0315] (1) Constructing an initial clinical event sequence based on the next clinical event and the clinical events corresponding to historical clinical data;

[0316] (2) matching the initial clinical event sequence with the medical rule templates in the medical rule template library;

[0317] (3) If the initial clinical event sequence matches any medical rule template in the medical rule template library, the next clinical event in the initial clinical event sequence is the next clinical event that meets the constraints.

[0318] Specifically, the above process is described in detail below:

[0319] First, this step builds a medical rule template library: Among them, each path template T m A reasonable disease progression path developed by medical experts based on clinical guidelines and real medical records, in the form of a sequence of clinical events: Each pathway template is used to constrain the model generation sequence to ensure that the generated events conform to clinical logic and medical rationality.

[0320] For example, the acute kidney injury treatment pathway template may be: diagnosis of acute kidney injury → use of diuretics → use of antihypertensive drugs → rechecking of serum creatinine → follow-up during the recovery period

[0321] Next, autoregressive sequence generation under medical rule constraints is performed.

[0322] First, you need to prepare the seed sequence S seed , represents the initial clinical event sequence used to initiate the generation process when the model generates a clinical event sequence. The present invention combines two methods to generate seed sequences: one derived from real clinical data and the other from a clinical pathway template defined by medical experts.

[0323] For real clinical data, a short clinical event segment is randomly sampled from real medical data as the initial seed sequence to start the autoregressive generation process. For example, real patient data randomly selected from a real hospital electronic medical record (EMR) database: e1: diagnosis of acute kidney injury → e2: use of diuretics.

[0324] For clinical pathway templates defined by medical experts, directly use the initial portion of the template defined by medical experts or clinical guidelines as the starting sequence. For example, a medical pathway template is defined as: Initial diagnosis of acute kidney injury → Use of diuretics → Use of antihypertensive medications → Recheck of serum creatinine → Follow-up during recovery. Use the first one or two events in the template as the seed sequence, for example: e1: Initial diagnosis of acute kidney injury → e2: Use of diuretics.

[0325] The core functions of the seed sequence are: providing the initial context for the model to generate clinical event sequences; initiating the autoregressive process through known medical context to guide the rationality of subsequent generated events; and ensuring that the generated sequence has a clear medical logical starting point to avoid random and meaningless generation results.

[0326] Specifically, the autoregressive generation process is:

[0327] 1. From a given seed sequence S seed =[e1,…,e t ]start;

[0328] 2. The next clinical event predicted based on the model output t+1 ;

[0329] 3. Combine the medical pathway template library for rule constraints and screening;

[0330] 4. Gradually generate a complete and reasonable sequence of medical clinical events.

[0331] The present invention uses the output of the CEAT++ model (the output of the multi-task event prediction decoder) as the basis for autoregressive generation. The specific generation process is as follows:

[0332] For each generative time step t+1, the model predicts the joint probability of the next clinical event as:

[0333]

[0334] Then, using the medical rule template library As a constraint, filter out the set of medical events that are acceptable in the current context ε allowed (t)={e|[S seed ; e] Comply with any medical pathway template T m}, where S seed represents the currently generated clinical event sequence, and e is the next generated clinical event (the next clinical event generated by the model). This step is used to limit the next clinical event generated by the model, preventing the model from freely generating any clinical event. It also ensures that generated clinical events conform to a defined clinical pathway template approved by medical experts, ensuring medical logic rationality.

[0335] For example: S seed =[diagnosis of acute kidney injury → use of diuretics];

[0336] Assume that the medical pathway template library contains two templates: Template 1: diagnosis of acute kidney injury → use of diuretics → use of antihypertensive drugs → rechecking of blood creatinine → follow-up during the recovery period;

[0337] Template 2: Diagnosis of acute kidney injury → Use of diuretics → Hemodialysis treatment → Renal function test;

[0338] When the model tries to generate the event "use antihypertensive drugs", the concatenated sequence is:

[0339] Diagnosed with acute kidney injury → use diuretics → use antihypertensive drugs;

[0340] This sequence conforms to template 1, so "using antihypertensive drugs" belongs to ε allowed (t);

[0341] If the model attempts to generate the event "hemodialysis treatment", the sequence after splicing is:

[0342] Diagnosis of acute kidney injury → use of diuretics → hemodialysis treatment;

[0343] This sequence matches template 2, so "hemodialysis treatment" also belongs to ε allowed (t).

[0344] But if the model tries to generate an event "insulin injection", the concatenated sequence is:

[0345] Diagnosis of acute kidney injury → use of diuretics → insulin injection;

[0346] This sequence does not match any of the template pathways, so "insulin injection" does not belong to ε. allowed (t), was excluded.

[0347] Finally, the model prediction distribution is subject to rule constraints and masking:

[0348]

[0349] This constraint method ensures that the generated clinical event sequence strictly complies with clinical medical logic and does not generate medical logic conflicts or meaningless event sequences.

[0350] In an optional embodiment of the present invention, a rare event sampling mechanism is used to adjust the probability corresponding to the next clinical event that meets the constraints, specifically comprising the following steps:

[0351] Using the probability adjustment formula Adjust the probability of the next clinical event that meets the constraints to obtain the adjusted probability, where P adjusted (e t+1 ) represents the adjusted probability, represents the normalized probability of the next clinical event that meets the constraints, f(e t+1 ) represents the next clinical event e t+1 The frequency of all clinical events in the historical clinical data corresponds to γ, which represents the sampling intensity coefficient of rare events.

[0352] Specifically, first, the event frequency f(e) of the training set (historical clinical data) is statistically analyzed to obtain the frequency of each clinical event;

[0353] When generating, the probability of clinical event generation is adjusted to:

[0354]

[0355] Where γ is the rare event sampling intensity coefficient, which is used to enhance the model's attention to low-frequency important clinical events. Based on the above probability distribution, random sampling is used to generate the next clinical event.

[0356] In an optional embodiment of the present invention, performing rationality scoring on the obtained multiple clinical event sequences specifically includes the following steps:

[0357] Each clinical event sequence is input into the potential cause discriminator, and the rationality score of each clinical event sequence is obtained as the output. The potential cause discriminator is a binary classification network trained based on the real clinical event sequence and the generated clinical event sequence.

[0358] Specifically, the latent cause discriminator of the medical latent cause modeling module CLVM is used to calculate the rationality score of each clinical event sequence:

[0359] The potential cause discriminator is a binary classification network trained using real clinical event sequences and clinical event sequences generated by the model, and its output is a rationality score in the interval [0,1].

[0360] Detailed example description:

[0361] Assume that the seed sequence (initial disease sequence) is:

[0362] Initial diagnosis: acute kidney injury → treatment: use of diuretics;

[0363] Based on the CEAT++ model, the next clinical event is predicted sequentially;

[0364] Applying a rare event sampling probability adjustment mechanism to increase the probability of sampling rare and important clinical events, such as "rechecking blood creatinine examination";

[0365] Generate multiple clinical event sequences, such as:

[0366] Initial diagnosis of "acute kidney injury" → use of diuretics → use of antihypertensive drugs → rechecking of blood creatinine → follow-up during the recovery period;

[0367] Initial diagnosis of "acute kidney injury" → use of diuretics → follow-up during the recovery period (skipping important treatment and review steps is unreasonable);

[0368] At this time, we obtain the clinical event sequence set: X candidate ={candidate 1, candidate 2};

[0369] The above clinical event sequence is input into the potential cause discriminator to calculate the plausibility score:

[0370] Candidate 1 has a score of 0.92, which is higher than θ (e.g., 0.75); candidate 2 has a score of 0.54, which is lower than θ.

[0371] Therefore, the high-quality target clinical event sequences that are ultimately retained form the final synthetic dataset:

[0372] The method of the present invention has the following innovative features:

[0373] Achieve type-specific modeling of heterogeneous events: Through the Heterogeneous Event Attention Module (HEM), the semantic features of different types of events, such as diagnosis, treatment, examination, and medication, are modeled distinctively, overcoming the weakening of clinical semantics caused by mixed event modeling in traditional methods.

[0374] Modeling the collaborative relationships between multiple events within the same time step: We introduce the Concurrent Graph (CEG) module, which explicitly learns the collaborative, reinforcing, or restrictive relationships between multiple events within the same time step through a graph attention mechanism, addressing the shortcomings of existing methods in handling concurrent events.

[0375] Explicitly modeling the evolution of disease stages: Through the Stage Gating Module (SGM), event representation is dynamically adjusted according to the stage changes of the clinical pathway, overcoming the problem that traditional linear modeling cannot reflect the stage evolution of the disease course;

[0376] Inferring and modeling potential medical causal mechanisms: Through the Latent Causal Modeling Module (CLVM), we introduce variational inference methods to model latent medical mechanisms that are not directly observable during disease evolution, improving the model's ability to fit and explain the evolution of complex diseases.

[0377] Achieve event sequence generation under medical rule constraints: In the event autoregressive generation process, combining medical rule templates and rationality judgment mechanisms effectively avoids medical logic errors and illegal event combinations, solving the problems of poor clinical rationality and unstable generation quality in existing generation methods;

[0378] Improve the generation coverage of rare clinical events: Through the rare event priority sampling mechanism, the coverage of low-frequency, high-value events in the generated data is improved, and the large model's ability to identify and model rare disease pathways and high-risk clinical scenarios is enhanced.

[0379] In summary, the present invention comprehensively overcomes the limitations of existing technologies in clinical event sequence modeling and data enhancement by constructing a multi-module structure-enhanced clinical event autoregressive generation system, and can generate high-quality clinical event sequences that conform to medical logic, have a reasonable structure, and have a wide coverage (that is, by simulating real clinical pathways, clinical event sequences with medical rationality and disease course structure characteristics can be generated, that is, the medical rationality, structural integrity and generalization training value (training usability) of the generated clinical event sequences are comprehensively improved), providing richer, more accurate and reliable data support for the training of large medical models, and significantly improving the generalization performance and clinical application value of large models in complex medical scenarios.

[0380] The method of the present invention successfully realizes the construction of graph-enhanced representation, structure-aware modeling, autoregressive generation and rule control mechanism from historical clinical data, and ultimately outputs a high-quality synthetic clinical event sequence set with reasonable clinical logic, complete medical semantics and diverse event distribution. This enhanced data can serve as an input source for a variety of medical artificial intelligence tasks, and is widely applicable to downstream scenarios such as electronic medical record completion, disease path prediction, rare case modeling, and clinical decision support system (CDSS) training. The data generated by this method is not only sufficient in quantity but also possesses significant advantages in medical rationality, structural expressiveness, and scenario practicality. This can significantly alleviate the data scarcity and distribution bias issues currently encountered in the development of large-scale medical models.

[0381] Example 2:

[0382] An embodiment of the present invention also provides an enhancement device for medical large model data. The enhancement device for medical large model data is mainly used to execute the enhancement method for medical large model data provided in the first embodiment of the present invention. The following is a detailed introduction to the enhancement device for medical large model data provided in the embodiment of the present invention.

[0383] Figure 2 FIG. 1 is a schematic diagram of a device for enhancing medical large model data according to an embodiment of the present invention. Figure 2 As shown, the device mainly includes: a structure enhancement unit 10, a clinical event autoregressive unit 20, a constraint unit 30, a probability adjustment unit 40, a loop unit 50, and a rationality scoring and determination unit 60, wherein:

[0384] A structure enhancement unit is used to perform vector embedding representation on the acquired historical clinical data to obtain a vector embedding representation of each clinical event, and to perform structural enhancement on the vector embedding representation of each clinical event based on the medical knowledge graph constructed based on the historical clinical data to obtain a graph-enhanced representation of each clinical event;

[0385] A clinical event autoregressive unit is configured to perform clinical event autoregression on the enhanced graph representation of each clinical event using a multi-module structure-enhanced clinical event autoregressive model to obtain the next clinical event and the probability corresponding to the next clinical event. The multi-module structure-enhanced clinical event autoregressive model includes: a heterogeneous event attention module, a concurrent graph structure module, a stage gating module, a medical latent cause modeling module, and a multi-task event prediction decoder connected in sequence. The stage gating module is also connected to the output of the heterogeneous event attention module.

[0386] A constraint unit, configured to constrain the next clinical event using a medical rule template library, and obtain the next clinical event that meets the constraint and the probability corresponding to the next clinical event that meets the constraint;

[0387] a probability adjustment unit, configured to adjust the probability corresponding to the next clinical event that meets the constraints by adopting a rare event sampling mechanism, and determine a target next clinical event based on the adjusted probability and the next clinical event that meets the constraints corresponding to the adjusted probability;

[0388] a loop unit, configured to use the target next clinical event as historical clinical data, return to execute the step of performing vector embedding representation on the acquired historical clinical data, and thereby obtain a clinical event sequence consisting of multiple target next clinical events;

[0389] The rationality scoring and determination unit is used to perform rationality scoring on the multiple clinical event sequences obtained, and determine the target clinical event sequence based on the rationality scores of each clinical event sequence, and then convert the target clinical event sequence into structured enhanced data for training large medical models.

[0390] In an embodiment of the present invention, a device for enhancing medical large model data is provided, including: performing vector embedding representation on the acquired historical clinical data to obtain a vector embedding representation of each clinical event, and structurally enhancing the vector embedding representation of each clinical event based on a medical knowledge graph constructed based on the historical clinical data to obtain a graph-enhanced representation of each clinical event; performing clinical event autoregression on the graph-enhanced representation of each clinical event using a multi-module structure-enhanced clinical event autoregressive model to obtain the next clinical event and the probability corresponding to the next clinical event, wherein the multi-module structure-enhanced clinical event autoregressive model includes: a heterogeneous event attention module, a concurrent graph structure module, a stage gating module, a medical latent cause modeling module and a multi-task event prediction decoder connected in sequence, and the stage gating module is also connected to the output of the heterogeneous event attention module ; A medical rule template library is used to constrain the next clinical event, and the next clinical event that meets the constraints and the probability corresponding to the next clinical event that meets the constraints are obtained; a rare event sampling mechanism is used to adjust the probability corresponding to the next clinical event that meets the constraints, and the target next clinical event is determined based on the adjusted probability and the next clinical event that meets the constraints corresponding to the adjusted probability; the target next clinical event is used as historical clinical data, and the step of vector embedding representation of the acquired historical clinical data is returned to obtain a clinical event sequence consisting of multiple target next clinical events; a rationality score is performed on the multiple clinical event sequences obtained, and a target clinical event sequence is determined based on the rationality score of each clinical event sequence, and the target clinical event sequence is converted into structured enhanced data for training large medical models. From the above description, it can be seen that in the enhancement device for medical big model data of the present invention, the clinical event autoregressive model enhanced by a multi-module structure comprehensively models the heterogeneity, concurrency, stage and potential of clinical events, and introduces medical rule templates and rare event sampling mechanisms, thereby significantly improving the medical usability and training benefits of the generated target clinical event sequence, and alleviating the technical problems that traditional medical big model data generation methods cannot effectively model the heterogeneity, concurrency and stage evolution of clinical events, lack of inference and modeling of potential medical causal mechanisms (potential causes), lack of medical rule constraints, and insufficient coverage of rare events and high-value disease path paths.

[0391] Optionally, the structure enhancement unit is also used to: extract clinical events from historical clinical data, wherein clinical events include: events, time and types; convert events and types in clinical events into standard medical coding representations through standardized mapping functions; use a constructed embedding matrix to map the standard medical coding representation into a vector embedding representation, thereby obtaining a vector embedding representation of each clinical event, wherein different types correspond to different embedding matrices; construct a medical knowledge graph for historical clinical data, wherein the medical knowledge graph includes: nodes of clinical events, edges with relationship types connecting nodes of different clinical events; vectorize each node in the medical knowledge graph to obtain a graph convolution embedding representation of the clinical events corresponding to each node; perform causal attention weighting on the multi-hop paths of each node in the medical knowledge graph based on the graph convolution embedding representation of each clinical event to obtain a multi-hop causal enhanced representation of the clinical events corresponding to each node; determine the graph enhanced representation of each clinical event based on the vector embedding representation of each clinical event, the graph convolution embedding representation of each clinical event, and the multi-hop causal enhanced representation of each clinical event.

[0392] Optionally, the structure enhancement unit is also used to: determine the multi-hop path of each node, and concatenate the graph convolution embedding representations of the nodes in each multi-hop path to obtain a multi-hop path vector representation of each multi-hop path; calculate the attention weight of each multi-hop path to the corresponding node through the multi-head self-attention mechanism of the Transformer structure; perform weighted fusion of the attention weight of each multi-hop path to the corresponding node and the multi-hop path vector representation of each multi-hop path to obtain a multi-hop causal enhancement representation of the corresponding node, and then obtain a multi-hop causal enhancement representation of each clinical event.

[0393] Optionally, the clinical event autoregressive unit is further used to: input the graph enhancement representation of each clinical event into the heterogeneous event attention module, and output the heterogeneous event enhancement representation of each clinical event, wherein the heterogeneous event attention module is used to perform attention aggregation on each clinical event using the graph enhancement representation of all clinical events in the entire clinical event sequence; input the heterogeneous event enhancement representation of each clinical event into the concurrent graph structure module, and output the concurrent event graph enhancement representation of each clinical event, wherein the concurrent graph structure module constructs a concurrent event co-occurrence graph according to the concurrent events of each clinical event, and then processes the concurrent event co-occurrence graph and the heterogeneous event enhancement representation of each clinical event to obtain the concurrent event graph enhancement representation of each clinical event; input the heterogeneous event enhancement representation of each clinical event and the concurrent event graph enhancement representation of each clinical event into the stage gating module to obtain the stage-aware gated representation of each clinical event, wherein the stage gating module is used to The gating value of the stage feature vector corresponding to each clinical event is calculated through the gating network, and the heterogeneous event enhanced representation and concurrent event graph enhanced representation of the corresponding clinical event are adjusted according to the calculated gating value to obtain the stage-aware gated representation of each clinical event; the stage-aware gated representation of each clinical event is input into the medical latent modeling module, and the medical latent enhanced representation of each clinical event is output, wherein the medical latent modeling module extracts the latent distribution parameters of the stage-aware gated representation of each clinical event through the latent variable encoder, and calculates the latent variables according to the latent distribution parameters, and then decodes the latent variables and the corresponding stage-aware gated representation of the clinical event through the latent fusion decoder to obtain the medical latent enhanced representation of each clinical event; the medical latent enhanced representation of each clinical event is input into the multi-task event prediction decoder, and the next clinical event and the probability corresponding to the next clinical event are output.

[0394] Optionally, the constraint unit is also used to: construct an initial clinical event sequence based on the next clinical event and the clinical events corresponding to the historical clinical data; match the initial clinical event sequence with the medical rule templates in the medical rule template library; if the initial clinical event sequence matches any medical rule template in the medical rule template library, then the next clinical event in the initial clinical event sequence is the next clinical event that meets the constraint.

[0395] Optionally, the probability adjustment unit is further configured to: adopt a probability adjustment formula Adjust the probability of the next clinical event that meets the constraints to obtain the adjusted probability, where P adjusted (e t+1 ) represents the adjusted probability, represents the normalized probability of the next clinical event that meets the constraints, f(e t+1 ) represents the next clinical event e t+1The frequency of all clinical events in the historical clinical data corresponds to γ, which represents the sampling intensity coefficient of rare events.

[0396] Optionally, the rationality scoring and determination unit is further used to: input each clinical event sequence into a potential cause discriminator, and output a rationality score for each clinical event sequence, wherein the potential cause discriminator is a binary classification network trained based on real clinical event sequences and generated clinical event sequences.

[0397] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those in the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference can be made to the corresponding content in the aforementioned method embodiment.

[0398] like Figure 3 As shown, an electronic device 600 provided in an embodiment of the present application includes: a processor 601, a memory 602 and a bus. The memory 602 stores machine-readable instructions executable by the processor 601. When the electronic device is running, the processor 601 communicates with the memory 602 through the bus, and the processor 601 executes the machine-readable instructions to perform the steps of the above-mentioned method for enhancing large medical model data.

[0399] Specifically, the memory 602 and processor 601 can be general-purpose memories and processors, which are not specifically limited here. When the processor 601 runs the computer program stored in the memory 602, it can execute the above-mentioned method for enhancing the large medical model data.

[0400] The processor 601 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 601 or by instructions in the form of software. The above-mentioned processor 601 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in memory 602, and processor 601 reads the information in memory 602 and performs the steps of the above method in conjunction with its hardware.

[0401] Corresponding to the above-mentioned method for enhancing large medical model data, an embodiment of the present application further provides a computer-readable storage medium, which stores machine-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to execute the steps of the above-mentioned method for enhancing large medical model data.

[0402] The device for enhancing the medical large model data provided in the embodiments of the present application can be specific hardware on the device or software or firmware installed on the device. The implementation principle and technical effects of the device provided in the embodiments of the present application are the same as those of the aforementioned method embodiments. For the sake of brief description, any part not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices, and units described above can all refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0403] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interface, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0404] For another example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0405] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0406] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0407] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling an electronic device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method for enhancing the medical large model data described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program code.

[0408] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0409] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The scope of protection of the present application is not limited thereto. Although the present application has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-mentioned embodiments within the technical scope disclosed in the present application, or perform equivalent replacements for some of the technical features thereof. However, these modifications, changes, or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application. They should all be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A method for enhancing large medical model data, characterized in that: include: Performing vector embedding representation on the acquired historical clinical data to obtain a vector embedding representation of each clinical event, and structurally enhancing the vector embedding representation of each clinical event based on a medical knowledge graph constructed from the historical clinical data to obtain a graph-enhanced representation of each clinical event; A multi-module structure-enhanced clinical event autoregressive model is used to perform clinical event autoregression on the graph-enhanced representation of each clinical event to obtain the next clinical event and the probability corresponding to the next clinical event, wherein the multi-module structure-enhanced clinical event autoregressive model includes: a heterogeneous event attention module, a concurrent graph structure module, a stage gating module, a medical latent cause modeling module and a multi-task event prediction decoder connected in sequence, and the stage gating module is also connected to the output of the heterogeneous event attention module; Using a medical rule template library to constrain the next clinical event, obtaining the next clinical event that meets the constraint and the probability corresponding to the next clinical event that meets the constraint; Adopting a rare event sampling mechanism to adjust the probability corresponding to the next clinical event that meets the constraints, and determining a target next clinical event based on the adjusted probability and the next clinical event that meets the constraints corresponding to the adjusted probability; Taking the target next clinical event as historical clinical data, returning to the step of performing vector embedding representation on the acquired historical clinical data, thereby obtaining a clinical event sequence consisting of multiple target next clinical events; The multiple clinical event sequences obtained are scored for rationality, and a target clinical event sequence is determined based on the rationality score of each clinical event sequence, and then the target clinical event sequence is converted into structured enhanced data for training a large medical model.

2. The method according to claim 1, characterized in that Performing vector embedding representation on the acquired historical clinical data to obtain a vector embedding representation of each clinical event, and structurally enhancing the vector embedding representation of each clinical event based on the medical knowledge graph constructed from the historical clinical data to obtain a graph-enhanced representation of each clinical event, including: Extract clinical events from the historical clinical data, wherein the clinical events include: event, time and type; converting the events and types in the clinical events into standard medical coding representations through a standardized mapping function; The standard medical coding representation is mapped into a vector embedding representation using the constructed embedding matrix, thereby obtaining a vector embedding representation of each clinical event, wherein different types correspond to different embedding matrices; Constructing a medical knowledge graph for the historical clinical data, wherein the medical knowledge graph includes: nodes of clinical events and edges with relationship types connecting nodes of different clinical events; Vectorizing each node in the medical knowledge graph to obtain a graph convolutional embedding representation of the clinical event corresponding to each node; Performing causal attention weighting on the multi-hop paths of each node in the medical knowledge graph based on the graph convolutional embedding representation of each clinical event to obtain a multi-hop causal enhanced representation of the clinical event corresponding to each node; The graph enhancement representation of each clinical event is determined based on the vector embedding representation of each clinical event, the graph convolution embedding representation of each clinical event, and the multi-hop causal enhancement representation of each clinical event.

3. The method according to claim 2, characterized in that Causal attention weighting is performed on the multi-hop paths of each node in the medical knowledge graph based on the graph convolutional embedding representation of each clinical event, including: Determine a multi-hop path for each node, and concatenate the graph convolution embedding representations of the nodes in each multi-hop path to obtain a multi-hop path vector representation of each multi-hop path; The attention weight of each multi-hop path to the corresponding node is calculated through the multi-head self-attention mechanism of the Transformer structure; The attention weight of each multi-hop path to the corresponding node and the multi-hop path vector representation of each multi-hop path are weightedly fused to obtain a multi-hop causal enhancement representation of the corresponding node, and then obtain a multi-hop causal enhancement representation of each clinical event.

4. The method according to claim 1, wherein The clinical event autoregressive model enhanced by a multi-module structure is used to perform clinical event autoregression on the enhanced graph representation of each clinical event, including: Inputting the graph-enhanced representation of each clinical event into the heterogeneous event attention module, and outputting the heterogeneous event enhanced representation of each clinical event, wherein the heterogeneous event attention module is used to perform attention aggregation on each clinical event using the graph-enhanced representation of all clinical events in the entire clinical event sequence; Inputting the heterogeneous event enhanced representation of each clinical event into the concurrent graph structure module, and outputting an enhanced concurrent event graph representation of each clinical event, wherein the concurrent graph structure module constructs a concurrent event co-occurrence graph based on the concurrent events of each clinical event, and then processes the concurrent event co-occurrence graph and the heterogeneous event enhanced representation of each clinical event to obtain an enhanced concurrent event graph representation of each clinical event; Inputting the heterogeneous event enhanced representation of each clinical event and the concurrent event graph enhanced representation of each clinical event into the stage gating module to obtain a stage-aware gated representation of each clinical event, wherein the stage gating module calculates a gate value for the stage feature vector corresponding to each clinical event through a gating network, and adjusts the corresponding heterogeneous event enhanced representation and concurrent event graph enhanced representation of the clinical event according to the calculated gate value to obtain a stage-aware gated representation of each clinical event; Inputting the stage-aware gated representation of each clinical event into the medical latent modeling module, and outputting a medical latent enhanced representation of each clinical event, wherein the medical latent modeling module extracts the latent distribution parameters of the stage-aware gated representation of each clinical event through a latent variable encoder, calculates the latent variable based on the latent distribution parameters, and then decodes the latent variable and the corresponding stage-aware gated representation of the clinical event through a latent fusion decoder to obtain the medical latent enhanced representation of each clinical event; The medical potential enhanced representation of each clinical event is input into a multi-task event prediction decoder, and the next clinical event and the probability corresponding to the next clinical event are output.

5. The method according to claim 1, wherein A medical rule template library is used to constrain the next clinical event, including: constructing an initial clinical event sequence according to the next clinical event and the clinical events corresponding to the historical clinical data; matching the initial clinical event sequence with the medical rule templates in the medical rule template library; If the initial clinical event sequence matches any medical rule template in the medical rule template library, the next clinical event in the initial clinical event sequence is the next clinical event that meets the constraint.

6. The method according to claim 1, characterized in that The probability of the next clinical event that meets the constraints is adjusted using a rare event sampling mechanism, including: Using the probability adjustment formula The probability corresponding to the next clinical event that meets the constraint is adjusted to obtain the adjusted probability, where P adjusted (e t+1 ) represents the adjusted probability, represents the normalized probability of the next clinical event that meets the constraint, f(e t+1 ) represents the next clinical event e t+1 The frequency of all clinical events corresponding to the historical clinical data, γ represents the rare event sampling intensity coefficient.

7. The method according to claim 1, characterized in that The plausibility of the obtained multiple clinical event sequences was scored, including: Each clinical event sequence is input into a potential cause discriminator, and a rationality score of each clinical event sequence is output, wherein the potential cause discriminator is a binary classification network trained based on the real clinical event sequence and the generated clinical event sequence.

8. A device for enhancing large medical model data, characterized in that: include: a structure enhancement unit, configured to perform vector embedding representation on the acquired historical clinical data to obtain a vector embedding representation of each clinical event, and to perform structural enhancement on the vector embedding representation of each clinical event based on a medical knowledge graph constructed from the historical clinical data to obtain a graph-enhanced representation of each clinical event; a clinical event autoregressive unit, configured to perform clinical event autoregression on the graph-enhanced representation of each clinical event using a multi-module structure-enhanced clinical event autoregressive model to obtain the next clinical event and the probability corresponding to the next clinical event, wherein the multi-module structure-enhanced clinical event autoregressive model comprises: a heterogeneous event attention module, a concurrent graph structure module, a stage gating module, a medical latent cause modeling module, and a multi-task event prediction decoder connected in sequence, and the stage gating module is further connected to the output of the heterogeneous event attention module; a constraint unit, configured to constrain the next clinical event using a medical rule template library, and obtain a next clinical event that meets the constraint and a probability corresponding to the next clinical event that meets the constraint; a probability adjustment unit, configured to adjust the probability corresponding to the next clinical event that meets the constraints by adopting a rare event sampling mechanism, and determine a target next clinical event based on the adjusted probability and the next clinical event that meets the constraints corresponding to the adjusted probability; a loop unit, configured to use the target next clinical event as historical clinical data, return to execute the step of performing vector embedding representation on the acquired historical clinical data, and thereby obtain a clinical event sequence consisting of multiple target next clinical events; The rationality scoring and determination unit is used to perform rationality scoring on the multiple clinical event sequences obtained, and determine the target clinical event sequence based on the rationality scores of each clinical event sequence, and then convert the target clinical event sequence into structured enhanced data for training a large medical model.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to execute the method according to any one of claims 1 to 7.