A nutrition plan recommendation method and system based on data fusion and knowledge graph
By combining multidimensional data fusion and knowledge graph technology with graph neural networks and reinforcement learning models, the problem that existing nutrition recommendation systems cannot meet personalized needs has been solved, and accurate and personalized nutrition plan recommendations have been achieved.
Patent Information
- Application Number
- CN202411129181.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-08-16
AI Technical Summary
Existing nutrition recommendation systems rely on a single data source, which fails to fully reflect users' health status and personalized needs, resulting in inaccurate recommendation results.
By acquiring multidimensional user data, data fusion and knowledge graph technologies are used to embed user data into a nutrition knowledge graph. Graph neural networks are used to process user-related nodes and edges, and reinforcement learning models are combined to optimize nutrition plans, taking into account nutritional needs and health indicators.
It enables precise and personalized nutrition recommendations, which can comprehensively reflect the user's health status and dynamic needs, thus improving the accuracy and personalization of the recommendations.
Smart Images

Figure CN118645214B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of smart medical systems, and in particular to a method and system for recommending nutrition plans based on data fusion and knowledge graphs. Background Art
[0002] As people's demand for a healthy lifestyle continues to increase, the research on personalized nutrition plan recommendation methods has gradually become a hot topic. Existing technologies have deficiencies in data processing and recommendation accuracy, making it difficult to fully reflect individual differences and nutritional needs.
[0003] The personalized nutrition recommendation systems currently on the market mainly rely on a single data source, such as the user's basic health data (age, gender, height, weight, BMI, etc.) for recommendations. However, relying solely on a single data source cannot fully reflect the user's health status and personalized needs. For example, information such as the user's eating habits and exercise status is also crucial to the formulation of a nutrition plan, but this information is often ignored in a single data source recommendation system, resulting in inaccurate recommendation results and difficulty in meeting the user's personalized needs.
[0004] In response to the above problems, the industry has not yet proposed a better technical solution. Summary of the invention
[0005] The embodiments of the present invention provide a method and system for recommending a nutrition plan based on data fusion and knowledge graph, which is used to at least solve the problem that the nutrition recommendation system in the current related technology cannot meet the personalized needs of users.
[0006] In a first aspect, an embodiment of the present invention provides a method for recommending a nutrition plan based on data fusion and knowledge graph, the method comprising:
[0007] Acquire multi-dimensional user data, wherein the multi-dimensional user data includes basic health data, health goal data, diet record data, exercise data, and health status data;
[0008] Embedding the multidimensional user data into a preset nutrition knowledge graph to extract user-related nodes and user-related edges from the nutrition knowledge graph;
[0009] Processing each of the user-related nodes and each of the user-related edges based on a graph neural network to determine corresponding user nutritional demand characteristics;
[0010] Based on the nutrition knowledge graph, determining at least one candidate nutrition plan that matches the nutrition requirement characteristics of the user;
[0011] The user's nutritional requirement characteristics and each of the candidate nutritional plans are input into a nutritional plan optimization model to determine a target nutritional plan to be recommended; the nutritional plan optimization model adopts a reinforcement learning model, the state of the reinforcement learning model is defined by the user's nutritional requirement characteristics, the action of the reinforcement learning model is defined by the candidate nutritional plans, and the reward function of the reinforcement learning model is defined according to the nutritional requirement satisfaction and the health indicator improvement.
[0012] In a second aspect, an embodiment of the present invention provides a nutrition plan recommendation system based on data fusion and knowledge graph, the system comprising:
[0013] A multi-dimensional data acquisition unit, used to acquire multi-dimensional user data, wherein the multi-dimensional user data includes basic health data, health goal data, diet record data, exercise data and health status data;
[0014] A graph feature extraction unit, used for embedding the multi-dimensional user data into a preset nutrition knowledge graph to extract user-related nodes and user-related edges from the nutrition knowledge graph;
[0015] A demand feature determination unit, configured to process each of the user-related nodes and each of the user-related edges based on a graph neural network to determine a corresponding user nutritional demand feature;
[0016] A candidate solution determining unit, configured to determine at least one candidate nutrition solution matching the nutrition requirement characteristics of the user based on the nutrition knowledge graph;
[0017] The target plan determination unit is used to input the user's nutritional demand characteristics and each of the candidate nutritional plans into a nutritional plan optimization model to determine the target nutritional plan to be recommended; the nutritional plan optimization model adopts a reinforcement learning model, the state of the reinforcement learning model is defined by the user's nutritional demand characteristics, the action of the reinforcement learning model is defined by the candidate nutritional plans, and the reward function of the reinforcement learning model is defined according to the nutritional demand satisfaction and the health indicator improvement.
[0018] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the above method.
[0019] In a fourth aspect, an embodiment of the present invention provides a storage medium, in which one or more programs including execution instructions are stored. The execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to execute the steps of the above-mentioned method of the present invention.
[0020] In a fifth aspect, an embodiment of the present invention further provides a computer program product, wherein the computer program product comprises a computer program stored on a storage medium, wherein the computer program comprises program instructions, and when the program instructions are executed by a computer, the computer executes the steps of the above method.
[0021] The method, system, electronic device and non-transitory computer-readable storage medium for recommending a nutrition plan based on data fusion and knowledge graph provided by the present invention can produce at least the following technical effects:
[0022] (1) By integrating multi-dimensional user data, including basic health data, health goal data, diet record data, exercise data, and health status data, the system can fully understand the user's health status, living habits, and health goals. By introducing multi-dimensional data, it ensures that the recommendation results can accurately reflect the user's personalized needs.
[0023] (2) By using the preset nutritional knowledge graph and embedding multi-dimensional user data into it, users’ nutritional needs can be effectively represented and inferred. By processing these nodes and edges through the graph neural network, the system can capture the deep relationship between users and nutrients, thereby accurately determining the nutritional needs of users, greatly improving the accuracy and personalization of recommendations.
[0024] (3) Based on the determined user nutritional demand characteristics, the reinforcement learning model is used to optimize the candidate nutritional plans. The reinforcement learning model defines the state (user nutritional demand characteristics), action (candidate nutritional plan) and reward function (nutritional demand satisfaction and health indicator improvement) to achieve accurate screening, analysis and recommendation of the target nutritional plan, so that the target nutritional plan can balance and optimize nutritional needs and health indicators.
[0025] Through this technical solution, the user's multi-dimensional data is fully integrated, and accurate nutritional demand feature extraction is achieved using knowledge graphs and graph neural networks. The recommendation results are dynamically optimized through reinforcement learning models, so that nutritional plans that meet their own health conditions and needs can be obtained, making the recommended nutritional plans more personalized and accurate, prompting users to more actively practice a healthy lifestyle. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 A flowchart of an example of a method for recommending a nutrition plan based on data fusion and knowledge graph according to an embodiment of the present invention is shown;
[0028] Figure 2 A schematic diagram showing an example of a state transition action in a reinforcement learning model;
[0029] Figure 3 Shows Figure 1 An exemplary operation flow chart of step S110 in FIG.
[0030] Figure 4 A schematic diagram showing a structural connection of an example of a graph neural network according to an embodiment of the present invention is shown;
[0031] Figure 5 Shown according to Figure 1 An exemplary operation flow chart of step S140 in FIG.
[0032] Figure 6 An operation flow chart showing an example of performing online learning optimization on a nutrition program optimization model according to an embodiment of the present invention;
[0033] Figure 7 A structural block diagram of an example of a nutrition plan recommendation system based on data fusion and knowledge graph according to an embodiment of the present invention is shown;
[0034] Figure 8 It is a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0036] Unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one", "one" or "the" do not indicate a quantitative limitation, but indicate the existence of at least one. Words such as "include" or "comprise" mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Words such as "connect" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0037] It should be noted that the terms "up", "down", "left", "right", "front", "back", etc. used in the present invention are only used to indicate relative position relationships. When the absolute position of the object being described changes, the relative position relationship may also change accordingly.
[0038] Figure 1 A flowchart of an example of a method for recommending a nutrition plan based on data fusion and knowledge graph according to an embodiment of the present invention is shown.
[0039] Regarding the executor of the method of the embodiment of the present invention, it can be any controller or processor with computing or processing capabilities, which can be integrated or partially integrated in a server or nutrition recommendation platform, so as to significantly improve the accuracy and effectiveness of personalized nutrition plan recommendations through the comprehensive application of data fusion, knowledge graph and reinforcement learning model, and can fully reflect the individual differences and dynamic needs of users, and provide accurate, personalized and long-term effective nutrition guidance.
[0040] In some examples, it can be integrated into the configuration server by software, hardware, or a combination of software and hardware, which should not be limited here. It should be understood that one or more steps involved in the following process can be implemented by one or more controllers or software installed and deployed in the client or server.
[0041] like Figure 1 As shown, in step S110, multi-dimensional user data is obtained, and the multi-dimensional user data includes basic health data, health goal data, diet record data, exercise data and health status data.
[0042] Here, the basic health data includes at least one of the following: age, gender, height, weight and BMI. Through the basic health data, the user's health profile can be effectively constructed. The health goal data includes at least one of the following: weight management goals, nutritional intake goals, health index goals and disease management goals. The diet record data includes at least one of the following: dietary preference information, dietary restriction information, daily food intake types and daily food intake quantities. Through the diet record data, detailed information on the user's eating habits and intake is provided. The exercise data includes at least one of the following: daily exercise volume, exercise type and weekly exercise frequency. Through the exercise data, the user's daily activity information is provided to help balance energy intake and consumption. The health status data includes at least one of the following: user physical examination information, previous medical history, family medical history and drug use information. The health history and current health status of the user are reflected through the health status data. The user's physical examination information includes at least one of the following: blood biochemical index data, genetic test data and medical diagnosis data.
[0043] More specifically, the collection method of multi-dimensional user data can be diverse, such as through user input interface, health data import interface, user questionnaire report, electronic health record or smart wearable device data synchronization. In addition, for the collection of genetic testing data, it can be obtained by individual users purchasing genetic testing services, or by individuals uploading genetic testing results obtained from third-party testing institutions. For the collection of blood biochemical index data, it can be obtained by individual users purchasing physical examination services or by individuals uploading physical examination results obtained from third-party testing institutions. For the collection of medical diagnosis data, it can be obtained by individual users uploading the test and diagnosis results obtained from third-party medical institutions.
[0044] For the specific data parameter types in the weight management goal, it can be a target weight, a weight loss goal or a weight gain goal. The target weight defines the weight that the user expects to achieve, the weight loss goal defines the weight that the user expects to lose within a specific time, and the weight gain goal defines the weight that the user expects to gain within a specific time. For the specific data parameter types in the nutrition intake goal, it can be a daily calorie intake and macronutrient goal. The daily calorie intake defines the total calories (calories) that the user expects to consume daily, and the macronutrient goal defines the daily intake goals of protein, fat and carbohydrates. For the specific data parameter types in the health indicator goal, it can be health indicator goal information such as blood pressure goal, blood sugar goal and cholesterol goal. The blood pressure goal defines the blood pressure level that the user expects to achieve, the blood sugar goal defines the fasting blood sugar and postprandial blood sugar levels that the user expects to achieve, and the cholesterol goal defines the total cholesterol, low-density lipoprotein (LDL) and high-density lipoprotein (HDL) levels that the user expects to achieve. The specific data parameter types in the disease management goals define the disease conditions that users expect to improve through nutrition and exercise, such as improvements to diabetes, high blood pressure or heart disease. Therefore, through the above diverse health goal data, the system can more comprehensively understand the needs and expectations of users, thereby providing more accurate and personalized health recommendations.
[0045] In some examples of embodiments of the present invention, the blood biochemical index data includes at least one of the following: blood lipids, blood sugar, blood uric acid and blood mineral concentration. The gene detection data includes the test results for the genes related to the metabolism of dietary ingredients and / or the genes related to the behavior of diet and lifestyle. The genes related to the metabolism of dietary ingredients include at least one of the following: carbohydrate metabolism related genes, fatty acid metabolism related genes, vitamin metabolism related genes, mineral metabolism related genes, alcohol metabolism related genes and caffeine metabolism related genes. The genes related to the behavior of diet and lifestyle include at least one of the following: appetite level related genes, food sensitivity related genes, food tolerance related genes, obesity risk related genes and sleep related genes. The medical diagnosis data includes at least one of the following chronic diseases related to the diet and lifestyle: hypertension, hyperlipidemia, hyperuricemia, diabetes, cardiovascular disease, fatty liver, kidney stones and osteoporosis.
[0046] Through this embodiment, multi-dimensional user data is fully collected, and the system can understand the user's health status and personalized needs more comprehensively and accurately, provide data support for subsequent nutritional plan recommendations, and improve user satisfaction and trust.
[0047] In step S120, the multi-dimensional user data is embedded into a preset nutrition knowledge graph to extract user-related nodes and user-related edges from the nutrition knowledge graph.
[0048] Here, the nutrition knowledge graph contains multiple nodes and edges; the node types of each node include: food node, nutrient component node, health status node, physiological characteristic node, eating habit node and exercise type node; the edge types of each edge include: inclusion relationship, contribution relationship, increased risk relationship, suitability relationship and avoidance relationship.
[0049] In some embodiments, the acquired multidimensional user data is cleaned, standardized, and formatted to ensure the quality and consistency of the data, and a specific algorithm (such as an embedding algorithm or a feature engineering method) is used to convert the user's multidimensional data into nodes and edges in the graph. For example, basic information such as the user's age and gender can be mapped to a physiological feature node; dietary records can be mapped to a dietary habit node. Furthermore, the user's multidimensional data can also be embedded in a nutritional knowledge graph to form a subgraph containing user-related information.
[0050] Through this embodiment, by utilizing the structured information of the knowledge graph, the user's multidimensional health data and their interrelationships can be better represented and understood, thereby improving the correlation between the user data and the knowledge graph. By embedding the user data into the nutrition knowledge graph, the nutrition knowledge of various aspects related to the user's health can be intuitively displayed.
[0051] In step S130, each user-related node and each user-related edge are processed based on the graph neural network to determine the corresponding user nutritional demand characteristics.
[0052] In some embodiments, the graph neural network model can be trained by using a large amount of pre-collected user data and nutritional knowledge graphs to learn the representation of nodes and edges and their relationships. Furthermore, the user-associated nodes and edges are input into the trained graph neural network, which comprehensively considers the user's basic health data, eating habits, exercise conditions, health status and other multi-dimensional information, and extracts the user's nutritional needs characteristics by aggregating, updating and transmitting features. Therefore, through the graph neural network model, the complex associations of users in the nutritional map can be effectively captured and understood, thereby accurately extracting the user's nutritional needs characteristics.
[0053] Through this embodiment, multi-dimensional user data and knowledge graphs are integrated to achieve a comprehensive and accurate user health portrait construction. It can comprehensively consider various aspects of user data, use graph neural networks to process knowledge graphs, capture complex nutritional relationships and associations between user characteristics, and improve recommendation accuracy.
[0054] Therefore, by using the preset nutrition knowledge graph, multi-dimensional user data is embedded in it. Due to the food nodes, nutrient nodes, health status nodes, physiological characteristics nodes, eating habits nodes and exercise type nodes contained in the knowledge graph, as well as the complex relationships between the nodes (such as inclusion relationships, helpful relationships, increased risk relationships, etc.), the user's nutritional needs can be effectively represented and inferred. By processing these nodes and edges through the graph neural network, the system can capture the deep relationship between users and nutrients, thereby accurately determining the user's nutritional needs characteristics, greatly improving the accuracy and personalization of recommendations.
[0055] In step S140, at least one candidate nutrition plan that matches the user's nutritional requirement characteristics is determined based on the nutrition knowledge graph.
[0056] In some embodiments, various matching algorithms based on knowledge graphs can be used to match the user's nutritional requirements with the nutritional solutions in the knowledge graph to determine preliminary candidate nutritional solutions. Thus, by utilizing the rich information in the knowledge graph, more personalized and scientific candidate nutritional solutions can be generated.
[0057] In step S150, the user's nutritional requirement characteristics and each candidate nutritional plan are input into a nutritional plan optimization model to determine a target nutritional plan to be recommended.
[0058] In some examples of the embodiments of the present invention, the nutrition plan optimization model adopts a reinforcement learning model. By designing an optimization model that includes the user's nutritional demand characteristics and candidate nutrition plans, the reinforcement learning method is used for optimization, so that the reinforcement learning model is trained by simulating user feedback and nutritional effects, so that it can continuously optimize the nutrition plan and recommend the optimal nutrition plan.
[0059] Figure 2 A schematic diagram showing an example of state transition actions in a reinforcement learning model.
[0060] like Figure 2 As shown, it involves actions corresponding to state transitions in the state space of multiple states S1~Sn, for example, a1 represents the action of state transition from S1 to S2, a2 represents the action from S2 to S1, a3 represents the state transition from S1 to S3, and so on. Here, the corresponding state transition can occur based on the strategy, and each state transition strategy can be used to occur different transitions. For example, based on the transition strategy for state S1, action a2 or a3 can occur.
[0061] It should be noted that the range of states that a state can transfer to (also called transferable states) may be limited or conditional. For example, none of S1 to S3 will transfer to S4 to Sn, while the states that state S1 can transfer to are S2 and S3, and so on.
[0062] In some embodiments, each action has a corresponding action reward, and each action reward can be determined based on a preset reward function. Generally, if the transfer reward is larger, it can be considered that the transferred action is more valuable, and the system will give priority to executing this action. For example, if the reward corresponding to action a1 is greater than the reward corresponding to a3, it means that the transferred action a1 is more valuable.
[0063] In some examples of embodiments of the present invention, the state of the nutrition plan optimization model is defined by the user's nutritional demand characteristics, the action of the nutrition plan optimization model is defined by the candidate nutrition plans, and the reward function of the nutrition plan optimization model is defined based on the satisfaction of nutritional needs and the improvement of health indicators.
[0064] Through the embodiment of the present invention, an optimization model including the user's nutritional demand characteristics and candidate nutritional solutions is designed, and the optimization is performed using a reinforcement learning method. By simulating user feedback and nutritional effects, the reinforcement learning model is trained so that it can continuously optimize the recommended nutritional solutions. Thus, by introducing the reinforcement learning model, the nutritional solution recommendation process has adaptive and dynamic optimization capabilities, comprehensively considering the satisfaction of nutritional needs and the improvement of health indicators, and can effectively improve the health of users.
[0065] More specifically, the reward function of the reinforcement learning model is It is expressed by the following formula:
[0066] , formula (1)
[0067] , formula (2)
[0068] , formula (3)
[0069] In the formula, and They represent the satisfaction of nutritional needs and the improvement of health indicators respectively. and Respectively represent the corresponding reward item weight parameters; Nutritional information The intake of Indicates user's nutritional information The demand, n represents the total number of types of nutrients required by users; Indicates health indicators changes, Is a health indicator The weight of m represents the number of types of health indicators.
[0070] Through this embodiment, a reward function based on the satisfaction of nutritional needs and the improvement of health indicators can be used to generate a personalized nutrition plan, ensuring that the recommended nutrition plan can meet the specific nutritional needs of the user to the greatest extent possible, ensuring that the various nutrients consumed by the user are in line with their health status and needs, and can help the user improve their health status according to the user's health indicators, such as controlling blood sugar, lowering blood pressure, regulating cholesterol levels, and managing weight. In addition, the reinforcement learning model can be optimized through various types of training methods, learn from historical data, and optimize on this basis, so that the model can adapt to users of different ages, genders, health conditions, and eating habits, and provide customized nutrition plans.
[0071] Figure 3 Shows Figure 1 An example operation flow chart of step S110 in FIG.
[0072] like Figure 3 As shown, in step S310, original user data is collected from the user terminal device, missing values in the original data matrix corresponding to the collected original user data are detected, and the corresponding positions of the missing values are recorded.
[0073] Specifically, for each data sampled from a terminal device (eg, a wearable device), check whether there is a missing value, and record the location of the missing value.
[0074] , formula (4)
[0075] In the formula, Represents the first The sample Features, represents the missing value indicator matrix.
[0076] In step S320, for each missing position, an initial filling is performed using a mean filling method.
[0077] Specifically, for each missing position, the initial imputed data matrix can be calculated using a simple method:
[0078] , formula (5)
[0079] In the formula, Indicates The mean of other sample values, Represents the initial filled data matrix In the The sample Features
[0080] In step S330, the initial padded data matrix is generatively padded using a generator to obtain a corresponding padded generator matrix.
[0081] Specifically, using the generator Generate padding for the initially padded data:
[0082] , formula (6)
[0083] In the formula, Represents a conditional generating function, generator Based on the initial imputed data and random noise Generate fill generator matrix .
[0084] In step S340, the original data matrix is updated using the padding generation matrix to obtain corresponding multi-dimensional user data.
[0085] Specifically, the generated filled data is updated to the original data matrix:
[0086] , formula (7)
[0087] In the formula, is the updated and padded data matrix element, which represents the corresponding multi-dimensional user data.
[0088] Through this embodiment, GAN (Generative Adversarial Network) is used to fill in missing data, which can effectively reduce missing values in the data, ensure the integrity of the data, make the filled data consistent with the original data distribution, ensure the consistency and rationality of the data, and improve the data quality. Therefore, using GAN to fill in the data enables the model to cope with the challenges brought by missing data. Filling in missing data can avoid the loss of key information due to missing data, ensure that the model can obtain complete information when processing actual data, and enhance the robustness of the model in an incomplete data environment. In addition, based on the complete data set after filling, the system can more accurately track the changes in the user's health data, can more comprehensively identify the user's health status and behavior patterns, and dynamically adjust the recommendation plan, so that the personalized nutrition plan recommendation system can more comprehensively understand the user's health status and needs, thereby providing more accurate recommendations.
[0089] Figure 4A schematic diagram of the structural connections of an example of a graph neural network according to an embodiment of the present invention is shown.
[0090] like Figure 4 As shown, the graph neural network 400 includes a cascaded input module 410, a plurality of graph convolution modules 420, and an output module 430. Each graph convolution module 420 includes a cascaded attention mechanism layer 421, a graph convolution layer 422, a layer normalization layer 423, and a residual connection layer 424.
[0091] More specifically, the input module 410 is used to process each of the user-related nodes and each of the user-related edges to obtain a corresponding input feature matrix:
[0092] , formula (8)
[0093] In the formula, represents the input feature matrix, represents the node feature embedding function; Represents a user node set, which includes each user-related node and other related nodes indicated by each user-related edge.
[0094] Here, by extracting the fusion features of multi-dimensional user data, the user's comprehensive health status and needs can be captured, thereby improving the accuracy of nutritional plan recommendations.
[0095] Each graph convolution module 420 is used to extract graph convolution features of each node feature.
[0096] The attention mechanism layer 421 is used to calculate the graph convolution feature attention weights:
[0097] , formula (9)
[0098] , formula (10)
[0099] In the formula, Representation Node For neighbor nodes The attention weight is The unnormalized value of the layer, Representation Node In the The attention weights of the layers, represents the transpose of the attention weight vector; Representation Node In the Graph convolution features of layer output; Representation Node The set of neighbor nodes.
[0100] The graph convolutional layer 422 is used to perform the following operations:
[0101] , formula (11)
[0102] In the formula, Indicates Layer Node The attention characteristics of represents the activation function, Indicates The weight matrix of the layer.
[0103] Here, the attention mechanism can adaptively assign weights to different neighbor nodes to capture the personalized characteristics of users. Thus, the relationship characteristics between users and nodes in the nutrition knowledge graph can be efficiently extracted through the graph convolution layer and the attention mechanism layer, so that the recommendation system can more accurately identify the nutritional needs of users.
[0104] The layer normalization layer 423 is used to perform layer normalization on the node features:
[0105] , formula (12)
[0106] In the formula, Representation layer normalization function, Indicates Layer Node The layer normalized features.
[0107] In this way, performing layer normalization after each convolution layer can eliminate the scale differences of feature values at different levels and enhance the stability of the model.
[0108] The residual connection layer 424 is used to perform the following operations:
[0109] , formula (13)
[0110] In the formula, Representation Node In the Graph convolution features of the layer output.
[0111] Therefore, through residual connections, the gradient vanishing problem of deep models can be alleviated, the effective transmission of information in deep networks can be ensured, and the robustness of the model can be improved.
[0112] The output module 430 is used to fuse the graph convolution features output by each graph convolution module.
[0113] , formula (14)
[0114] In the formula, represents the user's nutritional demand characteristics, and L represents the total number of graph convolution modules; and Represent the weight matrix and bias term of the fully connected layer respectively, Represents a feature concatenation operator.
[0115] Through the embodiments of the present invention, an enhanced graph attention network (E-GAT) is adopted, and an attention mechanism and layer normalization are adopted, so that the computing efficiency of the system can be improved while maintaining a high accuracy rate, and the computing efficiency of the system can be further improved according to changes in the health status and needs of users.
[0116] Figure 5 Shown according to Figure 1 An example operation flow chart of step S140 in FIG.
[0117] like Figure 5 As shown, in step S510, multiple graph nutrition plan features in the nutrition knowledge graph are extracted.
[0118] In some embodiments, nutrition plan features of the graph can be extracted from each nutrition knowledge node in the nutrition knowledge graph to obtain the graph nutrition plan features.
[0119] In step S520, the matching degree between the user's nutritional requirement characteristics and the characteristics of each atlas nutritional plan is calculated.
[0120] More specifically, the cosine similarity is used to calculate the matching degree between the user demand characteristics and each nutrition plan characteristics:
[0121] , formula (15)
[0122] In the formula, Indicates the characteristics of the atlas nutrition plan, express and The matching function between and Represents vectors and The module length;
[0123] In step S530, at least one candidate nutrition plan is screened according to the calculated matching degree and a preset matching degree threshold.
[0124] More specifically, set the matching threshold according to specific needs , to express the minimum matching requirements between user demand characteristics and nutrition plan characteristics.
[0125] , formula (16)
[0126] In the formula, It is a collection of all nutrition plans. is at least one candidate nutritional regimen screened, Indicates the matching threshold.
[0127] Through this embodiment, by calculating the matching degree between user demand characteristics and nutritional plan characteristics through cosine similarity, a large number of candidate plans can be processed quickly, and the system can accurately and effectively screen out the nutritional plan that best meets the user's needs, and can achieve reasonable and lightweight computing resources and time consumption.
[0128] Figure 6 An operational flow chart showing an example of online learning optimization of a nutrition program optimization model according to an embodiment of the present invention.
[0129] like Figure 6 As shown, in step S610, a user score for the target nutritional plan is obtained.
[0130] In some embodiments, a user-friendly rating interface is designed to allow users to rate the recommended target nutrition plan, where the rating dimensions may include the feasibility of the plan, the degree of meeting nutritional needs, personal preference satisfaction, physical health changes, etc. More specifically, user rating data can be collected through mobile applications, web pages, or other interactive interfaces, and user feedback and suggestions can be collected to further optimize the recommendation system.
[0131] In step S620, an expanded data sample for a nutrition plan optimization model is generated based on the user score, the user's nutrition requirement characteristics and the target nutrition plan.
[0132] Here, the reward corresponding to the expanded data sample is determined by the user score, the state corresponding to the expanded data sample is defined by the user's nutritional demand characteristics, and the state corresponding to the expanded data sample is defined by the target action indicated by the target nutritional plan.
[0133] Through this embodiment, an extended data sample for optimizing the model is generated based on the user score, the user's nutritional needs characteristics and the target nutritional plan. For each element (reward, status and action) in the extended data sample, the reward can be determined by the user score, for example, the higher the score, the higher the corresponding reward value; the user's current health status and nutritional needs are described through the user's nutritional needs characteristics definition; the specific content of the recommended plan is described through the target action definition indicated by the target nutritional plan. As a result, the generated extended data sample provides rich training data for the nutritional plan optimization model, covering the user's real feedback and multi-dimensional feature information, and improving the effectiveness and accuracy of model training.
[0134] In step S630, the nutrition plan optimization model is optimized through online learning based on the generated augmented data samples.
[0135] Here, the intelligence and adaptability of the personalized nutrition recommendation system are further improved by obtaining user ratings, generating extended data samples, and conducting online learning of the optimization model. Therefore, by conducting online learning optimization of the nutrition plan optimization model, the system can dynamically adapt to changes in user needs and feedback, and continuously improve the accuracy and satisfaction of the recommended plan. Based on the online learning mechanism, the model has adaptive capabilities, can be updated and optimized in a timely manner, and ensures the personalization and high accuracy of the target nutrition plan.
[0136] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of combined actions, but those skilled in the art should be aware that the present invention is not limited by the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention. In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0137] Figure 7 A structural block diagram of an example of a nutrition plan recommendation system based on data fusion and knowledge graph according to an embodiment of the present invention is shown.
[0138] like Figure 7 As shown, the nutrition plan recommendation system 700 based on data fusion and knowledge graph includes a multidimensional data acquisition unit 710, a graph feature extraction unit 720, a demand feature determination unit 730, a candidate plan determination unit 740 and a target plan determination unit 750.
[0139] The multi-dimensional data acquisition unit 710 is used to acquire multi-dimensional user data, where the multi-dimensional user data includes basic health data, health goal data, diet record data, exercise data, and health status data.
[0140] The graph feature extraction unit 720 is used to embed the multi-dimensional user data into a preset nutrition knowledge graph to extract user-related nodes and user-related edges from the nutrition knowledge graph.
[0141] The demand feature determination unit 730 is used to process each of the user-associated nodes and each of the user-associated edges based on a graph neural network to determine the corresponding user nutritional demand features.
[0142] The candidate solution determination unit 740 is used to determine at least one candidate nutrition solution that matches the user's nutritional demand characteristics based on the nutrition knowledge graph.
[0143] The target plan determination unit 750 is used to input the user's nutritional requirement characteristics and each of the candidate nutritional plans into a nutritional plan optimization model to determine the target nutritional plan to be recommended; the nutritional plan optimization model adopts a reinforcement learning model, the state of the reinforcement learning model is defined by the user's nutritional requirement characteristics, the action of the reinforcement learning model is defined by the candidate nutritional plans, and the reward function of the reinforcement learning model is defined based on the nutritional requirement satisfaction and the health indicator improvement.
[0144] In some embodiments, an embodiment of the present invention provides a non-volatile computer-readable storage medium, in which one or more programs including execution instructions are stored, and the execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to execute the above-mentioned nutrition plan recommendation method based on data fusion and knowledge graph of the present invention.
[0145] In some embodiments, an embodiment of the present invention further provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the above-mentioned nutrition plan recommendation method based on data fusion and knowledge graph.
[0146] In some embodiments, an embodiment of the present invention also provides an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute a nutrition plan recommendation method based on data fusion and knowledge graph.
[0147] Figure 8 is a schematic diagram of the hardware structure of an electronic device for executing a method for recommending a nutrition plan based on data fusion and knowledge graphs provided by another embodiment of the present invention, such as Figure 8 As shown, the device includes:
[0148] One or more processors 810 and memory 820, Figure 8 A processor 810 is taken as an example.
[0149] The device for executing the method for recommending a nutrition plan based on data fusion and knowledge graph may also include: an input device 830 and an output device 840 .
[0150] The processor 810, the memory 820, the input device 830 and the output device 840 may be connected via a bus or other means. Figure 8 The example of connecting through bus is taken in the following.
[0151] The memory 820, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the method for recommending a nutrition plan based on data fusion and knowledge graph in the embodiment of the present invention. The processor 810 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 820, that is, the method for recommending a nutrition plan based on data fusion and knowledge graph in the above method embodiment is implemented.
[0152] The memory 820 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 820 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 820 may optionally include a memory remotely arranged relative to the processor 810, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0153] The input device 830 may receive input digital or character information and generate signals related to user settings and function control of the electronic device. The output device 840 may include a display device such as a display screen.
[0154] The one or more modules are stored in the memory 820, and when executed by the one or more processors 810, perform the nutrition plan recommendation method based on data fusion and knowledge graph in any of the above method embodiments.
[0155] The above product can execute the method provided by the embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the method provided by the embodiment of the present invention.
[0156] The electronic device of the embodiment of the present invention exists in various forms, including but not limited to:
[0157] (1) Mobile communication equipment: This type of equipment is characterized by having mobile communication functions and its main purpose is to provide voice and data communications. This type of terminal includes: smart phones, multimedia phones, functional phones, and low-end phones.
[0158] (2) Ultra-mobile personal computer devices: These devices belong to the category of personal computers, have computing and processing functions, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, etc.
[0159] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players, handheld game consoles, e-books, smart toys, and portable car navigation devices.
[0160] (4) Other onboard electronic devices with data interaction functions, such as on-board devices installed in vehicles.
[0161] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0162] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0163] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for recommending nutrition plans based on data fusion and knowledge graph, characterized in that: The method comprises: Acquire multi-dimensional user data, wherein the multi-dimensional user data includes basic health data, health goal data, diet record data, exercise data, and health status data; Embedding the multidimensional user data into a preset nutrition knowledge graph to extract user-related nodes and user-related edges from the nutrition knowledge graph; Processing each of the user-related nodes and each of the user-related edges based on a graph neural network to determine corresponding user nutritional demand characteristics; Based on the nutrition knowledge graph, determining at least one candidate nutrition plan that matches the nutrition requirement characteristics of the user; Inputting the user's nutritional requirement characteristics and each candidate nutritional plan into a nutritional plan optimization model to determine a target nutritional plan to be recommended; the nutritional plan optimization model adopts a reinforcement learning model, the state of the reinforcement learning model is defined by the user's nutritional requirement characteristics, the action of the reinforcement learning model is defined by the candidate nutritional plan, and the reward function of the reinforcement learning model is defined according to the nutritional requirement satisfaction and the health indicator improvement; The reward function of the reinforcement learning model It is expressed by the following formula: ; ; ; In the formula, and They represent the satisfaction of nutritional needs and the improvement of health indicators respectively. and Respectively represent the corresponding reward item weight parameters; Nutritional information The intake of Indicates the user's nutritional content The demand, n The total number of types of nutrients that represent the user's nutritional needs; Indicates health indicators changes, Is a health indicator The weight of m Indicates the number of types of health indicators; The graph neural network includes a cascaded input module, a plurality of graph convolution modules and an output module; each of the graph convolution modules includes a cascaded attention mechanism layer, a graph convolution layer, a layer normalization layer and a residual connection layer; The input module is used to process each of the user-related nodes and each of the user-related edges to obtain a corresponding input feature matrix: ; In the formula, represents the input feature matrix, represents the node feature embedding function; represents a user node set, the user node set including each of the user-associated nodes and other related nodes indicated by each of the user-associated edges; Each of the graph convolution modules is used to extract graph convolution features of each node feature; The attention mechanism layer is used to calculate the attention weights of graph convolution features: ; ; In the formula, Representation Node For neighbor nodes The attention weight is The unnormalized value of the layer, Representation Node In the The attention weights of the layers, represents the transpose of the attention weight vector; Representation Node In the Graph convolution features of layer output; Representation Node The set of neighbor nodes of Graph convolutional layers are used to perform the following operations: ; In the formula, Indicates Layer Node The attention characteristics of represents the activation function, Indicates The weight matrix of the layer; The layer normalization layer is used to normalize the node features: ; In the formula, Representation layer normalization function, Indicates Layer Section Layer-normalized features of points; The residual connection layer is used to perform the following operations: ; In the formula, Representation section Point at Graph convolution features of layer output; The output module is used to fuse the graph convolution features output by each graph convolution module: ; In the formula, Indicates the nutritional needs of users. L Represents the total number of graph convolution modules; and denote the weight matrix and bias term respectively, Represents a feature concatenation operator.
2. The method according to claim 1, characterized in that The basic health data includes at least one of the following: age, gender, height, weight and BMI; the health goal data includes at least one of the following: weight management goal, nutrition intake goal, health index goal and disease management goal; the diet record data includes at least one of the following: diet preference information, diet restriction information, daily food intake types and daily food intake quantity; the exercise data includes at least one of the following: daily exercise volume, exercise type and weekly exercise frequency; the health status data includes at least one of the following: user physical examination information, previous medical history, family medical history and drug use information; the user physical examination information includes at least one of the following: blood biochemical index data, gene detection data and medical diagnosis data; The nutrition knowledge graph includes multiple nodes and edges; The node types of each of the nodes include: nutritional knowledge node, food node, nutrient component node, health status node, physiological characteristic node, eating habit node and exercise type node; the edge types of each of the edges include: inclusion relationship, contribution relationship, increased risk relationship, suitability relationship and avoidance relationship.
3. The method according to claim 2, characterized in that The blood biochemical indicator data include at least one of the following: blood lipids, blood sugar, blood uric acid and blood mineral concentration; the gene detection data include detection results for dietary component metabolism-related genes and / or dietary lifestyle behavior-related genes, the dietary component metabolism-related genes include at least one of the following: carbohydrate metabolism-related genes, fatty acid metabolism-related genes, vitamin metabolism-related genes, mineral metabolism-related genes, alcohol metabolism-related genes and caffeine metabolism-related genes, the dietary lifestyle behavior-related genes include at least one of the following: appetite level-related genes, food sensitivity-related genes, food tolerance-related genes, obesity risk-related genes and sleep-related genes; the medical diagnosis data include at least one of the following chronic diseases related to dietary lifestyle: hyperlipidemia, hyperuricemia, diabetes, cardiovascular disease, fatty liver, kidney stones and osteoporosis.
4. The method according to claim 1, characterized in that: The determining, based on the nutrition knowledge graph, at least one candidate nutrition plan that matches the nutrition requirement characteristics of the user comprises: Extracting multiple graph nutrition scheme features in the nutrition knowledge graph; Calculate the matching degree between the user's nutritional requirement characteristics and the characteristics of each nutritional plan: ; In the formula, Indicates the characteristics of the atlas nutrition plan, express and The matching function between Representation vector The module length, Representation vector The module length; At least one candidate nutrition plan is screened according to the calculated matching degree and a preset matching degree threshold: ; In the formula, It is a collection of all nutrition plans. is at least one candidate nutritional regimen screened, Indicates the matching threshold.
5. The method according to claim 4, characterized in that After inputting the user's nutritional requirement characteristics and each of the candidate nutritional solutions into a nutritional solution optimization model to determine a target nutritional solution to be recommended, the method further includes: Obtaining user ratings for the target nutrition plan; Generate an extended data sample for the nutrition plan optimization model according to the user score, the user nutrition demand characteristics and the target nutrition plan; the reward corresponding to the extended data sample is determined by the user score, the state corresponding to the extended data sample is defined by the user nutrition demand characteristics, and the action corresponding to the extended data sample is defined by the target action indicated by the target nutrition plan; Based on the generated augmented data samples, the nutrition plan optimization model is optimized through online learning.
6. The method according to claim 5, characterized in that The obtaining of multi-dimensional user data includes: Collect original user data from the user terminal device, detect missing values in the original data matrix corresponding to the collected original user data, and record the corresponding positions of the missing values: ; In the formula, Represents the first The sample Features, represents the missing value indicator matrix; For each missing position, the initial filling method is used: ; In the formula, Indicates The mean of other sample values, Represents the initial filled data matrix In the The sample Features Using Generators For the initial filled data matrix Perform generative padding to obtain the corresponding padding generation matrix: ; In the formula, Represents a conditional generating function, the generator is based on the initial filled data and random noise Generate fill generator matrix ; The original data matrix is updated using the padding generation matrix to obtain the corresponding multi-dimensional user data: ; In the formula, is the updated and padded data matrix element, which represents the corresponding multi-dimensional user data.
7. A nutrition plan recommendation system based on data fusion and knowledge graph, used to execute the nutrition plan recommendation method based on data fusion and knowledge graph as described in any one of claims 1 to 6, characterized in that: The system comprises: A multi-dimensional data acquisition unit, used to acquire multi-dimensional user data, wherein the multi-dimensional user data includes basic health data, health goal data, diet record data, exercise data and health status data; A graph feature extraction unit, used for embedding the multi-dimensional user data into a preset nutrition knowledge graph to extract user-related nodes and user-related edges from the nutrition knowledge graph; A demand feature determination unit, configured to process each of the user-related nodes and each of the user-related edges based on a graph neural network to determine a corresponding user nutritional demand feature; A candidate solution determining unit, configured to determine at least one candidate nutrition solution matching the nutrition requirement characteristics of the user based on the nutrition knowledge graph; The target plan determination unit is used to input the user's nutritional demand characteristics and each of the candidate nutritional plans into a nutritional plan optimization model to determine the target nutritional plan to be recommended; the nutritional plan optimization model adopts a reinforcement learning model, the state of the reinforcement learning model is defined by the user's nutritional demand characteristics, the action of the reinforcement learning model is defined by the candidate nutritional plans, and the reward function of the reinforcement learning model is defined according to the nutritional demand satisfaction and the health indicator improvement.
