Intelligent cooking optimization system and method based on machine learning
Through an intelligent cooking optimization system based on machine learning, user data is collected and cooking parameters are dynamically controlled, and the problem that traditional canteens are difficult to meet personalized needs is solved, efficient and personalized cooking solutions are achieved, and the quality of dishes and user satisfaction are improved.
Patent Information
- Application Number
- CN202510450256.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-04-11
AI Technical Summary
Traditional canteen cooking methods are difficult to meet the personalized and nutritious meal needs of different groups, and there are network delay problems and shortcomings in ignoring user health status and taste preferences.
Using an intelligent cooking optimization system based on machine learning, we use clustering algorithms and deep learning to determine the ingredients combination, and dynamically control cooking parameters through similarity calculation and optimization algorithms to formulate personalized cooking plans.
It has achieved accurate demand satisfaction for different user groups, improved cooking efficiency and quality of dishes, met users' needs for balanced nutrition and diversified tastes, and solved the problem that traditional cooking methods cannot meet personalized needs.
Smart Images

Figure CN119960318A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent kitchen technology, and more specifically, to an intelligent cooking optimization system and method based on machine learning. Background Art
[0002] With the rapid development of society and the improvement of people's living standards, catering needs in large canteens (such as school canteens, corporate canteens, etc.) have become increasingly complex and diversified. Canteens not only need to meet basic dietary needs, but also pay attention to balanced nutrition, diverse tastes and healthy eating, becoming an important place to promote collective health. In this context, canteen managers are faced with the challenge of how to provide personalized and nutritious meals for different groups (such as students, employees, etc.). However, traditional canteen cooking methods are often unable to cope with these personalized needs. Due to the size of the canteen and the diversity of the population, a single menu and fixed cooking methods often cannot meet the taste and health requirements of every diner. Especially during busy dining hours, how to quickly and efficiently provide meals suitable for different needs while ensuring food quality has become a major problem in canteen management.
[0003] The patent with announcement number CN108897245A discloses an intelligent cooking system; it includes: collecting and storing the information of ingredients or food, analyzing and calculating the reference cooking parameters and reference cooking curve, collecting the information of the ingredients to be cooked and the cooking requirements and uploading them to the cloud for storage, revising the reference cooking parameters and the reference cooking curve based on the characteristic difference between the ingredients to be cooked or food and the stored ingredients or food to obtain the current cooking parameters and the current cooking curve for the cooking; the cooking tool downloads the current cooking parameters and the current cooking curve to the cooking device, starts the cooking process, and after the cooking is completed, the feedback person feeds back the information, and the analysis module compares the feedback information with the current cooking parameters and the current cooking curve to optimize the cooking parameters and the cooking curve, and the optimized cooking parameters and cooking curve are used as reference data for the next cooking; it can be widely used in the working process of smart small household appliances to realize the diversification and customization of the functions of smart small household appliances.
[0004] However, although the above technology has achieved intelligent cooking, it is overly dependent on cloud processing and storage, and has network latency problems; moreover, it mainly focuses on the differentiated calculation of food characteristics, while ignoring the personalized consideration of user health status and taste preferences; in addition, the cooking process control is relatively fixed, and lacks the ability to flexibly control cooking parameters.
[0005] In view of this, the present invention proposes an intelligent cooking optimization system and method based on machine learning to solve the above problems. Summary of the invention
[0006] In order to overcome the above-mentioned defects of the prior art and achieve the above-mentioned purpose, the present invention provides the following technical solution: an intelligent cooking optimization method based on machine learning, comprising: Collect user characteristic data, which includes characteristic information of each user; Analyze user feature data, use clustering algorithms to divide user groups, and use deep learning to determine the ingredient combination corresponding to each user group; Obtain user dietary data, which includes each user's historical dietary records; Integrate user dietary data and ingredient combinations, use similarity calculation methods to screen dishes, and develop personalized cooking plans for different user groups; Combining user dietary data and cooking plans, an improved optimization algorithm is used to dynamically control cooking parameters during the cooking process of each dish.
[0007] Furthermore, the characteristic information includes age, gender, body mass index and amount of exercise; the body mass index is obtained by: obtaining the height and weight of each user, squaring the height of each user to obtain the square of the height; dividing the weight of each user by the corresponding square of the height to obtain the body mass index of each user; The steps to segment user groups include: Step A101: different digital labels are set for different genders and marked as gender labels, and the genders in the user feature data are replaced with corresponding gender labels; each set of feature information in the user feature data is used as a sample point, and the sample point corresponds to the feature information one by one; Step A102: Calculate the total number of groups N and set the number of groups , ; Step A103: Random Selection sample points as the center point, and mark each center point in ascending order. , ; Step A104: Mark the sample points that are not the center points as the division points, and mark each division point as , , is the number of groups of feature information in the user feature data; Step A105: According to The corresponding center point is established user groups, and calculate the point distance from each division point to each center point in turn; Step A106: Divide the points The distance to each center point is compared and the points are divided Assign to the user group corresponding to the center point with the smallest point distance; Step A107: , and return to step A106; Step A108: Repeat steps A106 to A107 until When the loop ends, the process goes to step A109; Step A109: recalculate the new center point corresponding to each user group; Step A110: Repeat steps A105 to A109 until the new center point of each user group recalculated in step A109 is consistent with the new center point of the corresponding user group calculated in the previous loop, and the loop ends to obtain user groups and corresponding division points as group sets; Step A111: Make , and return to step A103; Step A112: loop through steps A103 to A111 until When the loop ends, get A collection of groups, , and proceed to step A113; Step A113: Calculate the average distance corresponding to each group set, take the group set with the largest average distance as the optimal set, and obtain the user group in the optimal set.
[0008] Furthermore, in step A102, the method for calculating the total number of groups N is as follows: presetting four classification standards, wherein the classification standards correspond to the data in the feature information one by one; dividing each type of data in the feature information into groups according to the classification standards, and obtaining the number of groups corresponding to each type of data in the feature information; and multiplying each group number in turn to obtain the total number of groups N; In step A105, the expression of point distance is: ; In the formula, For the dividing point To center point The point distance, Center point Middle The value of the dimension, For the dividing point Middle The value of the dimension, ; Different dimensions represent different data in feature information; In step A109, the method for calculating the new center point of each user group includes: ; In the formula, For the The user groups correspond to the new center point. For the of the user groups A dividing point, , For the of the user groups The corresponding values of the partition points in different dimensions are For the The number of partition points in the user group, .
[0009] Furthermore, in A113, the method for calculating the average distance corresponding to each group set includes: Calculate the distance coefficient corresponding to each sample point in each population set, add each distance coefficient corresponding to each population set in turn, and then divide it by n to obtain the average distance corresponding to each population set; the expression of the distance coefficient is: ; In the formula, For the The distance coefficient of the sample points, For the The out-of-group distance of sample points, For the The intra-cluster distance of sample points, is the maximum value function, ; No. The calculation method of the distance within the group corresponding to the sample point is: The user group corresponding to the sample point is marked as the current group, and the user group except the All sample points other than the sample points are marked as other points; calculate the The point distance from the sample point to each other point is marked as the intra-cluster distance; each intra-cluster distance is added in turn, and then divided by the number of intra-cluster distances to obtain the The intra-cluster distance of sample points; No. The calculation method of the distance outside the group corresponding to the sample point is: The point distance from each sample point to each center point is marked as the adjacent distance; each adjacent distance is sorted from large to small, and the user group corresponding to the center point of the second adjacent distance is marked as the nearest group, and all sample points in the nearest group are marked as adjacent points; calculate the The point distance from each sample point to each adjacent point is marked as the out-of-cluster distance; each out-of-cluster distance is added in turn, and then divided by the number of out-of-cluster distances to obtain the The out-of-group distance of each sample point.
[0010] Further, the method for determining the combination of ingredients includes: Different digital labels are set for different user groups and marked as group labels; the group label corresponding to each user group is used as analysis data, the analysis data is input into the trained ingredient analysis model, and the corresponding combination label is predicted; the combination label is the digital label corresponding to the ingredient combination, and the digital labels corresponding to different ingredient combinations are all different; according to the predicted combination label, the corresponding ingredient combination is obtained.
[0011] The training process of the food analysis model includes: Pre-collection Group analysis data, The group analysis data are all set with corresponding combination labels. is an integer greater than 1, converting the analysis data and the corresponding combination labels into a corresponding set of feature vectors; taking each set of feature vectors as the input of the food analysis model, the food analysis model takes a set of predicted combination labels corresponding to each set of analysis data as output, and takes the actual combination labels corresponding to each set of analysis data as the prediction target, and the actual combination labels are the pre-set combination labels corresponding to the analysis data; minimizing the sum of the prediction errors of all analysis data is taken as the training target; the food analysis model is trained until the sum of the prediction errors converges and the training is stopped; the food analysis model is a deep neural network model.
[0012] Furthermore, the historical dietary records include dishes consumed by the user and dishes prohibited by the user; the dishes consumed by the user are dishes selected by the user during the historical dining process, and the dishes prohibited by the user are dishes that the user cannot eat; Ways to create a cooking plan include: According to the user's dietary data, the number of times each user selects each dish is obtained; according to the number of selections, the similarity between every two dishes is calculated; the dishes with a selection number of 0 and not being taboo dishes for the user are regarded as the untried dishes of the corresponding user, and a corresponding similar dish set is constructed for each untried dish; a similarity threshold is preset, and the similarity corresponding to each untried dish is compared with the similarity threshold, and the dishes corresponding to the similarity with a value greater than or equal to the similarity threshold are regarded as similar dishes of the corresponding untried dishes, and added to the similar dish set of the corresponding untried dishes; the dishes corresponding to the similarity with a value less than or equal to the similarity threshold are not regarded as similar dishes of the corresponding untried dishes; According to the similarity and the set of similar dishes, the predicted number of times for each untried dish is calculated; all the selection times and the predicted number of times corresponding to each dish are added up in sequence to obtain the total number of times corresponding to each dish; all dishes are sorted from large to small according to the corresponding total number of times to obtain a dish sorting table; the ingredients corresponding to each dish are obtained, and the ingredients corresponding to each dish are compared with the ingredient combination; if the ingredients corresponding to the dish do not exist in the ingredient combination, the corresponding dish is deleted from the dish sorting table; if the ingredients corresponding to the dish exist in the ingredient combination, the corresponding dish is retained in the dish sorting table; the number of users is obtained, and the number of users is equal to the number of groups of feature information in the user feature data; a preset number of coefficients is used, and the number of users is multiplied by the number of coefficients to obtain the number of dish varieties; the dishes in the dish sorting table are selected in positive order according to the number of dish varieties, and used as cooking plans.
[0013] Furthermore, the expression of similarity is: ; In the formula, For the Dishes and The similarity of the dishes, For the User for The number of dishes selected, For the User for The number of dishes selected, , is the number of users, , , , , is the number of dishes; The expression for the number of predictions is: ; In the formula, is the number of predictions, For dishes not tried The similarity of similar dishes, The similar dish is the first in the set of similar dishes corresponding to the dish that has not been tried. Similar dishes, For dishes that have not been tried, the corresponding user The number of similar dishes selected, , is the number of similar dishes in the set of similar dishes corresponding to the dish that has not been tried.
[0014] Furthermore, the cooking parameters include static parameters and dynamic parameters, the static parameters include the amount of ingredients, the amount of seasoning, the cooking time and the cooking method, and the dynamic parameters include the fire power; Methods for dynamically controlling cooking parameters include: Construct M sets of parameter sets, set ascending numerical labels for the M sets of parameter sets, and mark them as set labels. The range of the set labels is ; Set the initial aperture center and the initial aperture radius , and set the number of iterations ;in, , ; Define the loop process, the loop process is: generate m candidate solutions within the aperture range and reduce the aperture radius , , the candidate solutions correspond to the set labels one by one; calculate the cooking effect corresponding to each candidate solution, move the aperture center to the candidate solution with the largest cooking effect; repeat the cycle process, and each time the cycle process is repeated, the number of iterations is +1; preset iteration threshold G and radius threshold H; until or When , the repeated cycle process is stopped, the candidate solution corresponding to the aperture center is obtained, and it is marked as the best solution; the parameter set corresponding to the set label corresponding to the best solution is marked as the best set; Get the cooking time in the best set and mark it as the best time; preset a step set, which includes dishes and the time steps corresponding to the dishes; according to the current dish, get the corresponding time step from the step set and mark it as the current step; divide the best time by the current step to get the number of moments ; Input the best set into the trained firepower prediction model, predict the firepower size at the first future moment, and mark it as the first predicted firepower, the first future moment is the next moment of the current moment; replace the initial firepower size in the best set with the first predicted firepower, and re-input it into the trained firepower prediction model to predict the firepower size at the second future moment, the second future moment is the next moment of the first future moment; perform cyclic prediction on the firepower size until the firepower prediction model predicts the first future moment. The firepower at the future moment is marked as Predict firepower; take all predicted firepower sizes as a firepower set, and optimize the cooking parameters based on the optimal set and the firepower set; the training process of the firepower prediction model is consistent with the training process of the food analysis model, and both are deep neural network models.
[0015] Further, the method for constructing M sets of parameter sets is as follows: presetting a parameter range, the parameter range includes a range corresponding to each parameter in the research parameters; the research parameters include the amount of ingredients, the amount of seasonings, the cooking time, the method label and the initial fire size; randomly selecting a value from each range within the parameter range, and constructing a set of parameter sets, constructing a total of M sets of parameter sets, and the M sets of parameter sets are all different; wherein the method label is a digital label corresponding to the cooking method, and the method labels corresponding to different cooking methods are all different; The calculation method of the cooking effect is as follows: different digital labels are set for different dishes and marked as dish labels; the dish to be cooked is taken as the current dish, the dish label corresponding to the current dish is obtained, and it is marked as the current label; the parameter set corresponding to the set label corresponding to the candidate solution is obtained, the parameter set and the current label are used as evaluation parameters, and the evaluation parameters are input into the trained effect evaluation model to evaluate the corresponding cooking effect; the training process of the effect evaluation model is consistent with the training process of the food analysis model, and both are deep neural network models; The expression of the candidate solution is: ; In the formula, For the Candidate solutions, is the aperture center corresponding to the tth repetition of the cycle, is the aperture radius corresponding to the tth repetition of the cycle, is the random coefficient, , ; The expression for reducing the aperture radius is: ; In the formula, is the reduced aperture radius, is the shrinkage coefficient, .
[0016] The intelligent cooking optimization system based on machine learning is used to implement the intelligent cooking optimization method based on machine learning, including: A data collection module is used to collect user characteristic data, which includes characteristic information of each user; The ingredient determination module is used to analyze user feature data, divide user groups using clustering algorithms, and use deep learning to determine the ingredient combination corresponding to each user group; A data acquisition module is used to acquire user dietary data, which includes each user's historical dietary records; The cooking planning module is used to integrate user dietary data and ingredient combinations, use similarity calculation methods to screen dishes, and formulate personalized cooking plans for different user groups; The parameter control module is used to combine the user's dietary data and cooking plan, and adopts the improved optimization algorithm to dynamically control the cooking parameters during the cooking process of each dish.
[0017] Technical effects and advantages of the intelligent cooking optimization system and method based on machine learning of the present invention: By collecting user characteristic data and conducting precise analysis, different users can be divided into groups and the ingredient combinations that meet the needs of different user groups can be automatically determined. At the same time, by mining user dietary data, personalized cooking plans can be formulated for different user groups. In addition, optimization algorithms are used to dynamically control the cooking process to achieve optimal control of cooking parameters. This not only improves cooking efficiency and food quality, but also meets users' needs for balanced nutrition and diverse tastes, thereby effectively solving the problem that traditional cooking methods cannot meet personalized needs, promoting the realization of healthy eating, and improving the quality of dishes and service levels in collective dining environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 This is a schematic diagram of an intelligent cooking optimization system based on machine learning according to Embodiment 1 of the present invention; Figure 2 This is a flow chart of a method for dividing user groups according to Embodiment 1 of the present invention; Figure 3 This is a flow chart of the intelligent cooking optimization method based on machine learning according to Example 2 of the present invention. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0020] Example 1 See also Figure 1 As shown, the intelligent cooking optimization system based on machine learning in this embodiment includes a data collection module, an ingredient determination module, a data acquisition module, a cooking formulation module and a parameter control module; each module is connected by wired and / or wireless means to realize data transmission between modules.
[0021] The data collection module is used to collect user characteristic data.
[0022] The user characteristic data includes characteristic information of each user, where the user is a diner in the cafeteria (for example, students eating in a school cafeteria, employees eating in a company cafeteria, etc.); the characteristic information includes age, gender, body mass index and amount of exercise, where the amount of exercise is the amount of calories consumed on that day; the age and gender in the characteristic information are obtained through relevant systems within the organization; for example, the age and gender of each student can be obtained through the student information management system in the corresponding school, and the age and gender of each employee can be obtained through the human resources management system in the corresponding company; the amount of exercise in the characteristic information is obtained through wearable devices worn by the user (such as smart watches, smart bracelets, etc.); the method for obtaining the body mass index is: obtain the height and weight of each user, square the height of each user, and obtain the square of the height; divide the weight of each user by the corresponding square of the height to obtain the corresponding body mass index of each user; wherein the height and weight of each user are also obtained through relevant systems within the organization.
[0023] It should be noted that different users have different demands for food combinations; among them, users of different ages have significant differences in nutritional needs; for children and adolescents, more calcium, protein and vitamins are needed to support growth and development; for adults, they focus on a balanced diet and need high-fiber and low-fat ingredients; and for the elderly, they need to increase the intake of calcium, vitamin D and B12 to maintain bone and nerve health; gender differences will also affect nutritional needs and food choices; men usually need more protein and energy; for women, they need to pay attention to iron and calcium intake; body mass index is used to assess the user's health status; the larger the body mass index, the more overweight or obese the user is, so low-fat, low-calorie ingredients are needed; the smaller the body mass index, the less weight the user is, and the more high-energy, high-nutrient-density ingredients are needed; the amount of exercise directly affects the demand for energy and nutrition; for high exercise, more carbohydrates and protein are needed to replenish energy and promote muscle recovery; for low exercise, it is necessary to reduce the intake of high-energy ingredients and increase the proportion of vegetables and fruits to control calorie intake.
[0024] The ingredient determination module is used to analyze user feature data, divide user groups using clustering algorithms, and use deep learning to determine the ingredient combination corresponding to each user group.
[0025] like Figure 2 As shown, the steps of dividing user groups include: Step A101: different digital labels are set for different genders and marked as gender labels, and the genders in the user feature data are replaced with corresponding gender labels; each set of feature information in the user feature data is used as a sample point, and the sample point corresponds to the feature information one by one; Step A102: Calculate the total number of groups N and set the number of groups , ; Step A103: Random Selection sample points as the center point, and mark each center point in ascending order. , ; Mark the first center point as , mark the second center point as , will The center points are marked as ; Step A104: Mark the sample points that are not the center points as the division points, and mark each division point as , , is the number of groups of feature information in the user feature data; that is, the first division point is marked as , mark the second partition point as , will The center points are marked as ; Step A105: According to The corresponding center point is established user groups, and calculate the point distance from each division point to each center point in turn; Step A106: Divide the points The distance to each center point is compared and the points are divided Assign to the user group corresponding to the center point with the smallest point distance; Step A107: , and return to step A106; Step A108: Repeat steps A106 to A107 until When the loop ends, the process goes to step A109; Step A109: recalculate the new center point corresponding to each user group; Step A110: Repeat steps A105 to A109 until the new center point of each user group recalculated in step A109 is consistent with the new center point of the corresponding user group calculated in the previous loop, and the loop ends to obtain user groups and corresponding division points as group sets; Step A111: Make , and return to step A103; Step A112: loop through steps A103 to A111 until When the loop ends, get A collection of groups, , and proceed to step A113; Step A113: Calculate the average distance corresponding to each group set, take the group set with the largest average distance as the optimal set, and obtain the user group in the optimal set.
[0026] In the above step A102, the method for calculating the total number of groups N is: presetting 4 classification standards, the classification standards correspond to the data in the feature information one by one, and the classification standards are pre-set by technical personnel in this field according to actual conditions; according to the classification standards, each type of data in the feature information is divided into groups, and the number of groups corresponding to each type of data in the feature information is obtained; each group number is multiplied in turn to obtain the total number of groups N; illustratively, the classification standard corresponding to age is 0-12 years old for children, 13-18 years old for teenagers, 19-60 years old for adults, and over 60 years old for the elderly; therefore, the age is divided into groups according to the classification standard, and the number of groups obtained is 4.
[0027] In the above step A105, the expression of the point distance is: ; In the formula, For the dividing point To center point The point distance, Center point Middle The value of the dimension, For the dividing point Middle The value of the dimension, ; Among them, different dimensions represent different data in the feature information, for example, age is one dimension and exercise amount is another dimension.
[0028] In the above step A109, the method for calculating the new center point of each user group includes: ; In the formula, For the The user groups correspond to the new center point. For the of the user groups A dividing point, , For the of the user groups The corresponding values of the partition points in different dimensions are For the The number of partition points in the user group, .
[0029] In step A113, the method for calculating the average distance corresponding to each group set includes: Calculate the distance coefficient corresponding to each sample point in each population set, add each distance coefficient corresponding to each population set in turn, and then divide it by n to obtain the average distance corresponding to each population set; the expression of the distance coefficient is: ; In the formula, For the The distance coefficient of the sample points, For the The out-of-group distance of sample points, For the The intra-cluster distance of sample points, is the maximum value function, ; No. The calculation method of the distance within the group corresponding to the sample point is: The user group corresponding to the sample point is marked as the current group, and the user group except the All sample points other than the sample points are marked as other points; calculate the The point distance from the sample point to each other point is marked as the intra-cluster distance; each intra-cluster distance is added in turn, and then divided by the number of intra-cluster distances to obtain the The intra-cluster distance of sample points; No. The calculation method of the distance outside the group corresponding to the sample point is: The point distance from each sample point to each center point is marked as the adjacent distance; each adjacent distance is sorted from large to small, and the user group corresponding to the center point of the second adjacent distance is marked as the nearest group, and all sample points in the nearest group are marked as adjacent points; calculate the The point distance from each sample point to each adjacent point is marked as the out-of-cluster distance; each out-of-cluster distance is added in turn, and then divided by the number of out-of-cluster distances to obtain the The out-of-group distance of each sample point.
[0030] Methods for determining ingredient combinations include: Different digital labels are set for different user groups and marked as group labels; the group label corresponding to each user group is used as analysis data, the analysis data is input into a trained food analysis model, and a corresponding combination label is predicted; the combination label is a digital label corresponding to the food combination, and the digital labels corresponding to different food combinations are all different; according to the predicted combination label, the corresponding food combination is obtained; the method for constructing the food combination is as follows: technical personnel in this field obtain various kinds of food through food databases and websites (such as NutritionData, MyFitnessPal, food network, etc.), and randomly combine all the food to construct multiple different food combinations, wherein each food combination includes at least one food.
[0031] The training process of the food analysis model includes: Pre-collection Group analysis data, The group analysis data are all set with corresponding combination labels. is an integer greater than 1, converting the analysis data and the corresponding combination labels into a corresponding set of feature vectors; the combination labels corresponding to the analysis data are collected by technicians in the process of determining the historical food combination. Combined with the actual experience, each group of analysis data is analyzed in turn to determine the combination label corresponding to each group of analysis data. The group analysis data are set with corresponding combination labels in turn; Each set of feature vectors is used as the input of the food analysis model. The food analysis model takes a set of predicted combination labels corresponding to each set of analysis data as output, and takes the actual combination labels corresponding to each set of analysis data as the prediction target. The actual combination labels are the pre-set combination labels corresponding to the analysis data. The training goal is to minimize the sum of the prediction errors of all analysis data. The calculation formula of the prediction error is: ,in is the prediction error, is the group number of the eigenvector corresponding to the analyzed data, For the The predicted combination label corresponding to the group analysis data, For the The actual combination labels corresponding to the group analysis data; the food analysis model is trained until the sum of the prediction errors reaches convergence and the training is stopped.
[0032] The above-mentioned food analysis model is specifically a deep neural network model; it includes an input layer, a hidden layer and an output layer; each hidden layer includes multiple neurons, each neuron is connected to the neurons in the next layer, and the connection contains weights, which determine the importance and influence of data transmission in the neural network; an activation function is applied to each neuron between the hidden layer and the output layer, and the activation function introduces nonlinearity, allowing the network to learn more complex patterns and features.
[0033] The data acquisition module is used to obtain user dietary data.
[0034] User dietary data includes the historical dietary records of each user, and the historical dietary records include the dishes consumed by the user and the dishes that the user is prohibited from eating; the dishes consumed by the user are the dishes selected by the user during the historical dining process, and the dishes that the user is prohibited from eating are the dishes that the user cannot eat, such as dishes that the user is allergic to; user dietary data is obtained through the consumption record table in the canteen consumption management system; it should be understood that the purpose of collecting user dietary data is to effectively identify the user's dietary preferences and habits by analyzing the user's consumption behavior and dietary choices; it can not only help to gain an in-depth understanding of the user's taste preferences, consumption frequency and dish choices, but also reveal dietary trends in different time periods and seasons, so that the canteen can formulate cooking plans more accurately and further improve service quality and user experience.
[0035] The cooking planning module is used to integrate user dietary data and ingredient combinations, use similarity calculation methods to screen dishes, and formulate personalized cooking plans for different user groups.
[0036] Ways to create a cooking plan include: According to the user's dietary data, the number of times each user selects each dish is obtained; according to the number of selections, the similarity between every two dishes is calculated; the dishes with a selection number of 0 and not being taboo dishes for the user are regarded as the untried dishes of the corresponding user, and a corresponding similar dish set is constructed for each untried dish; a similarity threshold is preset, and the similarity threshold is preset by those skilled in the art according to actual conditions; the similarity corresponding to each untried dish is compared with the similarity threshold, and the dishes corresponding to the similarity with a value greater than or equal to the similarity threshold are regarded as similar dishes of the corresponding untried dishes, and are added to the similar dish set of the corresponding untried dishes; the dishes corresponding to the similarity with a value less than or equal to the similarity threshold are not regarded as similar dishes of the corresponding untried dishes; According to the similarity and the set of similar dishes, the predicted number of times for each untried dish is calculated; all the selection times and the predicted number of times corresponding to each dish are added in sequence to obtain the total number of times corresponding to each dish; all dishes are sorted from large to small according to the corresponding total number of times to obtain a dish sorting table; technical personnel in this field obtain the ingredients corresponding to each dish by consulting the recipe-related literature or website, and compare the ingredients corresponding to each dish with the ingredient combination; if the ingredients corresponding to the dish do not exist in the ingredient combination, the corresponding dish is deleted from the dish sorting table; if the ingredients corresponding to the dish exist in the ingredient combination, the corresponding dish is retained in the dish sorting table; the number of users is obtained, and the number of users is equal to the number of groups of feature information in the user feature data; a preset number of coefficients is preset by technical personnel in this field according to actual conditions; the number of users is multiplied by the number of coefficients to obtain the number of dish varieties; the dishes in the dish sorting table are selected in positive order according to the number of dish varieties, and used as cooking plans.
[0037] The expression of similarity is: ; In the formula, For the Dishes and The similarity of the dishes, For the User for The number of dishes selected, For the User for The number of dishes selected, , is the number of users, , , , , The number of dishes is obtained through user dietary data; The expression for the number of predictions is: ; In the formula, is the number of predictions, For dishes not tried The similarity of similar dishes, The similar dish is the first in the set of similar dishes corresponding to the dish that has not been tried. Similar dishes, For dishes that have not been tried, the corresponding user The number of similar dishes selected, , is the number of similar dishes in the set of similar dishes corresponding to the dish that has not been tried.
[0038] The parameter control module is used to combine the user's dietary data and cooking plan, and adopts the improved optimization algorithm to dynamically control the cooking parameters during the cooking process of each dish.
[0039] The dish to be cooked is taken as the current dish; the cooking parameters include static parameters and dynamic parameters, the static parameters include the amount of ingredients, the amount of seasonings, cooking time and cooking methods, and the dynamic parameters include the firepower; the amount of ingredients includes the weight of various ingredients used when cooking the current dish; the amount of seasonings includes the weight of various seasonings used when cooking the current dish, such as salt, sugar, oil, etc.; the cooking time is the time taken to cook the current dish; cooking methods include stir-frying, boiling, steaming, etc.; the firepower is the heat energy intensity generated by the cooking equipment when cooking the current dish, such as stoves, ovens, steam pots, etc.
[0040] Methods for dynamically controlling cooking parameters include: Construct M sets of parameter sets, set ascending numerical labels for the M sets of parameter sets, and mark them as set labels. The range of the set labels is ; Set the initial aperture center and the initial aperture radius , and set the number of iterations ;in, , ; Define the loop process, the loop process is: generate m candidate solutions within the aperture range and reduce the aperture radius , , the candidate solutions correspond to the set labels one by one; calculate the cooking effect corresponding to each candidate solution, move the aperture center to the candidate solution with the largest cooking effect; repeat the cycle process, and each time the cycle process is repeated, the number of iterations is +1; preset iteration threshold G and radius threshold H, which are preset by those skilled in the art according to actual conditions; until or When , the repeated cycle process is stopped, the candidate solution corresponding to the aperture center is obtained, and it is marked as the best solution; the parameter set corresponding to the set label corresponding to the best solution is marked as the best set.
[0041] The method for constructing M groups of parameter sets is as follows: technical personnel in this field preset parameter ranges based on the technical parameters of the cooking equipment and the ingredients corresponding to the dishes, combined with actual experience, and the parameter range includes the range corresponding to each parameter in the research parameters; the research parameters include the amount of ingredients, the amount of seasonings, the cooking time, the method label and the initial firepower; randomly select a value from each range within the parameter range, and construct a group of parameter sets, and construct a total of M groups of parameter sets, and the M groups of parameter sets are all different; wherein the method label is a digital label corresponding to the cooking method, and the method labels corresponding to different cooking methods are all different.
[0042] The calculation method of the cooking effect is as follows: different digital labels are set for different dishes, and marked as dish labels; the dish label corresponding to the current dish is obtained, and marked as the current label; the parameter set corresponding to the set label of the candidate solution is obtained, and the parameter set and the current label are used as evaluation parameters, and the evaluation parameters are input into the trained effect evaluation model to evaluate the corresponding cooking effect; the training process of the effect evaluation model is consistent with the training process of the ingredient analysis model, and both are deep neural network models; the cooking effect is the user's comprehensive evaluation of the taste and appearance of the current dish cooked under the conditions of the parameter set; the cooking effect corresponding to the evaluation parameters is evaluated by technical personnel in this field, who collect multiple groups of evaluation data during the historical dish cooking process, and cook the dish under the conditions of each group of evaluation data, and the cooked dish is tasted by multiple users, and a corresponding comprehensive evaluation is given, and the average of the comprehensive evaluation of each user is used as the cooking effect of the corresponding evaluation data.
[0043] The expression of the candidate solution is: ; In the formula, For the Candidate solutions, is the aperture center corresponding to the tth repetition of the cycle, is the aperture radius corresponding to the tth repetition of the cycle, is the random coefficient, , .
[0044] The expression for reducing the aperture radius is: ; In the formula, is the reduced aperture radius, is the shrinkage coefficient, .
[0045] Obtain the cooking time in the best set and mark it as the best time; preset a step set, which includes dishes and the time steps corresponding to the dishes. The step set is preset by technical personnel in this field according to actual conditions; according to the current dish, obtain the corresponding time step from the step set and mark it as the current step; divide the best time by the current step to obtain the number of moments ; Input the best set into the trained firepower prediction model, predict the firepower size at the first future moment, and mark it as the first predicted firepower, the first future moment is the next moment of the current moment; replace the initial firepower size in the best set with the first predicted firepower, and re-input it into the trained firepower prediction model to predict the firepower size at the second future moment, the second future moment is the next moment of the first future moment; perform cyclic prediction on the firepower size until the firepower prediction model predicts the first future moment. The firepower at the future moment is marked as Predict firepower; take all predicted firepower sizes as a firepower set, and optimize the cooking parameters based on the optimal set and the firepower set; the training process of the firepower prediction model is consistent with the training process of the food analysis model, and both are deep neural network models.
[0046] This embodiment can divide different users into groups by collecting user characteristic data and performing precise analysis, and automatically determine the ingredient combinations that meet the needs of different user groups; at the same time, by mining user dietary data, it can formulate personalized cooking plans for different user groups; in addition, an optimization algorithm is used to dynamically control the cooking process to achieve optimal control of cooking parameters; this not only improves cooking efficiency and dish quality, but also meets user needs for balanced nutrition and diverse tastes, thereby effectively solving the problem that traditional cooking methods cannot meet personalized needs, promoting the realization of healthy eating, and improving the quality of dishes and service levels in collective dining environments.
[0047] Example 2 See also Figure 3As shown, the part not described in detail in this embodiment is described in Example 1, and a smart cooking optimization method based on machine learning is provided, the method comprising: Collect user characteristic data; Analyze user feature data, use clustering algorithms to divide user groups, and use deep learning to determine the ingredient combination corresponding to each user group; Get user diet data; Integrate user dietary data and ingredient combinations, use similarity calculation methods to screen dishes, and develop personalized cooking plans for different user groups; Combining user dietary data and cooking plans, an improved optimization algorithm is used to dynamically control cooking parameters during the cooking process of each dish.
[0048] Example 3 The present application also provides an electronic device. The electronic device may include one or more processors and one or more memories. The memories store computer-readable codes, and when the computer-readable codes are run by the one or more processors, the above-mentioned intelligent cooking optimization method based on machine learning can be executed.
[0049] The method or system according to the implementation mode of the present application can also be implemented with the help of the architecture of the electronic device shown in the present application. The electronic device may include a bus, one or more CPUs, ROM, RAM, a communication port connected to a network, input / output, a hard disk, etc. A storage device in the electronic device, such as a ROM or a hard disk, can store the intelligent cooking optimization method based on machine learning provided in the present application. Furthermore, the electronic device may also include a user interface. Of course, the architecture shown in the present application is only exemplary. When implementing different devices, one or more components in the electronic device shown in the present application may be omitted according to actual needs.
[0050] Example 4 One embodiment of the present application discloses a computer-readable storage medium. Computer-readable instructions are stored on the computer-readable storage medium. When the computer-readable instructions are executed by a processor, the intelligent cooking optimization method based on machine learning according to the embodiment of the present application described with reference to the above figures can be executed. The storage medium includes, but is not limited to, for example, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.
[0051] In addition, according to the embodiments of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the present application provides a non-transitory machine-readable storage medium, which stores machine-readable instructions, and the machine-readable instructions can be executed by a processor to execute instructions corresponding to the method steps provided in the present application, for example: an intelligent cooking optimization method based on machine learning. When the computer program is executed by a central processing unit (CPU), the above functions defined in the method of the present application are executed.
[0052] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0053] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An intelligent cooking optimization method based on machine learning, characterized in that: include: Collect user characteristic data, which includes characteristic information of each user; Analyze user feature data, use clustering algorithms to divide user groups, and use deep learning to determine the ingredient combination corresponding to each user group; Obtain user dietary data, which includes each user's historical dietary records; Integrate user dietary data and ingredient combinations, use similarity calculation methods to screen dishes, and develop personalized cooking plans for different user groups; Combining user dietary data and cooking plans, an improved optimization algorithm is used to dynamically control cooking parameters during the cooking process of each dish.
2. The intelligent cooking optimization method based on machine learning according to claim 1, characterized in that: The characteristic information includes age, gender, body mass index and exercise volume; the body mass index is obtained by obtaining the height and weight of each user, squaring the height of each user, and obtaining the square of the height; Divide each user's weight by the square of their corresponding height to obtain each user's body mass index; The steps to segment user groups include: Step A101: different digital labels are set for different genders and marked as gender labels, and the genders in the user feature data are replaced with corresponding gender labels; each set of feature information in the user feature data is used as a sample point, and the sample point corresponds to the feature information one by one; Step A102: Calculate the total number of groups N and set the number of groups , ; Step A103: Random Selection sample points as the center point, and mark each center point in ascending order. , ; Step A104: Mark the sample points that are not the center points as the division points, and mark each division point as , , is the number of groups of feature information in the user feature data; Step A105: According to The corresponding center point is established user groups, and calculate the point distance from each division point to each center point in turn; Step A106: Divide the points The distance to each center point is compared and the points are divided Assign to the user group corresponding to the center point with the smallest point distance; Step A107: , and returns to step A106; Step A108: Repeat steps A106 to A107 until When the loop ends, the process goes to step A109; Step A109: recalculate the new center point corresponding to each user group; Step A110: Repeat steps A105 to A109 until the new center point of each user group recalculated in step A109 is consistent with the new center point of the corresponding user group calculated in the previous loop, and the loop ends to obtain user groups and corresponding division points as group sets; Step A111: Make , and return to step A103; Step A112: loop through steps A103 to A111 until When the loop ends, get A collection of groups, , and proceed to step A113; Step A113: Calculate the average distance corresponding to each group set, take the group set with the largest average distance as the optimal set, and obtain the user group in the optimal set.
3. The intelligent cooking optimization method based on machine learning according to claim 2, characterized in that: In step A102, the method for calculating the total number of groups N is as follows: presetting four classification standards, wherein the classification standards correspond to the data in the feature information one by one; dividing each type of data in the feature information into groups according to the classification standards, and obtaining the number of groups corresponding to each type of data in the feature information; and multiplying each group number in turn to obtain the total number of groups N; In step A105, the expression of point distance is: ; In the formula, For the dividing point To center point The point distance, Center point Middle The value of the dimension, For the dividing point Middle The value of the dimension, ; Different dimensions represent different data in feature information; In step A109, the method for calculating the new center point of each user group includes: ; In the formula, For the The user groups correspond to the new center point. For the of the user groups A dividing point, , For the of the user groups The corresponding values of the partition points in different dimensions are For the The number of partition points in the user group, .
4. The intelligent cooking optimization method based on machine learning according to claim 3 is characterized in that: In A113, the method for calculating the average distance corresponding to each group set includes: Calculate the distance coefficient corresponding to each sample point in each population set, add each distance coefficient corresponding to each population set in turn, and then divide it by n to obtain the average distance corresponding to each population set; the expression of the distance coefficient is: ; In the formula, For the The distance coefficient of the sample points, For the The out-of-group distance of sample points, For the The intra-cluster distance of sample points, is the maximum value function, ; No. The calculation method of the distance within the group corresponding to the sample point is: The user group corresponding to the sample point is marked as the current group, and the user group except the All sample points other than the sample points are marked as other points; calculate the The point distance from the sample point to each other point is marked as the intra-cluster distance; each intra-cluster distance is added in turn, and then divided by the number of intra-cluster distances to obtain the The intra-cluster distance of sample points; No. The calculation method of the distance outside the group corresponding to the sample point is: The point distance from each sample point to each center point is marked as the adjacent distance; each adjacent distance is sorted from large to small, and the user group corresponding to the center point of the second adjacent distance is marked as the nearest group, and all sample points in the nearest group are marked as adjacent points; calculate the The point distance from each sample point to each adjacent point is marked as the out-of-cluster distance; each out-of-cluster distance is added in turn, and then divided by the number of out-of-cluster distances to obtain the The out-of-group distance of each sample point.
5. The intelligent cooking optimization method based on machine learning according to claim 4 is characterized in that: Methods for determining ingredient combinations include: Different digital labels are set for different user groups and marked as group labels; the group label corresponding to each user group is used as analysis data, and the analysis data is input into the trained food analysis model to predict the corresponding combination label; the combination label is the digital label corresponding to the food combination, and the digital labels corresponding to different food combinations are all different; according to the predicted combination label, the corresponding food combination is obtained; The training process of the food analysis model includes: Pre-collection Group analysis data, The group analysis data are all set with corresponding combination labels. is an integer greater than 1, converting the analysis data and the corresponding combination labels into a corresponding set of feature vectors; taking each set of feature vectors as the input of the food analysis model, the food analysis model takes a set of predicted combination labels corresponding to each set of analysis data as output, and takes the actual combination labels corresponding to each set of analysis data as the prediction target, and the actual combination labels are the pre-set combination labels corresponding to the analysis data; minimizing the sum of the prediction errors of all analysis data is taken as the training target; the food analysis model is trained until the sum of the prediction errors converges and the training is stopped; the food analysis model is a deep neural network model.
6. The intelligent cooking optimization method based on machine learning according to claim 5, characterized in that: The historical dietary records include dishes consumed by the user and dishes prohibited by the user; the dishes consumed by the user are dishes selected by the user during the historical dining process, and the dishes prohibited by the user are dishes that the user cannot eat; Ways to create a cooking plan include: According to the user's dietary data, the number of times each user selects each dish is obtained; according to the number of selections, the similarity between every two dishes is calculated; the dishes with a selection number of 0 and not being taboo dishes for the user are regarded as the untried dishes of the corresponding user, and a corresponding similar dish set is constructed for each untried dish; a similarity threshold is preset, and the similarity corresponding to each untried dish is compared with the similarity threshold, and the dishes corresponding to the similarity with a value greater than or equal to the similarity threshold are regarded as similar dishes of the corresponding untried dishes, and added to the similar dish set of the corresponding untried dishes; the dishes corresponding to the similarity with a value less than or equal to the similarity threshold are not regarded as similar dishes of the corresponding untried dishes; According to the similarity and the set of similar dishes, the predicted number of times for each untried dish is calculated; all the selection times and the predicted number of times corresponding to each dish are added up in sequence to obtain the total number of times corresponding to each dish; all dishes are sorted from large to small according to the corresponding total number of times to obtain a dish sorting table; the ingredients corresponding to each dish are obtained, and the ingredients corresponding to each dish are compared with the ingredient combination; if the ingredients corresponding to the dish do not exist in the ingredient combination, the corresponding dish is deleted from the dish sorting table; if the ingredients corresponding to the dish exist in the ingredient combination, the corresponding dish is retained in the dish sorting table; the number of users is obtained, and the number of users is equal to the number of groups of feature information in the user feature data; a preset number of coefficients is used, and the number of users is multiplied by the number of coefficients to obtain the number of dish varieties; the dishes in the dish sorting table are selected in positive order according to the number of dish varieties, and used as cooking plans.
7. The intelligent cooking optimization method based on machine learning according to claim 6, characterized in that: The expression of similarity is: ; In the formula, For the Dishes and The similarity of the dishes, For the User for The number of dishes selected, For the User for The number of dishes selected, , is the number of users, , , , , is the number of dishes; The expression for the number of predictions is: ; In the formula, is the number of predictions, For dishes not tried The similarity of similar dishes, The similar dish is the first in the set of similar dishes corresponding to the dish that has not been tried. Similar dishes, The user who has not tried the dish has The number of similar dishes selected, , is the number of similar dishes in the set of similar dishes corresponding to the dish that has not been tried.
8. The intelligent cooking optimization method based on machine learning according to claim 7, characterized in that: The cooking parameters include static parameters and dynamic parameters. The static parameters include the amount of ingredients, the amount of seasoning, the cooking time and the cooking method. The dynamic parameters include the fire power. Methods for dynamically controlling cooking parameters include: Construct M sets of parameter sets, set ascending numerical labels for the M sets of parameter sets, and mark them as set labels. The range of the set labels is ; Set the initial aperture center and the initial aperture radius , and set the number of iterations ;in, , ; Define the loop process, the loop process is: generate m candidate solutions within the aperture range and reduce the aperture radius , , the candidate solutions correspond to the set labels one by one; calculate the cooking effect corresponding to each candidate solution, move the aperture center to the candidate solution with the largest cooking effect; repeat the cycle process, and each time the cycle process is repeated, the number of iterations is +1; preset iteration threshold G and radius threshold H; until or When , the repeated cycle process is stopped, the candidate solution corresponding to the aperture center is obtained, and it is marked as the best solution; the parameter set corresponding to the set label corresponding to the best solution is marked as the best set; Get the cooking time in the best set and mark it as the best time; preset a step set, which includes dishes and the time steps corresponding to the dishes; according to the current dish, get the corresponding time step from the step set and mark it as the current step; divide the best time by the current step to get the number of moments ; Input the best set into the trained firepower prediction model, predict the firepower size at the first future moment, and mark it as the first predicted firepower, the first future moment is the next moment of the current moment; replace the initial firepower size in the best set with the first predicted firepower, and re-input it into the trained firepower prediction model to predict the firepower size at the second future moment, the second future moment is the next moment of the first future moment; perform cyclic prediction on the firepower size until the firepower prediction model predicts the first future moment. The firepower at the future moment is marked as Predict firepower; take all predicted firepower sizes as a firepower set, and optimize the cooking parameters based on the optimal set and the firepower set; the training process of the firepower prediction model is consistent with the training process of the food analysis model, and both are deep neural network models.
9. The intelligent cooking optimization method based on machine learning according to claim 8, characterized in that: The method for constructing M sets of parameter sets is as follows: presetting a parameter range, the parameter range includes the range corresponding to each parameter in the research parameters; the research parameters include the amount of ingredients, the amount of seasoning, the cooking time, the method label and the initial fire size; randomly selecting a value from each range within the parameter range, and constructing a set of parameter sets, constructing a total of M sets of parameter sets, and the M sets of parameter sets are all different; wherein the method label is a digital label corresponding to the cooking method, and the method labels corresponding to different cooking methods are all different; The calculation method of the cooking effect is as follows: different digital labels are set for different dishes and marked as dish labels; the dish to be cooked is taken as the current dish, the dish label corresponding to the current dish is obtained, and it is marked as the current label; the parameter set corresponding to the set label corresponding to the candidate solution is obtained, the parameter set and the current label are used as evaluation parameters, and the evaluation parameters are input into the trained effect evaluation model to evaluate the corresponding cooking effect; the training process of the effect evaluation model is consistent with the training process of the food analysis model, and both are deep neural network models; The expression of the candidate solution is: ; In the formula, For the Candidate solutions, is the aperture center corresponding to the tth repetition of the cycle, is the aperture radius corresponding to the tth repetition of the cycle, is the random coefficient, , ; The expression for reducing the aperture radius is: ; In the formula, is the reduced aperture radius, is the shrinkage coefficient, .
10. An intelligent cooking optimization system based on machine learning, used to implement the intelligent cooking optimization method based on machine learning as described in any one of claims 1 to 9, characterized in that: include: A data collection module is used to collect user characteristic data, which includes characteristic information of each user; The ingredient determination module is used to analyze user feature data, divide user groups using clustering algorithms, and use deep learning to determine the ingredient combination corresponding to each user group; A data acquisition module is used to acquire user dietary data, which includes each user's historical dietary records; The cooking planning module is used to integrate user dietary data and ingredient combinations, use similarity calculation methods to screen dishes, and formulate personalized cooking plans for different user groups; The parameter control module is used to combine the user's dietary data and cooking plan, and adopts the improved optimization algorithm to dynamically control the cooking parameters during the cooking process of each dish.
Citation Information
Patent Citations
Intelligent cooking system
CN108897245A
User selecting method and device
CN106355449A
Sharing platform food material distribution method and system based on data model and readable storage medium
CN112100499A
User portraying method based on health management tag
CN115130006A
Cooking robot menu management method and system based on big data and medium
CN119692501A