WO2022133985A1 - 食物推荐方法、装置、存储介质及电子设备 - Google Patents
食物推荐方法、装置、存储介质及电子设备 Download PDFInfo
- Publication number
- WO2022133985A1 WO2022133985A1 PCT/CN2020/139313 CN2020139313W WO2022133985A1 WO 2022133985 A1 WO2022133985 A1 WO 2022133985A1 CN 2020139313 W CN2020139313 W CN 2020139313W WO 2022133985 A1 WO2022133985 A1 WO 2022133985A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- meal
- vector
- food
- target
- user
- Prior art date
Links
- 235000013305 food Nutrition 0.000 title claims abstract description 314
- 238000000034 method Methods 0.000 title claims abstract description 88
- 235000012054 meals Nutrition 0.000 claims description 296
- 239000013598 vector Substances 0.000 claims description 265
- 235000015097 nutrients Nutrition 0.000 claims description 84
- 230000007246 mechanism Effects 0.000 claims description 34
- 230000006870 function Effects 0.000 claims description 24
- 238000004422 calculation algorithm Methods 0.000 claims description 17
- 238000013528 artificial neural network Methods 0.000 claims description 15
- 239000011159 matrix material Substances 0.000 claims description 15
- 238000003062 neural network model Methods 0.000 claims description 12
- 235000021049 nutrient content Nutrition 0.000 claims description 11
- 102000004169 proteins and genes Human genes 0.000 claims description 11
- 108090000623 proteins and genes Proteins 0.000 claims description 11
- 150000001720 carbohydrates Chemical class 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 10
- 238000000605 extraction Methods 0.000 claims description 9
- 238000005295 random walk Methods 0.000 claims description 9
- 238000012549 training Methods 0.000 claims description 9
- 230000015654 memory Effects 0.000 claims description 7
- 201000010099 disease Diseases 0.000 claims description 5
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 claims description 5
- 238000006243 chemical reaction Methods 0.000 claims description 4
- 238000004364 calculation method Methods 0.000 claims description 3
- 238000012545 processing Methods 0.000 abstract description 8
- 230000008569 process Effects 0.000 description 13
- 235000021395 porridge Nutrition 0.000 description 10
- 235000007688 Lycopersicon esculentum Nutrition 0.000 description 8
- 241000657513 Senna surattensis Species 0.000 description 8
- 240000003768 Solanum lycopersicum Species 0.000 description 8
- 235000014633 carbohydrates Nutrition 0.000 description 8
- 238000010586 diagram Methods 0.000 description 8
- 235000021186 dishes Nutrition 0.000 description 8
- 241000209094 Oryza Species 0.000 description 7
- 235000007164 Oryza sativa Nutrition 0.000 description 7
- 235000021152 breakfast Nutrition 0.000 description 7
- 235000009566 rice Nutrition 0.000 description 7
- 235000014347 soups Nutrition 0.000 description 7
- 238000004891 communication Methods 0.000 description 6
- 235000008429 bread Nutrition 0.000 description 5
- 240000007124 Brassica oleracea Species 0.000 description 4
- 235000003899 Brassica oleracea var acephala Nutrition 0.000 description 4
- 235000011301 Brassica oleracea var capitata Nutrition 0.000 description 4
- 235000001169 Brassica oleracea var oleracea Nutrition 0.000 description 4
- 206010012601 diabetes mellitus Diseases 0.000 description 4
- 235000013601 eggs Nutrition 0.000 description 4
- 239000004615 ingredient Substances 0.000 description 4
- 235000016709 nutrition Nutrition 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000006399 behavior Effects 0.000 description 3
- 235000005911 diet Nutrition 0.000 description 3
- 238000010801 machine learning Methods 0.000 description 3
- 230000000378 dietary effect Effects 0.000 description 2
- 230000003203 everyday effect Effects 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 235000015219 food category Nutrition 0.000 description 2
- 238000011478 gradient descent method Methods 0.000 description 2
- 230000036541 health Effects 0.000 description 2
- 238000010606 normalization Methods 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 230000000306 recurrent effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 230000006403 short-term memory Effects 0.000 description 2
- 235000013311 vegetables Nutrition 0.000 description 2
- 235000000832 Ayote Nutrition 0.000 description 1
- 241001474374 Blennius Species 0.000 description 1
- 235000005979 Citrus limon Nutrition 0.000 description 1
- 244000131522 Citrus pyriformis Species 0.000 description 1
- 240000004244 Cucurbita moschata Species 0.000 description 1
- 235000009854 Cucurbita moschata Nutrition 0.000 description 1
- 235000009804 Cucurbita pepo subsp pepo Nutrition 0.000 description 1
- 239000000654 additive Substances 0.000 description 1
- 230000000996 additive effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013527 convolutional neural network Methods 0.000 description 1
- 230000002354 daily effect Effects 0.000 description 1
- 235000021185 dessert Nutrition 0.000 description 1
- 235000011850 desserts Nutrition 0.000 description 1
- 230000037213 diet Effects 0.000 description 1
- 235000006694 eating habits Nutrition 0.000 description 1
- 235000011389 fruit/vegetable juice Nutrition 0.000 description 1
- 150000004676 glycans Chemical class 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 235000013336 milk Nutrition 0.000 description 1
- 239000008267 milk Substances 0.000 description 1
- 210000004080 milk Anatomy 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 150000002772 monosaccharides Chemical class 0.000 description 1
- 230000035764 nutrition Effects 0.000 description 1
- 235000006180 nutrition needs Nutrition 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000010422 painting Methods 0.000 description 1
- 229920001282 polysaccharide Polymers 0.000 description 1
- 239000005017 polysaccharide Substances 0.000 description 1
- 238000011176 pooling Methods 0.000 description 1
- 235000015277 pork Nutrition 0.000 description 1
- 235000015136 pumpkin Nutrition 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
- 235000019605 sweet taste sensations Nutrition 0.000 description 1
- 230000002123 temporal effect Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16H—HEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
- G16H20/00—ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance
- G16H20/60—ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance relating to nutrition control, e.g. diets
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16H—HEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
- G16H50/00—ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics
- G16H50/20—ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics for computer-aided diagnosis, e.g. based on medical expert systems
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16H—HEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
- G16H50/00—ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics
- G16H50/70—ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics for mining of medical data, e.g. analysing previous cases of other patients
Definitions
- the present disclosure relates to the technical field of data processing, and in particular, to a food recommendation method, a food recommendation apparatus, a computer-readable storage medium, and an electronic device.
- the present disclosure provides a food recommendation method, a food recommendation apparatus, a computer-readable storage medium, and an electronic device.
- the present disclosure provides a food recommendation method, including:
- a recommendation model is used to determine a target recommended recipe.
- using a recommendation model to determine a target recommended recipe based on a plurality of foods to be recommended and the historical meal data includes:
- the target recommended recipe is determined through the hierarchical graph model.
- the building a hierarchical graph model based on the plurality of foods to be recommended includes:
- the hierarchical graph model is constructed with multiple foods to be recommended as nodes and paths between the nodes as edges.
- the determination of the target recommended recipes through the hierarchical graph model based on the historical meal data and a random walk algorithm includes:
- the food to be recommended contained in the path with the largest weight is determined as the target recommended recipe.
- determining the food to be recommended included in the path with the largest weight as the target recommended recipe includes:
- the probability that the user selects the target recommended recipe is determined based on the first probability value and the second probability value.
- using a recommendation model to determine a target recommended recipe based on a plurality of foods to be recommended and the historical meal data further includes:
- an attention mechanism model is used to determine a target recommended recipe.
- the target recommended recipe is determined by using an attention mechanism model based on a plurality of foods to be recommended and the historical meal data, including:
- multiple templates are preset for the catering rules of each meal
- the enhanced vector of the target template is classified through a neural network classifier, and the target recommended recipe corresponding to the target template is output.
- the implicit vector of each meal includes a second vector and a third vector; the acquiring the food of each meal in the user's historical meal data, and quantizing the food vector, And perform feature extraction on the food vector to obtain the implicit vector of each meal, including:
- the first vector of each meal is operated on with the second parameter matrix to obtain the third vector of each meal.
- the method further includes:
- each group of sample information includes: the implicit vector of each meal and the multiple template vectors;
- the operation is performed on the implicit vector of each meal and the target template vector to obtain an enhanced vector of the target template, including:
- the third vector of each meal is weighted and averaged to obtain the enhancement vector of the target template.
- the method further includes:
- the method further includes:
- the quality of each food in the target recommended recipe is determined according to the quality of each nutrient required for each meal.
- determining the quality of each food in the target recommended recipe according to the quality of each nutrient required for each meal includes:
- the quality of each food in the target recommended recipe is determined according to the quality of each nutrient required for each meal.
- the determining the quality of each nutrient required by the user for each meal according to the basic information of the user includes:
- nutrientCount n is the quality of the nth nutrient; energy is the energy value of each meal required by the user of the recipe to be recommended; ratio n is the proportional coefficient of the nth nutrient to the energy value of each meal; param n is the nth nutrient conversion Energy coefficient; n is a positive integer.
- the quality of each food in the target recommended recipe is determined according to the quality of each nutrient required for each meal, including:
- fat m is the fat content of the mth food
- x m is the quality of the mth food
- Count 1 is the fat mass required by the user of the recipe to be recommended for each meal
- protein m is the content of the mth food.
- the protein content contained Count 2 is the protein quality required by the user of the recipe to be recommended for each meal
- CHO m is the carbohydrate content contained in the mth food
- Count 3 is the amount of protein required by the user of the recipe to be recommended for each meal Carbohydrate mass
- m is the amount of food types in the target recommended recipe
- m is a positive integer.
- the method further includes:
- the constraints of each nutrient required by the user are preset according to the user's basic information
- the quality of each food in the target recommended recipe is determined according to the constraint condition.
- the method further includes:
- the content vector of each nutrient is used as the input of the neural network model, and the quality of each food in the target recommended recipe is output.
- ⁇ (Count 1 , Count 2 , Count 3 ), and the regular term is the constraint condition of each nutrient required by the preset user.
- the method further includes:
- the method further includes:
- the basic information includes at least one of age, gender, ethnicity, disease information, taste preference and weight.
- the method further includes:
- At least one of the quality of each nutrient required by the user for each meal and the quality of each food in the target recommended recipe is output.
- the present disclosure provides a food recommendation device, including:
- the data acquisition module is used to acquire the user's historical meal data
- the recipe determination module is configured to use the recommendation model to determine the target recommended recipe based on the plurality of foods to be recommended and the historical meal data.
- a model building module for building a hierarchical graph model based on the plurality of foods to be recommended
- the target recipe determination module is configured to determine the target recommended recipe through the hierarchical graph model based on the historical meal data and according to the random walk algorithm.
- the model building module is configured to use a plurality of foods to be recommended as nodes and paths between the nodes as edges to build the hierarchical graph model.
- a weight setting module used to initialize and set the weight of each edge in the hierarchical graph model
- a weight update module used for updating the weights of the sides according to the user's historical meal data
- the target recommended recipe determination module is configured to determine the food to be recommended contained in the path with the largest weight as the target recommended recipe.
- the target recommended recipe determination module includes:
- a first probability value determination unit configured to obtain the probability that the user selects the target recommended recipe according to the weight of the corresponding path of the target recommended recipe, which is a first probability value
- a second probability value determining unit configured to acquire the probability that other multiple users select the target recommended recipe, which is a second probability value
- a target recipe probability determination unit configured to determine the probability that the user selects the target recommended recipe based on the first probability value and the second probability value.
- the recipe determination module is further configured to: determine a target recommended recipe by using an attention mechanism model based on a plurality of foods to be recommended and the historical meal data.
- the recipe determination module further includes:
- a catering template setting module configured to preset multiple templates for the catering rules of each meal based on the plurality of foods to be recommended
- a template vectorization module for vectorizing the multiple templates to obtain multiple template vectors
- the implicit vector acquisition module is used to acquire the food of each meal in the user's historical meal data, quantify the food, and perform feature extraction on the food vector to obtain the implicit vector of each meal;
- the target template vector determination module is used to determine the target template vector based on the attention mechanism model, according to the implicit vector of each meal and the multiple template vectors;
- Enhanced vector acquisition module used to calculate the implicit vector of each meal and the target template vector to obtain the enhanced vector of the target template
- the target recommended recipe determination module is configured to classify the enhanced vector of the target template through a neural network classifier, and output the target recommended recipe corresponding to the target template.
- the implicit vector of each meal includes a second vector and a third vector
- the implicit vector obtaining module includes:
- the first vector acquisition module is used to acquire the food of each meal in the user's historical meal data, and quantize the food to obtain the first vector of each meal;
- the second vector obtaining module is used to operate the first vector of each meal by using the first parameter matrix to obtain the second vector of each meal;
- the third vector obtaining module is configured to operate the first vector of each meal by using the second parameter matrix to obtain the third vector of each meal.
- the target template vector determination module includes:
- each group of sample information includes: the implicit vector of each meal and the multiple template vectors;
- the model training module is used to take the implicit vector of each meal as input, and output the probability value of the plurality of template vectors to train the attention mechanism model, and use the template with the largest probability value as the output. vector as the target template vector.
- the enhancement vector obtaining module includes:
- An attention score calculation module for calculating the attention score between the target template vector and the second vector of each meal
- a target template enhancement vector acquisition module configured to perform a weighted average on the third vector of each meal according to the attention score corresponding to the implicit vector of each meal to obtain an enhancement vector of the target template.
- the present disclosure provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements any of the methods described above.
- the present disclosure provides an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned executable instructions by executing the executable instructions. method described.
- FIG. 1 shows a schematic diagram of an exemplary system architecture of a food recommendation method and apparatus to which embodiments of the present disclosure can be applied;
- FIG. 2 shows a schematic structural diagram of a computer system suitable for implementing an electronic device according to an embodiment of the present disclosure
- FIG. 3 schematically shows a flowchart of a food recommendation method according to an embodiment of the present disclosure
- FIG. 4 schematically shows a schematic diagram of a food knowledge graph according to an embodiment of the present disclosure
- FIG. 5 schematically shows a flowchart of steps of determining a target recommended recipe according to an embodiment of the present disclosure
- FIG. 6 schematically shows a schematic diagram of a hierarchical graph model according to an embodiment of the present disclosure
- FIG. 7 schematically shows a flow chart of steps of determining a target recommended recipe according to a specific embodiment of the present disclosure
- FIG. 8 schematically shows a flowchart of steps of determining a target recommended recipe according to another embodiment of the present disclosure
- FIG. 9 schematically shows a flowchart of steps of determining a target recommended recipe according to another embodiment of the present disclosure.
- FIG. 10 schematically shows a flow chart of the steps of determining the quality of each food in the target recommended recipe according to an embodiment of the present disclosure
- FIG. 11 schematically shows a block diagram of a food recommendation apparatus according to an embodiment of the present disclosure.
- Example embodiments will now be described more fully with reference to the accompanying drawings.
- Example embodiments can be embodied in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
- the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
- numerous specific details are provided in order to give a thorough understanding of the embodiments of the present disclosure.
- those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be employed.
- Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments, however, can be embodied in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
- the described features, structures or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided in order to give a thorough understanding of the embodiments of the present disclosure.
- FIG. 1 shows a schematic diagram of a system architecture of an exemplary application environment to which a food recommendation method and apparatus according to an embodiment of the present disclosure can be applied.
- the system architecture 100 may include one or more of terminal devices 101 , 102 , 103 , a network 104 and a server 105 .
- the network 104 is a medium used to provide a communication link between the terminal devices 101 , 102 , 103 and the server 105 .
- the network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
- the terminal devices 101, 102, and 103 may be various electronic devices, including but not limited to desktop computers, portable computers, smart phones, and tablet computers, and may also be various household appliances, such as smart refrigerators, smart range hoods, and the like. It should be understood that the numbers of terminal devices, networks and servers in FIG. 1 are only illustrative. There can be any number of terminal devices, networks, and servers according to implementation needs.
- the server 105 may be a server cluster composed of multiple servers, or the like.
- the food recommendation method provided by the embodiment of the present disclosure is generally executed by the server 105. Accordingly, the food recommendation apparatus is generally set in the server 105. After the server executes, the recommendation result can be sent to the terminal device and displayed to the user by the terminal device.
- the food recommendation method provided by the embodiments of the present disclosure may also be executed by one or more of the terminal devices 101 , 102 , and 103 .
- the food recommendation device may also be provided in the terminal device.
- the recommendation result may be directly displayed on the display screen of the terminal device, or the recommendation result may be provided to the user by means of voice broadcast. No special restrictions are made.
- FIG. 2 shows a schematic structural diagram of a computer system suitable for implementing an electronic device according to an embodiment of the present disclosure.
- a computer system 200 includes a central processing unit (CPU) 201, which can be loaded into a random access memory (RAM) 203 according to a program stored in a read only memory (ROM) 202 or a program from a storage section 208 Instead, various appropriate actions and processes are performed.
- RAM 203 various programs and data required for system operation are also stored.
- the CPU 201, the ROM 202, and the RAM 203 are connected to each other through a bus 204.
- An input/output (I/O) interface 205 is also connected to the bus 204 .
- the following components are connected to the I/O interface 205: an input section 206 including a keyboard, a mouse, etc.; an output section 207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 208 including a hard disk, etc. ; and a communication section 209 including a network interface card such as a LAN card, a modem, and the like. The communication section 209 performs communication processing via a network such as the Internet.
- a drive 210 is also connected to the I/O interface 205 as needed.
- a removable medium 211 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 210 as needed so that a computer program read therefrom is installed into the storage section 208 as needed.
- the food recommendation methods described in this disclosure are performed by a processor of an electronic device.
- the user's basic information and historical meal data and other information are input through the input portion 206, for example, the user's basic information and historical meal data and other information are input through the user interface of the electronic device.
- the output part 207 outputs information such as the target recommended recipe, the quality of each nutrient required by the user for each meal, and the quality of each food in the target recommended recipe.
- embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart.
- the computer program may be downloaded and installed from the network via the communication portion 209 and/or installed from the removable medium 211 .
- CPU central processing unit
- various functions defined in the method and apparatus of the present application are performed.
- the present application also provides a computer-readable medium.
- the computer-readable medium may be included in the electronic device described in the above embodiments; it may also exist alone without being assembled into the electronic device. middle.
- the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by an electronic device, causes the electronic device to implement the methods described in the following embodiments.
- the electronic device can implement the steps shown in FIG. 3 , FIG. 5 , FIG. 7 to FIG. 8 , and FIG. 10 .
- the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
- the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
- a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
- a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
- a computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .
- Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
- the method of catering meals may be based on the basic information of the user, analyzing the user's nutritional indicators, giving corresponding nutritional advice, and recommending recipes that meet nutritional needs.
- this method does not refer to the user's dining preferences, resulting in low accuracy of recommended recipes.
- this example embodiment provides a food recommendation method, which can be applied to the above-mentioned server 105 or one or more of the above-mentioned terminal devices 101 , 102 , and 103 .
- This example This is not specifically limited in the exemplary embodiment.
- the food recommendation method may include the following steps S310 to S320:
- Step S310 Obtain historical meal data.
- Step S320 Based on the multiple foods to be recommended and the historical meal data, use the recommendation model to determine the target recommended recipe.
- a recommendation model is used to determine a target recommended recipe based on a plurality of foods to be recommended and the historical meal data.
- the method can accurately determine the user's preferred recipe through the recommendation model, and can recommend scientific and reasonable recipes for the user by calculating the quality of each food in the recipe.
- step S310 historical meal data is acquired.
- the user's historical meal data can be obtained every time they are used, or can be obtained according to a preset time period.
- the user's historical meal data is obtained once a month
- the user's latest meal Historical meal data recommends food.
- the user's historical meal data may be the food selected by the user for each meal recently (in recent days, months, etc., time is not limited), and the food may include staple food, soup, porridge, and vegetables.
- the staple food may include rice, steamed bread, etc.
- the soup may include tomato egg soup, seaweed egg drop soup, and the like.
- the porridge may include rice porridge, pumpkin porridge, and the like. Dishes can include scrambled eggs with tomatoes, scrambled cabbage, etc.
- the food selected by the user for three meals a day in the past month may be obtained, for example, the breakfast on the first day is steamed bread + rice porridge + fried cabbage, and lunch and dinner are similar.
- the food selected by the user for each meal in the past 15 days and 20 days may also be acquired, which is not limited in this example implementation.
- basic user information may also be acquired, where the basic user information may be the user's age, gender, ethnicity, disease information, taste preference, weight, and the like.
- the basic user information may be the user's age, gender, ethnicity, disease information, taste preference, weight, and the like.
- a plurality of foods to be recommended can be determined according to the food knowledge graph and the user's basic information.
- Knowledge Graph is a graph-based data structure consisting of nodes (Point) and edges (Edge).
- nodes represent entities or concepts
- edges are composed of attributes or relationships.
- a knowledge graph is the most effective representation of relationships, and a knowledge graph refers to a relational network that connects all different kinds of information together. Therefore, knowledge graphs provide the ability to analyze problems from a "relational" perspective.
- a food knowledge graph can be constructed, the entities of the food knowledge graph can be various foods, and the attributes of the entities can include information such as nutrient composition, taste, efficacy of ingredients, and taboo groups of food.
- the food entities in the food knowledge graph include scrambled eggs with tomatoes, scrambled eggs with sugar, and steamed buns.
- the attributes of scrambled eggs with tomatoes may further include ingredients such as tomatoes and eggs.
- the properties of sugar scrambled eggs can include sweet taste, eggs and other ingredients.
- the taboo group is diabetic patients, and the nutrient content includes carbohydrates.
- the properties of steamed bread can include carbohydrates and so on.
- food knowledge graphs can be constructed from dishes and staple food categories, or both dishes and staple food categories can be reflected in the same knowledge graph.
- the constructed food knowledge graph can be stored for subsequent access and recall. Therefore, the food knowledge graph can be built in real time every time a user makes a food recommendation, or it can be pre-built and stored in the database, for example, the food knowledge graph can be stored in Neo4j (a high-performance NoSQL graph database) The database is called when the user makes a food recommendation.
- Neo4j a high-performance NoSQL graph database
- a plurality of foods to be recommended may be determined according to the food knowledge graph and basic user information. For example, if the user's ethnicity is Hui, you can look up food attributes in the food knowledge graph, and discard related foods such as pork that are not suitable for Hui users.
- the daily sugar intake and monosaccharide and polysaccharide intake requirements of diabetic users can be determined according to medical dietary taboo rules or doctor's orders, and whether the food is a high-glycemic food or whether it is a high-glycemic food or not can be determined according to the food knowledge map. If the above dietary taboo rules or doctor's orders are met, the food that does not meet the conditions will be discarded.
- the food remaining (not discarded) in the food knowledge graph is used as the food to be recommended.
- the foods to be recommended may be steamed bread, rice porridge, scrambled eggs with tomatoes, and the like.
- the food included in each meal in the user's historical meal data may also be used as the food to be recommended. Screening foods to be recommended based on user basic information can provide users with recipes more accurately and improve user experience. It is also possible to arrange multiple foods to be recommended based on the user's historical meal data through a binary sorting tree, and determine multiple foods to be recommended according to the user's basic information. You can also determine multiple foods to be recommended by creating relational data, such as , to create a MySQL database, which is not limited in this example implementation.
- catering rules for each meal may be preset.
- the food for breakfast can be preset, which can include main food + drinks + dishes, or main food + dishes, and can also include main food + drinks + dishes + desserts. Lunch and dinner are similar .
- the catering rules for each meal can be set according to the actual needs of the user.
- the user can input the catering rules through the user interface of the terminal, or the catering rules can be uniformly set in the background. A plurality of foods to be recommended are combined and matched according to the catering rules and then recommended to the user, which is not limited in this example implementation.
- step S320 based on a plurality of foods to be recommended and the historical meal data, a recommendation model is used to determine a target recommended recipe.
- the process may include the following steps:
- Step S510 Build a hierarchical graph model based on the multiple foods to be recommended.
- Hierarchical graph model refers to the use of a "directed tree" data structure to represent various entities and the relationship between entities. Each node in the tree represents a record type, and the edges between nodes represent the relationship between record types. The structure of the hierarchical graph model is clear, the connections between nodes are simple, and the connections between record types are represented by directed edges. Therefore, the efficiency of querying the food to be recommended according to the hierarchical graph model is high.
- Step S520 Based on the historical meal data, according to the random walk algorithm, determine the target recommended recipe through the hierarchical graph model.
- the random walk algorithm refers to traversing the entire hierarchical graph model starting from one or a series of vertices. At any vertex, the traverser will walk to the adjacent vertices of this vertex with probability 1-a, and randomly jump to any vertex in the hierarchical graph model with probability a, which is called the probability of jump occurrence. Then a probability distribution is obtained, which depicts the probability that each vertex in the hierarchical graph model is visited. Use this probability distribution as the input for the next walk and iterate the process repeatedly. When the iteration termination condition is met, the probability distribution will tend to converge.
- the iteration termination condition may be satisfying a preset number of iterations, for example, after 100 iterations, the probability distribution tends to converge, or may be other iteration termination conditions such as iterating until the probability distribution converges. After convergence, a stationary probability distribution can be obtained.
- the hierarchical graph model shown in FIG. 6 it is constructed with multiple foods to be recommended as nodes and paths between each of the foods to be recommended as edges.
- the plurality of foods to be recommended include staple foods such as 1, 2, 3, 4, etc., dishes such as a, b, c, d, etc., and soups such as m 1 , m 2 , m 3 , and m 4 .
- the target recommended recipe can be determined through the hierarchical graph model. Referring to FIG. 7 , the process can include the following steps:
- Step S710 Initially set the weight of each edge in the hierarchical graph model.
- the weight of each edge in the hierarchical graph model can be initially set.
- the initial weight of each edge in the hierarchical graph model can be set to 0, or the initial weight of each edge can be set to any other value.
- the purpose of setting the initial weight of each edge to 0 is to facilitate the statistics of the weight change of each edge in the subsequent hierarchical graph model.
- Step S720 Update the weights of the sides according to the user's historical meal data
- the user's historical meal data can be acquired, and the weights of the sides can be updated according to the user's historical meal data.
- the historical meal data of the user shows that the user's historical choices include: 1 ⁇ b ⁇ m 1 , 1 ⁇ b, 1 ⁇ a ⁇ m 1 , 2 ⁇ c and other paths.
- the weight of path 1 ⁇ b is (1 ⁇ b) number of paths/(including 1) number of paths), i.e. 2/3. It can be seen from this that the path 1 ⁇ b can be updated from the initial weight 0 to 2/3 according to the user's historical meal data.
- Step S730 Determine the food to be recommended contained in the path with the largest weight as the target recommended recipe.
- the weights of each path can be obtained.
- the weight of the path 1 ⁇ b is 2/3
- the weight of 1 ⁇ a is 1/6
- the weight of 1 ⁇ c is 1/6
- the weight of b ⁇ m 1 is 1/3
- the weight of b ⁇ m 2 is 1/3
- the weight of b ⁇ m 3 is 1/3.
- the probability that the user selects the target recommended recipe can be obtained according to the weight of the path corresponding to the target recommended recipe, which is recorded as the first probability value P 1 .
- the probability of other multiple users selecting the target recommended recipe can be obtained (for example, the probability of each user of the other multiple users recommending recipes based on this path is obtained and averaged), which is recorded as the second The probability value P 2 .
- (1- ⁇ ) refers to the weight of the event of selecting the target recommended recipe according to the selection of other users.
- the P values of various target recommended recipes can be sorted, for example, in descending order, and the top-ranked target recommended recipes are recommended to the user, for example, the target recommended recipes corresponding to the top ten P values after sorting are recommended to the user.
- the recipe can be more accurately recommended to the user.
- the user's preferred recipe is further optimized, providing the user with more choices, which can improve the user experience and increase the user's stickiness.
- the target recommended recipe may also be determined by using an attention mechanism model based on a plurality of foods to be recommended and the historical meal data.
- the process may include the following steps:
- Step S810 Based on the multiple foods to be recommended, preset multiple templates for the catering rules of each meal.
- the template of the catering rule for breakfast may include: main food + porridge + vegetables, main food + porridge + soup, main food + dishes + dessert, and lunch and dinner are similar.
- the number of meal catering templates is not limited in this example implementation.
- Step S820 Vectorize the multiple templates to obtain multiple template vectors.
- One-Hot (one-hot encoding) encoding may be performed on each item in each template to obtain a One-Hot encoding vector, that is, a template vector.
- One-Hot encoding is also known as one-bit valid encoding.
- the method is to use an N-bit state register to encode N states, each state has an independent register bit, and at any time, only one bit in the register is valid.
- the dimension of each template vector is the number of types of all foods to be recommended. You can also convert each template into a vector through the Word Embedding algorithm, such as Word2vec algorithm, Glove algorithm, etc., and you can also convert each template into a vector through other methods, such as TransE and other algorithms.
- Step S830 Obtain the food of each meal in the user's historical meal data, quantify the food vector, and perform feature extraction on the food vector to obtain the implicit vector of each meal.
- each meal may contain multiple foods to be recommended, and each of the foods to be recommended may be coded by an attention mechanism model, and each food to be recommended may be vectorized.
- the attention mechanism model is a machine learning model, which simulates the visual attention behavior of humans. When humans observe a painting, after scanning the image globally, they will get the target area that needs attention, and then pay more attention. , so as to obtain the detailed information of the target area. Therefore, human attention behavior can be abstracted and applied in machine learning models.
- the attention mechanism model may include: an embedding layer, a neural network layer, an attention layer, a connection layer and a normalization layer.
- One-Hot encoding can be performed on each food to be recommended to obtain a vector for each meal, or each food to be recommended can be encoded by the Word Embedding algorithm.
- Food is converted into a vector, such as Word2vec algorithm, Glove algorithm, etc., and each food to be recommended can be converted into a vector in other ways, such as TransE and other algorithms.
- the food selected by the user for three meals a day in the past n days can be obtained, and each food is taken as the food to be recommended and quantified, and the breakfast on the first day can be obtained as E 11 , Lunch is E 12 , dinner is E 13 . . . and dinner on the nth day is E n3 .
- the embedding layer of the attention mechanism model can also transform the matrix formed by each meal vector into a dense matrix through linear transformation, that is, project the high-dimensional sparse and irrelevant each meal vector to a low-dimensional vector.
- latent feature extraction can be performed on the low-dimensional vector of each meal through a neural network layer.
- latent features can be extracted through a long short-term memory network to obtain latent vectors for each meal, and the latent vectors for each meal can include the second vector and the third vector.
- long short-term memory network is a kind of temporal recurrent neural network, which is suitable for processing and predicting important events with relatively long interval and delay in time series.
- implicit features can also be extracted through a convolutional neural network, a recurrent neural network, or other networks, which are not limited here.
- the food in each meal in the user's historical meal data can be vectorized to obtain the first vector of each meal.
- the first vector of each meal is operated by the first neural network layer of the attention mechanism model to obtain the second vector of each meal.
- the first vector of each meal is operated by the second neural network layer of the attention mechanism model to obtain the third vector of each meal.
- the first vector and each parameter matrix may also be directly operated to obtain the second vector and the third vector.
- K 11 , K 12 , etc. are the second vectors of each meal, respectively.
- V 11 W 2 *E 11
- V 12 W 2 *E 12 . . .
- V n3 W 2 *E n3 .
- V 11 , V 12 , etc. are the third vectors of each meal, respectively.
- the target template vector is determined during the training process of the model.
- the specific process is as follows:
- the target template vector is determined according to the implicit vector of each meal and the plurality of template vectors.
- the machine learning model is trained based on a large amount of sample information, and the target template can be determined after training the above-mentioned attention mechanism model.
- multiple sets of sample information can be obtained first, and each set of sample information includes: a template vector, an implicit vector for each meal corresponding to the user's meal history data, and the corresponding probability that the user selects the sample template vector.
- the attention mechanism model is trained, and the one with the largest probability value is used as the output.
- the template vector is used as the target template vector, denoted as Q 1 .
- the process of training the attention mechanism model is the process of continuously updating the parameters in the model.
- the loss function can be calculated according to the probability and the predicted probability of the sample template vector selected by the user, and the attention mechanism model can be updated according to the loss function.
- the parameters (u T , W h and W s ) in the attention mechanism model are preset.
- the gradient descent method can be used to continuously calculate the loss function according to the principle of back propagation.
- the function updates the parameters in this model. After the parameters corresponding to each group of samples are determined, the target template is determined according to the output probability of each group of sample template vectors.
- Step S840 Calculate the implicit vector of each meal and the target template vector to obtain an enhanced vector of the target template.
- the attention score between the target template vector and the implicit vector of each meal can be calculated.
- the attention score is a value between 0 and 1, and the sum of all attention scores under the action of the attention mechanism model is 1.
- Each attention score represents the attention weight assigned to the current item. The attention score is often learned from the weight parameters of the neural network during model training, and is finally normalized.
- the attention score between the target template vector Q 1 and the second vector K i of each meal can be calculated through the dot product model in the attention scoring function, that is, the target template is calculated.
- weighted average is performed on the third vector V i of each meal, namely The enhancement vector of the target template is obtained.
- i is an integer from 1 to M
- M represents the number of all meals in n days.
- Ki represents the implicit vector of the ith meal
- i is an integer from 1 to M
- M represents the number of all meals in n days
- Q 1 represents the target template vector
- u T , W h and W s represent the attention mechanism parameters of the model
- the attention score f(K i , Q 1 ) of the target template vector Q 1 and the second vector K i of each meal can be calculated according to the above formula.
- the weights ⁇ 1 , . . . , ⁇ M can be obtained by normalizing each attention score f(K i , Q 1 ). Then do a weighted average with the third vector V i of each meal to get the enhancement vector c 1 , that is,
- the attention score may also be calculated according to the zoom-click model and the bilinear model in the attention scoring function.
- Step S850 Classify the enhanced vector of the target template through a neural network classifier, and output the target recommended recipe corresponding to the target template.
- the enhanced vector of the target template can be classified by a neural network classifier, for example, the target recommended recipe corresponding to the target template can also be output through pooling processing and normalization operation.
- the enhancement vector of the target template that is, the important feature vector
- the attention mechanism model is extracted through the attention mechanism model, and the important feature vector is matched with multiple recipes to be recommended in the database, which can be matched more accurately.
- Target recommends recipes are extracted through the attention mechanism model, and the important feature vector is matched with multiple recipes to be recommended in the database, which can be matched more accurately.
- the recipe template preferred by the user and the recipe determined according to the template can be obtained at the same time, and the recommendation can be made according to the preset template rules.
- the quality of each food in the target recommended recipe may also be determined according to the quality of each nutrient required for each meal.
- the process may include the following steps:
- Step S1010 Determine the quality of each nutrient required by the user for each meal according to the user's basic information.
- basic user information is acquired through a user interface, for example, the user inputs at least one of age, gender, ethnicity, disease information, taste preference and weight through the user interface.
- the energy required for each meal of the user can be determined according to the basic information of the user, and then the quality of each nutrient required by the user for each meal can be determined according to the relationship between the energy required by the user per meal and each nutrient.
- a reasonable range of the total energy required by the user in a day can be obtained according to the basic information of the user.
- the energy allocation of breakfast, lunch and dinner in a day can be determined by nutritional data, or the energy required for each meal can be allocated according to the actual needs of the user, such as breakfast accounts for 35%, lunch accounts for 40%, and dinner accounts for 25% , the range of energy that the user should consume for each of the three meals can be determined. For example, if the user needs a total energy of 1000 calories in a day, the user needs 350 calories for breakfast, 400 calories for lunch, and 250 calories for dinner.
- the quality of each nutrient required by the user for each meal can be determined according to the relationship between the energy required by the user for each meal and each nutrient, that is, according to:
- nutrientCount n is the quality of the nth nutrient; energy is the energy value of each meal required by the user of the recipe to be recommended; ratio n is the proportional coefficient of the nth nutrient to the energy value of each meal; param n is the nth nutrient conversion Energy coefficient; n is a positive integer.
- Step S1020 Determine the quality of each food in the target recommended recipe according to the quality of each nutrient required for each meal.
- the quality of each food in the target recommended recipe may be determined according to the relationship between the content of each nutrient in the food to be recommended contained in the target recommended recipe and the quality of each nutrient required for each meal, that is, according to:
- the quality of each food in the target recommended recipe is determined.
- fat m is the fat content of the m-th food
- x m is the quality of the m-th food
- Count 1 is the fat mass required by the target recommended recipe user for each meal
- protein m is the content of the m-th food.
- the protein content contained Count 2 is the protein quality required by the target recommended recipe user for each meal
- CHO m is the carbohydrate content contained in the mth food
- Count 3 is the target recommended recipe user required for each meal.
- m is the amount of food types in the target recommended recipe
- m is a positive integer.
- the target recommended recipe is bread + milk + fried cabbage
- m in the above formula 3
- the above equation group has a unique solution
- the quality of each food in the target recommended recipe can be determined, which can improve the quality of the recommended recipe. Accuracy to meet the needs of users.
- the target recommended recipe is rice + lemon juice + fried cabbage + cake
- m in the above formula 4
- the above equation group may have multiple solutions, that is, the obtained food quality for a certain recipe to be recommended.
- the distribution method is multiple, that is, the quality of each food in the recommended recipe for the target cannot be determined. Therefore, based on the preset meal catering rules for each meal, the constraints of each nutrient required by the user can also be preset according to the user's basic information.
- the intake of sugar can be controlled within a reasonable range, and the corresponding constraint on sugar intake can be: c 1 *x 1 +c 2 *x 2 +...+c m *x m ⁇ Count 4 , cm is the sugar content of the mth food, x m is the quality of the mth food, and Count 4 is the sugar quality required by the target recommended recipe user for each meal. Based on the above formula and further according to the constraint conditions, the quality of each food in the target recommended recipe can be determined, so as to provide the user with a more suitable recipe to meet the user's needs.
- each group (x 1 , x 2 , ... x m ) corresponds to a group (f x , p x , C x ), and f x , p x , and C x are the actual calculated nutrients required for each meal quality.
- a constraint function can be set:
- Count 1 , Count 2 , and Count 3 are the standard values of the quality of each nutrient required by the user for each meal calculated according to the relationship between the energy required by the user for each meal and each nutrient.
- the value of the above constraint function is the minimum
- the actual values f x , p x , and C x of the quality of each nutrient required by the user for each meal corresponding to the minimum value may be determined, and each of the target recommended recipes corresponding to the minimum value may be determined. quality of food.
- step S910 may also be used to determine the nutrient content of each food in the target recommended recipe, and quantify the nutrient content of each food.
- One-Hot coding can be performed on the content of each nutrient, and the content of each nutrient can be quantized to obtain a vector of each nutrient content.
- each group of sample data includes: the sample content vector of each nutrient, and the quality of each food in the target recommended recipe.
- the neural network model is trained with the sample content vector of each nutrient as input and the quality of each food in the target recommended recipe as output.
- the content vector of each nutrient can be used as the input of the neural network model, the neural network model can be updated according to the loss function, and the quality of each food in the target recommended recipe can be output.
- the gradient descent method can also be used to continuously calculate the loss function according to the principle of back propagation, and update the parameters in the neural network model according to the loss function.
- 2 +regular term, where ⁇ (Count 1 , Count 2 , Count 3 ), which is the difference of each nutrient required by the user for each meal. Quality, ⁇ ' is the quality of each nutrient required by the user for each meal predicted by the neural network, and the regular term is the preset constraint condition of each nutrient required by the user.
- the loss function can be used to estimate the degree of inconsistency between the predicted value of the model and the actual value.
- the loss function can also be an exponential loss function or a perceptual loss function, which is not limited in this example implementation.
- At least one of the total mass of each nutrient required by the user every day, the mass of each nutrient required for each meal, the mass of each food in the target recommended recipe, the target recommended recipe, and the like can also be output.
- the above items of information are output through a user interface.
- users can edit various contents through the interface and adjust them according to their personal needs.
- a recommendation model is used to determine a target recommended recipe, and according to each meal required Nutrient quality determines the quality of each food in the target recommended recipe.
- the method can accurately determine the user's preferred recipe through the recommendation model, and can recommend scientific and reasonable recipes for the user by calculating the quality of each food in the recipe.
- a food recommendation device is also provided.
- the apparatus can be applied to a server or terminal equipment.
- the food recommendation device 1100 may include a data acquisition module 1110 and a recipe determination module 1120, wherein:
- the data acquisition module 1110 is used to acquire the user's historical meal data
- the recipe determination module 1120 is configured to use a recommendation model to determine a target recommended recipe based on the plurality of foods to be recommended and the historical meal data.
- the data acquisition module acquires the user's historical meal data through a user interface, for example, the user inputs personal historical meal data through the user interface.
- the target recommended recipe determined by the recipe determination module may be displayed to the user through a user interface.
- the recipe determination module 1120 includes:
- a model building module for building a hierarchical graph model based on the plurality of foods to be recommended
- the target recipe determination module is configured to determine the target recommended recipe through the hierarchical graph model based on the historical meal data and according to the random walk algorithm.
- the model building module is configured to use a plurality of foods to be recommended as nodes and paths between the nodes as edges to build the hierarchical graph model.
- the recipe determination module includes:
- a weight setting module used to initialize and set the weight of each edge in the hierarchical graph model
- a weight update module used for updating the weights of the sides according to the user's historical meal data
- the target recommended recipe determination module is configured to determine the food to be recommended contained in the path with the largest weight as the target recommended recipe.
- the target recommended recipe determination module includes:
- a first probability value determination unit configured to obtain the probability that the user selects the target recommended recipe according to the weight of the corresponding path of the target recommended recipe, which is a first probability value
- a second probability value determining unit configured to acquire the probability that other multiple users select the target recommended recipe, which is a second probability value
- a target recipe probability determination unit configured to determine the probability that the user selects the target recommended recipe based on the first probability value and the second probability value.
- the recipe determination module 1120 is further configured to: determine the target recommended recipe by using an attention mechanism model based on the plurality of foods to be recommended and the historical meal data.
- the recipe determination module 1120 further includes:
- a catering template setting module configured to preset multiple templates for the catering rules of each meal based on the plurality of foods to be recommended
- a template vectorization module for vectorizing the multiple templates to obtain multiple template vectors
- the implicit vector acquisition module is used to acquire the food of each meal in the user's historical meal data, quantify the food vector, and perform feature extraction on the food vector to obtain the implicit vector of each meal;
- the target template vector determination module is used to determine the target template vector based on the attention mechanism model, according to the implicit vector of each meal and the multiple template vectors;
- Enhanced vector acquisition module used to calculate the implicit vector of each meal and the target template vector to obtain the enhanced vector of the target template
- the target recommended recipe determination module is used for classifying the enhanced vector of the target template through a neural network classifier, and outputting the target recommended recipe corresponding to the target template.
- the implicit vector of each meal includes a second vector and a third vector
- the implicit vector obtaining module includes:
- the first vector acquisition module is used to acquire the food of each meal in the user's historical meal data, and quantize the food to obtain the first vector of each meal;
- the second vector obtaining module is used to operate the first vector of each meal by using the first parameter matrix to obtain the second vector of each meal;
- the third vector obtaining module is configured to operate the first vector of each meal by using the second parameter matrix to obtain the third vector of each meal.
- the target template vector determination module includes:
- each group of sample information includes: the implicit vector of each meal and the multiple template vectors;
- the model training module is used to take the implicit vector of each meal as input, and output the probability value of the plurality of template vectors to train the attention mechanism model, and use the template with the largest probability value as the output. vector as the target template vector.
- the enhanced vector acquisition module includes:
- An attention score calculation module for calculating the attention score between the target template vector and the second vector of each meal
- a target template enhancement vector acquisition module configured to perform a weighted average on the third vector of each meal according to the attention score corresponding to the implicit vector of each meal to obtain an enhancement vector of the target template.
- the food recommendation device further includes:
- the catering rule preset module is used to preset catering rules for each meal.
- the food recommendation device further includes:
- a quality determination module configured to determine the quality of each food in the target recommended recipe according to the quality of each nutrient required for each meal.
- the quality determination module includes:
- the nutrient quality determination module is used to determine the quality of each nutrient required by the user for each meal according to the basic information of the user;
- a food quality determination module configured to determine the quality of each food in the target recommended recipe according to the quality of each nutrient required for each meal.
- the nutrient quality determination module includes:
- the energy determination module is used to determine the energy required by the user for each meal according to the basic information of the user;
- Each nutrient quality determination module is used for the relationship between the energy required for each meal and each nutrient according to the user:
- nutrientCount n is the quality of the nth nutrient; energy is the energy value of each meal required by the user of the recipe to be recommended; ratio n is the proportional coefficient of the nth nutrient to the energy value of each meal; param n is the nth nutrient conversion Energy coefficient; n is a positive integer.
- the food quality determination module is configured to: be used for the relationship between the content of each nutrient in the food to be recommended contained in the target recommended recipe and the quality of each nutrient required for each meal:
- fat m is the fat content of the mth food
- x m is the quality of the mth food
- Count 1 is the fat mass required by the user of the recipe to be recommended for each meal
- protein m is the content of the mth food.
- the protein content contained Count 2 is the protein quality required by the user of the recipe to be recommended for each meal
- CHO m is the carbohydrate content contained in the mth food
- Count 3 is the amount of protein required by the user of the recipe to be recommended for each meal Carbohydrate mass
- m is the amount of food types in the target recommended recipe
- m is a positive integer.
- the quality determination module includes and further includes:
- the constraint condition preset module is used to preset the constraint conditions of each nutrient required by the user according to the basic information of the user based on the preset meal catering rules for each meal;
- a food quality determination module configured to determine the quality of each food in the target recommended recipe according to the constraint condition.
- the quality determination module includes and further includes:
- the nutrient content vectorization module is used to determine the nutrient content of each food in the target recommended recipe, and quantize the nutrient content of each food;
- the food quality determination module is configured to use the content vector of each nutrient as the input of the neural network model, and output the quality of each food in the target recommended recipe.
- ⁇ (Count 1 , Count 2 , Count 3 ), and the regular term is the constraint condition of each nutrient required by the preset user.
- the food recommendation device further includes:
- the to-be-recommended food determination module is used to determine a plurality of to-be-recommended foods according to the food knowledge graph and basic user information.
- the food to be recommended determination module further includes:
- the user basic information acquisition module is used for acquiring basic user information, the basic information includes at least one of age, gender, ethnicity, disease information, taste preference and weight.
- the quality determination module further includes:
- At least one of the quality of each nutrient required by the user for each meal and the quality of each food in the target recommended recipe is output.
- Each module in the above device can be a general-purpose processor, including: a central processing unit, a network processor, etc.; it can also be a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic devices, discrete gates or transistors Logic devices, discrete hardware components. Each module can also be implemented in the form of software, firmware and the like. Each processor in the above device may be an independent processor, or may be integrated together.
- modules or units of the apparatus for action performance are mentioned in the above detailed description, this division is not mandatory. Indeed, according to embodiments of the present disclosure, the features and functions of two or more modules or units described above may be embodied in one module or unit. Conversely, the features and functions of one module or unit described above may be further divided into multiple modules or units to be embodied.
Landscapes
- Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Public Health (AREA)
- Data Mining & Analysis (AREA)
- Epidemiology (AREA)
- General Health & Medical Sciences (AREA)
- Primary Health Care (AREA)
- Biomedical Technology (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Pathology (AREA)
- Nutrition Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Medical Treatment And Welfare Office Work (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
一种食物推荐方法、装置、存储介质及电子设备,涉及数据处理技术领域。所述方法包括:获取历史用餐数据(S310);基于多个待推荐食物和所述历史用餐数据,使用推荐模型确定目标推荐食谱(S320)。本方法通过推荐模型可以准确的确定用户偏爱的食谱,并且通过计算所述食谱中各食物的质量,可以为用户科学合理的推荐食谱。
Description
本公开涉及数据处理技术领域,具体而言,涉及一种食物推荐方法、食物推荐装置、计算机可读存储介质以及电子设备。
随着人民生活水平的改善,人们越来越注重自身健康。而一个人的健康状况与其饮食习惯又息息相关,饮食是否健康合理成为了人们日常极为关心的话题。
因此,提供一种准确性高的食物推荐方法为用户科学合理的推荐食谱是非常必要的。
需要说明的是,在上述背景技术部分公开的信息仅用于加强对本公开的背景的理解,因此可以包括不构成对本领域普通技术人员已知的现有技术的信息。
发明内容
本公开提供一种食物推荐方法、食物推荐装置、计算机可读存储介质以及电子设备。
本公开提供一种食物推荐方法,包括:
获取用户的历史用餐数据;
基于多个待推荐食物和所述历史用餐数据,使用推荐模型确定目标推荐食谱。
在本公开的一种示例性实施例中,所述基于多个待推荐食物和所述历史用餐数据,使用推荐模型确定目标推荐食谱,包括:
基于所述多个待推荐食物,构建层次图模型;
基于所述历史用餐数据,根据随机游走算法,通过所述层次图模型确定目标推荐食谱。
在本公开的一种示例性实施例中,所述基于所述多个待推荐食物,构建层次图模型,包括:
以多个待推荐食物为节点,以所述节点之间的路径为边,构建所述层次图模型。
在本公开的一种示例性实施例中,所述基于所述历史用餐数据,根据随机游走算法,通过所述层次图模型确定目标推荐食谱,包括:
初始化设置所述层次图模型中各边的权重;
根据用户的历史用餐数据更新所述各边的权重;
将所述权重最大的路径中包含的待推荐食物确定为目标推荐食谱。
在本公开的一种示例性实施例中,所述将所述权重最大的路径中包含的待推荐食物确定为目标推荐食谱,包括:
根据所述目标推荐食谱对应路径的权重得到用户选取所述目标推荐食谱的概率,为第一概率值;
获取其他多个用户选择所述目标推荐食谱的概率,为第二概率值;
基于所述第一概率值和所述第二概率值确定用户选择所述目标推荐食谱的概率。
在本公开的一种示例性实施例中,所述基于多个待推荐食物和所述历史用餐数据,使用推荐模型确定目标推荐食谱,还包括:
基于多个待推荐食物和所述历史用餐数据,使用注意力机制模型,确定目标推荐食谱。
在本公开的一种示例性实施例中,所述基于多个待推荐食物和所述历史用餐数据,使用注意力机制模型,确定目标推荐食谱,包括:
基于所述多个待推荐食物,为每餐的配餐规则预设多个模板;
将所述多个模板向量化,得到多个模板向量;
获取用户的历史用餐数据中每餐的食物,将所述食物向量化,并对所述食物向量进行特征提取,得到每餐的隐含向量;
对所述每餐的隐含向量与目标模版向量进行运算,得到目标模板的增强向量;
将所述目标模板的增强向量通过神经网络分类器分类,输出所述目标模板对应的目标推荐食谱。
在本公开的一种示例性实施例中,所述每餐的隐含向量包括第二向量和第三向量;所述获取用户的历史用餐数据中每餐的食物,将所述食物向量化,并对所述食物向量进行特征提取,得到每餐的隐含向量,包括:
获取用户的历史用餐数据中每餐的食物,将所述食物向量化得到每餐的第一向量;
利用第一参数矩阵对所述每餐的第一向量进行运算,得到每餐的第二向量;
利用第二参数矩阵对所述每餐的第一向量进行运算,得到每餐的第三向量。
在本公开的一种示例性实施例中,所述方法还包括:
获取多组样本信息,每组样本信息包括:所述每餐的隐含向量和所述多个模板向量;
以所述每餐的隐含向量为输入,以所述多个模板向量的概率值为输出,对所述注意力机制模型进行训练,并将所述概率值最大的模板向量作为所述目标模板向量。
在本公开的一种示例性实施例中,所述对所述每餐的隐含向量与所述目标模版向量进行运算,得到目标模板的增强向量,包括:
计算所述目标模板向量与所述每餐的第二向量之间的注意力分数;
根据所述每餐的隐含向量对应的注意力分数,对所述每餐的第三向量进行加权平均,得到所述目标模板的增强向量。
在本公开的一种示例性实施例中,所述方法还包括:
预设每餐的配餐规则。
在本公开的一种示例性实施例中,所述方法还包括:
根据每餐所需的各营养素质量确定所述目标推荐食谱中各食物的质量。
在本公开的一种示例性实施例中,所述根据每餐所需的各营养素质量确定所述目标推荐食谱中各食物的质量,包括:
根据用户基本信息确定用户每餐所需的各营养素的质量;
根据每餐所需的各营养素质量确定所述目标推荐食谱中各食物的质量。
在本公开的一种示例性实施例中,所述根据用户基本信息确定用户每餐所需的各营养素的质量,包括:
根据用户基本信息确定用户每餐所需能量;
根据用户每餐所需能量与各营养素的关系:
确定用户每餐所需的各营养素的质量;
其中,nutrientCount
n为第n种营养素质量;energy为待推荐食谱用户每餐所需的能量值;ratio
n为第n种营养素占每餐的能量值的比例系数;param
n为第n种营养素换算能量系数;n为正整数。
在本公开的一种示例性实施例中,所述根据每餐所需的各营养素质量确定目标推荐食 谱中各食物的质量,包括:
根据所述目标推荐食谱包含的待推荐食物中的各营养素含量和每餐所需的各营养素质量的关系:
确定所述目标推荐食谱中各食物的质量;
其中,fat
m为第m种食物所含的脂肪含量,x
m为第m种食物的质量,Count
1为所述待推荐食谱用户每餐所需的脂肪质量,protein
m为第m种食物所含的蛋白质含量,Count
2为所述待推荐食谱用户每餐所需的蛋白质质量,CHO
m为第m种食物所含的碳水化合物含量,Count
3为所述待推荐食谱用户每餐所需的碳水化合物质量,m为所述目标推荐食谱中的食物种类量,且m为正整数。
在本公开的一种示例性实施例中,所述方法还包括:
基于预设每餐的配餐规则,根据用户基本信息预设用户所需各营养素的约束条件;
根据所述约束条件确定所述目标推荐食谱中各食物的质量。
在本公开的一种示例性实施例中,所述方法还包括:
确定目标推荐食谱中各食物的各营养素含量,将所述各食物的各营养素含量向量化;
将所述各营养素的含量向量作为神经网络模型的输入,输出所述目标推荐食谱中各食物的质量。
在本公开的一种示例性实施例中,所述神经网络模型的损失函数为Loss=||σ-σ‘||
2+正则项,
其中,σ=(Count
1,Count
2,Count
3),正则项为预设用户所需各营养素的约束条件。
在本公开的一种示例性实施例中,所述方法还包括:
根据食物知识图谱和用户基本信息确定多个待推荐食物。
在本公开的一种示例性实施例中,所述方法还包括:
获取用户基本信息,所述基本信息包括年龄、性别、民族、疾病信息、口味偏好和体重其中至少之一。
在本公开的一种示例性实施例中,所述方法还包括:
输出所述用户每餐所需的各营养素的质量、目标推荐食谱中各食物的质量中的至少之一。
本公开提供一种食物推荐装置,包括:
数据获取模块,用于获取用户的历史用餐数据;
食谱确定模块,用于基于多个待推荐食物和所述历史用餐数据,使用推荐模型确定目标推荐食谱。
在本公开的一种示例性实施例中,还包括:
模型构建模块,用于基于所述多个待推荐食物,构建层次图模型;
目标食谱确定模块,用于基于所述历史用餐数据,根据随机游走算法,通过所述层次图模型确定目标推荐食谱。
在本公开的一种示例性实施例中,所述模型构建模块被配置为以多个待推荐食物为节点,以所述节点之间的路径为边,构建所述层次图模型。
在本公开的一种示例性实施例中,还包括:
权重设置模块,用于初始化设置所述层次图模型中各边的权重;
权重更新模块,用于根据用户的历史用餐数据更新所述各边的权重;
目标推荐食谱确定模块,用于将所述权重最大的路径中包含的待推荐食物确定为目标推荐食谱。
在本公开的一种示例性实施例中,,所述目标推荐食谱确定模块包括:
第一概率值确定单元,用于根据所述目标推荐食谱对应路径的权重得到用户选取所述目标推荐食谱的概率,为第一概率值;
第二概率值确定单元,用于获取其他多个用户选择所述目标推荐食谱的概率,为第二概率值;
目标食谱概率确定单元,用于基于所述第一概率值和所述第二概率值确定用户选择所述目标推荐食谱的概率。
在本公开的一种示例性实施例中,所述食谱确定模块还被配置为:基于多个待推荐食物和所述历史用餐数据,使用注意力机制模型,确定目标推荐食谱。
在本公开的一种示例性实施例中,所述食谱确定模块还包括:
配餐模板设置模块,用于基于所述多个待推荐食物,为每餐的配餐规则预设多个模板;
模板向量化模块,用于将所述多个模板向量化,得到多个模板向量;
隐含向量获取模块,用于获取用户的历史用餐数据中每餐的食物,将所述食物向量化,并对所述食物向量进行特征提取,得到每餐的隐含向量;
目标模板向量确定模块,用于基于注意力机制模型,根据每餐的隐含向量和所述多个模板向量,确定目标模板向量;
增强向量获取模块,用于对所述每餐的隐含向量与所述目标模版向量进行运算,得到目标模板的增强向量;
目标推荐食谱确定模块,用于将所述目标模板的增强向量通过神经网络分类器分类,输出所述目标模板对应的目标推荐食谱。
在本公开的一种示例性实施例中,所述每餐的隐含向量包括第二向量和第三向量,隐含向量获取模块包括:
第一向量获取模块,用于获取用户的历史用餐数据中每餐的食物,将所述食物向量化得到每餐的第一向量;
第二向量获取模块,用于利用第一参数矩阵对所述每餐的第一向量进行运算,得到每餐的第二向量;
第三向量获取模块,用于利用第二参数矩阵对所述每餐的第一向量进行运算,得到每餐的第三向量。
在本公开的一种示例性实施例中,所述目标模板向量确定模块包括:
样本信息获取模块,用于获取多组样本信息,每组样本信息包括:所述每餐的隐含向量和所述多个模板向量;
模型训练模块,用于以所述每餐的隐含向量为输入,以所述多个模板向量的概率值为输出,对所述注意力机制模型进行训练,并将所述概率值最大的模板向量作为所述目标模板向量。
在本公开的一种示例性实施例中,所述增强向量获取模块包括:
注意力分数计算模块,用于计算所述目标模板向量与所述每餐的第二向量之间的注意力分数;
目标模板增强向量获取模块,用于根据所述每餐的隐含向量对应的注意力分数,对所述每餐的第三向量进行加权平均,得到所述目标模板的增强向量。
本公开提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任意一项所述的方法。
本公开提供一种电子设备,包括:处理器;以及存储器,用于存储所述处理器的可执行指令;其中,所述处理器配置为经由执行所述可执行指令来执行上述任意一项所述的方法。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出了可以应用本公开实施例的一种食物推荐方法及装置的示例性系统架构的示意图;
图2示出了适于用来实现本公开实施例的电子设备的计算机系统的结构示意图;
图3示意性示出了根据本公开的一个实施例的食物推荐方法的流程图;
图4示意性示出了根据本公开的一个实施例的食物知识图谱示意图;
图5示意性示出了根据本公开的一个实施例的确定目标推荐食谱的步骤的流程图;
图6示意性示出了根据本公开的一个实施例的层次图模型示意图;
图7示意性示出了根据本公开的一个具体实施例的确定目标推荐食谱的步骤的流程图;
图8示意性示出了根据本公开的另一个实施例的确定目标推荐食谱的步骤的流程图;
图9示意性示出了根据本公开的另一个实施例的确定目标推荐食谱的步骤的流程图;
图10示意性示出了根据本公开的一个实施例的确定目标推荐食谱中各食物的质量的步骤的流程图;
图11示意性示出了根据本公开的一个实施例的食物推荐装置的框图。
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。在下面的描述中,提供许多具体细节从而给出对本公开的实施方式的充分理解。然而,本领域技术人员将意识到,可以实践本公开的技术方案而省略所述特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知技术方案以避免喧宾夺主而使得本公开的各方面变得模糊。现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方 式中。在下面的描述中,提供许多具体细节从而给出对本公开的实施方式的充分理解。然而,本领域技术人员将意识到,可以实践本公开的技术方案而省略所述特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知技术方案以避免喧宾夺主而使得本公开的各方面变得模糊。
此外,附图仅为本公开的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。
图1示出了可以应用本公开实施例的一种食物推荐方法及装置的示例性应用环境的系统架构的示意图。
如图1所示,系统架构100可以包括终端设备101、102、103中的一个或多个,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。终端设备101、102、103可以是各种电子设备,包括但不限于台式计算机、便携式计算机、智能手机和平板电脑等,还可以是各种家用电器,如智能冰箱、智能油烟机等。应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。比如服务器105可以是多个服务器组成的服务器集群等。
本公开实施例所提供的食物推荐方法一般由服务器105执行,相应地,食物推荐装置一般设置于服务器105中,服务器执行完可以将推荐结果发送至终端设备,并由终端设备向用户展示。但本领域技术人员容易理解的是,本公开实施例所提供的食物推荐方法也可以由终端设备101、102、103中的一个或多个执行,相应的,食物推荐装置也可以设置于终端设备101、102、103中,例如,由终端设备执行后可以将推荐结果直接显示在终端设备的显示屏上,也可以通过语音播报的方式将推荐结果提供给用户,本示例性实施例中对此不做特殊限定。
图2示出了适于用来实现本公开实施例的电子设备的计算机系统的结构示意图。
需要说明的是,图2示出的电子设备的计算机系统200仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图2所示,计算机系统200包括中央处理单元(CPU)201,其可以根据存储在只读存储器(ROM)202中的程序或者从存储部分208加载到随机访问存储器(RAM)203中的程序而执行各种适当的动作和处理。在RAM 203中,还存储有系统操作所需的各种程序和数据。CPU 201、ROM 202以及RAM 203通过总线204彼此相连。输入/输出(I/O)接口205也连接至总线204。
以下部件连接至I/O接口205:包括键盘、鼠标等的输入部分206;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分207;包括硬盘等的存储部分208;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分209。通信部分209经由诸如因特网的网络执行通信处理。驱动器210也根据需要连接至I/O接口205。可拆卸介质211,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器210上,以便于从其上读出的计算机程序根据需要被安装入存储部分208。
在一些实施例中,由电子设备的处理器执行本公开中所述的食物推荐方法。在一些实 施例中,通过输入部分206输入用户基本信息和历史用餐数据等信息,例如,通过电子设备的用户交互界面输入用户基本信息和历史用餐数据等信息。在一些实施例中,通过输出部分207将目标推荐食谱、用户每餐所需的各营养素的质量和目标推荐食谱中各食物的质量等信息输出。
特别地,根据本公开的实施例,下文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分209从网络上被下载和安装,和/或从可拆卸介质211被安装。在该计算机程序被中央处理单元(CPU)201执行时,执行本申请的方法和装置中限定的各种功能。
作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该电子设备执行时,使得该电子设备实现如下述实施例中所述的方法。例如,所述的电子设备可以实现如图3、图5、图7至图8及图10所示的各个步骤等。
需要说明的是,本公开所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。
以下对本公开实施例的技术方案进行详细阐述:
饮食配餐方法例如可以是基于用户的基本信息分析用户营养指标给出对应的营养建议,并推荐符合营养需求的食谱。但是,这种方法并没有参考用户的用餐喜好,导致推荐食谱的准确性低。另外,对于仅根据用户用餐的历史选择行判断用户偏好的方式存在一定的局限性。
基于上述一个或多个问题,本示例实施方式提供了一种食物推荐方法,该方法可以应用于上述服务器105,也可以应用于上述终端设备101、102、103中的一个或多个,本示例性实施例中对此不做特殊限定。参考图3所示,该食物推荐方法可以包括以下步骤S310至步骤S320:
步骤S310.获取历史用餐数据。
步骤S320.基于多个待推荐食物和所述历史用餐数据,使用推荐模型确定目标推荐食 谱。
在本公开示例实施方式所提供的食物推荐方法中,通过获取用户的历史用餐数据,基于多个待推荐食物和所述历史用餐数据,使用推荐模型确定目标推荐食谱。该方法通过推荐模型可以准确的确定用户偏爱的食谱,并且通过计算所述食谱中各食物的质量,可以为用户推荐科学合理的食谱。
下面,对于本示例实施方式的上述步骤进行更加详细的说明。
在步骤S310中,获取历史用餐数据。
本示例实施方式中,获取用户的历史用餐数据,可以是每次使用时都获取,也可以按照预设的时间周期获取,例如,每个月获取一次用户的历史用餐数据,并根据用户最新的历史用餐数据推荐食物。所述用户的历史用餐数据可以是用户最近(近几天、几个月等,对时间不做限制)每餐所选择的食物,食物可以包括主食、汤、粥、菜等类型。其中,主食可以包括米饭、馒头等。汤可以包括番茄鸡蛋汤、紫菜蛋花汤等。粥可以包括米粥、南瓜粥等。菜可以包括西红柿炒鸡蛋、炒白菜等。
示例性的,可以获取用户过去一个月内,每日三餐所选择的食物,如第一天的早餐为馒头+米粥+炒白菜,午餐和晚餐类似。也可以获取用户过去15天、20天内每餐所选择的食物,本示例实施方式中对此不做限定。
例如,还可以获取用户基本信息,所述用户基本信息可以是用户的年龄、性别、民族、疾病信息、口味偏好、体重等。在获取用户基本信息后,可以根据食物知识图谱和用户基本信息确定多个待推荐食物。
知识图谱(Knowledge Graph)是一种基于图的数据结构,由节点(Point)和边(Edge)组成。在知识图谱中,节点表示实体或概念,边则由属性或关系构成。知识图谱是关系的最有效的表示方式,知识图谱是指把所有不同种类的信息连接在一起而得到的一个关系网络。因此,知识图谱提供了从“关系”的角度去分析问题的能力。
在本示例实施方式中,可以构建食物知识图谱,所述食物知识图谱的实体可以是各种食物,实体的属性可以包括食物的营养素成分、口味、食材功效、禁忌人群等信息。参考图4所示,该食物知识图谱中的食物实体包括西红柿炒鸡蛋、糖炒鸡蛋和馒头。其中,西红柿炒鸡蛋的属性又可以包括西红柿、鸡蛋等食材。糖炒鸡蛋的属性又可以包括口味甜,鸡蛋等食材,禁忌人群是糖尿病患者,营养素含量包括碳水化合物。馒头的属性又可以包括碳水化合物等。此外,可以将菜类和主食类分别构建食物知识图谱,也可以在同一个知识图谱中同时体现菜类和主食类。
可以将构建好的食物知识图谱进行存储以备后续访问和调用。因此,食物知识图谱可以是每次用户进行食物推荐时实时构建的,也可以是预先构建并存储于数据库中的,例如,可以将食物知识图谱存储于Neo4j(一种高性能的NoSQL图形数据库)数据库,在用户进行食物推荐时进行调用。
在一些实施例中,可以根据所述食物知识图谱和用户基本信息确定多个待推荐食物。例如,如果用户的民族为回族,可以在食物知识图谱中查找食物属性,将不适合回族用户的猪肉等相关的食物舍弃。例如,对于糖尿病患者,可以根据医学上饮食禁忌规则或医嘱等确定糖尿病用户每天糖类的摄入量和单糖、多糖的摄入要求等,根据食物知识图谱确定食物是否属于高升糖食物或是否符合以上饮食禁忌规则或医嘱等,将不符合条件的食物舍弃。将所述食物知识图谱中剩余(未舍弃)的食物作为待推荐食物。可以使用Cypher等查询语言在知识图谱中进行搜索和查询,找到符合用户基本信息的多个待推荐食物。所述 待推荐食物可以是馒头、米粥、西红柿炒鸡蛋等。也可以将用户的历史用餐数据中每餐包含的食物作为待推荐食物。基于用户基本信息筛选待推荐食物,可以更准确的为用户提供食谱,提升用户体验。也可以基于用户的历史用餐数据,通过二叉排序树将多个待选食物进行排列,并根据用户基本信息确定多个待推荐食物,还可以通过创建关系型数据确定多个待推荐食物,例如,创建MySQL数据库,本示例实施方式对此不做限定。
在一些实施例中,可以预先设置每餐的配餐规则。例如,为了将各类食物进行合理搭配,可以预先设置早餐的食物,可以包括主食+饮品+菜,也可以包括主食+菜,还可以包括主食+饮品+菜+餐后甜点,午餐和晚餐类似。可以理解的是,每餐的配餐规则可以根据用户实际需求设置,例如,可以是用户通过终端的用户交互界面等方式输入配餐规则,也可以是在后台预先统一设定好配餐规则,如可以将多个待推荐食物按照配餐规则进行组合搭配后推荐给用户,本示例实施方式中对此不做限定。
在步骤S320中,基于多个待推荐食物和所述历史用餐数据,使用推荐模型确定目标推荐食谱。
一种示例实施方式中,参考图5所示,该过程可以包括以下步骤:
步骤S510.基于所述多个待推荐食物,构建层次图模型。
多个待推荐食物可以是馒头、米粥、西红柿炒鸡蛋等,可以分别以馒头、米粥、西红柿炒鸡蛋等食物为节点,对应的,以所述节点之间的路径为边,构建层次图模型。层次图模型是指用一颗“有向树”的数据结构来表示各类实体以及实体间的联系,树中每一个节点代表一个记录类型,节点间的边表示记录类型之间的联系。层次图模型的结构清晰,节点间联系简单,且记录类型之间的联系用有向边表示。因此,根据层次图模型查询待推荐食物的效率高。
步骤S520.基于所述历史用餐数据,根据随机游走算法,通过所述层次图模型确定目标推荐食谱。
随机游走算法是指从一个或一系列顶点开始遍历整个层次图模型。在任意一个顶点,遍历者将以概率1-a游走到这个顶点的相邻顶点,以概率a随机跳跃到层次图模型中的任何一个顶点,称a为跳转发生概率,每次游走后得出一个概率分布,该概率分布刻画了层次图模型中每一个顶点被访问到的概率。用该概率分布作为下一次游走的输入并反复迭代这一过程,当满足迭代终止条件时,该概率分布会趋于收敛。其中,迭代终止条件可以是满足预设的迭代次数,如迭代100次后,概率分布趋于收敛,也可以是一直迭代直到概率分布收敛等其他迭代终止条件。收敛后,即可以得到一个平稳的概率分布。
参考图6所示的层次图模型,是以多个待推荐食物为节点,以各个待推荐食物之间的路径为边构建而成。所述多个待推荐食物包括主食有①、②、③、④等,菜有a、b、c、d等,汤有m
1、m
2、m
3、m
4等。可以通过所述层次图模型确定目标推荐食谱,参考图7所示,该过程可以包括以下步骤:
步骤S710.初始化设置所述层次图模型中各边的权重。
可以初始化设置层次图模型中各边的权重,例如,可以将层次图模型中各边的初始权重均设置为0,还可以将各边的初始权重设置为其它任意值。其中,将各边的初始权重均设置为0的目的是以便于统计后续层次图模型中各边的权重变化。
步骤S720.根据用户的历史用餐数据更新所述各边的权重;
可以获取用户的历史用餐数据,并根据用户的历史用餐数据更新所述各边的权重。例如,由用户的历史用餐数据显示用户的历史选择有:①→b→m
1,①→b,①→a→m
1,② →c等多种路径。假设对于以节点①为起始节点的路径有①→b→m
1,①→b,①→a→m
1,可知路径①→b的权重为(①→b)路径数/(含①的路径数),即2/3。由此可知,根据用户的历史用餐数据可以将路径①→b由初始权重0更新成2/3。
步骤S730.将所述权重最大的路径中包含的待推荐食物确定为目标推荐食谱。
在根据用户的历史用餐数据更新所述各边的权重后,可以得到每条路径的权重。例如,路径①→b的权重为2/3,①→a的权重为1/6,①→c的权重为1/6,b→m
1的权重为1/3,b→m
2的权重为1/3,b→m
3的权重为1/3。为用户推荐食物时,可以选择权重大的路径进行推荐,如可以选择①→b(主食①和菜b),也可以选择①→b→m
1(主食①、菜b和汤m
1),权重越大意味着用户选择该待推荐食物组合的概率越大,也即可以将该待推荐食物组合构成的食谱作为目标推荐食谱。
通过这种方式,不仅根据用户对①→b这个单一组合的历史选择行为判断用户对该食谱最感兴趣,同时考虑了含有该组合的其它食谱,例如①→b→m2,则考虑的信息更为全面,推荐更为精准。同时基于该结果,还可以认为,①→b与其它食材的搭配,也更容易被用户接受。
在一些实施方式中,可以根据目标推荐食谱对应路径的权重得到用户选取目标推荐食谱的概率,记为第一概率值P
1。根据大数据统计分析,可以获取其他多个用户选择该目标推荐食谱的概率(例如,分别获取其他多个用户中每个用户基于该路径进行食谱推荐的概率并取平均值),记为第二概率值P
2。基于P
1和P
2,根据公式P=αP
1+(1-α)P
2可以得到用户最终选择目标推荐食谱的概率,其中,α指根据用户的历史用餐数据确定选取目标推荐食谱的事件所占的权重,对应的,(1-α)指根据其他用户的选择确定选取目标推荐食谱的事件所占的权重。然后,可以对多种目标推荐食谱的P值进行排序,例如降序排序,将排名靠前的目标推荐食谱推荐给用户,如将排序后的前十个P值对应的目标推荐食谱向用户推荐。
由此可知,基于层次图模型,通过分析用户的历史用餐数据确定用户对哪种食物组合更偏爱,可以更准确的向用户推荐食谱。而且通过将该食物组合中的食物进行拆解,并与其它待推荐食物搭配,将用户偏爱的食谱进一步优化,为用户提供了更多的选择,可以提升用户体验,增加用户使用粘性。
另一种示例实施方式中,还可以基于多个待推荐食物和所述历史用餐数据,使用注意力机制模型,确定目标推荐食谱。参考图8所示,该过程可以包括以下步骤:
步骤S810.基于所述多个待推荐食物,为每餐的配餐规则预设多个模板。
可以预先为每餐的配餐规则设置多个模版。例如,早餐的配餐规则的模版可以包括:主食+粥+菜、主食+粥+汤、主食+菜+甜品,午餐和晚餐类似。其中,配餐模版的数量本示例实施方式中不做限制。
步骤S820.将所述多个模板向量化,得到多个模板向量。
在一些实施方式中,可以对每个模板中的每项进行One-Hot(独热编码)编码,得到One-Hot编码向量,即模板向量。One-Hot编码又称作一位有效编码,其方法是使用N位状态寄存器来对N个状态进行编码,每个状态都有独立的寄存器位,并且在任意时候,寄存器中只有一位有效。其中,每个模板向量的维度是所有待推荐食物的种类数量。也可以通过Word Embedding(词嵌入)算法将每个模板转化为向量,如Word2vec算法、Glove算法等,还可以通过其它方式将每个模板转化为向量,如TransE等算法。
步骤S830.获取用户的历史用餐数据中每餐的食物,将所述食物向量化,并对所述食 物向量进行特征提取,得到每餐的隐含向量。
示例性的,获取用户的历史用餐数据,每餐可以包含多个待推荐食物,可以通过注意力机制模型对每个待推荐食物编码,将每个待推荐食物向量化。所述注意力机制模型是一种机器学习模型,是模拟人类的视觉注意力行为,人类在观察一幅画的时候,在全局扫描图像后,会得到需要注意的目标区域,然后投入更多关注,从而获得目标区域的细节信息。因此,可以将人类的注意力行为抽象出来,应用在机器学习模型中。所述注意力机制模型可以包括:嵌入层、神经网络层、注意力层、连接层和归一化层。
在一些实施方式中,在所述注意力机制模型的嵌入层,可以对每个待推荐食物进行One-Hot编码,得到每餐向量,也可以通过Word Embedding(词嵌入)算法将每个待推荐食物转化为向量,如Word2vec算法、Glove算法等,还可以通过其它方式将每个待推荐食物转化为向量,如TransE等算法。
例如,参考图9中9A部分所示,可以获取用户过去n天内,每日三餐所选择的食物,将每个食物作为待推荐食物并向量化,可以得到第一天的早餐为E
11,午餐为E
12,晚餐为E
13……,第n天的晚餐为E
n3。
所述注意力机制模型的嵌入层还可以把每餐向量构成的矩阵,通过线性变换变成密集矩阵,即将高维稀疏且不相关的每餐向量投影到低维的向量。
在一些实施方式中,可以通过神经网络层对每餐的低维向量进行隐含特征的提取。例如,可以通过长短期记忆网络提取隐含特征,得到每餐的隐含向量,每餐的隐含向量可以包括第二向量和第三向量。其中,长短期记忆网络是一种时间递归神经网络,适合于处理和预测时间序列中间隔和延迟相对较长的重要事件。当然,也可以通过卷积神经网络、循环神经网络或其他网络提取隐含特征,在此不做限定。
示例性的,可以将用户的历史用餐数据中每餐中的食物向量化得到每餐的第一向量。通过注意力机制模型的第一神经网络层对所述每餐的第一向量进行运算,得到每餐的第二向量。通过注意力机制模型的第二神经网络层对所述每餐的第一向量进行运算,得到每餐的第三向量。
在一些实施方式中,也可以直接将第一向量与各参数矩阵进行运算进而得到第二向量和第三向量。
例如,参考图9中9B部分所示,可以将每餐的第一向量乘以第一参数矩阵W
1,得到K
11=W
1*E
11,K
12=W
1*E
12……,K
n3=W
1*E
n3。其中,K
11、K
12等分别为每餐的第二向量。
将每餐的第一向量乘以第二参数矩阵W
2,得到V
11=W
2*E
11,V
12=W
2*E
12……,V
n3=W
2*E
n3。其中,V
11、V
12等分别为每餐的第三向量。
目标模版向量在对模型的训练过程中确定,具体过程如下:
基于注意力机制模型,根据每餐的隐含向量和所述多个模板向量,确定目标模板向量。
机器学习模型是基于大量的样本信息训练得到,在对上述注意力机制模型进行训练后可以确定目标模板。训练过程可以先获取多组样本信息,每组样本信息包括:模板向量、用户的用餐历史数据对应的每餐的隐含向量,及对应的用户选取所述样本模板向量的概率。以所述每餐的隐含向量和每餐的隐含向量为输入,以所述多个模板向量的概率值为输出,对所述注意力机制模型进行训练,并将所述概率值最大的模板向量作为所述目标模板向量,记作Q
1。
本示例实施方式中,对注意力机制模型训练的过程,也就是不断更新该模型中参数的 过程。可以根据用户选取所述样本模板向量的概率和预测概率计算损失函数,并根据损失函数更新注意力机制模型。其中,注意力机制模型中的参数(u
T、W
h和W
s)是预先设置的,在训练的过程中,可以通过梯度下降法,根据反向传播原理,不断计算损失函数,并根据损失函数更新该模型中的参数。确定每组样本对应的参数后,根据输出的每组样本模板向量的概率确定所述目标模板。
步骤S840.对所述每餐的隐含向量与所述目标模版向量进行运算,得到目标模板的增强向量。
通过注意力机制模型的注意力层,针对目标模板向量,可以计算该目标模板向量与每餐的隐含向量之间的注意力分数。注意力分数是一个0~1区间的值,被注意力机制模型作用下的所有注意力分数和为1。每个注意力分数代表当前项所被分配的注意力权重,注意力分数常由神经网络的权重参数在模型的训练中学习得来,并最终进行归一化运算。
一种示例实施方式中,可以通过注意力打分函数中的点积模型,计算所述目标模板向量Q
1与所述每餐的第二向量K
i之间的注意力分数,也就是计算目标模板向量和第二向量的相似度,如通过计算K
i和Q
1点乘即α
i=K
i·Q
1,得到二者向量之间的相似度大小。根据目标模板向量和第二向量之间的相似度大小α
i,对所述每餐的第三向量V
i进行加权平均,即
得到所述目标模板的增强向量。其中,i为1~M的整数,M表示n天内所有餐的数量。
一种示例实施方式中,也可以通过注意力打分函数中的加性模型,即根据公式f(K
i,Q
1)=u
Ttanh(W
h*K
i+W
s*Q
1)计算注意力分数f(h
i,s)。其中,K
i表示的第i餐的隐含向量,i为1~M的整数,M表示n天内所有餐的数量,Q
1表示目标模板向量,u
T、W
h和W
s表示注意力机制模型的参数,
例如,参考图9中9C部分所示,可以根据上述公式,计算目标模板向量Q
1与每餐的第二向量K
i的注意力分数f(K
i,Q
1)。各注意力分数f(K
i,Q
1)经过归一化可以得到权重α
1,…,α
M。然后与每餐的第三向量V
i做加权平均,得到增强向量c
1,即
一种示例实施方式种,还可以根据注意力打分函数中的缩放点击模型和双线性模型计算注意力分数。
步骤S850.将所述目标模板的增强向量通过神经网络分类器分类,输出所述目标模板对应的目标推荐食谱。
参考图9中9D部分所示,可以将目标模板的增强向量通过神经网络分类器分类,例如,还可以通过池化处理和归一化运算,输出所述目标模板对应的目标推荐食谱。可见,本示例实施方式中通过注意力机制模型提取目标模板的增强向量即重要特征向量,并根据所述重要特征向量与数据库中的多个待推荐食谱进行匹配,可以更准确的匹配到对应的目标推荐食谱。
上述基于注意力机制模型进行推荐的方法中,能够同时得出用户偏爱的食谱模版以及根据该模版确定的食谱,且能够按着预先设置的模版规则进行推荐。
一种示例实施方式中,还可以根据每餐所需的各营养素质量确定所述目标推荐食谱中各食物的质量。参考图10所示,该过程可以包括以下步骤:
步骤S1010.根据用户基本信息确定用户每餐所需的各营养素的质量。
在一些实施方式中,通过用户交互界面获取用户基本信息,例如,用户通过用户交互界面输入年龄、性别、民族、疾病信息、口味偏好和体重其中至少之一。
本示例实施方式中,首先,可以根据用户基本信息确定用户每餐所需能量然后根据用 户每餐所需能量与各营养素的关系确定用户每餐所需的各营养素的质量。
具体的,基于营养学规则,可以根据用户基本信息获取用户一天中所需总能量的合理范围。例如,一天中早餐、午餐、晚餐的能量分配可以由营养学数据确定,也可以根据用户实际需求分配每餐所需能量,如早餐占比35%,午餐占比40%,晚餐占比25%,则可以确定用户三餐各应摄入的能量的范围。例如,用户一天所需总能量为1000卡路里,则早餐所需350卡路里,午餐所需400卡路里,晚餐所需250卡路里。
可以根据用户每餐所需能量与各营养素的关系确定用户每餐所需的各营养素的质量,即根据:
确定用户每餐所需的各营养素的质量。其中,nutrientCount
n为第n种营养素质量;energy为待推荐食谱用户每餐所需的能量值;ratio
n为第n种营养素占每餐的能量值的比例系数;param
n为第n种营养素换算能量系数;n为正整数。
步骤S1020.根据每餐所需的各营养素质量确定所述目标推荐食谱中各食物的质量。
一种示例实施方式中,可以根据目标推荐食谱包含的待推荐食物中的各营养素含量和每餐所需的各营养素质量的关系确定所述目标推荐食谱中各食物的质量,即根据:
确定所述目标推荐食谱中各食物的质量。其中,fat
m为第m种食物所含的脂肪含量,x
m为第m种食物的质量,Count
1为所述目标推荐食谱用户每餐所需的脂肪质量,protein
m为第m种食物所含的蛋白质含量,Count
2为所述目标推荐食谱用户每餐所需的蛋白质质量,CHO
m为第m种食物所含的碳水化合物含量,Count
3为所述目标推荐食谱用户每餐所需的碳水化合物质量,m为所述目标推荐食谱中的食物种类量,且m为正整数。
例如目标推荐食谱为面包+牛奶+炒白菜,则上述公式中的m=3,且上式等式组有唯一解,即可以确定该目标推荐食谱中各食物的质量,能够提高推荐的食谱的精确度,满足用户的需求。
再例如,目标推荐食谱为米饭+柠檬汁+炒白菜+蛋糕,则上述公式中的m=4,且上述等式组可能有多个解,即得到的针对某一个待推荐食谱中的食物质量分配方式为多个,即无法确定该目标推荐食谱中各食物的质量。因此,基于预设每餐的配餐规则,还可以根据用户基本信息预设用户所需各营养素的约束条件。例如,对于糖尿病患者,可以将糖类的摄入量控制在合理范围内,对应糖类摄入量的约束条件可以是:c
1*x
1+c
2*x
2+…+c
m*x
m≤Count
4,c
m为第m种食物所含的糖类含量,x
m为第m种食物的质量,Count
4为目标推荐食谱用户每餐所需的糖类质量。基于上述公式进而根据所述约束条件可以确定所述目标推荐食谱中各食物的质量,为用户提供更适合的食谱,满足用户的需求。
一种示例实施方式中,根据目标推荐食谱包含的待推荐食物中的各营养素含量和每餐所需的各营养素质量的关系确定所述目标推荐食谱中各食物的质量时,还可以令:
其中,每一组(x
1,x
2,…x
m)对应一组(f
x、p
x、C
x),f
x、p
x、C
x为实际计算出的 每餐所需的各营养素质量。
为了确定所述目标推荐食谱中各食物的质量x
1、x
2…x
m,可以设置约束函数:
Φ=min((f(x)-Count
1)
2+(p(x)-Count
2)
2+(p(x)-Count
3)
2+|x
1|+|x
2|+…+|x
m|)
其中,Count
1、Count
2、Count
3为根据用户每餐所需能量与各营养素的关系计算得到的用户每餐所需的各营养素的质量的标准值。当上述约束函数的值最小时,可以确定该最小值对应的用户每餐所需的各营养素的质量的实际值f
x、p
x、C
x,以及确定该最小值对应的目标推荐食谱中各食物的质量。
一种示例实施方式中,还可以通过步骤S910确定目标推荐食谱中各食物的各营养素含量,并将所述各食物的各营养素含量向量化。类似的,可以对各营养素含量进行One-Hot编码,将各营养素含量向量化,得到各营养素含量向量。
对应的,也可以获取多组样本数据先对神经网络模型进行训练。其中,每组样本数据包括:各营养素的样本含量向量、目标推荐食谱中各食物的质量。以所述各营养素的样本含量向量为输入,以所述目标推荐食谱中各食物的质量为输出,对神经网络模型进行训练。
具体的,可以将所述各营养素的含量向量作为神经网络模型的输入,根据损失函数更新所述神经网络模型,输出所述目标推荐食谱中各食物的质量。类似的,也可以通过梯度下降法,根据反向传播原理,不断计算损失函数,并根据损失函数更新神经网络模型中的参数。
所述神经网络模型的损失函数可以为Loss=||σ-σ‘||
2+正则项,其中,σ=(Count
1,Count
2,Count
3),为用户每餐所需的各营养素的质量,σ‘为所述神经网络预测得到的用户每餐所需的各营养素的质量,正则项为预设用户所需各营养素的约束条件。损失函数可以用来估量模型的预测值与真实值的不一致程度,损失函数也可以为指数损失函数,还可以为感知损失函数,本示例实施方式中对此不做限定。在确定了目标推荐食谱之后,可以由服务器发送给用户终端进行展示。如果当前展示的目标推荐食谱不满足用户偏好和需求时,用户可以切换下一个目标推荐食谱,将所有的目标推荐食谱逐一进行推荐。
在一些实施方式中,还可以输出所述用户每天需要的各营养素总质量、每餐所需的各营养素的质量、目标推荐食谱中各食物的质量、目标推荐食谱等其中的至少之一。例如,通过用户交互界面输出以上各项信息。例如,用户可以通过界面对各项内容进行编辑,根据个人需要进行调整。
在本公开示例实施方式所提供的食物推荐方法中,通过获取用户的历史用餐数据,基于多个待推荐食物和所述历史用餐数据,使用推荐模型确定目标推荐食谱,根据每餐所需的各营养素质量确定所述目标推荐食谱中各食物的质量。该方法通过推荐模型可以准确的确定用户偏爱的食谱,并且通过计算所述食谱中各食物的质量,可以为用户推荐科学合理的食谱。
应当注意,尽管在附图中以特定顺序描述了本公开中方法的各个步骤,但是,这并非要求或者暗示必须按照该特定顺序来执行这些步骤,或是必须执行全部所示的步骤才能实现期望的结果。附加的或备选的,可以省略某些步骤,将多个步骤合并为一个步骤执行,以及/或者将一个步骤分解为多个步骤执行等。
进一步的,本示例实施方式中,还提供了一种食物推荐装置。该装置可以应用于一服务器或终端设备。参考图11所示,该食物推荐装置1100可以包括数据获取模块1110以及食谱确定模块1120,其中:
数据获取模块1110,用于获取用户的历史用餐数据;
食谱确定模块1120,用于基于多个待推荐食物和所述历史用餐数据,使用推荐模型确定目标推荐食谱。
在一些实施例中,数据获取模块通过用户交互界面获取用户的历史用餐数据,例如,用户通过用户交互界面输入个人的历史用餐数据。
在一些实施例中,食谱确定模块确定的目标推荐食谱可以通过用户交互界面展示给用户。在一种可选的实施方式中,食谱确定模块1120包括:
模型构建模块,用于基于所述多个待推荐食物,构建层次图模型;
目标食谱确定模块,用于基于所述历史用餐数据,根据随机游走算法,通过所述层次图模型确定目标推荐食谱。
在一种可选的实施方式中,模型构建模块被配置为用于以多个待推荐食物为节点,以所述节点之间的路径为边,构建所述层次图模型。
在一种可选的实施方式中,食谱确定模块包括:
权重设置模块,用于初始化设置所述层次图模型中各边的权重;
权重更新模块,用于根据用户的历史用餐数据更新所述各边的权重;
目标推荐食谱确定模块,用于将所述权重最大的路径中包含的待推荐食物确定为目标推荐食谱。
在一种可选的实施方式中,目标推荐食谱确定模块包括:
第一概率值确定单元,用于根据所述目标推荐食谱对应路径的权重得到用户选取所述目标推荐食谱的概率,为第一概率值;
第二概率值确定单元,用于获取其他多个用户选择所述目标推荐食谱的概率,为第二概率值;
目标食谱概率确定单元,用于基于所述第一概率值和所述第二概率值确定用户选择所述目标推荐食谱的概率。
在一种可选的实施方式中,食谱确定模块1120还被配置为:用于基于多个待推荐食物和所述历史用餐数据,使用注意力机制模型,确定目标推荐食谱。
在一种可选的实施方式中,食谱确定模块1120还包括:
配餐模板设置模块,用于基于所述多个待推荐食物,为每餐的配餐规则预设多个模板;
模板向量化模块,用于将所述多个模板向量化,得到多个模板向量;
隐含向量获取模块,用于获取用户的历史用餐数据中每餐的食物,将所述食物向量化,并对所述食物向量进行特征提取,得到每餐的隐含向量;
目标模板向量确定模块,用于基于注意力机制模型,根据每餐的隐含向量和所述多个模板向量,确定目标模板向量;
增强向量获取模块,用于对所述每餐的隐含向量与所述目标模版向量进行运算,得到目标模板的增强向量;
目标推荐食谱确定模块,用于将所述目标模板的增强向量通过神经网络分类器分类,输出所述目标模板对应的目标推荐食谱。
在一种可选的实施方式中,所述每餐的隐含向量包括第二向量和第三向量,隐含向量获取模块包括:
第一向量获取模块,用于获取用户的历史用餐数据中每餐的食物,将所述食物向量化得到每餐的第一向量;
第二向量获取模块,用于利用第一参数矩阵对所述每餐的第一向量进行运算,得到每餐的第二向量;
第三向量获取模块,用于利用第二参数矩阵对所述每餐的第一向量进行运算,得到每餐的第三向量。
在一种可选的实施方式中,目标模板向量确定模块包括:
样本信息获取模块,用于获取多组样本信息,每组样本信息包括:所述每餐的隐含向量和所述多个模板向量;
模型训练模块,用于以所述每餐的隐含向量为输入,以所述多个模板向量的概率值为输出,对所述注意力机制模型进行训练,并将所述概率值最大的模板向量作为所述目标模板向量。
在一种可选的实施方式中,增强向量获取模块包括:
注意力分数计算模块,用于计算所述目标模板向量与所述每餐的第二向量之间的注意力分数;
目标模板增强向量获取模块,用于根据所述每餐的隐含向量对应的注意力分数,对所述每餐的第三向量进行加权平均,得到所述目标模板的增强向量。
在一种可选的实施方式中,该食物推荐装置还包括:
配餐规则预设模块,用于预设每餐的配餐规则。
在一种可选的实施方式中,该食物推荐装置还包括:
质量确定模块,用于根据每餐所需的各营养素质量确定所述目标推荐食谱中各食物的质量。
在一种可选的实施方式中,质量确定模块包括:
营养素质量确定模块,用于根据用户基本信息确定用户每餐所需的各营养素的质量;
食物质量确定模块,用于根据每餐所需的各营养素质量确定所述目标推荐食谱中各食物的质量。
在一种可选的实施方式中,营养素质量确定模块包括:
能量确定模块,用于根据用户基本信息确定用户每餐所需能量;
各营养素质量确定模块,用于根据用户每餐所需能量与各营养素的关系:
确定用户每餐所需的各营养素的质量;
其中,nutrientCount
n为第n种营养素质量;energy为待推荐食谱用户每餐所需的能量值;ratio
n为第n种营养素占每餐的能量值的比例系数;param
n为第n种营养素换算能量系数;n为正整数。
在一种可选的实施方式中,食物质量确定模块被配置为:用于根据所述目标推荐食谱包含的待推荐食物中的各营养素含量和每餐所需的各营养素质量的关系:
确定所述目标推荐食谱中各食物的质量;
其中,fat
m为第m种食物所含的脂肪含量,x
m为第m种食物的质量,Count
1为所述 待推荐食谱用户每餐所需的脂肪质量,protein
m为第m种食物所含的蛋白质含量,Count
2为所述待推荐食谱用户每餐所需的蛋白质质量,CHO
m为第m种食物所含的碳水化合物含量,Count
3为所述待推荐食谱用户每餐所需的碳水化合物质量,m为所述目标推荐食谱中的食物种类量,且m为正整数。
在一种可选的实施方式中,质量确定模块包括还包括:
约束条件预设模块,用于基于预设每餐的配餐规则,根据用户基本信息预设用户所需各营养素的约束条件;
食物质量确定模块,用于根据所述约束条件确定所述目标推荐食谱中各食物的质量。
在一种可选的实施方式中,质量确定模块包括还包括:
营养素含量向量化模块,用于确定目标推荐食谱中各食物的各营养素含量,将所述各食物的各营养素含量向量化;
食物质量确定模块,用于将所述各营养素的含量向量作为神经网络模型的输入,输出所述目标推荐食谱中各食物的质量。
在一种可选的实施方式中,食物质量确定模块中所述神经网络模型的损失函数为Loss=||σ-σ‘||
2+正则项,
其中,σ=(Count
1,Count
2,Count
3),正则项为预设用户所需各营养素的约束条件。
在一种可选的实施方式中,该食物推荐装置还包括:
待推荐食物确定模块,用于根据食物知识图谱和用户基本信息确定多个待推荐食物。
在一种可选的实施方式中,待推荐食物确定模块还包括:
用户基本信息获取模块,用于获取用户基本信息,所述基本信息包括年龄、性别、民族、疾病信息、口味偏好和体重其中至少之一。
在一种可选的实施方式中,质量确定模块还包括:
输出所述用户每餐所需的各营养素的质量、目标推荐食谱中各食物的质量中的至少之一。
上述食物推荐装置中各模块的具体细节已经在对应的食物推荐方法中进行了详细的描述,因此此处不再赘述。
上述装置中各模块可以是通用处理器,包括:中央处理器、网络处理器等;还可以是数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。各模块也可以由软件、固件等形式来实现。上述装置中的各处理器可以是独立的处理器,也可以集成在一起。
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。
Claims (33)
- 一种食物推荐方法,其特征在于,包括:获取历史用餐数据;基于多个待推荐食物和所述历史用餐数据,使用推荐模型确定目标推荐食谱。
- 根据权利要求1所述的食物推荐方法,其特征在于,所述基于多个待推荐食物和所述历史用餐数据,使用推荐模型确定目标推荐食谱,包括:基于所述多个待推荐食物,构建层次图模型;基于所述历史用餐数据,根据随机游走算法,通过所述层次图模型确定目标推荐食谱。
- 根据权利要求2所述的食物推荐方法,其特征在于,所述基于所述多个待推荐食物,构建层次图模型,包括:以多个待推荐食物为节点,以所述节点之间的路径为边,构建所述层次图模型。
- 根据权利要求2所述的食物推荐方法,其特征在于,所述基于所述历史用餐数据,根据随机游走算法,通过所述层次图模型确定目标推荐食谱,包括:初始化设置所述层次图模型中各边的权重;根据用户的历史用餐数据更新所述各边的权重;将所述权重最大的路径中包含的待推荐食物确定为目标推荐食谱。
- 根据权利要求4所述的食物推荐方法,其特征在于,所述将所述权重最大的路径中包含的待推荐食物确定为目标推荐食谱,包括:根据所述目标推荐食谱对应路径的权重得到用户选取所述目标推荐食谱的概率,为第一概率值;获取其他多个用户选择所述目标推荐食谱的概率,为第二概率值;基于所述第一概率值和所述第二概率值确定用户选择所述目标推荐食谱的概率。
- 根据权利要求1所述的食物推荐方法,其特征在于,所述基于多个待推荐食物和所述历史用餐数据,使用推荐模型确定目标推荐食谱,还包括:基于多个待推荐食物和所述历史用餐数据,使用注意力机制模型,确定目标推荐食谱。
- 根据权利要求6所述的食物推荐方法,其特征在于,所述基于多个待推荐食物和所述历史用餐数据,使用注意力机制模型,确定目标推荐食谱,包括:基于所述多个待推荐食物,为每餐的配餐规则预设多个模板;将所述多个模板向量化,得到多个模板向量;获取用户的历史用餐数据中每餐的食物,将所述食物向量化,并对所述食物向量进行特征提取,得到每餐的隐含向量;对所述每餐的隐含向量与目标模版向量进行运算,得到目标模板的增强向量;将所述目标模板的增强向量通过神经网络分类器分类,输出所述目标模板 对应的目标推荐食谱。
- 根据权利要求7所述的食物推荐方法,其特征在于,所述每餐的隐含向量包括第二向量和第三向量;所述获取用户的历史用餐数据中每餐的食物,将所述食物向量化,并对所述食物向量进行特征提取,得到每餐的隐含向量,包括:获取用户的历史用餐数据中每餐的食物,将所述食物向量化得到每餐的第一向量;利用第一参数矩阵对所述每餐的第一向量进行运算,得到每餐的第二向量;利用第二参数矩阵对所述每餐的第一向量进行运算,得到每餐的第三向量。
- 根据权利要求7所述的食物推荐方法,其特征在于,所述方法还包括:获取多组样本信息,每组样本信息包括:所述每餐的隐含向量和所述多个模板向量;以所述每餐的隐含向量为输入,以所述多个模板向量的概率值为输出,对所述注意力机制模型进行训练,并将所述概率值最大的模板向量作为所述目标模板向量。
- 根据权利要求8所述的食物推荐方法,其特征在于,所述对所述每餐的隐含向量与所述目标模版向量进行运算,得到目标模板的增强向量,包括:计算所述目标模板向量与所述每餐的第二向量之间的注意力分数;根据所述每餐的隐含向量对应的注意力分数,对所述每餐的第三向量进行加权平均,得到所述目标模板的增强向量。
- 根据权利要求1-10任一项所述的食物推荐方法,其特征在于,所述方法还包括:设置每餐的配餐规则。
- 根据权利要求1-11任一项所述的食物推荐方法,其特征在于,所述方法还包括:根据每餐所需的各营养素质量确定所述目标推荐食谱中各食物的质量。
- 根据权利要求12所述的食物推荐方法,其特征在于,所述根据每餐所需的各营养素质量确定所述目标推荐食谱中各食物的质量,包括:根据用户基本信息确定用户每餐所需的各营养素的质量;根据每餐所需的各营养素质量确定所述目标推荐食谱中各食物的质量。
- 根据权利要求14所述的食物推荐方法,其特征在于,所述根据每餐所需的各营养素质量确定目标推荐食谱中各食物的质量,包括:根据所述目标推荐食谱包含的待推荐食物中的各营养素含量和每餐所需的各营养素质量的关系:确定所述目标推荐食谱中各食物的质量;其中,fat m为第m种食物所含的脂肪含量,x m为第m种食物的质量,Count 1为所述待推荐食谱用户每餐所需的脂肪质量,protein m为第m种食物所含的蛋白质含量,Count 2为所述待推荐食谱用户每餐所需的蛋白质质量,CHO m为第m种食物所含的碳水化合物含量,Count 3为所述待推荐食谱用户每餐所需的碳水化合物质量,m为所述目标推荐食谱中的食物种类量,且m为正整数。
- 根据权利要求15所述的食物推荐方法,其特征在于,所述方法还包括:基于预设每餐的配餐规则,根据用户基本信息预设用户所需各营养素的约束条件;根据所述约束条件确定所述目标推荐食谱中各食物的质量。
- 根据权利要求15所述的食物推荐方法,其特征在于,所述方法还包括:确定目标推荐食谱中各食物的各营养素含量,将所述各食物的各营养素含量向量化;将所述各营养素的含量向量作为神经网络模型的输入,输出所述目标推荐食谱中各食物的质量。
- 根据权利要求17所述的食物推荐方法,其特征在于,所述神经网络模型的损失函数为Loss=||σ-σ‘|| 2+正则项,其中,σ=(Count 1,Count 2,Count 3),正则项为预设用户所需各营养素的约束条件。
- 根据权利要求1-18任一项所述的食物推荐方法,其特征在于,所述方法还包括:根据食物知识图谱和用户基本信息确定多个待推荐食物。
- 根据权利要求19所述的食物推荐方法,其特征在于,所述方法还包括:获取用户基本信息,所述基本信息包括年龄、性别、民族、疾病信息、口味偏好和体重其中至少之一。
- 根据权利要求13-20任一项所述的食物推荐方法,其特征在于,所述方法还包括:输出所述用户每餐所需的各营养素的质量、目标推荐食谱中各食物的质量中的至少之一。
- 一种食物推荐装置,其特征在于,包括:数据获取模块,用于获取用户的历史用餐数据;食谱确定模块,用于基于多个待推荐食物和所述历史用餐数据,使用推荐模型确定目标推荐食谱。
- 根据权利要求22所述的食物推荐装置,其特征在于,还包括:模型构建模块,用于基于所述多个待推荐食物,构建层次图模型;目标食谱确定模块,用于基于所述历史用餐数据,根据随机游走算法,通过所述层次图模型确定目标推荐食谱。
- 根据权利要求23所述的食物推荐装置,其特征在于,所述模型构建模块被配置为以多个待推荐食物为节点,以所述节点之间的路径为边,构建所述层次图模型。
- 根据权利要求24所述的食物推荐装置,其特征在于,还包括:权重设置模块,用于初始化设置所述层次图模型中各边的权重;权重更新模块,用于根据用户的历史用餐数据更新所述各边的权重;目标推荐食谱确定模块,用于将所述权重最大的路径中包含的待推荐食物确定为目标推荐食谱。
- 根据权利要求25所述的食物推荐装置,其特征在于,所述目标推荐食谱确定模块包括:第一概率值确定单元,用于根据所述目标推荐食谱对应路径的权重得到用户选取所述目标推荐食谱的概率,为第一概率值;第二概率值确定单元,用于获取其他多个用户选择所述目标推荐食谱的概率,为第二概率值;目标食谱概率确定单元,用于基于所述第一概率值和所述第二概率值确定用户选择所述目标推荐食谱的概率。
- 根据权利要求22所述的食物推荐装置,其特征在于,所述食谱确定模块还被配置为:基于多个待推荐食物和所述历史用餐数据,使用注意力机制模型,确定目标推荐食谱。
- 根据权利要求27所述的食物推荐装置,其特征在于,所述食谱确定模块还包括:配餐模板设置模块,用于基于所述多个待推荐食物,为每餐的配餐规则预设多个模板;模板向量化模块,用于将所述多个模板向量化,得到多个模板向量;隐含向量获取模块,用于获取用户的历史用餐数据中每餐的食物,将所述食物向量化,并对所述食物向量进行特征提取,得到每餐的隐含向量;目标模板向量确定模块,用于基于注意力机制模型,根据每餐的隐含向量和所述多个模板向量,确定目标模板向量;增强向量获取模块,用于对所述每餐的隐含向量与所述目标模版向量进行运算,得到目标模板的增强向量;目标推荐食谱确定模块,用于将所述目标模板的增强向量通过神经网络分类器分类,输出所述目标模板对应的目标推荐食谱。
- 根据权利要求28所述的食物推荐装置,其特征在于,所述每餐的隐含向量包括第二向量和第三向量,隐含向量获取模块包括:第一向量获取模块,用于获取用户的历史用餐数据中每餐的食物,将所述 食物向量化得到每餐的第一向量;第二向量获取模块,用于利用第一参数矩阵对所述每餐的第一向量进行运算,得到每餐的第二向量;第三向量获取模块,用于利用第二参数矩阵对所述每餐的第一向量进行运算,得到每餐的第三向量。
- 根据权利要求29所述的食物推荐装置,其特征在于,所述目标模板向量确定模块包括:样本信息获取模块,用于获取多组样本信息,每组样本信息包括:所述每餐的隐含向量和所述多个模板向量;模型训练模块,用于以所述每餐的隐含向量为输入,以所述多个模板向量的概率值为输出,对所述注意力机制模型进行训练,并将所述概率值最大的模板向量作为所述目标模板向量。
- 根据权利要求30所述的食物推荐装置,其特征在于,所述增强向量获取模块包括:注意力分数计算模块,用于计算所述目标模板向量与所述每餐的第二向量之间的注意力分数;目标模板增强向量获取模块,用于根据所述每餐的隐含向量对应的注意力分数,对所述每餐的第三向量进行加权平均,得到所述目标模板的增强向量。
- 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1-21任一项所述方法。
- 一种电子设备,其特征在于,包括:处理器;以及存储器,用于存储所述处理器的可执行指令;其中,所述处理器配置为经由执行所述可执行指令来执行权利要求1-21任一项所述的方法。
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2020/139313 WO2022133985A1 (zh) | 2020-12-25 | 2020-12-25 | 食物推荐方法、装置、存储介质及电子设备 |
US17/614,454 US20220399098A1 (en) | 2020-12-25 | 2020-12-25 | Diet recommendation method, device, storage medium and electronic device |
CN202080003624.2A CN115280422A (zh) | 2020-12-25 | 2020-12-25 | 食物推荐方法、装置、存储介质及电子设备 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2020/139313 WO2022133985A1 (zh) | 2020-12-25 | 2020-12-25 | 食物推荐方法、装置、存储介质及电子设备 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022133985A1 true WO2022133985A1 (zh) | 2022-06-30 |
Family
ID=82158639
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/139313 WO2022133985A1 (zh) | 2020-12-25 | 2020-12-25 | 食物推荐方法、装置、存储介质及电子设备 |
Country Status (3)
Country | Link |
---|---|
US (1) | US20220399098A1 (zh) |
CN (1) | CN115280422A (zh) |
WO (1) | WO2022133985A1 (zh) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11928174B2 (en) * | 2021-08-11 | 2024-03-12 | Bank Of America Corporation | Centralized dynamic portal for creating and hosting static and dynamic applications |
CN115527652B (zh) * | 2022-09-30 | 2023-04-25 | 复旦大学 | 一种基于人工智能的人体健康数据管理系统 |
CN116434911B (zh) * | 2023-02-23 | 2023-12-01 | 中国人民解放军空军军医大学 | 一种基于智能识别的个性化饮食监测方法及系统 |
CN116150451A (zh) * | 2023-04-23 | 2023-05-23 | 广东工业大学 | 一种基于时间序列的个性化菜谱推荐方法 |
CN116417115B (zh) * | 2023-06-07 | 2023-12-01 | 北京四海汇智科技有限公司 | 妊娠期糖尿病患者个性化营养方案推荐方法及系统 |
US12045271B1 (en) | 2023-09-27 | 2024-07-23 | Societe Des Produits Nestle S.A. | Methods and systems for facilitating the creation of food and/or beverage product concepts |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104731846A (zh) * | 2014-11-17 | 2015-06-24 | 陕西师范大学 | 基于多目标的个性化餐饮推荐方法及系统 |
CN105787500A (zh) * | 2014-12-26 | 2016-07-20 | 日本电气株式会社 | 基于人工神经网络的特征选择方法和装置 |
CN105843799A (zh) * | 2016-04-05 | 2016-08-10 | 电子科技大学 | 一种基于多源异构信息图模型的学术论文标签推荐方法 |
CN109346153A (zh) * | 2018-08-31 | 2019-02-15 | 北京唐冠天朗科技开发有限公司 | 一种数字化就餐系统和方法 |
CN110504019A (zh) * | 2019-08-30 | 2019-11-26 | 北京妙医佳健康科技集团有限公司 | 用户个性化饮食推荐方法、装置、电子设备及存储介质 |
CN110781413A (zh) * | 2019-08-28 | 2020-02-11 | 腾讯大地通途(北京)科技有限公司 | 兴趣点确定方法及装置、存储介质、电子设备 |
CN111402996A (zh) * | 2020-03-19 | 2020-07-10 | 珠海格力电器股份有限公司 | 一种饮食食谱推荐方法及系统、存储介质 |
Family Cites Families (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AU2013221301A1 (en) * | 2012-02-17 | 2014-09-04 | Good Measures, Llc | Systems and methods for user-specific modulation of nutrient intake |
US20160035248A1 (en) * | 2013-03-14 | 2016-02-04 | Sciencestyle Capital Partners, Llc | Providing Food-Portion Recommendations to Facilitate Dieting |
JP2015153181A (ja) * | 2014-02-14 | 2015-08-24 | 株式会社タニタ | 栄養管理支援装置、方法、プログラム、及びクッキングスケール |
JP2015194807A (ja) * | 2014-03-31 | 2015-11-05 | セイコーエプソン株式会社 | 栄養管理システム及び栄養管理プログラム |
CN109804438A (zh) * | 2016-08-12 | 2019-05-24 | 好措施有限责任公司 | 使用生物标记数据的个性化营养推荐 |
US11080775B2 (en) * | 2017-09-01 | 2021-08-03 | International Business Machines Corporation | Recommending meals for a selected group |
US20210209963A1 (en) * | 2018-01-24 | 2021-07-08 | The Engineered Non-Diet, Llc | System, Method, Process and Apparatus for Assisting in Formulating and Attaining Healthy Weight Management Goals |
US20190295440A1 (en) * | 2018-03-23 | 2019-09-26 | Nutrino Health Ltd. | Systems and methods for food analysis, personalized recommendations and health management |
CN108597582B (zh) * | 2018-04-18 | 2021-02-12 | 中国科学院计算技术研究所 | 一种用于执行Faster R-CNN神经网络运算的方法和装置 |
US20200098466A1 (en) * | 2018-08-30 | 2020-03-26 | Nutristyle Inc. | Machine learning implementations for a menu generation platform |
CN109493944A (zh) * | 2018-10-09 | 2019-03-19 | 珠海亿联德源信息技术有限公司 | 一种膳食管理系统 |
CN109545327A (zh) * | 2018-10-09 | 2019-03-29 | 珠海亿联德源信息技术有限公司 | 一种膳食管理方法及装置 |
US11144957B1 (en) * | 2019-05-08 | 2021-10-12 | Inmar Clearing, Inc. | System for recommending a meal kit based upon a user food item purchase history and related methods |
EP3772738A1 (en) * | 2019-08-08 | 2021-02-10 | Koninklijke Philips N.V. | An apparatus and method for providing dietary recommendation |
CN111524576B (zh) * | 2020-05-08 | 2023-07-07 | 四川大学 | 一种用于体重控制的食物重量估测学习系统 |
US11594317B2 (en) * | 2020-05-28 | 2023-02-28 | Kpn Innovations, Llc. | Methods and systems for determining a plurality of nutritional needs to generate a nutrient supplementation plan using artificial intelligence |
CN112002377B (zh) * | 2020-08-24 | 2021-04-27 | 东北林业大学 | 基于集成学习校准模型的松子蛋白质含量预测方法 |
-
2020
- 2020-12-25 WO PCT/CN2020/139313 patent/WO2022133985A1/zh active Application Filing
- 2020-12-25 US US17/614,454 patent/US20220399098A1/en active Pending
- 2020-12-25 CN CN202080003624.2A patent/CN115280422A/zh active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104731846A (zh) * | 2014-11-17 | 2015-06-24 | 陕西师范大学 | 基于多目标的个性化餐饮推荐方法及系统 |
CN105787500A (zh) * | 2014-12-26 | 2016-07-20 | 日本电气株式会社 | 基于人工神经网络的特征选择方法和装置 |
CN105843799A (zh) * | 2016-04-05 | 2016-08-10 | 电子科技大学 | 一种基于多源异构信息图模型的学术论文标签推荐方法 |
CN109346153A (zh) * | 2018-08-31 | 2019-02-15 | 北京唐冠天朗科技开发有限公司 | 一种数字化就餐系统和方法 |
CN110781413A (zh) * | 2019-08-28 | 2020-02-11 | 腾讯大地通途(北京)科技有限公司 | 兴趣点确定方法及装置、存储介质、电子设备 |
CN110504019A (zh) * | 2019-08-30 | 2019-11-26 | 北京妙医佳健康科技集团有限公司 | 用户个性化饮食推荐方法、装置、电子设备及存储介质 |
CN111402996A (zh) * | 2020-03-19 | 2020-07-10 | 珠海格力电器股份有限公司 | 一种饮食食谱推荐方法及系统、存储介质 |
Also Published As
Publication number | Publication date |
---|---|
US20220399098A1 (en) | 2022-12-15 |
CN115280422A (zh) | 2022-11-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022133985A1 (zh) | 食物推荐方法、装置、存储介质及电子设备 | |
Chen et al. | Eating healthier: Exploring nutrition information for healthier recipe recommendation | |
Gleason et al. | Publishing nutrition research: a review of multivariate techniques—part 3: data reduction methods | |
US20190304000A1 (en) | Online food and beverage search method based on food to biomarker optimization algorithms in a node ranked database | |
US20220230730A1 (en) | Recipe recommendation method and device, computing device and storage medium | |
CN110765273B (zh) | 推荐文案生成方法、装置、电子设备及可读存储介质 | |
Zhang et al. | Many-objective optimization meets recommendation systems: A food recommendation scenario | |
Sefa-Yeboah et al. | Development of a Mobile Application Platform for Self‐Management of Obesity Using Artificial Intelligence Techniques | |
US20210057077A1 (en) | Systems and methods for arranging transport of adapted nutrimental artifacts with user-defined restriction requirements using artificial intelligence | |
CN110119479A (zh) | 一种餐馆推荐方法、装置、设备及可读存储介质 | |
CN116417115A (zh) | 妊娠期糖尿病患者个性化营养方案推荐方法及系统 | |
Perperoglou et al. | Quantile foliation for modelling performance across body mass and age in Olympic weightlifting | |
CN112951374B (zh) | 数据分析方法、系统、计算机设备及存储介质 | |
Eftimov et al. | FoodEx2vec: New foods’ representation for advanced food data analysis | |
An et al. | We got nuts! use deep neural networks to classify images of common edible nuts | |
Chen et al. | Personalized expert recommendation systems for optimized nutrition | |
US20230230674A1 (en) | Systems and methods for arranging transport of adapted nutrimental artifacts with user-defined restriction requirements using artificial intelligence | |
Hidayat et al. | Decision support system for selection of staples food and food commodity price prediction post-covid-19 using simple additive weighting and multiple linear regression methods | |
CN108416628B (zh) | 一种融合食物多属性关系的餐厅菜品智能推荐系统 | |
Baghfalaki et al. | Approximate Bayesian inference for joint linear and partially linear modeling of longitudinal zero-inflated count and time to event data | |
Bublyk et al. | Comparative Analysis of The Caloric Performance of Products for People with Cardiovascular Disease. | |
Jridi et al. | Menu planning with a dynamic goal programming approach | |
White et al. | Investigating eating behaviours using topic models | |
Li et al. | Tree-regularized Bayesian latent class analysis for improving weakly separated dietary pattern subtyping in small-sized subpopulations | |
Oleksiv et al. | Information System of Dynamic and Adaptive Control of Human Diet Based on Machine Learning Technology. |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20966550 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 24/10/2023) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20966550 Country of ref document: EP Kind code of ref document: A1 |