Multi-agent based medical diagnosis assistance method and related apparatuses
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-14
- Publication Date
- 2026-08-11
AI Technical Summary
[0003]相关技术中,医疗学科分类极其精细且复杂,涵盖内科、外科、妇产科、儿科等多个专科领域,单一的大语言模型虽然具备通用的知识储备,但在面对特定专科的复杂疑难病例时,往往难以深入挖掘该专科特有的病理特征和临床规律,导致诊断的准确度和深度不足,容易出现“博而不精”的问题
本申请的一种基于多智能体的医疗诊断辅助方法及其相关装置,方法包括获取目标对象的病程数据;将病程数据并行输入至多个预设的第一大语言模型,得到多个候选诊断信息;其中,任一第一大语言模型对应于一个医疗专科领域,每个候选诊断信息包括若干个候选诊断、候选诊断对应的第一置信度和诊断依据;将每个候选诊断信息输入至预训练后的第二大语言模型,第二大语言模型基于预设的多头自注意力机制对不同的候选诊断信息分别进行加权融合处理,生成诊断辅助结果;其中,诊断辅助结果包括目标诊断和目标诊断对应的第二置信度。该方式中,能够通过多个第一大语言模型和第二大语言模型对用户的病程数据进行诊断分析,能够综合利用各专科领域的知识,避免单一模型导致的专科知识舍弃,得到专业的诊断辅助结果,从而提高了辅助诊断的效率以及准确性,提升了用户体验。
Smart Images

Figure CN122552089A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of large model technology, and in particular to a medical diagnostic assistance method and related device based on multi-agent systems. Background Technology
[0002] With the rapid development of artificial intelligence technology, especially the breakthroughs achieved by large language models in natural language processing and understanding, AI-assisted medical diagnosis has become an important means to improve the efficiency and quality of medical services. Existing medical diagnostic assistance systems typically use a single large language model to analyze patient medical data and directly output diagnostic suggestions.
[0003] In related technologies, medical disciplines are classified in an extremely detailed and complex manner, covering multiple specialties such as internal medicine, surgery, obstetrics and gynecology, and pediatrics. While a single, large-scale language model possesses general knowledge reserves, it often struggles to delve into the unique pathological features and clinical patterns of a specific specialty when faced with complex and difficult cases. This results in insufficient accuracy and depth in diagnosis, easily leading to the problem of being "broad but not deep." Secondly, the decision-making process of a single model is often a "black box," lacking multi-faceted verification mechanisms. Once the model exhibits illusions or logical biases, it is highly susceptible to erroneous diagnostic results, which are difficult for human doctors to identify and correct in a timely manner. Furthermore, existing technologies often lack effective weighting mechanisms when integrating multi-source information, failing to judge based on the confidence levels and diagnostic criteria output by different specialty models. This results in a lack of objectivity and reliability in the final diagnostic assistance results. Summary of the Invention
[0004] To address or partially address the problems existing in related technologies, this application provides a multi-agent-based medical diagnostic assistance method and related device, which can perform diagnostic analysis on the user's medical history data through multiple primary and secondary language models to obtain diagnostic assistance results, thereby improving the efficiency and accuracy of assisted diagnosis and enhancing the user experience.
[0005] The first aspect of this application provides a multi-agent-based medical diagnostic assistance method, comprising: acquiring disease course data of a target object; inputting the disease course data in parallel into multiple preset first large language models to obtain multiple candidate diagnostic information; wherein, each of the first large language models corresponds to a medical specialty field, and each candidate diagnostic information includes several candidate diagnoses, a first confidence level corresponding to the candidate diagnosis, and diagnostic criteria; inputting each candidate diagnostic information into a pre-trained second large language model, wherein the second large language model performs weighted fusion processing on different candidate diagnostic information based on a preset multi-head self-attention mechanism to generate a diagnostic assistance result; wherein, the diagnostic assistance result includes a target diagnosis and a second confidence level corresponding to the target diagnosis.
[0006] In conjunction with the first aspect, in one possible implementation of the first aspect, before inputting each of the candidate diagnostic information into the pre-trained second large language model, the method further includes: extracting M candidate diagnostic results, the first confidence level corresponding to each candidate diagnosis, and the diagnostic basis from the candidate diagnostic information; wherein M is an integer greater than or equal to 2; and concatenating the M candidate diagnoses, the first confidence level corresponding to each candidate diagnosis, and the diagnostic basis according to a preset template to obtain structured text for input into the second large oracle model.
[0007] In conjunction with the first aspect, in one possible implementation of the first aspect, the process of inputting the disease course data in parallel into multiple preset first large language models to obtain multiple candidate diagnostic information includes: The first confidence level is calculated using the following formula:
[0008] in, ; The j-th candidate diagnosis is output by the i-th largest language model. Let be the unnormalized score value output by the i-th largest language model for the j-th candidate diagnosis; M represents the first confidence level of the candidate diagnosis; M is the confidence level of each first... The number of candidate diagnoses output by the model; where the constraints include: .
[0009] In conjunction with the first aspect, in one possible implementation of the first aspect, the training process of the second large language model includes: acquiring disease course data samples and real diagnostic results corresponding to multiple target cases; inputting the disease course data samples into multiple first large language models respectively to obtain several diagnostic information samples; generating training input text according to a predetermined format using the disease course data samples and several diagnostic information samples corresponding to each target case; using the training input text as input features and the real diagnostic results corresponding to the target cases as output labels as training samples to form a training sample set; using the training sample set as training data, iteratively training a preset large language model based on a preset optimization loss function until the preset large language model converges to obtain the second large language model; wherein, the preset optimization loss function is to minimize the cross-entropy loss between the predicted diagnosis and the real diagnostic results of the large language model.
[0010] In conjunction with the first aspect, in one possible implementation of the first aspect, the preset optimization loss function is: L = -Σ_{n=1}^{N} log P(y_n | X_n) Where L is the cross-entropy loss; N is the number of samples in the training sample set.
[0011] In conjunction with the first aspect, one possible implementation of the first aspect further includes: inputting the training sample set into the second large language model, and obtaining the target number of candidate diagnoses in the candidate diagnostic information through a preset Top-(M) recall rate calculation formula; The preset Top-(M) recall calculation formula includes:
[0012] in, The total number of training samples in the training sample set; For the training sample set, the first One training sample; For the first The actual diagnostic results corresponding to each training sample; For the second largest language model targeting the first The output of each training sample Candidate diagnostic set; This is an indicator function that takes the value 1 when the condition inside the parentheses is true and takes the value 0 when the condition inside the parentheses is false.
[0013] In conjunction with the first aspect, in one possible implementation of the first aspect, the disease course data includes at least symptom description information, physical sign information, laboratory test results, and imaging test results.
[0014] A second aspect of this application provides a multi-agent-based medical diagnostic assistance device, comprising: an acquisition module for acquiring disease course data of a target object; a processing module for inputting the disease course data in parallel into multiple preset first large language models to obtain multiple candidate diagnostic information; wherein each of the first large language models corresponds to a medical specialty field, and each candidate diagnostic information includes several candidate diagnoses, a first confidence level corresponding to the candidate diagnosis, and diagnostic criteria; and a generation module for inputting each candidate diagnostic information into a pre-trained second large language model, wherein the second large language model performs weighted fusion processing on different candidate diagnostic information based on a preset multi-head self-attention mechanism to generate a diagnostic assistance result; wherein the diagnostic assistance result includes a target diagnosis and a second confidence level corresponding to the target diagnosis.
[0015] A third aspect of this application provides an electronic device, comprising: Processor; and A memory that stores executable code, which, when executed by the processor, causes the processor to perform the method described above.
[0016] A fourth aspect of this application provides a computer-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to perform the method described above.
[0017] The technical solution provided in this application may include the following beneficial effects: This application discloses a multi-agent-based medical diagnostic assistance method and related apparatus. The method includes acquiring the patient's medical history data; inputting the medical history data in parallel into multiple preset first-level language models to obtain multiple candidate diagnostic information; wherein each first-level language model corresponds to a medical specialty, and each candidate diagnostic information includes several candidate diagnoses, a first confidence level corresponding to the candidate diagnoses, and diagnostic criteria; inputting each candidate diagnostic information into a pre-trained second-level language model, which performs weighted fusion processing on different candidate diagnostic information based on a preset multi-head self-attention mechanism to generate a diagnostic assistance result; wherein the diagnostic assistance result includes the target diagnosis and a second confidence level corresponding to the target diagnosis. This method enables diagnostic analysis of the user's medical history data through multiple first-level and second-level language models, comprehensively utilizing knowledge from various specialty fields, avoiding the omission of specialty knowledge due to a single model, and obtaining professional diagnostic assistance results, thereby improving the efficiency and accuracy of assisted diagnosis and enhancing the user experience.
[0018] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0019] The above and other objects, features and advantages of this application will become more apparent from the more detailed description of exemplary embodiments thereof in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments thereof.
[0020] Figure 1 This is a schematic flowchart illustrating a multi-agent-based medical diagnostic assistance method according to an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a multi-agent-based medical diagnostic auxiliary device shown in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application. Detailed Implementation
[0021] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to make this application more thorough and complete, and to fully convey the scope of this application to those skilled in the art.
[0022] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0023] It should be understood that although the terms "first," "second," "third," etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0024] With the rapid development of artificial intelligence technology, especially the breakthroughs achieved by large language models in natural language processing and understanding, AI-assisted medical diagnosis has become an important means to improve the efficiency and quality of medical services. Existing medical diagnostic assistance systems typically use a single large language model to analyze patient medical data and directly output diagnostic suggestions.
[0025] In related technologies, medical disciplines are classified in an extremely detailed and complex manner, covering multiple specialties such as internal medicine, surgery, obstetrics and gynecology, and pediatrics. While a single, large-scale language model possesses general knowledge reserves, it often struggles to delve into the unique pathological features and clinical patterns of a specific specialty when faced with complex and difficult cases. This results in insufficient accuracy and depth in diagnosis, easily leading to the problem of being "broad but not deep." Secondly, the decision-making process of a single model is often a "black box," lacking multi-faceted verification mechanisms. Once the model exhibits illusions or logical biases, it is highly susceptible to erroneous diagnostic results, which are difficult for human doctors to identify and correct in a timely manner. Furthermore, existing technologies often lack effective weighting mechanisms when integrating multi-source information, failing to judge based on the confidence levels and diagnostic criteria output by different specialty models. This results in a lack of objectivity and reliability in the final diagnostic assistance results.
[0026] To address the aforementioned issues, this application provides a multi-agent-based medical diagnostic assistance method and related apparatus. This method can perform diagnostic analysis on a user's medical history data using multiple primary and secondary language models. It can comprehensively utilize knowledge from various specialized fields, avoiding the omission of specialized knowledge due to a single model, and obtaining professional diagnostic assistance results. This improves the efficiency and accuracy of assisted diagnosis and enhances the user experience.
[0027] The technical solutions of the embodiments of this application are described in detail below with reference to the accompanying drawings.
[0028] Figure 1 This is a flowchart illustrating a multi-agent-based medical diagnostic assistance method according to an embodiment of this application.
[0029] See Figure 1 A multi-agent-based medical diagnostic assistance method, comprising: S110: Obtain the disease course data of the target object.
[0030] Specifically, the target object can be the subject of a medical diagnosis. Disease progress data refers to various types of medical information related to the health status of the target object; for example, it may include information such as the patient's medical records, chief complaints, and present medical history recorded by healthcare professionals.
[0031] S120: Input the disease course data in parallel into multiple preset first-level language models to obtain multiple candidate diagnostic information; wherein, any first-level language model corresponds to a medical specialty field, and each candidate diagnostic information includes several candidate diagnoses, the first confidence level of the candidate diagnosis, and the diagnostic basis.
[0032] Specifically, the primary language model refers to a model trained with domain-specific knowledge. Each primary language model is pre-configured to correspond to a specific medical specialty, such as a cardiovascular specialty model, a respiratory specialty model, or a digestive specialty model. When patient data is input into the primary language model, these different models simultaneously and independently analyze and infer the data. After completing inference, each primary language model outputs candidate diagnostic information within its specialty. This candidate diagnostic information typically includes several specific candidate diagnoses, the first confidence level for each candidate diagnosis, and the diagnostic evidence supporting the diagnosis. For example, a cardiovascular specialty primary language model might output "coronary artery disease" as a candidate diagnosis, along with its corresponding confidence level and detailed diagnostic evidence.
[0033] S130: Input each candidate diagnostic information into the pre-trained second language model. The second language model performs weighted fusion processing on different candidate diagnostic information based on a preset multi-head self-attention mechanism to generate diagnostic assistance results. The diagnostic assistance results include the target diagnosis and the second confidence level corresponding to the target diagnosis.
[0034] Specifically, after receiving candidate diagnostic information, the second language model can identify and evaluate the relative importance of information provided by different specialty first language models through a pre-set multi-head self-attention mechanism, and assign different weights accordingly. For example, for a case mainly presenting with cardiac symptoms, the second language model may assign higher weights to the candidate diagnostic information output by the cardiovascular specialty first language model. Through this weighted fusion processing, the second language model can comprehensively consider professional opinions from multiple specialties, thereby generating a more comprehensive and accurate diagnostic assistance result. The diagnostic assistance result includes a target diagnosis and the corresponding second confidence level. The target diagnosis is the final diagnostic suggestion derived by the second language model after comprehensive analysis, and the second confidence level indicates the degree of certainty of the second language model regarding the target diagnosis.
[0035] For example, when a target patient (e.g., a 62-year-old male patient) seeks medical attention due to elevated blood pressure and blood sugar, the patient's medical history data can be obtained. This medical history data may include the patient's chief complaint, physical signs (e.g., blood pressure 160 / 95 mmHg, BMI 28.5 kg / m²), and laboratory test results (e.g., fasting blood glucose 8.2 mmol / L, 2-hour postprandial blood glucose 11.8 mmol / L, glycated hemoglobin 7.2%). Subsequently, this medical history data is input in parallel into the first major language model of the five specialties mentioned above. Each major language model independently analyzes and infers from the medical history data and generates its own candidate diagnostic information. For example, the primary language model for endocrinology and metabolism might output "type 2 diabetes" as a high-confidence candidate diagnosis, providing detailed diagnostic evidence such as blood glucose and glycated hemoglobin levels exceeding diagnostic criteria, and the patient's age and weight conforming to the characteristics of type 2 diabetes. The primary language model for cardiovascular diseases might output "grade 2 hypertension" as a high-confidence candidate diagnosis, explaining that the patient's blood pressure meets the criteria for grade 2 hypertension, and that they also have diabetes and are overweight, placing them in a high-risk cardiovascular population. The primary language models for respiratory, digestive, and neurological diseases may not provide a definitive diagnosis, but will offer potential comorbidities or exclusionary diagnoses based on disease progression data, generating corresponding confidence levels and diagnostic evidence. For example, a respiratory model might suggest obstructive sleep apnea syndrome, and a digestive model might suggest obstructive sleep apnea syndrome. The model can suggest non-alcoholic fatty liver disease, and the nervous system model can generate diabetic peripheral neuropathy. These candidate diagnostic information generated by five primary language models are then input into a pre-trained secondary language model. This secondary language model utilizes its internal multi-head self-attention mechanism to intelligently weight and fuse this information from different specialties. It then identifies diagnoses from the endocrine metabolism and cardiovascular models as having high first-level confidence and automatically assigns higher weights to these two specialties based on their diagnostic supporting text. Finally, the secondary language model generates diagnostic assistance results. For example, the diagnostic assistance results might include "type 2 diabetes" as the target diagnosis with a high second-level confidence (e.g., 0.82), while also identifying "grade 2 hypertension" as an important comorbidity with a second-level confidence (e.g., 0.71). Furthermore, the results will list potential items requiring attention, such as "non-alcoholic fatty liver disease," "obstructive sleep apnea syndrome," and "diabetic peripheral neuropathy," thus providing the patient with comprehensive and multi-dimensional diagnostic assistance suggestions, solving the problem that a single model cannot fully utilize multi-specialty knowledge.
[0036] Compared to the "N-choose-1" single-model working mode in related technologies, this embodiment adopts an "N→1" multi-agent parallel collaboration and intelligent fusion architecture. In the example above, when the patient's medical history data is input, instead of selecting an optimal specialty model for diagnosis, the primary language models of five specialties—cardiovascular, respiratory, digestive, endocrine metabolism, and nervous system—perform reasoning simultaneously in parallel. This parallel processing ensures that the expertise of all relevant specialties is fully utilized, avoiding the problem in related technologies where selecting a single model leads to the complete discarding of knowledge from other specialties. For example, in cases where patients simultaneously have elevated blood sugar and blood pressure, a single model might only be able to identify one of the problems. However, this embodiment, through parallel inference, can simultaneously obtain professional opinions from endocrinology and metabolism specialists and cardiovascular specialists. At the same time, it can input all the complete candidate diagnostic information generated by each first language model, including the specific candidate diagnosis, the corresponding first confidence level, and the detailed diagnostic basis text, into the second language model for fusion processing. The second language model can dynamically adjust the degree of attention given to the output information of different specialist models according to the patient's actual symptoms, thereby generating a more comprehensive, accurate, and clinically guiding diagnostic assistance result.
[0037] This application discloses a multi-agent-based medical diagnostic assistance method, comprising: acquiring the patient's medical history data; inputting the medical history data in parallel into multiple preset first-level language models to obtain multiple candidate diagnostic information; wherein each first-level language model corresponds to a medical specialty, and each candidate diagnostic information includes several candidate diagnoses, a first confidence level corresponding to the candidate diagnoses, and diagnostic criteria; inputting each candidate diagnostic information into a pre-trained second-level language model, which performs weighted fusion processing on different candidate diagnostic information based on a preset multi-head self-attention mechanism to generate a diagnostic assistance result; wherein the diagnostic assistance result includes the target diagnosis and a second confidence level corresponding to the target diagnosis. This method enables diagnostic analysis of the user's medical history data through multiple first-level and second-level language models to obtain diagnostic assistance results, thereby improving the efficiency and accuracy of assisted diagnosis and enhancing the user experience.
[0038] In one possible implementation, before inputting each candidate diagnostic information into the pre-trained second large language model, the method further includes: extracting M candidate diagnostic results, the first confidence level corresponding to the candidate diagnosis, and the diagnostic basis from the candidate diagnostic information; where M is an integer greater than or equal to 2; and concatenating the M candidate diagnoses, the first confidence level corresponding to the candidate diagnosis, and the diagnostic basis according to a preset template to obtain structured text for input into the second large oracle model.
[0039] Specifically, from the candidate diagnostic information generated by the first major language model in each medical specialty, the most representative or relevant M candidate diagnoses and their corresponding first confidence levels and diagnostic criteria can be selected. For example, the candidate diagnoses can be ranked based on the first confidence level, and the top M diagnoses can be selected. Then, the selected M candidate diagnoses and their related information can be converted into a unified and standardized format so that the second major language model can process them accurately and eliminate the differences in the output formats of different first major language models. For example, a specific natural language template can be set to organize this information into coherent sentences, such as "The diagnosis is [diagnosis name], the confidence level is [confidence level value], and the basis is [diagnostic criteria]".
[0040] In one possible implementation, the disease course data is input in parallel into multiple preset first large language models to obtain multiple candidate diagnostic information, including: The first confidence level is calculated using the following formula:
[0041] in, ; The j-th candidate diagnosis is output by the i-th largest language model. Let be the unnormalized score value output by the i-th largest language model for the j-th candidate diagnosis; M represents the first confidence level of a candidate diagnosis; M is the confidence level for each first-degree diagnosis. The number of candidate diagnoses output by the model; where the constraints include: .
[0042] For example, the first major language model corresponds to cardiology, respiratory medicine, gastroenterology, neurology, and endocrinology. After obtaining the target patient's disease progression data, this data is input into these five specialty models in parallel. Taking the first major language model for cardiology as an example, it can output three candidate diagnoses based on the disease progression data, such as "coronary heart disease," "myocarditis," and "arrhythmia," and provide the corresponding unnormalized score z for each. 11 z 12 z 13 Then, the first confidence level C corresponding to coronary heart disease is calculated using the above formula. 11 And calculate the first confidence level C for myocarditis and arrhythmia. 12 and C 13The first language model outputs the first confidence score of each candidate diagnosis. Subsequently, these candidate diagnosis information with unified confidence scores are input into the pre-trained second language model, which performs weighted fusion based on a multi-head self-attention mechanism, and finally generates a diagnostic assistance result containing the target diagnosis and its second confidence score. This can improve the judgment ability of the medical diagnostic assistance system and reduce the risk of misdiagnosis.
[0043] In one possible implementation, the training process of the second large language model includes: acquiring disease course data samples and real diagnostic results corresponding to multiple target cases; inputting the disease course data samples into multiple first large language models respectively to obtain several diagnostic information samples; generating training input text by taking the disease course data samples and several diagnostic information samples corresponding to each target case according to a predetermined format; using the training input text as input features and the real diagnostic results corresponding to the target cases as output labels as training samples to form a training sample set; using the training sample set as training data, iteratively training the preset large language model based on a preset optimization loss function until the preset large language model converges to obtain the second large language model; wherein, the preset optimization loss function is to minimize the cross-entropy loss between the predicted diagnosis and the real diagnostic results of the large language model.
[0044] For example, one million complete course data sets of confirmed cases can be retrieved from an electronic medical record database, along with their corresponding final diagnoses. These constitute the course data samples and the actual diagnostic results. For instance, a course data sample might include the patient's symptom description, physical examination data, laboratory test reports, and imaging results, with the actual diagnosis being "type 2 diabetes." These one million course data samples are then input one by one into several pre-deployed specialty models, such as the "Endocrinology Specialty First Language Model," the "Cardiovascular Specialty First Language Model," and the "Nephrology Specialty First Language Model." Each first language model outputs its corresponding candidate diagnosis, first confidence level, and diagnostic criteria for each course data sample, forming several diagnostic information samples. For example, for a course data set of "type 2 diabetes," the endocrinology specialty model might output "type 2 diabetes (confidence level 0.95)," the cardiovascular specialty model might output "hypertension (confidence level 0.8)," and the nephrology model might output "early diabetic nephropathy (confidence level 0.7)." Subsequently, each original disease course data sample and its corresponding diagnostic information samples output by the first major language model for all specialties are concatenated in a unified JSON format to generate training input text. Then, using these generated JSON-formatted training input texts as input features and the actual diagnostic results of the original cases (e.g., "type 2 diabetes") as output labels, a training sample set of millions is constructed. For example, a training sample is a pair (JSON training input text, actual diagnostic result). Finally, this training sample set is input into a pre-defined major language model based on the Transformer architecture for training. During training, the model continuously adjusts its internal parameters, aiming to minimize the cross-entropy loss between its predicted diagnostic results and the actual diagnostic results. For example, if the model predicts a probability of 0.7 for "type 2 diabetes" and the actual diagnosis is "type 2 diabetes," the loss is small; if the model predicts a probability of 0.7 for "hypertension," the loss is large. Through millions of iterations of training, the model reaches convergence when the cross-entropy loss on the validation set no longer decreases significantly. At this point, a second major language model capable of effectively fusing multi-specialty diagnostic information and outputting accurate diagnostic assistance results is obtained.
[0045] In one possible implementation, the preset optimization loss function is: L = -Σ_{n=1}^{N} log P(y_n | X_n) Where L is the cross-entropy loss and N is the number of samples in the training sample set.
[0046] Specifically, L represents the cross-entropy loss. The closer the model's prediction is to the true label, the smaller the cross-entropy loss value. y_n is the true label, and P is the probability that the model predicts a positive class. During training, when the model receives the training input text X_n (which contains course data samples of the target case and several diagnostic information samples), it generates a probability distribution of potential diagnostic results. By accumulating the losses of all N training samples and iteratively training on this basis, the model parameters are continuously adjusted to minimize the total loss L. This enables the model to more accurately map input features to the correct diagnostic results and assign higher prediction probabilities to the true diagnostic results.
[0047] In one possible implementation, the method further includes: inputting the training sample set into a second large language model, and obtaining the target number of candidate diagnoses in the candidate diagnostic information using a preset Top-(M) recall rate calculation formula; wherein the preset Top-(M) recall rate calculation formula includes:
[0048] in, The total number of training samples in the training sample set; For the training sample set, the first One training sample; For the first The actual diagnostic results corresponding to each training sample; For the second largest language model targeting the first The output of each training sample Candidate diagnostic set; This is an indicator function that takes the value 1 when the condition inside the parentheses is true and takes the value 0 when the condition inside the parentheses is false.
[0049] Specifically, the pre-defined Top-(M) recall formula can be used to measure the model's ability to include the true target in the first M predicted results. By calculating the Top-(M) recall, the recall performance of the model under different M values (i.e. different numbers of candidate diagnoses) can be analyzed, thereby selecting an M value that can ensure a high recall rate while avoiding information overload as the target number. For example, a recall threshold can be set, and then the minimum M value that meets the threshold can be found. By calculating the pre-defined Top-(M) recall, the model's performance under different numbers of candidate diagnoses can be quantified, thereby determining the optimal number of candidate diagnosis outputs, which helps to improve the accuracy and practicality of diagnostic assistance results.
[0050] In one possible implementation, the disease course data includes at least symptom description information, physical signs information, laboratory test results, and imaging test results.
[0051] This application discloses a multi-agent-based medical diagnostic assistance method, comprising: acquiring the patient's medical history data; inputting the medical history data in parallel into multiple preset first-level language models to obtain multiple candidate diagnostic information; wherein each first-level language model corresponds to a medical specialty, and each candidate diagnostic information includes several candidate diagnoses, a first confidence level corresponding to the candidate diagnoses, and diagnostic criteria; inputting each candidate diagnostic information into a pre-trained second-level language model, which performs weighted fusion processing on different candidate diagnostic information based on a preset multi-head self-attention mechanism to generate a diagnostic assistance result; wherein the diagnostic assistance result includes the target diagnosis and a second confidence level corresponding to the target diagnosis. This method enables diagnostic analysis of the user's medical history data through multiple first-level and second-level language models to obtain diagnostic assistance results, thereby improving the efficiency and accuracy of assisted diagnosis and enhancing the user experience.
[0052] Corresponding to the aforementioned application function implementation method embodiments, this application also provides a medical diagnostic auxiliary device, electronic device, and corresponding embodiments based on multi-agent systems.
[0053] Figure 2 This is a schematic diagram of the structure of a multi-agent-based medical diagnostic auxiliary device shown in an embodiment of this application.
[0054] See Figure 2 A multi-agent-based medical diagnostic auxiliary device 200, comprising: The acquisition module 210 is used to acquire the disease course data of the target object; The processing module 220 is used to input the disease course data in parallel into multiple preset first large language models to obtain multiple candidate diagnostic information; wherein, any first large language model corresponds to a medical specialty field, and each candidate diagnostic information includes several candidate diagnoses, the first confidence level of the candidate diagnosis, and the diagnostic basis; The generation module 230 is used to input each candidate diagnostic information into the pre-trained second language model. The second language model performs weighted fusion processing on different candidate diagnostic information based on a preset multi-head self-attention mechanism to generate diagnostic assistance results. The diagnostic assistance results include the target diagnosis and the second confidence level corresponding to the target diagnosis.
[0055] In one possible implementation, the processing module 220 is further configured to extract M candidate diagnostic results, the first confidence level corresponding to the candidate diagnosis, and the diagnostic basis from the candidate diagnostic information; wherein M is an integer greater than or equal to 2; and to concatenate the M candidate diagnoses, the first confidence level corresponding to the candidate diagnosis, and the diagnostic basis according to a preset template to obtain structured text for input to the second oracle model.
[0056] In one possible implementation, the generation module 230 is further configured to calculate the first confidence level using the following formula:
[0057] in, ; The j-th candidate diagnosis is output by the i-th largest language model. Let be the unnormalized score value output by the i-th largest language model for the j-th candidate diagnosis; M represents the first confidence level of a candidate diagnosis; M is the confidence level for each first-degree diagnosis. The number of candidate diagnoses output by the model; where the constraints include: .
[0058] In one possible implementation, the processing module 220 is further configured to acquire course data samples and actual diagnostic results corresponding to multiple target cases; input the course data samples into multiple first large language models respectively to obtain several diagnostic information samples; generate training input text according to a predetermined format using the course data samples and several diagnostic information samples corresponding to each target case; use the training input text as input features and the actual diagnostic results corresponding to the target cases as output labels as training samples to form a training sample set; use the training sample set as training data and iteratively train the preset large language model based on a preset optimization loss function until the preset large language model converges to obtain a second large language model; wherein, the preset optimization loss function is to minimize the cross-entropy loss between the predicted diagnosis and the actual diagnostic results of the large language model.
[0059] In one possible implementation, the processing module 220 is further configured to use a preset optimization loss function as follows: L = -Σ_{n=1}^{N} log P(y_n | X_n) Where L is the cross-entropy loss and N is the number of samples in the training sample set.
[0060] In one possible implementation, the processing module 220 is further configured to input the training sample set into the second language model, and obtain the target number of candidate diagnoses in the candidate diagnostic information using a preset Top-(M) recall formula; wherein the preset Top-(M) recall formula includes:
[0061] in, The total number of training samples in the training sample set; For the training sample set, the first One training sample; For the first The actual diagnostic results corresponding to each training sample; For the second largest language model targeting the first The output of each training sample Candidate diagnostic set; This is an indicator function that takes the value 1 when the condition inside the parentheses is true and takes the value 0 when the condition inside the parentheses is false.
[0062] In one possible implementation, the acquisition module is also used to acquire disease course data including at least symptom description information, physical signs information, laboratory test results, and imaging test results.
[0063] This application discloses a multi-agent-based medical diagnostic assistance device, comprising: an acquisition module for acquiring the medical history data of a target object; a processing module for inputting the medical history data in parallel into multiple preset first-level language models to obtain multiple candidate diagnostic information; wherein each first-level language model corresponds to a medical specialty, and each candidate diagnostic information includes several candidate diagnoses, a first confidence level corresponding to the candidate diagnoses, and diagnostic criteria; and a generation module for inputting each candidate diagnostic information into a pre-trained second-level language model, which performs weighted fusion processing on different candidate diagnostic information based on a preset multi-head self-attention mechanism to generate a diagnostic assistance result; wherein the diagnostic assistance result includes the target diagnosis and a second confidence level corresponding to the target diagnosis. This method enables diagnostic analysis of the user's medical history data through multiple first-level and second-level language models to obtain diagnostic assistance results, thereby improving the efficiency and accuracy of assisted diagnosis and enhancing the user experience.
[0064] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated further here.
[0065] This application also provides an electronic device. Figure 3 This is a schematic diagram of the hardware structure of an embodiment of the electronic device of this application. The electronic device includes a memory 320 and at least one processor 310. The memory 320 is electrically connected to the at least one processor 310. The memory 320 stores instructions. The at least one processor 310 calls the instructions in the memory 320, causing the electronic device to execute the multi-agent-based medical diagnostic assistance method according to any of the foregoing embodiments of this application.
[0066] Specifically, the processor 310 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0067] Memory 320 may include a mass storage device for data or instructions. For example, and not limitingly, memory 320 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 320 may include removable or non-removable (or fixed) media. Where appropriate, memory 320 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 320 is non-volatile solid-state memory. In a particular embodiment, memory 320 includes read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0068] In one example, the control device may also include a communication interface 330 and a bus 340. The processor 310, memory 320, and communication interface 330 are connected via the bus 340 and communicate with each other.
[0069] The communication interface 330 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0070] Bus 340 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 340 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.
[0071] Furthermore, in conjunction with the multi-agent-based medical diagnostic assistance method in the above embodiments, this application embodiment can provide a computer-readable storage medium for implementation. This computer-readable storage medium stores executable code, which, when executed by a processor, implements any of the multi-agent-based medical diagnostic assistance methods in the above embodiments.
[0072] This application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0073] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0074] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0075] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A medical diagnostic assistance method based on multi-agent systems, characterized in that, include: Obtain the disease course data of the target subject; The disease course data is input in parallel into multiple preset first large language models to obtain multiple candidate diagnostic information; wherein, any first large language model corresponds to a medical specialty field, and each candidate diagnostic information includes several candidate diagnoses, the first confidence level corresponding to the candidate diagnosis, and the diagnostic basis; Each candidate diagnostic information is input into a pre-trained second language model. The second language model performs weighted fusion processing on the different candidate diagnostic information based on a preset multi-head self-attention mechanism to generate a diagnostic assistance result. The diagnostic assistance result includes the target diagnosis and the second confidence level corresponding to the target diagnosis.
2. The method according to claim 1, characterized in that, Before inputting each of the candidate diagnostic information into the pre-trained second large language model, the method further includes: Extract M candidate diagnostic results, the first confidence level of each candidate diagnosis, and the diagnostic basis from the candidate diagnostic information; where M is an integer greater than or equal to 2. The M candidate diagnoses, their corresponding first confidence levels, and diagnostic criteria are concatenated according to a preset template to obtain structured text for input into the second major oracle model.
3. The method according to claim 1, characterized in that, The process involves inputting the disease course data in parallel into multiple preset first-level language models to obtain multiple candidate diagnostic information, including: The first confidence level is calculated using the following formula: in, ; The j-th candidate diagnosis is output by the i-th largest language model. Let be the unnormalized score value output by the i-th largest language model for the j-th candidate diagnosis; M represents the first confidence level of the candidate diagnosis; M is the confidence level of each first... The number of candidate diagnoses output by the model; where the constraints include: .
4. The method according to claim 1, characterized in that, The training process of the second major language model includes: Acquire disease course data samples and actual diagnostic results corresponding to multiple target cases; The disease course data samples are input into multiple first large language models respectively to obtain several diagnostic information samples; The course data sample and several diagnostic information samples corresponding to each target case are used to generate training input text according to a predetermined format; The training input text is used as the input feature, and the actual diagnosis result corresponding to the target case is used as the output label as the training sample to form a training sample set. The training sample set is used as training data, and a preset large language model is iteratively trained based on a preset optimization loss function until the preset large language model converges to obtain the second large language model; wherein, the preset optimization loss function is to minimize the cross-entropy loss between the predicted diagnosis and the actual diagnosis result of the large language model.
5. The method according to claim 4, characterized in that, The preset optimization loss function is: L = -Σ_{n=1}^{N} log P(y_n | X_n) Where L is the cross-entropy loss; N is the number of samples in the training sample set.
6. The method according to claim 4, characterized in that, Also includes: The training sample set is input into the second large language model, and the target number of candidate diagnoses in the candidate diagnostic information is obtained by using the preset Top-(M) recall rate calculation formula. The preset Top-(M) recall calculation formula includes: in, The total number of training samples in the training sample set; For the training sample set, the first One training sample; For the first The actual diagnostic results corresponding to each training sample; For the second largest language model targeting the first The output of each training sample Candidate diagnostic set; This is an indicator function that takes the value 1 when the condition inside the parentheses is true and takes the value 0 when the condition inside the parentheses is false.
7. The method according to claim 1, characterized in that, The disease progress data includes at least symptom descriptions, physical signs, laboratory test results, and imaging results.
8. A medical diagnostic auxiliary device based on multi-agent technology, characterized in that, include: The acquisition module is used to acquire the disease course data of the target object; The processing module is used to input the disease course data in parallel into multiple preset first large language models to obtain multiple candidate diagnostic information; wherein, any first large language model corresponds to a medical specialty field, and each candidate diagnostic information includes several candidate diagnoses, the first confidence level corresponding to the candidate diagnosis, and diagnostic basis; The generation module is used to input each candidate diagnostic information into a pre-trained second language model. The second language model performs weighted fusion processing on different candidate diagnostic information based on a preset multi-head self-attention mechanism to generate diagnostic assistance results. The diagnostic assistance results include the target diagnosis and the second confidence level corresponding to the target diagnosis.
9. An electronic device, characterized in that, include: processor; as well as A memory having executable code stored thereon, which, when executed by the processor, causes the processor to perform the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, It stores executable code that, when executed by a processor of an electronic device, causes the processor to perform the method as described in any one of claims 1-7.