Death rate prediction method and device based on structured medical data and large language model

By combining structured medical information and mortality prediction methods with large language models, the problem of insufficient feature expression and diagnostic reasoning capabilities in the prior art is solved, and more accurate and explainable mortality prediction is achieved, enhancing the applicability of the model in complex clinical environments.

CN120183676APending Publication Date: 2025-06-20QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510593367.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

The existing mortality prediction methods have shortcomings in feature expression, diagnostic reasoning ability and high-risk clue modeling, and it is difficult to fully express the deep semantic information of the patient's condition, lack the reasoning ability with medical knowledge background, and the electronic health archive data are multi-source heterogeneous and incomplete records, resulting in limited applicability and interpretability of the model in complex clinical environments.

Method used

A mortality prediction method based on structured medical information and large language models is proposed. By combining multi-source feature information, the mortality prediction model is trained, the large language model is used to semantic understanding and diagnostic reasoning of structured electronic health archive data, the high-risk disease and treatment record characteristics are extracted, and the fusion ability and robustness of the model are enhanced through structures such as multi-headed attention mechanism and gated circulation units.

Benefits of technology

It significantly improves the model's ability to identify factors related to high-risk death, improves the accuracy and interpretability of the prediction results, enhances the applicability and stability of the model in complex clinical environments, and achieves a risk assessment with more clinical practical value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120183676A_ABST
    Figure CN120183676A_ABST
Patent Text Reader

Abstract

The invention discloses a death rate prediction method and device based on structured medical data and a large language model, a storage medium and electronic equipment, and belongs to the technical field of natural language processing and the technical field of artificial intelligence. The technical problem to be solved by the invention is how to automatically extract important features related to death rate from electronic health record data of a patient and construct a multi-source information fusion prediction model to assist doctors in early intervention and accurate treatment decision. According to the technical scheme, (1) the death rate prediction method based on the structured medical data and the large language model comprises the following steps: S1, constructing a patient electronic health record data set; s2, constructing a death rate prediction framework; and S3, training the death rate prediction model. And (2) a death rate prediction device based on the structured medical data and the large language model, wherein the death rate prediction device comprises a patient electronic health record data set construction unit, a death rate prediction framework construction unit and a death rate prediction model training unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of natural language processing and artificial intelligence technology, and particularly to a mortality prediction method and device based on structured medical data and large language models. Background Art

[0002] With the continuous advancement of medical informatization, electronic health records have become an important carrier for hospitals to record and manage patients' conditions. The mortality prediction technology based on electronic health records can provide key risk warnings for doctors and assist in clinical decision-making, and has received extensive attention in the medical field. Existing methods mainly rely on structured electronic health record data, such as demographic information, laboratory test indicators, diagnostic codes, and scoring systems, and combine machine learning or deep neural network models to build mortality risk models. However, the existing technology still has the following problems in practical applications:

[0003] On the one hand, it is difficult for structured electronic health record data to fully express the deep semantic information in the evolution process of patients' conditions, such as the causal relationship between symptoms and the temporal evolution in multiple medical records, resulting in insufficient recognition of high-risk states by the model; on the other hand, traditional prediction models lack the reasoning ability of medical knowledge background, have insufficient understanding of the potential relationships and evolution paths between diseases, and are difficult to simulate the process of doctors forming comprehensive judgments in clinical diagnosis, which directly limits the applicability and interpretability of the model in complex clinical environments; in addition, electronic health record data has characteristics such as multi-source heterogeneity and incomplete records, further exacerbating the above modeling difficulties. Especially when facing information such as patient scoring systems, past medical history, and medical treatment paths, it is difficult for the model to effectively integrate and utilize.

[0004] In recent years, large language models have demonstrated powerful semantic understanding and reasoning capabilities in the field of natural language processing. However, their application in structured medical data is still in the initial exploration stage. How to effectively integrate their diagnostic capabilities with electronic health records for mortality prediction is one of the key problems that have not been solved yet. Therefore, the present invention aims to solve problems such as the limited expression ability of electronic health records, the insufficient reasoning ability of existing models, and the inaccurate capture of mortality risk clues, and proposes a mortality prediction method and device based on structured medical information and large language models to achieve a risk assessment model with higher accuracy, interpretability, and clinical practical value. Summary of the Invention

[0005] In view of the deficiencies of existing mortality prediction methods in feature expression, diagnostic reasoning ability, and high-risk clue modeling, the present invention proposes a mortality prediction method and device based on structured medical information and large language models. The method and device propose a new mortality prediction method that combines large language models and patient electronic health record data, and uses large language models to perform semantic understanding and diagnostic reasoning on key medical information in structured electronic health record data, thereby enhancing the model's ability to identify high-risk death-related factors; the core idea of the method is to train a mortality prediction model by combining multi-source feature information to obtain relatively accurate prediction results; one of the data sources is a large language model guided by prompts, which simulates the diagnostic reasoning process of clinicians, identifies high-risk disease conditions and treatment record features in the patient's electronic health record that are most likely to lead to death, and generates structured diagnostic labels; in addition, ICU severity score features, patient interview features, and true label features are also used as inputs to participate in model training, thereby further improving prediction performance; the present invention proposes a large language model medical diagnosis module, which gives full play to the ability of large language models in medical semantic understanding and reasoning. By using large language models to perform semantic filtering on structured patient electronic health record data, high-risk disease conditions and treatment record features that are highly correlated with the patient's ultimate death are extracted, and combined with the temporal relationship of patient interviews, a carefully designed prompt is used to guide the large language model to perform clinical-level disease severity diagnosis, thereby more accurately improving the prediction accuracy of the model; in order to better integrate feature information from different sources into the same model, the present invention proposes a new mortality prediction model, which can better combine patient interview features, ICU severity score features, and structured diagnostic labels, further enhancing the model's ability to fuse heterogeneous features and improving the accuracy and stability of death risk prediction.

[0006] The technical task of the present invention is achieved in the following manner. A mortality prediction method based on structured medical data and large language models, the method comprising the following steps:

[0007] S1. Construct a patient electronic health record dataset: Extract structured medical features such as the patient's demographic information, laboratory test indicators, and diagnostic codes from the electronic health record database, and at the same time obtain the evaluation results of the ICU severity scoring system during the patient's hospitalization, construct a patient electronic health record dataset, and provide raw data support for subsequent modeling;

[0008] S2. Construct a mortality prediction framework: First, construct a feature representation module, that is, screen and group the input patient electronic health record dataset to obtain the scores of the ICU severity scoring system and the patient's structured medical data. Then, perform a series of processes on these two parts respectively to obtain ICU severity scoring features, patient interview features, true label features, and disease and treatment record features. Subsequently, construct a large language model medical diagnosis module, and use the large language model to perform a series of operations on the disease and treatment record features output by the feature representation module to extract high-risk information and make a medical diagnosis. Finally, obtain structured diagnosis labels as one of the inputs of the prediction module. Finally, construct a prediction module, that is, construct a mortality prediction model including structures such as a gated recurrent unit, a multi-layer perceptron, and a multi-head attention layer, and use the data obtained from the feature representation module and the large language model medical diagnosis module for further training;

[0009] S3. Train the mortality prediction model: Control the training process by adjusting the model hyperparameters, and calculate and optimize the model parameters based on the cross-entropy loss function. When the model has not been fully trained, multiple rounds of training are required on the training dataset to optimize the parameters of the mortality prediction model. When the model training is completed, the model can output the corresponding mortality prediction result based on the input patient electronic health record.

[0010] Preferably, the construction process of the mortality prediction framework is as follows:

[0011] Feature representation module: Process the scores of the ICU severity scoring system and the patient's structured medical records after dataset screening and grouping of the patient electronic health record dataset respectively. For the scores of the ICU severity scoring system, group them according to the patient ID, perform mean reduction on the scores of the ICU severity scoring system of each group of patients, and then perform standardization processing on the obtained results to obtain ICU severity scoring features, where the ICU severity scoring system includes but is not limited to APACHE III, SAPS III, and GCS scores. For the patient's structured medical records, first perform data partitioning to obtain comprehensive health information, time of death, and disease and treatment records. The comprehensive health information includes demographic information and laboratory test indicators from multiple patient interviews. Since there are a large number of missing values in this data, missing value imputation, adding missing value indicators, and standardization are performed on it to obtain patient interview features;

[0012] For missing value imputation, the up-down missing value imputation method is used. First, the up missing value imputation method is executed. Grouped by patient ID, for each missing value in the same group, check whether the same feature in the previous medical consultation is empty. If it is not empty, use the current value for imputation. After imputing all missing values, then execute the down missing value imputation. The process is the same as above, except that the value of the same feature in the next medical consultation is taken; for the missing value indicator, if there are still a large number of missing values after imputing a certain feature using the up-down missing value imputation method, add a feature value to record whether the feature value of each medical consultation is missing. If it is missing, record it as 1, otherwise record it as 0; for standardization, this operation will map each feature value of the patient into a vector between 0 and 1, which is convenient for subsequent processing by the mortality prediction model;

[0013] Large language model medical diagnosis module: Taking the disease conditions and treatment record features as inputs, through four parts: uniqueness processing, high-risk information identification by the large language model, medical information matching, and large language model medical diagnosis, finally obtain structured diagnosis labels; specifically, first, take the intersection of the diseases, medications, and procedures in the multiple medical consultations of the disease conditions and treatment record features of this patient to obtain the uniqueness feature set of this patient;

[0014]

[0015] Among them, U(p i ) represents the uniqueness feature set of patient p i . represents the nth disease of patient p i , ensuring its uniqueness. m represents the total number of all diseases in the multiple medical consultations of the patient, the union of all unique diseases of this patient;

[0016] Secondly, taking the uniqueness feature set as the input, use the designed prompt to guide ChatGPT-3.5 or other large language models to identify the high-risk information highly related to death in this set, and obtain the high-risk disease conditions and treatment record features; then, taking the high-risk disease conditions and treatment record features and the disease conditions and treatment record features as inputs, match these two parts of the inputs, and retain the content in the disease conditions and treatment record features that matches the high-risk disease conditions and treatment record features to obtain the structured data at the medical consultation level; finally, design a prompt, insert the structured data at the medical consultation level of this patient into the prompt and guide the large language model to perform medical diagnosis together; in the prompt, in order to standardize the output of the large language model, a new large language model medical diagnosis evaluation standard is proposed, guiding the model to judge the severity of the disease from the dimensions of organ systems such as respiration, circulation, nerves, and infection, and comprehensively evaluate in combination with the overall state and the recent trend of disease changes, which can comprehensively cover the clinical manifestations related to the risk of death and is used as part of the training of the subsequent mortality prediction model;

[0017] Prediction module: For the patient interview features, a gated recurrent unit is used to extract the longitudinal time-series medical information contained therein; at the same time, for the ICU severity score features, a multi-layer perceptron is adopted for processing to obtain the corresponding feature representations respectively. Subsequently, a vector fusion operation is performed on the above two types of feature representations to integrate the feature information from different sources. Then, the fused feature vector is input into the multi-head attention mechanism layer, and the feature information highly correlated with the death risk is perceived through the attention mechanism; at the same time, the structured diagnosis label is input into the linear transformation layer to extract its corresponding feature representation, and further vector fusion is performed with the output features of the multi-head attention mechanism layer. Finally, the fused feature vector is input into the multi-layer perceptron to perform a binary classification task and output the death risk prediction result of the patient;

[0018] Preferably, the training process of the mortality prediction model is as follows:

[0019] In the model training stage, based on the training data set composed of ICU severity score features, patient interview features, structured diagnosis labels, and true label features, end-to-end optimization is carried out in a supervised learning manner; to address the class imbalance problem caused by the small number of dead patient samples in the training set, a class weight dynamic adjustment mechanism is introduced to automatically calculate the loss weights of positive and negative samples;

[0020] In terms of the loss function design, the binary cross-entropy loss function is adopted as the optimization objective, and the Adam optimization algorithm is combined to update the gradients of the network parameters; at the same time, a dynamic learning rate scheduling strategy is introduced to improve the convergence speed and robustness of the model during the training process; the K-fold cross-validation strategy is adopted during the training process to evaluate the model performance, track multiple indicators such as accuracy, AUPRC, AUROC, and F1-score, and select the optimal parameter configuration on the validation set for the final model deployment.

[0021] The mortality prediction device based on structured medical data and large language models, as shown in the appendix Figure 2 This device includes: a patient electronic health record data set construction unit, a mortality prediction framework construction unit, and a mortality prediction model training unit; which respectively implement the functions of steps S1, S2, and S3 in the mortality prediction method based on structured medical data and large language models, and the specific functions of each unit are described as follows:

[0022] The patient electronic health record dataset construction unit is used to process the original data in the patient electronic health record database and extract feature information related to mortality prediction. The features extracted by this unit include structured medical features such as the patient's demographic information, laboratory test indicators, and diagnosis codes; at the same time, the scoring results of the ICU severity scoring system during the patient's hospitalization are extracted. The scoring system includes, but is not limited to, the APACHE III score, the SAPS III score, and the GCS score, providing a structured input basis for subsequent model training;

[0023] The mortality prediction framework construction unit first further preprocesses the patient electronic health record through the feature representation module and normalizes it to obtain a deep semantic embedding representation; the patient electronic health record is divided into four parts: including ICU severity scoring features, patient interview features, true label features, and disease and treatment record features; secondly, the disease and treatment record features are input into the large language model medical diagnosis module, and the large language model is used to extract high-risk information from them and make a medical diagnosis to obtain a structured diagnosis label; then, a multi-level mortality prediction model is constructed, and further training is performed by combining the multi-source data output by the feature representation module and the large language model medical diagnosis module to better predict the patient's mortality;

[0024] The mortality prediction model training unit is used to train the mortality prediction model; this unit includes content such as hyperparameter setting, loss function calculation, and optimizer configuration. The data used for model training includes ICU severity scoring features, patient interview features, true label features, and structured diagnosis labels. This unit completes the training and optimization of the prediction model based on the above multi-source information and outputs model parameters that can be used for inpatient mortality prediction for subsequent clinical reasoning or risk prediction;

[0025] A storage medium stores multiple instructions, and the instructions are loaded by a processor to execute the steps of the above-mentioned medical automatic answering method based on a convolutional neural network.

[0026] An electronic device includes: the above storage medium; and a processor for executing the instructions in the storage medium.

[0027] The mortality prediction method and device based on structured medical data and a large language model of the present invention have the following advantages:

[0028] (1) By screening and preprocessing the electronic medical record database through a pre-written code script, the present invention can efficiently extract the structured feature information of patients, generate serialized medical visit data, and provide high-quality input support for subsequent deep learning model training;

[0029] (2) The present invention introduces a large language model and combines it with carefully designed diagnostic prompt words to guide the model to perform reasoning and judgment on high-risk medical information, capable of simulating the decision-making process of clinicians, and significantly improving the model's semantic understanding ability and recognition accuracy of death risk factors;

[0030] (3) The present invention proposes a new medical diagnosis and evaluation standard for large language models, guiding the model to judge the severity of the condition from the dimensions of organ systems such as respiration, circulation, nerves, and infection, and comprehensively evaluating it in combination with the overall state and recent disease change trends, capable of comprehensively covering the clinical manifestations related to death risk and improving the model training effect and prediction accuracy;

[0031] (4) The present invention constructs a unified feature representation by integrating ICU severity score features, patient interview features, true label features, and structured diagnostic labels, and introduces a multi-head attention mechanism to model the deep dependencies between features, enhancing the model's modeling ability and generalization ability for complex clinical states;

[0032] (5) The present invention proposes a training strategy based on deep feature fusion, extracts multi-source features through gated recurrent units and multi-layer perceptrons, and combines the multi-head attention mechanism to dynamically focus on key feature signals, effectively alleviating the problems of feature redundancy, noise interference, and heterogeneity in electronic health records, and significantly enhancing the robustness and stability of the model;

[0033] (6) The present invention introduces a longitudinal visit sequence modeling mechanism during the training process, makes full use of the time dynamic information in multiple hospitalizations or outpatient follow-ups of patients, and is capable of accurately capturing the evolution law of the disease and the change trend of latent death risk, further improving the model's prediction ability for medium- and long-term death risk;

[0034] (7) The present invention constructs a mortality prediction model based on artificial intelligence technology, capable of accurately predicting the death risk of patients in the short term in the future, improving the timeliness and initiative of clinical intervention, and is an important breakthrough in the field of medical artificial intelligence for intensive care prediction;

[0035] (8) The present invention adopts a modular designed mortality prediction framework, which has good scalability and portability, can adapt to various electronic medical record data formats and clinical application scenarios, and has high practical deployment and promotion potential. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The present invention will be further described below with reference to the drawings.

[0037] Figure 1 It is a flowchart of a mortality prediction method based on structured medical data and a large language model

[0038] Figure 2Structural block diagram of a mortality prediction device based on structured medical data and large language models

[0039] Figure 3 Flowchart of the patient health record dataset construction module

[0040] Figure 4 Flowchart of mortality prediction model training Detailed implementation manners

[0041] The mortality prediction method and device of the present invention based on structured medical data and large language models will be described in detail below with reference to the accompanying drawings of the specification and specific embodiments.

[0042] Embodiment 1:

[0043] The overall framework of the present invention is as shown in the appendix Figure 1 shown. As shown in the appendix Figure 1It can be seen that the main framework of the present invention includes the following three modules, namely, a feature representation module, a large language model medical diagnosis module, and a prediction module. Among them, the electronic health records of a patient's multiple medical consultations constitute a training sample; the training samples of all patients are collected to form a patient electronic health record dataset, and the patient electronic health record dataset is used as the input of the feature representation module; the feature representation module takes the patient electronic health record dataset as the input, first performs dataset screening and grouping to obtain the ICU severity scoring system score result and the patient's structured medical record; secondly, performs mean reduction and standardization on the ICU severity scoring system score result to obtain ICU severity scoring features, and finally sends them to the prediction module; at the same time, performs data partitioning on the patient's structured medical record to obtain comprehensive health information, time of death, and disease and treatment records; finally, performs missing value imputation, adds missing value indicators, and standardizes the comprehensive health information to obtain patient consultation features, and finally sends them to the prediction module, performs time of death judgment on the time of death to obtain true label features, and retains the description information of the disease and treatment records to obtain disease and treatment record features, and finally sends them to the large language model medical diagnosis module. The large language model medical diagnosis module takes the disease and treatment record features as the input; first, performs uniqueness processing to obtain a set of uniqueness features; secondly, passes the set of uniqueness features through the large language model high-risk information recognition to obtain high-risk disease and treatment record features; then, takes the disease and treatment record features and the high-risk disease and treatment record features as the input, performs medical information matching to obtain consultation-level structured data; finally, uses the consultation-level structured data to obtain structured diagnosis labels through the large language model medical diagnosis, and finally sends them to the prediction module. The prediction module takes the ICU severity scoring features, patient consultation features, and structured diagnosis labels as the input; first, passes the ICU severity scoring features through a multi-layer perceptron, and at the same time passes the patient consultation features through a gated recurrent unit, and then fuses the outputs of these two parts and inputs them into a multi-head attention layer; secondly, inputs the structured diagnosis labels into a linear layer, fuses the output of this layer with the output of the multi-head attention layer, and then inputs its output structure into a multi-layer perceptron to obtain a prediction result; finally, calculates the loss using the prediction result and the true label features, and further reversely optimizes the model parameters.

[0044] Embodiment 2:

[0045] As shown in the attached Figure 1 figure, the mortality prediction method based on structured medical data and large language model of the present invention includes the following steps:

[0046] S1. Construct the patient electronic health record dataset: This step aims to obtain the patient electronic health record database and further process it to finally obtain the patient electronic health record dataset. As shown in the appendix Figure 3 Firstly, obtain the patient electronic health record database, and then use a preset script to import the patient electronic health record database into the database management system. Secondly, use a data extraction script to extract the feature fields for assisting the mortality prediction task from the database management system, perform summarization and time sorting on the extraction results, and finally obtain the patient electronic health record dataset to provide raw data support for subsequent modeling.

[0047] S101. Construct the patient electronic health record database: Firstly, download the patient electronic health record database from the dataset open source website or use a private database. Secondly, use a preset script to import the electronic health record database into the database management system.

[0048] Example: Import the MIMIC-IV database into the database management system. The example is as follows:

[0049] Firstly, obtain the electronic health record database source file from the MIMIC-IV official website, and use its built-in preset script to import the database source file into the postgre database management system for subsequent efficient query of data feature values.

[0050] S102. Extract patient electronic health record data: Using the patient electronic health record database imported into the database management system in S101 as the input, write a data extraction script to perform a joint query on multiple associated tables in the electronic medical record database, and extract the feature fields for assisting the mortality prediction task, including the patient's demographic information, laboratory test indicators, diseases, descriptions and ICD codes of medications and procedure records, the patient's death date, and the evaluation results of the ICU severity scoring system during the patient's hospitalization. Subsequently, perform summarization and time sorting on the extraction results, and finally obtain the patient electronic health record dataset and save it as a CSV format file for subsequent modeling processing.

[0051] Example: Extract the feature fields for assisting mortality prediction in the MIMIC-IV database:

[0052] Firstly, write an sql query script to associate multiple tables in the MIMIC-IV database, summarize the queried information into one table, and finally export the content of the summary table as a CSV format file as the patient electronic health record dataset. Part of the dataset structure and content are as follows:

[0053] subject_id hadm_id stay_id gender age height weight ph temperature glucose 10001884 26184834 37510196 F 77 157 65 7.36 36.84 140 10001884 26202981 F 76 ......

[0054] The empty content indicates that the value of this feature has not been measured or recorded in the patient's electronic health record database. Since there are a large number of missing values in the patient's electronic health record database, imputation operations need to be performed for subsequent alignment;

[0055] S2. Construct a mortality prediction framework: The mortality prediction framework is jointly composed of a feature representation module, a large language model medical diagnosis module, and a prediction module;

[0056] S201. Feature representation module: This step aims to process the input patient electronic health record dataset into standardized features that meet the training of the mortality prediction model. First, the input patient electronic health record dataset is divided into two parts for processing after dataset screening and grouping: the scores of the ICU severity scoring system and the patient's structured medical records. Then, a series of operations are performed on these two parts respectively to obtain ICU severity scoring features, patient interview features, true label features, and disease and treatment record features;

[0057] S20101. Process the scores of the ICU severity scoring system: First, take the scores of the ICU severity scoring system obtained after dataset screening and grouping of the patient electronic health record dataset in S102 as input, group them according to the patient ID, and after performing mean reduction and standardization operations on each group, obtain ICU severity scoring features, where the ICU severity scoring system includes but is not limited to APACHE III, SAPS III, and GCS scores;

[0058] Example: In the MIMIC-IV dataset, process the patient's SPAS III:

[0059] First, group according to the patient ID, perform averaging and standardization operations on the data of each group, and the relevant code is as follows:

[0060] icu_score_avg = df.groupby('PatientID')[icu_score_columns].mean().reset_index()

[0061] icu_score_avg[icu_score_columns] = scaler.fit_transform(icu_score_avg[icu_score_columns])

[0062] After processing 22 interview records with patient ID 10001884, the data structure obtained is as follows, and some content is shown below:

[0063] PatientID sapsii saps_age_score saps_hr_score saps_sysbp_score sapsii ...... 10001884 0.44898 0.888889 1 0.384615 0.44898 ......

[0064] S20102. Process the structured medical record of the patient: First, take the structured medical record of the patient obtained after dataset screening and grouping of the patient electronic health record dataset in S102 as the input. After data partitioning, three parts of content are obtained: comprehensive health information, time of death, and disease condition and treatment record. Perform missing value imputation, add missing value indicators, and standardization operations on the comprehensive health information to obtain the patient interview characteristics. Perform a time of death judgment on the time of death to determine whether the patient has died. Finally, obtain the true label characteristics. Perform an operation to retain the descriptive information on the disease condition and treatment record to obtain the disease condition and treatment record characteristics.

[0065] Example: The process of processing the structured medical record of the patient in the MIMIC-IV dataset is as follows:

[0066] Specifically, perform data partitioning on the structured medical record of the patient to obtain comprehensive health information, time of death, and disease condition and treatment record. The comprehensive health information includes the demographic information and laboratory test indicators of the patient's multiple interviews. Since there are a large number of missing values in this data, missing value imputation, adding missing value indicators, and standardization are performed on it to obtain the patient interview characteristics.

[0067] For missing value imputation, the up-down missing value imputation method is used. First, perform the up missing value imputation method. Group by patient ID. For each missing value in the same group, check whether the same feature in the previous interview is empty. If it is not empty, use the current value for imputation. After imputing all missing values, then perform the down missing value imputation. The process is the same as above, except that the value of the same feature in the next interview is taken. For the missing value indicator, if there are still a large number of missing values after imputing a certain feature using the up-down missing value imputation method, add a feature value to record whether the feature value of each interview is missing. If it is missing, record it as 1, otherwise record it as 0. For standardization, this operation will map each feature value of the patient into a vector between 0 and 1 to facilitate the processing of the subsequent mortality prediction model. The partial structure of the patient interview characteristics is as follows:

[0068] PatientID RecordTime Sex Age ...... Hematocrit platelet ...... Height_missing ...... 10001884 1 0 0.634146 ...... 0.545358 0.126938 ...... 0 ...... 10001884 2 0 0.634146 ...... 0.529349 0.14059 ...... 0 ...... ......

[0069] Perform a time of death judgment on the time of death. If there is a record of the time of death for this patient, then the patient has died, and the true label characteristic is recorded as 1. Otherwise, the patient has survived, and the true label characteristic is recorded as 0.

[0070] For the disease condition and treatment record, perform an operation to retain the descriptive information to obtain the disease condition and treatment record characteristics. The disease condition and treatment record includes the descriptive information of the patient's diseases, medications, and procedures, as well as the ICD codes. Simply remove the ICD codes to obtain the disease condition and treatment record characteristics. Some of the content is shown as follows:

[0071]

[0072]

[0073] Then input the disease condition and treatment record features into the large language model medical diagnosis module;

[0074] S202. Large language model medical diagnosis module: This module aims to guide the large model through prompts to make a medical diagnosis of the disease condition and treatment record features that have undergone a series of processes, and obtain structured diagnosis labels. Specifically, take the disease condition and treatment record features obtained in S20102 as input, and after processing through four parts: uniqueness processing, large language model high-risk information identification, medical information matching, and large language model medical diagnosis, finally obtain structured diagnosis labels;

[0075] S20201. Uniqueness processing: Take the disease condition and treatment record features obtained in S20102 as input, group them by patient ID, and perform uniqueness processing on the disease condition and treatment record features of each patient to obtain a set of unique features;

[0076] Example: Perform uniqueness processing on the disease condition and treatment record features of patient ID 100018884 in the MIMIC-IV dataset:

[0077] Take the intersection of the diseases, medications, and procedures of multiple medical consultations in the disease condition and treatment record features of this patient to obtain the set of unique features of this patient;

[0078]

[0079] Among them, U(p i ) represents the set of unique features of patient p i , represents the nth disease of patient p i , ensuring its uniqueness, m represents the total number of all diseases of the patient's multiple medical consultations, The union of all unique diseases of this patient, and part of the structure and content of this set are shown as follows:

[0080]

[0081]

[0082] S20202. Large language model high-risk information identification: Take the set of unique features obtained in S20201 as input, and through large language model high-risk information identification, obtain high-risk disease condition and treatment record features;

[0083] Example: Identify high-risk information of the unique feature set of patient ID 100018884 in the MIMIC-IV dataset using a large language model:

[0084] First, use the unique feature set of patient ID 100018884 as input, and use the designed prompt to guide ChatGPT-3.5 or other large language models to identify high-risk information highly related to death in this set. The core content of the prompt is as follows:

[0085]

[0086]

[0087] Use this prompt to guide the large language model to output the high-risk information in the unique feature set of this patient, and obtain the high-risk condition and treatment record features. The high-risk condition and treatment record features of patient ID 10001884 are as follows:

[0088]

[0089] S20203. Medical information matching: Use the high-risk condition and treatment record features obtained in S20202 and the condition and treatment record features obtained in S20102 as input, match these two parts of the input, and retain the content in the condition and treatment record features that matches the high-risk condition and treatment record features to obtain the structured data at the interrogation level;

[0090] Example: Perform medical information matching on the high-risk condition and record features and the condition and treatment record features of patient ID 100018884 in the MIMIC-IV dataset:

[0091] Match these two parts of the input features, retain the fields that match successfully in the condition and treatment record features, and part of the content of the structured data at the interrogation level obtained is as follows:

[0092]

[0093] The empty content indicates that there is no high-risk information in a certain feature during this interrogation. For example, when RecordTime is 1 or 2 in the above table, the Disease record is empty;

[0094] S20204. Medical diagnosis by large language model: Use the structured data at the interrogation level obtained in S20203 as input, and design a prompt to guide the large model for medical diagnosis to obtain structured diagnostic labels;

[0095] Example: Process the structured data at the interrogation level of patient ID 10001884 in the MIMIC-IV dataset as follows:

[0096] First, design a prompt. Insert the structured data of the patient's medical history into the prompt and guide the large language model to perform medical diagnosis. In the prompt, in order to standardize the output of the large language model, a new medical diagnosis evaluation standard for the large language model is proposed. Guide the model to judge the severity of the condition from the dimensions of organ systems such as respiration, circulation, nerves, and infections, and comprehensively evaluate it in combination with the overall condition and the recent trend of the condition change. It can comprehensively cover the clinical manifestations related to the risk of death, and as part of the training of the subsequent mortality prediction model, the content of the prompt is as follows, which includes the medical diagnosis evaluation standard for the large language model:

[0097]

[0098]

[0099] This standard is used to systematically evaluate whether the patient's condition is out of control or deteriorating. Classify according to the main disease systems such as respiration, digestion, cardiovascular, urinary, reproductive, nerves, endocrine, blood and immunity, tumors, and systemic infections, judge the control status of related diseases item by item, and supplement the comprehensive judgment of other unlisted diseases. In addition, by reviewing the patient's recent five medical records, overall evaluate whether the condition has deteriorated rapidly or entered a critical state. It not only covers the control status of single diseases, but also takes into account the trend of the disease process, aiming to provide a unified and detailed basis for subsequent risk prediction, disease management or classification modeling;

[0100] After that, the large language model will perform medical diagnosis according to the requirements of the prompt. For each criterion in the evaluation criterion, if the large language model deems it established, it will output 1, otherwise it will output 0, and finally obtain the structured diagnosis label and send it to the prediction module;

[0101] S203. Prediction module: Take the ICU severity score feature obtained in S20101, the patient's medical history feature obtained in S20102, and the structured diagnosis label obtained in S20204 as inputs. First, construct a mortality prediction model containing structures such as gated recurrent units, multi-layer perceptrons, and multi-head attention layers, and then pass the input features to the mortality prediction model to finally obtain the prediction result;

[0102] Example: The construction and prediction process of the mortality prediction model is as follows:

[0103] First, based on the patient interview characteristics, a gated recurrent unit is used to extract the longitudinal time-series medical information contained therein; at the same time, for the ICU severity score characteristics, a multi-layer perceptron is used for processing to obtain corresponding feature representations respectively; subsequently, a vector fusion operation is performed on the above two types of feature representations to integrate feature information from different sources; then, the fused feature vector is input into the multi-head attention mechanism layer, and the attention mechanism is used to perceive the feature information highly correlated with the death risk; at the same time, the structured diagnosis label is input into the linear transformation layer to extract its corresponding feature representation, and further vector fusion is performed with the output features of the multi-head attention mechanism layer; finally, the fused feature vector is input into the multi-layer perceptron to perform a binary classification task and output the death risk prediction result of the patient; the partial implementation code of this mortality prediction model is as follows:

[0104]

[0105] Using the above code, it is possible to implement mortality prediction using multi-source input features;

[0106] S3. Train the mortality prediction model: Based on the constructed neural network structure, a supervised learning method is used to train the mortality prediction model; as shown in the appendix Figure 4 First, take the mortality prediction model constructed in step S203 as the initial network structure, and combine the ICU severity score characteristics obtained from S20101, the patient interview characteristics obtained from S20102, the true label characteristics, and the structured diagnosis labels obtained from S20204 as inputs to form a training dataset; during the training process, the binary cross-entropy loss function is used as the optimization objective, and the loss is calculated using the prediction results and the true label characteristics in the training dataset, and then the model parameters are optimized in reverse. Iterate according to such a process, and finally select the optimal parameter configuration on the validation set for the final model deployment;

[0107] S301. Calculate the cross-entropy loss function: Use the following calculation formula to calculate the binary cross-entropy loss for the true label characteristics obtained from S20102 and the prediction results obtained from S203:

[0108]

[0109] where L(·) represents the binary cross-entropy loss function, y represents the true label of the patient, represents the prediction result of the model;

[0110] After that, the binary cross-entropy loss is used to optimize the model parameters in reverse;

[0111] S302. Construct the optimization function: Use the Adam algorithm as the optimization function of the model, and optimize and train the mortality prediction model on the training dataset according to the set hyperparameters. Here, the hyperparameters refer to the parameters whose values need to be manually set before the start of the training process. This parameter cannot be automatically optimized through training. According to the differences in actual datasets, this parameter needs to be manually set by the user.

[0112] For example, in PyTorch, the Adam optimization function can be defined using the following code:

[0113] optim = torch.optim.Adam(lr)

[0114] In each training round, the model generates the mortality prediction results of patients through forward propagation. Subsequently, the prediction results are compared with the true labels to calculate the loss. Then, all trainable parameters in the model are updated by gradient through the backpropagation algorithm to minimize the loss function value. In addition, a dynamic learning rate scheduling mechanism is introduced to improve the convergence efficiency and training stability of the model.

[0115] S303. Evaluate the prediction results: The entire training process is evaluated using cross-validation. Each time, the data is divided into a training set and a validation set, and metrics such as accuracy, AUPRC, AUROC, and F1-score in each round of training are recorded for model performance evaluation and selection of the optimal model parameters. After the training is completed, the model parameter weights that perform best on the validation set are retained and used for subsequent test set evaluation and deployment.

[0116] The model proposed in the present invention has achieved better results than other models on the MIMIC-IV and eICU datasets. The comparison of the experimental results is shown in the following table:

[0117]

[0118] Among them, Acc represents accuracy, AUROC represents the area under the ROC curve, which is used to measure the overall discrimination ability of the model at different classification thresholds. AUPRC represents the area under the Precision-Recall curve, which pays more attention to the prediction performance of the positive class. F1 represents the harmonic mean of precision and recall.

[0119] Example 3:

[0120] As shown in the appendix Figure 2As shown in the figure, a mortality prediction device based on structured medical data and large language models, the device includes: a patient electronic health record dataset construction unit, a mortality prediction framework construction unit, and a mortality prediction model training unit; respectively implementing the functions of steps S1, S2, and S3 in the mortality prediction method based on structured medical data and large language models. The specific functions of each unit are as follows:

[0121] The patient electronic health record dataset construction unit is used to process the original data in the patient electronic health record database and extract feature information related to mortality prediction; the features extracted by this unit include structured medical features such as patient demographic information, laboratory test indicators, and diagnosis codes; at the same time, the scoring results of the ICU severity scoring system during the patient's hospitalization are extracted, and the scoring system includes but is not limited to APACHE III score, SAPS III score, and GCS score, providing a structured input basis for subsequent model training;

[0122] The mortality prediction framework construction unit first further preprocesses the patient electronic health record through a feature representation module and normalizes it to obtain a deep semantic embedding representation; the patient electronic health record is divided into four parts: including ICU severity scoring features, patient interview features, true label features, and disease and treatment record features; secondly, the disease and treatment record features are input into the large language model medical diagnosis module, and the large language model is used to extract high-risk information from them and make a medical diagnosis to obtain a structured diagnosis label; then, a multi-level mortality prediction model is constructed, and further training is performed by combining the multi-source data output by the feature representation module and the large language model medical diagnosis module to better predict the patient's mortality;

[0123] The mortality prediction model training unit is used to train the mortality prediction model; this unit includes hyperparameter setting, loss function calculation, and optimizer configuration, etc.; the data used for model training includes ICU severity scoring features, patient interview features, true label features, and structured diagnosis labels; this unit completes the training and optimization of the prediction model based on the above multi-source information and outputs model parameters that can be used for in-hospital mortality prediction for subsequent clinical reasoning or risk prediction;

[0124] Example 4:

[0125] Based on the storage medium of Example 2, which stores multiple instructions, and the instructions are loaded by a processor to execute the steps of the mortality prediction method based on structured medical data and large language models in Example 2.

[0126] Example 5:

[0127] An electronic device based on Embodiment 4, the electronic device includes: the storage medium of Embodiment 4; and a processor for executing instructions in the storage medium of Embodiment 4.

[0128] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

[0129] In this case, the program code read from the storage medium itself can implement the functions of any one of the above embodiments, so the program code and the storage medium storing the program code constitute a part of the present invention.

[0130] Embodiments of the storage medium for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RYM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Optionally, the program code can be downloaded from a server computer via a communication network.

[0131] In addition, it should be clear that not only can the functions of any one of the above embodiments be implemented by executing the program code read by the computer, but also by an operating system or the like operating on the computer based on the instructions of the program code to complete part or all of the actual operations.

[0132] In addition, it can be understood that the program code read from the storage medium is written into the memory provided in the expansion board inserted into the computer or into the memory provided in the expansion unit connected to the computer, and then based on the instructions of the program code, the CPU or the like installed on the expansion board or the expansion unit is made to execute part and all of the actual operations, so as to implement the functions of any one of the above embodiments.

[0133] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A mortality prediction method based on structured medical data and a large language model, characterized in that: The method is to construct a feature representation module, a large language model medical diagnosis module and a prediction module, integrate the ICU severity score features extracted from the patient's electronic health record, the patient's consultation features and the structured diagnosis labels obtained after the large language model medical diagnosis to form a training data set, and train a mortality prediction model that can predict the patient's mortality risk; wherein, the feature representation module is used to extract and process the patient's electronic health record data set to obtain the ICU severity score features, patient consultation records, true label features and condition and treatment record features; the large language model medical diagnosis module is used to simulate the diagnostic reasoning process of clinicians, semantically understand the condition and treatment record features and generate structured diagnosis labels; the prediction module is composed of a gated recurrent unit, a multi-layer perceptron and a multi-head attention mechanism, which is used to jointly model longitudinal time information and high-risk factors to improve the accuracy and clinical adaptability of mortality risk prediction, as follows: S1. Constructing the patient electronic health record dataset: Extracting the patient's demographic information, laboratory test indicators, diagnostic codes and other structured medical characteristics from the electronic health record database, and obtaining the evaluation results of the ICU severity scoring system during the patient's hospitalization, constructing the patient's electronic health record dataset to provide raw data support for subsequent modeling; S2. Construct a mortality prediction framework: First, construct a feature representation module, that is, screen and group the input patient electronic health record data set to obtain the ICU severity scoring system score results and the patient's structured medical data, and then perform a series of processing on these two parts to obtain ICU severity scoring features, patient consultation features, true label features, and condition and treatment record features; then construct a large language model medical diagnosis module, use the large language model to perform a series of operations on the condition and treatment record features output by the feature representation module to extract high-risk information and make a medical diagnosis, and finally obtain a structured diagnosis label as one of the inputs of the prediction module; finally, construct a prediction module, that is, construct a mortality prediction model including a gated recurrent unit, a multi-layer perceptron, a multi-head attention layer, etc., and use the data obtained from the feature representation module and the large language model medical diagnosis module for further training; S3. Train the mortality prediction model: Control the training process by adjusting the model hyperparameters, and calculate and optimize the model parameters based on the cross-entropy loss function. When the model has not been fully trained, multiple rounds of training are required on the training data set to optimize the parameters of the mortality prediction model. When the model training is completed, the model can output the corresponding mortality prediction results based on the input patient electronic health records.

2. The mortality prediction method based on structured medical data and large language model according to claim 1 is characterized in that The patient electronic health record data set construction module has the following specific implementation process: S1. Constructing the patient electronic health record data set: This step aims to obtain the patient electronic health record database and further process it to finally obtain the patient electronic health record data set; first, obtain the patient electronic health record database, and then use the preset script to import the patient electronic health record database into the database management system; second, use the data extraction script to extract the characteristic fields of the auxiliary mortality prediction task from the database management system, perform aggregation and time sorting on the extraction results, and finally obtain the patient electronic health record data set to provide raw data support for subsequent modeling; S101. Build a patient electronic health record database: First, download the patient electronic health record database from the dataset open source website or use a private database; second, use a preset script to import the electronic health record database into the database management system; S102. Extract patient electronic health record data: Take the patient electronic health record database imported into the database management system in S101 as input, write a data extraction script, perform a joint query on multiple related tables in the electronic medical record database, and extract feature fields that assist in the mortality prediction task, including the patient's demographic information, laboratory test indicators, descriptions and ICD codes of diseases, medications and procedure records, patient death dates, and ICU severity scoring system evaluation results during the patient's hospitalization; then, summarize and sort the extraction results in time, and finally obtain the patient electronic health record data set, and save it as a CSV format file for subsequent modeling processing.

3. The mortality prediction method based on structured medical data and large language model according to claim 1 is characterized by the feature representation Module, the specific implementation process is as follows: S201, feature representation module: This step aims to process the input patient electronic health record data set into standardized features that meet the training of the mortality prediction model; first, the patient electronic health record data set is input, and after data set screening and grouping, it is divided into two parts for processing: the ICU severity scoring system score results and the patient structured medical records; then a series of operations are performed on these two parts respectively to obtain ICU severity score features, patient consultation features, true label features, and condition and treatment record features; S20101. Processing the ICU severity scoring system scoring results: First, the ICU severity scoring system scoring results obtained after the patient electronic health record data set obtained in S102 is screened and grouped as input, and grouped according to the patient ID. After performing mean reduction and standardization operations on each group, the ICU severity scoring features are obtained, wherein the ICU severity scoring system includes but is not limited to APACHE III, SAPS III and GCS scores; S20102, processing patient structured medical records: First, the patient electronic health record data set obtained in S102 is used as input after data set screening and grouping to obtain the patient structured medical records, and after data division, the three parts of comprehensive health information, death time, and condition and treatment records are obtained; The comprehensive health information was interpolated for missing values, missing value indicators were added, and standardized to obtain the patient consultation characteristics; The purpose of judging the time of death is to determine whether the patient is dead and finally obtain the real label characteristics; the description information of the condition and treatment records is retained to obtain the characteristics of the condition and treatment records; The comprehensive health information includes the demographic information and laboratory test indicators of patients in multiple consultations. Since there are a large number of missing values ​​in the data, missing value interpolation, missing value indicators and standardization are performed to obtain the patient consultation characteristics; For the time of death, if there is a record of the patient's death time, then the patient is dead, and the true label feature is recorded as 1; otherwise, the patient is alive, and the true label feature is recorded as 0; For the medical condition and treatment records, the description information retention operation is performed to obtain the characteristics of the medical condition and treatment records, where the medical condition and treatment records contain the description information and ICD codes of the patient's disease, medication and procedures. The characteristics of the medical condition and treatment records are obtained by simply removing the ICD codes.

4. The mortality prediction method based on structured medical data and large language model according to claim 1 is characterized in that The large language model medical diagnosis module is as follows: S202, large language model medical diagnosis module: This module aims to guide the large model to make a medical diagnosis based on a series of processed disease and treatment record features through prompts, and obtain a structured diagnosis label. Specifically, the disease and treatment record features obtained in S20102 are used as input, and after four parts of processing, namely uniqueness processing, large language model high-risk information identification, medical information matching, and large language model medical diagnosis, a structured diagnosis label is finally obtained. S20201, uniqueness processing: taking the disease condition and treatment record features obtained in S20102 as input, grouping by patient ID, and performing uniqueness processing on the disease condition and treatment record features of each patient to obtain a unique feature set; The uniqueness processing is to take the intersection of the patient's condition and the diseases, medications and procedures of multiple consultations in the treatment record characteristics to obtain the unique feature set of the patient. The relevant calculation formula is as follows; Where U(p i ) indicates patient p i The unique feature set of Indicates patient p i The nth disease of , ensuring its uniqueness, m represents the total number of diseases that the patient has consulted multiple times, The union of all unique diseases for that patient; S20202, large language model high-risk information identification: The unique feature set obtained in S20201 is used as input, and high-risk disease and treatment record features are obtained through large language model high-risk information identification; Specifically, the patient's unique feature set is used as input, and the designed prompt is used to guide ChatGPT-3.5 or other large language models to identify high-risk information in the set that is highly correlated with death. The core content of the prompt words is as follows: Use the prompt word to guide the large language model to output high-risk information in the unique feature set of the patient, and obtain high-risk disease and treatment record features; S20203, medical information matching: taking the high-risk condition and treatment record features obtained in S20202 and the condition and treatment record features obtained in S20102 as input, matching the two parts of input, retaining the content of the condition and treatment record features that matches the high-risk condition and treatment record features, and finally obtaining the consultation-level structured data; Among them, after the two parts of input features are matched, if the content is empty, it means that there is no high-risk information in a certain feature in this consultation; S20204, large language model medical diagnosis: using the inquiry-level structured data obtained in S20203 as input, designing prompts to guide the large model medical diagnosis to obtain structured diagnosis labels; Specifically, first, a prompt is designed to insert the patient's consultation-level structured data into the prompt to guide the large language model to make a medical diagnosis. In the prompt, in order to standardize the output of the large language model, a new large language model medical diagnosis evaluation standard is proposed to guide the model to judge the severity of the disease from the dimensions of organ systems such as respiratory, circulatory, nervous, and infectious systems, and to conduct a comprehensive evaluation based on the overall status and recent disease change trends. It can fully cover the clinical manifestations related to the risk of death and serve as part of the subsequent mortality prediction model training. The prompt content is as follows, which includes the large language model medical diagnosis evaluation standard: This standard is used to systematically evaluate whether the patient's condition is uncontrolled or worsening; it classifies the main diseases such as respiratory, digestive, cardiovascular, urinary, reproductive, nervous, endocrine, blood and immune, tumor, and systemic infection, and judges the control of related diseases one by one, and supplements the comprehensive judgment of other unlisted diseases; in addition, it also reviews the patient's most recent five medical records to comprehensively evaluate whether the condition has deteriorated rapidly or entered a critical state; it covers both the control of a single disease and the trend of the course of the disease, aiming to provide a unified and detailed basis for subsequent risk prediction, disease management or classification modeling; Afterwards, the large language model will perform a medical diagnosis according to the prompt requirements. For each criterion in the evaluation criteria, if the large language model considers it to be true, it will output 1, otherwise it will output 0. Finally, a structured diagnosis label is obtained and sent to the prediction module.

5. The mortality prediction method based on structured medical data and large language model according to claim 1 is characterized in that Prediction module, as follows: S203, prediction module: using the ICU severity score features obtained in S20101, the patient consultation features obtained in S20102, and the structured diagnosis labels obtained in S20204 as input, first construct a mortality prediction model including a gated recurrent unit, a multi-layer perceptron, a multi-head attention layer, etc., and then pass the input features to the mortality prediction model to finally obtain the prediction result; Specifically, firstly, based on the patient's medical interview features, the gated recurrent unit is used to extract the longitudinal time series medical information contained therein; at the same time, the ICU severity score features are processed by a multi-layer perceptron to obtain the corresponding feature representations; then, a vector fusion operation is performed on the above two types of feature representations to integrate feature information from different sources; then, the fused feature vector is input into the multi-head attention mechanism layer, and the feature information that is highly correlated with the risk of death is perceived through the attention mechanism; at the same time, the structured diagnostic label is input into the linear transformation layer to extract its corresponding feature representation, and further vector fusion is performed with the output features of the multi-head attention mechanism layer; finally, the fused feature vector is input into the multi-layer perceptron to perform a binary classification task and output the patient's death risk prediction result.

6. The mortality prediction method based on structured medical data and large language model according to claim 1 is characterized in that Mortality prediction model training module, as follows: S3. Training the mortality prediction model: Based on the constructed neural network structure, the mortality prediction model is trained by supervised learning. First, the mortality prediction model constructed in step S203 is used as the initial network structure, and the ICU severity score features obtained in S20101, the patient consultation features obtained in S20102, the real label features and the structured diagnosis labels obtained in S20204 are combined as input to form a training data set. The training process uses the binary cross entropy loss function as the optimization target, uses the predicted results and the real label features in the training data set to calculate the loss, and then reversely optimizes the model parameters. This process is iterated, and finally the optimal parameter configuration is selected on the validation set for the final model deployment. S301, calculate the cross entropy loss function: use the following calculation formula to calculate the binary cross entropy loss using the true label features obtained in S20102 and the prediction results obtained in S203: where L(·) represents the binary cross entropy loss function, y represents the true label of the patient, Represents the prediction results of the model; Then binary cross entropy loss is used to reversely optimize the model parameters; S302, constructing an optimization function: using the Adam algorithm as the optimization function of the model, optimizing and training the mortality prediction model according to the set hyperparameters on the training data set; wherein the hyperparameter refers to a parameter whose value needs to be manually set before starting the training process; the parameter cannot be automatically optimized through training; according to different actual data sets, the parameter needs to be manually set by the user; In each training round, the model generates a patient's mortality prediction result through forward propagation. The prediction result is then compared with the true label to calculate the loss. The gradient of all trainable parameters in the model is then updated through the back-propagation algorithm to minimize the loss function value. In addition, a dynamic learning rate scheduling mechanism is introduced to improve the convergence efficiency and training stability of the model. S303. Evaluate prediction results: The entire training process is evaluated using cross-validation. Each time, the data is divided into a training set and a validation set, and the accuracy, AUPRC, AUROC, and F1-score in each round of training are recorded for model performance evaluation and selection of optimal model parameters. After the training is completed, the model parameter weights that perform best on the validation set are retained and used for subsequent test set evaluation and deployment.

7. A mortality prediction device based on structured medical data and a large language model, characterized in that: The model building unit includes a patient electronic health record data set building unit, a mortality prediction framework building unit and a mortality prediction model training unit, which respectively implement the mortality prediction method based on structured medical data and a large language model described in claims 1-6, as follows: The patient electronic health record data set construction unit is used to process the original data in the patient electronic health record database and extract feature information related to mortality prediction; the features extracted by this unit include patient demographic information, laboratory test indicators, diagnostic codes and other structured medical features; at the same time, the scoring results of the ICU severity scoring system of the patient during hospitalization are extracted, and the scoring system includes but is not limited to APACHE III score, SAPS III score and GCS score, providing a structured input basis for subsequent model training; The mortality prediction framework construction unit first pre-processes the patient's electronic health record through the feature representation module, and standardizes it to obtain a deep semantic embedding representation; divides the patient's electronic health record into four parts: including ICU severity score features, patient consultation features, true label features, and condition and treatment record features; secondly, inputs the condition and treatment record features into the large language model medical diagnosis module, uses the large language model to extract high-risk information and make a medical diagnosis, and obtains a structured diagnosis label; then, builds a multi-level mortality prediction model, and combines the multi-source data output by the feature representation module and the large language model medical diagnosis module for further training, so as to better predict patient mortality; The mortality prediction model training unit is used to train the mortality prediction model; this unit includes hyperparameter settings, loss function calculations, and optimizer configurations; the data used for model training include ICU severity score features, patient interview features, true label features, and structured diagnostic labels; this unit completes the training optimization of the prediction model based on the above multi-source information, and outputs model parameters that can be used for inpatient mortality prediction for subsequent clinical reasoning or risk prediction.

8. The mortality prediction device based on structured medical data and large language model according to claim 7 is characterized in that A loss function building module and an optimization function building module, wherein the model training unit comprises: A loss function building module, for calculating the error between the prediction result of the mortality prediction model and the true label of the patient using a binary cross entropy loss function; The optimization function building module is used to train and adjust the parameters in the mortality prediction model training using the Adam optimization algorithm to reduce the prediction error.

9. An electronic device, characterized in that: include: memory and at least one processor; Wherein, the memory stores a computer program; The at least one processor executes the computer program stored in the memory, so that the at least one processor performs the mortality prediction method based on structured medical data and a large language model as described in any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which can be executed by a processor to implement the mortality prediction method based on structured medical data and a large language model as described in any one of claims 1 to 6.

Citation Information

Cited By

  • ICU (Intensive Care Unit) patient death rate prediction method based on frequency sensing transverse and longitudinal aggregation

    CN120526999A