Big language model-based diet preference prediction method and device, equipment and medium
Through large language models and neural networks, food pictures and multimodal information are analyzed, and diet preference prediction results are generated, which solves the problem that the steam oven cannot accurately judge user taste, provides personalized cooking suggestions, and improves user satisfaction.
Patent Information
- Application Number
- CN202510788931.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-06-13
AI Technical Summary
The existing steam oven cannot accurately judge the user's dietary preferences, which makes it difficult to match personal tastes, affecting user experience and satisfaction.
Through a large language model, analyzing the cooked food pictures and collecting multimodal information, generating food state description features and preference features, using neural networks to extract feature vectors, and generating dietary preference prediction results through weighted fusion to provide cooking suggestions.
It realizes accurate judgment of users' dietary preferences, provides personalized cooking suggestions, and improves users' cooking satisfaction and experience.
Smart Images

Figure CN120298815A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cooking intelligence, and in particular to a method, device, equipment and medium for predicting dietary preferences based on a large language model. Background Art
[0002] With the improvement of living quality, steam ovens, as important cooking appliances in modern kitchens, are used more and more frequently. When using a steam oven, users often expect the baked food to match their personal dietary preferences, such as preferring a crispy crust, a tender texture, or a specific degree of doneness. However, the current cooking programs of steam ovens are mostly fixed and preset, or users need to manually adjust parameters, which is cumbersome and difficult to accurately match personal tastes. The existing steam oven technology cannot effectively evaluate the results of baked food such as color, texture, and flavor, and associate them with user preferences, resulting in cooking equipment in the prior art being unable to accurately judge user dietary preferences, making it difficult for users to stably obtain ideal cooking effects and affecting the use experience and satisfaction. Summary of the Invention
[0003] Embodiments of the present invention provide a method, device, equipment and medium for predicting dietary preferences based on a large language model, aiming to solve the problem that cooking equipment in the prior art cannot accurately judge user dietary preferences.
[0004] In a first aspect, embodiments of the present invention provide a method for predicting dietary preferences based on a large language model, which includes: judging the preference of a cooked food picture through a preset large language model to generate a state description feature and a preference feature of the food; collecting multi-modal information of the food during the cooking process, processing the multi-modal information of the food through a preset neural network to obtain a feature vector; performing weighted fusion on the feature vector, the state description feature and the preference feature to obtain a fusion feature; generating a corresponding dietary preference prediction result by passing the fusion feature through a preset preference prediction model, and generating a corresponding cooking suggestion according to the dietary preference prediction result.
[0005] In a second aspect, embodiments of the present invention further provide a device for predicting dietary preferences based on a large language model, which includes: a judgment unit for judging the preference of a cooked food picture through a preset large language model to generate a state description feature and a preference feature of the food; a collection unit for collecting multi-modal information of the food during the cooking process, processing the multi-modal information of the food through a preset neural network to obtain a feature vector; a fusion unit for performing weighted fusion on the feature vector, the state description feature and the preference feature to obtain a fusion feature; a generation unit for generating a corresponding dietary preference prediction result by passing the fusion feature through a preset preference prediction model, and generating a corresponding cooking suggestion according to the dietary preference prediction result.
[0006] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor. A computer program is stored on the memory, and when the processor executes the computer program, the above method is implemented.
[0007] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium. The storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a processor, the above method can be implemented.
[0008] An embodiment of the present invention provides a method, apparatus, device, and medium for predicting dietary preferences based on a large language model. Among them, the method includes: judging the preference of a cooked food picture through a preset large language model to generate a state description feature and a preference feature of the food; collecting multi-modal information of the food during the cooking process, processing the multi-modal information of the food through a preset neural network to obtain a feature vector; performing weighted fusion on the feature vector, the state description feature, and the preference feature to obtain a fusion feature; generating a corresponding dietary preference prediction result through a preset preference prediction model for the fusion feature, and generating a corresponding cooking suggestion according to the dietary preference prediction result. By collecting food pictures in a cooking device and multi-modal information of the food during the cooking process, the embodiment of the present invention understands the state of food cooking, performs feature extraction based on the collected information, and obtains corresponding food state description features and preference features, so as to predict the user's dietary preferences based on sufficient information. By fusing all the collected information and generating a corresponding dietary preference prediction result and a corresponding cooking suggestion through a preset preference prediction model, the user's cooking dietary preferences can be accurately judged, assisting the user in adjusting the diet and the cooking process, helping the user make food that better suits their taste, and improving user satisfaction. Description of the Drawings
[0009] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0010] Figure 1 It is a schematic flowchart of the method for predicting dietary preferences based on a large language model provided by the embodiment of the present invention; Figure 2 It is a schematic diagram of the first sub-process of the method for predicting dietary preferences based on a large language model provided by the embodiment of the present invention; Figure 3 It is a schematic diagram of the second sub-process of the method for predicting dietary preferences based on a large language model provided by the embodiment of the present invention; Figure 4 Schematic diagram of the third sub - process of the diet preference prediction method based on a large language model provided by an embodiment of the present invention; Figure 5 Schematic diagram of the fourth sub - process of the diet preference prediction method based on a large language model provided by an embodiment of the present invention; Figure 6 Schematic diagram of the fifth sub - process of the diet preference prediction method based on a large language model provided by an embodiment of the present invention; Figure 7 Schematic diagram of the sixth sub - process of the diet preference prediction method based on a large language model provided by an embodiment of the present invention; Figure 8 Schematic block diagram of the diet preference prediction device based on a large language model provided by an embodiment of the present invention; Figure 9 Schematic block diagram of the computer device provided by an embodiment of the present invention. Detailed implementation manners
[0011] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0012] It should be understood that when used in this specification and the appended claims, the terms "comprises" and "comprising" indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0013] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in this specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms.
[0014] It should be further understood that the term " / and" as used in this specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the related listed items, and includes these combinations.
[0015] Please refer to Figure 1 , Figure 1Schematic flowchart of the diet preference prediction method based on a large language model provided by an embodiment of the present invention. The diet preference prediction method based on a large language model in this embodiment can be applied to a steaming and baking cooking device, where the device has one or more of electromagnetic heating, heating tube heating, steam heating, microwave heating, or gas heating. A number of gas sensors, cameras, relative humidity sensors, and absolute humidity sensors are also deployed in the device. Food pictures can be collected through the camera, and the gas sensors, relative humidity sensors, and absolute humidity sensors collect multi-modal information of the food, so as to analyze the diet preference according to the collected information, accurately judge the user's cooking diet preference, and improve user satisfaction.
[0016] Figure 1 Schematic flowchart of the diet preference prediction method based on a large language model provided by an embodiment of the present invention. As shown in the figure, the method includes the following steps S110 - S140.
[0017] S110. Perform preference judgment on the food pictures after cooking through a preset large language model to generate the state description features and preference features of the food.
[0018] In this embodiment, the large language model is an artificial intelligence model based on deep learning. In the cooking field, the large language model can be used to analyze the descriptive text of food pictures. The state description features refer to the specific description of the current state of the food, and the preference features are the user's taste preferences and cooking method preferences. For example, taste preferences: rich, strong; cooking method preferences: roasting, making healthy food by oneself. Perform preference judgment on the food pictures after cooking through a preset large language model to generate the state description features and preference features of the food. Specifically, after the steaming and baking cooking device finishes cooking, the camera in the cooking device collects food pictures, and image recognition technology identifies the cooked food in the pictures and extracts corresponding appearance features, such as image information of color, shape, texture, etc. Input the image information into the pre-prepared large language model, and through the preset large language model, describe the state of the picture, give a preliminary judgment on the user's diet preference, and generate the state description features and preference features of the food. For example, state description features: eggplant: surface: covered with red sauce, roasted, state: evenly covered, with roast marks on the surface; preference features: taste preferences: rich, strong; cooking method preferences: roasting; preference for self-made food: making healthy food by oneself. Generating the description information of the food through the state description features and preference features of the food generated by the large language model provides objective and quantifiable information for subsequent accurate prediction of the user's diet preference.
[0019] In one embodiment, as Figure 2 shown, the step S110 further includes steps S111 - S112.
[0020] S111. Input the food picture into the preset large language model for status description and diet preference judgment, and generate a structured output result according to a preset template. S112. Encode the output result to generate the status description feature and the preference feature.
[0021] In this embodiment, the preset template is a pre - defined output template, which stipulates which fields and formats the output result should contain. Before the step of inputting the food picture into the preset large language model for status description and diet preference judgment and generating a structured output result according to the preset template, collect the cooking data of different ingredients in advance, establish a large number of sample data, and record the actual diet preferences of each sample. Input the corresponding image information into the pre - prepared large language model, and require the large language model to describe the state of the picture and give a preliminary judgment on the user's diet preference through the preset template to train the large language model. Among them, the preset template can be: I uploaded a picture of the food cooked by the user. Please help me analyze the cooking state of this food according to the information in this picture, and analyze the user's diet preference based on this food state. The trained large language model generates a corresponding structured output result according to the preset template, such as the output result in json format content, and encodes the generated output result. For example, create an Embedding Layer to convert the output result into a dense vector representation, so as to obtain the status description feature and the preference feature. By generating a structured output result and encoding it to obtain the corresponding status description feature and the preference feature, the features can be standardized and the subsequent calculation efficiency can be improved.
[0022] S120. Collect the food multi - modal information during the cooking process, and process the food multi - modal information through a preset neural network to obtain a feature vector.
[0023] In this embodiment, the food multi - modal information is the information collected from different sensors. The multi - modal information includes gas information, absolute humidity information, and relative humidity information collected by gas sensors, relative humidity sensors, and absolute humidity sensors. The food multi - modal information is a pre - trained deep learning model. It can receive multi - modal information as input and perform feature extraction and transformation on this information through mathematical operations (such as convolution, pooling, fully connected, etc.). The neural network will perform multi - level abstraction and representation learning on the input multi - modal information to generate a corresponding feature vector. Among them, the feature vector is a multi - dimensional vector, and each dimension represents a specific feature or attribute. By processing the food multi - modal information through a preset neural network to obtain a feature vector, the key information of the food can be captured, providing a data basis for the subsequent prediction of the user's diet preference.
[0024] In one embodiment, as Figure 3 shown, step S120 further includes steps S121 - S122.
[0025] S121. Extract features from the multimodal information through the preset neural network to generate a feature sequence; S122. Assign ranks to several features in the feature sequence according to the training feature data to obtain the feature vector.
[0026] In this embodiment, the feature sequence is a sequence composed of features of multimodal information at different times. The preset neural network is a pre-trained artificial neural network model that can receive multimodal information as input and perform feature extraction and transformation on this information. Extract features from the multimodal information through the preset neural network to generate a feature sequence. Specifically, through sensors deployed in the steam - baking device, gas information, absolute humidity information, and relative humidity information are collected at various stages or time points of cooking. Among them, information collection can be set to be performed at preset time intervals. For example, multimodal information is collected every minute. Four gas sensors, one relative humidity sensor, one absolute humidity sensor, and one temperature sensor are deployed in the steam - baking device. And within the cooking time range, each sensor has collected data at 300 time points. Then, consider the data of gas information as a two - dimensional array with a length of 300 and a width of 7. Then multiply this two - dimensional array by the pre - trained neural network to obtain an output, and this output is the extracted gas feature sequence. The number of output features varies according to the structure of the pre - trained neural network, and this is not limited here. Among them, it is also possible to calculate information such as the variance, mean, change value at the initial and final moments, maximum sensor response of each sensor, average sensor response at a specific cooking stage, time to reach the peak response, and area under the curve of the sensor response of the collected multimodal information at different times to obtain corresponding information features. Assign ranks to several features in the feature sequence according to the training feature data to obtain the feature vector. Specifically, the calculated individual features can be sorted in the training feature data set to obtain the rank of this feature, and the rank is assigned to this feature. After sorting all the features, a feature vector will be obtained. Among them, the training feature data set is composed of collected different features, and the training features are sorted according to their values to represent the degree change of cooking features. For example, the feature value of the caramelized smell is large and is ranked in the front, while the feature value of the normal smell is small and is ranked behind. By obtaining the feature vector to capture the key information of the food to understand the food state, so as to accurately judge the user's dietary preferences.
[0027] In one embodiment, as Figure 4As shown, the step S122 includes steps S1221 - S1222.
[0028] S1221. Sequentially perform feature ranking on several features in the feature sequence in the training feature data to obtain the position of each feature in the training feature data. S1221. Assign the position to the corresponding feature, and determine the feature vector according to the feature sequence after assignment.
[0029] In this embodiment, the feature sequence refers to a set of features obtained after multi - modal information collected at different times during cooking is processed by a neural network. These features can be arranged in chronological order to form a feature sequence. Sequentially perform feature ranking on several features in the feature sequence in the training feature data to obtain the position of each feature in the training feature data. For example, in the training set, we have a total of 3000 training samples. A certain gas feature ranks 322nd from largest to smallest in all training sets. Assign the position to the corresponding feature, then the ranking feature position is 322. Determine the feature vector according to the feature sequence after assignment, that is, sort all the features, and a feature vector will be obtained, such as [feature a position 322, feature b position 567,..., feature N position n]. Finally, perform normalization processing on the sorted features. Among them, the features in the training feature data are also arranged according to feature values. For example, the features with a stronger taste are arranged in the front. Then, according to the different feature positions, the user's diet preferences can be understood, which is convenient for subsequent preference prediction. By determining the feature vector according to the feature sequence after assignment, the accuracy of user diet preference prediction can be improved.
[0030] S130. Perform weighted fusion on the feature vector, the state description feature, and the preference feature to obtain a fusion feature.
[0031] In this embodiment, the weighted fusion is a method of combining multiple features or data sources, where each feature or data source is assigned a weight to represent its importance or contribution degree in the final fusion result. The feature vector is weighted-fused with the state description feature and the preference feature to obtain the fusion feature. Specifically, weights are determined for the feature vector, the state description feature, and the preference feature respectively. These weights can be set according to the actual application scenario, data characteristics, or expert knowledge, and no limitation is imposed thereon. For example, if the state description feature is considered the most important in the current application, a higher weight can be assigned to it; while if the preference feature has a smaller impact on the final result, a lower weight can be assigned to it. Before performing the weighted fusion, each feature can be normalized to eliminate the dimensional difference between different features. The normalization methods include min-max normalization, Z-score normalization, etc., and no limitation is imposed on which method to choose. Multiply the feature vector, the state description feature, and the preference feature by their corresponding weights respectively, and then add the obtained results to get the fusion feature. Among them, the fusion feature can also be obtained by simple feature concatenation. By weighted-fusing all features to obtain the fusion feature, a feature integrating multiple pieces of information is obtained, providing more accurate and comprehensive information for subsequent diet preference prediction.
[0032] In one embodiment, as Figure 5 shown, the step S130 further includes steps S131 - S132.
[0033] S131. Weightedly fuse the feature vector with the state description feature and the preference feature to generate a high-dimensional vector; S132. Determine whether the high-dimensional vector exceeds a preset feature dimension. If it exceeds, perform dimensionality reduction through a preset dimensionality reduction method to obtain the fusion feature.
[0034] In this embodiment, the preset feature dimension is a preset threshold used to limit the maximum dimension of the fused feature. This threshold may be set based on factors such as computing resources, model performance, or application requirements, and is not limited herein. The feature vector, the state description feature, and the preference feature are weighted and fused to generate a high-dimensional vector. Specifically, weights are assigned to the feature vector, the state description feature, and the preference feature respectively, and the feature vector, the state description feature, and the preference feature are multiplied by their corresponding weights respectively, and then the results are added together to generate a high-dimensional vector. For example, high-dimensional vector = weight 1 * feature vector + weight 2 * state description feature + weight 3 * preference feature. Determine whether the high-dimensional vector exceeds the preset feature dimension. If it exceeds, perform dimensionality reduction through a preset dimensionality reduction method to obtain the fused feature. Specifically, calculate the dimension of the high-dimensional vector, that is, the number of features. Compare the dimension of the high-dimensional vector with the preset feature dimension. If the dimension of the high-dimensional vector exceeds the preset feature dimension, it needs to be processed for dimensionality reduction. If the dimension of the high-dimensional vector exceeds the preset feature dimension, one or more of the following dimensionality reduction methods can be used: principal component analysis (PCA: projects high-dimensional data into a low-dimensional space through linear transformation, retaining the maximum variance), t-SNE (t-distributed stochastic neighbor embedding: used for visualizing high-dimensional data, retaining the local structure of the data), autoencoder (Autoencoder: learns the low-dimensional representation of data through a neural network). Select an appropriate dimensionality reduction method to convert the high-dimensional vector into a low-dimensional vector, thereby obtaining a low-dimensional fused feature vector. By selecting an appropriate dimensionality reduction method, the high-dimensional vector is converted into a low-dimensional vector to comprehensively consider the information of the feature vector, the state description feature, and the preference feature, while maintaining a low dimension, which is convenient for subsequent processing and analysis.
[0035] S140. Generate a corresponding diet preference prediction result by passing the fused feature through a preset preference prediction model, and generate a corresponding cooking suggestion according to the diet preference prediction result.
[0036] In this embodiment, the preset preference prediction model is a trained deep learning model for predicting the user's dietary preferences based on the input feature vectors. The model can adopt techniques such as decision trees, support vector machines, neural networks, etc., and use historical data to train the model to ensure that the model can learn the relationship between features and dietary preferences. The fused features are input into the preset preference prediction model to generate corresponding dietary preference prediction results, and corresponding cooking suggestions are generated based on the dietary preference prediction results. Specifically, the model calculates based on the input fused features and outputs the dietary preference prediction results of the user. For example, the model predicts that the user has a relatively high preference for healthy and low-fat foods. According to the dietary preference prediction results output by the model, cooking suggestions suitable for the user are generated. The cooking suggestions can include recommended ingredients, cooking methods, seasonings, etc. For example, if the user shows a high preference for a certain food, more relevant recipes or cooking methods can be recommended. If the user shows a low preference for a certain food, it can be recommended to avoid or replace it with other ingredients. Through the trained preference prediction model, the user's dietary preferences can be accurately predicted, and the generated cooking suggestions can help the user select recipes that meet their taste and health needs, thereby enhancing the user's satisfaction and participation in the cooking process.
[0037] In one embodiment, as Figure 6 shown, steps S1401 - S1402 are further included before step S140.
[0038] S1401. Select an initial classification model according to the task type; S1402. Train and update the initial classification model with training data and a preset loss function to generate the preset preference prediction model capable of performing preference prediction.
[0039] In this embodiment, the task type is the task type that the constructed model is to perform. In this embodiment, the task type is a classification task (classifying the input features into different taste preferences. For example, the preset taste preferences are one of [preferably crispy, preferably tender, preferably light, preferably spicy, severely spicy]). Therefore, a classification model is selected. Among them, logistic regression, SVM, random forest, or neural network (such as MLP) can be used as the initial classification model. A deep learning model can also be used for structural design to obtain the initial classification model. The designed model should include: an input layer (receiving the concatenated feature vectors), a hidden layer (extracting features using fully connected layers, convolutional layers, or LSTM layers), and an output layer (designing the output according to the task type. For example, the classification task outputs a probability distribution, and the regression task outputs a continuous value). The initial classification model is trained and updated through training data and a preset loss function to generate the preset preference prediction model that can perform preference prediction. Specifically, a training data set is prepared, including input features and corresponding labels (such as the user's preference score or classification label for food). Among them, the data set should be divided into a training set, a validation set, and a test set to evaluate the model performance. Select an appropriate loss function according to the task type. For example, the mean squared error loss function. The model is trained using an optimizer (such as Adam, SGD), the loss function, and the training set. Hyperparameters such as the learning rate, batch size, and number of training epochs are adjusted to optimize the model performance. The validation set and the test set are used to evaluate the model performance to ensure that the model has good generalization ability. The evaluation metrics include accuracy, precision, recall, F1 score, etc. (classification task) or mean squared error, mean absolute error, etc. (regression task). After training is completed, the model can be used to predict the preference results of new data, and then this model is the preset preference prediction model. By generating the preset preference prediction model that can perform preference prediction, preference prediction can be effectively performed according to the collected data, and personalized diet recommendations can be provided.
[0040] In one embodiment, as Figure 7 shown, step S140 includes steps S141 - S142.
[0041] S141. Screen out the corresponding recipes to be recommended and cooking suggestions according to the diet preference prediction result; S142. Display the recipes to be recommended, the cooking suggestions, and the diet preference prediction result.
[0042] In this embodiment, the cloud of the cooking device contains a large number of recipes. Corresponding recommended recipes to be recommended and cooking suggestions are screened out according to the dietary preference prediction result. According to the dietary preference prediction result, the system screens out recipes that meet the user's preferences from the recipe database. The screening process may involve matching multiple dimensions of the recipes, such as ingredients, flavors, cooking methods, etc. For example, if the user prefers low-fat foods, the system will give priority to screening out those low-fat or fat-free recipes. In addition to screening recipes, personalized cooking suggestions are generated according to the user's dietary preferences and current status (such as available ingredients, cooking equipment, etc.). The cooking suggestions may include adjusting the amount of ingredients in the recipe, recommending alternative ingredients, providing cooking techniques or precautions, etc. The screened recipes and the generated cooking suggestions can be combined into a recommended list. The recommended list can be sorted according to factors such as the user's preference level, the popularity of the recipe, and the cooking difficulty, so that the user can more easily find the desired recipe. The recommended recipes to be recommended, the cooking suggestions, and the dietary preference prediction result are displayed. Specifically, they are displayed on the screen of the cooking device or the corresponding App terminal. By screening out the recommended recipes to be recommended and the cooking suggestions and displaying them, it helps the user to conveniently find the recipes that meet their own preferences and obtain personalized cooking suggestions, thereby improving the dining experience and user satisfaction.
[0043] Figure 8 It is a schematic block diagram of a dietary preference prediction device 200 based on a large language model provided by an embodiment of the present invention. As Figure 8 shown, corresponding to the above dietary preference prediction method based on a large language model, the present invention also provides a dietary preference prediction device based on a large language model. The dietary preference prediction device based on a large language model includes units for executing the above dietary preference prediction method based on a large language model. This device can be configured in terminals such as desktop computers, tablet computers, laptops, etc. Specifically, please refer to Figure 8 , the dietary preference prediction device based on a large language model includes a judgment unit 210, a collection unit 220, a fusion unit 230, and a generation unit 240.
[0044] The judgment unit 210 is used to judge the preference of the cooked food picture through a preset large language model, and generate the state description features and preference features of the food.
[0045] In one embodiment, the judgment unit 210 includes an input unit and an encoding unit.
[0046] The input unit is used to input the food picture into the preset large language model for state description and dietary preference judgment, and generate a structured output result according to a preset template; The encoding unit is used to encode the output result to generate the state description features and the preference features.
[0047] The acquisition unit 220 is configured to acquire multi-modal information of food during the cooking process, perform feature processing on the multi-modal information of food through a preset neural network, and obtain a feature vector.
[0048] In one embodiment, the acquisition unit 220 includes an extraction unit and an assignment unit.
[0049] The extraction unit is configured to extract features from the multi-modal information through the preset neural network to generate a feature sequence. The assignment unit is configured to assign ranks to several features in the feature sequence according to training feature data to obtain the feature vector.
[0050] In one embodiment, the acquisition unit 220 includes a sorting unit and a determination unit.
[0051] The sorting unit is configured to sequentially sort several features in the feature sequence in the training feature data to obtain the rank of each feature in the training feature data. The determination unit is configured to assign the rank to the corresponding feature and determine the feature vector according to the feature sequence after assignment.
[0052] The fusion unit 230 is configured to perform weighted fusion on the feature vector, the state description feature, and the preference feature to obtain a fusion feature.
[0053] In one embodiment, the fusion unit 230 includes a weighting unit and a dimensionality reduction unit.
[0054] The weighting unit is configured to perform weighted fusion on the feature vector, the state description feature, and the preference feature to generate a high-dimensional vector. The dimensionality reduction unit is configured to determine whether the high-dimensional vector exceeds a preset feature dimension. If it exceeds, dimensionality reduction is performed through a preset dimensionality reduction method to obtain the fusion feature.
[0055] The generation unit 240 is configured to generate a corresponding dietary preference prediction result from the fusion feature through a preset preference prediction model, and generate a corresponding cooking suggestion according to the dietary preference prediction result.
[0056] In one embodiment, the generation unit 240 includes a selection unit and an update unit.
[0057] The selection unit is configured to select an initial classification model according to the task type. The update unit is configured to train and update the initial classification model through training data and a preset loss function to generate the preset preference prediction model capable of performing preference prediction.
[0058] In one embodiment, the generating unit 240 includes a selection unit and an updating unit.
[0059] A screening unit, configured to screen out corresponding recipes to be recommended and cooking suggestions according to the diet preference prediction result; A display unit, configured to display the recipes to be recommended, the cooking suggestions, and the diet preference prediction result.
[0060] It should be noted that those skilled in the art can clearly understand that the specific implementation processes of the above diet preference prediction device 200 based on the large language model and each unit can refer to the corresponding descriptions in the foregoing method embodiments. For the sake of convenience and brevity of description, they will not be elaborated here.
[0061] The above diet preference prediction device based on the large language model can be implemented in the form of a computer program, and this computer program can run on a computer device as shown in Figure 9 shown.
[0062] Please refer to Figure 9 , Figure 9 which is a schematic block diagram of a computer device provided by an embodiment of the present application. The computer device 500 can be a terminal or a server. Among them, the terminal can be an electronic device with a communication function such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device. The server can be an independent server or a server cluster composed of multiple servers.
[0063] Referring to Figure 9 , the computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501. Among them, the memory can include a non-volatile storage medium 503 and an internal memory 504.
[0064] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions. When the program instructions are executed, the processor 502 can execute a diet preference prediction method based on the large language model.
[0065] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500.
[0066] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a diet preference prediction method based on the large language model.
[0067] The network interface 505 is used for network communication with other devices. Those skilled in the art can understand that Figure 9 The structure shown in Figure 9 is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device 500 to which the solution of this application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0068] Among them, the processor 502 is used to run the computer program 5032 stored in the memory to implement the steps of the above method.
[0069] It should be understood that in the embodiments of this application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0070] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, and the storage medium is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above method.
[0071] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, where the computer program includes program instructions. When the program instructions are executed by the processor, the processor is caused to execute the steps of the above method.
[0072] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, an optical disk, or other various computer-readable storage media that can store program codes.
[0073] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of the examples have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0074] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0075] The steps in the method of the embodiments of the present invention can be adjusted, combined, and deleted according to actual needs. The units in the device of the embodiments of the present invention can be combined, divided, and deleted according to actual needs. In addition, the functional units in each embodiment of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0076] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present invention.
[0077] As described above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A method for predicting dietary preferences based on large language models, characterized in that, Including: Judging the preference of the cooked food picture through a preset large language model to generate the state description features and preference features of the food; Collecting the multi-modal information of the food during the cooking process, processing the multi-modal information of the food through a preset neural network to obtain a feature vector; Performing weighted fusion on the feature vector, the state description features and the preference features to obtain a fusion feature; Generating a corresponding diet preference prediction result by passing the fusion feature through a preset preference prediction model, and generating a corresponding cooking suggestion according to the diet preference prediction result.
2. The method according to claim 1, wherein The step of judging the preference of the cooked food picture through a preset large language model to generate the state description features and preference features of the food includes: Inputting the food picture into the preset large language model for state description and diet preference judgment, and generating a structured output result according to a preset template; Encoding the output result to generate the state description features and the preference features.
3. The method according to claim 1, wherein The step of collecting the multi-modal information of the food during the cooking process, processing the multi-modal information of the food through a preset neural network to obtain a feature vector includes: Performing feature extraction on the multi-modal information through the preset neural network to generate a feature sequence; Assigning positions to several features in the feature sequence according to training feature data to obtain the feature vector.
4. The method according to claim 3, wherein The step of assigning positions to several features in the feature sequence according to training feature data to obtain the feature vector includes: Sequentially sorting several features in the feature sequence in the training feature data to obtain the position of each feature in the training feature data; Assigning the position to the corresponding feature, and determining the feature vector according to the feature sequence after assignment.
5. The method according to claim 1, characterized in that, The step of performing weighted fusion on the feature vector, the state description features and the preference features to obtain a fusion feature includes: Performing weighted fusion on the feature vector, the state description features and the preference features to generate a high-dimensional vector; Judging whether the high-dimensional vector exceeds a preset feature dimension, and if it exceeds, performing dimensionality reduction through a preset dimensionality reduction method to obtain the fusion feature.
6. The method according to claim 1, wherein Before the step of generating a corresponding diet preference prediction result by passing the fusion feature through a preset preference prediction model, it includes: Selecting an initial classification model according to the task type; Training and updating the initial classification model through training data and a preset loss function to generate the preset preference prediction model capable of performing preference prediction.
7. The method according to claim 1, characterized in that, The step of generating a corresponding cooking suggestion according to the diet preference prediction result includes: Screening out corresponding recipes to be recommended and cooking suggestions according to the diet preference prediction result; Displaying the recipes to be recommended, the cooking suggestions and the diet preference prediction result.
8. A dietary preference prediction device based on a large language model, characterized in that Including: A judgment unit for judging the preference of the cooked food picture through a preset large language model to generate the state description features and preference features of the food; A collection unit for collecting the multi-modal information of the food during the cooking process, processing the multi-modal information of the food through a preset neural network to obtain a feature vector; A fusion unit, configured to perform weighted fusion on the feature vector, the state description feature, and the preference feature to obtain a fusion feature; A generation unit, configured to generate a corresponding diet preference prediction result by passing the fusion feature through a preset preference prediction model, and generate a corresponding cooking suggestion according to the diet preference prediction result.
9. A computer device, characterized in that, The computer device includes a memory and a processor, and a computer program is stored on the memory. When the processor executes the computer program, the method according to any one of claims 1-7 is implemented.
10. A storage medium, characterized in that, The storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a processor, the method according to any one of claims 1-7 can be implemented.
Citation Information
Patent Citations
Semantic segmentation-based food material image processing method and device, equipment and medium
CN117975440A
Oven control method and device, electronic equipment and storage medium
CN120010308A
Method and system for automatic cook program determination
US20240404044A1
Cited By
Individualized taste modeling and formula generating method based on large model
CN121073533A
