A nutritional assessment system for dietary intake after bariatric surgery based on neural network
Through the Transformer-RL model and marginal reward optimization loss function, the nutritional evaluation problem was solved inaccurate nutritional evaluation in the traditional system, personalized dietary plan adjustment was achieved, and postoperative recovery effect and long-term health management were improved.
Patent Information
- Application Number
- CN202510496928.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-04-21
AI Technical Summary
The traditional postoperative nutrition assessment system of weight loss surgery ignores individual differences and dynamic changes in patients, resulting in inaccurate nutrition assessment results and difficult to adapt to the needs of patients at different stages of recovery.
A Transformer-RL model combining channel separation, fragment extraction, location embedding, situation embedding and decision tree path optimization is adopted to optimize the inference path through marginal reward optimization loss function to generate personalized nutritional evaluation results.
It has achieved accurate assessment of patients' postoperative dietary intake, dynamic adjustment of nutritional plans, and improved the postoperative recovery effect and long-term health management support.
Smart Images

Figure CN120032808B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of health data analysis, and particularly to a nutrition assessment system for dietary intake after bariatric surgery based on a neural network. Background Art
[0002] With the continuous development of technology, although the traditional nutrition assessment system after bariatric surgery has helped patients' recovery to a certain extent, there are still some deficiencies: First of all, the traditional system often ignores the individual differences of patients and the dynamic changes during the postoperative recovery process, resulting in the nutrition assessment results may not be accurate enough to adjust the patients' diet plans in a timely manner; Secondly, the traditional system ignores the comprehensive analysis of multi-dimensional data of patients or has low sensitivity to some influencing factors; for example, the dietary needs of postoperative patients not only depend on the intake, but also are closely related to the internal recovery situation, metabolic changes and the individual health status of patients; traditional methods often cannot effectively capture these complex relationships, resulting in poor accuracy of the assessment and difficulty in meeting the needs of patients at different recovery stages; Therefore, there is an urgent need for a nutrition assessment system for dietary intake after bariatric surgery based on a neural network, which can perform multi-dimensional analysis on patients' health data through a deep learning model, combine personalized optimization paths, and dynamically adjust the nutrition plan to ensure the postoperative recovery effect. Summary of the Invention
[0003] The present invention provides a nutrition assessment system for dietary intake after bariatric surgery based on a neural network, aiming to optimize postoperative nutrition assessment through deep learning technology, provide personalized dietary advice for patients, and support postoperative recovery and long-term health management; in this system, first, a Transformer-RL model combined with channel separation, segment extraction, position embedding, context embedding and decision tree path optimization strategies is used to process complex postoperative health data; this model can analyze patients' health data more efficiently and generate preliminary nutrition assessment results; in order to further improve the accuracy of the assessment and the adaptability of the system, the system optimizes the inference path in the Transformer-RL model through path optimization technology; specifically, the marginal reward optimization loss function is adopted, combined with strategies such as value optimization, contrast learning, Bellman optimality, logarithmic loss and reward normalization, to optimize the generation process of the initial inference path; this optimization scheme can evaluate the potential of the path in real time, ensure that the assessment results fully consider the personalized needs of patients and the actual situation of postoperative recovery, so as to generate the optimal inference path and further improve the accuracy of nutrition assessment; through the above technical steps, the present invention realizes a system that can dynamically adjust the nutrition plan and accurately assess the dietary intake of postoperative patients, providing scientific and effective support for the recovery of postoperative patients.
[0004] The present invention provides a nutritional intake assessment system for post-bariatric surgery based on a neural network. The system includes a data acquisition module, a data preprocessing module, a nutritional assessment module, an optimization assessment module, and a plan adjustment module:
[0005] The data acquisition module collects the patient's basic information, diet records, postoperative recovery data, and nutritional requirement data, and integrates them as postoperative health data;
[0006] The data preprocessing module removes redundancy, processes missing values, normalizes data, and cleans data from the postoperative health data to generate refined health data;
[0007] The nutritional assessment module builds a Transformer model, optimizes the Transformer model by combining channel separation, segment extraction, positional embedding, context embedding, and decision tree path optimization strategies, constructs a Transformer-RL model, processes the refined health data through the Transformer-RL model, and generates a nutritional assessment result; the Transformer-RL model includes an encoder layer and a linear layer;
[0008] The optimization assessment module constructs a marginal reward optimization loss function by combining value optimization, contrastive learning, Bellman optimality, logarithmic loss, and reward normalization, optimizes the Transformer-RL model through the marginal reward optimization loss function, and generates an optimized nutritional assessment result;
[0009] The plan adjustment module adjusts the nutritional requirements according to the optimized nutritional assessment result, dynamically adjusts the nutritional plan, improves the effect of postoperative recovery, and supports long-term health management.
[0010] Furthermore, the process of the nutritional assessment module generating a nutritional assessment result specifically includes the following steps:
[0011] Step S1: Channel separation: Perform channel separation on the refined health data, independently process different categories of data, separate the influences between different data dimensions, thereby improving the prediction accuracy of the model, and generating separated health data;
[0012] Step S2: Segment extraction: Cut the separated health data into time series segments, and each time series segment represents the health data characteristics within a different time period, generating a set of health data segments;
[0013] Step S3: Positional embedding: Add positional encoding to the set of health data segments to maintain the time order and time correlation, generating a set of embedded information health data segments;
[0014] Step S4: Linear projection: Map the set of embedded information health data segments into a health data feature representation through linear projection;
[0015] Step S5: Encoder Processing: Process the health data feature representation through the encoder layer to generate encoder feature data;
[0016] Step S6: Decision Tree Optimization: Process the encoder feature data through the decision tree path optimization strategy to generate an initial inference path;
[0017] Step S7: Output: Flatten the initial inference path and generate a nutrition assessment result through a linear layer.
[0018] Furthermore, Step S5 specifically includes the following steps:
[0019] Step S51: Introduce a context embedding mechanism and a multi-head attention mechanism, dynamically adjust the multi-head attention mechanism through the context embedding mechanism to construct a context-multi-head attention mechanism, and concurrently focus on the health data feature representation through the context-multi-head attention mechanism to learn the dependencies between different types of health data feature representations and generate attention mechanism feature data;
[0020] Step S52: Perform additive normalization and feed-forward operations on the attention mechanism feature data to enhance the data's stability and performance ability and generate encoder feature data.
[0021] Furthermore, Step S6 specifically includes the following steps:
[0022] Step S61: Convert the encoder feature data into a logarithmic probability distribution, and construct a candidate path set according to the logarithmic probability distribution. The candidate path set is divided into un-terminated candidate paths and terminated candidate paths;
[0023] Step S62: Perform an expansion operation on the un-terminated candidate paths to ensure that the exploration scope covers the potential solution space and generate an expanded inference path set;
[0024] Step S63: Traverse the expanded inference path set, perform inference to generate new inference paths, improve the candidate path set, and ensure the breadth and depth of the inference path exploration in each round of inference to fully evaluate the potential of each inference path and generate a complete inference path set; The complete inference path set contains multiple inference paths;
[0025] Step S64: Score each inference path in the complete inference path set using the Bellman error and logit values, evaluate the potential of each inference path, and select the current optimal inference path as the initial inference path.
[0026] Furthermore, the process of the optimization and evaluation module generating an optimized nutrition assessment result specifically includes the following steps:
[0027] Step B1: Evaluate the reward difference of the initial inference path through the marginal reward optimization loss function;
[0028] Step B2: Optimize the initial inference path according to the reward difference to generate the optimal inference path, and optimize the Transformer-RL model according to the optimal inference path to generate the optimized nutrition assessment result.
[0029] Adopting the above solution, the beneficial effects of the present invention are as follows:
[0030] The present invention provides a nutrition assessment system for postoperative diet intake after bariatric surgery based on a neural network. By combining advanced deep learning methods and multi-dimensional data processing technologies, it has successfully achieved accurate nutrition assessment of postoperative diet intake after bariatric surgery. The Transformer-RL model adopted by the system can efficiently process complex postoperative health data, and through technologies such as channel separation, segment extraction, position embedding, and context embedding, accurately capture various health characteristics during the postoperative rehabilitation process of patients, thereby providing a more personalized diet assessment for postoperative patients. This method enables the assessment system to respond in a timely manner to changes in diet requirements during the postoperative rehabilitation process of patients, ensuring the scientificity and effectiveness of nutritional intake and greatly improving the postoperative recovery effect.
[0031] By introducing path optimization technology, the present invention further improves the inference accuracy and adaptability of the system. The adoption of the marginal reward optimization loss function enables the system to adjust the inference path in real time, optimize the accuracy of the nutrition assessment result, and ensure that the system can dynamically adapt to the personalized needs and recovery progress of patients. By combining technologies such as value optimization, contrast learning, and Bellman optimality, the model can not only fully evaluate the potential of each inference path, but also optimize the inference path through multiple rounds of inference, enhancing the accuracy of the assessment result. The optimized inference path can better adapt to the postoperative recovery needs of different patients, thereby improving the practicality and accuracy of the system.
[0032] In summary, the beneficial effects of the present invention are that by introducing advanced neural network technology and path optimization algorithms, it solves the problems of low accuracy and poor adaptability in traditional postoperative nutrition assessment methods. The system can not only evaluate the nutritional needs of patients in real time based on personalized health data, but also dynamically adjust the diet plan to ensure the nutritional intake and rehabilitation effect of postoperative patients. The implementation of this technology provides a more accurate and efficient solution for diet management after bariatric surgery, significantly improving the quality of postoperative recovery of patients and providing strong technical support for long-term health management. Brief Description of the Drawings
[0033] Figure 1 It is a schematic diagram of the modules of a nutrition assessment system for postoperative diet intake after bariatric surgery based on a neural network provided by the present invention;
[0034] Figure 2 It is a schematic structural diagram of the Transformer-RL model in Embodiment 2. Detailed implementation manners
[0035] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0036] Embodiment 1, according to Figure 1 , the present invention provides a nutritional intake assessment system for post-bariatric surgery based on a neural network. The system includes a data acquisition module, a data preprocessing module, a nutritional assessment module, an optimization assessment module, and a plan adjustment module:
[0037] The data acquisition module collects the patient's basic information, diet records, postoperative recovery data, and nutritional requirement data, and integrates them as postoperative health data;
[0038] The data preprocessing module removes redundancy, processes missing values, standardizes data, and cleans data from the postoperative health data to generate refined health data;
[0039] The nutritional assessment module establishes a Transformer model, optimizes the Transformer model by combining channel separation, segment extraction, positional embedding, context embedding, and decision tree path optimization strategies, constructs a Transformer-RL model, and processes the refined health data through the Transformer-RL model to generate a nutritional assessment result; the Transformer-RL model includes an encoder layer and a linear layer;
[0040] The optimization assessment module constructs a marginal reward optimization loss function by combining value optimization, contrast learning, Bellman optimality, logarithmic loss, and reward normalization, and optimizes the Transformer-RL model through the marginal reward optimization loss function to generate an optimized nutritional assessment result;
[0041] The plan adjustment module adjusts the nutritional requirements according to the optimized nutritional assessment result, dynamically adjusts the nutritional plan, improves the effect of postoperative recovery, and supports long-term health management.
[0042] Embodiment 2, according to Figure 2, this embodiment is based on Embodiment 1. In this embodiment, the process of the nutrition assessment module generating a nutrition assessment result by processing refined health data through a Transformer-RL model specifically includes the following steps:
[0043] Step S1: Channel separation: Perform channel separation on the refined health data, independently process different categories of data, separate the influences between different data dimensions, thereby improving the prediction accuracy of the model, and generating separated health data;
[0044] Step S2: Segment extraction: Cut the separated health data into time series segments, and each time series segment represents the health data characteristics in different time periods, generating a set of health data segments;
[0045] Step S3: Positional embedding: Add positional encoding to the set of health data segments to maintain the time order and time correlation, generating a set of health data segments with embedded information;
[0046] Step S4: Linear projection: Map the set of health data segments with embedded information into a health data feature representation through linear projection;
[0047] Step S5: Encoder processing: Process the health data feature representation through the encoder layer to generate encoder feature data;
[0048] Step S6: Decision tree optimization: Process the encoder feature data through a decision tree path optimization strategy to generate an initial inference path;
[0049] Step S7: Output: Flatten the initial inference path and generate a nutrition assessment result through a linear layer.
[0050] Embodiment 3, this embodiment is based on Embodiment 1. In this embodiment, the process of generating a nutrition assessment result specifically includes the following steps:
[0051] Step E1: Channel separation: Perform channel separation on the refined health data, independently process different categories of data, separate the influences between different data dimensions, thereby improving the prediction accuracy of the model, and generating separated health data;
[0052] Step E2: Segment extraction: Cut the separated health data into time series segments, and each time series segment represents the health data characteristics in different time periods, generating a set of health data segments;
[0053] Step E3: Positional embedding: Add positional encoding to the set of health data segments to maintain the time order and time correlation, generating a set of health data segments with embedded information;
[0054] Step E4: Linear Projection: Map the set of embedded information health data segments into a health data feature representation through linear projection;
[0055] Step E5: Encoder Processing: Process the health data feature representation through the encoder layer to generate encoder feature data;
[0056] Step E6: Output: Flatten the encoder feature data and generate a nutrition assessment result through a linear layer.
[0057] Example 4: This example is based on Example 2. In this example, step S5 specifically includes the following steps:
[0058] Step S51: Introduce a context embedding mechanism and a multi-head attention mechanism. Dynamically adjust the multi-head attention mechanism through the context embedding mechanism to construct a context-multi-head attention mechanism. Parallelly focus on the health data feature representation through the context-multi-head attention mechanism, learn the dependencies between different types of health data feature representations, and generate attention mechanism feature data;
[0059] Step S52: Perform additive normalization and feed-forward operations on the attention mechanism feature data to enhance the stability and performance ability of the data, and generate encoder feature data.
[0060] Example 5: This example is based on Example 2. In this example, step S5 specifically includes the following steps:
[0061] Step R1: Introduce a multi-head attention mechanism. Parallelly focus on the health data feature representation through the multi-head attention mechanism, learn the dependencies between different types of health data, and generate attention mechanism feature data;
[0062] Step R2: Perform additive normalization and feed-forward operations on the attention mechanism feature data to enhance the stability and performance ability of the data, and generate encoder feature data.
[0063] Example 6: This example is based on Example 4. In this example, step S6 specifically includes the following steps:
[0064] Step S61: Convert the encoder feature data into a logarithmic probability distribution. According to the logarithmic probability distribution, construct a set of candidate paths. The set of candidate paths is divided into un-terminated candidate paths and terminated candidate paths;
[0065] Step S62: Perform an expansion operation on the un-terminated candidate paths to ensure that the exploration range covers the potential solution space and generate an expanded inference path set;
[0066] Step S63: Traverse the extended inference path set, perform inference, generate new inference paths, and improve the candidate path set. During each round of inference, ensure the breadth and depth of the inference path exploration to fully evaluate the potential of each inference path and generate a complete inference path set; the complete inference path set contains multiple inference paths.
[0067] The inference is executed 20 rounds.
[0068] Step S64: For each inference path in the complete inference path set, score it using the Bellman error and logit value, evaluate the potential of each inference path, and select the current optimal inference path as the initial inference path. The formulas used are as follows:
[0069] ;
[0070] where, represents the time step, represents the Bellman error, represents the state at time step ; represents the state at time step ; represents the action; represents the immediate reward for executing action in state ; represents the discount factor, represents the value function of state ; represents the value function of state ;
[0071] ;
[0072] where, represents the logit value, represents the transposed weight vector, represents the feature vector for executing action in state ;
[0073] ;
[0074] where, represents the inference path index, represents the inference path, represents the score of the inference path, represents the sum of all in the inference path ;
[0075] Example 7. This example is based on Example 6. In this example, the process of the optimization evaluation module generating the optimized nutrition evaluation result specifically includes the following steps:
[0076] Step B1: Evaluate the reward difference of the initial inference path through the marginal reward optimization loss function. The formula used is as follows:
[0077] ;
[0078] Among them, represents the dynamic value marginal loss function, represents the expected value, and represent the path identifiers; and represent the paths respectively; represents the path After passing through the current state, the next state inferred, represents the path After passing through the current state, the next state inferred; represents the reference policy distribution, represents the hyperparameter, represents the reward function; represents the path in the state optimal value, represents the path in the state optimal value; represents the logarithm of the result after passing through the Sigmoid function;
[0079] Step B2: Optimize the initial inference path according to the reward difference to generate the optimal inference path, and optimize the Transformer-RL model according to the optimal inference path to generate the optimized nutrition evaluation result.
[0080] The above describes the present invention and its implementation manners. This description is not restrictive. What is shown in the drawings is only one of the implementation manners of the present invention, and the actual structure is not limited thereto; generally speaking, if those of ordinary skill in the art are inspired by it and design similar structural manners and embodiments without creative efforts without departing from the purpose of the present invention, they should all fall within the protection scope of the present invention.
Claims
1. A nutritional assessment system for dietary intake after bariatric surgery based on neural network, including a data preprocessing module, which generates refined health data; characterized in that: The system further includes a nutrition assessment module and an optimization assessment module; The nutrition assessment module: establishes a Transformer model, optimizes the Transformer model by combining channel separation, segment extraction, positional embedding, context embedding, and decision tree path optimization strategies, constructs a Transformer-RL model, processes the refined health data through the Transformer-RL model, and generates a nutrition assessment result; The optimization assessment module: constructs a marginal reward optimization loss function by combining value optimization, contrastive learning, Bellman optimality, logarithmic loss, and reward normalization, optimizes the Transformer-RL model through the marginal reward optimization loss function, and generates an optimized nutrition assessment result; The process of the optimization assessment module generating the optimized nutrition assessment result specifically includes the following steps: Step B1: Evaluate the reward difference of the initial inference path through the marginal reward optimization loss function, and the formula used is as follows: ; Among them, represents the dynamic value marginal loss function, represents the expected value, and represents the path identifier; and respectively represent the paths; represents the path After passing through the current state, the next state deduced, represents the path After passing through the current state, the next state deduced; represents the reference policy distribution, represents the hyperparameter, represents the reward function; represents the path at the state the optimal value of, represents the path at the state the optimal value of; represents the logarithm of the result after passing through the Sigmoid function; Step B2: Optimize the initial inference path according to the reward difference, generate an optimal inference path, optimize the Transformer-RL model according to the optimal inference path, and generate an optimized nutrition assessment result; The Transformer-RL model includes an encoder layer and a linear layer; The process of the nutrition assessment module generating the nutrition assessment result specifically includes the following steps: Step S1: Perform channel separation on the refined health data to generate separated health data; Step S2: Cut the separated health data into time series segments to generate a set of health data segments; Step S3: Add positional encoding to the set of health data segments to maintain the time order and time correlation, and generate a set of embedded information health data segments; Step S4: Map the set of embedded information health data segments into a health data feature representation through linear projection; Step S5: Process the health data feature representation through the encoder layer to generate encoder feature data; Step S6: Process the encoder feature data through the decision tree path optimization strategy to generate an initial inference path; Step S7: Flatten the initial inference path and generate a nutrition assessment result through the linear layer; Step S6 specifically includes the following steps: Step S61: Convert the encoder feature data into a logarithmic probability distribution, and construct a set of candidate paths according to the logarithmic probability distribution. The set of candidate paths is divided into un-terminated candidate paths and terminated candidate paths; Step S62: Perform an expansion operation on the un-terminated candidate paths to generate a set of expanded inference paths; Step S63: Traverse the set of expanded inference paths, perform inference, improve the set of candidate paths, and generate a set of complete inference paths. The set of complete inference paths contains multiple inference paths; Step S64: Score each inference path in the set of complete inference paths using the Bellman error and logit value, evaluate the potential of each inference path, and select the current optimal inference path as the initial inference path.
2. The nutrition assessment system for dietary intake after bariatric surgery based on neural network according to claim 1, wherein: Step S5 specifically includes the following steps: Step S51: Introduce the context embedding mechanism and the multi-head attention mechanism, dynamically adjust the multi-head attention mechanism through the context embedding mechanism, construct the context-multi-head attention mechanism, and concurrently focus on the health data feature representations through the context-multi-head attention mechanism to generate the attention mechanism feature data; Step S52: Perform additive normalization and feed-forward operations on the attention mechanism feature data to generate the encoder feature data.
Citation Information
Patent Citations
Precise nutrition decision-making system and method based on offline reinforcement learning
CN119833107A