A dietary regimen generation system based on collaborative filtering and factorization machines model

The dietary plan generation system, which uses collaborative filtering and factor decomposition machine models, solves the problem of unscientific traditional postpartum meal planning, and achieves personalized and scientific nutrition management to ensure balanced nutrition for postpartum women.

CN115631831BActive Publication Date: 2026-07-07NANJING MEDLANDER MEDICAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-29
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Traditional postpartum meal preparation methods are cumbersome and unscientific, failing to take into account the individual differences of postpartum women, resulting in unbalanced nutritional intake and affecting the health of postpartum women.

Method used

A dietary plan generation system based on collaborative filtering and factor decomposition machine models is adopted. It collects human body composition data through bioelectrical impedance technology, combines basic information and eating conditions, recommends personalized dietary plans using collaborative filtering and FM algorithms, and adjusts nutrient intake through intelligent plate analysis.

Benefits of technology

It enables the automatic generation of scientific and reasonable dietary plans based on the individual circumstances of postpartum women, dynamically monitors and adjusts nutrient intake, and ensures that postpartum women have a balanced diet.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115631831B_ABST
    Figure CN115631831B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of dietary recommendation, in particular to a dietary plan generation system based on collaborative filtering and factorization machine model, which comprises a body composition collection module, a basic information collection module, a data storage module, a dietary recommendation module, a display module, a meal data collection module and a repair module. The dietary recommendation module can push out corresponding dietary plan according to the basic information and body composition of the user and the actual meal information of the user. The repair module calculates the appropriate nutrition that needs to be supplemented by the user during the next meal through the meal condition and historical data of the user. The present application can automatically generate a recipe that meets the needs of each postpartum mother. The system can also monitor the meal condition of the postpartum mother and feed back the meal data to the next week's diet plan to make a repair to the meal plan of the postpartum mother, thereby ensuring the scientificity of the nutrition intake of the mother.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of dietary recommendation technology, specifically a dietary plan generation system based on collaborative filtering and factor decomposition machine models. Background Technology

[0002] Postpartum meals refer to the meals eaten by new mothers during their postpartum confinement period, encompassing their diet and overall health. Typically, this period lasts one to two months. However, traditional personalized postpartum meals rely on manual preparation, which is cumbersome. Firstly, manual preparation may not consider the mother's overall health condition. Secondly, it may not take into account the different postpartum goals of each mother, resulting in meals that are often unscientific and unbalanced, potentially harming the mother's physical and mental well-being. Furthermore, manually preparing individual meal plans is inefficient, placing a heavy workload on nutritionists when there are many mothers.

[0003] Currently, the method of preparing postpartum meals, if done in a postpartum care center and with a nutritionist, involves the nutritionist creating standardized meal plans based on experience and distributing them to all postpartum mothers. However, due to the large number of postpartum mothers, it's impossible to cater to each mother's different tastes and physical conditions, and there's no way to advise each mother on how much to eat. Most meals are prepared based on the individual postpartum mother's appetite.

[0004] If you are at home, the postpartum meals are prepared based on the cook's own experience or the postpartum mother's preferences. In this case, the nutritional considerations are not scientific enough, and the amount of food eaten depends on the postpartum mother's own appetite. Summary of the Invention

[0005] The purpose of this invention is to provide a dietary plan generation system based on collaborative filtering and factor decomposition machine models to solve the problems mentioned in the background art.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a dietary plan generation system based on collaborative filtering and factor decomposition machine model, the system including a body composition acquisition module, a basic information acquisition module, a data storage module, a dietary recommendation module, a display module, a meal data acquisition module, and a repair module;

[0007] The body composition acquisition module collects human body composition data using bioelectrical impedance analysis (BIA), a technique that measures body water content using electrical methods. The body composition data includes weight, muscle mass, body fat, and visceral fat. This data will serve as input parameters for the diet generation module.

[0008] The basic information collection module acquires the test user's basic information through data entry; this information includes height, age, postpartum time, blood pressure, dietary preferences, and dietary restrictions. These parameters will serve as input parameters for the diet generation module.

[0009] The data storage module is used to store recipe data, user basic information, body composition information, and the user's actual dining situation; the recipe data includes postpartum meal plans for sample users and weekly meal plans for test users.

[0010] The dietary recommendation module will generate corresponding dietary plans based on the test user's basic information, body composition data, and actual meal information.

[0011] The display module shows the menu for the next seven days, the basic information of the test users, and the daily meal schedule of the test users; the display module can be accessed on a PC and a mobile app.

[0012] The meal data collection module collects test users' evaluations of the recipes and their daily meal records.

[0013] The repair module calculates the predicted number of milligrams of nutrients that the test user needs to supplement during the next meal by using the test user's meal situation and the historical data of the sample users.

[0014] The output terminals of the body composition acquisition module and the basic information acquisition module are connected to the input terminal of the data storage module. The output terminal of the data storage module is connected to the input terminal of the diet recommendation module. The output terminal of the diet recommendation module is connected to the input terminal of the display module. The output terminal of the display module is connected to the input terminal of the meal data acquisition module. The output terminal of the meal data acquisition module is connected to the input terminal of the data storage module. The output terminal of the meal data acquisition module is connected to the input terminal of the repair module. The output terminal of the repair module is connected to the input terminal of the data storage module.

[0015] The dietary recommendation module includes a collaborative filtering unit and an FM algorithm unit;

[0016] The collaborative filtering unit performs a first-level recall of dietary plans in the dietary database based on the postpartum diseases of the test users.

[0017] The FM algorithm unit adds feature combinations to the collaborative filtering of dietary plans, and performs a second recall on the dietary plans recalled in the first layer, so as to achieve the purpose of automatic recommendation of dietary plans.

[0018] The steps of the collaborative filtering unit in performing the first-level recall of the dietary plan are as follows:

[0019] S3-1. First, obtain the disease information of the test users and compare it with all historical sample users. The diseases mentioned include gestational diabetes, gestational hypertension, gestational hyperlipidemia, postpartum edema, postpartum anemia, postpartum hair loss, postpartum hemorrhoids, postpartum obesity, etc.

[0020] S3-2, Using the Jaccard formula: Calculate the similarity between the disease status of sample users in historical data and the disease status of test users, and find K users whose disease status is similar to that of test users. The similarity between users and test users cannot be lower than a set value Y. Y is a percentage, K is a constant, A is the disease status of test users, and B is the disease status of sample users in historical data. Y is set to 80%, and K is set to 2000.

[0021] S3-3. Each test user selects N recipes as the result of the first layer of recall, where N is a constant, and N is set to 5.

[0022] The steps of the FM algorithm unit for the second-level recall of the dietary plan are as follows:

[0023] S4-1. Use FM formula: A second-level recall is performed on the dietary plan, setting x i It is the user's characteristic value, x i x j It is the interaction feature between users and dietary plans; where W0 is the bias term, W i For the user's feature value x i The weighting coefficient, W ij The weight coefficients of the interaction features between users and dietary plans, i = 1, 2, 3, ..., n; j = 1, 2, 3, ..., n+1;

[0024] S4-2. Using matrix factorization, set the latent vector of the i-th feature as v. i Then the weight coefficient W of the cross term ij Decomposed into Formula 3 can be obtained through transformation. Where W0 is the bias term, W i For the user's feature value x i The weighting coefficient, W ij The weight coefficients for the interaction features between users and dietary plans, i = 1, 2, 3, ..., n; j = 1, 2, 3, ..., n+1; v i It is the latent vector of the i-th feature. <v i vj > represents the cross-weight coefficients between features i and j; FM learns a one-dimensional vector of size K for each feature, thus, the two features x i and x j The feature combination weight value is obtained through the latent vector v corresponding to the feature. i and v j inner product <v i v j > is used to represent this. The coefficients W0, W1, W2, ... W are calculated. n And vectors v1, v2, ... v n-1 v n This allows the model to calculate the recommendation score for each dietary plan given by the test users; however, the computational complexity of the model at this point is O(kn). 2 The complexity is too high, so we continue to expand the formula to obtain Formula 4:

[0025]

[0026] Expanding the above formula further, the vector dot product expands into a summation form, resulting in Formula 5:

[0027]

[0028] in It is the latent vector v i The One element, It is the latent vector v j The There are elements, where k is the number of elements in the one-dimensional implicit vector. Extracting the common part from the formula yields Formula Six:

[0029]

[0030] i and j are essentially the same, and when expressed as squares, we get Formula 7:

[0031]

[0032] Substituting Formula 7 into Formula 3, we get Formula 8:

[0033]

[0034] Calculate the coefficients W0, W1, W2, ... W of the formula. n And vectors v1, v2, ... v n-1 v n This allows us to calculate the recommended score for each dietary plan from the test users.

[0035] S4-3. Using the computing power of computers, offline training samples are used to obtain the coefficients of each feature value.

[0036] S4-4. Multiply the latent vectors of the user's feature values ​​and the dietary plan's feature values ​​pairwise to obtain the coefficient values ​​of the interaction features between the user and the dietary plan.

[0037] The specific method for obtaining the coefficients of each eigenvalue in S4-3 is as follows:

[0038] S5-1. In a Python environment, add the xlearn library and install xlearn and cmake.

[0039] S5-2. Set feature parameters; the feature parameters are test user ID, test user location, test user production time, test user taste, recipe nutritional attributes, and recipe staple food attributes.

[0040] S5-3. Perform one-hot encoding on the feature parameters. In this training, the above 6 features, 4 user features and 2 dietary plan features were selected. After one-hot encoding, 48 feature parameters will be formed.

[0041] S5-4. Remove samples where all feature values ​​are 0 between the test user and the sample user, and generate the training sample set and the test sample set.

[0042] S5-5. Import the training and test sample sets retrieved in step one as data inputs into offline training and set the model parameters. The model parameters include the learning rate, metric, and latent vector length; here, the latent vector length is set to 3. Begin offline training on the training and test sample sets.

[0043] The dining data acquisition module includes a dining situation acquisition unit and a dining evaluation acquisition unit;

[0044] The dining situation collection unit collects the dining situation of the test user; for example, if the test user has leftover food in their meal, the smart plate will analyze the leftover food to obtain the number of milligrams of nutrients contained in the leftover food.

[0045] The meal evaluation collection unit collects evaluations given by test users after they have eaten the meal.

[0046] The repair module calculates the number of milligrams of nutrients in the uneaten food by the smart plate when the test user did not finish the meal in the first meal. Due to the special nature of postpartum meals, each user consumes postpartum meals for one to two months, resulting in a small amount of user data. It is necessary to combine historical data: the number of milligrams of nutrients that sample users with similar body composition data lacked in the first week, the number of milligrams of nutrients that needed to be supplemented in the following week, and use a predictive model to predict the number of milligrams of nutrients that the test user needs to supplement in the following week.

[0047] Since the number of milligrams of nutrients that test users need to supplement in the second week is predicted based on sample users with similar body composition data, and the sample users are different from the test users, the original predicted values ​​need to be adjusted.

[0048] The specific method for predicting the number of milligrams of nutrients that test users need to supplement is as follows:

[0049] S8-1. Set up a sample user who did not finish their meal. Using a smart meal tray, analyze the uneaten portion of the meal to determine the milligrams of nutrients contained in the food and the additional milligrams of nutrients the user needs to supplement in the following week. in This refers to the number of milligrams of nutrients in the uneaten portion of the meal by the p-th sample user, analyzed by the smart meal plate. p Let μ be the number of milligrams of additional nutrients that the p-th sample user needs to supplement in their diet next week, where p = 1, 2, 3, ..., μ.

[0050] S8-2, Setting the Fitting Curve Let the fitted value Based on the definition conditions of sample points and fitted curves able to obtain in Here, b is the curve coefficient, and b is the error term. These are the predicted values ​​for the curve coefficients. This is the predicted value of the error term. Predicted values ​​of the nutrients that users need to supplement;

[0051] S8-3, Settings Need to obtain b minimizes the value of L, where L is the sum of squared residuals;

[0052] S8-4, Calculation

[0053]

[0054]

[0055]

[0056]

[0057]

[0058] Similarly, we can obtain

[0059]

[0060] S8-5, Fitted Curve

[0061]

[0062] in This refers to the number of milligrams of nutrients in the uneaten portion of the meal by the p-th sample user, analyzed by the smart meal plate. p It represents the number of milligrams of additional nutrients that the p-th sample user needs to supplement in their next meal.

[0063] The specific method for adjusting the predicted number of milligrams of additional nutrients needed for the following week based on the test user's personal body composition data is as follows: Set the adjusted predicted number of milligrams of additional nutrients needed for the following week to H = Mσ. p +Nσ p +g, where M and N are weighting coefficients, and g is the error data; M>N, where M is the efficiency of postpartum mothers in nutrient absorption, and N is the efficiency of postpartum mothers in nutrient metabolism; the number of milligrams of nutrients that the test users need to supplement is stored in the database, and dietary recommendations are made to the test users again through the dietary recommendation module. The error data is the error caused by postpartum mothers eating foods other than postpartum meals after eating.

[0064] Compared with the prior art, the beneficial effects achieved by the present invention are as follows: The present invention designs a complete nutrition management system. First, it can automatically generate a dietary recipe that suits each postpartum mother according to her different physical condition and dietary preferences. The recipe not only includes the types of food, but also the required food weight, so that postpartum mothers know what to eat and how much to eat.

[0065] In addition to providing meal recipes, the system can also monitor the postpartum mother's eating habits at each meal and feed the meal data into the next week's diet plan, making dynamic adjustments to the postpartum mother's meal plan to ensure that the mother's nutritional intake is scientific. Attached Figure Description

[0066] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0067] Fig. 1 This is a schematic diagram of the system structure of a dietary plan generation system based on collaborative filtering and factor decomposition machine models;

[0068] Fig. 2 This is an architecture diagram of a dietary recommendation module in a dietary plan generation system based on collaborative filtering and factor decomposition machine models; Detailed Implementation

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

[0070] Please see Figs. 1-2 The present invention provides a technical solution: a dietary plan generation system based on collaborative filtering and factor decomposition machine model, the system including a body composition acquisition module, a basic information acquisition module, a data storage module, a dietary recommendation module, a display module, a meal data acquisition module and a repair module;

[0071] The body composition acquisition module collects human body composition data using bioelectrical impedance analysis (BIA), a technique that measures body water content using electrical methods. The body composition data includes weight, muscle mass, body fat, and visceral fat. This data will serve as input parameters for the diet generation module.

[0072] The basic information collection module acquires the test user's basic information through data entry; this information includes height, age, postpartum time, blood pressure, dietary preferences, and dietary restrictions. These parameters will serve as input parameters for the diet generation module.

[0073] The data storage module is used to store recipe data, user basic information, body composition information, and the user's actual dining situation; the recipe data includes postpartum meal plans for sample users and weekly meal plans for test users.

[0074] The dietary recommendation module will generate corresponding dietary plans based on the test user's basic information, body composition data, and actual meal information.

[0075] The display module shows the menu for the next seven days, the basic information of the test users, and the daily meal schedule of the test users; the display module can be accessed on a PC and a mobile app.

[0076] The meal data collection module collects test users' evaluations of the recipes and their daily meal records.

[0077] The repair module calculates the predicted number of milligrams of nutrients that the test user needs to supplement during the next meal by using the test user's meal situation and the historical data of the sample users.

[0078] The output terminals of the body composition acquisition module and the basic information acquisition module are connected to the input terminal of the data storage module. The output terminal of the data storage module is connected to the input terminal of the diet recommendation module. The output terminal of the diet recommendation module is connected to the input terminal of the display module. The output terminal of the display module is connected to the input terminal of the meal data acquisition module. The output terminal of the meal data acquisition module is connected to the input terminal of the data storage module. The output terminal of the meal data acquisition module is connected to the input terminal of the repair module. The output terminal of the repair module is connected to the input terminal of the data storage module.

[0079] The dietary recommendation module includes a collaborative filtering unit and an FM algorithm unit;

[0080] The collaborative filtering unit performs a first-level recall of dietary plans in the dietary database based on the postpartum diseases of the test users.

[0081] The FM algorithm unit adds feature combinations to the collaborative filtering of dietary plans, and performs a second recall on the dietary plans recalled in the first layer, so as to achieve the purpose of automatic recommendation of dietary plans.

[0082] The steps of the collaborative filtering unit in performing the first-level recall of the dietary plan are as follows:

[0083] S3-1. First, obtain the disease information of the test users and compare it with all historical sample users. The diseases mentioned include gestational diabetes, gestational hypertension, gestational hyperlipidemia, postpartum edema, postpartum anemia, postpartum hair loss, postpartum hemorrhoids, postpartum obesity, etc.

[0084] S3-2, Using the Jaccard formula: Calculate the similarity between the disease status of sample users in historical data and the disease status of test users, and find K users whose disease status is similar to that of test users. The similarity between users and test users cannot be lower than a set value Y. Y is a percentage, K is a constant, A is the disease status of test users, and B is the disease status of sample users in historical data. Y is set to 80%, and K is set to 2000.

[0085] S3-3. Each test user selects N recipes as the result of the first layer of recall, where N is a constant, and N is set to 5.

[0086] The steps of the FM algorithm unit for the second-level recall of the dietary plan are as follows:

[0087] S4-1. Use FM formula: A second-level recall is performed on the dietary plan, setting x i It is the user's characteristic value, x i x j It is the interaction feature between users and dietary plans; where W0 is the bias term, W i For the user's feature value x i The weighting coefficient, W ij The weight coefficients of the interaction features between users and dietary plans, i = 1, 2, 3, ..., n; j = 1, 2, 3, ..., n+1;

[0088] S4-2. Using matrix factorization, set the latent vector of the i-th feature as v. i Then the weight coefficient W of the cross term ij Decomposed into Formula 3 can be obtained through transformation. Where W0 is the bias term, W i For the user's feature value x i The weighting coefficient, W ij The weight coefficients for the interaction features between users and dietary plans, i = 1, 2, 3, ..., n; j = 1, 2, 3, ..., n+1; v i It is the latent vector of the i-th feature. <v i v j > represents the cross-weight coefficients between features i and j; FM learns a one-dimensional vector of size K for each feature, thus, the two features x i and x j The feature combination weight value is obtained through the latent vector v corresponding to the feature. i and v j inner product <v i v j > is used to represent this. The coefficients W0, W1, W2, ... W are calculated. nAnd vectors v1, v2, ... v n-1 v n This allows the model to calculate the recommendation score for each dietary plan given by the test users; however, the computational complexity of the model at this point is O(kn). 2 The complexity is too high, so we continue to expand the formula to obtain Formula 4:

[0089]

[0090] Expanding the above formula further, the vector dot product expands into a summation form, resulting in Formula 5:

[0091]

[0092] in It is the latent vector v i The One element, It is the latent vector v j The There are elements, where k is the number of elements in the one-dimensional implicit vector. Extracting the common part from the formula yields Formula Six:

[0093]

[0094] i and j are essentially the same, and when expressed as squares, we get Formula 7:

[0095]

[0096] Substituting Formula 7 into Formula 3, we get Formula 8:

[0097]

[0098] Calculate the coefficients W0, W1, W2, ... W of the formula. n And vectors v1, v2, ... v n-1 v n This allows us to calculate the recommended score for each dietary plan from the test users.

[0099] S4-3. Using the computing power of computers, offline training samples are used to obtain the coefficients of each feature value.

[0100] S4-4. Multiply the latent vectors of the user's feature values ​​and the dietary plan's feature values ​​pairwise to obtain the coefficient values ​​of the interaction features between the user and the dietary plan.

[0101] The specific method for obtaining the coefficients of each eigenvalue in S4-3 is as follows:

[0102] S5-1. In a Python environment, add the xlearn library and install xlearn and cmake.

[0103] S5-2. Set feature parameters; the feature parameters are test user ID, test user location, test user production time, test user taste, recipe nutritional attributes, and recipe staple food attributes.

[0104] S5-3. Perform one-hot encoding on the feature parameters. In this training, the above 6 features, 4 user features and 2 dietary plan features were selected. After one-hot encoding, 48 feature parameters will be formed.

[0105] S5-4. Remove samples where all feature values ​​are 0 between the test user and the sample user, and generate the training sample set and the test sample set.

[0106] S5-5. Import the training and test sample sets retrieved in step one as data inputs into offline training and set the model parameters. The model parameters include the learning rate, metric, and latent vector length; here, the latent vector length is set to 3. Begin offline training on the training and test sample sets.

[0107] The dining data acquisition module includes a dining situation acquisition unit and a dining evaluation acquisition unit;

[0108] The dining situation collection unit collects the dining situation of the test user; for example, if the test user has leftover food in their meal, the smart plate will analyze the leftover food to obtain the number of milligrams of nutrients contained in the leftover food.

[0109] The meal evaluation collection unit collects evaluations given by test users after they have eaten the meal.

[0110] The repair module calculates the number of milligrams of nutrients in the uneaten food by the smart plate when the test user did not finish the meal in the first meal. Due to the special nature of postpartum meals, each user consumes postpartum meals for one to two months, resulting in a small amount of user data. It is necessary to combine historical data: the number of milligrams of nutrients that sample users with similar body composition data lacked in the first week, the number of milligrams of nutrients that needed to be supplemented in the following week, and use a predictive model to predict the number of milligrams of nutrients that the test user needs to supplement in the following week.

[0111] Since the number of milligrams of nutrients that test users need to supplement in the second week is predicted based on sample users with similar body composition data, and the sample users are different from the test users, the original predicted values ​​need to be adjusted.

[0112] The specific method for predicting the number of milligrams of nutrients that test users need to supplement is as follows:

[0113] S8-1. Set up a sample user who did not finish their meal. Using a smart meal tray, analyze the uneaten portion of the meal to determine the milligrams of nutrients contained in the food and the additional milligrams of nutrients the user needs to supplement in the following week. in This refers to the number of milligrams of nutrients in the uneaten portion of the meal by the p-th sample user, analyzed by the smart meal plate. p Let μ be the number of milligrams of additional nutrients that the p-th sample user needs to supplement in their diet next week, where p = 1, 2, 3, ..., μ.

[0114] S8-2, Setting the Fitting Curve Let the fitted value Based on the definition conditions of sample points and fitted curves able to obtain in Here, b is the curve coefficient, and b is the error term. These are the predicted values ​​for the curve coefficients. This is the predicted value of the error term. Predicted values ​​of the nutrients that users need to supplement;

[0115] S8-3, Settings Need to obtain b minimizes the value of L, where L is the sum of squared residuals;

[0116] S8-4, Calculation

[0117]

[0118]

[0119]

[0120]

[0121]

[0122] Similarly, we can obtain

[0123]

[0124] S8-5, Fitted Curve

[0125]

[0126] in This refers to the number of milligrams of nutrients in the uneaten portion of the meal by the p-th sample user, analyzed by the smart meal plate. p It represents the number of milligrams of additional nutrients that the p-th sample user needs to supplement in their next meal.

[0127] The specific method for adjusting the predicted number of milligrams of additional nutrients needed for the following week based on the test user's personal body composition data is as follows: Set the adjusted predicted number of milligrams of additional nutrients needed for the following week to H = Mσ. p +Nσ p +g, where M and N are weighting coefficients, and g is the error data; M>N, where M is the efficiency of postpartum mothers in nutrient absorption, and N is the efficiency of postpartum mothers in nutrient metabolism; the number of milligrams of nutrients that the test users need to supplement is stored in the database, and dietary recommendations are made to the test users again through the dietary recommendation module. The error data is the error caused by postpartum mothers eating foods other than postpartum meals after eating.

[0128] In this implementation case:

[0129] Five sample users were selected, and the smart meal tray was used to analyze the uneaten food to determine the milligrams of nutrients contained in the uneaten food and the milligrams of nutrients that the users needed to supplement in the following week. The sample data were (15,10), (12,8), (11,10), (16,15), and (14,9); unit: milligrams.

[0130] According to the formula Substituting the sample data yields:

[0131] If the user did not finish the meal during the test, the smart plate analysis showed that the uneaten meal contained 17 milligrams of nutrients. Therefore, the user needs to supplement 13.318 milligrams of nutrients in the following week.

[0132] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0133] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A dietary plan generation system based on collaborative filtering and factor decomposition machine models, characterized in that: The system includes a body composition acquisition module, a basic information acquisition module, a data storage module, a dietary recommendation module, a display module, a meal data acquisition module, and a repair module; The body composition acquisition module collects human body composition data using bioelectrical impedance analysis (BIA) technology. The basic information collection module obtains the basic information of the test user through information input. The data storage module is used to store recipe data, user basic information, body composition information, and the user's actual dining situation; the recipe data includes postpartum meal plans for sample users and weekly meal plans for test users. The dietary recommendation module will generate corresponding dietary plans based on the test user's basic information, body composition data, and actual meal information. The display module shows the menu for the next seven days, the basic information of the test users, and the daily meal situation of the test users. The meal data collection module collects test users' evaluations of the recipes and their daily meal records. The repair module calculates the predicted number of milligrams of nutrients that the test user needs to supplement during the next meal by using the test user's meal situation and the historical data of the sample users. The output terminals of the body composition acquisition module and the basic information acquisition module are connected to the input terminal of the data storage module. The output terminal of the data storage module is connected to the input terminal of the diet recommendation module. The output terminal of the diet recommendation module is connected to the input terminal of the display module. The output terminal of the display module is connected to the input terminal of the meal data acquisition module. The output terminal of the display module is connected to the input terminal of the data storage module. The output terminal of the meal data acquisition module is connected to the input terminal of the data storage module. The output terminal of the meal data acquisition module is connected to the input terminal of the repair module. The output terminal of the repair module is connected to the input terminal of the data storage module. The dietary recommendation module includes a collaborative filtering unit and an FM algorithm unit; The collaborative filtering unit performs a first-level recall of dietary plans in the dietary database based on the postpartum diseases of the test users. The FM algorithm unit adds feature combinations to the collaborative filtering of dietary plans, and performs a second recall on the dietary plans recalled in the first layer, so as to achieve the purpose of automatic recommendation of dietary plans. The steps of the collaborative filtering unit in performing the first-level recall of the dietary plan are as follows: S3-1. First, obtain the disease information of the test users and compare it with all historical sample users. S3-2, Using the Jaccard formula: The similarity between the disease status of sample users in historical data and the disease status of test users is calculated, and K users are found whose disease status is similar to that of the test users. The similarity between these K users and the test users cannot be lower than a set value Y; where Y is a percentage and K is a constant. It is to test the user's disease condition, the stated It refers to the disease status of sample users in historical data; S3-3, Each test user selects N recipes as the result of the first-level recall, where N is a constant; The steps of the FM algorithm unit for the second-level recall of the dietary plan are as follows: S4-1. Use FM formula: A second-level recall of the dietary plan was conducted, setting up... These are the user's characteristic values. It is a feature that combines the user and the dietary plan; in It is a bias term. For user feature values The weighting coefficients, The weighting coefficients for the feature terms of the interaction between users and dietary plans. 1, 2, 3, ..., ... ; ; S4-2. Using matrix decomposition, set the first... The latent vector of the dimensional feature is Then the weight coefficient of the cross term Decomposed into Through transformation, we can obtain ,in It is a bias term. For user feature values The weighting coefficients, The weighting coefficients for the feature terms of the interaction between users and dietary plans. 1, 2, 3, ..., ... ; ; It is the first Latent vectors of dimensional features It is a feature and characteristics Cross-weight coefficients; Calculate the formula coefficients sum vector This allows us to calculate the recommendation score for each dietary plan given by the test users. S4-3. Using the computing power of computers, offline training samples are used to obtain the coefficients of each feature value. S4-4. Multiply the latent vectors of the user's feature values ​​and the feature values ​​of the diet plan pairwise to obtain the coefficient values ​​of the interaction features between the user and the diet plan. The repair module calculates the number of milligrams of nutrients in the uneaten food by the smart plate when the test user did not finish the meal in the first meal. Due to the special nature of postpartum meals, each user consumes postpartum meals for one to two months, resulting in a small amount of user data. It is necessary to combine historical data: the number of milligrams of nutrients that sample users with similar body composition data lacked in the first week, the number of milligrams of nutrients that needed to be supplemented in the following week, and use a predictive model to predict the number of milligrams of nutrients that the test user needs to supplement in the following week. Since the number of milligrams of nutrients that test users need to supplement in the second week is predicted based on sample users with similar body composition data, and the sample users are different from the test users, the original predicted values ​​need to be adjusted.

2. The dietary plan generation system based on collaborative filtering and factor decomposition machine model according to claim 1, characterized in that: The specific method for obtaining the coefficients of each eigenvalue in S4-3 is as follows: S5-1. In a Python environment, add the xlearn library and install xlearn and cmake. S5-2. Set feature parameters; the feature parameters are test user ID, test user location, test user production time, test user taste, recipe nutritional attributes, and recipe staple food attributes. S5-3. Perform one-hot encoding on the feature parameters; S5-4. Remove samples where all feature values ​​are 0 between the test user and the sample user, and generate the training sample set and the test sample set. S5-5. Import the training and test sample sets retrieved in the first step as data inputs into the offline training and set the model parameters; start offline training on the training and test sample sets.

3. The dietary plan generation system based on collaborative filtering and factor decomposition machine model according to claim 1, characterized in that: The dining data acquisition module includes a dining situation acquisition unit and a dining evaluation acquisition unit; The dining situation collection unit is used to collect the dining situation of test users; The meal evaluation collection unit collects evaluations given by test users after they have eaten the meal.

4. The dietary plan generation system based on collaborative filtering and factor decomposition machine model according to claim 1, characterized in that: The specific method for predicting the number of milligrams of nutrients that test users need to supplement is as follows: S8-1. Set up a sample user who did not finish their meal. Using a smart meal tray, analyze the uneaten portion of the meal to determine the milligrams of nutrients contained in the uneaten portion and the additional milligrams of nutrients the user needs to supplement in their diet the following week. ,in It is the first The smart meal plate analyzed the number of milligrams of nutrients in the uneaten portion of a sample user's meal. It is the first The number of milligrams of additional nutrients that a sample of users needs to supplement in their diet for the following week. ; S8-2, Setting the Fitting Curve Let the fitted value According to the definition conditions of sample points and fitted curves able to obtain ,in For curve coefficients, It is an error term. These are the predicted values ​​for the curve coefficients. This is the predicted value of the error term. Predicted values ​​of the nutrients that users need to supplement; S8-3, Settings , needs to be obtained and Make The value is the smallest, among which It is the sum of squared residuals; S8-4. Obtain the fitted curve through calculation. ; in It is the first The smart meal plate analyzed the number of milligrams of nutrients in the uneaten portion of a sample user's meal. It is the first The number of milligrams of nutrients that each sample user needs to supplement in their next meal.

5. The dietary plan generation system based on collaborative filtering and factor decomposition machine model according to claim 4, characterized in that: The specific method for adjusting the predicted number of milligrams of additional nutrients needed for the following week based on the test user's personal body composition data is as follows: Set the predicted number of milligrams of additional nutrients needed for the following week to be adjusted by the test user. ,in and These are the weighting coefficients. This is error data; the number of milligrams of additional nutrients that the test users need to supplement is stored in the database, and dietary recommendations are then made to the test users again through the dietary recommendation module.

Citation Information

Patent Citations

  • Resident diet balance quantification analysis method based on intelligent information processing terminal, and system thereof

    CN104866954A

  • Method for context-aware recommendations based on implicit user feedback

    US20140180760A1