Recipe recommendation method, system, electronic device, storage medium and chip

The neural network generates recommended recipe feature vectors based on the information of the ingredient library, adjusts the learning rate to optimize the neural network, solves the problem that smart refrigerators have difficulty understanding user tastes, and achieves more accurate recipe recommendations.

CN115964544BActive Publication Date: 2025-08-08SPREADTRUM SEMICON (NANJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211634403.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-19
Publication Date
2025-08-08
Estimated Expiration
2042-12-19

AI Technical Summary

Technical Problem

Existing smart refrigerators have difficulty understanding users' tastes or preferences, resulting in inaccurate recommendations of recipes.

Method used

The neural network generates recommended recipe feature vectors based on the information of the ingredient library, adjusts the learning rate to learn users' preferences, and optimizes the neural network to provide more accurate recipe recommendations.

Benefits of technology

Improves the accuracy of recipe recommendations, allowing neural networks to learn user tastes or preferences in less learning times, and improves the accuracy of recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115964544B_ABST
    Figure CN115964544B_ABST
Patent Text Reader

Abstract

The present disclosure provides a recipe recommendation method, system, electronic device, storage medium, and chip. The method includes: in response to a target recipe selected by a user from a recommended recipe, obtaining a target recipe feature vector based on the target recipe; determining a learning rate of a neural network based on the target recipe feature vector; optimizing the neural network according to the learning rate; and in response to an update of the food library information, determining a new recommended recipe based on the optimized neural network and the updated food library information. The present disclosure generates one or more recommended recipes for a user based on the acquired food library information by using a neural network, analyzes the target recipe determined by the user from the one or more recommended recipes, obtains a target recipe feature vector, and adjusts the learning rate of the neural network based on the target recipe feature vector so that the neural network learns the user's preferences, thereby making more accurate recipe recommendations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of smart refrigerators, and in particular to a recipe recommendation method, system, electronic device, storage medium, and chip. Background Art

[0002] A smart refrigerator is one that offers intelligent control and food management. Users can access information about food quantity and freshness and quality anytime, anywhere through a device or the refrigerator's onboard smart screen, and receive recipe recommendations and other services.

[0003] Current smart refrigerators can recommend recipes based on the ingredients already in the refrigerator. However, to make accurate recommendations, current smart refrigerators often require users to collect or enter their favorite recipes in advance, or prioritize recipes selected previously. This fails to truly and accurately understand a user's tastes or preferences. Summary of the Invention

[0004] In order to overcome the above technical problems, the present disclosure provides a recipe recommendation method, system, electronic device, storage medium and chip.

[0005] In a first aspect, the present disclosure provides a recipe recommendation method, comprising:

[0006] In response to a target recipe selected by a user from the recommended recipes, a target recipe feature vector is obtained based on the target recipe; wherein the recommended recipe is determined based on the recommended recipe feature vector, and the recommended recipe feature vector is output by a neural network based on information in the ingredient library;

[0007] determining a learning rate of the neural network based on the target recipe feature vector;

[0008] optimizing the neural network according to the learning rate;

[0009] In response to the update of the food library information, a new recommended recipe is determined based on the optimized neural network according to the updated food library information.

[0010] Optionally, the neural network includes an execution network, a model network, and an evaluation network;

[0011] The execution network is used to output a food stimulus feature vector according to the food library information; wherein the food stimulus feature vector is used to simulate different stimuli to the user caused by different foods in the food library information;

[0012] The model network is used to simulate the user and output the recommended recipe feature vector based on the food stimulus feature vector and the food library information;

[0013] The evaluation network is used to output an evaluation feature vector based on the target recipe feature vector.

[0014] Optionally, the step of determining the learning rate of the neural network based on the target recipe feature vector includes:

[0015] Calculating a first feedback feature value; wherein the first feedback feature value is determined based on the target recipe feature vector, the current ingredient stimulation feature vector, the current evaluation feature vector, and the current weight of the execution network;

[0016] Obtaining a previous first feedback feature and a previous stimulus prediction reference feature value of the execution network;

[0017] Determining a current stimulation prediction reference eigenvalue based on the previous first feedback eigenvalue and the previous stimulation prediction reference eigenvalue; wherein the previous first feedback eigenvalue is used to characterize the influence of the previously selected target recipe on the current food stimulus eigenvector;

[0018] determining a first learning adjustment amount according to the first feedback characteristic value and the stimulation prediction reference characteristic value;

[0019] The sum of the first learning adjustment amount and the current learning rate of the execution network is calculated to obtain a first learning rate of the execution network.

[0020] Optionally, the step of calculating the first feedback characteristic value includes:

[0021] Extracting an ingredient consumption feature vector from the target recipe feature vector; wherein the ingredient consumption feature vector is used to represent the ingredients required to be consumed by the target recipe;

[0022] determining a cost function based on the food consumption feature vector;

[0023] Determining the objective function of the execution network according to the cost function, the current food stimulus feature vector, the target recipe feature vector, and the current evaluation feature vector;

[0024] The first feedback characteristic value is determined according to the objective function of the execution network and the current weight of the execution network.

[0025] Optionally, the cost function is:

[0026] U(t)=μ1x t 2 ,

[0027] Where U(t) is the cost function, x tis the food consumption feature vector for this time, μ1 is the first preset coefficient, and t is the number of times the neural network corresponding to this time has been optimized for the user;

[0028] The objective function of the execution network is:

[0029]

[0030] Among them, E A (t) is the objective function of the execution network, is the food stimulus feature vector, is the characteristic vector of this evaluation, m t is the target recipe feature vector, μ2 is the second preset coefficient;

[0031] The calculation method of the first feedback characteristic value is:

[0032]

[0033] Among them, D A(t) is the first feedback characteristic value of this time, w A(t) is the current weight of the execution network.

[0034] Optionally, the current stimulus prediction reference characteristic value is calculated as follows:

[0035] S A(t) =(1-μ3)D A(t-1) +μ3S A(t-1) ,

[0036] Among them, S A(t) is the reference feature value predicted for this stimulus, D A(t-1) is the previous first feedback characteristic value, is the reference characteristic value predicted by the previous stimulation, μ3 is the third preset coefficient, and t is the number of times the neural network has been optimized for the user corresponding to this time;

[0037] The calculation method of the first learning rate adjustment amount is:

[0038]

[0039] Among them, Δα A is the first learning rate increment, D A(t) is the first feedback feature of this time, a1 is the first preset increment, b1 is the first preset attenuation coefficient, α A(t) is the current learning rate of the execution network.

[0040] Optionally, the step of determining the learning rate of the neural network based on the target recipe feature vector includes:

[0041] Obtaining a previous ideal evaluation feature vector of the evaluation network;

[0042] Calculating the second feedback eigenvalue of the evaluation network; wherein the second feedback eigenvalue is determined based on the previous ideal evaluation eigenvector, the current evaluation eigenvector, and the current weight of the evaluation network;

[0043] Obtaining a previous evaluation reference characteristic value and a previous second feedback characteristic value of the execution network;

[0044] Determining a reference feature value for this evaluation based on the previous evaluation reference feature value and the previous second feedback feature value; wherein the previous second feedback feature value is used to represent the influence of the previously selected target recipe on the current evaluation feature vector;

[0045] Determining a second learning adjustment amount according to the current evaluation reference characteristic value and the current second feedback characteristic value;

[0046] The second learning rate of the evaluation network is obtained by calculating the sum of the second learning adjustment amount and the current learning rate of the evaluation network.

[0047] Optionally, the step of calculating the second feedback characteristic value of the evaluation network includes:

[0048] Determine the current ideal evaluation feature vector according to the previous ideal evaluation feature vector and the current evaluation feature vector;

[0049] Determining the objective function of the evaluation network according to the current evaluation feature vector and the current ideal evaluation feature vector;

[0050] The second feedback characteristic value is determined according to the objective function of the evaluation network and the current weight of the evaluation network.

[0051] Optionally, the ideal evaluation feature vector is calculated as follows:

[0052]

[0053] Among them, β t is the ideal evaluation feature vector for this time, is the characteristic vector of this evaluation, β (t-1) is the previous ideal evaluation feature vector, and t is the number of times the neural network has been optimized for the user;

[0054] The objective function of the evaluation network is:

[0055]

[0056] Among them, E C (t) is the objective function of the evaluation network, μ4 is the fourth preset coefficient;

[0057] The calculation method of the second feedback characteristic value is:

[0058]

[0059] Among them, D C(t) is the second feedback characteristic value of this time, w C(t) The current weights of the evaluation network.

[0060] Optionally, the calculation method of the reference characteristic value of this evaluation is:

[0061] S C(t) =(1-μ5)D C(t-1) +μ5S C(t-1) ,

[0062] Among them, S C(t) is the reference characteristic value of this evaluation, D C(t-1) is the second feedback characteristic value of the previous time, S C(t-1) is the reference characteristic value of the previous evaluation, μ5 is the fifth preset coefficient, and t is the number of times the neural network has been optimized for the user corresponding to this time;

[0063] The second learning rate adjustment amount is calculated as follows:

[0064]

[0065] Among them, Δα C is the second learning rate increment, S C(t) is the reference characteristic value of this evaluation, D C(t) is the second feedback feature, a2 is the second preset increment, b2 is the second preset attenuation coefficient, α C(t) is the current learning rate of the evaluation network.

[0066] Optionally, the step of optimizing the neural network according to the learning rate includes:

[0067] Obtain the previous ideal food stimulus feature vector;

[0068] Determine the current ideal food stimulus feature vector according to the previous ideal food stimulus feature vector and the current food stimulus feature vector;

[0069] Obtaining a first error gradient according to the first learning rate, the current ideal food stimulation feature vector, the current food stimulation feature vector, and the current ideal evaluation feature vector;

[0070] Updating the weights of the execution network using the first error gradient;

[0071] The calculation method of the ideal food stimulus feature vector is as follows:

[0072]

[0073] The first error gradient is calculated as follows:

[0074]

[0075] Where Δw A is the first error gradient, α A(t+1) is the first learning rate, U(t) is the cost function, is the food stimulus feature vector, u t is the ideal food stimulus feature vector, u t-1 is the feature vector of the previous ideal food stimulus, m t is the target recipe feature vector, β t is the ideal evaluation feature vector, w A(t) is the current weight of the execution network, and t is the number of times the neural network has been optimized for the user.

[0076] Optionally, the step of optimizing the neural network according to the learning rate includes:

[0077] Obtaining a second error gradient according to the second learning rate;

[0078] Updating the weights of the evaluation network using the second error gradient;

[0079] The second error gradient is calculated as follows:

[0080]

[0081] Where Δw C is the second error gradient, α C(t+1) For the second learning rate, is the characteristic vector of this evaluation, β t is the ideal evaluation feature vector, w C(t) is the current weight of the evaluation network, and t is the number of times the neural network has been optimized for the user.

[0082] Optionally, the neural network is used to count the types of ingredients and the quantity of each type of ingredients based on the ingredient library information to obtain an ingredient library feature vector, and input the ingredient library feature vector into the execution network.

[0083] Optionally, the recipe recommendation method includes:

[0084] Calculating a matching degree between the recommended recipe feature vector and the recipe feature vectors in the recipe database;

[0085] The recommended recipe is determined according to the matching degree.

[0086] In a second aspect, the present disclosure provides a recipe recommendation system, including:

[0087] a response module, configured to, in response to a target recipe selected by a user from the recommended recipes, obtain a target recipe feature vector based on the target recipe; wherein the recommended recipe is determined based on the recommended recipe feature vector, which is output by a neural network based on information in the ingredient library;

[0088] a learning rate calculation module, configured to determine a learning rate of the neural network based on the target recipe feature vector;

[0089] A network updating module, configured to optimize the neural network according to the learning rate;

[0090] A recommended recipe updating module is used to determine a new recommended recipe based on the updated food library information in response to the update of the food library information based on the optimized neural network.

[0091] Optionally, the neural network includes an execution network, a model network, and an evaluation network;

[0092] The execution network is used to output a food stimulus feature vector according to the food library information; wherein the food stimulus feature vector is used to simulate different stimuli to the user caused by different foods in the food library information;

[0093] The model network is used to simulate the user and output the recommended recipe feature vector based on the food stimulus feature vector and the food library information;

[0094] The evaluation network is used to output an evaluation feature vector based on the target recipe feature vector.

[0095] Optionally, the learning rate calculation module includes a first learning rate determination unit.

[0096] The first learning rate determination unit is used to calculate the first feedback characteristic value of this time; wherein, the first feedback characteristic value of this time is determined according to the target recipe characteristic vector, the current ingredient stimulation characteristic vector, the current evaluation characteristic vector and the current weight of the execution network; obtain the previous first feedback characteristic and the previous stimulation prediction reference characteristic value of the execution network; determine the current stimulation prediction reference characteristic value according to the previous first feedback characteristic value and the previous stimulation prediction reference characteristic value; wherein, the previous first feedback characteristic value is used to characterize the influence of the previously selected target recipe on the current ingredient stimulation characteristic vector; determine the first learning adjustment amount according to the current first feedback characteristic value and the current stimulation prediction reference characteristic value; calculate the sum of the first learning adjustment amount and the current learning rate of the execution network to obtain the first learning rate.

[0097] Optionally, the first learning rate determination unit is used to extract an ingredient consumption feature vector from the target recipe feature vector; wherein the ingredient consumption feature vector is used to characterize the ingredients required to be consumed by the target recipe; a cost function is determined based on the ingredient consumption feature vector; an objective function of the execution network is determined according to the cost function, the current ingredient stimulation feature vector, the target recipe feature vector and the current evaluation feature vector; and the first feedback feature value is determined according to the objective function of the execution network and the current weight of the execution network.

[0098] Optionally, the cost function is:

[0099] U(t)=μ1x t 2 ,

[0100] Where U(t) is the cost function, x t is the food consumption feature vector for this time, μ1 is the first preset coefficient, and t is the number of times the neural network corresponding to this time has been optimized for the user;

[0101] The objective function of the execution network is:

[0102]

[0103] Among them, E A (t) is the objective function of the execution network, is the food stimulus feature vector, is the characteristic vector of this evaluation, m t is the target recipe feature vector, μ2 is the second preset coefficient;

[0104] The calculation method of the first feedback characteristic value is:

[0105]

[0106] Among them, D A(t) is the first feedback characteristic value of this time, w A(t) is the current weight of the execution network.

[0107] Optionally, the current stimulus prediction reference characteristic value is calculated as follows:

[0108] S A(t) =(1-μ3)D A(t-1) +μ3S A(t-1) ,

[0109] Among them, S A(t) is the reference feature value predicted for this stimulus, D A(t-1) is the previous first feedback characteristic value, is the reference characteristic value predicted by the previous stimulation, μ3 is the third preset coefficient, and t is the number of times the neural network has been optimized for the user corresponding to this time;

[0110] The calculation method of the first learning rate adjustment amount is:

[0111]

[0112] Among them, Δα A is the first learning rate increment, D A(t) is the first feedback feature of this time, a1 is the first preset increment, b1 is the first preset attenuation coefficient, α A(t) is the current learning rate of the execution network.

[0113] Optionally, the learning rate calculation module includes a second learning rate determination unit.

[0114] The second learning rate determination unit is used to obtain the previous ideal evaluation feature vector of the evaluation network; calculate the second feedback feature value of the evaluation network; wherein the second feedback feature value is determined based on the previous ideal evaluation feature vector, the current evaluation feature vector and the current weight of the evaluation network; obtain the previous evaluation reference feature value and the previous second feedback feature value of the execution network; determine the current evaluation reference feature value based on the previous evaluation reference feature value and the previous second feedback feature value; wherein the previous second feedback feature value is used to characterize the influence of the target recipe selected last on the current evaluation feature vector; determine the second learning adjustment amount based on the current evaluation reference feature value and the current second feedback feature value; calculate the sum of the second learning adjustment amount and the current learning rate of the evaluation network to obtain the second learning rate.

[0115] Optionally, the second learning rate determination unit is used to determine the current ideal evaluation feature vector based on the previous ideal evaluation feature vector and the current evaluation feature vector; determine the objective function of the evaluation network based on the current evaluation feature vector and the current ideal evaluation feature vector; and determine the current second feedback feature value based on the objective function of the evaluation network and the current weight of the evaluation network.

[0116] Optionally, the ideal evaluation feature vector is calculated as follows:

[0117]

[0118] Among them, β t is the ideal evaluation feature vector for this time, is the characteristic vector of this evaluation, β (t-1) is the previous ideal evaluation feature vector, and t is the number of times the neural network has been optimized for the user;

[0119] The objective function of the evaluation network is:

[0120]

[0121] Among them, E C (t) is the objective function of the evaluation network, μ4 is the fourth preset coefficient;

[0122] The calculation method of the second feedback characteristic value is:

[0123]

[0124] Among them, D C(t) is the second feedback characteristic value of this time, w C(t) The current weights of the evaluation network.

[0125] Optionally, the calculation method of the reference characteristic value of this evaluation is:

[0126] S C(t) =(1-μ5)D C(t-1) +μ5S C(t-1) ,

[0127] Among them, S C(t) is the reference characteristic value of this evaluation, D C(t-1) is the second feedback characteristic value of the previous time, S C(t-1) is the reference characteristic value of the previous evaluation, μ5 is the fifth preset coefficient, and t is the number of times the neural network has been optimized for the user corresponding to this time;

[0128] The second learning rate adjustment amount is calculated as follows:

[0129]

[0130] Among them, Δα C For the second learning rate increment, S C(t) is the reference characteristic value of this evaluation, D C(t) is the second feedback feature, a2 is the second preset increment, b2 is the second preset attenuation coefficient, α C(t) is the current learning rate of the evaluation network.

[0131] Optionally, the network update module includes a network optimization execution unit.

[0132] The execution network optimization unit is used to obtain the previous ideal food stimulus feature vector; determine the current ideal food stimulus feature vector based on the previous ideal food stimulus feature vector and the current food stimulus feature vector; obtain a first error gradient based on the first learning rate, the current ideal food stimulus feature vector, the current food stimulus feature vector and the current ideal evaluation feature vector; and use the first error gradient to update the weight of the execution network.

[0133] The calculation method of the ideal food stimulus feature vector is as follows:

[0134]

[0135] The first error gradient is calculated as follows:

[0136]

[0137] Where Δw A is the first error gradient, α A(t+1) is the first learning rate, U(t) is the cost function, is the food stimulus feature vector, u t is the ideal food stimulus feature vector, u t-1 is the feature vector of the previous ideal food stimulus, m t is the target recipe feature vector, β t is the ideal evaluation feature vector, w A(t) is the current weight of the execution network, and t is the number of times the neural network has been optimized for the user.

[0138] Optionally, the network update module includes a network optimization evaluation unit.

[0139] The evaluation network optimization unit is configured to: obtain a second error gradient according to the second learning rate; and update the weight of the evaluation network using the second error gradient;

[0140] The second error gradient is calculated as follows:

[0141]

[0142] Where Δw C is the second error gradient, α C(t+1) For the second learning rate, is the characteristic vector of this evaluation, β t is the ideal evaluation feature vector, w C(t) is the current weight of the evaluation network, and t is the number of times the neural network has been optimized for the user.

[0143] Optionally, the neural network is used to count the types of ingredients and the quantity of each type of ingredients based on the ingredient library information to obtain an ingredient library feature vector, and input the ingredient library feature vector into the execution network.

[0144] Optionally, the recommended recipe updating module is configured to calculate a matching degree between the recommended recipe feature vector and a recipe feature vector in a recipe database; and determine the recommended recipe based on the matching degree.

[0145] In a third aspect, the present disclosure provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the recipe recommendation method described in the first aspect is implemented.

[0146] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the recipe recommendation method described in the first aspect.

[0147] In a fifth aspect, the present disclosure provides a chip that executes the recipe recommendation method described in the first aspect.

[0148] The positive progress of this disclosure is:

[0149] The recipe recommendation method, system, electronic device, storage medium and chip provided by the present disclosure generate a recommended recipe feature vector for a user based on acquired food library information by using a neural network, determine one or more recommended recipes based on the recommended recipe feature vector, and parse the target recipe determined by the user from the one or more recommended recipes to obtain a target recipe feature vector. The learning rate of the neural network is adjusted based on the target recipe feature vector so that the neural network learns the user's preferences.

[0150] In particular, compared with traditional neural networks that use a constant value as the learning rate, the present invention dynamically determines the learning rate of the neural network based on each user's selection, which can greatly improve the convergence speed during training, thereby allowing the neural network to truly learn the user's taste or preference based on fewer learning times. BRIEF DESCRIPTION OF THE DRAWINGS

[0151] Figure 1 A schematic diagram of a process for a recipe recommendation method according to Embodiment 1 of the present disclosure;

[0152] Figure 2 A schematic diagram of the structure of a neural network provided in Example 1 of the present disclosure;

[0153] Figure 3 A schematic diagram of the modules of the recipe recommendation system provided in Example 2 of the present disclosure;

[0154] Figure 4 A schematic diagram of the structure of a smart refrigerator provided in Example 2 of the present disclosure;

[0155] Figure 5 This is a structural diagram of an electronic device provided in Example 3 of the present disclosure. DETAILED DESCRIPTION

[0156] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.

[0157] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0158] It should be noted that the execution entity of the recipe recommendation method provided in this embodiment can be a separate chip, chip module or UE, or a chip or chip module integrated in the UE.

[0159] The recipe recommendation system described in the embodiments may be a separate chip, chip module, or UE, or a chip or chip module integrated into a UE. The various modules / units included in the recipe recommendation system may be software modules / units, hardware modules / units, or partially software modules / units and partially hardware modules / units.

[0160] For example, for each device or product applied to or integrated into a chip, each module / unit contained therein may be implemented in the form of hardware such as circuits, or at least some of the modules / units may be implemented in the form of software programs, which run on a processor integrated inside the chip, and the remaining modules / units may be implemented in the form of hardware such as circuits; for each device or product applied to or integrated into a chip module, each module / unit contained therein may be implemented in the form of hardware such as circuits, and different modules / units may be located in the same component (such as a chip, circuit module, etc.) or different components of the chip module, or at least some of the modules / units may be implemented in the form of software programs. / Unit can be implemented in the form of a software program, which runs on a processor integrated inside the chip module, and the remaining modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in the UE, the various modules / units contained therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or different components in the terminal, or, at least some modules / units can be implemented in the form of a software program, which runs on a processor integrated inside the UE, and the remaining modules / units can be implemented in the form of hardware such as circuits.

[0161] Example 1

[0162] This embodiment provides a recipe recommendation method.

[0163] See also Figure 1 , the recipe recommendation method includes the following steps:

[0164] S1. In response to a user selecting a target recipe from the recommended recipes, obtaining a target recipe feature vector based on the target recipe; wherein the recommended recipe is determined based on the recommended recipe feature vector, which is output by a neural network based on information in the ingredient library;

[0165] S2. determining a learning rate of the neural network based on the target recipe feature vector;

[0166] S3. Optimize the neural network based on the learning rate;

[0167] S4. In response to the update of the food library information, determine a new recommended recipe based on the optimized neural network according to the updated food library information.

[0168] The above-mentioned recipe recommendation method uses a neural network to generate one or more recommended recipes for the user based on the acquired ingredient library information, parses the target recipe determined by the user from one or more recommended recipes, obtains the target recipe feature vector, and adjusts the learning rate of the neural network based on the target recipe feature vector so that the neural network learns the user's preferences, thereby making more accurate recipe recommendations.

[0169] In this embodiment, see Figure 2 ,The neural network includes execution network, model network and evaluation network.

[0170] First, the neural network extracts the food library feature vector from the food library information.

[0171] Specifically, the neural network is used to count the types of ingredients and the quantity of each type of ingredients based on the information of the ingredient library to obtain a feature vector of the ingredient library.

[0172] Then, the food library feature vector is input into the execution network, and the execution network is used to output the food stimulus feature vector according to the food library feature vector.

[0173] Specifically, the ingredient stimulation feature vector is used to simulate the different stimulations that different ingredients in the ingredient library information produce on the user.

[0174] Next, the ingredient library feature vector and the ingredient stimulation feature vector are input into the model network, and the model network is used to output a recommended recipe feature vector based on the ingredient library feature vector and the ingredient stimulation feature vector.

[0175] Specifically, the model network mainly predicts the user's preferred recipes based on the known ingredient library information and the different stimulations produced by various ingredients on different users, and then generates a recommended recipe feature vector.

[0176] For example, the feature vector of the recommended recipe mainly includes predictions of multiple dimensions such as cooking method, type of meat and vegetable used, type of material used, saltiness, sweetness, spiciness, and sourness.

[0177] After the model network outputs a recommended recipe feature vector, the matching degree between the recommended recipe feature vector and the recipe feature vectors of different recipes in the preset recipe database is calculated, and a recommended recipe is determined based on the matching degree. The user can then select a target recipe from one or more recommended recipes.

[0178] For example, recipes corresponding to recipe feature vectors with a matching degree greater than a preset threshold are selected as recommended recipes, and are ranked by matching degree. Specifically, based on the number of recipes that can be displayed per page, recommended recipes with high matching degrees are placed on the first few pages for display and recommendation. Alternatively, the recipes can be ranked by calculated matching degree, with a preset number of recipes ranked at the top being selected as recommended recipes.

[0179] Among them, in addition to the common similarity algorithm, the matching degree can also be calculated by taking the difference between the recommended recipe feature vector and the recipe feature vector and taking the norm to obtain the matching degree.

[0180] Finally, in response to the user's selected target recipe, a target recipe feature vector is extracted from the target recipe and input into the evaluation network, which then outputs an evaluation feature vector based on the target recipe feature vector. Based on this evaluation feature vector, the weights of the execution network and the evaluation network are adjusted to ensure that the ingredient stimulus feature vector output by the execution network is more closely aligned with the actual stimulus that different ingredients actually induce in the user.

[0181] Among them, adjusting the weights of the execution network and the evaluation network requires first determining the learning rate of the network.

[0182] Specifically, step S2 includes the step of determining a first learning rate for executing the network:

[0183] S211. Calculate the first feedback feature value of this time; wherein the first feedback feature value of this time is determined based on the target recipe feature vector, the current ingredient stimulation feature vector, the current evaluation feature vector, and the current weight of the execution network;

[0184] S212, obtaining the previous first feedback feature of the execution network and the previous stimulus prediction reference feature value;

[0185] S213, determining a current stimulation prediction reference eigenvalue based on the previous first feedback eigenvalue and the previous stimulation prediction reference eigenvalue; wherein the previous first feedback eigenvalue is used to represent the influence of the previously selected target recipe on the current food stimulus eigenvector;

[0186] S214, determining a first learning adjustment amount according to the first feedback characteristic value and the stimulation prediction reference characteristic value;

[0187] S215. Calculate the sum of the first learning adjustment amount and the current learning rate of the execution network to obtain a first learning rate.

[0188] It should be noted that when the neural network is optimized for the user's preferences for the first time, the reference feature value for the stimulus prediction is preset and does not need to be calculated.

[0189] Wherein, step S211 includes:

[0190] S2111. Extracting an ingredient consumption feature vector from the target recipe feature vector; wherein the ingredient consumption feature vector is used to represent the ingredients required for the target recipe;

[0191] S2112. Determine a cost function based on the food consumption feature vector;

[0192] S2113. Determine the target function of the execution network based on the cost function, the current food stimulus feature vector, the target recipe feature vector, and the current evaluation feature vector;

[0193] S2114: Determine the first feedback characteristic value according to the objective function of the execution network and the current weight of the execution network.

[0194] For example, the food consumption feature vector is x t , and t represents the number of times the corresponding neural network has been optimized for the user, then the cost function is:

[0195] U(t)=μ1x t 2 ,

[0196] Wherein, U(t) is the cost function, and μ1 is the first preset coefficient.

[0197] According to the cost function U(t), the characteristic vector of this food stimulus Target recipe feature vector m t And the feature vector of this evaluation The objective function of the execution network is:

[0198]

[0199] Among them, E A (t) is the objective function of the execution network, and μ2 is the second preset coefficient.

[0200] Based on this, the calculation method of the first feedback characteristic value is:

[0201]

[0202] Among them, D A(t) is the first feedback eigenvalue of this time, w A(t) are the current weights of the execution network.

[0203] And, the first feedback feature obtained last time is expressed as D A(t-1) , the reference feature value predicted by the previous stimulus is expressed as S A(t-1) , then the calculation method of the reference characteristic value of this stimulus prediction is:

[0204] S A(t) =(1-μ3)D A(t-1) +μ3S A(t-1) ,

[0205] Among them, S A(t) is the reference characteristic value predicted for this stimulus, and μ3 is the third preset coefficient.

[0206] Based on the current stimulus prediction reference eigenvalue S A(t) , the first feedback characteristic value D A(t) and the current learning rate α of the execution network A(t) , the calculation method of the first learning rate adjustment is:

[0207]

[0208] Among them, Δα A is the first learning rate increment, a1 is the first preset increment, and b1 is the first preset attenuation coefficient.

[0209] It should be noted that in this stimulus prediction reference characteristic value S A(t) and the first feedback eigenvalue D A(t) When the product of is greater than 0, it means that the reference characteristic value S of this stimulus prediction A(t) and the first feedback eigenvalue D A(t) The prediction direction is the same, so the first learning rate needs to be adjusted in a positive direction, and the first learning rate adjustment amount is dynamically determined as the first preset increment a1.

[0210] In this stimulus prediction reference eigenvalue S A(t) and the first feedback eigenvalue D A(t) When the product of is less than 0, it means that the reference characteristic value S of this stimulus prediction A(t) and the first feedback eigenvalue D A(t) The prediction direction is opposite to that of , so the first learning rate needs to be adjusted in the opposite direction, and the first learning rate adjustment amount is dynamically determined as the first preset attenuation coefficient b1 and the current learning rate α of the execution network A(t) The product of .

[0211] That is, in this embodiment, when the first learning rate is adjusted in a positive direction, it increases by a constant, and when the first learning rate is adjusted in a negative direction, it decreases according to a certain ratio. This ensures that the first learning rate increases linearly when adjusted in a positive direction and decreases exponentially when adjusted in a negative direction. This allows for faster learning of user preferences.

[0212] Therefore, the first learning rate for executing the network is calculated as:

[0213] α A(t+1) =Δα A +α A(t) ,

[0214] Among them, α A(t+1) The first learning rate for executing the network.

[0215] And, step S2 also includes the step of determining a second learning rate for evaluating the network:

[0216] S221, obtaining the previous ideal evaluation feature vector of the evaluation network;

[0217] S222: Calculate the second feedback eigenvalue of the evaluation network; wherein the second feedback eigenvalue is determined based on the previous ideal evaluation eigenvector, the current evaluation eigenvector, and the current weight of the evaluation network;

[0218] S223, obtaining the previous evaluation reference characteristic value and the previous second feedback characteristic value of the execution network;

[0219] S224. Determine a reference feature value for this evaluation based on the previous evaluation reference feature value and the previous second feedback feature value; wherein the previous second feedback feature value is used to represent the impact of the previously selected target recipe on the current evaluation feature vector;

[0220] S225: Determine a second learning adjustment amount based on the current evaluation reference characteristic value and the current second feedback characteristic value;

[0221] S226. Calculate the sum of the second learning adjustment amount and the current learning rate of the evaluation network to obtain a second learning rate.

[0222] It should be noted that when the neural network is optimized for the user's preferences for the first time, the reference feature value for this evaluation is also preset and does not need to be calculated.

[0223] Wherein, step S222 specifically includes:

[0224] S2221. Determine the current ideal evaluation feature vector based on the previous ideal evaluation feature vector and the current evaluation feature vector;

[0225] S2222. Determine the objective function of the evaluation network based on the current evaluation feature vector and the current ideal evaluation feature vector;

[0226] S2223. Determine the second feedback characteristic value according to the objective function of the evaluation network and the current weight of the evaluation network.

[0227] For example, the previous ideal evaluation feature vector obtained is β (t-1) , the feature vector of this evaluation is The number of times the corresponding neural network has been optimized for the user is t, so the ideal evaluation feature vector β t The calculation method is:

[0228]

[0229] Based on this ideal evaluation feature vector β t And the characteristic vector of this evaluation is The objective function of the evaluation network is:

[0230]

[0231] Among them, EC (t) is the objective function of the evaluation network, and μ4 is the fourth preset coefficient.

[0232] Based on the current weight w of the evaluation network C(t) , the second feedback eigenvalue D C(t) The calculation method is:

[0233]

[0234] And, the previous second feedback characteristic value obtained is expressed as D C(t-1) , the previous evaluation reference characteristic value is expressed as S C(t-1) , then the calculation method of the reference characteristic value of this evaluation is:

[0235] S C(t) =(1-μ5)D C(t-1) +μ5S C(t-1) ,

[0236] Among them, S C(t) is the reference characteristic value for this evaluation, and μ5 is the fifth preset coefficient.

[0237] Based on the reference characteristic value S C(t) 、The second feedback feature D C(t) And the current learning rate α of the evaluation network C(t) , the second learning rate adjustment is calculated as:

[0238]

[0239] Among them, Δα C is the second learning rate increment, a2 is the second preset increment, and b2 is the second preset attenuation coefficient.

[0240] It should be noted that in this evaluation, the reference characteristic value S C(t) and the second feedback eigenvalue D C(t) When the product of is greater than 0, it means the reference characteristic value S of this evaluation C(t) and the second feedback eigenvalue D C(t) The prediction direction is the same, so the second learning rate needs to be adjusted in a positive direction, and the second learning rate adjustment amount is dynamically determined as the second preset increment a2.

[0241] In this evaluation, the reference characteristic value S C(t) and the second feedback eigenvalue D C(t) When the product of is less than 0, it means the reference characteristic value S of this evaluation C(t) and the second feedback eigenvalue D C(t)The prediction direction is opposite to that of , so the second learning rate needs to be adjusted in the opposite direction, and the second learning rate adjustment amount is dynamically determined as the second preset attenuation coefficient b2 and the current learning rate α of the execution network C(t) The product of .

[0242] That is, in this embodiment, when the second learning rate is adjusted in a positive direction, it increases by a constant, and when it is adjusted in a negative direction, it decreases according to a certain ratio. This ensures that the second learning rate increases linearly when adjusted in a positive direction and decreases exponentially when adjusted in a negative direction. This allows for faster learning of user preferences.

[0243] Based on the first learning rate obtained in step S2, step S3 specifically includes:

[0244] S311, obtaining the previous ideal food stimulus feature vector;

[0245] S312, determining the current ideal food stimulus feature vector based on the previous ideal food stimulus feature vector and the current food stimulus feature vector;

[0246] S313, obtaining a first error gradient according to the first learning rate, the current ideal food stimulation feature vector, the current food stimulation feature vector, and the current ideal evaluation feature vector;

[0247] S314. Use the first error gradient to update the weights of the execution network.

[0248] For example, the obtained previous ideal food stimulus feature vector is represented as u t-1 , the ideal food stimulus feature vector u t The calculation method is:

[0249]

[0250] Among them, t is the number of times the corresponding neural network has been optimized for the user.

[0251] Based on the first learning rate α A(t+1) , cost function U(t), characteristic vector of this food stimulus Target recipe feature vector m t , the ideal evaluation feature vector β t , the ideal food stimulus feature vector u t and the current weight w of the execution network A(t) , the first error gradient Δw A The calculation method is:

[0252]

[0253] Calculate the current weight w of the execution network A(t) and the first error gradient ΔwA The sum of , we get the weight after executing the network update.

[0254] Correspondingly, based on the second learning rate obtained in step S2, step S3 further includes:

[0255] S321. Obtain a second error gradient according to a second learning rate;

[0256] S322. Use the second error gradient to update the weight of the evaluation network.

[0257] For example, based on the second learning rate α C(t+1) , the characteristic vector of this evaluation The ideal evaluation feature vector β t and the current weight w of the evaluation network C(t) , the second error gradient Δw C The calculation method is:

[0258]

[0259] Calculate the current weight w of the evaluation network C(t) and the second error gradient Δw C The sum of , we can get the updated weight of the evaluation network.

[0260] In step S4, since the execution network and evaluation network of the neural network have been optimized accordingly, in response to the update of the food library information, new recommended recipes can be determined based on the optimized neural network according to the updated food library information, so that the output recommended recipes are more in line with the user's preferences.

[0261] Example 2

[0262] This embodiment provides a recipe recommendation system.

[0263] See also Figure 3 , the recipe recommendation system includes:

[0264] A response module 41 is configured to respond to a user selecting a target recipe from the recommended recipes and obtain a target recipe feature vector based on the target recipe; wherein the recommended recipe is determined based on the recommended recipe feature vector, which is the output of the neural network based on the information in the ingredient library;

[0265] a learning rate calculation module 42 for determining a learning rate of a neural network based on a target recipe feature vector;

[0266] A network updating module 43 is used to optimize the neural network according to the learning rate;

[0267] The recommended recipe updating module 44 is configured to respond to the update of the food library information and determine a new recommended recipe based on the updated food library information based on the optimized neural network.

[0268] The above-mentioned recipe recommendation system uses a neural network to generate one or more recommended recipes for the user based on the acquired ingredient library information, parses the target recipe determined by the user from one or more recommended recipes, obtains the target recipe feature vector, and adjusts the learning rate of the neural network based on the target recipe feature vector so that the neural network learns the user's preferences and thus recommends recipes more accurately.

[0269] In this embodiment, see Figure 2 ,The neural network includes execution network, model network and evaluation network.

[0270] First, the neural network extracts the food library feature vector from the food library information.

[0271] Specifically, the neural network is used to count the types of ingredients and the quantity of each type of ingredients based on the information of the ingredient library to obtain a feature vector of the ingredient library.

[0272] Then, the food library feature vector is input into the execution network, and the execution network is used to output the food stimulus feature vector according to the food library feature vector.

[0273] Specifically, the ingredient stimulation feature vector is used to simulate the different stimulations that different ingredients in the ingredient library information produce on the user.

[0274] Next, the ingredient library feature vector and the ingredient stimulation feature vector are input into the model network, and the model network is used to output a recommended recipe feature vector based on the ingredient library feature vector and the ingredient stimulation feature vector.

[0275] Specifically, the model network mainly predicts the user's preferred recipes based on the known ingredient library information and the different stimulations produced by various ingredients for different users, and then generates a recommended recipe feature vector.

[0276] For example, the feature vector of the recommended recipe mainly includes predictions of multiple dimensions such as cooking method, type of meat and vegetable used, type of material used, saltiness, sweetness, spiciness, and sourness.

[0277] After the model network outputs a recommended recipe feature vector, the recommended recipe update module 44 is used to calculate the matching degree between the recommended recipe feature vector and the recipe feature vectors of different recipes in the preset recipe database, and determine a recommended recipe based on the matching degree. The user can then select a target recipe from one or more recommended recipes.

[0278] For example, recipes corresponding to recipe feature vectors with a matching degree greater than a preset threshold are selected as recommended recipes, and are ranked by matching degree. Specifically, based on the number of recipes that can be displayed per page, recommended recipes with high matching degrees are placed on the first few pages for display and recommendation. Alternatively, the ranking can be performed based on the calculated matching degree, with a preset number of recipes ranked at the top being selected as recommended recipes.

[0279] Among them, in addition to the common similarity algorithm, the matching degree can also be calculated by taking the difference between the recommended recipe feature vector and the recipe feature vector and taking the norm to obtain the matching degree.

[0280] Finally, in response to the user's selected target recipe, a target recipe feature vector is extracted from the target recipe and input into the evaluation network, which then outputs an evaluation feature vector based on the target recipe feature vector. Based on this evaluation feature vector, the weights of the execution network and the evaluation network are adjusted to ensure that the ingredient stimulus feature vector output by the execution network is more closely aligned with the actual stimulus that different ingredients actually induce in the user.

[0281] Among them, adjusting the weights of the execution network and the evaluation network requires first determining the learning rate of the network.

[0282] Specifically, the learning rate calculation module 42 includes a first learning rate determination unit 421, which is used to calculate the first feedback characteristic value of this time; wherein, the first feedback characteristic value of this time is determined based on the target recipe characteristic vector, the current ingredient stimulation characteristic vector, the current evaluation characteristic vector and the current weight of the execution network; obtain the previous first feedback characteristic and the previous stimulation prediction reference characteristic value of the execution network; determine the current stimulation prediction reference characteristic value based on the previous first feedback characteristic value and the previous stimulation prediction reference characteristic value; wherein, the previous first feedback characteristic value is used to characterize the influence of the previously selected target recipe on the current ingredient stimulation characteristic vector; determine the first learning adjustment amount based on the current first feedback characteristic value and the current stimulation prediction reference characteristic value; calculate the sum of the first learning adjustment amount and the current learning rate of the execution network to obtain the first learning rate.

[0283] It should be noted that when the neural network is optimized for the user's preferences for the first time, the reference feature value for the stimulus prediction is preset and does not need to be calculated.

[0284] Among them, the first learning rate determination unit 421 is used to extract the ingredient consumption feature vector from the target recipe feature vector; wherein, the ingredient consumption feature vector is used to characterize the ingredients that need to be consumed by the target recipe; the cost function is determined based on the ingredient consumption feature vector; the objective function of the execution network is determined according to the cost function, the current ingredient stimulation feature vector, the target recipe feature vector and the current evaluation feature vector; the first feedback feature value is determined according to the objective function of the execution network and the current weight of the execution network.

[0285] For example, the food consumption feature vector is x t , and t represents the number of times the corresponding neural network has been optimized for the user, then the cost function is:

[0286] U(t)=μ1x t 2 ,

[0287] Wherein, U(t) is the cost function, and μ1 is the first preset coefficient.

[0288] According to the cost function U(t), the characteristic vector of this food stimulus Target recipe feature vector m t And the feature vector of this evaluation The objective function of the execution network is:

[0289]

[0290] Among them, E A (t) is the objective function of the execution network, and μ2 is the second preset coefficient.

[0291] Based on this, the calculation method of the first feedback characteristic value is:

[0292]

[0293] Among them, D A(t) is the first feedback eigenvalue of this time, w A(t) are the current weights of the execution network.

[0294] And, the first feedback feature obtained last time is expressed as D A(t-1) , the reference feature value predicted by the previous stimulus is expressed as S A(t-1) , then the calculation method of the reference characteristic value of this stimulus prediction is:

[0295] S A(t) =(1-μ3)D A(t-1) +μ3S A(t-1) ,

[0296] Among them, S A(t) is the reference characteristic value predicted for this stimulus, and μ3 is the third preset coefficient.

[0297] Based on the current stimulus prediction reference eigenvalue S A(t) , the first feedback characteristic value D A(t) and the current learning rate α of the execution network A(t) , the calculation method of the first learning rate adjustment is:

[0298]

[0299] Among them, Δα A is the first learning rate increment, a1 is the first preset increment, and b1 is the first preset attenuation coefficient.

[0300] It should be noted that in this stimulus prediction reference characteristic value S A(t) and the first feedback eigenvalue D A(t) When the product of is greater than 0, it means that the reference characteristic value S of this stimulus prediction A(t) and the first feedback eigenvalue D A(t) The prediction direction is the same, so the first learning rate needs to be adjusted in a positive direction, and the first learning rate adjustment amount is dynamically determined as the first preset increment a1.

[0301] In this stimulus prediction reference eigenvalue S A(t) and the first feedback eigenvalue D A(t) When the product of is less than 0, it means that the reference characteristic value S of this stimulus prediction A(t) and the first feedback eigenvalue D A(t) The prediction direction is opposite to that of , so the first learning rate needs to be adjusted in the opposite direction, and the first learning rate adjustment amount is dynamically determined as the first preset attenuation coefficient b1 and the current learning rate α of the execution network A(t) The product of .

[0302] That is, in this embodiment, when the first learning rate is adjusted in a positive direction, it increases by a constant, and when the first learning rate is adjusted in a negative direction, it decreases according to a certain ratio. This ensures that the first learning rate increases linearly when adjusted in a positive direction and decreases exponentially when adjusted in a negative direction. This allows for faster learning of user preferences.

[0303] Therefore, the first learning rate for executing the network is calculated as:

[0304] α A(t+1) =Δα A +α A(t) ,

[0305] Among them, α A(t+1) The first learning rate for executing the network.

[0306] In addition, the learning rate calculation module 42 also includes a second learning rate determination unit 422, which is used to obtain the previous ideal evaluation feature vector of the evaluation network; calculate the second feedback feature value of the evaluation network; wherein the second feedback feature value is determined based on the previous ideal evaluation feature vector, the current evaluation feature vector and the current weight of the evaluation network; obtain the previous evaluation reference feature value and the previous second feedback feature value of the execution network; determine the current evaluation reference feature value based on the previous evaluation reference feature value and the previous second feedback feature value; wherein the previous second feedback feature value is used to characterize the influence of the target recipe selected last on the current evaluation feature vector; determine the second learning adjustment amount based on the current evaluation reference feature value and the current second feedback feature value; calculate the sum of the second learning adjustment amount and the current learning rate of the evaluation network to obtain the second learning rate.

[0307] It should be noted that when the neural network is optimized for the user's preferences for the first time, the reference feature value for this evaluation is also preset and does not need to be calculated.

[0308] Among them, the second learning rate determination unit 422 is used to determine the ideal evaluation feature vector based on the previous ideal evaluation feature vector and the current evaluation feature vector; determine the objective function of the evaluation network based on the current evaluation feature vector and the current ideal evaluation feature vector; determine the second feedback feature value based on the objective function of the evaluation network and the current weight of the evaluation network.

[0309] For example, the previous ideal evaluation feature vector obtained is β (t-1) , the feature vector of this evaluation is The number of times the corresponding neural network has been optimized for the user is t, so the ideal evaluation feature vector β t The calculation method is:

[0310]

[0311] Based on this ideal evaluation feature vector β t And the characteristic vector of this evaluation is The objective function of the evaluation network is:

[0312]

[0313] Among them, E C (t) is the objective function of the evaluation network, and μ4 is the fourth preset coefficient.

[0314] Based on the current weight w of the evaluation network C(t) , the second feedback eigenvalue D C(t) The calculation method is:

[0315]

[0316] And, the previous second feedback characteristic value obtained is expressed as D C(t-1) , the previous evaluation reference characteristic value is expressed as S C(t-1) , then the calculation method of the reference characteristic value of this evaluation is:

[0317] S C(t) =(1-μ5)D C(t-1) +μ5S C(t-1) ,

[0318] Among them, S C(t) is the reference characteristic value for this evaluation, and μ5 is the fifth preset coefficient.

[0319] Based on the reference characteristic value S C(t) 、The second feedback feature D C(t) And the current learning rate α of the evaluation network C(t) , the second learning rate adjustment is calculated as:

[0320]

[0321] Among them, Δα C is the second learning rate increment, a2 is the second preset increment, and b2 is the second preset attenuation coefficient.

[0322] It should be noted that in this evaluation, the reference characteristic value S C(t) and the second feedback eigenvalue D C(t) When the product of is greater than 0, it means the reference characteristic value S of this evaluation C(t) and the second feedback eigenvalue D C(t) The prediction direction is the same, so the second learning rate needs to be adjusted in a positive direction, and the second learning rate adjustment amount is dynamically determined as the second preset increment a2.

[0323] In this evaluation, the reference characteristic value S C(t) and the second feedback eigenvalue D C(t) When the product of is less than 0, it means the reference characteristic value S of this evaluation C(t) and the second feedback eigenvalue D C(t) The prediction direction is opposite to that of , so the second learning rate needs to be adjusted in the opposite direction, and the second learning rate adjustment amount is dynamically determined as the second preset attenuation coefficient b2 and the current learning rate α of the execution network C(t) The product of .

[0324] That is, in this embodiment, when the second learning rate is adjusted in a positive direction, it increases by a constant, and when it is adjusted in a negative direction, it decreases according to a certain ratio. This ensures that the second learning rate increases linearly when adjusted in a positive direction and decreases exponentially when adjusted in a negative direction. This allows for faster learning of user preferences.

[0325] Based on the first learning rate obtained by the learning rate calculation module 42 , the network updating module 43 includes a network optimization execution unit 431 .

[0326] The execution network optimization unit 431 is used to obtain the previous ideal food stimulus feature vector; determine the current ideal food stimulus feature vector based on the previous ideal food stimulus feature vector and the current food stimulus feature vector; obtain the first error gradient based on the first learning rate, the current ideal food stimulus feature vector, the current food stimulus feature vector and the current ideal evaluation feature vector; and use the first error gradient to update the weights of the execution network.

[0327] For example, the obtained previous ideal food stimulus feature vector is represented as u t-1 , the ideal food stimulus feature vector u t The calculation method is:

[0328]

[0329] Among them, t is the number of times the corresponding neural network has been optimized for the user.

[0330] Based on the first learning rate α A(t+1) , cost function U(t), characteristic vector of this food stimulus Target recipe feature vector m t , the ideal evaluation feature vector β t , the ideal food stimulus feature vector u t and the current weight w of the execution network A(t) , the first error gradient Δw A The calculation method is:

[0331]

[0332] Calculate the current weight w of the execution network A(t) and the first error gradient Δw A The sum of , we get the weight after executing the network update.

[0333] Correspondingly, based on the second learning rate obtained by the learning rate calculation module 42 , the network updating module 43 further includes a network optimization evaluation unit 432 .

[0334] The evaluation network optimization unit 432 is configured to obtain a second error gradient according to the second learning rate; and use the second error gradient to update the weight of the evaluation network.

[0335] For example, based on the second learning rate α C(t+1) , the characteristic vector of this evaluation The ideal evaluation feature vector β tand the current weight w of the evaluation network C(t) , the second error gradient Δw C The calculation method is:

[0336]

[0337] Calculate the current weight w of the evaluation network C(t) and the second error gradient Δw C The sum of , we can get the updated weight of the evaluation network.

[0338] In the recommended recipe update module 44, since the execution network and the evaluation network of the neural network have been optimized accordingly, in response to the update of the food library information, new recommended recipes can be determined based on the optimized neural network and the updated food library information, so that the output recommended recipes are more in line with the user's preferences.

[0339] In actual application scenarios, this recipe recommendation system can be applied to various smart terminals, such as smart refrigerators, mobile phones, computers, and other terminals.

[0340] Exemplarily, the recipe recommendation system can be used in a smart refrigerator equipped with a display screen and a camera. The camera captures video frames of users storing or taking food out of the refrigerator to update the food library information in real time. In response to the update of the food library information, the smart refrigerator intelligently generates recommended recipes for the user based on a neural network, and outputs and displays them in various forms such as video, pictures, and audio to facilitate user selection. After the user selects a target recipe from the recommended recipes, the target recipe is analyzed and learned to optimize the neural network. The neural network is then used to learn the user's preferred cooking methods, types of ingredients, flavors, and other aspects in a multi-dimensional manner to recommend recipes that meet the user's preferences.

[0341] At the same time, to reduce the computational complexity of smart terminals, cloud computing can be used to transmit locally collected data to the cloud for computation, and then return the results to the smart terminal. This can effectively alleviate the hardware pressure of smart terminals and reduce unnecessary hardware costs.

[0342] Exemplary, reference Figure 4The smart refrigerator collects video frame images through the camera module, and the central processing unit uploads the collected video frame images to the cloud for analysis. After the cloud analysis is completed, the latest food library information is returned to the smart refrigerator. After receiving the latest food library information, the central processing unit saves it to the local storage module. When the central processing unit detects that the food library information in the local storage module is updated, it uses the recipe recommendation module to generate a suitable recommended recipe based on the local food library information. The central processing unit displays the recommended recipe through the touch display module (such as a touch screen) based on the recommended recipe determined by the recipe recommendation module, and can also broadcast the recommended recipe through the voice module.

[0343] Specifically, the camera module mainly captures video frames through the triggering of user behavior.

[0344] For example, the camera module captures data at a standard of 30 frames per minute, marks the identified food with a food frame, and marks the video frame image containing the food frame as a valid frame. Then, in the captured valid frame, the actual displacement of the food is calculated based on the front and back displacement of the food frame to determine whether the current operation is a removal action or a placement action.

[0345] In addition, the camera module also integrates face recognition function, and establishes different preference data tables for different users. The operation of the current user mode only affects the preference data table of the current user, realizing the accurate recipe recommendation function of multi-user mode.

[0346] It should be understood that since the hardware of a mobile phone or computer is usually sufficient for recipe recommendation and also provides interactive functions, the application software formed based on the recipe recommendation method can also be run on terminals such as mobile phones and computers.

[0347] For example, when the smart refrigerator is connected to the Internet, it can directly or indirectly transmit the food library information to a mobile phone or computer. After the relevant application software outputs the recommended recipe based on the obtained food library information, the user can directly use the mobile phone or computer to select the target recipe.

[0348] Example 3

[0349] This embodiment provides an electronic device.

[0350] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Example 3 of the present disclosure. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the recipe recommendation method described in Example 1 is implemented. Figure 5 The electronic device 50 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0351] In practical applications, electronic devices can be smart refrigerators, mobile phones, computers and other equipment products.

[0352] like Figure 5 As shown, the electronic device 50 may also be in the form of a general-purpose computing device, such as a server device. Components of the electronic device 50 may include, but are not limited to, the at least one processor 51, the at least one memory 52, and a bus 53 connecting different system components (including the memory 52 and the processor 51).

[0353] The bus 53 includes a data bus, an address bus, and a control bus.

[0354] The memory 52 may include a volatile memory, such as a random access memory (RAM) 521 and / or a cache memory 522 , and may further include a read-only memory (ROM) 523 .

[0355] The memory 52 may also include a program / utility 525 having a set (at least one) of program modules 524, such program modules 524 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0356] The processor 51 executes various functional applications and data processing by running computer programs stored in the memory 52, such as the recipe recommendation method described in Example 1 of the present disclosure.

[0357] The electronic device 50 may also communicate with one or more external devices 54 (e.g., a keyboard, a pointing device, etc.). Such communication may be performed via an input / output (I / O) interface 55. Furthermore, the model generating device 50 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 56. Figure 5 As shown, the network adapter 56 communicates with the other modules of the model-generating device 50 via the bus 53. It should be understood that, although not shown in the figures, other hardware and / or software modules may be used in conjunction with the model-generating device 50, including but not limited to microcode, device drivers, redundant processors, external disk drive arrays, RAID (RAID) systems, tape drives, and data backup storage systems.

[0358] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.

[0359] Example 4

[0360] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the recipe recommendation method described in Example 1 is implemented.

[0361] The readable storage medium may include, but is not limited to, a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0362] In a possible implementation manner, the present disclosure may also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute and implement the recipe recommendation method described in Example 1.

[0363] The program code for executing the present disclosure may be written in any combination of one or more programming languages, and the program code may be executed entirely on the user device, partially on the user device, as a standalone software package, partially on the user device and partially on a remote device, or entirely on the remote device.

[0364] Although specific embodiments of the present invention have been described above, those skilled in the art will appreciate that these are merely illustrative and that the scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, and such changes and modifications are intended to fall within the scope of the present invention.

Claims

1. A recipe recommendation method, characterized in that: The recipe recommendation method comprises: In response to a target recipe selected by a user from the recommended recipes, a target recipe feature vector is obtained based on the target recipe; wherein the recommended recipe is determined based on the recommended recipe feature vector, and the recommended recipe feature vector is output by a neural network based on information in the ingredient library; determining a learning rate of the neural network based on the target recipe feature vector; optimizing the neural network according to the learning rate; In response to the update of the food library information, determining a new recommended recipe based on the optimized neural network according to the updated food library information; The neural network includes an execution network, a model network and an evaluation network; The execution network is used to output a food stimulus feature vector according to the food library information; wherein the food stimulus feature vector is used to simulate different stimuli to the user caused by different foods in the food library information; The model network is used to simulate the user and output the recommended recipe feature vector based on the food stimulus feature vector and the food library information; The evaluation network is used to output an evaluation feature vector according to the target recipe feature vector; The step of determining the learning rate of the neural network based on the target recipe feature vector includes: Calculating a first feedback feature value; wherein the first feedback feature value is determined based on the target recipe feature vector, the current ingredient stimulation feature vector, the current evaluation feature vector, and the current weight of the execution network; Obtaining a previous first feedback feature value and a previous stimulus prediction reference feature value of the execution network; Determining a current stimulation prediction reference eigenvalue based on the previous first feedback eigenvalue and the previous stimulation prediction reference eigenvalue; wherein the previous first feedback eigenvalue is used to characterize the influence of the previously selected target recipe on the current food stimulus eigenvector; determining a first learning adjustment amount according to the first feedback characteristic value and the stimulation prediction reference characteristic value; The sum of the first learning adjustment amount and the current learning rate of the execution network is calculated to obtain a first learning rate of the execution network.

2. The recipe recommendation method according to claim 1, characterized in that: The step of calculating the first feedback characteristic value includes: Extracting an ingredient consumption feature vector from the target recipe feature vector; wherein the ingredient consumption feature vector is used to represent the ingredients required to be consumed by the target recipe; determining a cost function based on the food consumption feature vector; Determining the objective function of the execution network according to the cost function, the current food stimulus feature vector, the target recipe feature vector, and the current evaluation feature vector; The first feedback characteristic value is determined according to the objective function of the execution network and the current weight of the execution network.

3. The recipe recommendation method according to claim 2, characterized in that: The cost function is: U(t)=μ1x t 2 , Where U(t) is the cost function, x t is the food consumption feature vector, μ1 is the first preset coefficient, and t is the number of times the neural network has been optimized for the user; The objective function of the execution network is: Among them, E A (t) is the objective function of the execution network, is the food stimulus feature vector, is the characteristic vector of this evaluation, m t is the target recipe feature vector, μ2 is the second preset coefficient; The calculation method of the first feedback characteristic value is: Among them, D A(t) is the first feedback characteristic value of this time, w A(t) is the current weight of the execution network.

4. The recipe recommendation method according to claim 1, wherein: The calculation method of the reference characteristic value of the current stimulus prediction is: S A(t) =(1-μ3)D A(t-1) +μ3S A(t-1) , Among them, S A(t) is the reference feature value predicted for this stimulus, D A(t-1) is the first feedback characteristic value of the previous time, S A(t-1) is the reference characteristic value predicted by the previous stimulation, μ3 is the third preset coefficient, and t is the number of times the neural network has been optimized for the user corresponding to this time; The calculation method of the first learning rate adjustment amount is: Among them, Δα A is the first learning rate increment, D A(t) is the first feedback feature of this time, a1 is the first preset increment, b1 is the first preset attenuation coefficient, α A(t) is the current learning rate of the execution network.

5. The recipe recommendation method according to claim 2, characterized in that: The step of determining the learning rate of the neural network based on the target recipe feature vector includes: Obtaining a previous ideal evaluation feature vector of the evaluation network; Calculating the second feedback eigenvalue of the evaluation network; wherein the second feedback eigenvalue is determined based on the previous ideal evaluation eigenvector, the current evaluation eigenvector, and the current weight of the evaluation network; Obtaining a previous evaluation reference characteristic value and a previous second feedback characteristic value of the execution network; Determining a reference feature value for this evaluation based on the previous evaluation reference feature value and the previous second feedback feature value; wherein the previous second feedback feature value is used to represent the influence of the previously selected target recipe on the current evaluation feature vector; Determining a second learning adjustment amount according to the current evaluation reference characteristic value and the current second feedback characteristic value; The second learning rate of the evaluation network is obtained by calculating the sum of the second learning adjustment amount and the current learning rate of the evaluation network.

6. The recipe recommendation method according to claim 5, characterized in that: The step of calculating the second feedback characteristic value of the evaluation network includes: Determine the current ideal evaluation feature vector according to the previous ideal evaluation feature vector and the current evaluation feature vector; Determining the objective function of the evaluation network according to the current evaluation feature vector and the current ideal evaluation feature vector; The second feedback characteristic value is determined according to the objective function of the evaluation network and the current weight of the evaluation network.

7. The recipe recommendation method according to claim 6, characterized in that: The calculation method of the ideal evaluation feature vector is: Among them, β t is the ideal evaluation feature vector for this time, is the characteristic vector of this evaluation, β (t-1) is the previous ideal evaluation feature vector, and t is the number of times the neural network has been optimized for the user; The objective function of the evaluation network is: Among them, E C (t) is the objective function of the evaluation network, μ4 is the fourth preset coefficient; The calculation method of the second feedback characteristic value is: Among them, D C(t) is the second feedback characteristic value of this time, w C(t) The current weights of the evaluation network.

8. The recipe recommendation method according to claim 5, characterized in that: The calculation method of the reference characteristic value of this evaluation is: S C(t) =(1-μ5)D C(t-1) +μ5S C(t-1) , Among them, S C(t) is the reference characteristic value of this evaluation, D C(t-1) is the second feedback characteristic value of the previous time, S C(t-1) is the reference characteristic value of the previous evaluation, μ5 is the fifth preset coefficient, and t is the number of times the neural network has been optimized for the user corresponding to this time; The second learning adjustment amount is calculated as follows: Among them, Δα C is the second learning adjustment amount, S C(t) is the reference characteristic value of this evaluation, D C(t) is the second feedback feature, a2 is the second preset increment, b2 is the second preset attenuation coefficient, α C(t) is the current learning rate of the evaluation network.

9. The recipe recommendation method according to claim 6, characterized in that: The step of optimizing the neural network according to the learning rate comprises: Obtain the previous ideal food stimulus feature vector; Determine the current ideal food stimulus feature vector according to the previous ideal food stimulus feature vector and the current food stimulus feature vector; Obtaining a first error gradient according to the first learning rate, the current ideal food stimulation feature vector, the current food stimulation feature vector, and the current ideal evaluation feature vector; Updating the weights of the execution network using the first error gradient; The calculation method of the ideal food stimulus feature vector is as follows: The first error gradient is calculated as follows: Where Δw A is the first error gradient, α A(t+1) is the first learning rate, U(t) is the cost function, is the food stimulus feature vector, u t is the ideal food stimulus feature vector, u t-1 is the feature vector of the previous ideal food stimulus, m t is the target recipe feature vector, β t is the ideal evaluation feature vector, w A(t) is the current weight of the execution network, and t is the number of times the neural network has been optimized for the user.

10. The recipe recommendation method according to claim 6, characterized in that: The step of optimizing the neural network according to the learning rate comprises: Obtaining a second error gradient according to the second learning rate; Updating the weights of the evaluation network using the second error gradient; The second error gradient is calculated as follows: Where Δw C is the second error gradient, α C(t+1) For the second learning rate, is the characteristic vector of this evaluation, β t is the ideal evaluation feature vector, w C(t) is the current weight of the evaluation network, and t is the number of times the neural network has been optimized for the user.

11. The recipe recommendation method according to claim 1, wherein: The neural network is used to count the types of ingredients and the quantity of each type of ingredients according to the food library information to obtain a food library feature vector, and input the food library feature vector into the execution network.

12. The recipe recommendation method according to claim 1, wherein: The recipe recommendation method comprises: Calculating a matching degree between the recommended recipe feature vector and the recipe feature vectors in the recipe database; The recommended recipe is determined according to the matching degree.

13. A recipe recommendation system, characterized in that: The recipe recommendation system includes: a response module, configured to, in response to a target recipe selected by a user from the recommended recipes, obtain a target recipe feature vector based on the target recipe; wherein the recommended recipe is determined based on the recommended recipe feature vector, which is output by a neural network based on information in the ingredient library; a learning rate calculation module, configured to determine a learning rate of the neural network based on the target recipe feature vector; A network updating module, configured to optimize the neural network according to the learning rate; a recommended recipe updating module, configured to determine a new recommended recipe based on the updated food library information and the optimized neural network in response to the update of the food library information; The neural network includes an execution network, a model network and an evaluation network; The execution network is used to output a food stimulus feature vector according to the food library information; wherein the food stimulus feature vector is used to simulate different stimuli to the user caused by different foods in the food library information; The model network is used to simulate the user and output the recommended recipe feature vector based on the food stimulus feature vector and the food library information; The evaluation network is used to output an evaluation feature vector according to the target recipe feature vector; The learning rate calculation module includes a first learning rate determination unit; The first learning rate determination unit is used to calculate the first feedback characteristic value of this time; wherein, the first feedback characteristic value of this time is determined according to the target recipe characteristic vector, the current ingredient stimulation characteristic vector, the current evaluation characteristic vector and the current weight of the execution network; obtain the previous first feedback characteristic value and the previous stimulation prediction reference characteristic value of the execution network; determine the current stimulation prediction reference characteristic value according to the previous first feedback characteristic value and the previous stimulation prediction reference characteristic value; wherein, the previous first feedback characteristic value is used to characterize the influence of the target recipe selected last on the current ingredient stimulation characteristic vector; determine the first learning adjustment amount according to the current first feedback characteristic value and the current stimulation prediction reference characteristic value; calculate the sum of the first learning adjustment amount and the current learning rate of the execution network to obtain the first learning rate.

14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the recipe recommendation method according to any one of claims 1 to 12 is implemented.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the recipe recommendation method according to any one of claims 1 to 12 is implemented.

16. A chip, characterized in that: The chip includes a processor, and the chip executes the recipe recommendation method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Massage program intelligent recommendation method and system based on deep learning

    CN112559860A

  • Menu recommendation method, electronic equipment and storage medium

    CN115269963A