Liver cancer clinical decision support method and system based on large language model, and medium
By combining incremental pre-training and supervised fine-tuning with image feature extraction and physician feedback mechanisms, the problem of insufficient understanding of medical terminology in liver cancer diagnosis by large language models has been solved, achieving high-quality multimodal diagnostic support and improving the accuracy and accessibility of liver cancer diagnosis.
Patent Information
- Application Number
- CN202511396056.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-28
- Publication Date
- 2025-11-28
AI Technical Summary
Traditional large language models lack understanding of medical terminology and clinical logic in liver cancer diagnosis, resulting in factual errors. Furthermore, the scarcity and complexity of data lead to insufficient diagnostic accuracy and accessibility.
We adopted a three-stage training strategy of incremental pre-training, supervised fine-tuning, and preference alignment. Through a federated learning framework, we injected medical guidelines and expert experience in the field of liver cancer into the large language model. Combined with the image feature extraction model, we constructed a multimodal clinical reasoning instruction set and introduced a doctor feedback mechanism to optimize the model output.
The model can accurately interpret image data and text reports, generate detailed intermediate reasoning, enhance diagnostic logic and terminology, and improve the credibility and verifiability of diagnostic recommendations.
Smart Images

Figure CN121034603A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, more particularly, to a liver cancer clinical decision support method and system based on a large language model and a medium. BACKGROUND
[0002] Liver cancer is one of the malignant tumors with high morbidity and mortality worldwide, and its diagnosis and treatment process involves complex clinical decision-making. Traditional clinical decision-making highly depends on the professional knowledge and experience of doctors, but in areas where medical resources are unevenly distributed, primary medical institutions often lack experienced liver cancer specialists. At the same time, the diagnosis of liver cancer requires the integration of multi-modal data such as imaging reports, laboratory tests, and pathological results, and the decision-making process involves a large amount of professional knowledge and complex logical reasoning, which puts high demands on the comprehensive ability of doctors. In recent years, the excellent performance of large language models (LLM) in general fields has triggered new opportunities in the field of medical artificial intelligence, and how to use these advanced technologies to improve the accuracy and accessibility of liver cancer clinical decision-making has become an important research direction with important clinical value.
[0003] Large language models have shown potential in medical question answering, literature abstract generation, and other tasks due to their strong natural language processing capabilities and knowledge reserves. Such models can quickly search and analyze massive medical literature to assist doctors in obtaining the latest diagnosis and treatment guidelines and research findings. However, general large language models have significant limitations in professional medical scenarios: on the one hand, the models lack a deep understanding of medical terminology and clinical logic; on the other hand, their generated content may contain factual errors or not comply with medical standards, posing safety risks. Training models for specialized fields such as liver cancer faces multiple challenges such as data scarcity, knowledge specialization, and complex reasoning: therefore, how to obtain high-quality data with long reasoning chains and conduct comprehensive reasoning based on patient clinical data is a pressing problem. SUMMARY
[0004] To solve the above technical problems, the present application proposes a liver cancer clinical decision support method and system based on a large language model and a medium, which efficiently injects medical guidelines, clinical data, and expert experience in the liver cancer field into a large language model through a three-stage training strategy of incremental prediction practice, supervised fine-tuning, and preference alignment, enabling the model to master accurate diagnostic logic and terminology expression.
[0005] The first aspect of the present application provides a liver cancer clinical decision support method based on a large language model, comprising the following steps:
[0006] S1: Collect professional corpus in the field of liver cancer, use incremental pre-training under the federated learning framework combined with parameter efficient fine-tuning technology to inject field knowledge into the large language model base, and obtain a field-enhanced model;
[0007] S2: Based on real clinical data, a large language model is used to fuse the structured features output by the image feature extraction model to synthesize a high-quality liver cancer clinical reasoning instruction set containing intermediate reasoning basis, and the field enhanced model is fine-tuned with the high-quality liver cancer clinical reasoning instruction set to obtain an instruction fine-tuning model;
[0008] S3: Constructing positive and negative sample pairs and introducing a doctor real-time feedback mechanism, a grouping relative strategy optimization algorithm and a Monte Carlo tree search are used to train the instruction fine-tuning model, so that the model output aligns with the preferences of human experts, and a final liver cancer auxiliary diagnosis large language model is obtained;
[0009] S4: Receiving a decision request containing target patient clinical data, inputting the decision request into the liver cancer auxiliary diagnosis large language model, and obtaining the structured results output by the model containing auxiliary decision suggestions and reasoning basis.
[0010]
[0011] The loss function L GRPO is represented as:
[0012]
[0013] Where N is the batch size, A i is the response of the i-th sample obtained by Monte Carlo tree search sampling, x i is the input instruction of the i-th sample, π θ is the instruction fine-tuning model to be optimized, Advantage(A i | x i ) is the advantage function, Advantage(A i | x i ) = R(A i | x i ) - R(y- | x i ), R is the reward model, β is the regularization coefficient, represents the expectation of the sampled instruction x in the data distribution D, KL is the divergence, π ref is the initial instruction fine-tuning model.
[0014] Monte Carlo tree search can efficiently explore the vast response space under the guidance of the reward model, find positive samples with much higher quality than simple model sampling, and accelerate the convergence of the alignment process.
[0015] In this scheme, receiving a decision request containing target patient clinical data, inputting the decision request into the liver cancer auxiliary diagnosis large language model, and obtaining the structured results output by the model containing auxiliary decision suggestions and reasoning basis, including:
[0016] The liver cancer auxiliary diagnosis large language model is deployed, receives instructions from the front end through a pre-defined RESTful API interface, verifies the legality and integrity of the request parameters, converts the clinical data in JSON format transmitted by the front end into the prompt format required by the model, and performs inference calculation on the liver cancer auxiliary diagnosis large language model.
[0017] The pre-processed prompt text is sent to an inference engine, a set of preset decoding parameters is configured for this inference call, the inference engine inputs the formatted prompt into the liver cancer auxiliary diagnosis large language model, performs autoregressive generation, and gradually outputs each token to finally form a complete answer.
[0018] The answer generated by the model is structurally parsed, and the structured result and the original request ID are encapsulated into JSON format and returned to the front end.
[0019] The second aspect of the application provides a liver cancer clinical decision support system based on a large language model, which comprises a data management module, a model training and optimization module, a model deployment and management module, an API interface module, a high-performance inference module and a front-end application module.
[0020] The data management module collects, cleans, labels, stores and manages multi-source heterogeneous medical data, obtains a text corpus for pre-training and an instruction pair data set for fine-tuning.
[0021] The model training and optimization module uses incremental pre-training combined with parameter efficient fine-tuning technology, injects domain knowledge into the large language model base to obtain a domain enhanced model, synthesizes a high-quality liver cancer clinical reasoning instruction set containing intermediate reasoning basis based on real clinical data using the large language model, and uses the high-quality instruction set to supervise the fine-tuning of the domain enhanced model to obtain an instruction fine-tuning model, constructs positive and negative sample pairs, and trains the instruction fine-tuning model using a direct preference optimization algorithm to align the model output with human expert preferences to obtain a final liver cancer auxiliary diagnosis large language model.
[0022] The model deployment and management module deploys the trained model to a production environment and provides continuous model lifecycle management to obtain a liver cancer auxiliary diagnosis large language model instance ready for loading.
[0023] The API interface module receives requests sent from the front end, verifies the legality and integrity of the request parameters, converts the clinical data in JSON format transmitted by the front end into the prompt format required by the model, receives the results of the inference module, encapsulates them into standardized JSON format and returns them to the front end.
[0024] The high-performance inference module loads and performs inference calculation on the liver cancer auxiliary diagnosis large language model.
[0025] The front-end application module provides an interactive interface for the user, including a data input interface and a result display interface, and collects the use feedback of the doctor, for subsequent iteration and optimization of the model.
[0026] Compared with the prior art, the beneficial effects of the present application are:
[0027] The present application overcomes the limitations of traditional methods relying on single text description by integrating image feature extraction model and large language model. The system can process patient's image visual information and text report data in parallel. The model not only interprets the written conclusions of radiologists, but also directly analyzes the deep visual patterns in the image. Through the three-stage training strategy of incremental prediction training, supervised fine-tuning and human preference alignment, the medical guidelines, clinical data and expert experience in the field of liver cancer are efficiently injected into the model, enabling it to master precise diagnostic logic and terminology expression. Using the powerful generation capability of the large language model, the instruction-answer pairs containing detailed intermediate reasoning basis are automatically synthesized. These data clearly show the complete logical chain from the original clinical evidence to the final diagnosis conclusion, making the trained model not only able to give diagnosis suggestions, but also to gradually explain its judgment basis, greatly enhancing the trust and verifiability of the model output for doctors. BRIEF DESCRIPTION OF DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments or examples of the present application, the following will briefly introduce the drawings needed to be used in the embodiment or example description. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor.
[0029] Figure 1 A flowchart of a liver cancer clinical decision support method based on a large language model is shown;
[0030] Figure 2 A flowchart of obtaining a high-quality liver cancer clinical reasoning instruction set is shown;
[0031] Figure 3 A flowchart of training a liver cancer auxiliary diagnosis large language model is shown;
[0032] Figure 4 A block diagram of a liver cancer clinical decision support system based on a large language model is shown. DETAILED DESCRIPTION
[0033] In order to more clearly illustrate the technical solutions in the embodiments or examples of the present application, the following will briefly introduce the drawings needed to be used in the embodiment or example description. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor.
[0034] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. However, it will be apparent to one skilled in the art that the present application can be practiced without the specific details set forth in this description.
[0035] Figure 1 A flowchart of a liver cancer clinical decision support method based on a large language model is shown.
[0036] S1: Collect professional corpus in the field of liver cancer, use incremental pre-training under the federated learning framework combined with parameter efficient fine-tuning technology to inject domain knowledge into the large language model base, and obtain a domain enhanced model;
[0037] S2: Based on real clinical data, use a large language model to fuse structured features output by an image feature extraction model, synthesize a high-quality liver cancer clinical reasoning instruction set containing intermediate reasoning basis, and use the high-quality liver cancer clinical reasoning instruction set to supervise the instruction fine-tuning of the domain enhanced model, and obtain an instruction fine-tuning model;
[0038] S3: Construct positive and negative sample pairs, and introduce a doctor real-time feedback mechanism, use a grouping relative strategy optimization algorithm and a Monte Carlo tree search to train the instruction fine-tuning model, align the model output with human expert preferences, and obtain a final liver cancer auxiliary diagnosis large language model;
[0039] S4: Receive a decision request containing target patient clinical data, input the decision request into the liver cancer auxiliary diagnosis large language model, and obtain structured results containing auxiliary decision suggestions and reasoning basis output by the model.
[0040] It should be noted that the professional corpus related to liver cancer is collected for data cleaning, desensitization and format standardization processing, an incremental pre-training data set is constructed, and the professional corpus includes medical textbooks, medical guidelines, medical papers, de-identified real clinical electronic medical record texts, and pre-screened medical question and answer pairs. The server selects and initializes a preset large language model base (such as Qwen2-7B-Base) as a global model, in each round of training, the server randomly selects part of the medical center clients to participate in this round of training, and distributes the current global model to the selected medical center clients; each medical center client uses the local data to use the LoRA algorithm to perform incremental pre-training on the downloaded model using standard autoregressive language modeling, so that the large language model base learns the association between medical vocabulary, the specific meaning of medical terminology and the logical structure of clinical description in the incremental pre-training data set;
[0041] Each client freezes the original parameters θ of the large language model base using the LoRA algorithm during local training baseDuring the training process, the original parameters that remain frozen are kept unchanged, and a pair of low-rank decomposition matrices are introduced at the attention layer, usually beside the query Q, key K, value V and output O matrices of the Attention layer. The incremental pre-training dataset is input to the large language model base, and by minimizing the cross-entropy loss, the low-rank decomposition matrices A and B of the LoRA adapter are iteratively updated to obtain the parameter increment During the training process, the cross-entropy loss function is minimized The parameter update is realized as follows:
[0042]
[0043] wherein represents the word unit that should actually appear at the t-th position of the i-th sample, represents the one-hot encoding vector of the true label, the true word unit at the t-th position of the i-th sample, T represents the sequence length, N represents the batch size, and θ represents the model parameters, represents the preceding context, which refers to all the word units before the t-th position in the i-th sample.
[0044] During the client local training process, noise is added to protect data privacy, so that the final uploaded model update cannot be used to infer the original information of any single patient. The differential privacy technique is applied to add noise to the gradient, and the LoRA adapter parameters obtained by training are uploaded after adding noise. The server collects the LoRA adapter parameters uploaded by each client, uses a secure aggregation protocol to summarize and calculate the average update applied to the global model; during the optimization process on the client side and the server side, the AdamW adaptive optimizer is used to dynamically adjust the learning rate for the LoRA parameters, and the convergence of the global model is evaluated, so as to accelerate the convergence and improve the performance of the final model. If the global model converges, the final field enhanced model is output.
[0045] It should be noted that, as shown in Figure 2 By fusing image visual features and text reports, a high-quality, multi-modal liver cancer clinical reasoning instruction set is synthesized. The instruction set includes image features, text descriptions, intermediate reasoning basis and final diagnosis, and the diversity and complexity of the data are further improved through a generative adversarial network, laying a foundation for training a more powerful multi-modal liver cancer auxiliary diagnosis model.
[0046] Structured clinical data of liver cancer patients is acquired, and image data elements and text data elements are extracted. The image data elements and the text data elements are data-aligned, a visual model pre-trained on a large natural image dataset is used to extract features from the image data elements, such as ResNet, Vision Transformer / ViT, a liver cancer CT / MRI image is input into the model to obtain a structured visual feature vector, which encodes visual information of the image, such as the shape, edge, enhancement method, and position of the tumor. Natural language processing is performed on the text report and other text data elements, and NER named entity recognition is used to obtain standardized text descriptions, such as converting obvious enhancement in the arterial phase to a standardized label. The structured visual feature vector and the standardized text description are interacted through cross-attention to generate a multi-modal representation vector. The multi-modal representation vector is used as conditional information, combined with a preset task instruction template to form a prompt word, and the prompt word is input into a preset large language model, such as GPT-4, to require the preset large language model to generate a text containing detailed intermediate reasoning basis and a final diagnosis answer, for example: 1. The visual features show a right lobe of liver occupying lesion with obvious enhancement in the arterial phase, which is consistent with the typical performance of liver cancer... 2. The text report indicates that there is no cancer embolus in the portal vein... In conclusion, the diagnosis result is: CNLC Ia stage liver cancer. The data pair (multi-modal representation vector, reasoning chain, diagnosis answer) is formatted into a standard format for instruction fine-tuning.
[0047] In order to simulate the complexity and diversity of data in the real world, a generative adversarial network is introduced, the (multi-modal representation vector, reasoning chain, diagnosis answer) data pair is introduced into the generative adversarial network, a generator generates a fake but realistic multi-modal feature vector according to a random noise vector and a diagnosis label, a discriminator judges the authenticity of the multi-modal feature vector, and the training is iterated until it cannot be determined whether the feature vector is real or generated; real multi-modal feature vectors and feature vectors generated by the generator are used as samples to train the discriminator to improve its ability to distinguish true and false, and the generator is trained to generate more realistic feature vectors that can deceive the discriminator. After the training of the generator is completed, a plurality of multi-modal feature vectors are obtained, and the generated multi-modal feature vectors are input into the preset large language model again to generate corresponding reasoning chains and diagnosis answers, thereby greatly expanding the size and diversity of the instruction set. The enhanced data pairs are divided into a training set, a validation set, and a test set to form a high-quality liver cancer clinical reasoning instruction set for supervised fine-tuning.
[0048] It should be noted that the synthesized high-quality multi-modal liver cancer clinical reasoning instruction set is used to fine-tune the domain enhanced model. Through the course learning strategy, the model learns from simple to deep, and through the weighted cross-entropy loss function, the rare cases are given higher weights, thereby significantly improving the model's diagnostic reasoning ability in complex and rare clinical scenarios, and obtaining a more balanced and powerful instruction fine-tuning model.
[0049] The domain enhanced model obtained by incremental pre-training is loaded into the training environment, and the training set, validation set and test set corresponding to the high-quality liver cancer clinical reasoning instruction set are loaded. Each sample format in the high-quality liver cancer clinical reasoning instruction set includes: instruction, input and output. The instruction describes the task that the model needs to perform, the input provides specific patient clinical data, and the output is the text generated by the model containing the complete reasoning chain and the final answer. The difficulty score of each sample in the training set is defined based on lesion complexity, feature typicality and diagnosis complexity. Lesion complexity is determined according to the number of lesions and tumor size, feature typicality is determined by judging whether the image and text features meet the typical performance of liver cancer, and diagnosis complexity is determined by typing and whether it is accompanied by complex complications. According to the difficulty score, simple samples, medium difficulty samples and difficult samples are divided. Simple samples are used to initialize training, so that the model first masters the most basic and most common patterns. The performance of the model on the current validation set is obtained through the course scheduler, such as loss no longer decreasing. According to the performance, the training phase is switched. When the model's performance on the validation set is stable, medium difficulty samples are introduced for further training, such as cases with slightly mixed features that need to be differentiated. Finally, difficult samples are introduced for training, such as rare cases or late complex cases with extremely atypical imaging performance and extremely easy misdiagnosis.
[0050] Because the number of samples of rare or complex cases is much less than that of ordinary cases. Standard cross-entropy loss treats all samples equally, leading the model to learn common patterns and not enough to fit rare cases. Each sample in the training set is assigned a weight based on the reciprocal of its frequency in the training set. For samples marked as rare or with a very high difficulty score, a larger weight is assigned. Standard autoregressive language modeling is used for fine-tuning. In training, the instruction, input and expected output are concatenated into a complete sequence, and the weighted cross-entropy loss function is used to calculate the loss of the output part. When the model makes a prediction error on a rare sample, a larger loss value will be generated, so that the model will pay more attention to parameter updating, forcing the model to learn rare patterns better. The weighted cross-entropy loss function L Weighted-SFT is represented as:
[0051]
[0052] where N is the batch size, w iis the sample weight, T is the sequence length, is the true label, the true token at the t-th position of the i-th sample, P θ is the probability distribution predicted by the model, is the token that should actually appear at the t-th position of the i-th sample, represents the context above, which refers to all tokens before the t-th position in the i-th sample.
[0053] In each batch, the weighted loss is calculated, and the gradient is backpropagated. Since the loss of rare samples is amplified, the gradient generated by them will also be larger, and the model parameters will be adjusted to a greater extent in the direction of better fitting these samples. Using the AdamW optimizer, all model parameters are updated according to the calculated loss gradient; during training, the model performance is evaluated on the validation set regularly, and the model checkpoint with the best performance on the validation set is saved as the final result. After training is completed, the final version of the model weight is saved, the instruction fine-tuned model is obtained, and the test set is used for preliminary evaluation.
[0054] It should be noted that by collecting the annotations and corrections of doctors on the model output, a dynamic preference dataset is dynamically constructed and updated, and a graph neural network is used to perform semantic association and enhancement on the feedback samples, so that the model can continuously learn the latest preferences of human experts. For each instruction in the high-quality liver cancer clinical reasoning instruction set, the instruction fine-tuned model generates several different candidate answers through a diversity sampling strategy, and introduces a doctor real-time feedback mechanism to obtain multi-dimensional evaluation feedback, including: overall evaluation, error labeling, and real-time correction, etc. According to the multi-dimensional evaluation feedback, positive samples and negative samples are divided, wherein the positive samples are the model outputs annotated as excellent by the doctors, or the revised versions provided by the doctors, and the negative samples are the original outputs of the model annotated as errors by the doctors, and a dynamic preference dataset is constructed (instruction x, positive sample y+, negative sample y-); the graph neural network can generate new and reasonable preference sample pairs by reasoning the semantic association between samples, thereby enriching the dataset. Each sample in the dynamic preference dataset is represented by a text embedding vector as a node, the cosine similarity between nodes is calculated to construct an edge structure, and the node and edge structure are used to generate a sample relationship graph; the graph neural network is used to perform representation learning on the sample relationship graph, the difficult instruction nodes are obtained according to the feedback frequency, the updated node representation of the difficult instruction nodes is obtained, and the new instructions are obtained by decoding the updated node representation; the graph structure features of the positive sample nodes and the negative sample nodes are obtained using the graph neural network, and new preference pairs (positive sample y+, negative sample y-) are generated according to the graph structure features, and the new instructions and new preference pairs are added to the dynamic preference dataset, thereby significantly expanding the size and diversity of the dataset at the semantic level.
[0055] It should be noted that, asFigure 3 As shown, a group competition mechanism is added to preference learning through a group relative policy optimization algorithm; and Monte Carlo tree search is used for prospective policy sampling to efficiently search for and lock high-quality response policies that conform to human preferences, so that the instruction fine-tuning model can be quickly and accurately aligned with human expert preferences, resulting in the final auxiliary diagnostic model for liver cancer.
[0056] Using the instruction fine-tuning model as the initial strategy, Monte Carlo tree search is used to sample from the preference dataset. For any instruction, positive samples are used as prior knowledge, and negative samples are used as the comparison benchmark. In the selection or expansion phase of the Monte Carlo tree search, positive samples y+ can serve as high-quality guiding paths. In the evaluation phase of the Monte Carlo tree search, one of the core tasks of the reward model R is to accurately determine the quality of the sequence A generated by the current Monte Carlo tree search simulation relative to the negative sample y-. The initial strategy is used for prospective search, and the reward model is evaluated using a reward model pre-trained with human expert preference data. The reward model typically consists of a pre-trained language model base plus a linear layer. Enhanced positive samples A+ are obtained by sampling, satisfying R(A+|x)>R(y-|x), and the expected value is R(A+|x)≈R(y+|x). A grouping relative strategy optimization algorithm is employed to group responses according to instructions. Each group contains negative samples, positive samples, and augmented samples. Negative samples come from the original preference dataset and represent unfavored responses, while positive samples come from the original preference dataset and represent favored responses. Augmented samples are high-quality responses generated for this round of training using Monte Carlo tree search. A reward model is used to calculate reward scores for all responses (negative, positive, and augmented samples) within a group to obtain the relative advantage of each response. A loss function is used to drive fine-tuning of the model to surpass negative sample responses and approach the augmented and enhanced samples, thereby updating the model parameters and obtaining the final large-scale language model for auxiliary diagnosis of liver cancer.
[0057] The loss function L GRPO Represented as:
[0058]
[0059] Where N is the batch size, A i Let x be the response obtained by Monte Carlo tree search for the i-th sample. i For the input instruction of the i-th sample, π θ For the instruction fine-tuning model to be optimized, Advantage(A) i |x i ) is the advantage function, Advantage(A) i |x i )=R(A i |x i )-R(y-∣xi R represents the reward model, and β is the regularization coefficient. This represents the expectation of the instruction x sampled from the data distribution D, where KL is the divergence and π is the inequality. ref This is the initial instruction fine-tuning model.
[0060] After completing the direct preference optimization training, the final large language model for liver cancer auxiliary diagnosis is obtained, and its output style is more in line with the preferences of human experts. Monte Carlo tree search, guided by the reward model, can efficiently explore the response space, sample high-quality positive samples, and accelerate the convergence of the alignment process. The grouping mechanism optimized by the grouping relative strategy constructs intra-group contrastive learning. Through direct comparison of negative and positive samples and augmented samples, the boundaries of human preferences can be learned more clearly.
[0061] It should be noted that a large-scale language model for auxiliary diagnosis of liver cancer is constructed through multi-stage model training. This trained model is then deployed in practical applications to provide doctors with real-time, structured, and interpretable clinical decision support, generating auxiliary decision suggestions for reference. Ultimately, the diagnosis still requires doctors to combine the model output with clinical experience. The deployment of the large-scale language model for auxiliary diagnosis of liver cancer involves receiving HTTP / HTTPS requests from the web or mobile app via a predefined RESTful API interface. Request instructions are typically encapsulated in JSON format, containing the following key fields: user_id: the identity identifier of the requesting doctor; request_id: the unique identifier for this request; task_type: the specific task type the model needs to perform; clinical_data: the clinical data text of the target patient. The API key, user permissions, and the legitimacy of the request source are verified to prevent malicious attacks. The JSON structure is checked for correctness, and required fields such as request_id and clinical_data are not missing. The incoming clinical_data is cleaned by removing extra spaces and line breaks, and then structurally concatenated into the prompt format required by the model.
[0062] The preprocessed prompt text is sent to the inference engine (vLLM), which loads and manages the final HCClinMed model, handling concurrent inference requests. A set of preset decoding parameters is configured for this inference call to balance the quality and creativity of the generated results. The inference engine inputs the formatted prompts into the large language model for liver cancer auxiliary diagnosis, performs autoregressive generation, and outputs each token step by step to form a complete answer. The model-generated answer is then structured and parsed, and the structured result, along with the original request ID, is encapsulated in JSON format and returned to the front-end client via an HTTP response. If errors such as model service unavailability or inference timeout occur during the inference process, the system will capture the exception and return a JSON response containing error information and the corresponding error status code. The large language model for liver cancer auxiliary diagnosis automatically transforms doctors' natural language descriptions into professional diagnostic suggestions, greatly improving efficiency. The output conclusions and inference basis help doctors understand and verify the model's judgments. Through API gateways, high-performance inference engines, and error handling mechanisms, the stability and high availability of the service are ensured, meeting the actual needs of clinical work.
[0063] Figure 4 A block diagram of a clinical decision support system for liver cancer based on a large language model is shown.
[0064] The second aspect of the present invention provides a clinical decision support system for liver cancer based on a large language model. The system includes: a data management module, a model training and optimization module, a model deployment and management module, an API interface module, a high-performance inference module, and a front-end application module.
[0065] The data management module collects, cleans, labels, stores, and manages multi-source heterogeneous medical data, acquiring a text corpus for pre-training and a dataset of instruction pairs for fine-tuning. Its key functions include pulling raw data from Hospital Information Systems (HIS), Laboratory Information Systems (LIS), and Picture Archiving Systems (PACS); automatically performing data cleaning, format standardization, and strict privacy anonymization to ensure data compliance with ethical and security standards; and managing different versions of the dataset to ensure the reproducibility of model training.
[0066] The model training and optimization module employs incremental pre-training combined with efficient parameter fine-tuning techniques within a federated learning framework. Domain knowledge is injected into the large language model base to obtain a domain-enhanced model. Based on real clinical data, the module utilizes the large language model to extract structured features from the model output by fusing image features, synthesizing a high-quality hepatocellular carcinoma clinical reasoning instruction set containing intermediate reasoning basis. This high-quality instruction set is then used to perform supervised instruction fine-tuning of the domain-enhanced model, resulting in an instruction fine-tuning model. Positive and negative sample pairs are constructed, and a real-time doctor feedback mechanism is introduced. A grouped relative strategy optimization algorithm and Monte Carlo tree search are used to train the instruction fine-tuning model, aligning the model output with human expert preferences to obtain the final large language model for auxiliary diagnosis of hepatocellular carcinoma.
[0067] The model deployment and management module deploys the trained model to the production environment and provides continuous model lifecycle management to obtain a loaded, ready-to-use large language model instance for liver cancer auxiliary diagnosis.
[0068] The API interface module receives requests from the front end, verifies the legality and completeness of the request parameters, converts the JSON format clinical data transmitted from the front end into the prompt word format required by the model, receives the results from the inference module, encapsulates them into a standardized JSON format and returns them to the front end, including structured information such as diagnostic conclusions, inference process, and confidence levels.
[0069] The high-performance inference module loads and executes inference computations for the large language model used in liver cancer auxiliary diagnosis. It utilizes high-performance inference frameworks such as vLLM and TensorRT-LLM to load deployed models, significantly optimizing inference speed and throughput. It also supports dynamic batch processing to handle high-concurrency requests. Real-time monitoring of GPU and memory usage ensures service stability.
[0070] The front-end application module provides users with an interactive interface, including a data input interface and a result display interface. The data input interface is a structured form or text input box for doctors to input or paste patients' clinical data. The result display interface clearly and structurally displays the diagnostic suggestions, detailed reasoning chains, and key diagnostic evidence returned by the model, helping doctors understand and verify the model's conclusions and collect feedback from doctors for subsequent model iteration and optimization.
[0071] The third embodiment of the present invention provides a computer-readable storage medium, which includes a program for a clinical decision support method for liver cancer based on a large language model. When the program for a clinical decision support method for liver cancer based on a large language model is executed by a processor, it implements the steps of a clinical decision support method for liver cancer based on a large language model.
[0072] In the several embodiments provided in this application, it should be understood that the disclosed methods can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between units may be electrical, mechanical, or other forms. Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes: mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, and other media capable of storing program code.
[0073] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A clinical decision support method for liver cancer based on a large language model, characterized in that, Includes the following steps: S1: Collect professional corpus in the field of liver cancer, and use incremental pre-training under the federated learning framework combined with efficient parameter fine-tuning technology to inject domain knowledge into the large language model base to obtain a domain-enhanced model; S2: Based on real clinical data, the structured features output by the model are extracted by fusing image features with a large language model, and a high-quality clinical reasoning instruction set for liver cancer containing intermediate reasoning basis is synthesized. The domain enhancement model is then fine-tuned with supervised instructions using the high-quality clinical reasoning instruction set for liver cancer to obtain the instruction fine-tuning model. S3: Construct positive and negative sample pairs, introduce a real-time feedback mechanism from doctors, and use a grouping relative strategy optimization algorithm and Monte Carlo tree search to train the instruction fine-tuning model so that the model output is aligned with human expert preferences, thus obtaining the final large language model for auxiliary diagnosis of liver cancer. S4: Receive a decision request containing clinical data of the target patient, input the decision request into the large language model for auxiliary diagnosis of liver cancer, and obtain the structured results output by the model, which include auxiliary decision suggestions and reasoning basis.
2. The clinical decision support method for liver cancer based on a large language model according to claim 1, characterized in that, We collected specialized corpora related to liver cancer, and employed incremental pre-training combined with efficient parameter fine-tuning techniques within a federated learning framework to inject domain knowledge into a large language model base, resulting in a domain-enhanced model, including: We collected professional corpora related to liver cancer, cleaned, de-identified, and standardized the data to construct an incremental pre-training dataset. The professional corpora included medical textbooks, medical guidelines, medical papers, de-identified real clinical electronic medical record texts, and pre-screened medical question-and-answer pairs. The server selects and initializes a preset large language model base as the global model. In each round of training, the server randomly selects some medical center clients to participate in the training and distributes the current global model to the selected medical center clients. Each medical center client uses local data and the LoRA algorithm to incrementally pre-train the downloaded model using standard autoregressive language modeling. This allows the large language model base to learn the associations between medical terms in the incremental pre-training dataset, the specific meanings of medical terms, and the logical structure of clinical descriptions. The LoRA algorithm is used to freeze the original global parameters. The frozen original parameters are kept unchanged during training. A pair of low-rank decomposition matrices are introduced into the attention layer. The low-rank decomposition matrices of the LoRA adapter are iteratively updated by minimizing the cross-entropy loss. Differential privacy technology is applied to add noise to the gradient. The noisy LoRA adapter parameters obtained from training are uploaded. The server collects the LoRA adapter parameters uploaded by each client, summarizes them using a secure aggregation protocol, calculates the average, and updates them to the global model. During the optimization process, both locally on the client and globally on the server, the AdamW adaptive optimizer is used to dynamically adjust the learning rate for the LoRA parameter and evaluate whether the global model converges. If the global model converges, the final domain augmentation model is output.
3. The clinical decision support method for liver cancer based on a large language model according to claim 1, characterized in that, Based on real clinical data, a high-quality clinical reasoning instruction set for liver cancer, incorporating intermediate reasoning evidence, is synthesized using a large language model. This includes: Structured clinical data of liver cancer patients are obtained and image data elements and text data elements are extracted. The image data elements and text data elements are aligned. The image data elements are used to extract features from the image data elements using a pre-trained visual model. The image visual information is encoded to obtain a structured visual feature vector. Natural language processing is performed on the text data elements, and a standardized text description is obtained by named entity recognition. The structured visual feature vector and the standardized text description are interacted through cross attention to generate a multimodal representation vector. The multimodal representation vector is used as conditional information and combined with a preset task instruction template to form a prompt word. The prompt word is input into a preset large language model, which is required to generate text containing detailed intermediate reasoning and final diagnostic answer. The text is then uniformly formatted into a standard format for instruction fine-tuning to obtain (multimodal representation vector, reasoning chain, diagnostic answer) data pairs. The data pair (multimodal representation vector, inference chain, diagnostic answer) is introduced into a generative adversarial network. A generator is used to generate multimodal feature vectors based on random noise vectors and diagnostic labels. A discriminator judges the authenticity of the multimodal feature vectors. The network is iteratively trained until it can no longer distinguish whether the feature vectors are real or generated. After training, the generator is used to obtain several multimodal feature vectors. The generated multimodal feature vectors are then input into the preset large language model to generate corresponding inference chains and diagnostic answers, thereby enhancing the data pairs. The enhanced data pairs are then divided into training, validation, and test sets to form a high-quality clinical inference instruction set for supervised fine-tuning of liver cancer.
4. The clinical decision support method for liver cancer based on a large language model according to claim 1, characterized in that, The domain enhancement model is subjected to supervised instruction fine-tuning using the high-quality liver cancer clinical reasoning instruction set to obtain an instruction fine-tuning model, including: The domain augmentation model obtained from incremental pre-training is loaded into the training environment, along with the training set, validation set, and test set corresponding to the high-quality liver cancer clinical reasoning instruction set. Each sample in the high-quality liver cancer clinical reasoning instruction set includes: instruction, input, and output. The instruction describes the task that the model needs to perform, the input provides specific patient clinical data, and the output is the text generated by the expected model that contains a complete reasoning chain and the final answer. Based on the complexity of the lesion, the typicality of the features, and the complexity of the diagnosis, a difficulty score is defined for each sample in the training set, and the samples are divided into simple, medium, and difficult samples according to the difficulty score. The training is initialized using simple samples. The model's performance on the current validation set is obtained through the course scheduler, and the training phase is switched according to the performance. When the model's performance on the validation set is stable, medium-difficulty samples are introduced to continue training, and finally, difficult samples are introduced. Weights are assigned to each sample in the training set based on the reciprocal of the sample’s frequency in the training set. Standard autoregressive language is used for modeling and fine-tuning. During training, the instructions, inputs and expected outputs are concatenated into a complete sequence, and the loss of the output part is calculated using the weighted cross-entropy loss function. The AdamW optimizer is used to update all parameters of the model based on the calculated loss gradient. During training, model performance is evaluated periodically on the validation set, and the best-performing model checkpoint on the validation set is saved as the final result. After training is completed, the final version of the model weights is saved, instructions are obtained to fine-tune the model, and a preliminary evaluation is performed using the test set.
5. The clinical decision support method for liver cancer based on a large language model according to claim 1, characterized in that, Positive and negative sample pairs are constructed, and a real-time feedback mechanism from doctors is introduced to obtain a dynamic preference dataset, including: For each instruction in the high-quality liver cancer clinical reasoning instruction set, the instruction fine-tuning model generates several different candidate answers through a diversity sampling strategy. A real-time doctor feedback mechanism is introduced to obtain multi-dimensional evaluation feedback. Positive and negative samples are divided according to the multi-dimensional evaluation feedback to construct a dynamic preference dataset. Each sample in the dynamic preference dataset is represented by a text embedding vector as a node. The cosine similarity between nodes is calculated to construct an edge structure. The node and edge structure are used to generate a sample relationship graph. The graph neural network is used to learn the representation of the sample relationship graph. Difficult instruction nodes are obtained according to the feedback frequency. The node representation updated by the graph neural network is obtained. The node representation updated by the difficult instruction nodes is decoded to obtain new instructions. A graph neural network is used to obtain the graph structure features of positive and negative sample nodes. New preference pairs are generated based on the graph structure features, and the new instructions and new preference pairs are added to the dynamic preference dataset.
6. The clinical decision support method for liver cancer based on a large language model according to claim 1, characterized in that, The instruction fine-tuning model is trained using a grouping relative strategy optimization algorithm and Monte Carlo tree search to align the model output with human expert preferences, resulting in the final large language model for auxiliary diagnosis of liver cancer, including: Using the instruction fine-tuning model as the initial strategy, Monte Carlo tree search is used to sample in the preference dataset. For any instruction, positive samples are used as prior knowledge and negative samples are used as the comparison benchmark. The initial strategy is used for prospective search and evaluated by a reward model pre-trained with human expert preference data. Enhanced positive samples are obtained by sampling. The grouping relative strategy optimization algorithm is adopted to group the responses according to the instructions. Each group contains negative samples, positive samples, and enhanced samples. The reward model is used to calculate the reward score for all responses (negative samples, positive samples, and enhanced samples) in the group to obtain the relative advantage of each response. The loss function is used to drive the fine-tuning of the model to surpass the negative sample responses and approach the enhanced and enhanced samples in order to update the model parameters and obtain the final large language model for auxiliary diagnosis of liver cancer. The loss function L GRPO Represented as: Where N is the batch size, A i Let x be the response obtained by Monte Carlo tree search for the i-th sample. i For the input instruction of the i-th sample, π θ For the instruction fine-tuning model to be optimized, Advantage(A) i |x i ) is the advantage function, Advantage(A) i |x i )=R(A i |x i )-R(y-∣x i R represents the reward model, and β is the regularization coefficient. This represents the expectation of the instruction x sampled from the data distribution D, where KL is the divergence and π is the inequality. ref This is the initial instruction fine-tuning model.
7. The clinical decision support method for liver cancer based on a large language model according to claim 1, characterized in that, The system receives a decision request containing clinical data of the target patient, inputs the decision request into the large language model for auxiliary diagnosis of liver cancer, and obtains a structured result output by the model containing auxiliary decision suggestions and reasoning basis, including: Deploy a large language model for auxiliary diagnosis of liver cancer, receive instructions from the front end through a predefined RESTful API interface, verify the legality and completeness of request parameters, and convert the JSON format clinical data transmitted from the front end into the prompt word format required by the model; The preprocessed prompt text is sent to the inference engine, which configures a set of preset decoding parameters for this inference call. The inference engine inputs the formatted prompts into the large language model for auxiliary diagnosis of liver cancer, performs autoregressive generation, and outputs each token step by step to form a complete answer. The model-generated answers are parsed in a structured manner, and the structured results, along with the original request ID, are encapsulated into JSON format and returned to the front end.
8. A clinical decision support system for liver cancer based on a large language model, characterized in that, To implement the liver cancer clinical decision support method based on a large language model as described in any one of claims 1-7, the system includes: a data management module, a model training and optimization module, a model deployment and management module, an API interface module, a high-performance inference module, and a front-end application module; The data management module collects, cleans, labels, stores and manages multi-source heterogeneous medical data, and obtains a text corpus for pre-training and a instruction pair dataset for fine-tuning. The model training and optimization module employs incremental pre-training combined with efficient parameter fine-tuning techniques within a federated learning framework. Domain knowledge is injected into the large language model base to obtain a domain-enhanced model. Based on real clinical data, the module utilizes the large language model to extract structured features from the model output by fusing image features, synthesizing a high-quality hepatocellular carcinoma clinical reasoning instruction set containing intermediate reasoning basis. This high-quality instruction set is then used to perform supervised instruction fine-tuning of the domain-enhanced model, resulting in an instruction fine-tuning model. Positive and negative sample pairs are constructed, and a real-time doctor feedback mechanism is introduced. A grouped relative strategy optimization algorithm and Monte Carlo tree search are used to train the instruction fine-tuning model, aligning the model output with human expert preferences to obtain the final large language model for auxiliary diagnosis of hepatocellular carcinoma. The model deployment and management module deploys the trained model to the production environment and provides continuous model lifecycle management to obtain a loaded, ready-to-use large language model instance for liver cancer auxiliary diagnosis. The API interface module receives requests from the front end, verifies the legality and completeness of the request parameters, converts the JSON format clinical data transmitted by the front end into the prompt word format required by the model, receives the results from the inference module, encapsulates them into a standardized JSON format, and returns them to the front end. The high-performance inference module loads and executes the inference calculation of the large language model for auxiliary diagnosis of liver cancer; The front-end application module provides users with an interactive interface, including a data input interface and a result display interface, and collects feedback from doctors for subsequent model iteration and optimization.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a liver cancer clinical decision support method program based on a large language model. When the liver cancer clinical decision support method program based on a large language model is executed by a processor, it implements the steps of the liver cancer clinical decision support method based on a large language model as described in any one of claims 1 to 7.
Citation Information
Cited By
Large language model liver cancer prediction method and system based on improved sampling strategy
CN121885162A
Liver cancer prediction method and system based on improved sampling strategy of large language model
CN121885162B
Clinical decision-making method, system and equipment for respiratory system diseases and medium
CN122224478A
A respiratory disease clinical decision making method, system, device, and medium
CN122224478B