Nutritional intervention recommendation method for tumor patients and related device

By employing a multi-stage fine-tuning training method, the ability of the large language model to understand professional knowledge in the field of tumor nutrition was improved, which solved the problem of existing models generating erroneous results in nutritional intervention for cancer patients and enabled precise recommendations for personalized nutritional intervention.

CN122494130APending Publication Date: 2026-07-31BEIJING ONION PARTNER TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING ONION PARTNER TECHNOLOGY CO LTD
Filing Date
2026-06-10
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing general-purpose large language models lack expertise in tumor nutrition, resulting in an inability to generate accurate and personalized recommendations in nutritional intervention scenarios for cancer patients, and leading to factual errors and fabricated content.

Method used

By efficiently fine-tuning parameters on a dataset of instructions in the field of tumor nutrition, a basic fine-tuning model is constructed; by fine-tuning the nutritional assessment dataset using thought chain methods, a nutritional assessment fine-tuning model is formed; by comparing intervention program comparison datasets and historical follow-up datasets, a program generation fine-tuning model is obtained through comparative learning and memory enhancement training; finally, based on symptom description information, risk classification detection and popularization processing are performed to generate personalized nutritional intervention recommendations.

Benefits of technology

The model possesses expertise in tumor nutrition, assessment reasoning, and the ability to deliver information in a clear and accessible manner, providing precise and personalized nutritional intervention recommendations that improve the accuracy and personalization of those recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122494130A_ABST
    Figure CN122494130A_ABST
Patent Text Reader

Abstract

This application relates to the field of artificial intelligence technology and provides a method and related equipment for recommending nutritional interventions for cancer patients. The method involves: efficiently fine-tuning and training parameters on a dataset of instructions in the field of cancer nutrition to obtain a basic fine-tuning model; fine-tuning and training using a thought chain method on a nutritional assessment dataset to update the basic fine-tuning model and obtain a nutritional assessment fine-tuning model; comparative learning and memory enhancement training on an intervention plan comparison dataset and a historical follow-up dataset to update the nutritional assessment fine-tuning model and obtain a plan generation fine-tuning model; and performing risk classification detection and simplified transformation on the symptom description information input by the patient based on the plan generation fine-tuning model to obtain personalized nutritional intervention recommendations for cancer patients. This invention, through multi-stage progressive fine-tuning, enables the model to possess professional knowledge of cancer nutrition, assessment reasoning, risk identification, and simplified output capabilities, providing accurate and personalized nutritional intervention recommendations for cancer patients.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method and related equipment for recommending nutritional interventions for cancer patients. Background Technology

[0002] Significant progress has been made in the fields of natural language understanding and generation. Existing general-purpose large language models have basic medical knowledge question-answering capabilities and are being tested for application in nutritional intervention recommendation scenarios. However, the pre-training data of general-purpose large language models mainly comes from publicly available text on the Internet, with a very low proportion of professional literature, clinical guidelines, and expert experience in the field of tumor nutrition. This results in the model's insufficient grasp of professional knowledge in tumor nutrition, leading to factual errors and knowledge illusions such as fabricated content in professional tumor nutrition question-answering.

[0003] In existing technologies, the main improvement solutions to the above problems adopt retrieval-enhanced generation technology, which uses external knowledge bases to retrieve relevant content to assist model generation. However, this solution only supplements knowledge at the input level and does not perform targeted optimization of the model's internal parameters. The model's domain understanding ability is not fundamentally improved, and it is still difficult to perform effective multivariate reasoning when facing complex clinical scenarios of cancer patients, and it cannot generate accurate personalized nutritional intervention recommendations. Summary of the Invention

[0004] This invention provides a method and related equipment for recommending nutritional interventions for cancer patients, in order to solve the technical problem that existing general-purpose large language models cannot generate accurate and personalized recommendation results in the scenario of recommending nutritional interventions for cancer patients due to insufficient domain knowledge.

[0005] In a first aspect, embodiments of this application provide a method for recommending nutritional interventions for cancer patients, including: The parameters of the instruction dataset in the field of tumor nutrition are efficiently fine-tuned to obtain the basic fine-tuned model. The nutritional assessment dataset containing assessment reasoning annotations is trained using a mind chain fine-tuning method, and the basic fine-tuning model is updated to obtain the nutritional assessment fine-tuning model. The intervention protocol comparison dataset with symptom annotations and the historical follow-up dataset are subjected to comparative learning training and memory enhancement training to update the nutrition assessment fine-tuning model, thus obtaining the protocol generation fine-tuning model. Based on the proposed scheme, a fine-tuned model is generated to perform risk classification detection and simplified processing on the symptom description information input by the patient, resulting in personalized nutritional intervention recommendations for cancer patients.

[0006] Secondly, embodiments of this application provide a nutritional intervention recommendation device for cancer patients, comprising: The knowledge injection module is used to efficiently fine-tune the parameters of the instruction dataset in the field of tumor nutrition to obtain a basic fine-tuned model. The evaluation reasoning module is used to fine-tune the training of the nutrition evaluation dataset containing evaluation reasoning annotations, update the basic fine-tuning model, and obtain the nutrition evaluation fine-tuning model. The protocol generation module is used to perform comparative learning and memory enhancement training on the intervention protocol comparison dataset containing symptom annotations and the historical follow-up dataset, and to update the nutritional assessment fine-tuning model to obtain the protocol generation fine-tuning model. The recommended output module is used to generate a fine-tuning model based on the scheme to perform risk classification detection and popularization processing on the symptom description information input by the patient, so as to obtain personalized nutritional intervention recommendation results for cancer patients.

[0007] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the above-mentioned recommended method for nutritional intervention for cancer patients.

[0008] Fourthly, embodiments of this application provide a readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described recommended method for nutritional intervention for cancer patients.

[0009] Fifthly, embodiments of this application provide a computer program product, which includes a computer program that, when executed by a processor, enables the implementation of the steps of the above-described recommended method for nutritional intervention for cancer patients.

[0010] In one of the solutions provided by the aforementioned methods, devices, equipment, media, and programs for recommending nutritional interventions for cancer patients, a basic fine-tuning model is obtained by efficiently fine-tuning parameters on a dataset of instructions in the field of cancer nutrition; a nutritional assessment fine-tuning model is obtained by fine-tuning the nutritional assessment dataset using a thought chain method; a nutritional assessment fine-tuning model is obtained by comparing and training intervention program comparison datasets and historical follow-up datasets using comparative learning and memory enhancement training; and a program generation fine-tuning model is obtained by performing risk classification detection and simplified transformation of the symptom description information input by the patient based on the program generation fine-tuning model, thus obtaining personalized nutritional intervention recommendations for cancer patients. This invention, through multi-stage progressive fine-tuning, enables the model to possess professional knowledge of cancer nutrition, assessment reasoning, risk identification, and simplified output capabilities, providing accurate and personalized nutritional intervention recommendations for cancer patients. Attached Figure Description

[0011] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a schematic diagram of a nutritional intervention recommendation system for cancer patients according to one embodiment of the present invention; Figure 2 This is a flowchart illustrating a method for recommending nutritional interventions for cancer patients according to an embodiment of the present invention; Figure 3 yes Figure 2 A schematic diagram of the implementation process of step S10; Figure 4 yes Figure 2 A schematic diagram of the implementation process of step S20; Figure 5 This is a schematic diagram of a nutritional intervention recommendation device for cancer patients according to one embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. Detailed Implementation

[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0014] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof. It should also be understood that, as used in this specification and the appended claims, the term "and / or" refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0015] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0016] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0017] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0018] To illustrate the technical solution of the present invention, specific embodiments are described below.

[0019] To address the problems mentioned above in the background art, embodiments of this application propose a method, apparatus, device, medium, and program product for recommending nutritional interventions for cancer patients. The nutritional intervention recommendation method for cancer patients provided by embodiments of this invention can be applied to, for example... Figure 1 The nutritional intervention recommendation system for cancer patients shown includes a client and a server.

[0020] In one embodiment, such as Figure 2 As shown, a recommended method for nutritional intervention in cancer patients is provided, which is then applied to... Figure 1 Taking the nutritional intervention recommendation system for cancer patients as an example, the following steps are included: S10: Perform efficient parameter fine-tuning training on the instruction dataset in the field of tumor nutrition to obtain a basic fine-tuned model; S20: Perform mind chain fine-tuning training on the nutrition assessment dataset containing assessment reasoning annotations, update the basic fine-tuning model, and obtain the nutrition assessment fine-tuning model. S30: Comparative learning and memory enhancement training are performed on the intervention program comparison dataset containing symptom annotations and the historical follow-up dataset to update the nutrition assessment fine-tuning model and obtain the program generation fine-tuning model; S40: Based on the above scheme, a fine-tuning model is generated to perform risk classification detection and popularization processing on the symptom description information input by the patient, so as to obtain personalized nutritional intervention recommendations for cancer patients.

[0021] The pre-training corpus of the general-purpose large language model contains a very low proportion of literature on tumor nutrition, which can easily lead to factual errors when directly applied to tumor nutrition question-and-answer scenarios. This embodiment extracts four categories of content—knowledge-based questions and answers, concept explanations, standard interpretations, and dosage calculations—from authoritative clinical literature such as the CSCO Tumor Nutrition Therapy Guidelines, ESPEN Guidelines, and ASPEN Guidelines. After manual review and format annotation, this constitutes a tumor nutrition instruction dataset of approximately 100,000 entries. During the fine-tuning phase, LoRA technology is used. A pair of low-rank decomposition matrices is inserted into the query matrix, key matrix, value matrix, and feedforward network layer of the pre-trained large language model's attention mechanism. The original model parameters are frozen during training, and gradient updates are performed only on the low-rank matrices. The low-rank number r is set to 64, the learning rate is configured to 1e-4, and the AdamW optimizer is used in conjunction with a cosine learning rate decay strategy. After training, the low-rank adaptive fine-tuning parameters are merged with the original pre-training parameters to obtain the basic fine-tuned model.

[0022] In this embodiment, assessment standards such as NRS2002, PG-SGA, and GLIM each involve multi-step, hierarchical reasoning based on patient vital signs, disease diagnosis information, and laboratory indicators. If only fine-tuning based on instructions is used, the model can only learn the superficial mapping relationship between input and output, making it difficult to establish a complete assessment reasoning chain. Therefore, this embodiment annotates the complete reasoning steps for each assessment case in the training data, including the step-by-step calculation process of weight loss score, food intake score, and disease severity score, as well as the final nutritional risk level. This allows the model to learn both the reasoning path and the final conclusion simultaneously during training. Regarding the loss function, a joint loss function is constructed by weighted summing of the cross-entropy loss of the reasoning steps and the mean squared error loss of the reasoning process. This joint loss function is used to train the basic fine-tuned model with full parameter fine-tuning, resulting in a nutritional assessment fine-tuned model. It should be noted that the joint loss function supervises both the reasoning steps and the final score simultaneously. Compared to training methods that only supervise the final answer, this drives the model to form a more stable reasoning logic, reducing the possibility of contradictions between the assessment conclusion and the reasoning process.

[0023] In this embodiment, the nutritional assessment fine-tuning model already possesses assessment and reasoning capabilities. However, in the protocol generation scenario, the model still needs to distinguish between high-quality protocols and those with defects, and continuously track the patient's status during multiple rounds of follow-up. Simple instruction fine-tuning is insufficient for the model to establish the ability to judge protocol quality, and it is also difficult to prevent state forgetting during long dialogues. In the contrastive learning training phase of this embodiment, intervention protocols formulated by clinical nutritionists are used as positive samples, and protocols with nutritional goal deviations or conflicting symptom treatment logic are used as negative samples to construct an intervention protocol comparison dataset. A contrastive loss function is constructed with the objective of maximizing the difference between the scores of positive and negative samples and the interval threshold. The nutritional assessment fine-tuning model is then trained through contrastive learning to obtain a contrastive learning intermediate model. Furthermore, in the memory enhancement training phase, the vital signs, treatment stages, and symptom information in the patient's historical follow-up data are vectorized and stored in a dynamic cache. A memory consistency loss function is constructed by weighted summing of the difference in memory vectors at adjacent time points and the state update accuracy, preventing the model from forgetting early diagnostic conclusions during long dialogues. The training samples gradually transition from short dialogues to long dialogues, and the intermediate model of contrastive learning is trained with memory enhancement to obtain a fine-tuned model for scheme generation.

[0024] In this embodiment, after receiving the symptom description information input by the patient, the solution generation fine-tuning model first generates a personalized intervention plan. Simultaneously, the risk classifier calculates a risk score for the same symptom description information and compares the score with a preset risk threshold. If the score exceeds the threshold, the emergency response unit extracts key content from the symptom description information and outputs medical guidance; if it does not exceed the threshold, it outputs a standard intervention instruction, resulting in a risk management outcome. Based on the above description, the risk classification detection and intervention plan generation are executed in parallel without blocking each other, ensuring response efficiency. After obtaining the risk management outcome, the professional terminology involved in the intervention plan is identified and extracted. Nutrient numerical indicators are converted into equivalent daily food quantities that patients can perceive. Complex intervention operations are broken down into step-by-step instructions including execution time, execution method, and precautions. The content is then sorted and filtered according to patient cognitive preference alignment rules, integrating empathic and encouraging expressions with professional and authoritative endorsements to obtain personalized nutritional intervention recommendations for cancer patients.

[0025] In one embodiment, such as Figure 3 As shown, step S10 specifically includes the following steps: S11: The knowledge Q&A, concept explanations, standard interpretations and dosage calculation content in authoritative guidelines and clinical literature on tumor nutrition are extracted and annotated in a structured manner to obtain a dataset of instructions in the field of tumor nutrition. S12: Based on the tumor nutrition domain instruction dataset, insert a low-rank decomposition matrix into the query matrix, key matrix, value matrix and feedforward network layer of the attention mechanism of the pre-trained large language model, freeze the original parameters of the pre-trained large language model, and perform gradient update training only on the low-rank decomposition matrix to obtain low-rank adaptive fine-tuning parameters. S13: Combine the low-rank adaptive fine-tuning parameters with the original parameters of the pre-trained large language model to obtain the basic fine-tuning model.

[0026] In this embodiment, professional knowledge in the field of tumor nutrition is scattered across a large number of clinical guidelines and literature. If the original literature is directly used as the training corpus input into the model, the model will find it difficult to accurately extract and memorize professional knowledge from unstructured text. Therefore, in constructing the instruction dataset, this embodiment classifies and organizes the literature content according to knowledge type, breaking it down into four categories of structured instruction items: knowledge questions and answers, concept explanations, standard interpretations, and dosage calculations. Among them, knowledge questions and answers cover the nutritional metabolic characteristics of various tumors and nutritional coping strategies for common symptoms; concept explanations provide standardized definitions of professional terms in the field of tumor nutrition; standard interpretations focus on the usage rules of assessment standards such as NRS2002, PG-SGA, and GLIM; and dosage calculations cover the calculation methods for nutrient requirements such as energy targets and protein targets. After manual review and format annotation, the above four categories constitute the instruction dataset for the field of tumor nutrition, with a data size of approximately 100,000 entries.

[0027] In the fine-tuning phase, performing full parameter fine-tuning on a pre-trained large language model requires all billions of parameters to participate in gradient calculation and updates, resulting in extremely high training costs. Furthermore, large-scale parameter updates can easily destroy the general language capabilities accumulated during pre-training. This embodiment employs LoRA technology, inserting a pair of low-rank decomposition matrices next to the query matrix, key matrix, value matrix of the attention mechanism in the pre-trained large language model, and the weight matrix of the feedforward network layer. The low-rank number r is set to 64. During training, all original parameters of the pre-trained model are frozen, and gradient calculation and parameter updates are performed only on the inserted low-rank decomposition matrices. The learning rate is configured as 1e-4, using the AdamW optimizer combined with a cosine learning rate decay strategy. The batch size is set to 32, the gradient accumulation step is 4, and the training epochs are 3. After the above training process, the low-rank adaptive fine-tuning parameters are obtained.

[0028] It should be noted that the low-rank decomposition matrix decomposes the update amount of the original weight matrix into the product of two low-rank matrices. The number of parameters required for training is only a very small proportion of the total number of parameters in the original model. While significantly reducing training costs, the general language understanding ability of the original model is fully preserved. After training, the low-rank adaptive fine-tuning parameters are added bit-by-bit to the original parameters of the pre-trained large language model and merged. The merged model has the same structure as the original model during the inference phase, without introducing additional inference latency, resulting in the basic fine-tuned model.

[0029] In one embodiment, such as Figure 4 As shown, step S20 specifically includes the following steps: S21: Patient vital signs data, disease diagnosis information and test indicators are labeled with a stepwise reasoning process according to the nutritional risk screening standard to obtain a nutritional assessment dataset with inference chain annotations including weight loss score, food intake score and disease severity score. S22: Based on the nutrition assessment dataset, construct a joint loss function for the basic fine-tuning model by weighted summation of the cross-entropy loss of the inference step and the mean square error loss of the inference process, and perform full-parameter fine-tuning training on the basic fine-tuning model to obtain the nutrition assessment fine-tuning model.

[0030] In this embodiment, nutritional risk assessment involves multiple standards such as NRS2002, PG-SGA, and GLIM. Each standard requires the step-by-step extraction of key information from patient vital signs, disease diagnosis information, and laboratory indicators, and scoring each item according to rules, ultimately summarizing to derive the nutritional risk level. If only the final score is used as the training label, the model can only learn a superficial mapping from input to conclusion, failing to establish a stable step-by-step reasoning ability. This can easily lead to erroneous conclusions when faced with complex cases involving incomplete information or contradictory indicators.

[0031] In the data construction phase, this embodiment uses real medical records to annotate a complete inference chain for each assessment case. Taking the NRS2002 assessment as an example, the inference chain annotation covers the following dimensions: First, the degree of nutritional impairment is determined based on the patient's BMI value, and a corresponding score is given. Then, the weight loss score is determined based on the patient's recent weight loss percentage. Next, the eating status score is determined by combining the ratio of the patient's actual food intake to normal food intake. Finally, the disease severity score is determined by referring to the NRS2002 disease severity grading table based on the disease diagnosis type. The scores of each sub-item are summed and an age-adjusted score is added to obtain the total score, which is used to determine whether the patient has nutritional risks. The annotation method for the PG-SGA dataset is similar, covering the patient's self-reported weight changes, dietary intake, gastrointestinal symptoms, activity level, as well as the degree of metabolic stress and physical examination results assessed by medical staff. The scoring process for each dimension is annotated separately and the results are summarized to obtain the PG-SGA grading. The GLIM diagnostic dataset is labeled along two paths: phenotypic indicators and etiological indicators. Phenotypic indicators cover the degree of weight loss, low BMI assessment, and muscle loss assessment, while etiological indicators cover reduced intake, malabsorption, and inflammatory burden assessment. Both types of indicators must be met simultaneously for a diagnosis of malnutrition and severity classification. The three datasets mentioned above have sizes of approximately 10,000 cases for NRS2002, approximately 8,000 cases for PG-SGA, and approximately 5,000 cases for GLIM. All datasets were anonymized before being used for training, collectively forming a nutritional assessment dataset containing inference chain annotations.

[0032] During the training phase, this embodiment uses full-parameter fine-tuning to update the basic fine-tuned model, with a learning rate of 5e-5, a batch size of 32, and a gradient accumulation step count of 4. Regarding the loss function, the classification judgment results at each step in the inference chain are supervised by cross-entropy loss, while the numerical output of intermediate computational costs at each step is supervised by mean squared error loss. The two are weighted and summed to construct a joint loss function, with the weight coefficients dynamically adjusted based on the convergence of the inference step accuracy and the final score accuracy. In summary, the joint loss function simultaneously constrains the model's progressive inference path and the final score conclusion, driving the model to progressively generate the complete inference chain as intermediate outputs while outputting the final nutritional risk level, ensuring logical consistency between the evaluation conclusion and the inference process. It should be noted that the introduction of inference process supervision loss requires the model to not only provide the correct final answer during training but also ensure the accuracy of each intermediate inference step. This is particularly important to prevent situations where the model's inference path deviates but the final answer happens to be correct. After the above training process, a nutritional assessment fine-tuning model was obtained, with an automatic assessment accuracy of 92% using NRS2002 and a Kappa coefficient of 0.88 consistent with the results of manual assessment by nutritionists.

[0033] In one embodiment, step 30 specifically includes the following steps: Positive and negative sample labels were used to label intervention plans developed by clinical nutritionists with plans that had deviations in nutritional goals or conflicting symptom management logic, resulting in a comparative dataset of intervention plans. Based on the intervention program comparison dataset, the nutritional assessment fine-tuning model is constructed by maximizing the difference between the positive and negative sample scores and the interval threshold to build a contrastive loss function for contrastive learning training, thereby obtaining a contrastive learning intermediate model; The physical signs, treatment stages, and symptom information in the patient's historical follow-up data are vectorized and stored in a dynamic cache. A memory consistency loss function is constructed by weighted summation of the difference in memory vectors at adjacent time points and the accuracy of state updates. The contrastive learning intermediate model is trained with memory enhancement from short dialogues to long dialogues using a course learning strategy to obtain a scheme generation fine-tuning model.

[0034] In this embodiment, the nutritional assessment fine-tuning model already possesses the ability to perform structured assessments of patients' nutritional status. However, in the protocol generation scenario, the model still needs to further learn the core features of high-quality intervention protocols and continuously track changes in patient status during long-term follow-up. If relying solely on supervised training with positive samples, the model struggles to establish an active judgment ability regarding protocol quality and cannot effectively distinguish between protocols with reasonable nutritional goals and those with logical flaws. Therefore, this embodiment applies comparative learning training and memory enhancement training sequentially to the nutritional assessment fine-tuning model in two stages.

[0035] During the comparative learning training phase, intervention plans actually developed by clinical nutritionists were used as positive samples. These positive sample plans included reasonable energy targets, protein targets, dietary recommendations, and nutritional supplement recommendations, with each nutrient target aligning with the actual needs of the patients' disease type and treatment stage. Negative sample plans were divided into two categories: those with nutritional target biases, where the energy or protein targets deviated significantly from the patients' actual needs; and those with conflicting symptom management logic, where dietary recommendations for the patient's current symptoms contradicted symptom management principles (e.g., recommending a high-fiber diet for a patient with severe diarrhea). The positive and negative samples were paired and labeled to form the intervention plan comparison dataset, with a data size of approximately 20,000 cases. The comparative loss function aimed to maximize the difference between the positive and negative sample scores and the interval threshold, specifically in the form L = L_CE + α × max(0, margin - (Score_pos - Score_neg)), where L_CE is the basic cross-entropy loss, Score_pos and Score_neg are the model output scores of the positive and negative samples, respectively, margin is the preset interval threshold, and α is the balance coefficient. The nutritional assessment fine-tuning model was trained using the aforementioned contrastive loss function, driving the model to widen the score gap between high-quality and low-quality solutions, thus obtaining a contrastive learning intermediate model.

[0036] During the memory enhancement training phase, the follow-up period for cancer patients typically spans multiple stages, including pre-operative care, chemotherapy, radiotherapy, targeted therapy, and rehabilitation. At each follow-up visit, the model needs to accurately understand the changing relationship between the patient's current state and historical states in order to generate a reasonable dynamic adjustment plan. Therefore, this embodiment introduces a memory encoder to vectorize and encode the physical signs, treatment stages, and symptom information in the patient's historical follow-up data. The encoded state vectors are stored in a dynamic buffer, which is updated synchronously with each follow-up data update, always preserving the complete state sequence of the patient from their initial visit to the current follow-up moment. In each round of dialogue, the model reads the historical state vector from the dynamic buffer, concatenates it with the current input information, and participates in the reasoning process for plan generation. Regarding the loss function, a memory consistency loss function is constructed by weighted summing of the L2 norm of the difference between memory vectors at adjacent time steps and the state update accuracy. Specifically, it takes the form: Consistency_Loss = ||Memory_t - Memory_(t-1)||2 + α×Status_Update_Accuracy, where Memory_t and Memory(t-1) are the memory vectors at the current and previous time steps, respectively, Status_Update_Accuracy is the accuracy evaluation term for state updates, and α is the balancing coefficient. This loss function constrains the variation range between memory vectors at adjacent time steps, preventing abrupt forgetting of historical information during state updates, while ensuring consistency between the memory content and the patient's actual state through the state update accuracy term.

[0037] Based on the above description, this embodiment employs a course-based learning strategy to arrange the input order of training samples. Initially, short dialogue samples with fewer rounds are used, gradually introducing long dialogue samples spanning multiple follow-up periods, covering different follow-up periods such as 1 month, 3 months, and 6 months, as the training progresses. The training data includes 15,000 sets of multi-round dialogues, 3,000 complete case studies covering the entire course of the patient's disease, and 5,000 sets of follow-up dialogues. After completing the aforementioned memory enhancement training on the comparative learning intermediate model, a scheme generation fine-tuning model is obtained.

[0038] In one embodiment, step S40 specifically includes the following steps: Based on the aforementioned scheme, a fine-tuning model is generated to produce a personalized intervention plan using the symptom description information input by the patient, thus obtaining the intervention plan; The symptom description information input by the patient is processed in parallel dual-path. One path performs routine instruction generation processing on the symptom description information, while the other path calculates a risk score by using a risk classifier to obtain a risk score. The risk score is compared with a preset risk threshold. When the risk score exceeds the preset risk threshold, the emergency response device is triggered to extract key information from the symptom description and output medical guidance. When the risk score does not exceed the preset risk threshold, a routine intervention instruction is output to obtain the risk treatment result. Based on the risk management results, the technical terms in the intervention plan are simplified to obtain personalized nutritional intervention recommendations for cancer patients.

[0039] In this embodiment, after receiving the symptom description information input by the patient, the intervention plan generation fine-tuning model simultaneously initiates two processing paths: intervention plan generation and risk classification detection. These two paths execute in parallel without blocking each other. The intervention plan generation path involves the model directly reasoning from the symptom description information, comprehensively considering the patient's disease type, treatment stage, nutritional status, and current symptoms to generate a personalized intervention plan that includes energy targets, protein targets, dietary recommendations, and nutritional supplement suggestions. It should be noted that the intervention plan generation process also references the historical state vector in the patient's dynamic cache to ensure consistency between the plan content and the patient's previous follow-up records.

[0040] Meanwhile, the risk classification detection path initiates parallel processing of the same symptom description information. One path processes the symptom description information according to the regular instruction generation process, outputting standard health guidance content; the other path inputs the symptom description information into the risk classifier, which extracts features from the symptom type, duration, and severity of the input text, and calculates a risk score. During the training phase, the risk classifier uses Focal Loss to address the class imbalance between emergency symptom samples and ordinary symptom samples, oversampling emergency symptom samples such as hematemesis, melena, severe vomiting, severe diarrhea, dysphagia, and dyspnea, ensuring the classifier maintains high sensitivity to low-frequency, high-risk symptoms.

[0041] After obtaining the risk score, it is compared with a preset risk threshold. If the risk score exceeds the preset risk threshold, the patient is determined to be at urgent risk. The emergency response system then extracts key symptom information from the symptom description, identifies key elements such as the onset time of symptoms, accompanying manifestations, and past medical history, and generates corresponding medical guidance based on the patient's current treatment stage. The system clearly informs the patient to seek medical attention immediately or contact their attending physician, and prompts them to explain the key symptom information that needs to be explained to the doctor. If the risk score does not exceed the preset risk threshold, the system directly outputs routine intervention instructions, resulting in a risk management outcome.

[0042] The system then identifies and extracts the technical terms involved in the intervention plan. The technical terminology identification module scans the intervention plan text, locating nutrient names, numerical indicators, medical terms, and operational suggestions, and performs corresponding conversion processing on each type of technical term. Regarding nutrient numerical indicators, units of measurement such as grams and milligrams are converted into equivalent quantities of everyday foods that patients can intuitively perceive, based on a nutrient composition database. For example, the number of grams of protein is mapped to the specific serving sizes of common foods such as eggs, milk, and tofu. For complex intervention operations, the comprehensive recommendations in the original plan are broken down into step-by-step instructions including execution time, execution method, and precautions. Each instruction corresponds to a specific action that the patient can independently complete during a meal or at a specific time point. The converted content is then sorted and filtered according to patient cognitive preference alignment rules, prioritizing instructions with higher execution priority and stronger patient compliance. This is combined with empathetic and encouraging expressions and professional authoritative endorsements to obtain personalized nutritional intervention recommendations for cancer patients.

[0043] In one embodiment, the step of simplifying the technical terms in the intervention plan based on the risk treatment results to obtain personalized nutritional intervention recommendations for cancer patients specifically includes the following steps: The professional terms in the intervention plan are identified and extracted, the nutrient numerical indicators in the professional terms are converted into the equivalent expression of daily food that patients can perceive, and the complex intervention operations in the professional terms are broken down into step-by-step operation instructions that include execution time, execution method and precautions, so as to obtain the simplified structure instructions of professional terms. Based on the simplified technical terminology structure instructions, the content is sorted and filtered according to the patient's cognitive preference alignment rules to obtain the preference alignment output; Based on the preference alignment output, the empathic incentive expressions and professional authority endorsement content are fused and assembled to obtain personalized nutritional intervention recommendations for cancer patients.

[0044] In this embodiment, the intervention plan is directly output by the plan generation and fine-tuning model. Its content primarily uses clinical terminology, involving numerous nutrient names, numerical indicators, and medical operational suggestions. Cancer patients and their families generally lack professional medical background; directly presenting these technical terms to patients can easily lead to misunderstandings and thus affect the actual implementation of the plan. Therefore, this embodiment systematically simplifies the technical terminology in the intervention plan before outputting the final recommendation.

[0045] The first step in the popularization process is to identify and extract the technical terms from the intervention protocol text. This identification covers four categories: nutrient names and their corresponding numerical values, medical operational terms, treatment-related professional vocabulary, and complex intervention recommendations. For nutrient numerical value terms, units of measurement such as grams and milligrams are converted into equivalent quantities of everyday food that patients can intuitively understand, based on a nutrient database. Priority is given to common food types found in patients' daily diets, with specific portion sizes clearly indicated so patients can follow the instructions directly without calculation. For complex intervention operational terms, the comprehensive recommendations in the original protocol are broken down step by step. Each decomposed instruction corresponds to a specific action that the patient can independently complete within a single meal or time frame, and each instruction is supplemented with three elements: execution time, execution method, and precautions. After this processing, a simplified structure of technical terms is obtained.

[0046] The content of the simplified technical terminology instructions is then sorted and filtered according to patient cognitive preference alignment rules. These rules are constructed based on patient feedback data on their preferences for different expression methods, reflecting differences in information reception among patients of different educational levels and ages. During sorting, instructions with higher execution priority and stronger patient compliance are placed at the top. During filtering, items with low relevance to the patient's current treatment stage or execution difficulty exceeding the patient's actual ability are removed, resulting in a preference-aligned output.

[0047] Based on the above explanation, and building upon the preference-aligned output, the output content is integrated with empathic motivational expressions and professional authoritative endorsements. Empathic motivational expressions are generated according to the patient's current treatment stage and symptom status, incorporating positive affirmations and emotional support for the patient's physical condition into the protocol description to help the patient build confidence in implementing the protocol. Professional authoritative endorsements highlight the corresponding clinical guidelines at key recommendations, preserving the protocol's professional credibility and avoiding any doubts about its authority from patients after simplified translation. After integrating these two parts with the preference-aligned output, personalized nutritional intervention recommendations for cancer patients are obtained.

[0048] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0049] In one embodiment, a nutritional intervention recommendation device for cancer patients is provided, which corresponds one-to-one with the nutritional intervention recommendation method for cancer patients described in the above embodiments. For example... Figure 5As shown, the nutritional intervention recommendation device for cancer patients includes a knowledge injection module 501, an assessment and reasoning module 502, a plan generation module 503, and a recommendation output module 504. Detailed descriptions of each functional module are as follows: The knowledge injection module is used to efficiently fine-tune the parameters of the instruction dataset in the field of tumor nutrition to obtain a basic fine-tuned model. The evaluation reasoning module is used to fine-tune the training of the nutrition evaluation dataset containing evaluation reasoning annotations, update the basic fine-tuning model, and obtain the nutrition evaluation fine-tuning model. The protocol generation module is used to perform comparative learning and memory enhancement training on the intervention protocol comparison dataset containing symptom annotations and the historical follow-up dataset, and to update the nutritional assessment fine-tuning model to obtain the protocol generation fine-tuning model. The recommended output module is used to generate a fine-tuning model based on the scheme to perform risk classification detection and popularization processing on the symptom description information input by the patient, so as to obtain personalized nutritional intervention recommendation results for cancer patients.

[0050] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0051] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0052] This application also provides a computer device, such as... Figure 6As shown, the computer device includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor. When the processor executes the computer program, it implements the steps in any of the above method embodiments, or when the processor executes the computer program, it implements the functions of each module / unit in the above device embodiments.

[0053] For example, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete this application. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the computer device.

[0054] Those skilled in the art will understand that Figure 6 The computer device described is merely an example and does not constitute a limitation on the computer device. It may include more or fewer components than shown, or combine certain components, or different components. For example, the computer device may also include input / output devices, network access devices, buses, etc.

[0055] The aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), or Field Programmable Gate Arrays (FPGAs). Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0056] The memory can be an internal storage unit of the computer device, such as a hard drive or RAM. The memory can also be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory can include both internal and external storage units of the computer device.

[0057] This application also provides a readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.

[0058] This application provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.

[0059] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographing device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0060] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0061] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0062] In the embodiments provided in this application, it should be understood that the disclosed apparatus / devices and methods can be implemented in other ways. For example, the apparatus / device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

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

[0064] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for recommending a nutritional intervention for a tumor patient, characterized in that, The recommended methods for nutritional intervention for cancer patients include: The parameters of the instruction dataset in the field of tumor nutrition are efficiently fine-tuned to obtain the basic fine-tuned model. The nutritional assessment dataset containing assessment reasoning annotations is trained using a mind chain fine-tuning method, and the basic fine-tuning model is updated to obtain the nutritional assessment fine-tuning model. The intervention protocol comparison dataset with symptom annotations and the historical follow-up dataset are subjected to comparative learning training and memory enhancement training to update the nutrition assessment fine-tuning model, thus obtaining the protocol generation fine-tuning model. Based on the proposed scheme, a fine-tuned model is generated to perform risk classification detection and simplified processing on the symptom description information input by the patient, resulting in personalized nutritional intervention recommendations for cancer patients.

2. The method of recommending a nutritional intervention for a tumor patient according to claim 1, characterized in that, The method of efficiently fine-tuning and training the instruction dataset in the field of tumor nutrition to obtain the basic fine-tuned model includes: We extracted and annotated the knowledge questions, concept explanations, standard interpretations, and dosage calculation content from authoritative guidelines and clinical literature on tumor nutrition in a structured manner to obtain a dataset of instructions in the field of tumor nutrition. Based on the tumor nutrition domain instruction dataset, the query matrix, key matrix, value matrix and feedforward network layer of the attention mechanism of the pre-trained large language model are inserted into a low-rank decomposition matrix. The original parameters of the pre-trained large language model are frozen, and gradient update training is performed only on the low-rank decomposition matrix to obtain low-rank adaptive fine-tuning parameters. The low-rank adaptive fine-tuning parameters are combined with the original parameters of the pre-trained large language model to obtain the basic fine-tuning model.

3. The method of recommending a nutritional intervention for a tumor patient according to claim 1, wherein, The step of fine-tuning the nutrition assessment dataset containing assessment inference annotations using a thought chain method, and updating the basic fine-tuning model to obtain the nutrition assessment fine-tuning model includes: Patient vital signs data, disease diagnosis information and test indicators were labeled according to the nutritional risk screening standard to obtain a nutritional assessment dataset with inference chain annotations including weight loss score, food intake score and disease severity score. Based on the nutrition assessment dataset, a joint loss function is constructed by weighting the cross-entropy loss of the inference step and the mean squared error loss of the inference process to the basic fine-tuning model. The basic fine-tuning model is then trained with full parameter fine-tuning to obtain the nutrition assessment fine-tuning model.

4. The method of recommending a nutritional intervention for a tumor patient according to claim 1, wherein, The step of performing comparative learning and memory enhancement training on the intervention protocol comparison dataset containing symptom annotations and the historical follow-up dataset to update the nutritional assessment fine-tuning model, resulting in a protocol generation fine-tuning model, includes: Positive and negative sample labels were used to label intervention plans developed by clinical nutritionists with plans that had deviations in nutritional goals or conflicting symptom management logic, resulting in a comparative dataset of intervention plans. Based on the intervention program comparison dataset, the nutritional assessment fine-tuning model is constructed by maximizing the difference between the positive and negative sample scores and the interval threshold to build a contrastive loss function for contrastive learning training, thereby obtaining a contrastive learning intermediate model; The physical signs, treatment stages, and symptom information in the patient's historical follow-up data are vectorized and stored in a dynamic cache. A memory consistency loss function is constructed by weighted summation of the difference in memory vectors at adjacent time points and the accuracy of state updates. The contrastive learning intermediate model is trained with memory enhancement from short dialogues to long dialogues using a course learning strategy to obtain a scheme generation fine-tuning model.

5. The method for recommending nutritional intervention for cancer patients according to claim 1, characterized in that, The process of generating a fine-tuned model based on the aforementioned scheme to perform risk classification detection and simplified translation of the symptom description information input by the patient, resulting in personalized nutritional intervention recommendations for cancer patients, includes: Based on the aforementioned scheme, a fine-tuning model is generated to produce a personalized intervention plan using the symptom description information input by the patient, thus obtaining the intervention plan; The symptom description information input by the patient is processed in parallel dual-path. One path performs routine instruction generation processing on the symptom description information, while the other path calculates a risk score by using a risk classifier to obtain a risk score. The risk score is compared with a preset risk threshold. When the risk score exceeds the preset risk threshold, the emergency response device is triggered to extract key information from the symptom description and output medical guidance. When the risk score does not exceed the preset risk threshold, a routine intervention instruction is output to obtain the risk treatment result. Based on the risk management results, the technical terms in the intervention plan are simplified to obtain personalized nutritional intervention recommendations for cancer patients.

6. The method for recommending nutritional intervention for cancer patients according to claim 5, characterized in that, The process of simplifying the technical terms in the intervention plan based on the risk management results to obtain personalized nutritional intervention recommendations for cancer patients includes: The professional terms in the intervention plan are identified and extracted, the nutrient numerical indicators in the professional terms are converted into the equivalent expression of daily food that patients can perceive, and the complex intervention operations in the professional terms are broken down into step-by-step operation instructions that include execution time, execution method and precautions, so as to obtain the simplified structure instructions of professional terms. Based on the simplified technical terminology structure instructions, the content is sorted and filtered according to the patient's cognitive preference alignment rules to obtain the preference alignment output; Based on the preference alignment output, the empathic incentive expressions and professional authority endorsement content are fused and assembled to obtain personalized nutritional intervention recommendations for cancer patients.

7. A nutritional intervention recommendation device for cancer patients, characterized in that, include: The knowledge injection module is used to efficiently fine-tune the parameters of the instruction dataset in the field of tumor nutrition to obtain a basic fine-tuned model. The evaluation reasoning module is used to fine-tune the training of the nutrition evaluation dataset containing evaluation reasoning annotations, update the basic fine-tuning model, and obtain the nutrition evaluation fine-tuning model. The protocol generation module is used to perform comparative learning and memory enhancement training on the intervention protocol comparison dataset containing symptom annotations and the historical follow-up dataset, and to update the nutritional assessment fine-tuning model to obtain the protocol generation fine-tuning model. The recommended output module is used to generate a fine-tuning model based on the above scheme to perform risk classification detection and popularization processing on the symptom description information input by the patient, so as to obtain personalized nutritional intervention recommendation results for cancer patients.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method for recommending nutritional interventions for cancer patients as described in any one of claims 1 to 6.

9. A readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method for recommending nutritional interventions for cancer patients as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, enables the implementation of the steps of the nutritional intervention recommendation method for cancer patients as described in any one of claims 1 to 6.