Personalized recipe recommendation system, recommendation method and interaction system
Through a personalized recipe recommendation system, combined with multi-objective optimization algorithm, particle swarm optimization algorithm and collaborative filtering algorithm, the problem that the existing technology fails to fully consider the user's dietary history and health status is solved, and personalized and nutritionally balanced recipe recommendations are achieved.
Patent Information
- Application Number
- CN202510870173.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-10-17
AI Technical Summary
Existing diet recommendation technologies fail to fully consider the user's dietary history, health status and individual differences, resulting in the recommended diet plan being unable to fully adapt to the user's actual situation.
A personalized recipe recommendation system is provided, which includes a user data collection module, a food image recognition module and a personalized recommendation module. By obtaining the user's health data, dietary preference data and food photos, it uses a multi-objective optimization algorithm, a particle swarm optimization algorithm and a collaborative filtering algorithm, combined with a multimodal large model to recommend recipes.
It provides more suitable and personalized recipe recommendations based on the user's dietary history, health status and individual differences, ensuring nutritional balance and meeting health needs.
Smart Images

Figure CN120809081A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of diet recommendation, in particular to a personalized recipe recommendation system, a recommendation method and an interaction system. BACKGROUND
[0002] With the rapid development of China's economy, people's living standards have improved significantly, and living conditions have improved continuously. Diet has shifted to nutrition, and demand has become more personalized and diversified. People gradually shift to pursuing nutritional balance and health. However, during this transition, the irrational adjustment of the dietary structure has led to a high incidence of chronic diseases, such as obesity, hypertension, diabetes, and dyslipidemia. Studies have shown that the occurrence of chronic diseases is closely related to long-term irrational eating habits. For example, excessive caloric intake can lead to obesity, excessive salt intake can increase the risk of hypertension, and excessive sugar and fat intake can lead to diabetes and dyslipidemia. Therefore, a reasonable diet and balanced nutrition are crucial, not only to maintain normal metabolism and enhance immune function, but also to effectively prevent chronic diseases, improve health levels, and reduce medical costs.
[0003] Currently, there are many diet recommendation technologies that can recommend diets for users. In order to provide personalized diet recommendations for users, these diet recommendation technologies usually collect basic information of users, such as age, gender, height, weight, etc., and make appropriate diet recommendations based on this. However, the current diet recommendation technology has the following limitations in user information collection: (1) Ignoring dietary history and health status: Most diet recommendation technologies fail to effectively collect users' past dietary history and health status, which are crucial for accurately assessing user needs; (2) Not fully considering individual differences: Individual dietary preferences, special needs (such as food allergies), and regional differences are often not fully considered, resulting in recommended dietary plans that may not fully adapt to users' actual situations. SUMMARY
[0004] The purpose of the present application is to provide a personalized recipe recommendation system, a recommendation method and an interaction system, which can recommend more suitable and personalized recipes for users.
[0005] To achieve the above-mentioned purpose, the present application provides the following solutions:
[0006] In a first aspect, the present application provides a personalized recipe recommendation system, which comprises a user data collection module, a food image recognition module and a personalized recommendation module.
[0007] The user data collection module is used to obtain health data and dietary preference data of a user, the health data includes basic information, health status and exercise habits, the basic information includes region, the health status includes allergen list, chronic disease and dietary goal;
[0008] The food image recognition module is configured to acquire a food photo uploaded by a user and recognize the food photo to obtain a food recognition result, the food recognition result including a food category corresponding to the food photo.
[0009] The personalized recommendation module is connected to the user data collection module and the food image recognition module respectively, and is configured to determine a recommended recipe for recommendation to the user based on the health data, the dietary preference data and the food recognition result.
[0010] In a second aspect, the present application provides a personalized recipe recommendation method applied to the personalized recipe recommendation system, and the personalized recipe recommendation method comprises the following steps:
[0011] acquiring health data and dietary preference data of a user, the health data including basic information, health conditions and exercise habits, the basic information including a region, the health conditions including an allergen list, chronic diseases and dietary goals;
[0012] acquiring a food photo uploaded by a user and recognizing the food photo to obtain a food recognition result, the food recognition result including a food category corresponding to the food photo;
[0013] determining a recommended recipe for recommendation to the user based on the health data, the dietary preference data and the food recognition result.
[0014] In a third aspect, the present application provides a personalized recipe interaction system, which comprises a client and a background server, and the background server comprises the personalized recipe recommendation system.
[0015] The client is configured to acquire health data and dietary preference data input by a user and transmit the health data and the dietary preference data to the background server in an encrypted manner, the background server being configured to bind the health data and the dietary preference data to a user ID and store them in a user data record database, and a user data collection module in the background server being configured to acquire health data and dietary preference data of a user from the user data record database.
[0016] The client is used to obtain an initial food photo uploaded by a user, pre-process the initial food photo to obtain a food photo, and transmit the food photo to the background server. The food image recognition module in the background server is used to identify the food photo to obtain an initial food recognition result, and transmit the initial food recognition result to the client. The client is used to show the initial food recognition result to the user, adjust the initial food recognition result based on user input to obtain a food recognition result, and transmit the food recognition result to the background server. The background server is used to bind the food photo and the food recognition result with a user ID, and store them in a user diet record database. The food image recognition module in the background server is used to obtain a food recognition result from the user diet record database.
[0017] The personalized recommendation module in the background server is used to determine a recommended recipe for recommendation to the user based on the health data, the diet preference data, and the food recognition result.
[0018] According to the specific embodiments provided in the present application, the present application has the following technical effects:
[0019] The present application provides a personalized recipe recommendation system, a recommendation method, and an interaction system, which include a user data collection module, a food image recognition module, and a personalized recommendation module. The user data collection module is used to obtain health data and diet preference data of a user. The health data includes basic information, health conditions, and exercise habits. The basic information includes a region. The health conditions include an allergen list, chronic diseases, and a diet target. The food image recognition module is used to obtain a food photo uploaded by the user, and identify the food photo to obtain a food recognition result. The food recognition result includes a food category corresponding to the food photo. The personalized recommendation module is used to determine a recommended recipe for recommendation to the user based on the health data, the diet preference data, and the food recognition result. When the recipe is recommended, the present application can fully consider the diet history (i.e., the food category obtained by identifying the food photo uploaded by the user), the health conditions (including the allergen list, the chronic diseases, and the diet target), the diet preference data, and the region of the user. By considering more comprehensive influencing factors, the present application can recommend a more suitable and personalized recipe for the user. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort.
[0021] Figure 1 A flowchart of a personalized recipe recommendation method provided in Embodiment 2 of the present application. DETAILED DESCRIPTION
[0022] The technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0023] Embodiment 1
[0024] The embodiment provides a personalized recipe recommendation system, which comprises a user data collection module, a food image recognition module and a personalized recommendation module.
[0025] The user data collection module is used to obtain health data and dietary preference data of a user, the health data comprises basic information, health condition and exercise habit, the basic information comprises a region, different regions have taste differences, so that the region to which the user belongs is determined, and the taste preference of the user can be preliminarily determined, the basic information can further comprise age, gender, height, weight and body mass index (BMI index, which is a commonly used index for measuring the fatness and health of a human body), the health condition comprises an allergen list, a chronic disease and a dietary goal, the allergen list comprises allergens of the user, such as peanuts, shrimps and the like, the chronic disease is a chronic disease suffered by the user, such as hypertension, diabetes and the like, the dietary goal can comprise at least one of fat reduction, muscle gain and balanced diet, for example, the daily calorie of the fat reduction is controlled at 1800 kcal, the protein intake of the muscle gain is 100 grams, and the exercise habit comprises exercise intensity, which is divided into three levels of low, medium and high, can be manually selected by the user, or the daily steps of the user can be obtained through WeChat exercise synchronization, and the exercise intensity is determined based on the daily steps, and the dietary preference data comprises taste preference and taboo food materials, the taste preference is a taste preferred by the user, such as Sichuan cuisine, Cantonese cuisine and the like, or sweet, spicy, salty and the like, and the taboo food materials are food materials that cannot be accepted by the user, such as pork, beef and the like.
[0026] When the exercise intensity is determined based on the daily steps, the specific process comprises:
[0027] (1) Exercise intensity model based on daily steps
[0028] The exercise intensity model takes the total number of WeChat steps of a user in a day (i.e., daily steps) as the only input, and maps the daily steps to the exercise intensity indicator MET (Metabolic Equivalent of Task) - minutes (MET-min for short) through reasonable assumptions, which can quantify the physical effort consumed by daily walking, thereby classifying the exercise intensity.
[0029] The reasonable assumptions are: average stride L = 0.70 meters / step, average walking speed v = 1.2 meters / second, and the metabolic equivalent MET corresponding to walking is the intermediate value 3.3. After substituting the above reasonable assumptions, the linear relationship between MET-min and daily steps can be obtained:
[0030]
[0031] wherein MET-min (S) is the exercise intensity indicator, S is the daily steps; and k1 is the conversion coefficient.
[0032] (2) Intensity classification
[0033] According to the standard of 500-1000 MET-min per week recommended by the World Health Organization (WHO) and the American Heart Association (AHA), it can be converted to daily, and the exercise intensity can be classified according to Table 1.
[0034] Table 1 Exercise intensity classification standard
[0035]
[0036]
[0037] If the number of WeChat steps S = 8000 steps in a day, then [S = 8000, MET-min (S) = 0.0321 x 8000 ≈ 256.8], which corresponds to moderate intensity.
[0038] The food image recognition module is configured to obtain a food photo uploaded by a user and recognize the food photo to obtain a food recognition result, which includes a food category corresponding to the food photo. In the aspect of recognizing the food photo to obtain the food recognition result, the food image recognition module is configured to take the food photo as input, recognize the food photo by using a multi-modal large model, and obtain the food recognition result. The food recognition result further includes a nutritional component and a serving size corresponding to the food photo. The multi-modal large model can be any existing multi-modal large model, such as a GLM-4V series model, a FLAMINGO model, a BLIP-2 model, and the like. Taking the GLM-4V series model as an example, the GLM-4V series model is based on pre-trained visual-linguistic joint encoding capability to analyze image content, recognize food categories (such as “stewed pork” and “broccoli with shrimp”) and their nutritional components (including calories, such as about 500 kcal per 100 g of stewed pork; protein, such as about 20 g per 100 g of chicken breast; fat, carbohydrates, and trace elements such as vitamin C content), and estimate serving sizes (such as about 150 g by image proportion).
[0039] The personalized recommendation module is connected to the user data collection module and the food image recognition module, respectively. The personalized recommendation module is configured to determine a recommended recipe for recommendation to a user based on health data, dietary preference data, and a food recognition result. In the aspect of determining the recommended recipe for recommendation to the user based on the health data, the dietary preference data, and the food recognition result, the personalized recommendation module is configured to take the health data, the dietary preference data, and the food recognition result as input, and combine a multi-objective optimization algorithm, a particle swarm optimization algorithm, and a collaborative filtering algorithm to determine the recommended recipe for recommendation to the user.
[0040] In the following, the three algorithms are described in detail.
[0041] (1) Multi-objective optimization algorithm
[0042] According to the dietary goals and nutritional needs of the user, multiple target variables are optimized. For example, if the dietary goal of the user is to reduce fat, the upper limit of daily calories is set to 1800 kcal, while ensuring that the protein intake is not less than 60 g. If the dietary goal of the user is a balanced diet, the ratio of carbohydrates, protein, and fat is optimized to be close to 4:3:3. At the same time, the constraint conditions are considered, such as excluding allergens (such as peanuts), and a recipe (including a combination of ingredients and the amount of each ingredient used) that meets the constraint conditions is generated.
[0043] The linear programming (LP) method is used to define the objective function including minimizing the heat value, maximizing the key nutrient standard rate and minimizing the key nutrient deviation, the constraint conditions including the heat range, the key nutrient lower limit, the allergen exclusion, the macro-nutrient heat proportion and the seasonal availability, the optimal solution is calculated by the solver (such as the SciPy library of Python), and the first recommended recipe is output.
[0044] (1) Decision variable:
[0045] Let y i represent whether the i-th recipe (dish) is selected, y i ∈{0,1}, when selected, y i =1, when not selected, y i =0, which is the decision variable, x ij represents the usage amount of the j-th food material in the i-th recipe (the usage amount of each food material in the i-th recipe can be determined when the i-th recipe is 500g / portion, if the i-th recipe is not 500g / portion, then the usage amount of each food material in the i-th recipe can be determined in proportion), which is a known value.
[0046] (2) Objective function:
[0047] 1) Minimize the heat value:
[0048]
[0049] Wherein, f1 is the first target, that is, the heat value; J is the total number of recipes; N is the total number of food materials; h i is the heat ratio (KJ / g) of the i-th recipe.
[0050] 2) Maximize the key nutrient standard rate:
[0051]
[0052] Wherein, f2 is the second target, that is, the key nutrient standard rate; P k,i is the proportion of the k-th key nutrient in the i-th recipe, the key nutrients including carbohydrates, proteins and fats; T k is the expected content of the k-th key nutrient.
[0053] 3) Minimize the key nutrient deviation, to minimize the deviation between the actual content and the expected content of the key nutrients in the first recommended recipe:
[0054]
[0055] where f3 is the third objective, i.e., key nutrient bias; c, p, f are the actual contents of carbohydrates, proteins, and fats, respectively k is the actual content of the kth key nutrient, r c , p , f are the expected contents of carbohydrates, proteins, and fats, respectively. k is the expected content of the kth key nutrient, c , p , f are the expected contents of carbohydrates, proteins, and fats, respectively.
[0056] After converting the maximization objective into a minimization form, the objective function can be expressed as: min [f1, -f2, f3] T .
[0057] (3) Constraint conditions:
[0058] 1) Calorie range:
[0059]
[0060] where L and U are the lower and upper limits of calories, respectively, which are set according to the user's energy requirements and are determined based on the dietary goals.
[0061] 2) Key nutrient lower limit:
[0062]
[0063] 3) Allergen exclusion:
[0064] If allergic to the kth food material,
[0065]
[0066] where A is the set of food materials to which the user is allergic, determined based on the allergen list.
[0067] 4) Macro-nutrient calorie proportion:
[0068]
[0069] where c j , p j , f j are the proportions of carbohydrates, proteins, and fats in the jth food material, respectively.
[0070] The constraint condition is:
[0071] 0.45 ≤ c j ≤ 0.65;
[0072] 0.10≤p j ≤0.35;
[0073] 0.20≤f j ≤0.35;
[0074] wherein, c j , p j , f j upper and lower limits are determined based on dietary goals and chronic diseases.
[0075] 5) Seasonal availability:
[0076]
[0077] wherein, SeasonOff is the set of food materials that are not available in the current season.
[0078] (4) The final recommended recipe is given according to the recommendation degree of each recipe provided by reinforcement learning, and the first recommended recipe is obtained:
[0079] y i =1 represents the recipe obtained by multi-objective optimization screening, and the recipe whose recommendation degree is in the top M (in descending order) is selected from the recipe whose y i =1 as the recommended recipe, and the first recommended recipe is obtained, and M can be determined according to user demand.
[0080] For example, if M is 1, which means that one recommended recipe is selected at this time, and the formula is as follows:
[0081] i * =arg max r i i∈P;
[0082] wherein, i * represents the recipe with the highest recommendation degree, that is, the recommended recipe; r i is the recommendation degree of the i-th recipe; P={i|y i =1} represents the set of recipes obtained by multi-objective optimization screening.
[0083] According to the above multi-objective optimization algorithm, the first recommended recipe is obtained.
[0084] (II) Particle Swarm Optimization (PSO) algorithm
[0085] Find the optimal solution of the recipe in the multi-dimensional target space, balance the nutritional balance, calorie control and user preferences. For example, the user prefers Sichuan cuisine and needs low calories, and will prefer "Mapo Tofu (less oil version) + cucumber salad" to high-calorie options. The PSO algorithm optimizes through group cooperation to ensure that the recommended results meet the health needs and are in line with the taste.
[0086] Initialize 50 (which can be replaced by other values, according to user needs) particles, each containing a position vector (i.e. recipe, including food material combination and usage amount of each food material, such as "chicken breast 100g + rice 50g") and a speed vector, each recipe only has selected and not selected, so the element value of the position vector can only be 0 or 1, that is, the position vector x j = [x j1 ,x j2 ,x j3 …,x jJ ] is a binary vector, x jJ is a binary variable representing whether the jth particle selects the Jth recipe, J is the total number of recipes, and if x jJ = 1, it means that the jth particle selects the Jth recipe, and the speed vector v j = [v j1 ,v j2 ,v j3 …,v jJ ], v jJ is the probability of the jth particle selecting the Jth recipe. In the first iteration, the speed vector is initialized, usually randomly initialized to [-4, 4], so that sigmoid(v j ) covers the [0.02, 0.98] probability interval.
[0087] (1) Fitness function:
[0088]
[0089] where f(x j ) is the fitness of the jth particle; is the nutritional deviation, and k is from 1 to 4 because protein, calories, vitamin A, and vitamin B are taken as nutrients, ∑x ji ·n ji,k ·500 is the sum of i, n ji,k is the content of the kth nutrient contained in the ith recipe of the jth particle, and multiplying 500 sets the weight of each dish (prepared based on the ith recipe of the jth particle) to 500g, T k is the expected intake of the kth nutrient, based on chronic disease determination; α|∑x ji -K| is the recipe quantity constraint condition, α is the first weight, α is 1000, K is the expected number of recipes; μ·max(0,(∑xji ·s z 2 is the user's dietary preference constraint, μ is a second weight, μ takes 8.9, ∑x ji ·s z is the sum of z, s z is the zth information amount, such as the specific amount of salt, sugar, S is the target value of the constraint, which is determined according to the user's demand; ε∑x ji r i is a recommendation degree constraint, which is determined based on the recommendation degree of each recipe given by reinforcement learning, ε is a third weight, ε = -1, r i is the recommendation degree of the ith recipe.
[0090] (2) Iterative update:
[0091] The iterative update formula is:
[0092] v ji t+1 = wv ji t + c1r1(p j t -sigmoid(v ji t ))+ c2r2(g t -sigmoid(v ji t ));
[0093] wherein, v ji t+1 is the probability of the jth particle selecting the ith recipe at the t+1th iteration; w is the inertia weight, which is initially set to 0.8 and decreases to 0.4 with iteration; v ji t is the probability of the jth particle selecting the ith recipe at the tth iteration; c1 is the first learning factor, which can be fixed to 2; r1 is the first random number, which can be generated in the interval [0, 1]; p j t is the optimal position of the jth particle at the tth iteration; c2 is the second learning factor, which can be fixed to 2; r2 is the second random number, which can be generated in the interval [0, 1]; g t is the optimal position of all particles at the tth iteration.
[0094] The speed is mapped to probability through the sigmoid function, which is used for binaryzation:
[0095]
[0096] wherein, rand() represents a random number.
[0097] By constantly updating the velocity vector and position vector of the particles, the optimal solution is finally found, and the second recommended recipe is obtained, realizing the recipe recommendation most consistent with the user's nutritional needs.
[0098] (III) Collaborative filtering algorithm
[0099] Based on the user's historical ratings (the user's ratings on the uploaded recipe photos), similar users are determined, and based on the similar user preferences, recipes that meet the user's taste are recommended. For example, if the user prefers spicy and sour taste and the similar user scores higher for "spicy and sour shredded potato" in the library, this recipe will be recommended first, ensuring that the recommended results are more personalized and attractive.
[0100] From the user's historical ratings (such as "red cooked pork" rated 4 points, "steamed fish" rated 5 points) and check-in records (i.e. food photos uploaded by the user), a user-recipe rating matrix is constructed, and the similarity between users is calculated:
[0101]
[0102] Where s(u,v) represents the similarity between user u and user v, which is an unknown quantity to be calculated; I is the set of recipes, which is known data that can be extracted from the food photos uploaded by the user; r (u,i) is the rating of recipe i by user u, r (v,i) is the rating of recipe i by user v, both of which are known data that can be extracted from the user's ratings on the uploaded food photos; and are the average ratings calculated by user u and user v based on their respective ratings, is the average value of the ratings of each recipe in the set of recipes by user u, is the average value of the ratings of each recipe in the set of recipes by user v.
[0103] If the similarity exceeds 0.7, user v is considered a similar user of user u, and the similar user's high-rated recipes are used to filter the first recommended recipe and the second recommended recipe to generate the final recommended recipe.
[0104] Through the multi-objective optimization algorithm, the nutritional scientificity is ensured, through the particle swarm optimization algorithm, the personalized demand is balanced, and through the collaborative filtering algorithm, the taste matching degree is improved, and finally the recommended recipe that meets the user's health and preferences is generated.
[0105] At this time, in this embodiment, the health data, dietary preference data and food recognition results are taken as inputs, and the multi-objective optimization algorithm, particle swarm optimization algorithm and collaborative filtering algorithm are combined to determine the recommended recipe recommended to the user, specifically including:
[0106] (1) determining the objective function and constraint condition of the multi-objective optimization algorithm and the fitness function of the particle swarm optimization algorithm based on the health data and the diet preference data, and determining the first recommended recipe by using the multi-objective optimization algorithm and determining the second recommended recipe by using the particle swarm optimization algorithm.
[0107] (2) determining the similar users of the user by using the collaborative filtering algorithm with the food recognition result as input.
[0108] The similar users of the user are determined by using the collaborative filtering algorithm with the food recognition result as input, and specifically includes: for each candidate user, the similarity between the user and the candidate user is calculated by using the food recognition result as input, and all candidate users are screened based on the similarity to determine the similar users of the user.
[0109] The calculation formula of the similarity is:
[0110]
[0111] Wherein, s(u,v) is the similarity between the user u and the user v; I is the recipe set; r (i,i) is the score of the recipe i given by the user u; is the average value of the score of each recipe in the recipe set given by the user u; r (v,i) is the score of the recipe i given by the user v; is the average value of the score of each recipe in the recipe set given by the user v.
[0112] The similar users of the user are determined by screening all candidate users based on the similarity, and specifically includes: selecting the candidate users with a similarity greater than a preset similarity (such as 0.7) as the similar users of the user.
[0113] (3) screening the first recommended recipe and the second recommended recipe based on the recommended recipes of the similar users to obtain the recommended recipe recommended to the user.
[0114] The similar users of the user are determined by screening all candidate users based on the similarity, and specifically includes: selecting the candidate users with a similarity greater than a preset similarity (such as 0.7) as the similar users of the user.
[0115] The personalized recipe recommendation system of the embodiment further includes a dynamic adjustment module.
[0116] The food image recognition module is configured to acquire a target food photo uploaded by a user and feedback of the user on the target food photo, and recognize the target food photo to obtain a food category, nutritional components and serving size corresponding to the target food photo. The target food photo is a photo of food prepared by the user based on a recommended recipe. It should be noted that the target food photo belongs to a kind of food photos.
[0117] The dynamic adjustment module is connected with the food image recognition module and the personalized recommendation module respectively. The dynamic adjustment module is configured to determine a recommendation degree of each recipe based on the feedback of the user on the target food photo by using a reinforcement learning algorithm (such as Q-learning), and adjust an optimization result of the multi-objective optimization algorithm and parameters in a fitness function of the particle swarm optimization algorithm based on the recommendation degree of each recipe. The adjustment of the optimization result of the multi-objective optimization algorithm refers to screening the optimization result P of the multi-objective optimization algorithm to obtain a first recommended recipe. The adjustment of the parameters in the fitness function of the particle swarm optimization algorithm refers to adjusting r i .
[0118] The specific process of the reinforcement learning algorithm is as follows:
[0119] (1) Definition:
[0120] In the reinforcement learning framework, the state is the health data of the user, and the action is the recommended recipe.
[0121] 1) State: height, weight, body mass index (BMI), body fat rate and exercise intensity.
[0122] 2) Action: recommended recipe.
[0123] 3) Reward:
[0124] The design of the reward needs to consider both the satisfaction of the user on the recommended recipe and the change of the health index (such as the BMI index) of the user.
[0125] After the user is fed back the recommended recipe, the user will score the food prepared based on the recommended recipe on that day to obtain a user score. The user score (such as 1 star to 5 stars) reflects the satisfaction of the user on the food on that day, and a high user score indicates that the user is more satisfied with the recommended recipe.
[0126] r user = star_rating;
[0127] Wherein, r user is the feedback reward of the user; and star_rating is the user score.
[0128] The health reward is based on the change of the health index of the user, and the health index includes the BMI and the body fat rate body_fat.
[0129] r health =∑ m∈{BMI,body_fat} w m *ΔG mt ;
[0130] Among them, r health Reward for health; m is the weight coefficient of the mth health indicator (can be 0.5); ΔG mt =G mt -G mt-1 The actual value of the mth health indicator and the target value of the mth health indicator from time step t-1 to t are tar get m The change in the difference (obtained from the user database), e.g., ΔG BMIt =(target BMI -m t )-(target BMI -m t-1 ), target BMI is the target value of health indicator BMI, m t is the actual value of the health indicator BMI at time step t, m t-1 is the actual value of the health indicator BMI at time step t-1.
[0131] Positive ΔG mt Indicates that health indicators have improved (such as BMI reduction), so the health reward is positive; negative ΔG mt Indicates that the health indicator deteriorates, so the health bonus is negative.
[0132] To prevent highly recommended recipes from being recommended repeatedly, a new recipe diversity bonus has been added to occasionally recommend recipes with lower recommendation levels:
[0133]
[0134] Among them, r diversity Bonus points for recipe diversity.
[0135] The final reward r t It is the weighted sum of user feedback reward, health reward and recipe diversity reward:
[0136] r t =α*r user +β*r health +γ*r diversity ;
[0137] Among them, α, β, and γ are all weight coefficients, which determine the relative importance of user feedback rewards, health rewards, and recipe diversity rewards in the rewards.
[0138] In the early stage, when health indicators are more important, β can be set to be larger than α. Here, it can be defined that α = 0.3, β = 0.6, and γ = 0.1.
[0139] (2) Strategy Optimization and Q Learning:
[0140] The iterative process of the Q-value function is:
[0141] 1) Q value function initialization:
[0142] The Q value of all recipes is initialized to 50:
[0143] Q init (s,a)=50;
[0144] Among them, Q init (s,a) is the Q-value of choosing action a (including each recipe in J recipes) in state s.
[0145] 2) Interact with the environment to get rewards:
[0146] In state s t Select a recommended recipe t , calculate the reward r t , and enters state s t+1 It should be noted that, unlike traditional reinforcement learning algorithms, this embodiment does not rely on the state s t Select a recommended recipe t , recommended recipe a t The recommended recipe is determined by multi-objective optimization algorithm, particle swarm optimization algorithm and collaborative filtering algorithm.
[0147] 3) Q-value function update:
[0148]
[0149] Among them, Q1(s t ,a t ) is in state s t Next, select Recommended Recipe a t The updated Q value; Q(s t ,a t ) is in state s t Next, select Recommended Recipe a t Q value; α is the learning rate, which determines the amplitude of Q value update. Here, α is set to 0.15 to obtain a more stable learning process and reduce noise interference; r t is the reward; γ is the discount factor, which determines the weight of future rewards. Here, γ = 0.95 is set to focus more on future rewards. For state s t+1Next, the maximum value of the Q value of each recipe a is selected.
[0150] It should be noted that if the recipe a is not selected as the recommended recipe a this time t , the Q value of the recipe a will not be updated, and only the Q value of the recommended recipe a t will be updated.
[0151] Among them, The calculation process is as follows:
[0152] The Q value function in different states is predicted, and the Q value function is fine-tuned according to the nutritional requirements in different states, so as to complete the prediction
[0153] 1.1) Sugar adjustment:
[0154] If it is high blood sugar (high blood sugar if the user has diabetes), then:
[0155]
[0156] Among them, spf is the proportion of sugar content in recipe a to calories.
[0157] If it is low blood sugar, then:
[0158]
[0159] 1.2) Calorie adjustment:
[0160] First, calculate the daily calorie consumption TDEE of the user. For boys, the basal metabolic rate BMR = 88.362 + (13.397 x weight kg) + (4.799 x height cm) - (5.677 x age), and for girls, the basal metabolic rate BMR = 447.593 + (9.247 x weight kg) + (3.098 x height cm) - (4.330 x age). The daily calorie consumption TDEE = BMR x activity coefficient, which is determined according to the user's filled exercise intensity: if the exercise intensity is low, the activity coefficient is 1.375, if the exercise intensity is medium, the activity coefficient is 1.55, and if the exercise intensity is high, the activity coefficient is 1.725. Then calculate the calorie of the recipe a minus one third of the daily calorie consumption TDEE, and get fas.
[0161] If the diet goal is to lose weight, then:
[0162]
[0163] If the diet goal is to gain muscle, then:
[0164]
[0165] If the diet goal is balanced diet, then:
[0166]
[0167] 1.3) Protein adjustment:
[0168] If the diet goal is muscle gain, then:
[0169]
[0170] where ppw is the ratio of protein content of recipe a to the weight of the user.
[0171] If the user is a child aged 1-3, then:
[0172]
[0173] If the user is a child aged 4-10, then:
[0174]
[0175] If the user is a teenager aged 11-17, then:
[0176]
[0177] If the user is an adult aged 18-49, then:
[0178]
[0179] If the user is an elderly person over 50, then:
[0180]
[0181] If multiple conditions are met at the same time, such as high blood sugar and fat loss, first use the formula for high blood sugar to update once, get Q(s t+1 ,a), and then use the obtained Q(s t+1 ,a) as Q(s t ,a) to update once using the fat loss formula.
[0182] (3) Initial learning and feedback loop:
[0183] Due to the small amount of initial data, online learning is needed to gradually accumulate data and adjust the strategy. Each interaction between the user and the recommendation system generates new data (user ratings and health indicators) and affects the update of Q value. Through multiple interactions with the user, the recommendation strategy can be gradually adjusted to better adapt to the user's needs.
[0184] After obtaining the target food photo uploaded by the user each time, the embodiment performs Q value updating by using the reinforcement learning algorithm each time to obtain the updated Q value of each recipe, and then normalizes the updated Q value of each recipe to 0-100 to obtain the recommendation degree of each recipe.
[0185] Embodiment 2
[0186] The embodiment provides a personalized recipe recommendation method applied to the personalized recipe recommendation system in embodiment 1, as shown in Figure 1 The personalized recipe recommendation method comprises the following steps.
[0187] S1: Obtain health data and dietary preference data of a user, wherein the health data comprises basic information, health conditions and exercise habits, the basic information comprises a region, and the health conditions comprise an allergen list, chronic diseases and dietary goals.
[0188] S2: Obtain food photos uploaded by the user, and identify the food photos to obtain food recognition results, wherein the food recognition results comprise food categories corresponding to the food photos.
[0189] S3: Determine a recommended recipe recommended to the user based on the health data, the dietary preference data and the food recognition results.
[0190] In S3, the recommended recipe recommended to the user is determined based on the health data, the dietary preference data and the food recognition results, and specifically comprises: taking the health data, the dietary preference data and the food recognition results as inputs, and combining a multi-objective optimization algorithm, a particle swarm optimization algorithm and a collaborative filtering algorithm to determine the recommended recipe recommended to the user.
[0191] Specifically, taking the health data, the dietary preference data and the food recognition results as inputs, and combining the multi-objective optimization algorithm, the particle swarm optimization algorithm and the collaborative filtering algorithm to determine the recommended recipe recommended to the user comprises:
[0192] (1) determining a target function and a constraint condition of the multi-objective optimization algorithm and a fitness function of the particle swarm optimization algorithm based on the health data and the dietary preference data, and determining a first recommended recipe by using the multi-objective optimization algorithm and a second recommended recipe by using the particle swarm optimization algorithm.
[0193] (2) taking the food recognition results as inputs, and determining similar users of the user by using the collaborative filtering algorithm.
[0194] The food recognition result is taken as input, and a collaborative filtering algorithm is used to determine the similar users of the user, specifically including: for each candidate user, the similarity between the user and the candidate user is calculated by taking the food recognition result as input, and all candidate users are screened based on the similarity to determine the similar users of the user.
[0195] The calculation formula of the similarity is:
[0196]
[0197] The similarity between the user u and the user v is s(u, v); I is the recipe set; r (u,i) is the score of the user u on the recipe i; is the average value of the score of the user u on each recipe in the recipe set; r (v,i) is the score of the user v on the recipe i; is the average value of the score of the user v on each recipe in the recipe set.
[0198] The similarity between the user u and the user v is s(u, v); I is the recipe set; r
[0199] (3) The first recommended recipe and the second recommended recipe are screened based on the recommended recipe of the similar user to obtain the recommended recipe recommended to the user.
[0200] The first recommended recipe and the second recommended recipe are screened based on the recommended recipe of the similar user to obtain the recommended recipe recommended to the user, specifically including: the first recommended recipe and the second recommended recipe in the recommended recipe of the similar user are selected as the recommended recipe recommended to the user.
[0201] Embodiment 3
[0202] In this embodiment, through the synergistic effect of multi-modal analysis and multiple algorithms, personalized recipe recommendation is realized on the WeChat applet platform. Specifically, the embodiment provides a personalized recipe interaction system, which includes a client and a background server. The client can be a WeChat applet client, and the background server includes the personalized recipe recommendation system in embodiment 1.
[0203] The personalized recipe interaction system has the following four functions:
[0204] (1) User data collection and storage: through the WeChat applet client and the database in the background server
[0205] The user fills in the detailed health questionnaire and diet preference questionnaire survey through the interactive form of the WeChat applet front-end interface, which can be multiple selected, obtains the health data and diet preference data input by the user, and the health data includes basic information, health status and exercise habit. After filling in, the WeChat applet client calls the API interface, transmits the health data and diet preference data to the background server through the HTTPS protocol, the background server binds each record (i.e. health data and diet preference data) with the user's WeChat ID to form a unique user portrait, and stores it in the user data record database. The user data record database can use a cloud MySQL database. The WeChat applet client also supports users to update information at any time, such as adding allergens or adjusting diet goals, and records each modification through a timestamp to track trends.
[0206] Through this function, comprehensive and dynamically updated user basic data can be provided for personalized recommendation, ensuring that the user's needs and constraints can be accurately understood.
[0207] At this time, in the embodiment, the client is used to obtain the health data and diet preference data input by the user, and to encrypt and transmit the health data and diet preference data to the background server. The background server is used to bind the health data and diet preference data with the user ID, and store them in the user data record database. The user data collection module in the background server is used to obtain the health data and diet preference data of the user from the user data record database.
[0208] (2) Food image recognition and nutrient component analysis: through the multi-modal large model (such as GLM-4V series) and database in the WeChat applet client and the background server
[0209] The user uploads an initial food photo (supports JPEG, PNG format, resolution minimum 720p) through the "take a photo" or "select from album" function of the WeChat mini-program client. The WeChat mini-program client pre-processes the initial food photo (such as cropping to a square, compressing to below 500KB), and then transmits the pre-processed food photo to the GLM-4V series model in the background server through API interface. The GLM-4V series model outputs the food name, food category, nutritional composition, and serving size of each food photo through pre-trained visual-linguistic joint encoding capabilities combined with a large food image dataset, with an accuracy of over 95%. The GLM-4V series model identifies the food photo, and the initial food recognition result obtained is returned to the WeChat mini-program client in JSON format. The user can view the detailed nutrition list (including nutritional composition) on the front-end interface of the WeChat mini-program client and support manual editing functions (such as correcting the food name to "steamed fish" or adjusting the serving size to 200g). The adjusted food recognition result is transmitted to the background server, which stores the food recognition result in the user's diet record database, including the upload time and food recognition result, for subsequent long-term analysis.
[0210] Through this function, the rapid conversion from image to nutritional composition is realized, providing real-time and accurate input for personalized recommendation, while supporting long-term tracking of dietary habits.
[0211] At this time, in this embodiment, the client is used to obtain the initial food photo uploaded by the user, pre-process the initial food photo to obtain a food photo, and transmit the food photo to the background server. The food image recognition module in the background server is used to identify the food photo to obtain an initial food recognition result, and transmit the initial food recognition result to the client. The client is used to show the initial food recognition result to the user, adjust the initial food recognition result based on user input to obtain a food recognition result, and transmit the food recognition result to the background server. The background server is used to bind the food photo and the food recognition result with the user ID and store them in the user's diet record database. The food image recognition module in the background server is used to obtain the food recognition result from the user's diet record database.
[0212] (3) Personalized recipe generation and recommendation: realized through the background server
[0213] Based on the user's health data, dietary preference data, and food recognition result, three algorithms work together to generate personalized recommended recipes, and through API interface, the recommended recipe is returned as a recommendation result to the WeChat mini-program client for display.
[0214] At this time, in the embodiment, the personalized recommendation module in the background server is used to determine the recommended recipe recommended to the user based on the health data, the dietary preference data and the food recognition result.
[0215] (4) Dynamic adjustment and continuous optimization: realized through the WeChat applet client and the background server
[0216] The user records the actual intake condition (such as uploading a “oatmeal” photo and inputting the consumption amount of 100 grams) and feedback opinions (such as satisfaction score of recommended recipe, 0-5 points; text evaluation, such as “taste is good but salty”) through the “diet punch card” function of the WeChat applet client. The diet punch card data is collected daily and stored in the database, and a diet trend report (such as “this week, the average protein intake is 80 grams, and the average calorie is 1900 kilocalories”) is generated every week, and the recommendation strategy is optimized.
[0217] Through the above functions, the adaptability of the recommendation is realized, ensuring continuous optimization with the change of user dietary habits and health status, and providing long-term effective personalized suggestions.
[0218] The embodiment relates to a personalized recipe interaction system based on multi-modal analysis, which takes WeChat applet as a carrier, integrates user data collection module, food image recognition module, personalized recommendation module and dynamic adjustment module. The system realizes rapid nutrition component recognition of the food photo uploaded by the user through multi-modal large model technology, and generates personalized recommended recipes, that is, generates personalized scientific dietary suggestions, in combination with user health data and dietary preference data. The system supports multiple use scenarios, such as daily dietary planning at home, nutrition management of fitness groups and health diet monitoring of special groups (such as diabetic patients). In addition, the system provides a user-friendly interaction interface, supports real-time uploading of food photos, viewing of nutrition component analysis results and obtaining of recommended recipes, and the user can also record daily diet through the punch card function, so that the system continuously optimizes the recommended content. Through the multi-modal large model, the nutrition component of the food photo uploaded by the user is recognized, and the multi-objective optimization algorithm is used to optimize the nutrition collocation, the particle swarm optimization algorithm is used to balance the user preference and the health target, and the collaborative filtering algorithm is used to analyze the dietary habits of similar users, so that the recommended recipe meeting the personalized needs of the user is finally generated. At the same time, through the dynamic adjustment mechanism, the recommended result is continuously optimized according to the user feedback and long-term dietary data. Compared with the prior art, the embodiment realizes significant technical progress in personalized recommendation, dynamic optimization, user experience, operation convenience and recommendation quality.
[0219] Most of the current diet recommendation technologies still lack long-term dietary habit tracking, that is, many diet recommendation technologies only achieve daily diet record function and fail to dynamically adjust and optimize according to the long-term dietary habits and health trends of users. The embodiment introduces a dynamic adjustment module, which can well solve the above problems and continuously optimize the recommendation results according to user feedback and long-term dietary data. In addition, the embodiment adds artificial intelligence, after the user uploads a food photo, a multi-modal large model identifies recipe information and nutritional components and adds them to the database, and recommends to users with high similarity, which is more in line with the needs of the public and more humanized, meets the needs of young people for convenient and personalized diet, and has wide market adaptability.
[0220] Most of the current diet recommendation technologies still ignore the actual operation difficulty, such as the feasibility of food procurement, cooking time and other practical problems, which makes it difficult to implement some recommended solutions, that is, due to the rich variety of food materials, fixed local food material information cannot fully meet the dietary needs of users, with the digital upgrading of smart agricultural markets, the embodiment can further link the smart agricultural market after generating the recommended recipe to inform the user where to go to purchase the food materials involved in the recommended recipe.
[0221] For the process of recipe recommendation, the embodiment uses three algorithms to achieve recommendation, which are based on user input information to achieve personalized and high feedback health diet recommendation.
[0222] The embodiment has the following advantages:
[0223] (1) Advantage 1: High accuracy of personalized recommendation
[0224] This advantage comes from "user data collection and storage" and "personalized recipe generation and recommendation". Through the WeChat mini-program client, comprehensive health data (such as allergens, chronic diseases, dietary goals, exercise habits) and dietary preference data of users are collected to build an accurate user portrait. Combined with multi-objective optimization algorithm, particle swarm optimization algorithm and collaborative filtering algorithm, not only the health needs of users (such as controlling daily calories at 1800 kcal or protein intake at 100 grams) can be met, but also personalized taste preferences (such as preferring Sichuan cuisine or tabooing pork) can be considered. Compared with traditional diet recommendation technologies that only perform rough matching based on basic information (such as age and weight), the embodiment ensures that the recommended results are highly consistent with individual needs through multi-dimensional data input and collaborative optimization of various algorithms. For example, for a weight loss user, a low-calorie and high-protein recipe (such as "boiled chicken breast + broccoli") can be generated, and allergens (such as peanuts) can be excluded, significantly improving the accuracy and practicality of the recommendation.
[0225] (2) Advantage 2: Strong dynamic optimization and adaptability
[0226] This advantage comes from "dynamic adjustment and continuous optimization", which uses reinforcement learning algorithm to dynamically adjust the recommendation strategy according to user feedback (such as satisfaction score, diet check-in data) and long-term diet trend (such as average calorie 1900 kcal). Compared with traditional static diet recommendation technology, through the "feedback loop + reinforcement learning" mechanism, continuous optimization is realized according to the change of user demand, ensuring the effectiveness and relevance of long-term use.
[0227] (3) Advantage 3: User engagement and experience optimization
[0228] This advantage comes from "dynamic adjustment and continuous optimization", through "diet check-in" function and weekly diet trend report (such as "this week's average protein intake 80 grams"), the user's active participation and health management awareness are enhanced. Users can upload diet records in real time and view nutrition intake trends, and intuitively understand their own health progress (such as the degree of achieving the fat loss goal). Compared with traditional diet recommendation technology that only provides one-way recommendation, this embodiment significantly improves user stickiness and long-term use willingness through daily interaction (such as check-in) and visual feedback (such as trend charts). For example, users will be more motivated to stick to healthy eating habits when they see their weekly calorie intake gradually approaching the target value.
[0229] (4) Advantage 4: Photo recognition function improves convenience
[0230] This advantage comes from "food image recognition and nutrition component analysis", using multi-modal large model (GLM-4V series) to quickly recognize food photos uploaded by users, automatically analyzing food categories (such as "stewed pork"), nutrition components (such as 500 kcal per 100 grams) and portion size (such as 150 grams), with an accuracy rate of over 95%. Users only need to take pictures to complete diet records, without the need to manually input tedious information. Compared with the inefficient way of traditional diet recommendation technology relying on user manual input, through image recognition technology, the operation process is greatly simplified, improving the convenience of use. For example, users can take a picture of a plate of "broccoli with shrimp", which can automatically generate nutrition data and be included in the recommendation calculation, greatly reducing the user's burden.
[0231] (5) Advantage 5: Recommendation quality is scientific and diversified
[0232] The advantage comes from "personalized recipe generation and recommendation", which uses multi-objective optimization algorithm, particle swarm optimization algorithm and collaborative filtering algorithm to ensure the best balance between health, personalization and user preference. Compared with the recommendation system based on basic rule matching only, the embodiment introduces various optimization algorithms, making the recommended results more scientific and reasonable. The multi-objective optimization algorithm ensures that the recommended recipes meet the health goals, such as ensuring protein intake or controlling the upper limit of calories. The particle swarm optimization algorithm finds the best combination of balanced nutrition and user preference through group optimization. The collaborative filtering algorithm combines the preferences of similar users to ensure higher user acceptance of the recommended results. This series of data-driven and intelligent optimization methods make the recommendation take into account scientificity, personalization and deliciousness, which is more advantageous than traditional methods.
[0233] In summary, compared with traditional diet recommendation technology, the embodiment realizes technical upgrading and user experience optimization in many aspects:
[0234] (1) Higher recommendation accuracy: based on various data collection and algorithm optimization, the recipe matching degree is more accurate.
[0235] (2) Continuous optimization and adaptation: reinforcement learning mechanism allows dynamic adjustment of recommendations and long-term adaptation to user needs.
[0236] (3) Better user experience: provides diet check-in, trend analysis and other functions to improve user stickiness.
[0237] (4) More convenient to use: AI photo recognition significantly improves food input efficiency and reduces user operation burden.
[0238] (5) Higher recommendation quality: combined with multi-objective optimization algorithm, particle swarm optimization algorithm and collaborative filtering algorithm to ensure the best balance between health, personalization and deliciousness.
[0239] The above advantages come from the comprehensiveness of user data collection, innovative application of multi-modal analysis and deep integration of various AI technologies, making the embodiment not only a meal recommendation tool, but also an intelligent, precise and adaptive health management platform, providing long-term and effective dietary solutions for users.
[0240] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.
[0241] Any technical features in the above embodiments can be combined, and for the sake of brevity, not all possible combinations are described above, however, it should be understood that the application encompasses all possible combinations of the technical features described above.
[0242] The principles and implementation manners of the present application are described herein by using specific examples, and the above embodiments are only used to help understand the method of the present application and its core idea; meanwhile, according to the idea of the present application, the specific implementation manners and application scopes will be changed by those skilled in the art. In conclusion, the content of the present specification should not be understood as a limitation of the present application.
Claims
1. A personalized recipe recommendation system, characterized by: The personalized recipe recommendation system includes: a user data collection module, a food image recognition module and a personalized recommendation module; The user data collection module is used to obtain the user's health data and dietary preference data, wherein the health data includes basic information, health status and exercise habits, the basic information includes region, and the health status includes allergen list, chronic diseases and dietary goals; The food image recognition module is used to obtain food photos uploaded by users, and recognize the food photos to obtain food recognition results, wherein the food recognition results include the food types corresponding to the food photos; The personalized recommendation module is connected to the user data collection module and the food image recognition module respectively; the personalized recommendation module is used to determine the recommended recipes to be recommended to the user based on the health data, the dietary preference data and the food recognition results.
2. The personalized recipe recommendation system according to claim 1, characterized in that: The basic information also includes age, gender, height, weight and body mass index; the dietary goals include at least one of fat loss, muscle gain and balanced diet; the exercise habits include exercise intensity; and the dietary preference data includes taste preferences and taboo ingredients.
3. The personalized recipe recommendation system according to claim 1, characterized in that: In terms of identifying the food photo and obtaining a food identification result, the food image recognition module is used to take the food photo as input, utilize a multimodal large model to identify the food photo, and obtain a food identification result. The food identification result also includes the nutritional components and portion size corresponding to the food photo.
4. The personalized recipe recommendation system according to claim 1, characterized in that: In terms of determining the recommended recipes to be recommended to the user based on the health data, the dietary preference data and the food identification results, the personalized recommendation module is used to use the health data, the dietary preference data and the food identification results as inputs, and combine a multi-objective optimization algorithm, a particle swarm optimization algorithm and a collaborative filtering algorithm to determine the recommended recipes to be recommended to the user; wherein the objective function of the multi-objective optimization algorithm includes minimizing the caloric value, maximizing the key nutrient compliance rate and minimizing the key nutrient deviation, and the constraints of the multi-objective optimization algorithm include caloric range, key nutrient lower limit, allergen exclusion, macronutrient calorie ratio and seasonal availability.
5. The personalized recipe recommendation system according to claim 4, characterized in that: The personalized recipe recommendation system further includes: a dynamic adjustment module; The food image recognition module is used to obtain a target food photo uploaded by a user and the user's feedback on the target food photo, and to identify the target food photo to obtain the food type, nutritional ingredients, and serving size corresponding to the target food photo. The target food photo is a photo of a food prepared by the user based on a recommended recipe; The dynamic adjustment module is connected to the food image recognition module and the personalized recommendation module respectively; the dynamic adjustment module is used to determine the recommendation level of each recipe based on the user's feedback on the target food photo using a reinforcement learning algorithm, and adjust the optimization results of the multi-objective optimization algorithm and the parameters in the fitness function of the particle swarm optimization algorithm based on the recommendation level of each recipe.
6. A personalized recipe recommendation method, applied to the personalized recipe recommendation system according to any one of claims 1 to 5, characterized in that: The personalized recipe recommendation method includes: Acquiring the user's health data and dietary preference data, wherein the health data includes basic information, health status, and exercise habits, the basic information includes region, and the health status includes a list of allergens, chronic diseases, and dietary goals; Obtaining food photos uploaded by users, and identifying the food photos to obtain food identification results, wherein the food identification results include the food types corresponding to the food photos; Based on the health data, the dietary preference data, and the food identification result, a recommended recipe is determined to be recommended to the user.
7. The personalized recipe recommendation method according to claim 6, characterized in that: Determining a recommended recipe to recommend to the user based on the health data, the dietary preference data, and the food identification result, specifically comprising: using the health data, the dietary preference data, and the food identification result as input, and combining a multi-objective optimization algorithm, a particle swarm optimization algorithm, and a collaborative filtering algorithm to determine the recommended recipe to recommend to the user; The health data, the dietary preference data, and the food recognition results are used as inputs, and a multi-objective optimization algorithm, a particle swarm optimization algorithm, and a collaborative filtering algorithm are combined to determine a recommended recipe for the user, specifically including: Determining an objective function and constraints of a multi-objective optimization algorithm and a fitness function of a particle swarm optimization algorithm based on the health data and the dietary preference data, and determining a first recommended recipe using the multi-objective optimization algorithm, and determining a second recommended recipe using the particle swarm optimization algorithm; wherein the objective function of the multi-objective optimization algorithm includes minimizing caloric value, maximizing key nutrient compliance, and minimizing key nutrient deviation, and the constraints of the multi-objective optimization algorithm include caloric range, key nutrient lower limit, allergen exclusion, macronutrient caloric ratio, and seasonal availability; Using the food recognition result as input, a collaborative filtering algorithm is used to determine similar users of the user; Based on the recommended recipes of the similar users, the first recommended recipes and the second recommended recipes are screened to obtain a recommended recipe for the user.
8. The personalized recipe recommendation method according to claim 7, characterized in that: Using the food recognition result as input, a collaborative filtering algorithm is used to determine similar users of the user, specifically comprising: for each candidate user, using the food recognition result as input, calculating the similarity between the user and the candidate user, and screening all the candidate users based on the similarity to determine similar users of the user; The calculation formula of the similarity is: Where s(u,v) is the similarity between user u and user v; I is the recipe set; r (u,i) is the rating of recipe i by user u; is the average of user u’s ratings for each recipe in the recipe collection; r (v,i) is the rating of recipe i by user v; is the average of the ratings given by user v to each recipe in the recipe collection; The step of screening all the candidate users based on the similarity to determine similar users of the user specifically includes: selecting the candidate users whose similarity is greater than a preset similarity as similar users of the user.
9. The personalized recipe recommendation method according to claim 7, characterized in that: Based on the recommended recipes of the similar users, the first recommended recipe and the second recommended recipe are screened to obtain recommended recipes recommended to the user, specifically including: selecting the first recommended recipe and the second recommended recipe in the recommended recipes of the similar users as recommended recipes recommended to the user.
10. A personalized recipe interactive system, characterized by: The personalized recipe interaction system comprises: a client and a backend server, wherein the backend server comprises the personalized recipe recommendation system according to any one of claims 1 to 5; The client is used to obtain the health data and dietary preference data input by the user, and encrypt and transmit the health data and dietary preference data to the backend server. The backend server is used to bind the health data and dietary preference data with the user ID and store them in the user data record database. The user data collection module in the backend server is used to obtain the user's health data and dietary preference data from the user data record database; The client is used to obtain an initial food photo uploaded by a user, pre-process the initial food photo to obtain a food photo, and transmit the food photo to the backend server; the food image recognition module in the backend server is used to recognize the food photo to obtain an initial food recognition result, and transmit the initial food recognition result to the client; the client is used to display the initial food recognition result to the user, adjust the initial food recognition result based on user input to obtain a food recognition result, and transmit the food recognition result to the backend server; the backend server is used to bind the food photo and the food recognition result with the user ID and store them in the user diet record database; the food image recognition module in the backend server is used to obtain the food recognition result from the user diet record database; The personalized recommendation module in the backend server is used to determine a recommended recipe to be recommended to the user based on the health data, the dietary preference data and the food identification result.
Citation Information
Cited By
Information recommendation method and device based on closed loop and storage medium
CN121765142A