A generative medical large model processing method and device
By constructing a large generative medical model and performing pre-training and fine-tuning, combined with expert evaluation, the problem of lack of large model training in the medical field is solved, the application of multi-type task models is realized, and the efficiency and accuracy of model training in the field of cardiovascular diseases are improved. sex.
Patent Information
- Application Number
- CN202410400018.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-03
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-04-03
AI Technical Summary
Existing generative large language models in the medical field, especially in the cardiovascular disease subdivision, lack mature model training cases and are difficult to be directly applied to designated fields.
Build a large generative medical model based on the generative large language model, and build a pre-training data set using medical field knowledge and a fine-tuning data set using knowledge in the cardiovascular comorbidity field. Perform pre-training and fine-tuning, and combine it with the expert evaluation mechanism to form a base version and Large model of downstream tasks.
It implements the training and evaluation mechanism of generative medical large models, provides large models for multiple types of tasks, solves the problem of lack of large model training solutions in cardiovascular disease subdivisions, and improves the application efficiency and accuracy of the model in the medical field.
Smart Images

Figure CN118171693B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method and device for processing a generative medical large model. Background Art
[0002] In the field of Natural Language Processing (NLP), generative large language models (LLMs) have broad application prospects, but before being applied to a specific field, they need to be pre-trained and fine-tuned in the subdivided field based on the knowledge in the field, otherwise the model cannot be directly used in the specified field. Currently known generative LLM model training cases are mostly concentrated in some non-professional fields. There are no relatively mature model training cases for reference in professional fields, especially in the cardiovascular disease subdivision field in the medical field. The technical problem to be solved by the present invention is how to perform corresponding medical field pre-training and cardiovascular disease subdivision field fine-tuning on a generative large language model applied to the medical field, i.e., a generative medical large model. Summary of the invention
[0003] The purpose of the present invention is to provide a processing method, device, electronic device and computer-readable storage medium for a generative medical big model in view of the defects of the prior art. The present invention first constructs a generative medical big model based on a type of generative big language model, and plans multiple model downstream tasks (medical vocabulary query task, disease classification prediction task, disease treatment plan prediction task and critical illness risk prediction task) for the generative medical big model; then constructs a pre-training data set based on medical field knowledge and constructs corresponding fine-tuning data sets for various model downstream tasks based on cardiovascular comorbidity field knowledge; then pre-trains the generative medical big model based on the pre-training data set to obtain the corresponding base version big model; then fine-tunes the base version big model based on each fine-tuning data set to obtain the corresponding downstream task big model; finally, all downstream task big models are evaluated according to the comprehensive evaluation mechanism of expert + big model to obtain the corresponding model evaluation results. It can be seen that the present invention can provide a model training and evaluation mechanism for a generative medical big model. Based on this mechanism, not only the base big model of the generative medical big model can be obtained, but also the downstream task big model corresponding to each downstream task can be obtained, and the model performance of each downstream task big model can be effectively evaluated; the present invention can solve the problem of lack of big model training solutions in the cardiovascular disease subdivision field, and can also provide multiple types of task big models for this field through the training mechanism of the present invention.
[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present invention provides a method for processing a generative medical large model, the method comprising:
[0005] Building a generative medical big model based on a generative big language model;
[0006] Constructing a pre-training dataset based on medical domain knowledge and constructing corresponding fine-tuning datasets for various model downstream tasks based on cardiovascular comorbidity domain knowledge; the model downstream tasks include medical vocabulary query tasks, disease classification prediction tasks, disease treatment plan prediction tasks, and critical illness risk prediction tasks;
[0007] Pre-training the generative medical big model based on the pre-training data set to obtain a corresponding base version big model;
[0008] Fine-tune the base model based on each of the fine-tuning data sets to obtain a corresponding downstream task model;
[0009] All the downstream task models are evaluated to obtain corresponding model evaluation results.
[0010] Preferably, the generative medical big model is a generative big language model based on the Transformer model structure; the generative medical big model includes the T5 series model;
[0011] The medical vocabulary query task is a downstream model processing task for vocabulary definition query based on medical vocabulary names; the disease classification prediction task is a downstream model processing task for disease classification prediction based on detection information and / or inspection information and / or symptom description information; the disease treatment plan prediction task is a downstream model processing task for treatment plan prediction based on disease classification information and / or detection information and / or inspection information and / or symptom description information; the critical illness risk prediction task is a downstream model processing task for critical illness risk level prediction based on detection information and / or inspection information and / or symptom description information and / or historical medical record information.
[0012] Preferably, the construction of a pre-training dataset based on medical domain knowledge and the construction of corresponding fine-tuning datasets for various model downstream tasks based on cardiovascular comorbidity domain knowledge specifically include:
[0013] The pre-training dataset is constructed by collecting general medical dictionaries, textbooks, diagnosis and treatment guidelines, expert papers, industry literature and medical records in the medical field; and each of the fine-tuning datasets is constructed by collecting specialized medical dictionaries, textbooks, diagnosis and treatment guidelines, expert papers, industry literature and medical records in the field of cardiovascular comorbidities.
[0014] Preferably, the pre-training data set includes a medical vocabulary query task corpus, a disease classification prediction task corpus, a disease treatment plan prediction task corpus, and a critical illness risk prediction task corpus;
[0015] The medical vocabulary query task corpus is composed of a plurality of first task corpora; the first task corpora include first vocabulary name information and first vocabulary interpretation information;
[0016] The disease classification prediction task corpus is composed of multiple second task corpora; the second task corpus includes a first detection information set, a first inspection information set, a first symptom description information set and a first diagnosis report information; when the first detection information set is not empty, it is composed of one or more first detection information; when the first inspection information set is not empty, it is composed of one or more first inspection information; when the first symptom description information set is not empty, it is composed of one or more first symptom description information; the first diagnosis report information is composed of one or more first disease diagnosis types; the data format types of the first detection information and the first inspection information include text format and image format;
[0017] The disease treatment plan prediction task corpus is composed of multiple third task corpora; the third task corpus includes first disease type information, second detection information set, second inspection information set, second symptom description information set and first treatment plan set; when the second detection information set is not empty, it is composed of one or more second detection information; when the second inspection information set is not empty, it is composed of one or more second inspection information; when the second symptom description information set is not empty, it is composed of one or more second symptom description information; the first treatment plan set is composed of one or more first treatment plans, and each of the first treatment plans corresponds to a treatment type; the data format types of the second detection information and the second inspection information include text format and image format;
[0018] The critical illness risk prediction task corpus is composed of multiple fourth task corpora; the fourth task corpus includes a third detection information set, a third inspection information set, a third symptom description information set, a first historical medical record set and a first critical illness type and level diagnosis information; when the third detection information set is not empty, it is composed of one or more third detection information; when the third inspection information set is not empty, it is composed of one or more third inspection information; when the third symptom description information set is not empty, it is composed of one or more third symptom description information; when the first historical medical record set is not empty, it is composed of multiple first historical medical records, each of which includes at least a first historical time, a first historical diagnosis report, a first historical treatment plan and a first historical critical illness type and level diagnosis information; the data format types of the third detection information and the third inspection information include text format and image format.
[0019] Preferably, the fine-tuning data set corresponding to the medical vocabulary query task is composed of a plurality of first task fine-tuning corpora; the first task fine-tuning corpora include first question information and first answer information; the first question information includes a query instruction text for instructing the model to perform a vocabulary interpretation query according to the input query vocabulary name information and one or more first query vocabulary names; the first answer information is a corresponding first interpretation label text;
[0020] The fine-tuning data set corresponding to the disease classification prediction task is composed of a plurality of second task fine-tuning corpora; the second task fine-tuning corpora include second question information and second answer information; the second question information includes a disease classification prediction instruction text for instructing the model to perform disease classification prediction based on the input reference information and one or more first reference information; the information type of the first reference information includes detection information, inspection information and symptom description information; the data format type of the first reference information includes text format and image format; the second answer information is composed of one or more first disease type label texts;
[0021] The fine-tuning data set corresponding to the disease treatment plan prediction task is composed of multiple third task fine-tuning corpora; the third task fine-tuning corpora include third question information and third answer information; the third question information includes a treatment plan prediction instruction text for instructing the model to predict the disease treatment plan based on the input reference information and one or more second reference information; the information type of the second reference information includes disease type information, detection information, inspection information and symptom description information; the data format type of the second reference information includes text format and image format; the third answer information is a corresponding first treatment plan label text;
[0022] The fine-tuning data set corresponding to the critical illness risk prediction task is composed of multiple fourth task fine-tuning corpora; the fourth task fine-tuning corpora include fourth question information and fourth answer information; the fourth question information includes a critical illness prediction instruction text for instructing the model to predict the critical illness risk level according to the input reference information and one or more third reference information; the information types of the third reference information include detection information, inspection information, symptom description information and historical medical record information; when the information type of the third reference information is historical medical record information, it should be composed of at least 2 or more historical medical record texts; the data format types of the third reference information include text format and image format; the fourth answer information is a corresponding first critical illness type and level label text;
[0023] The question and answer information in the task fine-tuning corpus of all the fine-tuning datasets are related to the field of cardiovascular comorbidities.
[0024] Preferably, the pre-training of the generative medical big model based on the pre-training data set to obtain the corresponding base big model specifically includes:
[0025] Initializing the model parameters of the generative medical large model to obtain a corresponding first initial model;
[0026] Performing a first round of self-supervised pre-training on the first initial model according to the medical vocabulary query task corpus of the pre-training data set to obtain a corresponding first round pre-training model;
[0027] Performing a second round of self-supervised pre-training on the first round of pre-training model according to the disease classification prediction task corpus of the pre-training data set to obtain a corresponding second round of pre-training model;
[0028] Performing a third round of self-supervised pre-training on the second round pre-training model according to the disease treatment plan prediction task corpus of the pre-training data set to obtain a corresponding third round pre-training model;
[0029] Performing a fourth round of self-supervised pre-training on the first round pre-training model according to the critical illness risk prediction task corpus of the pre-training data set to obtain a corresponding fourth round pre-training model;
[0030] A first specified number of the first task corpus, the second task corpus, the third task corpus and the fourth task corpus are respectively extracted from the medical vocabulary query task corpus, the disease classification prediction task corpus, the disease treatment plan prediction task corpus and the critical illness risk prediction task corpus according to the principle of random extraction to form the corresponding first, second, third and fourth verification corpus sets; the first specified number is an integer greater than zero; the first verification corpus is composed of the first specified number of first verification corpus, and each of the first verification corpus corresponds to one first task corpus; the second verification corpus is composed of the first specified number of second verification corpus, and each of the second verification corpus corresponds to one second task corpus; the third verification corpus is composed of the first specified number of third verification corpus, and each of the third verification corpus corresponds to one third task corpus; the fourth verification corpus is composed of the first specified number of fourth verification corpus, and each of the fourth verification corpus corresponds to one fourth task corpus;
[0031] The fourth round of pre-training model is verified and modulated according to the first, second, third and fourth verification corpora to obtain the corresponding base version large model.
[0032] Furthermore, performing a first round of self-supervised pre-training on the first initial model according to the medical vocabulary query task corpus of the pre-training data set to obtain a corresponding first round pre-training model specifically includes:
[0033] Step 71, taking the first of the first task corpora in the medical vocabulary query task corpus as the corresponding current corpus;
[0034] Step 72, the corresponding first model input information is composed of a preset query instruction text template and the first vocabulary name information of the current corpus; and the remaining information in the first model input information except the query instruction text template is subjected to random mask replacement processing; and the first vocabulary interpretation information of the current corpus is extracted as the corresponding first model label information; the query instruction text template is an instruction text template used to instruct the model to perform vocabulary interpretation query according to the input query vocabulary name information;
[0035] Step 73, inputting the first model input information into the first initial model for model processing to obtain corresponding first model prediction information;
[0036] Step 74, bringing the first model prediction information and the first model label information into a preset first objective function and performing a round of parameter optimization on the first initial model in the direction of minimizing the objective function; and after this round of parameter optimization, identifying whether the current corpus is the last first task corpus of the medical vocabulary query task corpus; if so, go to step 75; if not, extracting the next first task corpus of the medical vocabulary query task corpus as the new current corpus and returning to step 72;
[0037] Step 75, solidify the model parameters of the first initial model to obtain the corresponding first round pre-training model.
[0038] Furthermore, performing a second round of self-supervised pre-training on the first round of pre-training model according to the disease classification prediction task corpus of the pre-training data set to obtain a corresponding second round of pre-training model specifically includes:
[0039] Step 81, taking the first of the second task corpus in the disease classification prediction task corpus as the corresponding current corpus;
[0040] Step 82, the preset disease classification prediction instruction text template and the first detection information set, the first inspection information set and the first symptom description information set of the current corpus form the corresponding second model input information; and perform random mask replacement processing on the remaining information in the second model input information except the disease classification prediction instruction text template; and extract the first diagnosis report information of the current corpus as the corresponding second model label information; the disease classification prediction instruction text template is an instruction text template used to instruct the model to perform disease classification prediction according to the input reference information;
[0041] Step 83, inputting the second model input information into the first round pre-training model for model processing to obtain corresponding second model prediction information;
[0042] Step 84, bringing the second model prediction information and the second model label information into the preset second objective function and performing a round of parameter optimization on the first round pre-training model in the direction of minimizing the objective function; and after the completion of this round of parameter optimization, identifying whether the current corpus is the last second task corpus of the disease classification prediction task corpus; if so, go to step 85; if not, extracting the next second task corpus of the disease classification prediction task corpus as the new current corpus and returning to step 82;
[0043] Step 85, solidify the model parameters of the first round of pre-training model to obtain the corresponding second round of pre-training model.
[0044] Furthermore, performing a third round of self-supervised pre-training on the second round pre-training model according to the disease treatment plan prediction task corpus of the pre-training data set to obtain a corresponding third round pre-training model specifically includes:
[0045] Step 91, taking the first third task corpus of the disease treatment plan prediction task corpus as the corresponding current corpus;
[0046] Step 92, the corresponding third model input information is composed of the preset treatment plan prediction instruction text template and the first disease type information, the second detection information set, the second inspection information set and the second symptom description information set of the current corpus; and the remaining information in the third model input information except the treatment plan prediction instruction text template is randomly masked and replaced; and the first treatment plan set of the current corpus is extracted as the corresponding third model label information; the treatment plan prediction instruction text template is an instruction text template used to instruct the model to perform disease classification prediction based on the input reference information;
[0047] Step 93, inputting the third model input information into the second round pre-training model for model processing to obtain corresponding third model prediction information;
[0048] Step 94, bringing the third model prediction information and the third model label information into the preset third objective function and performing a round of parameter optimization on the second round pre-training model in the direction of minimizing the objective function; and after the completion of this round of parameter optimization, identifying whether the current corpus is the last third task corpus of the disease treatment plan prediction task corpus; if so, go to step 95; if not, extracting the next third task corpus of the disease treatment plan prediction task corpus as the new current corpus and returning to step 92;
[0049] Step 95, solidify the model parameters of the second-round pre-training model to obtain the corresponding third-round pre-training model.
[0050] Further, performing a fourth round of self-supervised pre-training on the first round pre-training model according to the critical illness risk prediction task corpus of the pre-training data set to obtain a corresponding fourth round pre-training model specifically includes:
[0051] Step 101, taking the first fourth task corpus of the critical illness risk prediction task corpus as the corresponding current corpus;
[0052] Step 102, the corresponding fourth model input information is composed of a preset critical illness prediction instruction text template and the third detection information set, the third inspection information set, the third symptom description information set and the first historical medical record set of the current corpus; and the remaining information in the fourth model input information except the critical illness prediction instruction text template is subjected to random mask replacement processing; and the first critical illness type and level diagnosis information of the current corpus is extracted as the corresponding fourth model label information; the critical illness prediction instruction text template is an instruction text template used to instruct the model to predict the critical illness risk level according to the input reference information;
[0053] Step 103, inputting the fourth model input information into the third round pre-training model for model processing to obtain corresponding fourth model prediction information;
[0054] Step 104, bringing the fourth model prediction information and the fourth model label information into the preset fourth objective function and performing a round of parameter optimization on the third round pre-training model in the direction of minimizing the objective function; and after the completion of this round of parameter optimization, identifying whether the current corpus is the last fourth task corpus of the critical illness risk prediction task corpus; if so, go to step 105; if not, extracting the next fourth task corpus of the critical illness risk prediction task corpus as the new current corpus and returning to step 102;
[0055] Step 105, solidifying the model parameters of the third round of pre-training model to obtain the corresponding fourth round of pre-training model.
[0056] Furthermore, the verification and modulation of the fourth round of pre-training model according to the first, second, third and fourth verification corpora to obtain the corresponding base version large model specifically includes:
[0057] Step 111: each of the first verification corpora in the first verification corpus set is used as the corresponding current verification corpus; and the corresponding model input information x is composed of a preset query instruction text template and the first vocabulary name information of the current verification corpus. i=1,j ; and input information x to the model i=1,j The remaining information except the query instruction text template is subjected to random mask replacement processing; and the first vocabulary interpretation information of the current verification corpus is extracted as the corresponding model label information And the model is fed with information x i=1,j Input the fourth round of pre-training model for model processing to obtain the corresponding model prediction information y i=1,j ; i is the verification corpus index, 1≤i≤4, j is the corpus index, 1≤j≤N, N is the first specified number;
[0058] Step 112: each of the second verification corpora in the second verification corpus set is used as the corresponding current verification corpus; and the corresponding model input information x is composed of the preset disease classification prediction instruction text template and the first detection information set, the first inspection information set and the first symptom description information set of the current verification corpus. i=2,j ; and input information x to the model i=2,j The remaining information except the disease classification prediction instruction text template is randomly masked and replaced; and the first diagnosis report information of the current verification corpus is extracted as the corresponding model label information And the model is fed with information x i=2,j Input the fourth round of pre-training model for model processing to obtain the corresponding model prediction information yi=2,j ;
[0059] Step 113, each of the third verification corpora of the third verification corpus set is used as the corresponding current verification corpus; and the corresponding model input information x is composed of the preset treatment plan prediction instruction text template and the first disease type information, the second detection information set, the second inspection information set and the second symptom description information set of the current verification corpus. i=3,j ; and input information x to the model i=3,j The remaining information except the treatment plan prediction instruction text template is randomly masked and replaced; and the first treatment plan set of the current verification corpus is extracted as the corresponding model label information And the model is fed with information x i=3,j Input the fourth round of pre-training model for model processing to obtain the corresponding model prediction information y i=3,j ;
[0060] Step 114, each of the fourth verification corpora of the fourth verification corpus set is used as the corresponding current verification corpus; and the corresponding model input information x is composed of the preset critical illness prediction instruction text template and the third detection information set, the third inspection information set, the third symptom description information set and the first historical medical record set of the current verification corpus. i=4,j ; and input information x to the model i=4,j The remaining information except the critical illness prediction instruction text template is randomly masked and replaced; and the first critical illness type and grade diagnosis information of the current verification corpus is extracted as the corresponding model label information And the model is fed with information x i=4,j Input the fourth round of pre-training model for model processing to obtain the corresponding model prediction information y i=4,j ;
[0061] Step 115: predict information y from N models corresponding to each corpus index i i,j The corresponding model prediction vector Y i , and the N model label information corresponding to each corpus index i The corresponding model prediction vector And the obtained multiple pairs of the model prediction vectors Y i and the model prediction vector Bring in the preset model overall loss function L total Calculate and obtain the corresponding model loss value;
[0062] in,
[0063]
[0064] I is the total number of validation corpus, the default value is 4,
[0065] α i=1、2、3、4 They are the four preset weighting parameters,
[0066] L i=1、2、3、4 are the preset first, second, third and fourth loss functions respectively,
[0067] The first loss function L1 includes an L1 loss function and an L2 loss function.
[0068] The second loss function L2 includes a cross entropy loss function,
[0069] The third loss function L3 includes an L1 loss function and an L2 loss function.
[0070] The third loss function L4 includes a cross entropy loss function;
[0071] Step 116, identifying whether the model loss value satisfies a preset convergence loss value range; if so, proceeding to step 117; if not, moving towards making the overall model loss function L total Perform a round of parameter optimization on the fourth round pre-training model in the direction of reaching the minimum value, and return to step 111 for re-verification after the end of this round of parameter optimization;
[0072] Step 117, solidify the model parameters of the fourth round of pre-training model to obtain the corresponding base model.
[0073] Preferably, fine-tuning the base model based on each of the fine-tuning data sets to obtain a corresponding downstream task model specifically includes:
[0074] The model parameters of the base plate large model are replicated four times to obtain corresponding first, second, third and fourth base plate large models;
[0075] The fine-tuning data sets corresponding to the medical vocabulary query task, the disease classification prediction task, the disease treatment plan prediction task, and the critical illness risk prediction task are recorded as corresponding first, second, third, and fourth fine-tuning data sets;
[0076] The first task fine-tuning corpus of the first fine-tuning data set is traversed; and during the traversal, the first task fine-tuning corpus currently traversed is used as the corresponding current fine-tuning corpus; and the first question information and the first answer information of the current fine-tuning corpus are used as the corresponding current model input information and current model label information; and the current model input information is input into the first base version large model for model processing to obtain the corresponding current model prediction information; and the current model prediction information and the current model label information are brought into the preset fifth loss function, and based on the preset large model fine-tuning optimization mechanism, the model parameters of the first base version large model are fine-tuned in a direction to minimize the loss value of the fifth loss function; and at the end of the traversal, the model parameters of the first base version large model are solidified once to obtain the downstream task large model corresponding to the medical vocabulary query task; the large model fine-tuning optimization mechanism includes the LoRA optimization mechanism and the Adapter optimization mechanism; the fifth loss function includes the L1 loss function and the L2 loss function;
[0077] The second task fine-tuning corpus of the second fine-tuning data set is traversed; and during the traversal, the second task fine-tuning corpus currently traversed is used as the corresponding current fine-tuning corpus; and the second question information and the second answer information of the current fine-tuning corpus are used as the corresponding current model input information and the current model label information; and the current model input information is input into the second base version large model for model processing to obtain the corresponding current model prediction information; and the current model prediction information and the current model label information are brought into the preset sixth loss function, and based on the large model fine-tuning optimization mechanism, a round of fine-tuning is performed on the model parameters of the second base version large model in the direction of minimizing the loss value of the sixth loss function; and at the end of the traversal, the model parameters of the second base version large model are solidified once to obtain the downstream task large model corresponding to the disease classification prediction task; the sixth loss function includes a cross entropy loss function;
[0078] The third task fine-tuning corpus of the third fine-tuning data set is traversed; and during the traversal, the third task fine-tuning corpus currently traversed is used as the corresponding current fine-tuning corpus; and the third question information and the third answer information of the current fine-tuning corpus are used as the corresponding current model input information and the current model label information; and the current model input information is input into the third base version large model for model processing to obtain the corresponding current model prediction information; and the current model prediction information and the current model label information are brought into the preset seventh loss function, and based on the large model fine-tuning optimization mechanism, a round of fine-tuning is performed on the model parameters of the third base version large model in the direction of minimizing the loss value of the seventh loss function; and at the end of the traversal, the model parameters of the third base version large model are solidified once to obtain the downstream task large model corresponding to the disease treatment plan prediction task; the seventh loss function includes an L1 loss function and an L2 loss function;
[0079] The fourth task fine-tuning corpus of the fourth fine-tuning data set is traversed; and during the traversal, the fourth task fine-tuning corpus currently traversed is used as the corresponding current fine-tuning corpus; and the fourth question information and the fourth answer information of the current fine-tuning corpus are used as the corresponding current model input information and the current model label information; and the current model input information is input into the fourth base version large model for model processing to obtain the corresponding current model prediction information; and the current model prediction information and the current model label information are brought into the preset eighth loss function, and based on the large model fine-tuning optimization mechanism, a round of fine-tuning is performed on the model parameters of the fourth base version large model in the direction of minimizing the loss value of the eighth loss function; and at the end of the traversal, the model parameters of the fourth base version large model are solidified once to obtain the downstream task large model corresponding to the critical risk prediction task; the eighth loss function includes a cross entropy loss function.
[0080] Preferably, the evaluating of all the downstream task large models to obtain corresponding model evaluation results specifically includes:
[0081] Recruiting a second specified number of experts in the field of cardiovascular medicine to form a first expert group; and selecting another mature generative large language model applied in the field of cardiovascular medicine as the corresponding first evaluation model; the first expert group is composed of the second specified number of first experts; the second specified number is an integer greater than zero; the model structure of the first evaluation model is significantly different from the model structure of the generative large language model, and the model structure of the first evaluation model includes a GPT model structure and a BERT model structure;
[0082] Each of the first experts in the first expert group raises a third specified number of task processing questions a for each of the downstream task large models. k,z,q And get the corresponding self-model output result b k,z,q , and output the result b of each self-model according to the preset M-level scoring standard k,z,q Score and get the corresponding expert manual score c k,z,q ; 1≤k≤K, K is the total number of the downstream task large models, the default is 4; 1≤z≤Z, Z is the second specified number; 1≤q≤Q, Q is the third specified number; the third specified number is an integer greater than zero; M is an integer greater than zero, the M-level scoring standard includes level one, level two, and so on until level M; the output result score c k,z,q The value range of is an integer between 1 and M;
[0083] Each of the tasks described above will be processed as a k,z,q Input the first evaluation model to perform model processing to obtain the corresponding evaluation model output result And output the results for each evaluation model The corresponding self-model output result b k,z,q The similarity of is estimated to get the corresponding similarity d k,z,q ; and each of the similarities d k,z,q The product of M is used as the corresponding model comparison score The similarity d k,z,q The value range is a real number range between 0 and 1; the model comparison score The value range of is a real number between 0 and M;
[0084] According to all the expert manual scores c corresponding to each of the downstream task large models k,z,q Compare the scores with the model Perform the corresponding model evaluation to obtain the corresponding evaluation score CM k ;in, β 1、2 are two preset weighting parameters respectively; the evaluation score CM k One-to-one correspondence with the downstream task model;
[0085] And all the evaluation scores CM obtained k The composition corresponds to the model evaluation result.
[0086] A second aspect of an embodiment of the present invention provides a device for implementing the method for processing a generative medical big model as described in the first aspect, the device comprising: a model construction module, a data set construction module, a base version big model training module, a downstream task big model fine-tuning module and a model evaluation module;
[0087] The model building module is used to build a generative medical big model based on the generative big language model;
[0088] The data set construction module is used to construct a pre-training data set based on medical domain knowledge and to construct corresponding fine-tuning data sets for various model downstream tasks based on cardiovascular comorbidity domain knowledge; the model downstream tasks include medical vocabulary query tasks, disease classification prediction tasks, disease treatment plan prediction tasks, and critical illness risk prediction tasks;
[0089] The base model training module is used to pre-train the generative medical model based on the pre-training data set to obtain the corresponding base model;
[0090] The downstream task large model fine-tuning module is used to fine-tune the base large model based on each of the fine-tuning data sets to obtain the corresponding downstream task large model;
[0091] The model evaluation module is used to evaluate all the downstream task large models to obtain corresponding model evaluation results.
[0092] A third aspect of an embodiment of the present invention provides an electronic device, including: a memory, a processor, and a transceiver;
[0093] The processor is used to be coupled to the memory, read and execute instructions in the memory, so as to implement the method steps described in the first aspect above;
[0094] The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
[0095] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions. When the computer instructions are executed by a computer, the computer executes the instructions of the method described in the first aspect above.
[0096] The embodiment of the present invention provides a processing method, device, electronic device and computer-readable storage medium for a generative medical big model. As can be seen from the above content, the embodiment of the present invention first constructs a generative medical big model based on a type of generative big language model, and plans multiple model downstream tasks (medical vocabulary query task, disease classification prediction task, disease treatment plan prediction task and critical illness risk prediction task) for the generative medical big model; then constructs a pre-training data set based on medical field knowledge and constructs corresponding fine-tuning data sets for various model downstream tasks based on cardiovascular comorbidity field knowledge; then pre-trains the generative medical big model based on the pre-training data set to obtain the corresponding base version big model; then fine-tunes the base version big model based on each fine-tuning data set to obtain the corresponding downstream task big model; finally, all downstream task big models are evaluated according to the comprehensive evaluation mechanism of expert + big model to obtain the corresponding model evaluation results. It can be seen that the embodiment of the present invention can provide a model training and evaluation mechanism for a generative medical big model. Based on this mechanism, not only the base big model of the generative medical big model can be obtained, but also the downstream task big model corresponding to each downstream task can be obtained, and the model performance of each downstream task big model can be effectively evaluated; through the embodiment of the present invention, not only the problem of the lack of big model training solutions in the cardiovascular disease subdivision field is solved, but also a multi-category task big model is provided for this field. BRIEF DESCRIPTION OF THE DRAWINGS
[0097] Figure 1 A schematic diagram of a method for processing a generative medical large model provided in the first embodiment of the present invention;
[0098] Figure 2 A module structure diagram of a processing device for a generative medical large model provided in the second embodiment of the present invention;
[0099] Figure 3 A schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0100] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0101] Embodiment 1 of the present invention provides a method for processing a generative medical large model, such as Figure 1 As shown in the schematic diagram of a processing method of a generative medical large model provided in the first embodiment of the present invention, the method mainly includes the following steps:
[0102] Step 1: Build a generative medical big model based on the generative big language model.
[0103] Here, the generative medical big model of the embodiment of the present invention is a type of generative big language model implemented based on the Transformer model structure; the generative medical big model includes at least the T5 series model.
[0104] Step 2: construct a pre-training dataset based on medical domain knowledge and construct corresponding fine-tuning datasets for various model downstream tasks based on cardiovascular comorbidity domain knowledge;
[0105] Specifically: a pre-training data set is constructed by collecting general medical dictionaries, textbooks, diagnosis and treatment guidelines, expert papers, industry literature, and medical records in the medical field; and each fine-tuning data set is constructed by collecting specialized medical dictionaries, textbooks, diagnosis and treatment guidelines, expert papers, industry literature, and medical records in the field of cardiovascular comorbidities.
[0106] Here, the pre-training data set obtained by data collection and sorting in the embodiment of the present invention includes a medical vocabulary query task corpus, a disease classification prediction task corpus, a disease treatment plan prediction task corpus and a critical illness risk prediction task corpus; wherein,
[0107] 1) The medical vocabulary query task corpus is composed of a plurality of first task corpora; the first task corpora include first vocabulary name information and first vocabulary interpretation information;
[0108] 2) The disease classification prediction task corpus is composed of multiple second task corpora; the second task corpus includes a first detection information set, a first inspection information set, a first symptom description information set and a first diagnosis report information; when the first detection information set is not empty, it is composed of one or more first detection information; when the first inspection information set is not empty, it is composed of one or more first inspection information; when the first symptom description information set is not empty, it is composed of one or more first symptom description information; the first diagnosis report information is composed of one or more first disease diagnosis types; the data format types of the first detection information and the first inspection information include text format and image format;
[0109] 3) The disease treatment plan prediction task corpus is composed of multiple third task corpora; the third task corpus includes first disease type information, second detection information set, second inspection information set, second symptom description information set and first treatment plan set; when the second detection information set is not empty, it is composed of one or more second detection information; when the second inspection information set is not empty, it is composed of one or more second inspection information; when the second symptom description information set is not empty, it is composed of one or more second symptom description information; the first treatment plan set is composed of one or more first treatment plans, and each first treatment plan corresponds to a treatment type; the data format types of the second detection information and the second inspection information include text format and image format;
[0110] 4) The critical illness risk prediction task corpus is composed of multiple fourth task corpora; the fourth task corpus includes a third detection information set, a third inspection information set, a third symptom description information set, a first historical medical record set and a first critical illness type and level diagnosis information; when the third detection information set is not empty, it is composed of one or more third detection information; when the third inspection information set is not empty, it is composed of one or more third inspection information; when the third symptom description information set is not empty, it is composed of one or more third symptom description information; when the first historical medical record set is not empty, it is composed of multiple first historical medical records, each first historical medical record at least includes a first historical time, a first historical diagnosis report, a first historical treatment plan and a first historical critical illness type and level diagnosis information; the data format types of the third detection information and the third inspection information include text format and image format.
[0111] In addition, the embodiment of the present invention also plans multiple model downstream tasks for the generative medical big model, specifically including: medical vocabulary query task, disease classification prediction task, disease treatment plan prediction task and critical illness risk prediction task; among them, 1) the medical vocabulary query task is a downstream model processing task for vocabulary interpretation query based on medical vocabulary names; 2) the disease classification prediction task is a downstream model processing task for disease classification prediction based on detection information and / or inspection information and / or symptom description information; 3) the disease treatment plan prediction task is a downstream model processing task for treatment plan prediction based on disease classification information and / or detection information and / or inspection information and / or symptom description information; 4) the critical illness risk prediction task is a downstream model processing task for critical illness risk level prediction based on detection information and / or inspection information and / or symptom description information and / or historical medical record information.
[0112] The fine-tuning data sets constructed by the embodiment of the present invention for the downstream tasks of each model mentioned above through data collection and organization are specifically:
[0113] 1) The fine-tuning dataset corresponding to the medical vocabulary query task is composed of a plurality of first task fine-tuning corpora; the first task fine-tuning corpora include first question information and first answer information; the first question information includes a query instruction text for instructing the model to perform a vocabulary interpretation query according to the input query vocabulary name information and one or more first query vocabulary names; the first answer information is a corresponding first interpretation label text;
[0114] 2) The fine-tuning data set corresponding to the disease classification prediction task is composed of multiple second task fine-tuning corpora; the second task fine-tuning corpora include second question information and second answer information; the second question information includes a disease classification prediction instruction text for instructing the model to perform disease classification prediction based on the input reference information and one or more first reference information; the information type of the first reference information includes detection information, inspection information and symptom description information; the data format type of the first reference information includes text format and image format; the second answer information is composed of one or more first disease type label texts;
[0115] 3) The fine-tuning data set corresponding to the disease treatment plan prediction task is composed of multiple third task fine-tuning corpora; the third task fine-tuning corpora include third question information and third answer information; the third question information includes a treatment plan prediction instruction text for instructing the model to predict the disease treatment plan according to the input reference information and one or more second reference information; the information type of the second reference information includes disease type information, detection information, inspection information and symptom description information; the data format type of the second reference information includes text format and image format; the third answer information is a corresponding first treatment plan label text;
[0116] 4) The fine-tuning data set corresponding to the critical illness risk prediction task is composed of multiple fourth task fine-tuning corpora; the fourth task fine-tuning corpora include fourth question information and fourth answer information; the fourth question information includes a critical illness prediction instruction text for instructing the model to predict the critical illness risk level according to the input reference information and one or more third reference information; the information type of the third reference information includes detection information, inspection information, symptom description information and historical medical record information; when the information type of the third reference information is historical medical record information, it should be composed of at least 2 or more historical medical record texts; the data format type of the third reference information includes text format and image format; the fourth answer information is a corresponding first critical illness type and level label text;
[0117] It should be noted that the questions and answers in the task fine-tuning corpus of all fine-tuning datasets are related to the field of cardiovascular comorbidities.
[0118] Step 3, pre-training the generative medical big model based on the pre-training data set to obtain the corresponding base version big model;
[0119] Specifically, it includes: step 31, initializing the model parameters of the generative medical large model to obtain a corresponding first initial model;
[0120] Step 32, performing a first round of self-supervised pre-training on the first initial model according to the medical vocabulary query task corpus of the pre-training data set to obtain a corresponding first round pre-training model;
[0121] Specifically, it includes: step 321, taking the first first task corpus of the medical vocabulary query task corpus as the corresponding current corpus;
[0122] Step 322, the first model input information is formed by the preset query instruction text template and the first vocabulary name information of the current corpus; and the remaining information in the first model input information except the query instruction text template is subjected to random mask replacement processing; and the first vocabulary interpretation information of the current corpus is extracted as the corresponding first model label information;
[0123] The query instruction text template is an instruction text template used to instruct the model to perform a vocabulary interpretation query based on the input query vocabulary name information;
[0124] Step 323, inputting the first model input information into the first initial model for model processing to obtain corresponding first model prediction information;
[0125] Step 324, bringing the first model prediction information and the first model label information into the preset first objective function and performing a round of parameter optimization on the first initial model in the direction of minimizing the objective function; and after the completion of this round of parameter optimization, identifying whether the current corpus is the last first task corpus of the medical vocabulary query task corpus; if so, turning to step 325; if not, extracting the next first task corpus of the medical vocabulary query task corpus as the new current corpus and returning to step 322;
[0126] Here, the first objective function is a preset objective function for optimizing the parameters of the entire model;
[0127] Step 325, solidifying the model parameters of the first initial model to obtain the corresponding first round pre-training model;
[0128] Step 33, performing a second round of self-supervised pre-training on the first round pre-training model according to the disease classification prediction task corpus of the pre-training data set to obtain a corresponding second round pre-training model;
[0129] Specifically, it includes: step 331, taking the first second task corpus of the disease classification prediction task corpus as the corresponding current corpus;
[0130] Step 332, the preset disease classification prediction instruction text template and the first detection information set, the first inspection information set and the first symptom description information set of the current corpus form the corresponding second model input information; and perform random mask replacement processing on the remaining information in the second model input information except the disease classification prediction instruction text template; and extract the first diagnosis report information of the current corpus as the corresponding second model label information;
[0131] Among them, the disease classification prediction instruction text template is an instruction text template used to instruct the model to perform disease classification prediction based on the input reference information;
[0132] Step 333, inputting the second model input information into the first round pre-training model for model processing to obtain corresponding second model prediction information;
[0133] Step 334, bringing the second model prediction information and the second model label information into the preset second objective function and performing a round of parameter optimization on the first round pre-training model in the direction of minimizing the objective function; and after the completion of this round of parameter optimization, identifying whether the current corpus is the last second task corpus of the disease classification prediction task corpus; if so, go to step 335; if not, extract the next second task corpus of the disease classification prediction task corpus as the new current corpus and return to step 332;
[0134] Here, the second objective function is a preset objective function for optimizing the parameters of the entire model;
[0135] Step 335, solidifying the model parameters of the first round of pre-training model to obtain the corresponding second round of pre-training model;
[0136] Step 34, performing a third round of self-supervised pre-training on the second round pre-training model according to the disease treatment plan prediction task corpus of the pre-training data set to obtain a corresponding third round pre-training model;
[0137] Specifically, it includes: step 341, taking the first third task corpus of the disease treatment plan prediction task corpus as the corresponding current corpus;
[0138] Step 342, the corresponding third model input information is composed of the preset treatment plan prediction instruction text template and the first disease type information, the second detection information set, the second inspection information set, and the second symptom description information set of the current corpus; and the remaining information in the third model input information except the treatment plan prediction instruction text template is subjected to random mask replacement processing; and the first treatment plan set of the current corpus is extracted as the corresponding third model label information;
[0139] Among them, the treatment plan prediction instruction text template is an instruction text template used to instruct the model to perform disease classification prediction based on the input reference information;
[0140] Step 343, inputting the third model input information into the second round pre-training model for model processing to obtain corresponding third model prediction information;
[0141] Step 344, bringing the third model prediction information and the third model label information into the preset third objective function and performing a round of parameter optimization on the second round pre-training model in the direction of minimizing the objective function; and after the completion of this round of parameter optimization, identifying whether the current corpus is the last third task corpus of the disease treatment plan prediction task corpus; if so, go to step 345; if not, extract the next third task corpus of the disease treatment plan prediction task corpus as the new current corpus and return to step 342;
[0142] Here, the third objective function is a preset objective function for optimizing the parameters of the entire model;
[0143] Step 345, solidifying the model parameters of the second round pre-training model to obtain the corresponding third round pre-training model;
[0144] Step 35, performing a fourth round of self-supervised pre-training on the first round pre-training model according to the critical illness risk prediction task corpus of the pre-training data set to obtain a corresponding fourth round pre-training model;
[0145] Specifically, it includes: step 351, taking the first fourth task corpus of the critical illness risk prediction task corpus as the corresponding current corpus;
[0146] Step 352, the corresponding fourth model input information is composed of the preset critical illness prediction instruction text template and the third detection information set, the third inspection information set, the third symptom description information set and the first historical medical record set of the current corpus; and the remaining information in the fourth model input information except the critical illness prediction instruction text template is subjected to random mask replacement processing; and the first critical illness type and grade diagnosis information of the current corpus is extracted as the corresponding fourth model label information;
[0147] Among them, the critical illness prediction instruction text template is an instruction text template used to instruct the model to predict the critical illness risk level according to the input reference information;
[0148] Step 353, inputting the fourth model input information into the third round pre-training model for model processing to obtain corresponding fourth model prediction information;
[0149] Step 354, bringing the fourth model prediction information and the fourth model label information into the preset fourth objective function and performing a round of parameter optimization on the third round pre-training model in the direction of minimizing the objective function; and after the completion of this round of parameter optimization, identifying whether the current corpus is the last fourth task corpus of the critical risk prediction task corpus; if so, go to step 355; if not, extract the next fourth task corpus of the critical risk prediction task corpus as the new current corpus and return to step 352;
[0150] Here, the fourth objective function is a preset objective function for optimizing the parameters of the entire model;
[0151] Step 355, solidifying the model parameters of the third round of pre-training model to obtain the corresponding fourth round of pre-training model;
[0152] Step 36, extracting a first specified number of first task corpora, second task corpora, third task corpora, and fourth task corpora from each of the medical vocabulary query task corpus, the disease classification prediction task corpus, the disease treatment plan prediction task corpus, and the critical illness risk prediction task corpus according to the random extraction principle to form corresponding first, second, third, and fourth verification corpora;
[0153] Among them, the first specified number is an integer greater than zero; the first verification corpus set consists of a first specified number of first verification corpora, and each first verification corpus corresponds to a first task corpus; the second verification corpus set consists of a first specified number of second verification corpora, and each second verification corpus corresponds to a second task corpus; the third verification corpus set consists of a first specified number of third verification corpora, and each third verification corpus corresponds to a third task corpus; the fourth verification corpus set consists of a first specified number of fourth verification corpora, and each fourth verification corpus corresponds to a fourth task corpus;
[0154] Step 37, verify and modulate the fourth round of pre-training model according to the first, second, third and fourth verification corpora to obtain the corresponding base version large model;
[0155] Specifically, it includes: step 371, taking each first verification corpus of the first verification corpus set as the corresponding current verification corpus; and forming the corresponding model input information x by the preset query instruction text template and the first vocabulary name information of the current verification corpus. i=1,j ; and input information x to the model i=1,j The rest of the information except the query instruction text template is randomly masked and replaced; and the first word interpretation information of the current verification corpus is extracted as the corresponding model label information And input the model into the information x i=1,jInput the fourth round of pre-training model for model processing to obtain the corresponding model prediction information y i=1,j ;
[0156] Where i is the verification corpus index, 1≤i≤4, j is the corpus index, 1≤j≤N, and N is the first specified number;
[0157] Step 372: each second verification corpus of the second verification corpus set is used as the corresponding current verification corpus; and the corresponding model input information x is composed of the preset disease classification prediction instruction text template and the first detection information set, the first inspection information set and the first symptom description information set of the current verification corpus. i=2,j ; and input information x to the model i=2,j The rest of the information except the disease classification prediction instruction text template is randomly masked and replaced; and the first diagnosis report information of the current verification corpus is extracted as the corresponding model label information And input the model into the information x i=2,j Input the fourth round of pre-training model for model processing to obtain the corresponding model prediction information y i=2,j ;
[0158] Step 373: each third verification corpus of the third verification corpus set is used as the corresponding current verification corpus; and the corresponding model input information x is composed of the preset treatment plan prediction instruction text template and the first disease type information, the second detection information set, the second inspection information set, and the second symptom description information set of the current verification corpus. i=3,j ; and input information x to the model i=3,j The rest of the information except the treatment plan prediction instruction text template is randomly masked and replaced; and the first treatment plan set of the current verification corpus is extracted as the corresponding model label information And input the model into the information x i=3,j Input the fourth round of pre-training model for model processing to obtain the corresponding model prediction information y i=3,j ;
[0159] Step 374: each fourth verification corpus of the fourth verification corpus set is used as the corresponding current verification corpus; and the corresponding model input information x is composed of the preset critical illness prediction instruction text template and the third detection information set, the third inspection information set, the third symptom description information set and the first historical medical record set of the current verification corpus. i=4,j ; and input information x to the model i=4,j The rest of the information except the critical illness prediction instruction text template is randomly masked and replaced; and the first critical illness type and grade diagnosis information of the current verification corpus is extracted as the corresponding model label information And input the model into the information x i=4,jInput the fourth round of pre-training model for model processing to obtain the corresponding model prediction information y i=4,j ;
[0160] Step 375: predict information y from N models corresponding to each corpus index i i,j The corresponding model prediction vector Y i , and the N model label information corresponding to each corpus index i The corresponding model prediction vector And the obtained multiple pairs of model prediction vectors Y i and the model prediction vector Bring in the preset model overall loss function L total Calculate and obtain the corresponding model loss value;
[0161] in,
[0162]
[0163] I is the total number of validation corpus, the default value is 4,
[0164] α i=1、2、3、4 They are the four preset weighting parameters,
[0165] L i=1、2、3、4 are the preset first, second, third and fourth loss functions respectively,
[0166] The first loss function L1 includes L1 loss function and L2 loss function.
[0167] The second loss function L2 includes the cross entropy loss function,
[0168] The third loss function L3 includes the L1 loss function and the L2 loss function.
[0169] The third loss function L4 includes a cross entropy loss function;
[0170] Step 376, identify whether the model loss value meets the preset convergence loss value range; if it does, go to step 377; if not, move towards making the overall model loss function L total Perform a round of parameter optimization on the fourth round pre-training model in the direction of reaching the minimum value, and return to step 371 for re-verification after the completion of this round of parameter optimization;
[0171] Here, the convergence loss value range is a pre-set loss value range;
[0172] Step 377, solidify the model parameters of the fourth round of pre-training model to obtain the corresponding base model.
[0173] Step 4: Fine-tune the base model based on each fine-tuning dataset to obtain the corresponding downstream task model;
[0174] Specifically, it includes: step 41, performing four parameter replications on the model parameters of the base plate large model to obtain corresponding first, second, third and fourth base plate large models;
[0175] Step 42, recording the fine-tuning data sets corresponding to the medical vocabulary query task, the disease classification prediction task, the disease treatment plan prediction task, and the critical illness risk prediction task as the corresponding first, second, third, and fourth fine-tuning data sets;
[0176] Step 43, traverse the first task fine-tuning corpus of the first fine-tuning data set; and during the traversal, use the currently traversed first task fine-tuning corpus as the corresponding current fine-tuning corpus; and use the first question information and the first answer information of the current fine-tuning corpus as the corresponding current model input information and current model label information; and input the current model input information into the first base version large model for model processing to obtain the corresponding current model prediction information; and bring the current model prediction information and the current model label information into the preset fifth loss function, and based on the preset large model fine-tuning optimization mechanism, perform a round of fine-tuning on the model parameters of the first base version large model in the direction of minimizing the loss value of the fifth loss function; and at the end of the traversal, solidify the model parameters of the first base version large model to obtain the downstream task large model corresponding to the medical vocabulary query task;
[0177] Among them, the large model fine-tuning optimization mechanism includes the LoRA optimization mechanism and the Adapter optimization mechanism; the fifth loss function includes the L1 loss function and the L2 loss function;
[0178] Step 44, traverse the second task fine-tuning corpus of the second fine-tuning data set; and during the traversal, use the currently traversed second task fine-tuning corpus as the corresponding current fine-tuning corpus; and use the second question information and the second answer information of the current fine-tuning corpus as the corresponding current model input information and current model label information; and input the current model input information into the second base version large model for model processing to obtain the corresponding current model prediction information; and bring the current model prediction information and the current model label information into the preset sixth loss function, and based on the large model fine-tuning optimization mechanism, perform a round of fine-tuning on the model parameters of the second base version large model in the direction of minimizing the loss value of the sixth loss function; and at the end of the traversal, solidify the model parameters of the second base version large model once to obtain the downstream task large model corresponding to the disease classification prediction task;
[0179] Among them, the sixth loss function includes a cross entropy loss function;
[0180] Step 45, traverse the third task fine-tuning corpus of the third fine-tuning data set; and during the traversal, use the third task fine-tuning corpus currently traversed as the corresponding current fine-tuning corpus; and use the third question information and the third answer information of the current fine-tuning corpus as the corresponding current model input information and current model label information; and input the current model input information into the third base version large model for model processing to obtain the corresponding current model prediction information; and bring the current model prediction information and the current model label information into the preset seventh loss function, and based on the large model fine-tuning optimization mechanism, perform a round of fine-tuning on the model parameters of the third base version large model in the direction of minimizing the loss value of the seventh loss function; and at the end of the traversal, solidify the model parameters of the third base version large model once to obtain the downstream task large model corresponding to the disease treatment plan prediction task;
[0181] Among them, the seventh loss function includes L1 loss function and L2 loss function;
[0182] Step 46, traverse the fourth task fine-tuning corpus of the fourth fine-tuning data set; and during the traversal, use the fourth task fine-tuning corpus currently traversed as the corresponding current fine-tuning corpus; and use the fourth question information and the fourth answer information of the current fine-tuning corpus as the corresponding current model input information and current model label information; and input the current model input information into the fourth base version large model for model processing to obtain the corresponding current model prediction information; and bring the current model prediction information and the current model label information into the preset eighth loss function, and based on the large model fine-tuning optimization mechanism, perform a round of fine-tuning on the model parameters of the fourth base version large model in the direction of minimizing the loss value of the eighth loss function; and at the end of the traversal, solidify the model parameters of the fourth base version large model once to obtain the downstream task large model corresponding to the critical risk prediction task;
[0183] Among them, the eighth loss function includes a cross entropy loss function.
[0184] Step 5: Evaluate all downstream task models to obtain corresponding model evaluation results;
[0185] Specifically, it includes: step 51, recruiting a second specified number of experts in the field of cardiovascular medicine to form a first expert group; and selecting another mature generative large language model applied in the field of cardiovascular medicine as the corresponding first evaluation model;
[0186] The first expert group is composed of a second specified number of first experts; the second specified number is an integer greater than zero; the model structure of the first evaluation model is significantly different from the model structure of the generative large language model, and the model structure of the first evaluation model includes a GPT model structure and a BERT model structure;
[0187] Step 52: each first expert in the first expert group proposes a third specified number of task processing questions a to each downstream task large model. k,z,q And get the corresponding self-model output result b k,z,q , and output the result b of each self-model according to the preset M-level scoring standard k,z,q Score and get the corresponding expert manual score c k,z,q ;
[0188] Among them, 1≤k≤K, K is the total number of downstream task large models, the default is 4; 1≤z≤Z, Z is the second specified number; 1≤q≤Q, Q is the third specified number; the third specified number is an integer greater than zero; M is an integer greater than zero, and the M-level scoring standard includes level one, level two, and so on until level M; the output result score c k,z,q The value range of is an integer between 1 and M;
[0189] Step 53: each task processing problem a k,z,q Input the first evaluation model for model processing to obtain the corresponding evaluation model output result And output the results for each evaluation model And the corresponding self-model output result b k,z,q The similarity of is estimated to get the corresponding similarity d k,z,q ; and each similarity d k,z,q The product of M is used as the corresponding model comparison score
[0190] Among them, the similarity d k,z,q The value range is a real number between 0 and 1; model comparison score The value range of is a real number between 0 and M;
[0191] Step 55: According to the manual scores of all experts corresponding to the large models of each downstream task, k,z,q Comparison score with the model Perform the corresponding model evaluation to obtain the corresponding evaluation score CM k ;
[0192] in, β 1、2 They are two preset weighted parameters; the evaluation score CM k One-to-one correspondence with the downstream task model;
[0193] Step 56, and all the evaluation scores CM obtained k The corresponding model evaluation results.
[0194] Here, the embodiment of the present invention sets a corresponding evaluation score threshold H for each downstream task model in advance.k ; After obtaining the model evaluation results, each evaluation score CM k Whether it exceeds the corresponding evaluation score threshold H k Identification is performed, and if it exceeds, the corresponding downstream task large model is recorded as a high-availability model; if it does not exceed, the corresponding downstream task large model is recorded as a low-availability model. For each downstream task large model marked as a low-availability model, the embodiment of the present invention will further fine-tune the current downstream task large model based on the corresponding training steps 43, 44, 45 or 46 in the aforementioned step 4, and re-evaluate the fine-tuned downstream task large model through step 5, and mark the current downstream task large model as a high / low-availability model again based on the evaluation score, until the current downstream task large model is finally marked as a high-availability model. For each downstream task large model marked as a high-availability model, the embodiment of the present invention will open it to users as an open model.
[0195] Figure 2 This is a module structure diagram of a generative medical large model processing device provided in the second embodiment of the present invention. The device is a terminal device or server that implements the aforementioned method embodiment, and can also be a device that enables the aforementioned terminal device or server to implement the aforementioned method embodiment. For example, the device can be a device or chip system of the aforementioned terminal device or server. Figure 2 As shown, the device includes: a model construction module 201, a data set construction module 202, a base model training module 203, a downstream task model fine-tuning module 204 and a model evaluation module 205.
[0196] The model building module 201 is used to build a generative medical big model based on the generative big language model.
[0197] The data set construction module 202 is used to construct a pre-training data set based on medical field knowledge and to construct corresponding fine-tuning data sets for various model downstream tasks based on cardiovascular comorbidity field knowledge; model downstream tasks include medical vocabulary query tasks, disease classification prediction tasks, disease treatment plan prediction tasks and critical illness risk prediction tasks.
[0198] The base model training module 203 is used to pre-train the generative medical model based on the pre-training data set to obtain the corresponding base model.
[0199] The downstream task large model fine-tuning module 204 is used to fine-tune the base large model based on each fine-tuning data set to obtain the corresponding downstream task large model.
[0200] The model evaluation module 205 is used to evaluate all downstream task large models to obtain corresponding model evaluation results.
[0201] An embodiment of the present invention provides a processing device for a generative medical large model, which can execute the method steps in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here.
[0202] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the model building module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above-mentioned module is determined. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0203] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more specific integrated circuits (ASIC), or one or more digital signal processors (DSP), or one or more field programmable gate arrays (FPGA), etc. For another example, when a certain module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program codes. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0204] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the above method embodiments are generated. The above computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above-mentioned computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the above-mentioned computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, Bluetooth, microwave, etc.) methods. The above-mentioned computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The above-mentioned available media can be magnetic media (such as floppy disks, hard disks, tapes), optical media (such as DVDs), or semiconductor media (such as solid-state drives (SSDs)), etc.
[0205] Figure 3 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. The electronic device may be a terminal device or a server for implementing the method of the aforementioned embodiment, or may be a terminal device or a server for implementing the method of the aforementioned embodiment connected to the aforementioned terminal device or server. Figure 3 As shown, the electronic device may include: a processor 301 (such as a CPU), a memory 302, and a transceiver 303; the transceiver 303 is coupled to the processor 301, and the processor 301 controls the transceiver 303. Various instructions may be stored in the memory 302 to complete various processing functions and implement the processing steps described in the aforementioned embodiment method. Preferably, the electronic device involved in the embodiment of the present invention also includes: a power supply 304, a system bus 305 and a communication port 306. The system bus 305 is used to realize the communication connection between components. The above-mentioned communication port 306 is used for connecting and communicating between the electronic device and other peripherals.
[0206] exist Figure 3The system bus 305 mentioned in the figure can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used to realize the communication between the database access device and other devices (such as a client, a read-write library, and a read-only library). The memory may include a random access memory (RAM), and may also include a non-volatile memory (Non-Vol at ile Memory), such as at least one disk storage.
[0207] The above-mentioned processors can be general-purpose processors, including central processing units (CPU), network processors (Network Processor, NP), graphics processing units (Graphics Processing Unit, GPU), etc.; they can also be digital signal processors DSP, application-specific integrated circuits ASIC, field programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0208] It should be noted that an embodiment of the present invention further provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the method and processing process provided in the above embodiments.
[0209] An embodiment of the present invention further provides a chip for executing instructions, wherein the chip is used to execute the processing steps described in the aforementioned method embodiment.
[0210] The embodiment of the present invention provides a processing method, device, electronic device and computer-readable storage medium for a generative medical big model. As can be seen from the above content, the embodiment of the present invention first constructs a generative medical big model based on a type of generative big language model, and plans multiple model downstream tasks (medical vocabulary query task, disease classification prediction task, disease treatment plan prediction task and critical illness risk prediction task) for the generative medical big model; then constructs a pre-training data set based on medical field knowledge and constructs corresponding fine-tuning data sets for various model downstream tasks based on cardiovascular comorbidity field knowledge; then pre-trains the generative medical big model based on the pre-training data set to obtain the corresponding base version big model; then fine-tunes the base version big model based on each fine-tuning data set to obtain the corresponding downstream task big model; finally, all downstream task big models are evaluated according to the comprehensive evaluation mechanism of expert + big model to obtain the corresponding model evaluation results. It can be seen that the embodiment of the present invention can provide a model training and evaluation mechanism for a generative medical big model. Based on this mechanism, not only the base big model of the generative medical big model can be obtained, but also the downstream task big model corresponding to each downstream task can be obtained, and the model performance of each downstream task big model can be effectively evaluated; through the embodiment of the present invention, not only the problem of the lack of big model training solutions in the cardiovascular disease subdivision field is solved, but also a multi-category task big model is provided for this field.
[0211] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0212] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0213] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for processing a generative medical large model, characterized in that: The method comprises: Building a generative medical big model based on a generative big language model; Constructing a pre-training dataset based on medical domain knowledge and constructing corresponding fine-tuning datasets for various model downstream tasks based on cardiovascular comorbidity domain knowledge; the model downstream tasks include medical vocabulary query tasks, disease classification prediction tasks, disease treatment plan prediction tasks, and critical illness risk prediction tasks; Pre-training the generative medical big model based on the pre-training data set to obtain a corresponding base version big model; Fine-tune the base model based on each of the fine-tuning data sets to obtain a corresponding downstream task model; Evaluate all the downstream task models to obtain corresponding model evaluation results; in, The generative medical big model is a generative big language model based on the Transformer model structure; the generative medical big model includes the T5 series model; The pre-training data set includes a medical vocabulary query task corpus, a disease classification prediction task corpus, a disease treatment plan prediction task corpus, and a critical illness risk prediction task corpus; The medical vocabulary query task corpus is composed of a plurality of first task corpora; the first task corpora include first vocabulary name information and first vocabulary interpretation information; The disease classification prediction task corpus is composed of multiple second task corpora; the second task corpus includes a first detection information set, a first inspection information set, a first symptom description information set and a first diagnosis report information; when the first detection information set is not empty, it is composed of one or more first detection information; when the first inspection information set is not empty, it is composed of one or more first inspection information; when the first symptom description information set is not empty, it is composed of one or more first symptom description information; the first diagnosis report information is composed of one or more first disease diagnosis types; the data format types of the first detection information and the first inspection information include text format and image format; The disease treatment plan prediction task corpus is composed of multiple third task corpora; the third task corpus includes first disease type information, second detection information set, second inspection information set, second symptom description information set and first treatment plan set; when the second detection information set is not empty, it is composed of one or more second detection information; when the second inspection information set is not empty, it is composed of one or more second inspection information; when the second symptom description information set is not empty, it is composed of one or more second symptom description information; the first treatment plan set is composed of one or more first treatment plans, and each of the first treatment plans corresponds to a treatment type; the data format types of the second detection information and the second inspection information include text format and image format; The critical illness risk prediction task corpus is composed of multiple fourth task corpora; the fourth task corpus includes a third detection information set, a third inspection information set, a third symptom description information set, a first historical medical record set and first critical illness type and level diagnosis information; when the third detection information set is not empty, it is composed of one or more third detection information; when the third inspection information set is not empty, it is composed of one or more third inspection information; when the third symptom description information set is not empty, it is composed of one or more third symptom description information; when the first historical medical record set is not empty, it is composed of multiple first historical medical records, each of which includes at least a first historical time, a first historical diagnosis report, a first historical treatment plan and a first historical critical illness type and level diagnosis information; the data format types of the third detection information and the third inspection information include text format and image format; The fine-tuning dataset corresponding to the medical vocabulary query task is composed of a plurality of first task fine-tuning corpora; the first task fine-tuning corpora include first question information and first answer information; the first question information includes a query instruction text for instructing the model to perform a vocabulary interpretation query according to the input query vocabulary name information and one or more first query vocabulary names; the first answer information is a corresponding first interpretation label text; The fine-tuning data set corresponding to the disease classification prediction task is composed of a plurality of second task fine-tuning corpora; the second task fine-tuning corpora include second question information and second answer information; the second question information includes a disease classification prediction instruction text for instructing the model to perform disease classification prediction based on the input reference information and one or more first reference information; the information type of the first reference information includes detection information, inspection information and symptom description information; the data format type of the first reference information includes text format and image format; the second answer information is composed of one or more first disease type label texts; The fine-tuning data set corresponding to the disease treatment plan prediction task is composed of multiple third task fine-tuning corpora; the third task fine-tuning corpora include third question information and third answer information; the third question information includes a treatment plan prediction instruction text for instructing the model to predict the disease treatment plan based on the input reference information and one or more second reference information; the information type of the second reference information includes disease type information, detection information, inspection information and symptom description information; the data format type of the second reference information includes text format and image format; the third answer information is a corresponding first treatment plan label text; The fine-tuning data set corresponding to the critical illness risk prediction task is composed of multiple fourth task fine-tuning corpora; the fourth task fine-tuning corpora include fourth question information and fourth answer information; the fourth question information includes a critical illness prediction instruction text for instructing the model to predict the critical illness risk level according to the input reference information and one or more third reference information; the information types of the third reference information include detection information, inspection information, symptom description information and historical medical record information; when the information type of the third reference information is historical medical record information, it should be composed of at least 2 or more historical medical record texts; the data format types of the third reference information include text format and image format; the fourth answer information is a corresponding first critical illness type and level label text; The questions and answers in the task fine-tuning corpus of all the fine-tuning datasets are related to the field of cardiovascular comorbidities; The pre-training of the generative medical big model based on the pre-training data set to obtain the corresponding base big model specifically includes: Initializing the model parameters of the generative medical large model to obtain a corresponding first initial model; Performing a first round of self-supervised pre-training on the first initial model according to the medical vocabulary query task corpus of the pre-training data set to obtain a corresponding first round pre-training model; Performing a second round of self-supervised pre-training on the first round of pre-training model according to the disease classification prediction task corpus of the pre-training data set to obtain a corresponding second round of pre-training model; Performing a third round of self-supervised pre-training on the second round pre-training model according to the disease treatment plan prediction task corpus of the pre-training data set to obtain a corresponding third round pre-training model; Performing a fourth round of self-supervised pre-training on the third-round pre-training model according to the critical illness risk prediction task corpus of the pre-training data set to obtain a corresponding fourth-round pre-training model; A first specified number of the first task corpus, the second task corpus, the third task corpus and the fourth task corpus are respectively extracted from the medical vocabulary query task corpus, the disease classification prediction task corpus, the disease treatment plan prediction task corpus and the critical illness risk prediction task corpus according to the principle of random extraction to form the corresponding first, second, third and fourth verification corpus sets; the first specified number is an integer greater than zero; the first verification corpus is composed of the first specified number of first verification corpus, and each of the first verification corpus corresponds to one first task corpus; the second verification corpus is composed of the first specified number of second verification corpus, and each of the second verification corpus corresponds to one second task corpus; the third verification corpus is composed of the first specified number of third verification corpus, and each of the third verification corpus corresponds to one third task corpus; the fourth verification corpus is composed of the first specified number of fourth verification corpus, and each of the fourth verification corpus corresponds to one fourth task corpus; Verify and modulate the fourth round of pre-training model according to the first, second, third and fourth verification corpora to obtain the corresponding base version large model; The step of fine-tuning the base model based on each of the fine-tuning data sets to obtain a corresponding downstream task model specifically includes: The model parameters of the base plate large model are replicated four times to obtain corresponding first, second, third and fourth base plate large models; The fine-tuning data sets corresponding to the medical vocabulary query task, the disease classification prediction task, the disease treatment plan prediction task, and the critical illness risk prediction task are recorded as corresponding first, second, third, and fourth fine-tuning data sets; The first task fine-tuning corpus of the first fine-tuning data set is traversed; and during the traversal, the first task fine-tuning corpus currently traversed is used as the corresponding current fine-tuning corpus; and the first question information and the first answer information of the current fine-tuning corpus are used as the corresponding current model input information and current model label information; and the current model input information is input into the first base version large model for model processing to obtain the corresponding current model prediction information; and the current model prediction information and the current model label information are brought into the preset fifth loss function, and based on the preset large model fine-tuning optimization mechanism, the model parameters of the first base version large model are fine-tuned in a direction to minimize the loss value of the fifth loss function; and at the end of the traversal, the model parameters of the first base version large model are solidified once to obtain the downstream task large model corresponding to the medical vocabulary query task; the large model fine-tuning optimization mechanism includes the LoRA optimization mechanism and the Adapter optimization mechanism; the fifth loss function includes the L1 loss function and the L2 loss function; The second task fine-tuning corpus of the second fine-tuning data set is traversed; and during the traversal, the second task fine-tuning corpus currently traversed is used as the corresponding current fine-tuning corpus; and the second question information and the second answer information of the current fine-tuning corpus are used as the corresponding current model input information and the current model label information; and the current model input information is input into the second base version large model for model processing to obtain the corresponding current model prediction information; and the current model prediction information and the current model label information are brought into the preset sixth loss function, and based on the large model fine-tuning optimization mechanism, a round of fine-tuning is performed on the model parameters of the second base version large model in the direction of minimizing the loss value of the sixth loss function; and at the end of the traversal, the model parameters of the second base version large model are solidified once to obtain the downstream task large model corresponding to the disease classification prediction task; the sixth loss function includes a cross entropy loss function; The third task fine-tuning corpus of the third fine-tuning data set is traversed; and during the traversal, the third task fine-tuning corpus currently traversed is used as the corresponding current fine-tuning corpus; and the third question information and the third answer information of the current fine-tuning corpus are used as the corresponding current model input information and the current model label information; and the current model input information is input into the third base version large model for model processing to obtain the corresponding current model prediction information; and the current model prediction information and the current model label information are brought into the preset seventh loss function, and based on the large model fine-tuning optimization mechanism, a round of fine-tuning is performed on the model parameters of the third base version large model in the direction of minimizing the loss value of the seventh loss function; and at the end of the traversal, the model parameters of the third base version large model are solidified once to obtain the downstream task large model corresponding to the disease treatment plan prediction task; the seventh loss function includes an L1 loss function and an L2 loss function; The fourth task fine-tuning corpus of the fourth fine-tuning data set is traversed; and during the traversal, the fourth task fine-tuning corpus currently traversed is used as the corresponding current fine-tuning corpus; and the fourth question information and the fourth answer information of the current fine-tuning corpus are used as the corresponding current model input information and the current model label information; and the current model input information is input into the fourth base version large model for model processing to obtain the corresponding current model prediction information; and the current model prediction information and the current model label information are brought into the preset eighth loss function, and based on the large model fine-tuning optimization mechanism, a round of fine-tuning is performed on the model parameters of the fourth base version large model in the direction of minimizing the loss value of the eighth loss function; and at the end of the traversal, the model parameters of the fourth base version large model are solidified once to obtain the downstream task large model corresponding to the critical risk prediction task; the eighth loss function includes a cross entropy loss function; The step of evaluating all the downstream task large models to obtain corresponding model evaluation results specifically includes: Recruiting a second specified number of experts in the field of cardiovascular medicine to form a first expert group; and selecting another mature generative large language model applied in the field of cardiovascular medicine as the corresponding first evaluation model; the first expert group is composed of the second specified number of first experts; the second specified number is an integer greater than zero; the model structure of the first evaluation model includes a GPT model structure and a BERT model structure; Each of the first experts in the first expert group proposes a third specified number of task processing questions a to each of the downstream task large models. k,z,q And get the corresponding self-model output result b k,z,q , and output the result b of each self-model according to the preset M-level scoring standard k,z,q Score and get the corresponding expert manual score c k,z,q ; 1≤k≤K, K is the total number of the downstream task large models, the default is 4; 1≤z≤Z, Z is the second specified number; 1≤q≤Q, Q is the third specified number; the third specified number is an integer greater than zero; M is an integer greater than zero, the M-level scoring standard includes level one, level two, and so on until level M; the expert manual scoring c k,z,q The value range of is an integer between 1 and M; Each of the tasks described above will be processed by k,z,q Input the first evaluation model to perform model processing to obtain the corresponding evaluation model output result And output the results for each evaluation model The corresponding self-model output result b k,z,q The similarity of is estimated to get the corresponding similarity d k,z,q ; and each of the similarities d k,z,q The product of M is used as the corresponding model comparison score The similarity d k,z,q The value range is a real number range between 0 and 1; the model comparison score The value range of is a real number between 0 and M; According to all the expert manual scores c corresponding to each of the downstream task large models k,z,q Compare the scores with the model Perform the corresponding model evaluation to obtain the corresponding evaluation score CM k ;in, β 1、2 are two preset weighted parameters respectively; the evaluation score CM k One-to-one correspondence with the downstream task model; And all the evaluation scores CM obtained k The composition corresponds to the model evaluation result.
2. The method for processing a generative medical large model according to claim 1, characterized in that: The medical vocabulary query task is a downstream model processing task for vocabulary interpretation query based on medical vocabulary names; the disease classification prediction task is a downstream model processing task for disease classification prediction based on detection information and / or inspection information and / or symptom description information; the disease treatment plan prediction task is a downstream model processing task for treatment plan prediction based on disease classification information and / or detection information and / or inspection information and / or symptom description information; The critical illness risk prediction task is a downstream model processing task for predicting the critical illness risk level based on detection information and / or inspection information and / or symptom description information and / or historical medical record information.
3. The method for processing a generative medical large model according to claim 1, characterized in that: The pre-training dataset is constructed based on medical domain knowledge and the corresponding fine-tuning dataset is constructed for various model downstream tasks based on cardiovascular comorbidity domain knowledge, specifically including: The pre-training dataset is constructed by collecting general medical dictionaries, textbooks, diagnosis and treatment guidelines, expert papers, industry literature and medical records in the medical field; and each of the fine-tuning datasets is constructed by collecting specialized medical dictionaries, textbooks, diagnosis and treatment guidelines, expert papers, industry literature and medical records in the field of cardiovascular comorbidities.
4. The method for processing a generative medical large model according to claim 1, characterized in that: The step of performing a first round of self-supervised pre-training on the first initial model according to the medical vocabulary query task corpus of the pre-training data set to obtain a corresponding first round pre-training model specifically includes: Step 71, taking the first of the first task corpora in the medical vocabulary query task corpus as the corresponding current corpus; Step 72, the corresponding first model input information is composed of a preset query instruction text template and the first vocabulary name information of the current corpus; and the remaining information in the first model input information except the query instruction text template is subjected to random mask replacement processing; and the first vocabulary interpretation information of the current corpus is extracted as the corresponding first model label information; the query instruction text template is an instruction text template used to instruct the model to perform vocabulary interpretation query according to the input query vocabulary name information; Step 73, inputting the first model input information into the first initial model for model processing to obtain corresponding first model prediction information; Step 74, bringing the first model prediction information and the first model label information into a preset first objective function and performing a round of parameter optimization on the first initial model in the direction of minimizing the objective function; and after this round of parameter optimization, identifying whether the current corpus is the last first task corpus of the medical vocabulary query task corpus; if so, go to step 75; if not, extracting the next first task corpus of the medical vocabulary query task corpus as the new current corpus and returning to step 72; Step 75, solidify the model parameters of the first initial model to obtain the corresponding first round pre-training model.
5. The method for processing a generative medical large model according to claim 1, characterized in that: The performing a second round of self-supervised pre-training on the first round of pre-training model according to the disease classification prediction task corpus of the pre-training data set to obtain a corresponding second round of pre-training model specifically includes: Step 81, taking the first of the second task corpus in the disease classification prediction task corpus as the corresponding current corpus; Step 82, the preset disease classification prediction instruction text template and the first detection information set, the first inspection information set and the first symptom description information set of the current corpus form the corresponding second model input information; and perform random mask replacement processing on the remaining information in the second model input information except the disease classification prediction instruction text template; and extract the first diagnosis report information of the current corpus as the corresponding second model label information; the disease classification prediction instruction text template is an instruction text template used to instruct the model to perform disease classification prediction according to the input reference information; Step 83, inputting the second model input information into the first round pre-training model for model processing to obtain corresponding second model prediction information; Step 84, bringing the second model prediction information and the second model label information into the preset second objective function and performing a round of parameter optimization on the first round pre-training model in the direction of minimizing the objective function; and after the completion of this round of parameter optimization, identifying whether the current corpus is the last second task corpus of the disease classification prediction task corpus; if so, go to step 85; if not, extracting the next second task corpus of the disease classification prediction task corpus as the new current corpus and returning to step 82; Step 85, solidify the model parameters of the first round of pre-training model to obtain the corresponding second round of pre-training model.
6. The method for processing a generative medical large model according to claim 1, characterized in that: The performing a third round of self-supervised pre-training on the second round pre-training model according to the disease treatment scheme prediction task corpus of the pre-training data set to obtain a corresponding third round pre-training model specifically includes: Step 91, taking the first third task corpus of the disease treatment plan prediction task corpus as the corresponding current corpus; Step 92, the corresponding third model input information is composed of the preset treatment plan prediction instruction text template and the first disease type information, the second detection information set, the second inspection information set and the second symptom description information set of the current corpus; and the remaining information in the third model input information except the treatment plan prediction instruction text template is randomly masked and replaced; and the first treatment plan set of the current corpus is extracted as the corresponding third model label information; the treatment plan prediction instruction text template is an instruction text template used to instruct the model to perform disease classification prediction based on the input reference information; Step 93, inputting the third model input information into the second round pre-training model for model processing to obtain corresponding third model prediction information; Step 94, bringing the third model prediction information and the third model label information into the preset third objective function and performing a round of parameter optimization on the second round pre-training model in the direction of minimizing the objective function; and after the completion of this round of parameter optimization, identifying whether the current corpus is the last third task corpus of the disease treatment plan prediction task corpus; if so, go to step 95; if not, extracting the next third task corpus of the disease treatment plan prediction task corpus as the new current corpus and returning to step 92; Step 95, solidify the model parameters of the second-round pre-training model to obtain the corresponding third-round pre-training model.
7. The method for processing a generative medical large model according to claim 1, characterized in that: The performing a fourth round of self-supervised pre-training on the third round pre-training model according to the critical illness risk prediction task corpus of the pre-training data set to obtain a corresponding fourth round pre-training model specifically includes: Step 101, taking the first fourth task corpus of the critical illness risk prediction task corpus as the corresponding current corpus; Step 102, the corresponding fourth model input information is composed of a preset critical illness prediction instruction text template and the third detection information set, the third inspection information set, the third symptom description information set and the first historical medical record set of the current corpus; and the remaining information in the fourth model input information except the critical illness prediction instruction text template is subjected to random mask replacement processing; and the first critical illness type and level diagnosis information of the current corpus is extracted as the corresponding fourth model label information; the critical illness prediction instruction text template is an instruction text template used to instruct the model to predict the critical illness risk level according to the input reference information; Step 103, inputting the fourth model input information into the third round pre-training model for model processing to obtain corresponding fourth model prediction information; Step 104, bringing the fourth model prediction information and the fourth model label information into the preset fourth objective function and performing a round of parameter optimization on the third round pre-training model in the direction of minimizing the objective function; and after the completion of this round of parameter optimization, identifying whether the current corpus is the last fourth task corpus of the critical illness risk prediction task corpus; if so, go to step 105; if not, extracting the next fourth task corpus of the critical illness risk prediction task corpus as the new current corpus and returning to step 102; Step 105, solidifying the model parameters of the third round of pre-training model to obtain the corresponding fourth round of pre-training model.
8. The method for processing a generative medical large model according to claim 1, characterized in that: The verifying and modulating the fourth round of pre-training model according to the first, second, third and fourth verification corpora to obtain the corresponding base version large model specifically includes: Step 111: each of the first verification corpora in the first verification corpus set is used as the corresponding current verification corpus; and the corresponding model input information x is composed of a preset query instruction text template and the first vocabulary name information of the current verification corpus. i=1,j ; and input information x to the model i=1,j The remaining information except the query instruction text template is subjected to random mask replacement processing; and the first vocabulary interpretation information of the current verification corpus is extracted as the corresponding model label information And the model is fed with information x i=1,j Input the fourth round of pre-training model for model processing to obtain the corresponding model prediction information y i=1,j ; i is the verification corpus index, 1≤i≤4, j is the corpus index, 1≤j≤N, N is the first specified number; Step 112: each of the second verification corpora in the second verification corpus set is used as the corresponding current verification corpus; and the corresponding model input information x is composed of the preset disease classification prediction instruction text template and the first detection information set, the first inspection information set and the first symptom description information set of the current verification corpus. i=2,j ; and input information x to the model i=2,j The remaining information except the disease classification prediction instruction text template is randomly masked and replaced; and the first diagnosis report information of the current verification corpus is extracted as the corresponding model label information And the model is fed with information x i=2,j Input the fourth round of pre-training model for model processing to obtain the corresponding model prediction information y i=2,j ; Step 113, each of the third verification corpora of the third verification corpus set is used as the corresponding current verification corpus; and the corresponding model input information x is composed of the preset treatment plan prediction instruction text template and the first disease type information, the second detection information set, the second inspection information set and the second symptom description information set of the current verification corpus. i=3,j ; and input information x to the model i=3,j The remaining information except the treatment plan prediction instruction text template is randomly masked and replaced; and the first treatment plan set of the current verification corpus is extracted as the corresponding model label information And the model is fed with information x i=3,j Input the fourth round of pre-training model for model processing to obtain the corresponding model prediction information y i=3,j ; Step 114, each of the fourth verification corpora of the fourth verification corpus set is used as the corresponding current verification corpus; and the corresponding model input information x is composed of the preset critical illness prediction instruction text template and the third detection information set, the third inspection information set, the third symptom description information set and the first historical medical record set of the current verification corpus. i=4,j ; and input information x to the model i=4,j The remaining information except the critical illness prediction instruction text template is randomly masked and replaced; and the first critical illness type and grade diagnosis information of the current verification corpus is extracted as the corresponding model label information And the model is fed with information x i=4,j Input the fourth round of pre-training model for model processing to obtain the corresponding model prediction information y i=4,j ; Step 115: predict information y from N models corresponding to each corpus index i i,j The corresponding model prediction vector Y i , and the N model label information corresponding to each corpus index i The corresponding model prediction vector And the obtained multiple pairs of the model prediction vectors Y i and the model prediction vector Bring in the preset model overall loss function L total Calculate and obtain the corresponding model loss value; in, I is the total number of validation corpus, the default value is 4, α i=1、2、3、4 They are the four preset weighting parameters, L i=1、2、3、4 are the preset first, second, third and fourth loss functions respectively, The first loss function L1 includes an L1 loss function and an L2 loss function. The second loss function L2 includes a cross entropy loss function, The third loss function L3 includes an L1 loss function and an L2 loss function. The fourth loss function L4 includes a cross entropy loss function; Step 116, identifying whether the model loss value satisfies a preset convergence loss value range; if so, proceeding to step 117; if not, moving towards making the overall model loss function L total Perform a round of parameter optimization on the fourth round pre-training model in the direction of reaching the minimum value, and return to step 111 for re-verification after the end of this round of parameter optimization; Step 117, solidify the model parameters of the fourth round of pre-training model to obtain the corresponding base model.
9. A device for executing the generative medical large model processing method according to any one of claims 1 to 8, characterized in that: The device comprises: a model construction module, a data set construction module, a base model training module, a downstream task model fine-tuning module and a model evaluation module; The model building module is used to build a generative medical big model based on the generative big language model; The data set construction module is used to construct a pre-training data set based on medical domain knowledge and to construct corresponding fine-tuning data sets for various model downstream tasks based on cardiovascular comorbidity domain knowledge; the model downstream tasks include medical vocabulary query tasks, disease classification prediction tasks, disease treatment plan prediction tasks, and critical illness risk prediction tasks; The base model training module is used to pre-train the generative medical model based on the pre-training data set to obtain the corresponding base model; The downstream task large model fine-tuning module is used to fine-tune the base large model based on each of the fine-tuning data sets to obtain the corresponding downstream task large model; The model evaluation module is used to evaluate all the downstream task large models to obtain corresponding model evaluation results.
10. An electronic device, characterized in that: include: memory, processors, and transceivers; The processor is used to couple with the memory, read and execute instructions in the memory, so as to implement the method according to any one of claims 1 to 8; The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a computer, the computer is enabled to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Medical data application method and device based on machine learning and storage medium
CN116246769A
Model training method and device suitable for large language model, equipment and medium
CN116976424A
Self-supervised representation learning paradigm for medical images
US20230111306A1
