Diabetes patient nutrition proportioning scheme generation method based on calorie prediction network
Through a method based on the calorie prediction network, using physiological indicators and blood sugar monitoring data, a BMR calculation module and blood sugar encoder are designed to build a calorie prediction space, which solves the problem of low accuracy in traditional methods, and realizes the automation and dynamic adjustment of personalized nutritional ratio schemes to meet the nutritional needs of diabetic patients.
Patent Information
- Application Number
- CN202510374056.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-07-01
AI Technical Summary
The existing blood sugar management program relies on traditional formulas to calculate the basal metabolic rate and daily calorie required, with low accuracy, difficulty in considering individual differences, and accurate grasp of the nutritional needs and metabolic characteristics of diabetic patients.
Using a method based on a caloric prediction network, a basal metabolic rate BMR calculation module and a blood sugar level encoder were designed by obtaining patient physiological indicators and blood sugar monitoring data, a caloric prediction space was constructed, and a personalized nutritional ratio scheme was generated. Feature extraction and analysis were performed using the Resnet backbone network and SE attention mechanism, and a multi-layer perceptron and full-connected layer were used for caloric prediction.
It realizes the generation of automated and personalized nutritional ratio schemes, which can be dynamically adjusted based on real-time data, significantly improve treatment efficiency and convenience, and accurately meet the physiological and pathological needs of diabetic patients.
Smart Images

Figure CN120236719A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of healthcare methods, and particularly relates to a method for generating a nutritional ratio plan for diabetic patients based on a calorie prediction network. Background Art
[0002] Diabetes is a chronic disease marked by hyperglycemia, caused by absolute or relative insulin deficiency and utilization disorders. This disease is mainly divided into three types: type 1, type 2, and gestational diabetes. Currently, the incidence and prevalence of diabetes are on the rise globally. For diabetic patients, the progression of diabetes is a one-way street and irreversible. It can only be alleviated by controlling diet or exercise. When blood sugar is well controlled through daily diet or exercise, the development process of diabetes can be alleviated to a large extent. When blood sugar control is poor due to unreasonable daily diet or lack of exercise, it may accelerate the development process of diabetes.
[0003] Therefore, diet management is very important for diabetic patients. The traditional daily management of diabetic patients is carried out by listening to the doctor's advice. However, since diagnoses and treatments only occur at some time points, the doctor's advice is only for the designated time points and cannot achieve long-term diet management for diabetic patients. Therefore, how to provide personalized and long-term diet management for diabetic patients is a technical problem that needs to be solved urgently at present.
[0004] Current blood sugar prediction algorithms mainly analyze historical blood sugar data to establish a time series model to predict future blood sugar values. In addition, it can also be constructed based on machine learning algorithms, such as support vector machines, decision trees, neural networks, etc. The construction of the model requires training data, including factors such as the patient's blood sugar data, diet data, and basal metabolic rate. However, the current algorithms rely on traditional formulas to calculate the basal metabolic rate and daily calorie requirements, with low accuracy and unable to take into account individual differences to accurately grasp the nutritional needs and metabolic characteristics of each patient. Summary of the Invention
[0005] The purpose of the present invention is to provide a method for generating a nutritional ratio plan for diabetic patients based on a calorie prediction network, which solves the problems that the existing blood sugar management plan relies on traditional formulas to calculate the basal metabolic rate and daily calorie requirements, with low accuracy and difficulty in considering individual differences.
[0006] The technical solution adopted by the present invention is: a method for generating a nutritional ratio plan for diabetic patients based on a calorie prediction network, which obtains the patient's own physiological indicators and recent blood glucose monitoring data, designs a basal metabolic rate BMR calculation module according to the patient's physiological indicators, designs a blood glucose level encoder according to the blood glucose monitoring results, constructs a calorie prediction space according to the patient's physiological indicators and the output results of the blood glucose level encoder, constructs a calorie prediction head through the output results of the calorie prediction space, constructs a calorie prediction network based on the calorie prediction head, and finally, when in use, inputs the patient's body indicators, that is, individual parameters, into the BMR calculation module, inputs the patient's daily fasting blood glucose value into the blood glucose level encoder, and the calorie prediction network outputs the proportion of nutrients that the patient should ingest daily. The characteristics of the technical solution adopted by the present invention also lie in: Furthermore, the method for generating a nutritional ratio plan for diabetic patients based on a calorie prediction network is specifically implemented according to the following steps: Step 1: Obtain a batch of patients' own physiological indicators and recent blood glucose monitoring data; Step 2: Design of the BMR calculation module: According to the patient's physiological indicators, form an individual parameter vector for each patient, and measure the basal metabolic rate BMR of each patient for a continuous week. Corresponding the individual parameter vector with the patient's BMR value, obtain the training data set of the BMR calculation module. Take the individual parameter vector of the patient as the input, and after convolution, obtain the feature map F. Use the bottleneck in Resnet as the backbone network basic module to extract features from the feature map F, and at the same time perform average pooling operation on it. Add the extracted features to the average pooling result to obtain the basic metabolic feature FBMR. Perform a convolution operation on the basic metabolic feature FBMR to obtain the final basal metabolic rate value BMR. Finally, use the training data set of the BMR calculation module to train the parameters of the above module. After the model converges, obtain the BMR calculation module; Step 3: Design of the blood glucose level encoder: Perform a convolution operation on the blood glucose data to obtain a blood glucose feature vector. Input the blood glucose feature vector into the SE attention mechanism for key feature screening to obtain feature M1. Input feature M1 into the multi-layer perceptron and repeat the per-dimensional addition and SE attention mechanism screening to obtain feature M2. Perform convolution processing and per-dimensional addition on feature M2 to obtain the final blood glucose feature vector FBG; Step 4, Heat Prediction Space Design: The blood glucose feature vector FBG output in Step 3 is passed through a multi-layer perceptron to remove the feature aliasing effect of the previous step, obtaining the blood glucose feature vector A. The basal metabolic rate feature FBMR in the module of Step 2 is subjected to convolutional processing to obtain the basal metabolic rate feature map B. The basal metabolic rate feature map B is configured with a weight of α, and matrix multiplication is performed with the blood glucose feature vector A to obtain the feature map C. Convolution and average pooling operations are performed on the feature map C, and the convolution result and the pooling result are added and then subjected to convolution operation to obtain the heat prediction feature map FQ; Step 5, Heat Prediction Head Design: The heat prediction feature map FQ is input into two consecutive fully connected layers. The dimensions of the fully connected layers are 8 and 3 respectively, and the final heat prediction value is output, that is, the recommended intake of carbohydrates, proteins, and fats; Step 6, Heat Prediction Network Design: The heat prediction network includes a first heat prediction network, a second heat prediction network, and a third heat prediction network; The first heat prediction network is for predicting the heat intake before the patient's first meal of the day, including a first blood glucose level encoder, a BMR calculation module, a first heat prediction space, and a first heat prediction head. The input is the patient's fasting blood glucose monitoring result and individual parameters, and the output is the heat value X; The second heat prediction network is for predicting the heat intake before the patient's second meal of the day, including a second blood glucose level encoder, a second heat prediction space, and a second heat prediction head. The input is the blood glucose 1 after the first meal and the heat prediction feature map FQ1 in the first heat prediction network, and the output is the heat value Y; The third heat prediction network is for predicting the heat intake before the patient's third meal of the day, including a third blood glucose level encoder, a third heat prediction space, and a third heat prediction head. The input is the blood glucose 2 after the second meal and the heat prediction feature map FQ2 in the second heat prediction network, and the output is the heat value Z; The network structures of the first, second, and third blood glucose level encoders are the same, all being the blood glucose level encoder structure in Step 3; the network structures of the first, second, and third heat prediction heads are the same, all being the heat prediction head structure in Step 4; Step 7, Generation of the Patient's Personalized Nutrition Ratio Plan: The patient's individual parameters are input into the BMR calculation module, and the patient's daily fasting blood glucose value is input into the first blood glucose level encoder. The three heat prediction networks can automatically output the proportion of nutrients that the patient should intake for the first, second, and third meals of the day, that is, breakfast, lunch, and dinner.
[0007] Further, the patient's own physiological indicators in Step 1 include age, gender, height, weight, and exercise level.
[0008] Further, Step 2 is specifically as follows: First, according to the individual parameters of a group of diabetic patients, an individual parameter vector of 16 dimensions is formed for each patient; the basal metabolic rate (BMR) of each patient is measured continuously for one week, that is, before breakfast every day, in a waking state, lying quietly and resting for half an hour, with the room temperature maintained at 18 - 22 °C, and measured using an instrument according to the indirect calorimetry method. The average value of the BMR values for that week is taken as the BMR value corresponding to the patient; the individual parameter vector and the patient's BMR value are corresponded to each other, which is the training data set of the BMR calculation module. The design process of the BMR calculation module is as follows: Taking the individual parameter vector of a patient as the input, first, the individual parameter vector B1 of the patient is respectively input into 16 one-dimensional convolutional layers with a convolutional kernel of 1*3 for feature dimension elevation, with a stride set to 1, to obtain 16 16-dimensional individual parameter feature vectors; these 16-dimensional feature vectors are concatenated to obtain a feature map F with a size of 16*16; Using the bottleneck in Resnet as the basic module of the backbone network, the feature map F is input into 4 consecutive bottlenecks for feature extraction to obtain a feature output with a size of 4*4; Synchronously, an average pooling operation with a pooling kernel of 2*2 is performed on the feature map F, and the result is added to the feature output of the previous step to obtain the basal metabolic feature FBMR with a dimension of 4*4, as shown in formula (1); A single-core two-dimensional convolutional layer with a kernel of 4*4 is set, and the basal metabolic feature FBMR is input into this convolutional layer to obtain the final basal metabolic rate value BMR, as shown in formula (2).
[0009] Among them, is the feature output result obtained after the feature map F is input into the bottleneck, and Averpool(F) is the result obtained after the average pooling of the feature map F. is the result obtained after the convolution of the basal metabolic feature FBMR. Finally, the training data set of the BMR calculation module is used to train the parameters of this module. After the model converges, the BMR calculation module is obtained.
[0010] Furthermore, step 3 is specifically as follows: First, the measured blood glucose monitoring level (BGL) of the patient is respectively input into 32 one-dimensional convolutional layers with a convolutional kernel of 1*3 for feature dimension elevation, with a stride set to 1, to obtain 32 32-dimensional blood glucose feature vectors; the above-mentioned 32 feature vectors are added dimension by dimension to obtain a 1*32-dimensional blood glucose feature vector; and this feature vector is input into the SE attention mechanism for key feature screening to obtain the feature M1, as shown in formula (3). Then, the feature M1 is input into 32 parallel multi-layer perceptrons (MLPs), and 32 1*16-dimensional features are output. By repeating the per-dimension addition and SE attention mechanism screening on them, a 16-dimensional feature M2 is obtained, as shown in formula (4); The 16-dimensional feature M2 is further subjected to 16 parallel one-dimensional convolutional processes and per-dimension addition to obtain the final blood glucose feature vector FBG, with a size of 1*16-dimensional, as shown in formula (5);
[0011] where i is the serial number corresponding to the feature map, is the blood glucose feature vector.
[0012] Furthermore, step 4 is specifically as follows: Calorie prediction space design: The blood glucose feature vector FBG output in step 3 is passed through a multi-layer perceptron to remove the feature aliasing effect of the previous step, and a 32-dimensional blood glucose feature vector A is obtained, as shown in formula (6); The basal metabolic rate feature FBMR in the module of step 2 is input into a transposed convolutional layer with a convolutional kernel of 3*3 and a stride of 8 to obtain a basal metabolic rate feature map B, as shown in formula (7); Subsequently, in the calorie prediction space, the basal metabolic rate feature map B is configured with a weight of α, and matrix multiplication is performed with the blood glucose feature vector A to obtain a 32*32-dimensional feature map C, as shown in formula (8); The feature map C is subjected to 64 parallel two-dimensional convolutional operations, and after the convolutional results are element-wise added, they are input into a backbone network composed of 8 consecutive bottlenecks for feature extraction and downsampling to obtain a calorie prediction feature map with a dimension of 4*4; the feature map C is subjected to average pooling with a kernel of 8, and the pooling result is added to the calorie prediction feature map and a two-dimensional convolutional operation with a convolutional kernel of 3*3 and a number of 1 is performed to obtain a final calorie prediction feature map FQ with a dimension of 4*4, as shown in formula (9);
[0013] where, is the blood glucose feature vector A, is the basal metabolic rate feature map B, is the feature map C, α is the weight, is the calorie prediction feature map FQ, and i is the serial number corresponding to the feature map; Different values of α correspond to the first, second, and third calorie prediction spaces respectively. In the first calorie prediction space, α is 1; in the second calorie prediction space, α is 0.65; in the third calorie prediction space, α is 0.75.
[0014] Furthermore, step 6 is specifically as follows: Design of the first calorie prediction network: Input the fasting blood glucose monitoring results of the patient into the first blood glucose level encoder to obtain the first blood glucose feature vector FBG; input the individual parameters into the BMR calculation module to obtain the basal metabolic feature FBMR. In the construction of the calorie prediction network, remove the last step of the BMR calculation module in step 1 and only take the basal metabolic feature FBMR as the output; input the first blood glucose feature vector FBG and the basal metabolic feature FBMR into the first calorie prediction space simultaneously to obtain the calorie prediction feature map FQ1, and input it into the first calorie prediction head to obtain a set of calorie values X, that is, the amounts of carbohydrates, proteins, and fats that should be ingested in the patient's first meal; construct the first calorie prediction training dataset according to the first meal calorie intake value suggestions given by experts for a batch of patients' fasting blood glucose values and individual parameters; use this dataset to train the parameters of the first calorie prediction network until the model converges; Design of the second calorie prediction network: Input the blood glucose monitoring results after the patient's first meal, that is, the first post-meal blood glucose 1, into the second blood glucose level encoder to obtain the second blood glucose feature vector FBG; input the calorie prediction feature map FQ1 output by the first calorie prediction space and the second blood glucose feature vector FBG into the second calorie prediction space simultaneously, and set the α value of the second calorie prediction space to 0.65 to obtain the calorie prediction feature map FQ2, and input it into the second calorie prediction head to obtain a set of calorie values Y, that is, the amounts of carbohydrates, proteins, and fats that should be ingested in the patient's second meal; construct the second calorie prediction training dataset according to the second lunch calorie intake value suggestions given by experts for a batch of patients' fasting blood glucose values, first post-meal blood glucose values, and individual parameters; use this dataset to train the parameters of the second calorie prediction network until the model converges; Design of the third calorie prediction network: Input the blood glucose monitoring results after the patient's second meal, that is, the second post-meal blood glucose 2, into the third blood glucose level encoder to obtain the third blood glucose feature vector FBG; input the calorie prediction feature map FQ2 output by the second calorie prediction space and the third blood glucose feature vector FBG into the third calorie prediction space simultaneously, and set the α value of the third calorie prediction space to 0.75 to obtain the calorie prediction feature map FQ3, and input it into the third calorie prediction head to obtain a set of calorie values Z, that is, the amounts of carbohydrates, proteins, and fats that should be ingested in the patient's third meal. Construct the third calorie prediction training dataset according to the third meal calorie intake value suggestions given by experts for a batch of patients' fasting blood glucose values, first post-meal blood glucose values, second post-meal blood glucose values, and individual parameters; use this dataset to train the parameters of the third calorie prediction network until the model converges.
[0015] Furthermore, in step 7, select the corresponding calorie prediction network according to the number of meals the patient has to generate the personalized nutrition ratio plan for the patient within the day.
[0016] The beneficial effects of the present invention are: 1. Compared with the traditional process of formulating nutritional ratio plans, which is cumbersome and requires a large amount of manual calculation and evaluation by dietitians according to individual differences, the method for generating a nutritional ratio plan for diabetic patients based on a calorie prediction network in the present invention has a core technology of a calorie prediction network. This method can autonomously analyze the patient's physical condition based on the patient's body indicators and regular blood glucose monitoring results, and automatically and specifically output the nutritional ratios for three meals, significantly improving the treatment efficiency and convenience. In addition, this method can also be dynamically adjusted according to the patient's real-time data and feedback, making it more scientific and reasonable.
[0017] 2. In the present invention, the BMR calculation module, blood glucose level encoder, and calorie prediction space abandon traditional calculation formulas, and through big data-driven and neural network analysis, deeply learn and analyze the coupling relationship between the individual characteristics of diabetic patients and their blood glucose levels, and can accurately grasp the nutritional needs and metabolic characteristics of each patient, so as to meet their unique physiological and pathological needs. Brief Description of the Drawings
[0018] Figure 1 is the overall flowchart of the method of the present invention; Figure 2 is the structural diagram of the BMR calculation module of the method of the present invention; Figure 3 is the structural diagram of the blood glucose level encoder of the method of the present invention; Figure 4 is the structural diagram of the calorie prediction space of the method of the present invention; Figure 5 is the structural diagram of the calorie prediction network of the method of the present invention. Detailed Embodiments
[0019] The method of the present invention will be further described below through examples and drawings.
[0020] Example 1 A method for generating a nutritional ratio plan for diabetic patients based on a calorie prediction network, which obtains the patient's own physiological indicators and recent blood glucose monitoring data, designs a basal metabolic rate BMR calculation module according to the patient's physiological indicators, designs a blood glucose level encoder according to the blood glucose monitoring results, constructs a calorie prediction space according to the patient's physiological indicators and the output results of the blood glucose level encoder, constructs a calorie prediction head through the output results of the calorie prediction space, constructs a calorie prediction network based on the calorie prediction head, and finally, when in use, inputs the patient's body indicators, that is, individual parameters, into the BMR calculation module, inputs the patient's daily fasting blood glucose value into the blood glucose level encoder, and the calorie prediction network outputs the proportion of nutrients that the patient should intake daily.
[0021] Example 2 A method for generating a nutritional ratio plan for diabetic patients based on a calorie prediction network is specifically implemented according to the following steps: Step 1: Obtain a batch of patients' own physiological indicators and recent blood glucose monitoring data; Step 2: Design of the BMR calculation module: According to the patients' physiological indicators, form the individual parameter vectors of each patient, and measure the basal metabolic rate (BMR) of each patient continuously for one week. Correlate the individual parameter vectors with the patients' BMR values to obtain the training dataset of the BMR calculation module. Use the individual parameter vectors of the patients as inputs, and after convolution, obtain the feature map F. Use the bottleneck in Resnet as the basic backbone network module to extract features from the feature map F. At the same time, perform average pooling operation on it. Add the extracted features to the average pooling result to obtain the basal metabolic feature F_BMR. Perform a convolution operation on the basal metabolic feature F_BMR to obtain the final basal metabolic rate value BMR. Finally, use the training dataset of the BMR calculation module to train the parameters of the above module. After the model converges, obtain the BMR calculation module; Step 3: Design of the blood glucose level encoder: Perform a convolution operation on the blood glucose data to obtain the blood glucose feature vector. Input the blood glucose feature vector into the SE attention mechanism for key feature screening to obtain the feature M1. Input the feature M1 into the multi-layer perceptron and repeat the per-dimensional addition and SE attention mechanism screening to obtain the feature M2. Perform convolution processing and per-dimensional addition on the feature M2 to obtain the final blood glucose feature vector F_BG; Step 4: Design of the calorie prediction space: Pass the blood glucose feature vector F_BG output in Step 3 through a multi-layer perceptron to remove the feature aliasing effect of the previous step to obtain the blood glucose feature vector A. Perform a convolution operation on the basal metabolic feature F_BMR in the module of Step 2 to obtain the basal metabolic feature map B. Configure the weight of the basal metabolic feature map B with a weight of α, and perform matrix multiplication with the blood glucose feature vector A to obtain the feature map C. Perform convolution and average pooling operations on the feature map C. After adding the convolution result and the pooling result, perform another convolution operation to obtain the calorie prediction feature map F_Q; Step 5: Design of the calorie prediction head: Input the calorie prediction feature map F_Q into two consecutive fully connected layers. The dimensions of the fully connected layers are 8 and 3 respectively, and output the final calorie prediction value, that is, the recommended intake of carbohydrates, proteins, and fats; Step 6: Design of the calorie prediction network: The calorie prediction network includes the first calorie prediction network, the second calorie prediction network, and the third calorie prediction network; The first calorie prediction network is for predicting the calorie intake before the first meal of the patient every day, and includes the first blood glucose level encoder, the BMR calculation module, the first calorie prediction space, and the first calorie prediction head. The input is the patient's fasting blood glucose monitoring result and individual parameters, and the output is the calorie value X; The second calorie prediction network is for predicting the calorie intake before the patient's second meal of the day, including a second blood glucose level encoder, a second calorie prediction space, and a second calorie prediction head. The input is the post-meal blood glucose 1 after the first meal and the calorie prediction feature map FQ1 in the first calorie prediction network, and the output is the calorie value Y. The third calorie prediction network is for predicting the calorie intake before the patient's third meal of the day, including a third blood glucose level encoder, a third calorie prediction space, and a third calorie prediction head. The input is the post-meal blood glucose 2 after the second meal and the calorie prediction feature map FQ2 in the second calorie prediction network, and the output is the calorie value Z. The network structures of the first, second, and third blood glucose level encoders are the same, all being the blood glucose level encoder structure in step 3; the network structures of the first, second, and third calorie prediction heads are the same, all being the calorie prediction head structure in step 4. Step 7: Generation of the patient's personalized nutrition ratio plan: Input the patient's individual parameters into the BMR calculation module, and input the patient's daily fasting blood glucose value into the first blood glucose level encoder. The three calorie prediction networks can automatically output the proportions of nutrients that the patient should intake for the first, second, and third meals of the day, that is, breakfast, lunch, and dinner.
[0022] Example 3 Based on Example 2, as Figure 2 shown, the design process of the BMR calculation module is as follows: Taking a patient's individual parameter vector as the input, first, input the patient's individual parameter vector B1 into 16 one-dimensional convolutional layers with a convolutional kernel of 1*3 respectively for feature dimension elevation, with a stride set to 1, to obtain 16 16-dimensional individual parameter feature vectors; Concatenate these 16-dimensional feature vectors to obtain a feature map F with a size of 16*16; Use the bottleneck in Resnet as the backbone network basic module, input the feature map F into 4 consecutive bottlenecks for feature extraction to obtain a feature output with a size of 4*4; Synchronously perform an average pooling operation with a pooling kernel of 2*2 on the feature map F, and add the result to the feature output of the previous step to obtain the basal metabolic feature FBMR with a dimension of 4*4, as shown in formula (1); Set a single-core two-dimensional convolutional layer with a kernel of 4*4, input the basal metabolic feature FBMR into this convolutional layer to obtain the final basal metabolic rate value BMR, as shown in formula (2).
[0023] Among them, is the feature output result obtained after the feature map F is input into the bottleneck, Averpool(F) is the result obtained after the average pooling of the feature map F, is the result obtained after the convolution of the basal metabolic feature FBMR; Finally, the BMR calculation module is trained with a training dataset to train the parameters of the module. After the model converges, the BMR calculation module is obtained.
[0024] Example 4 Based on Example 2, as Figure 3 shown, the blood glucose level encoder is designed as follows: First, the measured blood glucose monitoring levels BGL of the patient are respectively input into 32 one-dimensional convolutional layers with a convolutional kernel of 1*3 for feature dimension elevation, and the stride is set to 1 to obtain 32 32-dimensional blood glucose feature vectors; the above 32 feature vectors are added dimension by dimension to obtain a 1*32-dimensional blood glucose feature vector; and this feature vector is input into the SE attention mechanism for key feature screening to obtain feature M1, as shown in formula (3); Then, feature M1 is input into 32 parallel multi-layer perceptrons MLP, and 32 1*16-dimensional features are output. The dimension-by-dimension addition and SE attention mechanism screening are repeated for them to obtain 16-dimensional feature M2, as shown in formula (4); The 16-dimensional feature M2 is subjected to 16 parallel one-dimensional convolutional processes and dimension-by-dimension addition to obtain the final blood glucose feature vector FBG, with a size of 1*16 dimensions, as shown in formula (5);
[0025] where i is the serial number corresponding to the feature map, is the blood glucose feature vector.
[0026] Example 5 Based on Example 2, as Figure 4 shown, the calorie prediction space is designed as follows: The blood glucose feature vector FBG output in step 3 is passed through a multi-layer perceptron to remove the feature aliasing effect of the previous step to obtain a 32-dimensional blood glucose feature vector A, as shown in formula (6); The basic metabolic feature FBMR in the module of step 2 is input into a transposed convolutional layer with a convolutional kernel of 3*3 and a stride of 8 to obtain a basic metabolic feature map B, as shown in formula (7); Subsequently, in the calorie prediction space, the basic metabolic feature map B is configured with a weight of α, and matrix multiplication is performed with the blood glucose feature vector A to obtain a 32*32-dimensional feature map C, as shown in formula (8); Perform 64 parallel two-dimensional convolution operations on the feature map C, and after element-wise summing the convolution results, input them into a backbone network composed of 8 consecutive bottlenecks for feature extraction and downsampling to obtain a heat prediction feature map with a dimension of 4*4; perform average pooling on the feature map C with a kernel of 8, and perform addition on the pooling result and the heat prediction feature map, as well as a two-dimensional convolution operation with a convolution kernel of 3*3 and a number of 1 to obtain a final heat prediction feature map FQ with a dimension of 4*4, as shown in formula (9);
[0027] Among them, is the blood glucose feature vector A, is the basal metabolic feature map B, is the feature map C, α is the weight, is the heat prediction feature map FQ, and i is the serial number corresponding to the feature map; Different α values correspond to the first, second, and third heat prediction spaces respectively. α is 1 in the first heat prediction space, 0.65 in the second heat prediction space, and 0.75 in the third heat prediction space.
[0028] Example 6 The present invention proposes a method for generating a nutritional ratio plan for diabetic patients based on a heat prediction network, and its process is as Figure 1 shown, and it is divided into the following steps: Step 1: Design of the BMR calculation module. The function of this module is to calculate the basal metabolic rate of patients according to their physiological index information. First, record the individual parameters of a group of diabetic patients, including information such as age, gender, height, weight, and exercise level; based on the above information, form a 16-bit individual parameter vector for each patient; measure the basal metabolic rate (BMR) of each patient continuously for one week, that is, before having breakfast every day, lie quietly and rest for half an hour (but stay awake), maintain the room temperature at about 20°C, and measure it using an instrument according to the indirect calorimetry method. Take the average value of the BMR values of this week as the BMR value corresponding to this patient, and correspond the individual parameter vector with the patient's BMR value, which is the training data set of the BMR calculation module.
[0029] Taking the individual parameter vector of a patient as the input, demonstrate the design process of the BMR calculation module, as Figure 2Shown as follows: First, the individual parameter vector B1 of the patient is respectively input into 16 one-dimensional convolutional layers with a convolutional kernel of 1*3 for feature dimensionality increase, with the stride set to 1, obtaining 16 16-dimensional individual parameter feature vectors; these 16-dimensional feature vectors are concatenated to obtain a feature map F with a size of 16*16; the bottleneck in Resnet is used as the backbone network basic module, and the feature map F is input into 4 consecutive bottlenecks for feature extraction, obtaining a feature output with a size of 4*4; simultaneously, an average pooling operation with a pooling kernel of 2*2 is performed on the feature map F, and the result is added to the feature output of the previous step to obtain the basic metabolic feature FBMR with a dimension of 4*4, as shown in formula (1); a single-core two-dimensional convolutional layer with a kernel of 4*4 is set, and this feature is input into this convolutional layer to obtain the final basal metabolic rate value BMR, as shown in formula (2); finally, the BMR calculation module training dataset is used to train the parameters of this module, and after the model converges, the BMR calculation module is obtained.
[0030]
[0031] Among them, is the feature output result obtained after the feature map F is input into the bottleneck, and Averpool(F) is the result obtained after the average pooling of the feature map F. is the result obtained after the convolution of the basic metabolic feature FBMR. Step 2: Design of the blood glucose level encoder. The role of the blood glucose level encoder is to process the real-time blood glucose monitoring results of the patient into valuable blood glucose feature vectors through feature extraction. As Figure 3 shown, first, the measured blood glucose monitoring levels BGL (Blood glucose level) of the patient are respectively input into 32 one-dimensional convolutional layers with a convolutional kernel of 1*3 for feature dimensionality increase, with the stride set to 1, obtaining 32 32-dimensional blood glucose feature vectors; the above 32 feature vectors are added dimension by dimension to obtain a 1*32-dimensional blood glucose feature vector; and this feature vector is input into the SE (Squeeze Excitation module) attention mechanism for key feature screening to obtain feature M1, as shown in formula (3), then feature M1 is input into 32 parallel multi-layer perceptrons MLP (Multilayer Perception), outputting 32 1*16-dimensional features, repeating the addition dimension by dimension and SE attention mechanism screening to obtain 16-dimensional feature M2, as shown in formula (4); this 16-dimensional feature is then subjected to 16 parallel one-dimensional convolutional processes and addition dimension by dimension to obtain the final blood glucose feature vector FBG with a size of 1*16, as shown in formula (5).
[0032] where \(i\) is the serial number corresponding to the feature map, and it is the blood glucose feature vector.
[0033] Step 3: Design of the calorie prediction space. The role of the calorie prediction space is to mine the coupling relationship between the current blood glucose level characteristics and the basal metabolic characteristics of the patient, and to predict the reasonable calorie intake for the next meal based on the learning results.
[0034] As Figure 4 shown, first, perform the first calorie prediction space design: Pass the blood glucose feature vector FBG output in Step 2 through a multi-layer perceptron to remove the feature aliasing effect of the previous step, and obtain a 32-dimensional blood glucose feature vector A, as shown in Equation (6); Input the basal metabolic feature FBMR in the module of Step 1 (note that here the final output of the BMR calculation module: the basal metabolic rate value BMR is not used) into a transposed convolutional layer with a convolutional kernel of 3×3 and a stride of 8 to obtain the basal metabolic feature map B, as shown in Equation (7); Subsequently, in the first calorie prediction space, perform weight configuration with a weight of α on the basal metabolic feature map B, and perform matrix multiplication with the blood glucose feature vector A to obtain a 32×32-dimensional feature map C, as shown in Equation (8); Perform 64 parallel two-dimensional convolutional operations on this feature map, and after element-wise summing the convolutional results, input them into a backbone network composed of 8 consecutive bottlenecks for feature extraction and downsampling to obtain a calorie prediction feature map with a dimension of 4×4; Perform average pooling with a kernel of 8 on the feature map C, and perform addition and two-dimensional convolutional operations with a convolutional kernel of 3×3 and a number of 1 on the pooling result and the calorie prediction feature map to obtain the final calorie prediction feature map FQ with a dimension of 4×4, as shown in Equation (9).
[0035]
[0036] where is the blood glucose feature vector A, is the basal metabolic feature map B, is the feature map C, α is the weight, is the calorie prediction feature map FQ, and \(i\) is the serial number corresponding to the feature map; Step 4: Design of the calorie prediction head; Input the calorie prediction feature map FQ into two consecutive fully connected layers. The dimensions of the fully connected layers are 8 and 3 respectively, and output the final calorie prediction value, that is, the recommended intakes of carbohydrates, proteins, and fats.
[0037] Step 5: Design of the calorie prediction network. As Figure 5As shown, first, the first calorie prediction network is designed. The fasting blood glucose monitoring results of the patient are input into the first blood glucose level encoder to obtain the first blood glucose feature vector FBG. The individual parameters are input into the BMR calculation module to obtain the basal metabolic feature FBMR (note: in the construction of the calorie prediction network, the last step of the BMR calculation module in step one is removed, and only the basal metabolic feature FBMR is taken as the output). The first blood glucose feature vector FBG and the basal metabolic feature FBMR are simultaneously input into the first calorie prediction space, and the α value of the first calorie prediction space is set to 1 to obtain the calorie prediction feature map FQ, which is then input into the first calorie prediction head to obtain a set of calorie values X, that is, the amounts of carbohydrates, proteins, and fats that should be ingested in the patient's breakfast. Let experts give suggestions on reasonable breakfast calorie intake values based on the fasting blood glucose values and individual parameters of a group of patients. Based on this, the first calorie prediction training dataset is constructed; this dataset is used to train the parameters of the first calorie prediction network until the model converges.
[0038] The second calorie prediction network is designed. The post-breakfast blood glucose monitoring results of the patient, that is, postprandial blood glucose 1, are input into the second blood glucose level encoder to obtain the second blood glucose feature vector FBG. The calorie prediction feature map FQ output by the first calorie prediction space and the second blood glucose feature vector FBG are simultaneously input into the second calorie prediction space, and the α value of the second calorie prediction space is set to 0.65 to obtain the calorie prediction feature map FQ, which is then input into the second calorie prediction head to obtain a set of calorie values Y, that is, the amounts of carbohydrates, proteins, and fats that should be ingested in the patient's lunch. Let experts give suggestions on reasonable lunch calorie intake values based on the fasting blood glucose values, post-breakfast blood glucose values, and individual parameters of a group of patients. Based on this, the second calorie prediction training dataset is constructed; this dataset is used to train the parameters of the second calorie prediction network until the model converges.
[0039] The third calorie prediction network is designed. The post-lunch blood glucose monitoring results of the patient, that is, postprandial blood glucose 2, are input into the third blood glucose level encoder to obtain the third blood glucose feature vector FBG. The calorie prediction feature map FQ output by the second calorie prediction space and the third blood glucose feature vector FBG are simultaneously input into the third calorie prediction space, and the α value of the third calorie prediction space is set to 0.75 to obtain the calorie prediction feature map FQ, which is then input into the third calorie prediction head to obtain a set of calorie values Z, that is, the amounts of carbohydrates, proteins, and fats that should be ingested in the patient's dinner. Let experts give suggestions on reasonable dinner calorie intake values based on the fasting blood glucose values, post-breakfast blood glucose values, post-lunch blood glucose values, and individual parameters of a group of patients. Based on this, the third calorie prediction training dataset is constructed; this dataset is used to train the parameters of the third calorie prediction network until the model converges.
[0040] Note: The network structures of the first, second, and third blood glucose level encoders are the same, all of which are the blood glucose level encoder structures in Step 2. The network structures of the first, second, and third calorie prediction heads are the same, all of which are the calorie prediction head structures in Step 4.
[0041] Step 6: Generate a personalized nutrition ratio plan for the patient. Measure the patient's physical indicators and input the physical indicators required in Step 1, i.e., individual parameters, into the BMR calculation module (the individual parameter input can be updated in a timely manner according to the changes in the patient's physical condition). Input the patient's daily fasting blood glucose value into the first blood glucose level encoder, and the three calorie prediction heads can automatically output the proportions of nutrients that the patient should intake for breakfast, lunch, and dinner on that day. After breakfast, output the patient's postprandial blood glucose into the second blood glucose level encoder, and the second and third calorie prediction heads can automatically obtain the proportions of nutrients that should be intaken for lunch and dinner. After lunch, output the patient's postprandial blood glucose into the third blood glucose level encoder, and the third calorie prediction head can automatically obtain the proportion of nutrients that should be intaken for dinner.
Claims
1. A method for generating a nutritional ratio plan for diabetic patients based on a calorie prediction network, characterized in that: The patient's own physiological indicators and recent blood glucose monitoring data are obtained, and a basal metabolic rate (BMR) calculation module is designed according to the patient's physiological indicators. A blood glucose level encoder is designed according to the blood glucose monitoring results. A calorie prediction space is constructed according to the patient's physiological indicators and the output results of the blood glucose level encoder. A calorie prediction head is constructed through the output results of the calorie prediction space. A calorie prediction network is constructed based on the calorie prediction head. Finally, when using the calorie prediction network, the patient's physical indicators, i.e., individual parameters, are input into the BMR calculation module, and the patient's daily fasting blood glucose value is input into the blood glucose level encoder. The calorie prediction network outputs the proportion of nutrients that the patient should consume daily.
2. The method for generating a nutritional ratio plan for diabetic patients based on a calorie prediction network according to claim 1, characterized in that: Please follow the steps below to implement: Step 1: Obtain a batch of patients' own physiological indicators and recent blood sugar monitoring data; Step 2, BMR calculation module design: According to the patient's physiological indicators, an individual parameter vector is formed for each patient, and the basal metabolic rate BMR of each patient is measured for one week. The individual parameter vector is matched with the patient's BMR value to obtain the BMR calculation module training data set. The patient's individual parameter vector is used as input, and the feature map F is obtained after convolution. The bottleneck in Resnet is used as the backbone network basic module to extract features from the feature map F, and the average pooling operation is performed on it. The extracted features are added to the average pooling results to obtain the basal metabolic feature FBMR, and the basal metabolic feature FBMR is convolved to obtain the final basal metabolic rate value BMR. Finally, the BMR calculation module training data set is used to train the parameters of the above modules. After the model converges, the BMR calculation module is obtained; Step 3, blood glucose level encoder design: perform convolution operation on blood glucose data to obtain blood glucose feature vector, input blood glucose feature vector into SE attention mechanism for key feature screening, obtain feature M1, input feature M1 into multi-layer perceptron for repeated dimension-by-dimension addition and SE attention mechanism screening, obtain feature M2, perform convolution processing and dimension-by-dimension addition on feature M2, and obtain the final blood glucose feature vector FBG; Step 4, calorie prediction space design: The blood glucose feature vector FBG output in step 3 is removed by a multi-layer perceptron to obtain the blood glucose feature vector A, and the basal metabolic feature FBMR in the module in step 2 is convolved to obtain the basal metabolic feature map B, and the basal metabolic feature map B is weighted with a weight value of α, and matrix multiplied with the blood glucose feature vector A to obtain the feature map C, and the feature map C is convolved and averaged pooled, and the convolution result and the pooling result are added and then convolved to obtain the calorie prediction feature map FQ; Step 5, calorie prediction head design: input the calorie prediction feature map FQ into two consecutive fully connected layers, the dimensions of the fully connected layers are 8 and 3 respectively, and output the final calorie prediction value, that is, the recommended intake of carbohydrates, protein and fat; Step 6, heat prediction network design: the heat prediction network includes a first heat prediction network, a second heat prediction network and a third heat prediction network; The first calorie prediction network predicts the calorie intake of the patient before the first meal of the day, and includes a first blood glucose level encoder, a BMR calculation module, a first calorie prediction space and a first calorie prediction head. The input is the patient's fasting blood glucose monitoring results and individual parameters, and the output is a calorie value X; The second calorie prediction network predicts the calorie intake of the patient before the second meal of the day, and includes a second blood glucose level encoder, a second calorie prediction space, and a second calorie prediction head. The input is the first post-meal blood glucose 1 and the calorie prediction feature map FQ1 in the first calorie prediction network, and the output is the calorie value Y. The third calorie prediction network predicts the calorie intake of the patient before the third meal of the day, and includes a third blood glucose level encoder, a third calorie prediction space, and a third calorie prediction head. The input is the second post-meal blood glucose 2 and the calorie prediction feature map FQ2 in the second calorie prediction network, and the output is the calorie value Z; The first, second, and third blood sugar level encoder network structures are consistent, which are all the blood sugar level encoder structures in step 3; the first, second, and third calorie prediction head network structures are consistent, which are all the calorie prediction head structures in step 4; Step 7, generate a personalized nutritional ratio plan for the patient: input the patient's individual parameters into the BMR calculation module, input the patient's daily fasting blood glucose value into the first blood glucose level encoder, and the three calorie prediction networks can automatically output the proportion of nutrients that the patient should consume for the first meal, second meal, and third meal of the day, that is, breakfast, lunch, and dinner.
3. The method for generating a nutritional ratio plan for diabetic patients based on a calorie prediction network according to claim 2, characterized in that: The patient's own physiological indicators in step 1 include age, gender, height, weight and exercise level.
4. The method for generating a nutritional ratio plan for diabetic patients based on a calorie prediction network according to claim 2, characterized in that: The step 2 is specifically as follows: First, based on the individual parameters of a group of diabetic patients, a 16-dimensional individual parameter vector is formed for each patient; the basal metabolic rate (BMR) of each patient is measured for one week, that is, before breakfast every day, the patient is awake and rests for half an hour, the room temperature is maintained at 18-22°C, and the BMR value of the week is averaged as the BMR value corresponding to the patient; the individual parameter vector and the patient's BMR value are matched to each other, which is the training data set of the BMR calculation module; The design process of the BMR calculation module is as follows: take a patient's individual parameter vector as input, first, input the patient's individual parameter vector B1 into 16 one-dimensional convolution layers with a convolution kernel of 1*3 for feature dimension upgrading, and set the step size to 1, to obtain 16 16-dimensional individual parameter feature vectors; concatenate the 16-dimensional feature vectors to obtain a feature map F with a size of 16*16; use the bottleneck in Resnet as the backbone network basic module, input the feature map F into 4 consecutive bottlenecks for feature extraction, and obtain a feature output with a size of 4*4; simultaneously perform an average pooling operation on the feature map F with a pooling kernel of 2*2, and add the result to the feature output of the previous step to obtain a basal metabolic feature FBMR with a dimension of 4*4, as shown in formula (1); set a single-core two-dimensional convolution layer with a kernel of 4*4, input the basal metabolic feature FBMR into the convolution layer, and obtain the final basal metabolic rate value BMR, as shown in formula (2); in, is the feature output result after bottleneck is input into feature map F, and Averpool(F) is the result after average pooling of feature map F. It is the result obtained after convolution of the basic metabolic feature FBMR; Finally, the BMR calculation module training data set is used to train the parameters of the module. After the model converges, the BMR calculation module is obtained.
5. The method for generating a nutritional ratio plan for diabetic patients based on a calorie prediction network according to claim 2, characterized in that: The step 3 is as follows: First, the patient's blood glucose monitoring level BGL is input into 32 one-dimensional convolution layers with a convolution kernel of 1*3 for feature dimension upgrading, and the step size is set to 1, to obtain 32 32-dimensional blood glucose feature vectors; the above 32 feature vectors are added dimension by dimension to obtain a 1*32-dimensional blood glucose feature vector; and the feature vector is input into the SE attention mechanism for key feature screening to obtain feature M1, as shown in formula (3); Then, feature M1 is input into 32 parallel multi-layer perceptrons MLP, and 32 1*16-dimensional features are output. The features are repeatedly added dimension by dimension and screened by SE attention mechanism to obtain 16-dimensional feature M2, as shown in formula (4); The 16-dimensional feature M2 is subjected to 16 parallel one-dimensional convolutions and dimension-by-dimension addition to obtain the final blood glucose feature vector FBG, which has a size of 1*16 dimensions, as shown in formula (5); Among them, i is the serial number corresponding to the feature map, is the blood glucose feature vector.
6. The method for generating a nutritional ratio plan for diabetic patients based on a calorie prediction network according to claim 2, characterized in that: The step 4 is specifically as follows: Calorie prediction space design: The blood glucose feature vector FBG output in step 3 is used through a multi-layer perceptron to remove the feature aliasing effect of the previous step to obtain a 32-dimensional blood glucose feature vector A, as shown in formula (6); The basic metabolic feature FBMR in the module of step 2 is input into the deconvolution layer with a convolution kernel of 3*3 and a step length of 8 to obtain the basic metabolic feature map B, as shown in formula (7); Then, in the calorie prediction space, the basal metabolic feature map B is weighted with a weight of α and matrix-multiplied with the blood glucose feature vector A to obtain a 32*32-dimensional feature map C, as shown in formula (8); The feature map C is subjected to 64 parallel two-dimensional convolution operations, and the convolution results are added element by element, and then input into a backbone network composed of 8 consecutive bottlenecks for feature extraction and downsampling, so as to obtain a heat prediction feature map with a dimension of 4*4; the feature map C is subjected to average pooling with a kernel of 8, and the pooling result is added to the heat prediction feature map, and a two-dimensional convolution operation with a convolution kernel of 3*3 and a number of 1 is performed, so as to obtain a heat prediction feature map FQ with a final dimension of 4*4, as shown in formula (9); in, is the blood glucose feature vector A, is the basic metabolic characteristic diagram B, is the feature map C, α is the weight, is the heat prediction feature map FQ, i is the serial number corresponding to the feature map; Different α values correspond to the first, second, and third heat prediction spaces, respectively. In the first heat prediction space, α is 1, in the second heat prediction space, α is 0.65, and in the third heat prediction space, α is 0.
75.
7. The method for generating a nutritional ratio plan for diabetic patients based on a calorie prediction network according to claim 2, characterized in that: The step 6 is specifically as follows: Design of the first calorie prediction network: input the patient's fasting blood glucose monitoring results into the first blood glucose level encoder to obtain the first blood glucose feature vector FBG; input the individual parameters into the BMR calculation module to obtain the basic metabolic characteristics FBMR, and in the construction of the calorie prediction network, remove the last step of the BMR calculation module in step 1, and only take the basic metabolic characteristics FBMR as the output; input the first blood glucose feature vector FBG and the basic metabolic characteristics FBMR into the first calorie prediction space at the same time to obtain the calorie prediction feature graph FQ1, and input it into the first calorie prediction head to obtain a set of calorie values X, that is, the amount of carbohydrates, proteins and fat that the patient should consume in the first meal; construct the first calorie prediction training data set based on the first meal calorie intake value recommendations given by experts for a group of patients' fasting blood glucose values and individual parameters; use this data set to train the parameters of the first calorie prediction network until the model converges; Design of the second calorie prediction network: input the patient's first post-meal blood glucose monitoring result, i.e., the first post-meal blood glucose 1, into the second blood glucose level encoder to obtain the second blood glucose feature vector FBG; input the calorie prediction feature graph FQ1 and the second blood glucose feature vector FBG output by the first calorie prediction space into the second calorie prediction space at the same time, and set the α value of the second calorie prediction space to 0.65 to obtain the calorie prediction feature graph FQ2, which is then input into the second calorie prediction head to obtain a set of calorie values Y, i.e., the amount of carbohydrates, protein, and fat that the patient should consume in the second meal; construct a second calorie prediction training data set based on the fasting blood glucose values, the first post-meal blood glucose values, and the second lunch calorie intake values given by experts based on individual parameters of a group of patients; use this data set to train the parameters of the second calorie prediction network until the model converges; Design of the third calorie prediction network: input the patient's second post-meal blood glucose monitoring result, i.e., second post-meal blood glucose 2, into the third blood glucose level encoder to obtain the third blood glucose feature vector FBG; input the calorie prediction feature graph FQ2 and the third blood glucose feature vector FBG output by the second calorie prediction space into the third calorie prediction space at the same time, and set the α value of the third calorie prediction space to 0.75 to obtain the calorie prediction feature graph FQ3, and input it into the third calorie prediction head to obtain a set of calorie values Z, i.e., the amount of carbohydrates, protein and fat that the patient should consume in the third meal; construct a third calorie prediction training data set based on the third meal calorie intake value recommendations given by experts for a group of patients' fasting blood glucose values, first post-meal blood glucose values, second post-meal blood glucose values and individual parameters; use this data set to train the parameters of the third calorie prediction network until the model converges.
8. The method for generating a nutritional ratio plan for diabetic patients based on a calorie prediction network according to claim 2, characterized in that: In step 7, a corresponding calorie prediction network is selected according to the patient's meal frequency to generate a personalized nutrition ratio plan for the patient for the day.