Dietary adjustment system and method based on knowledge graph
Through a technical framework based on knowledge graphs, combined with multi-source heterogeneous knowledge graphs and graph representation learning, the deficiencies of knowledge modeling and multi-perspective learning in the intelligent meal adjustment system are solved, and the generation and dynamic adjustment of personalized meal plans are realized, improving improve the practicality and openness of the system.
Patent Information
- Application Number
- CN202410887390.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-10-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing intelligent meal adjustment systems have deficiencies in knowledge modeling, multi-perspective learning, cross-modal understanding and continuous evolution, making it difficult to meet complex and changing user needs, especially when generating personalized meals under the guidance of nutritional and medical knowledge. lack of flexibility and generalization capabilities.
Adopting a technical framework based on knowledge graphs, through multi-source heterogeneous knowledge graph construction, graph representation learning, cross-modal reasoning and knowledge distillation, combined with multiple perspectives of nutrition, pharmacology, taboos and taste, a personalized meal plan is generated and passed on to users Feedback is used for dynamic adjustments and knowledge base updates.
It realizes a dietary intelligent decision-making solution with nutritional professionalism, user personalization, intelligent recommendation and knowledge interpretability. It solves the problems of narrow knowledge coverage, slow update speed and lack of continuous learning ability in traditional methods, and improves the practicality of the system. sex and openness.
Smart Images

Figure CN118800399A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of dietary adjustment systems, and more specifically, to a dietary adjustment system and method based on a knowledge graph. Background Art
[0002] With the improvement of living standards in modern society, people's demand for healthy diet is growing. However, due to the professionalism and individual differences of nutrition knowledge, it is often difficult for ordinary users to develop a diet plan that is both nutritionally balanced and meets personal needs based on their own health conditions and dietary preferences. This provides broad application prospects and urgent practical needs for the research and development of intelligent diet adjustment systems.
[0003] In recent years, the rapid development of artificial intelligence technology has provided new ideas for the design of intelligent dietary adjustment systems. Existing research mainly focuses on the following aspects: First, recommendations based on nutrition knowledge bases. This type of method uses rule-based or case-based reasoning to achieve dietary matching by constructing structured knowledge such as food nutrient libraries and disease population dietary taboo libraries. However, this type of method usually has a narrow knowledge coverage and slow update speed, making it difficult to cope with complex and changing user needs; second, collaborative filtering recommendations based on user portraits. This type of method uses collaborative filtering, matrix decomposition and other algorithms based on user historical dietary records, taste preferences and other data to mine similarities between different users, thereby achieving accurate recommendations of items. However, this type of method is prone to fall into the "information cocoon", lacks the guidance of nutrition and medical expertise, and is difficult to take into account the nutritional value and health orientation of dietary matching; third, content-based recipe recommendations. This type of method is mainly based on the meta-information of recipes (such as ingredient composition, cooking methods, taste preferences, etc.), and achieves recipe retrieval and sorting through attribute matching. However, this type of method is difficult to model high-dimensional semantic associations between ingredients, lacks personalized considerations, and has limited practicality.
[0004] Despite many attempts, the existing intelligent dietary adjustment methods still have the following shortcomings: First, most of the existing methods organize and use nutrition and health knowledge in a static way, lack the flexibility of knowledge representation and reasoning, and are difficult to model complex semantic associations; second, the existing methods are mainly based on a single perspective (such as nutrition, taste, etc.) for user modeling and recommendation generation, ignoring the diversity and complexity of user needs, and the actual effect is difficult to guarantee; third, the existing methods are mainly guided by the idea of dimensionality reduction, and use matrix decomposition and other technologies to achieve low-rank representation of User-Item, but when applied to complex and heterogeneous large-scale knowledge graphs, their generalization ability and interpretability are greatly reduced; finally, the existing methods lack the ability to continuously learn from user feedback, cannot adapt to the dynamic changes of user preferences and external knowledge environment, and lack timeliness and novelty. These problems restrict the further development of intelligent dietary adjustment systems.
[0005] Specifically, one of the existing mainstream algorithms is a collaborative filtering recommendation algorithm based on matrix decomposition. Its core is to use the user-item rating matrix, learn the implicit vector representation of users and items through matrix decomposition technology, and approximate the rating value with the inner product of the implicit vector. Although the algorithm has achieved good results in some scenarios, it is not competent in the intelligent dietary adjustment task: first, the algorithm focuses on the use of user and item collaborative information, but ignores the important guiding role of nutrition and medical knowledge in the dietary field in recommendation. It is difficult to generate professional dietary plans based on co-occurrence information between users alone; second, the algorithm relies on the historical interaction data of users and items, while in the actual dietary adjustment scenario, the user's explicit feedback data (such as dish ratings) is often very sparse, and there are even a large number of cold-start users and items, which makes it difficult for the algorithm to learn accurate latent factor representations; third, matrix decomposition is essentially a linear dimensionality reduction of the user-item interaction matrix, and its feature expression ability is limited, especially when facing the dietary adjustment task that requires simultaneous modeling of multi-dimensional heterogeneous information such as nutritional attributes, efficacy attributes, taste attributes, and taboo attributes of ingredients, its modeling and reasoning capabilities are difficult to meet the needs; finally, the user / item latent factor vectors generated by the algorithm have poor interpretability, making it difficult to gain user trust, and lack the ability to adjust online and continuously learn, making it difficult to adapt to the dynamic changes of user preferences. These problems have caused traditional collaborative filtering algorithms to be frequently frustrated in the intelligent dietary adjustment task.
[0006] In summary, traditional intelligent recommendation algorithms are difficult to meet the needs of the field of intelligent dietary adjustment due to their deficiencies in knowledge modeling, multi-perspective learning, cross-modal understanding, and continuous evolution. It is urgent to develop a new intelligent recommendation paradigm that integrates nutritional knowledge, integrates multi-perspective data, supports heterogeneous reasoning, and has online learning capabilities. This is not only an inevitable trend in the research of intelligent dietary adjustment, but also an objective requirement for artificial intelligence technology to deeply empower the field of health management. The present invention is proposed in this context, aiming to provide new ideas and methods for the design of intelligent dietary adjustment systems through graph-driven cross-modal representation and reasoning. Summary of the invention
[0007] The present invention aims at the above-mentioned technical problems and proposes a dietary adjustment system and method based on knowledge graph. Through the knowledge-driven and data-driven technical framework, with cross-domain knowledge graph as background knowledge and user health big data as dynamic feedback, through graph representation learning, cross-modal reasoning, knowledge distillation and other artificial intelligence technologies, a set of dietary intelligent decision-making solutions with nutritional professionalism, user personalization, intelligent recommendation and knowledge interpretability are formed.
[0008] The present invention provides a diet adjustment system based on knowledge graph, the system comprising: a multi-source heterogeneous knowledge graph construction module, a user health status analysis module, an intelligent diet adjustment engine, a diet execution feedback module and a knowledge graph update module;
[0009] The multi-source heterogeneous knowledge graph construction module is used to construct a heterogeneous knowledge graph containing cross-domain knowledge of nutrition, medicine, and Chinese medicine diet therapy;
[0010] The user health status analysis module is used to map user health data into entities and associations in the knowledge graph to construct a personal health knowledge graph;
[0011] The intelligent dietary adjustment engine includes: a graph representation learning unit integrating multiple perspectives, a dish combination recommendation unit based on a graph attention network, a progressive logic comparison and conflict resolution unit, and a multimodal knowledge distillation unit; the intelligent dietary adjustment engine is used to combine the heterogeneous knowledge graph and the personal health knowledge graph to generate a personalized dietary plan through graph representation learning, graph attention combination recommendation, logical reasoning, and multimodal distillation;
[0012] The meal execution feedback module is used to collect multi-dimensional feedback data of users on the recommended meals and guide the dynamic adjustment of the recommendation strategy;
[0013] The knowledge graph update module is used to mine user feedback logs, learn new collocation combinations and user preferences, and continuously expand the knowledge graph.
[0014] Specifically, the multi-view graph representation learning unit is used to learn low-dimensional embedding representation of ingredients from multiple perspectives such as nutrition, pharmacology, taboos, and taste using a heterogeneous graph attention network algorithm;
[0015] The graph attention dish combination recommendation unit is used to construct a dish combination embedding representation using a graph attention network, and generate three meals a day dish recommendations in combination with a nutritional balance constraint;
[0016] The progressive logic comparison and conflict resolution unit is used to detect and eliminate potential conflicts in dish combinations through logical reasoning of the knowledge graph, and introduce a soft rule loss function penalty model;
[0017] The multimodal knowledge distillation unit is used to integrate the multi-perspective food embedding representations into a unified Student network through knowledge distillation technology, taking into account both reasoning efficiency and multimodal balance.
[0018] Specifically, the heterogeneous graph attention network algorithm embeds the food node i under the perspective k as The calculation formula is:
[0019]
[0020] in, is the set of neighbor nodes of node i under relationship r; is the transformation matrix of relation r under view k; a is the attention vector; σ is the activation function, and is the parameter matrix under perspective k, σ is the nonlinear activation function; R is the set of relationship types; || represents the concatenation operation.
[0021] Specifically, the calculation process of the graph attention dish combination recommendation unit is as follows: for a dish containing ingredients {v1, v2, …, v n}, its embedding representation is e C for:
[0022]
[0023] Among them, β i is the attention weight of ingredient i on dish C; W and a are the parameter matrix and vector of the attention network. At the same time, the recommended dish combination must meet the nutritional balance constraint:
[0024]
[0025] Among them, C b is the set of dishes in meal period b; Nutr(C j ) for dish C j The nutritional content of each ingredient; Req is the recommended daily intake.
[0026] Specifically, the progressive logic comparison and conflict resolution unit is based on the knowledge graph G and the personal health knowledge graph G P , for candidate dish combination C j To perform conflict detection:
[0027]
[0028] Among them, R(C j ,G) is C j The corresponding relationship set of the ingredients in the graph G; ⊥ represents the logic of the two relationships
[0029] Conflict; By introducing the soft rule loss function L R Penalize the model:
[0030]
[0031] Among them, f is the scoring function embedded in the knowledge graph; γ is the penalty term coefficient; y i ,i′ is a conflict indicator variable, through back propagation L R , so that the model gradually reduces logical conflicts.
[0032] Specifically, the Student network loss function is the KL divergence of the Teacher network output and the Student network output:
[0033]
[0034] p l (v i )=softmax(z l (v i ) / T),l∈{S,T k}
[0035] Among them, z l For network l to food v i The output of k is the weight coefficient of viewing angle k; T is the temperature coefficient; p l It is the probability distribution after softmax normalization. The final learned Student network is used independently in the inference stage, taking into account both efficiency and multimodal fusion.
[0036] Specifically, the meal execution feedback module calculates the user's score F for the recommended dish. j and changes in physiological indicators ΔB j Constructed as a feedback tuple (F j ,ΔB j ), multiple feedback tuples are aggregated into an ordered set {F t}, and integrated into the reward function:
[0037]
[0038] Among them, α is the balancing factor, the reward function is used as the supervision signal of the graph network, and the optimization goal is to maximize the cumulative reward:
[0039] Specifically, the knowledge graph update module expands knowledge in the following ways:
[0040] (1) Frequently co-occurring food combinations i ,v j} If it can evoke positive feedback, add it as a new edge i,j :
[0041]
[0042] Among them, Support({v i ,v j}) is the ingredient combination {v i ,v j} support; The confidence level of evoking positive feedback for this ingredient combination; α and β are the thresholds of support and confidence;
[0043] (2) Decompose the user-dish-feedback matrix M: M = U∑V T , get the user's implicit preference vector u i and the implicit feature vector v of the dish j , the inner product of the two as the preference edge weight of user i for dish j.
[0044] An intelligent dietary adjustment method based on the above system comprises the following steps:
[0045] Step 1. Knowledge graph construction: Using natural language processing technology, extract knowledge in the fields of nutrition, medicine, and Chinese medicine from structured and unstructured data sources to construct a multi-source heterogeneous knowledge graph;
[0046] Step 2. Health status analysis: Map user health data to entities and associations in the knowledge graph through the health status ontology to build a personal health knowledge graph;
[0047] Step 3. Dietary adjustment generation:
[0048] Step 3.1. Multi-perspective ingredient representation learning: From multiple perspectives such as nutrition, pharmacology, taboos, and taste, a heterogeneous graph attention network algorithm is used to learn low-dimensional embedding representations of ingredients;
[0049] Step 3.2. Graph attention dish combination recommendation: Use the graph attention network to construct a dish combination embedding representation, and combine it with nutritional balance constraints to generate three meals a day dish recommendations;
[0050] Step 3.3. Logical comparison and conflict resolution: Detect and eliminate potential conflicts in dish combinations through logical reasoning of the knowledge graph, and introduce a soft rule loss function penalty model;
[0051] Step 3.4. Multimodal knowledge distillation: The multi-perspective food embedding representations are integrated into a unified Student network through knowledge distillation technology, taking into account both reasoning efficiency and multimodal balance;
[0052] Step 4. Feedback learning: Collect users’ ratings of recommended dishes and feedback on changes in physiological indicators, construct a reward function as a supervisory signal for the graph network, and guide the dynamic adjustment of the recommendation strategy;
[0053] Step 5. Knowledge graph update: mine user feedback logs, add frequently co-occurring ingredient combinations based on association rule learning, learn users’ implicit taste preferences through matrix decomposition, and continuously expand the knowledge graph.
[0054] The present invention has the following beneficial effects:
[0055] First of all, the present invention cleverly integrates the two intelligent paradigms of knowledge-driven and data-driven. On the one hand, with the cross-domain knowledge graph as the core, explicit knowledge such as nutrition, medicine, and traditional Chinese medicine pharmacology is systematically integrated to form a comprehensive, standardized, and explainable knowledge base, which provides reliable prior support for intelligent decision-making; on the other hand, by continuously collecting and learning users' health status data and dietary feedback data, and using data-driven technologies such as representation learning and transfer learning, the prior knowledge is dynamically updated and optimized, realizing the continuous evolution of the knowledge base. The two paradigms cooperate with each other in the recommendation process. The prior knowledge ensures the professionalism and rationality of the recommendation results, and the a posteriori data gives the recommendation results personalization and timeliness. The two complement each other and are organically unified, which not only avoids the rigidity of a pure rule system and the black box nature of a pure data-driven method, but also overcomes the limitations of the two paradigms when they are applied separately, reflecting the synergistic gain effect.
[0056] Secondly, from the perspective of the algorithm core, the multi-perspective graph representation learning and cross-modal knowledge distillation technology adopted by the present invention have well solved the heterogeneity and high dimensionality problems of knowledge in the field of dietary health. Traditional dietary adjustments are mostly modeled based on a single perspective (such as nutrition) and homogeneous data, ignoring the semantic association of ingredients in different attribute dimensions, making it difficult to fully characterize the characteristics of ingredients. In response to this problem, the present invention innovatively uses graph neural networks to realize multi-perspective embedded representation learning of ingredients. On the one hand, the modeling paradigm of heterogeneous graphs well matches the multi-dimensional heterogeneous characteristics of dietary health knowledge; on the other hand, the attention mechanism provides an adaptive fusion solution for embedded representations of different perspectives. In addition, through the knowledge distillation of the teacher-student network, the compression and refinement of multi-perspective knowledge at the semantic level is further realized. In summary, the above method well describes the multi-semantic information of ingredients from the perspective of representation learning, and forms support in multiple links such as knowledge construction, recommendation generation, and strategy iteration, ultimately achieving seamless connection from representation to decision-making, highlighting the synergy between the modules of the system.
[0057] Again, in the recommendation generation link, the present invention realizes the cross-layer mapping of ingredients to dishes through the graph attention network, and introduces a multi-objective optimization mechanism. This approach is unique in design: on the one hand, the representation vector of the candidate dish is a weighted fusion of the embedded information of the ingredients it contains, which not only retains the inherent ingredient matching relationship of the dish, but also can flexibly adjust the importance of different ingredients, giving the dish a more refined feature representation; on the other hand, when generating candidate dish combinations, the two goals of nutritional balance and health coordination are considered at the same time, and a graph-based logical rule is established to detect and eliminate potential logical conflicts. This design cleverly unifies the two goals of nutritional balance and health orientation into the same framework, and realizes the multi-angle control of the quality of the diet therapy plan through the idea of multi-task learning, which not only avoids the negative interference between different goals, but also can achieve the synchronous improvement of different goals through joint training, and well avoids the one-sidedness of single-objective optimization. It can be seen that this combination design of causal graph reasoning and multi-objective optimization is a revolutionary paradigm breakthrough in the design of traditional nutritional meals and diet therapy plans.
[0058] Finally, a major innovation of the present invention is the introduction of user feedback links and knowledge iteration mechanisms, which enable the intelligent system to have the ability to continuously evolve. Traditional static recommendation systems usually only have one-way decision-making capabilities and lack interactive feedback with users, which will become "rigid" over time. In response to this problem, the present invention constructs a complete closed-loop feedback mechanism: user feedback data is introduced into the optimization target of the recommendation strategy, and the strategy can be continuously adjusted to meet user needs through feedback correction of reinforcement learning; at the same time, the system will regularly use feedback data to expand and update the knowledge graph, continuously absorb new nutritional knowledge and user preference knowledge, and ensure the novelty of the knowledge base. As a result, the system realizes the dynamic closed loop of "knowledge-decision-feedback", and the ability of online error correction and continuous evolution makes it get rid of the traditional static system and have the quality of lifelong learning. From the perspective of cognitive science, this is also a beneficial attempt to give intelligent systems human-like continuous learning capabilities.
[0059] In summary, the present invention skillfully uses and combines a variety of cutting-edge artificial intelligence technologies such as knowledge graphs, representation learning, cross-modal mapping, multi-task optimization, reinforcement learning, etc., and makes many innovations in the overall framework design. It has effectively solved the problems of knowledge heterogeneity, complex semantics, and changing preferences in the field of dietary health, and has achieved synergistic efficiency and complementary optimization at multiple levels. The practicality, intelligence, and openness of the system have been greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 This is a schematic diagram of the framework of a dietary adjustment system based on a knowledge graph according to the present invention.
[0061] Figure 2This is a schematic diagram of the framework of the intelligent dietary adjustment engine of the present invention.
[0062] Figure 3 This is a flow chart of a dietary adjustment method based on a knowledge graph of the present invention. DETAILED DESCRIPTION
[0063] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation, structure, features and effects of a diet adjustment system based on a knowledge graph proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0064] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0065] The specific scheme of a dietary adjustment system based on a knowledge graph provided by the present invention is described in detail below with reference to the accompanying drawings.
[0066] Example 1
[0067] See also Figure 1-2 The present invention proposes an intelligent dietary adjustment system based on a knowledge graph, including a multi-source heterogeneous knowledge graph construction module 1, a user health status analysis module 2, an intelligent dietary adjustment engine 3, a dietary execution feedback module 4 and a knowledge graph update module 5.
[0068] Among them, the multi-source heterogeneous knowledge graph construction module 1 is used to integrate cross-domain knowledge such as nutrition, medicine, and Chinese medicine diet therapy, and construct a multi-type entity covering ingredients, nutrients, diseases, drugs, treatment methods, and a large-scale semantic network containing various heterogeneous associations such as the nutrient content of ingredients, the association between ingredients and diseases, and the pharmacological effects of ingredients. This knowledge graph provides rich domain knowledge support for intelligent dietary adjustment. The construction process uses natural language processing technology to extract information from structured data (such as pharmacopoeia, ingredient list, etc.) and unstructured text (such as medical literature, case reports, etc.), extract entities, attributes, and relationship knowledge, and formalize them into ontology and knowledge base. Among them, entity extraction uses named entity recognition algorithm to identify specific types of entities such as ingredients and diseases from the text; attribute extraction uses part-of-speech analysis and dependency syntax analysis to extract its intrinsic attributes from the sentence where the entity is located; relationship extraction uses rule-based, template-based or machine learning methods to discover the association between entities. The extracted knowledge is then manually verified and integrated to eventually form a high-quality heterogeneous knowledge graph.
[0069] The function of the user health status analysis module 2 is to collect and semantically represent the user's health status data in real time. This module receives multi-source heterogeneous health data such as the user's electronic medical records, physical examination reports, case descriptions, etc., and extracts information such as symptoms, signs, and examination results through medical information extraction, ontology mapping, etc., and semantically maps these fragmented information to existing concepts such as diseases and symptoms in the knowledge graph, thereby forming a structured and semantic personal health knowledge graph. For example, the field "high blood sugar" is extracted from the medical record and mapped to the disease concept of "hyperglycemia" in the knowledge graph; the test result of "alanine aminotransferase 60U / L" is extracted from the physical examination report and mapped to the symptom concept of "elevated transaminase". In addition, it is also possible to infer whether the user suffers from a certain disease based on the clinical diagnostic criteria of the disease. For example, if the user's fasting blood sugar is continuously greater than 7.0mmol / L, it is inferred that the user suffers from diabetes. Through the above information extraction, ontology mapping and logical reasoning process, a complete personal health knowledge graph can be dynamically constructed to fully reflect the user's health status.
[0070] See also Figure 2 The intelligent dietary adjustment engine 3 is the core module of the present invention, which is used to comprehensively utilize heterogeneous domain knowledge graphs and personalized health status information, and automatically generate nutritionally balanced and health-oriented intelligent dietary plans through artificial intelligence technologies such as multi-perspective representation learning, cross-modal reasoning, and knowledge distillation.
[0071] Specifically, the engine contains four key technical units:
[0072] (1) Multi-view graph representation learning unit 31: This unit uses a heterogeneous graph attention network algorithm to learn low-dimensional semantic embedding representations of ingredients from multiple perspectives such as nutrition, pharmacology, and taste preference. For an ingredient node i under perspective k, its embedding representation is Generated through the following attention aggregation mechanism:
[0073]
[0074] in, is the set of neighbor nodes of node i under relationship r; is the transformation matrix of relation r under view k; a is the attention vector; σ is the activation function, and is the parameter matrix under the viewing angle k. Intuitively, the attention coefficient α i ,j k,rDynamically capture the contribution of node j to the embedded representation of node i under perspective k through relationship r. Ultimately, each ingredient node will learn a K-dimensional embedding vector that comprehensively describes its nutritional properties, pharmacological effects, taste characteristics and other aspects. Based on the learned ingredient embedding representation, the semantic similarity between ingredients under different perspectives can be further calculated to provide a basis for subsequent combination recommendations. For example, by performing an inner product on the nutritional perspective embeddings of two ingredients, we can obtain their similarity scores in nutritional matching.
[0075] (2) Graph attention dish combination recommendation unit 32: This unit receives the embedded representation of ingredients learned from multiple perspectives, and implements cross-layer mapping from ingredients to dishes through the graph attention network to form a nutritionally balanced dish combination for three meals a day. Specifically, for a set of ingredients {v1,…,v n}, first generate its embedding representation e through the attention mechanism C :
[0076] β i =softmax(LeakyReLU(a T [We C We i ]))
[0077]
[0078] Among them, β i For food v i The attention weight of dish C intuitively reflects v i The importance of C; W is the shared transformation matrix; a is the attention vector. Then, all meal periods B1,…,B T The dish combination embeddings are summed to get the overall meal plan embedding:
[0079]
[0080] Add nutritional balance loss L N Perform optimization solution:
[0081]
[0082] Where N is the set of nutrient types that need to be controlled, such as calories, protein, fat, etc. n (C) is the content of nutrient n in dish C; Req n is the recommended total intake of nutrient n in three meals a day. Minimizing this loss function can ensure that the generated three-meal-a-day dish combination achieves a balanced nutrient intake overall.
[0083] (3) Progressive logic comparison and conflict resolution unit 33: In order to avoid conflicts between the recommended solution and the user's medical history, medication contraindications and other health conditions, this unit introduces logical reasoning and rule constraints based on the knowledge graph. Specifically, for any candidate dish combination C, the possible logical conflicts are detected through the rules R in the knowledge graph G:
[0084]
[0085] Among them, R(C) is the set of associated edges of all ingredients in C in the knowledge graph G; ⊥ represents the logical conflict of two relationships. For example, a dish combination contains both "pork liver" and "spinach", and the taboo population attribute of "spinach" in the health knowledge graph happens to include "abnormal liver function", then the combination is judged to conflict with the user's health status. In order to smoothly eliminate logical conflicts, the unit further designed a soft rule loss function to penalize conflicting dish combinations:
[0086]
[0087] Among them, γ C is the conflict coefficient, which can be set as a function of the number of conflicting rules; f is the scoring function embedded in the knowledge graph; μ is the margin threshold. R And the above nutritional balance loss L N, The generated dish combinations can meet health constraints while taking into account nutritional balance. This mechanism introduces external knowledge as a rule-based prior to make up for the limitations of pure data-driven methods. In the recommendation process, iterative optimization can be used to gradually explore more and more implicit conflicts and continuously improve the rationality and effectiveness of the dietary therapy plan.
[0088] (4) Multimodal knowledge distillation unit 34: To further improve the computational efficiency and generalization ability of dish combination recommendation, this unit proposes a multimodal knowledge distillation mechanism based on the Teacher-Student paradigm. The core idea is to distill the food representation knowledge learned by multiple Teacher models from the perspective of nutrition, pharmacology, and taste into a unified Student model. Formally, let is the Teacher model learned from K perspectives, S is the Student model, and the optimization goal is to minimize the KL divergence of the output distribution of the Student model and the Teacher model:
[0089]
[0090] p l (v i )=softmax(z l (v i) / T),l∈{S,T k}
[0091] Among them, p S (v i )and The Student and Teacher models are respectively i The probability distribution of the output; z l is the output logits of model l; T is the temperature coefficient, which is used to control the smoothness of the distribution after softening; α k is the weight coefficient of view k, which reflects its importance. By jointly optimizing the distillation loss L of all viewpoints D , the knowledge of the multimodal Teacher model can be compressed into a single Student model, so that only the Student model needs to be used in the inference stage, which can take into account both computational efficiency and the fusion of multi-view information. In practice, the Teacher model can use large-scale pre-trained models such as BERT, while the Student model can be designed as a lightweight neural network to achieve a balance between effect and efficiency. In addition, the knowledge in the Teacher model is complementary, and after fusion, the generalization performance of the Student model can be significantly improved.
[0092] In the meal execution feedback module 4, we record the user's response to the dish combination C recommended by the system j The subjective score F j And the change value of physiological indicators (such as blood sugar, blood pressure, etc.) before and after consumption ΔB j , and construct it into a feedback tuple (C j ,F j ,ΔB j ). Over time, we can get a series of feedback tuples Based on these feedback data, we designed a reward function R(C) for dish combination:
[0093]
[0094] Among them, H C represents the set of all historical feedback tuples that are highly similar to the candidate dish combination C, and α is a balance factor that weighs subjective scores and objective physiological indicators. The physical meaning of this reward function is that for a candidate dish combination C, if similar historical dish combinations can frequently obtain high user scores and do not cause significant fluctuations in user physiological indicators, then we give this dish combination a higher reward value; conversely, if similar historical combinations often only obtain lower user scores or cause significant deterioration of user physiological indicators, then we give it a lower reward value.
[0095] In the actual recommendation process, the intelligent dietary adjustment engine takes maximizing the cumulative reward as the optimization goal and continuously adjusts its generation strategy. Formally, the optimization problem can be expressed as:
[0096]
[0097] Among them, t is the recommendation round, C t is the set of dish combinations recommended in round t. Through this feedback-based reinforcement learning mechanism, the recommendation system can continuously optimize in the direction of satisfying the user's subjective preferences and helping to improve the user's health status, thus achieving adaptive updates of the recommendation strategy.
[0098] For example, suppose that in a certain recommendation, the system generates a dish combination for the user that includes "steamed egg, avocado salad, and whole wheat bread". After eating, the user gave the combination a high score of 4 stars for its taste and appearance, and his blood sugar level remained within the normal range. After the system captures this positive feedback signal, it will appropriately increase the reward value of the dish combination and increase its probability of appearing in subsequent recommendations accordingly. At the same time, if another combination that includes "braised pork, egg tarts, and milk tea" has been frequently rated low by users in multiple past recommendations and has caused a significant increase in the user's blood sugar and blood lipids, the system will significantly reduce its reward value and try to avoid this combination in subsequent recommendations. Through this continuous strategy improvement, the system can minimize potential health risks while respecting the user's subjective feelings.
[0099] The main function of the knowledge graph update module 5 is to expand and modify the original nutrition and health knowledge graph using the continuously accumulated user feedback data. One of the key update methods is to automatically discover the implicit food pairing rules from the massive feedback logs. Here we use the classic association rule mining algorithm.
[0100] Specifically, we first extract all the co-occurrence records of ingredients from the feedback log to form several ingredient combinations. Then, for each ingredient combination {v i ,v j}, we calculate two indicators: Support({v i ,v j}) and confidence The calculation formula of support is:
[0101]
[0102] Its physical meaning is that the combination of ingredients {v i ,v j The frequency of simultaneous occurrence of} in the historical feedback dish combination. The confidence calculation formula is:
[0103]
[0104] Its physical meaning is that in the combination of ingredients {v i ,v j}, and the average score is met in all historical dishes combinations Changes in higher and average physiological indicators Intuitively, if an ingredient combination has frequently aroused positive feedback from users in the past, we believe that the combination may contain some kind of ingredient combination pattern that is beneficial to health.
[0105] After obtaining the support and confidence of all ingredient combinations, we set a support threshold α and a confidence threshold β to filter out ingredient combinations that meet the following conditions:
[0106]
[0107] For the ingredient combination that meets the conditions, we add an ingredient v to the knowledge graph. i To ingredients j These newly discovered associations will be added to the original nutrition knowledge base in a timely manner, so that it can continue to absorb users' practical experience and improve the effectiveness of the knowledge base.
[0108] The hardware implementation of the intelligent dietary adjustment system of the present invention mainly includes a processor, a memory, a network interface and other peripheral devices. Among them, the processor is used to execute system software modules, such as data collection, knowledge graph construction, multimodal learning, cross-modal reasoning, etc.; the memory is used to store system software and various types of data, such as domain knowledge base, user health records, interaction logs, etc.; the network interface is used to support the system's data communication and service interface functions.
[0109] Specifically, the above processors can be general-purpose processors, such as CPU, microprocessor, microcontroller, DSP, FPGA, ASIC, etc.; or they can be special-purpose processors, such as GPU, TPU, NPU, etc. By adopting high-performance computing chips, the system can support the storage, representation learning and reasoning calculation of large-scale knowledge graphs. The memory can include internal memory and external memory. Among them, the internal memory can be a volatile memory such as SRAM, DRAM, etc., which is used for fast reading and writing of program code and data; the external memory can be a non-volatile memory such as a hard disk, U disk, CD, etc., which is used for persistent storage of programs, data and knowledge bases. The network interface can be an Ethernet card, WIFI module, Bluetooth module, etc., which supports data interaction between the system and external devices and service platforms.
[0110] When the system is working, the processor loads the program modules in the memory and collaborates to realize various intelligent service functions. For example, in the data collection stage, the processor obtains the user's health status data and dietary behavior data from multi-source heterogeneous terminals such as medical information systems and smart devices through the network interface, and stores it in the health record database in the memory. In the knowledge graph construction stage, the processor loads structured and unstructured data sources in the fields of nutrition, medicine, traditional Chinese medicine and diet from the memory, and uses natural language processing and knowledge extraction technology to build a heterogeneous knowledge graph covering thousands of nodes, and persists it in the graph database.
[0111] After entering the intelligent recommendation stage, core components such as the multi-perspective graph representation learning unit 31, the dish combination recommendation unit based on the graph attention network 32, the progressive logic comparison and conflict resolution unit 33, and the multimodal knowledge distillation unit 34 are successively loaded into the processor's instruction memory and data memory to collaboratively perform various computing tasks. Taking multi-perspective graph representation learning as an example, the processor first reads the multi-perspective association data of the ingredients from the graph database and sends it to the graph attention network for representation learning. The learned ingredient embedding vector will be written back to the memory for subsequent reasoning calculations. For example, when recommending dish combinations, the processor successively performs a series of calculations such as attention aggregation, nutritional balance analysis, and conflict rule reasoning. The intermediate results are frequently exchanged between internal and external memories, and the final output dietary plan will also be returned to the user terminal through the network interface.
[0112] In the background of the system, the processor will also regularly call up the dietary execution feedback module 4 and the knowledge graph update module 5, incrementally read the user's interactive feedback log from the persistent storage, use the reinforcement learning algorithm to timely calibrate the recommendation strategy, and discover new dish matching rules through association rule mining and other technologies to expand the knowledge graph. Throughout the process, hardware devices such as processors, memory, and network interfaces work closely with software modules such as data collection, knowledge graph construction, intelligent recommendation, and strategy iteration, and support each other, forming an efficient, flexible, and sustainable intelligent dietary adjustment system.
[0113] It should be pointed out that the division and configuration of the above hardware modules are not the only implementation methods. In actual products, hardware specifications such as processors and memory can be flexibly adjusted according to specific application scenarios and performance requirements, or a highly available and highly scalable distributed cluster architecture can be adopted.
[0114] Example 2
[0115] See also Figure 3 The present invention also provides an intelligent dietary adjustment method based on a knowledge graph, comprising the following steps:
[0116] Step 1. Knowledge graph construction: Using natural language processing technology, extract knowledge in the fields of nutrition, medicine, and Chinese medicine from structured and unstructured data sources to construct a multi-source heterogeneous knowledge graph;
[0117] Step 2. Health status analysis: Map user health data to entities and associations in the knowledge graph through the health status ontology to build a personal health knowledge graph;
[0118] Step 3. Dietary adjustment generation:
[0119] Step 3.1. Multi-perspective ingredient representation learning: From multiple perspectives such as nutrition, pharmacology, taboos, and taste, a heterogeneous graph attention network algorithm is used to learn low-dimensional embedding representations of ingredients;
[0120] Step 3.2. Graph attention dish combination recommendation: Use the graph attention network to construct a dish combination embedding representation, and combine it with nutritional balance constraints to generate three meals a day dish recommendations;
[0121] Step 3.3. Logical comparison and conflict resolution: Detect and eliminate potential conflicts in dish combinations through logical reasoning of the knowledge graph, and introduce a soft rule loss function penalty model;
[0122] Step 3.4. Multimodal knowledge distillation: The multi-perspective food embedding representations are integrated into a unified Student network through knowledge distillation technology, taking into account both reasoning efficiency and multimodal balance;
[0123] Step 4. Feedback learning: Collect users’ ratings of recommended dishes and feedback on changes in physiological indicators, construct a reward function as a supervisory signal for the graph network, and guide the dynamic adjustment of the recommendation strategy;
[0124] Step 5. Knowledge graph update: mine user feedback logs, add frequently co-occurring ingredient combinations based on association rule learning, learn users’ implicit taste preferences through matrix decomposition, and continuously expand the knowledge graph.
[0125] Compared with the prior art, the main advantages of the present invention include:
[0126] (1) The knowledge dimension is more comprehensive. It integrates knowledge from multiple fields such as nutrition, traditional Chinese medicine pharmacology, and culinary taste, and can achieve balanced optimization of nutrition, taste, and health;
[0127] (2) User modeling is more accurate. Through semantic health status portraits combined with dietary behavior feedback data, users’ health characteristics and preference characteristics can be fully understood;
[0128] (3) The recommendation method is smarter. It uses cutting-edge artificial intelligence models such as graph neural networks, attention mechanisms, and multi-task learning. The recommendation process is highly interpretable and has outstanding generalization capabilities.
[0129] (4) The system design is more open. The introduction of a continuous knowledge graph update mechanism can adapt to the dynamic changes of the external environment and user preferences, and realize the open evolution of the intelligent system.
[0130] It should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A dietary adjustment system based on knowledge graph, characterized in that: The system includes: a multi-source heterogeneous knowledge graph construction module, a user health status analysis module, an intelligent diet adjustment engine, a diet execution feedback module and a knowledge graph update module; The multi-source heterogeneous knowledge graph construction module is used to construct a heterogeneous knowledge graph containing cross-domain knowledge of nutrition, medicine, and Chinese medicine diet therapy; The user health status analysis module is used to map user health data into entities and associations in the knowledge graph to construct a personal health knowledge graph; The intelligent dietary adjustment engine includes: a graph representation learning unit integrating multiple perspectives, a dish combination recommendation unit based on a graph attention network, a progressive logic comparison and conflict resolution unit, and a multimodal knowledge distillation unit; the intelligent dietary adjustment engine is used to combine the heterogeneous knowledge graph and the personal health knowledge graph to generate a personalized dietary plan through graph representation learning, graph attention combination recommendation, logical reasoning, and multimodal distillation; The meal execution feedback module is used to collect multi-dimensional feedback data of users on the recommended meals and guide the dynamic adjustment of the recommendation strategy; The knowledge graph update module is used to mine user feedback logs, learn new collocation combinations and user preferences, and continuously expand the knowledge graph.
2. The system according to claim 1, characterized in that The multi-view graph representation learning unit is used to learn low-dimensional embedding representation of ingredients from multiple perspectives such as nutrition, pharmacology, taboos, and taste using a heterogeneous graph attention network algorithm; The graph attention dish combination recommendation unit is used to construct a dish combination embedding representation using a graph attention network, and generate three meals a day dish recommendations in combination with a nutritional balance constraint; The progressive logic comparison and conflict resolution unit is used to detect and eliminate potential conflicts in dish combinations through logical reasoning of the knowledge graph, and introduce a soft rule loss function penalty model; The multimodal knowledge distillation unit is used to integrate the multi-perspective food embedding representations into a unified Student network through knowledge distillation technology, taking into account both reasoning efficiency and multimodal balance.
3. The system according to claim 2, characterized in that The heterogeneous graph attention network algorithm embeds the food node i under the perspective k The calculation formula is: in, is the set of neighbor nodes of node i under relationship r; is the transformation matrix of relation r under view k; a is the attention vector; σ is the activation function, and is the parameter matrix under perspective k, σ is the nonlinear activation function; R is the set of relationship types; || represents the concatenation operation.
4. The system according to claim 3, characterized in that The calculation process of the graph attention dish combination recommendation unit is as follows: for the ingredients {v1, v2, …, v n }, its embedding representation is e C for: Among them, β i is the attention weight of ingredient i on dish C; W and a are the parameter matrix and vector of the attention network. At the same time, the recommended dish combination must meet the nutritional balance constraint: Among them, C b is the set of dishes in meal period b; Nutr(C j ) for dish C j The nutritional content of each ingredient; Req is the recommended daily intake.
5. The system according to claim 4, characterized in that The progressive logic comparison and conflict resolution unit is based on the knowledge graph G and the personal health knowledge graph G P , for candidate dish combination C j To perform conflict detection: Among them, R(C j ,G) is C j The corresponding relationship set of the ingredients in the graph G; ⊥ indicates the logical conflict between the two relationships; by introducing the soft rule loss function L R Penalize the model: Among them, f is the scoring function embedded in the knowledge graph; γ is the penalty term coefficient; y i ,i′ is a conflict indicator variable, through back propagation L R , so that the model gradually reduces logical conflicts.
6. The system according to claim 2, characterized in that The Student network loss function is the KL divergence of the Teacher network output and the Student network output: p l (v i )=softmax(z l (v i ) / T),l∈{S,T k } Among them, p S (v i )and The Student and Teacher models are respectively i The probability distribution of the output; z l For network l to food v i The output of; T is the temperature coefficient, which is used to control the smoothness of the distribution after softening; α k is the weight coefficient of perspective k, which reflects its importance; p l It is the probability distribution after softmax normalization. The final learned Student network is used independently in the inference stage, taking into account both efficiency and multimodal fusion.
7. The system according to claim 1, characterized in that The meal execution feedback module calculates the user's score for the recommended dish. j and changes in physiological indicators ΔB j Constructed as a feedback tuple (F j ,ΔB j ), multiple feedback tuples are aggregated into an ordered set {F t }, and integrated into the reward function: Among them, α is the balancing factor, the reward function is used as the supervision signal of the graph network, and the optimization goal is to maximize the cumulative reward:
8. The system according to claim 1, characterized in that The knowledge graph update module expands knowledge in the following ways: (1) Frequently co-occurring food combinations i ,v j } If it can evoke positive feedback, add it as a new edge i,j : Among them, Support({v i ,v j }) is the ingredient combination {v i ,v j } support; The confidence level of evoking positive feedback for this ingredient combination; α and β are the thresholds of support and confidence; (2) Decompose the user-dish-feedback matrix M: M = U∑V T , get the user's implicit preference vector u i and the implicit feature vector v of the dish j , the inner product of the two as the preference edge weight of user i for dish j.
9. An intelligent dietary adjustment method based on the system according to any one of claims 1 to 8, characterized in that: The following steps are involved: Step 1. Knowledge graph construction: Using natural language processing technology, extract knowledge in the fields of nutrition, medicine, and Chinese medicine diet therapy from structured and unstructured data sources to construct a multi-source heterogeneous knowledge graph; Step 2. Health status analysis: Map user health data to entities and associations in the knowledge graph through the health status ontology to build a personal health knowledge graph; Step 3. Dietary adjustment generation: Step 3.
1. Multi-perspective ingredient representation learning: From the perspectives of nutrition, pharmacology, taboos, and taste, a heterogeneous graph attention network algorithm is used to learn low-dimensional embedding representations of ingredients; Step 3.
2. Graph attention dish combination recommendation: Use the graph attention network to construct a dish combination embedding representation, and combine it with nutritional balance constraints to generate three meals a day dish recommendations; Step 3.
3. Logical comparison and conflict resolution: Detect and eliminate potential conflicts in dish combinations through logical reasoning of the knowledge graph, and introduce a soft rule loss function penalty model; Step 3.
4. Multimodal knowledge distillation: The multi-perspective food embedding representations are integrated into a unified Student network through knowledge distillation technology, taking into account both reasoning efficiency and multimodal balance; Step 4. Feedback learning: Collect users’ ratings of recommended dishes and feedback on changes in physiological indicators, construct a reward function as a supervisory signal for the graph network, and guide the dynamic adjustment of the recommendation strategy; Step 5. Knowledge graph update: mine user feedback logs, add frequently co-occurring ingredient combinations based on association rule learning, learn users’ implicit taste preferences through matrix decomposition, and continuously expand the knowledge graph.
Citation Information
Cited By
Dietary management system and method based on unmanned cooker
CN119851874A
Task scheduling optimization and feedback control method and system based on causal graph structure
CN120494060A
