Electric cooker cooking time control method based on deep learning and electric cooker
The cooking model built through deep learning, combining deep belief networks and long short-term memory networks, solves the problem that traditional rice cookers cannot accurately control cooking time, enabling personalized rice cooking and improving user experience and cooking results.
Patent Information
- Application Number
- CN202511044482.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-11-18
AI Technical Summary
Traditional pressure rice cookers struggle to precisely control cooking time for different types of rice and water amounts, cannot automatically learn user preferences, and thus cannot cook rice with the right texture.
A deep learning-based approach is used to construct a cooking model through deep belief networks and long short-term memory networks. The model is trained using experimental data from rice cookers under different cooking conditions, features are extracted, and the optimal cooking time is predicted. Personalized adjustments are then made based on user preferences.
It achieves precise control of cooking time for different rice varieties and water combinations, enabling the cooking of rice that meets the user's taste, improving cooking results and user experience, and reducing manual intervention by the user.
Smart Images

Figure CN120959563A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of household appliances, and in particular to a rice cooker cooking time control method based on deep learning and a rice cooker. BACKGROUND
[0002] When the pressure type rice cooker is working, the space in the sealed pressure cooker is sealed, so that the steam in the pot cannot be discharged. With heating, the pressure in the pressure cooker rises, and the boiling point of water also rises. In a high-temperature and high-pressure environment, food is more likely to be cooked and boiled, thereby shortening the cooking time.
[0003] When the traditional pressure type rice cooker is cooking, it usually follows a fixed cooking program (such as cooking rice, cooking porridge, cooking soup, and stewing meat, which have corresponding preset programs. According to the characteristics and cooking requirements of different foods, the heating time and pressure are controlled). However, when cooking rice, it is difficult to accurately control the cooking time for different types of rice and different amounts of water to cook rice suitable for the taste of various users. Although some rice cookers have some simple adjustment functions, they cannot automatically learn user preferences, are difficult to meet the diverse needs of users, and are difficult to cook rice suitable for the taste of users. SUMMARY
[0004] The purpose of the embodiments of the present application is to provide a rice cooker cooking time control method based on deep learning and a rice cooker, which can provide reliable cooking time control support for intelligent rice cookers and cook rice suitable for the taste of users.
[0005] In order to achieve the above-mentioned purpose, the embodiments of the present application adopt the following technical solutions: In a first aspect, the embodiments of the present application provide a rice cooker cooking time control method based on deep learning, which comprises: constructing a first training data set based on experimental cooking data of a rice cooker under different cooking conditions; Training a preset deep belief network based on the first training data set to extract features based on the complex nonlinear relationship between the experimental cooking data and the cooking time in the deep belief network, and obtain a second training data set; Taking the second training data set as the input of a preset long short-term memory network to train the long short-term memory network based on the second training data set and establish a cooking model; Inputting the current cooking data of the rice cooker under the current cooking condition into the cooking model to obtain the cooking time control strategy of the rice cooker.
[0006] In an embodiment, the deep belief network comprises a plurality of restricted Boltzmann machines, each of the Boltzmann machines comprising a visible layer and a hidden layer, the nodes of the visible layer comprising respective features of experimental cooking data, the experimental cooking data comprising rice variety, rice amount, water amount, initial rice temperature and water temperature, ambient temperature and humidity; the nodes of the hidden layer being used to learn a latent feature representation of a complex non-linear relationship between the experimental cooking data and cooking time; the training of the preset deep belief network by the first training data set comprises: inputting the first training data set into the visible layer of a first Boltzmann machine in the deep belief network, performing forward propagation on the first training data set in the visible layer to obtain node states of the hidden layer; starting from the node states of the hidden layer, calculating reconstruction activation probabilities of the nodes of the visible layer, and obtaining a reconstructed visible layer state by sampling; updating weights and biases of the hidden layer of the first restricted Boltzmann machine and the reconstructed visible layer by using a contrastive divergence algorithm, and inputting data obtained after the forward propagation into a second restricted Boltzmann machine in the deep belief network, and sequentially updating weights and biases of hidden layers and visible layers of the plurality of restricted Boltzmann machines.
[0007] The calculation formula of the contrastive divergence algorithm specifically comprises: ; ; ; wherein, is an updated connection weight between an i-th node in the visible layer and a j-th node in the hidden layer, b i is a bias of the updated visible layer node, c j is a bias of the updated hidden layer node, and ϵ is a learning rate, data represents an expectation based on original data, recon represents an expectation based on reconstructed data, v i and h i are a visible layer original node state vector and a hidden layer original node state vector, respectively, and are a visible layer node state vector and a hidden layer node state vector obtained after training, respectively.
[0008] In an embodiment, the method further comprises: extracting a node state vector of a last hidden layer of the plurality of restricted Boltzmann machines to obtain a second training data set.
[0009] In an embodiment, the inputting the second training data set into the long short-term memory network comprises: performing sequence data format conversion on the second training data set according to a preset dimension; performing supervised training on the long short-term memory network using the second training data set after the sequence data format conversion.
[0010] In an embodiment, the cooking data comprises an optimal cooking time, the long short-term memory network comprises an LSTM layer, an input layer and a full connection layer; and the supervised training on the long short-term memory network using the second training data set after the sequence data format conversion comprises: inputting the second training data set after the sequence data format conversion into the input layer of the long short-term memory network in a sequence, and sequentially passing through the LSTM layer and the full connection layer of the long short-term memory network, and outputting a predicted optimal cooking time; calculating a loss value of the predicted optimal cooking time and an actual optimal cooking time by a loss function, and calculating a weight gradient of the loss function on the long short-term memory network by a back propagation algorithm; updating a weight parameter of the long short-term memory network using a preset optimizer based on the weight gradient to minimize the loss function; when the loss function after the minimization processing satisfies a preset training termination condition, taking the long short-term memory network corresponding to the loss function as a cooking model.
[0011] In an embodiment, the updating the weight parameter of the long short-term memory network using the optimizer comprises: updating the weight parameter using the following formula: ; ; ; ; ; wherein, w t represents a weight parameter value at the tth time, w t+1 represents a weight parameter value at the t+1th iteration, m t represents a first moment estimation of the gradient, m t−1 a first moment estimation at the t−1th time, and v t−1 represents a second moment estimation at the t−1th time, represents a corrected first moment estimation, The modified second moment estimation is shown, and a represents a learning rate for controlling the step size of parameter update, β1 represents a decay rate of the first moment for controlling the influence of historical gradients on m t , β2 represents a decay rate of the second moment for controlling the influence of historical gradient squares on v t , g t represents the gradient calculated by the current batch, i.e., the loss function with respect to the weight parameter w, and ε is a constant for avoiding division by zero when the value is very small.
[0012] In an embodiment, after inputting the current cooking data of the rice cooker under the current cooking condition into the cooking model to obtain the cooking time control strategy of the rice cooker, the method further comprises: when the real cooking time set by the user is different from the optimal cooking time in the cooking time control strategy, determining an optimization loss value of the real cooking time and the optimal cooking time according to the loss function; and based on the optimization loss value, calculating the weight gradient of the loss function with respect to the long short-term memory network by using a back propagation algorithm to update the cooking model.
[0013] In a second aspect, the present application provides an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the steps of the deep learning-based cooking time control method for a rice cooker according to any one of the first aspect.
[0014] In a third aspect, the present application provides a rice cooker comprising the electronic device according to the second aspect.
[0015] The deep learning-based cooking time control method for a rice cooker and the rice cooker provided by the present application use the features extracted by the deep belief network as the input of the long short-term memory network. The long short-term memory network is good at processing time series data and can effectively capture the long-term dependence relationship in the data. The long short-term memory network is used to further analyze the time series features in the cooking process. Through the training of a large amount of data, the parameters of the deep belief network and the long short-term memory network are continuously optimized, and finally a high-precision cooking model is constructed to provide reliable cooking time control support for the intelligent rice cooker and cook rice with appropriate taste for the user. BRIEF DESCRIPTION OF DRAWINGS
[0016] The accompanying drawings, which are included to provide a further understanding of the present application, constitute a part of this application and illustrate certain illustrative embodiments of the present application and its description, which serve to explain the present application, and do not constitute improper limitations on the present application. In the drawings: Figure 1 A flowchart of a deep learning-based cooking time control method for a rice cooker provided by one embodiment of the present application; Figure 2 A structural schematic diagram of an electronic device is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0017] For the purpose, technical solutions and advantages of the present application to be clearer, the technical solutions of the present application will be described clearly and completely below in combination with specific embodiments of the present application and corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without any creative work belong to the scope of protection of the present application.
[0018] The terms "first", "second", and the like in the specification and claims are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application are implemented in an order other than those illustrated or described herein. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally means that the front and rear associated objects are in an "or" relationship.
[0019] In the hardware structure of the electric rice cooker of the present application, a pressure control module, a temperature detection module, a rice and water detection module, a rice cooking time adjustment button, a display and operation interface and other hardware components are provided. These hardware components are installed at the corresponding positions of the electric rice cooker and electrically connected, and the communication between the modules is ensured to be normal, the sensor can accurately detect the related parameters, so that the actuator can accurately perform the corresponding action according to the instruction. In addition, the pressure control module needs to be calibrated, different pressure thresholds are set, and the pressure control precision is verified through the pressure regulating valve, and the temperature detection module is temperature calibrated to ensure that the measured temperature is accurate and reliable, and the rice and water detection module is tested for rice and water measurement accuracy to adjust the related parameters to accurately measure different amounts of rice and water.
[0020] Reference Figure 1 A flowchart of an electric rice cooker cooking time control method based on deep learning is provided for an embodiment of the present application. The electric rice cooker cooking time control method based on deep learning can be executed by an electric rice cooker cooking time control device based on deep learning provided by an embodiment of the present application. The device can be realized in the form of software and / or hardware, such as a server, a computer, a processor, and other electronic devices.
[0021] In this embodiment, the processor of the execution subject of the electric rice cooker cooking time control method based on deep learning is taken as an example. The electric rice cooker cooking time control method based on deep learning provided by the embodiment includes: Step S1, constructing a first training data set based on experimental cooking data of the electric rice cooker under different cooking conditions.
[0022] Specifically, in the experimental process, by systematically collecting relevant data of the electric rice cooker cooking a variety of different types of rice (such as japonica rice, indica rice, glutinous rice, etc.) under different water conditions, it covers parameters such as the type of rice, the ratio of rice quantity and water quantity, the initial rice temperature and water temperature, the environmental temperature and humidity, etc., and records detailed information such as the best cooking time corresponding to different rice texture (such as hard, moderate, soft), thereby constructing the first training data set. This first training data set aims to provide comprehensive basic data support for subsequent model training, ensuring that the model can fully learn the cooking rules under different conditions to achieve accurate cooking time prediction.
[0023] Step S2, training a preset deep belief network through the first training data set, and based on the deep belief network, extracting features of the complex nonlinear relationship between the experimental cooking data and the cooking time in the first training data set to obtain a second training data set.
[0024] In this embodiment, the collected first training data set is taken as input to construct a deep belief network composed of a plurality of restricted Boltzmann machines stacked in sequence. Through the method of unsupervised learning, the deep belief network can automatically extract key features from the data, deeply mine the complex nonlinear relationship between the input factors such as rice type and water quantity and the cooking time, and thus complete the preliminary feature representation learning of the data, laying a foundation for subsequent model training. This process aims to capture the potential patterns in the data and improve the adaptability of the model to different cooking scenarios.
[0025] It can be understood that the restricted Boltzmann machine (RBM) is a model based on energy function, which includes a visible layer and a hidden layer. There is no connection between the nodes in the layer, while the nodes between the layers are fully connected. The nodes in the visible layer correspond to the features of the input data, such as the type of rice, the amount of rice, the amount of water, the initial rice temperature and water temperature, the environmental temperature and humidity, etc., while the nodes in the hidden layer are responsible for learning and representing the potential features in the data. This structure design aims to mine the deep patterns of the data through unsupervised learning, providing support for subsequent feature extraction and model training.
[0026] Preferably, before training the preset deep network through the first training data set, the method further comprises: data cleaning of the first training data set, and normalization processing of the data of different features in the first training data set after data cleaning; The formula of the normalization processing is: ; Where X normis the normalized result, X is the original feature value, X min and X max respectively the minimum and maximum values of the original feature values in the first training data set after data cleaning.
[0027] In addition, it is understood that before normalizing the data, the data set needs to be cleaned, which specifically includes checking and removing abnormal values and missing values. For example, if the rice variety label of a certain sample is incorrect, or the cooking time data is incomplete, these data need to be corrected or deleted to ensure the quality of the data set. A large amount of collected data covers detailed information such as different rice varieties, water quantity combinations, and corresponding optimal cooking times.
[0028] Through normalization, the data of different features can be uniformly mapped to a consistent numerical range (usually [0, 1] or [-1, 1]), thereby achieving precise control of numerical features such as rice weight and water quantity. This processing method helps to improve the comparability of data and the stability of model training.
[0029] Further, the deep belief network comprises a plurality of restricted Boltzmann machines, each of which comprises a visible layer and a hidden layer, the nodes of the visible layer comprising respective features of experimental cooking data, the experimental cooking data comprising rice variety, rice quantity, water quantity, initial rice temperature and water temperature, ambient temperature and humidity; the nodes of the hidden layer are used to learn a latent feature representation of the complex nonlinear relationship between the experimental cooking data and the cooking time; training the preset deep belief network through the first training data set comprises: inputting the first training data set into the visible layer of the first Boltzmann machine in the deep belief network, and performing forward propagation on the first training data set in the visible layer to obtain the node state of the hidden layer; starting from the node state of the hidden layer, the reconstruction activation probability of the visible layer node is calculated, and the reconstructed visible layer state is obtained by sampling; the weights and biases of the hidden layer and the reconstructed visible layer of the first restricted Boltzmann machine are updated using the contrast divergence algorithm, and the data obtained after the forward propagation is input into the second restricted Boltzmann machine in the preset deep belief network, and the weights and biases of the hidden layer and the visible layer of the plurality of restricted Boltzmann machines are updated in sequence.
[0030] It is understood that the restricted Boltzmann machine is an energy-based model composed of a visible layer and a hidden layer, with no connection between nodes within the layer and full connection between nodes between layers. The visible layer nodes correspond to respective features of the input data, such as rice variety, rice quantity, water quantity, initial rice temperature and water temperature, ambient temperature and humidity, and the hidden layer nodes are used to learn a latent feature representation of the data.
[0031] The energy function of the restricted Boltzmann machine is defined as:
[0032] where v is the visible layer node state vector, h is the hidden layer node state vector, w ij is the connection weight between the i-th node of the visible layer and the j-th node of the hidden layer, b i is the bias of the visible layer node, c j is the bias of the hidden layer node, n v and n h are the number of visible layer nodes and hidden layer nodes, respectively.
[0033] Based on the energy function, the restricted Boltzmann machine calculates the activation probability of the nodes by Gibbs sampling. The activation probability of the visible layer node i given the hidden layer is:
[0034] The activation probability of the hidden layer node j given the visible layer is:
[0035] where is the sigmoid function.
[0036] As can be seen from the above, the deep belief network is stacked by multiple restricted Boltzmann machines. The process of training the deep belief network is to train the multiple restricted Boltzmann machines layer by layer.
[0037] Suppose the deep belief network in this embodiment is composed of L restricted Boltzmann machines, denoted as RBM. RBM1, RBM2, …, RBML represent the restricted Boltzmann machines from the bottom layer to the top layer. The training process of the deep belief network in this application is described.
[0038] First, the first layer RBM (RBM1) is trained, including the following processes: ① Initialize parameters: randomly initialize the weight matrix W1 of RBM1, the visible layer bias vector b1, and the hidden layer bias vector c1. The weights are usually initialized to small random values, for example, in the range of [-0.1, 0.1].
[0039] ② Input data: the preprocessed data is input as the visible layer input v of RBM1.
[0040] ③ Forward propagation: according to the above hidden layer activation probability formula, the activation probability P(h|v) of the hidden layer node is calculated, and the state h of the hidden layer node is obtained by sampling.
[0041] (4) Reconstruct data: Starting from the hidden layer state h, the reconstruction activation probability P(v'|h) of the visible layer nodes is calculated according to the visible layer activation probability formula, and the reconstructed visible layer state v' is obtained by sampling.
[0042] In an embodiment, the calculation formula of the contrast divergence algorithm specifically comprises: ; ; ; wherein, is the updated connection weight between the i-th node in the visible layer and the j-th node in the hidden layer, b i is the updated bias of the visible layer node, c j is the updated bias of the hidden layer node, and ε is the learning rate, data represents the expectation based on the original data, recon represents the expectation based on the reconstructed data, v i and h i are the original node state vectors of the visible layer and the hidden layer, respectively, and are the node state vectors of the visible layer and the hidden layer obtained after training, respectively.
[0043] Next, the subsequent layer RBMs (RBM2, …, RBML) are trained. The training of the subsequent layers mainly takes the output of the first layer as input, and mainly includes the following processes: ① Input data transformation: the output of the hidden layer of the previous layer RBMs (such as RBMk-1) is taken as the input of the visible layer of the current layer RBMs (RBMk). This means that the features learned by the previous layer are taken as new input data for further feature extraction.
[0044] ② Repeat the training steps: for each RBM, repeat the above steps of initializing parameters, forward propagation, reconstructing data, and updating parameters until all RBMs are trained. Through layer-by-layer training, the deep belief network can automatically learn different levels of abstract features in the data, such as extracting features related to the water absorption and swelling rate of rice from the basic physical parameters of rice and water.
[0045] Through the above detailed pre-training process, the deep belief network can effectively automatically extract valuable feature representations from a large amount of different rice and water combinations and corresponding optimal cooking time data, laying a foundation for further learning and cooking time prediction of the subsequent long short-term memory network.
[0046] Step S3, taking the second training data set as an input of the preset long short-term memory network to train the long short-term memory network based on the second training data set and establish a cooking model.
[0047] It can be understood that the features extracted by the deep belief network are taken as the input of the long short-term memory network, which is good at processing time series data and can effectively capture long-term dependencies in data. In the present application, the long short-term memory network is used to further analyze the time series features in the cooking process, such as the influence of the change of pressure and temperature in the pot over time on the taste of rice, so as to more accurately predict the cooking time required to cook rice with a specific taste for different combinations of rice and water. Through training on a large amount of data, the parameters of the deep belief network and the long short-term memory network are continuously optimized, and finally a high-precision cooking model is constructed to provide reliable cooking time control support for the intelligent rice cooker.
[0048] Preferably, the node state vector of the last hidden layer of the plurality of restricted Boltzmann machines is extracted to obtain the second training data set.
[0049] That is, the features obtained by training the preset deep belief network are collected to form the second training data set, which is taken as the input of the preset long short-term memory network.
[0050] Further, the cooking data includes an optimal cooking time, and the long short-term memory network includes an LSTM layer, an input layer and a fully connected layer; the supervised training of the long short-term memory network using the second training data set converted in the complete sequence data format includes: inputting the second training data set converted in the complete sequence data format into the input layer of the long short-term memory network in chronological order, and sequentially passing through the LSTM layer and the fully connected layer of the long short-term memory network, and outputting a predicted optimal cooking time; calculating a loss value of the predicted optimal cooking time and the actual optimal cooking time by a preset loss function, and calculating a weight gradient of the preset long short-term memory network by a back propagation algorithm; based on the weight gradient, updating the weight parameters of the long short-term memory network using a preset optimizer to minimize the loss function; when the loss function after minimization processing satisfies a preset training termination condition, the long short-term memory network corresponding to the loss function is taken as a cooking model.
[0051] Here, updating the weight parameters of the long short-term memory network using a preset optimizer includes: The weight parameters are updated using the following formula: ; ; ; ; ; wherein w t denotes the weight parameter value at the t-th time, w t+1 denotes the weight parameter value at the t+1-th iteration, m t denotes the first moment estimation of the gradient, m t−1 denotes the first moment estimation at the t-1-th time, vt denotes the second moment estimation of the gradient, v t−1 denotes the second moment estimation at the t-1-th time, denotes the corrected first moment estimation, denotes the corrected second moment estimation, a denotes the learning rate, used to control the step size of the parameter update, b1 denotes the decay rate of the first moment, used to control the influence of the historical gradient on m t , b2 denotes the decay rate of the second moment, used to control the influence of the historical gradient square on v t , g t denotes the gradient calculated in the current batch, i.e. the derivative of the loss function with respect to the weight parameter w, and e is a constant used to avoid division by zero when is very small.
[0052] Specifically, the features obtained by training the deep belief network are taken as the input of the long short-term memory network, and the long short-term memory network weight parameters are adjusted through supervised training and back propagation algorithm, so as to obtain a cooking model with good performance and store it in the specific implementation process of the main control chip of the electric rice cooker as follows: First, data preparation and format adjustment are performed. The outputs of the last hidden layer are obtained from the trained deep belief network model, which are the features extracted by the deep belief network pre-training. The features are integrated with the corresponding actual best cooking time label data to form a training data set of the long short-term memory network.
[0053] Then, the sequence data format conversion is performed on the data in the training data set. Since the long short-term memory network is suitable for processing sequence data, the integrated data set needs to be converted into a sequence format suitable for the input of the long short-term memory network. The data set used for model training generally contains multiple samples. Assuming that the deep belief network pre-training feature dimension of each sample is d and the time step is T (in the cooking scenario, the time step can be set according to specific requirements, for example, the cooking process can be divided into multiple stages, and each stage is taken as a time step). The data set is arranged as a three-dimensional tensor with a shape of ((number of samples, T, d)). At the same time, the corresponding actual best cooking time label is arranged as a two-dimensional tensor with a shape of ((number of samples, 1)).
[0054] Then, the LSTM network is constructed. A typical LSTM network structure consists of one or more LSTM layers and optionally contains a fully connected layer. For example, a network can be designed to contain two LSTM layers and one fully connected layer: the first LSTM layer is configured with a large number of hidden units (e.g., 128) to capture complex patterns in the sequence data; the second LSTM layer is configured with a small number of hidden units (e.g., 64) to further refine the extracted features. The fully connected layer is used to map the features output by the LSTM layers to the final prediction, and its output dimension is 1, i.e., the predicted cooking time.
[0055] During the network construction, the weight matrices and bias vectors of the LSTM layers and the fully connected layer are automatically initialized. Typically, the weight matrices are initialized randomly, e.g., using the Xavier initialization, to ensure that the network can learn efficiently at the early stage of training.
[0056] Finally, the constructed LSTM network is supervised trained using the prepared dataset through a loss function and an optimizer.
[0057] The loss function is used to measure the error between the model's prediction and the actual optimal cooking time. In this embodiment, the Mean Squared Error (MSE) is chosen as the loss function, which is defined as:
[0058] where MSE is the loss value, n is the number of samples, yi is the actual optimal cooking time of the i-th sample, is the predicted cooking time of the i-th sample by the model.
[0059] Next, an optimizer is selected to adjust the weight parameters of the LSTM network to minimize the loss function. Common optimizers include Stochastic Gradient Descent (SGD) and its variants, such as Adagrad, Adadelta, RMSProp, and Adam. In this scenario, the Adam optimizer is chosen because it can adaptively adjust the learning rate of each parameter, and it converges faster. The hyperparameters of the Adam optimizer can be set according to experience.
[0060] The prepared dataset is input into the LSTM network in batches for training. In each batch, the data passes through the LSTM layers and the fully connected layer in order, and the model outputs the predicted cooking time. The loss between the predicted value and the actual value is calculated, and then the gradient of the loss function with respect to the network weights is calculated using the backpropagation algorithm. The optimizer updates the network's weight parameters based on the calculated gradient to reduce the loss.
[0061] The batch of deep belief network pre-training feature data is input into the long short-term memory network, and the data sequentially passes through each layer of the long short-term memory network and the full connection layer to obtain the predicted cooking time . Then, according to the mean square error loss function, the loss L between the predicted value and the actual optimal cooking time y of the batch is calculated, and the back propagation algorithm is used to calculate the gradient of the loss function to each layer of network weight in reverse. Finally, the optimizer updates the network weight parameters according to the calculated gradient according to the scheduled update rule.
[0062] Step S4, input the current cooking data of the electric rice cooker under the current cooking condition into the cooking model to obtain the cooking time control strategy of the electric rice cooker.
[0063] In this application, intelligent adjustment is made according to the conditions and food material characteristics of each specific cooking, which means that the electric rice cooker can provide personalized cooking experience for each user, dynamically optimize the time control of each cooking according to user preferences and historical cooking data. Therefore, through the deep learning method (combination of deep belief network and long short-term memory network), the obtained cooking time control strategy has the advantages of high efficiency, intelligence, accuracy and personalization. This not only improves the cooking effect of the electric rice cooker, but also improves the energy utilization rate, and ultimately brings better user experience.
[0064] In an embodiment, after inputting the current cooking data of the electric rice cooker under the current cooking condition into the cooking model to obtain the cooking time control strategy of the electric rice cooker, it further comprises: when the real cooking time set by the user is different from the optimal cooking time in the cooking time control strategy, determining the optimization loss value of the real cooking time and the optimal cooking time according to the loss function; based on the optimization loss value, calculating the weight gradient of the loss function to the long short-term memory network through the back propagation algorithm to update the cooking model.
[0065] That is, during the iterative training process, the performance of the model is evaluated using the validation set after the end of each training cycle (epoch). If the loss (such as MSE) on the validation set no longer decreases in multiple consecutive epochs, or reaches the preset maximum training epoch number, the model is considered to have converged and the training is stopped. Otherwise, continue training until the stopping condition is met. After multiple iterations of training, when the model performs well on both the validation set and the test set, the trained long short-term memory model is stored in the main control chip of the electric rice cooker.
[0066] In addition, during the training process, the model needs to be evaluated regularly to monitor the performance of the model and decide whether to continue training or adjust the hyperparameters. In addition, the original data set can also be divided into training set, validation set and test set. For example, it can be divided according to the proportion of 70%, 15%, 15%. The training set is used to train the model, the validation set is used to evaluate the model performance during the training process, and the test set is used to finally evaluate the generalization ability of the trained model. In addition to using mean square error as the loss function during the training process, other indicators can also be used to evaluate the performance of the model, such as mean absolute error (MAE), root mean squared error (RMSE), etc. MAE can intuitively reflect the average error size between the predicted value and the actual value, and RMSE is more sensitive to large errors and can better reflect the volatility of the model prediction value.
[0067] The cooking process of the electric rice cooker is described below through a specific embodiment.
[0068] First, the corresponding setting parameters input by the user are obtained. After the user puts the appropriate amount of rice and water into the inner pot of the electric rice cooker and covers the pot cover, the rice and water detection module automatically measures the amount of rice and water and transmits the data to the main control chip. The initial rice temperature and water temperature are obtained through the temperature detection module, and the environmental temperature and humidity are detected by the environmental sensor, which are transmitted together as input parameters to the cooking model.
[0069] Second, the cooking time prediction and setting are performed. The cooking model predicts the cooking time required to cook the rice with the texture (such as hard, moderate, and soft) selected by the user on the operation interface according to the input parameters, and feeds back the time information to the main control chip. The main control chip displays the predicted cooking time on the display and operation interface, and formulates a detailed cooking plan according to the time, including pressure, temperature and heating power settings at different stages.
[0070] Next, the cooking is performed according to the set parameters. The main control chip controls the pressure control module and heating device to make the pressure and temperature in the pot change according to the preset cooking plan. For example, in the warming-up stage, the pressure in the pot is quickly raised to the set value; in the pressure-maintaining stage, the pressure and temperature are maintained stable for a period of time; in the simmering stage, the pressure and temperature are appropriately reduced. At the same time, the temperature in the pot is monitored in real time by the temperature detection module and fed back to the main control chip, which adjusts the heating power according to the temperature to ensure the accuracy of the cooking process.
[0071] Finally, to better understand the user's usage preferences, the user's corresponding user preference learning after cooking rice is also needed. If the user adjusts the cooking time through the cooking time adjustment button during the cooking process or after the cooking is completed, the main control chip records the adjustment parameter and the related data of the rice, water, etc. in this cooking. In the subsequent idle time, the main control chip inputs these new data as learning samples into the cooking model, and the cooking model learns online using these samples to update the model parameters, so as to more accurately predict the cooking time that meets the user's taste for similar rice and water combinations in the future.
[0072] When learning the user's preferences, given the advantages of the Adam optimizer in handling non-stationary targets and sparse gradients, the Adam optimizer can be used in this scenario for online learning of the cooking model based on deep learning (a combination of deep belief networks and long short-term memory networks). When a new sample is received each time, the model parameters are effectively adjusted. In addition, since the cooking model has been pre-trained and supervised trained with a large amount of data in the early stage, its structure remains unchanged, but the parameters can be updated, so after receiving new user preference data, the weights and biases of the model will be fine-tuned according to the new samples.
[0073] The following describes the specific implementation of the process of the electric rice cooker learning the user's preferences in the cooking model through a specific embodiment.
[0074] When the user adjusts the cooking time through the cooking time adjustment button, the main control chip immediately captures this operation. At the same time, the main control chip obtains the related data of this cooking from various sensors of the electric rice cooker (such as the rice and water detection module, the temperature detection module, etc.), including the type of rice, the amount of rice, the amount of water, the initial rice and water temperature, the ambient temperature and humidity, and the user-adjusted cooking time.
[0075] Next, the main control chip organizes the captured data into a format suitable for input into the cooking model. For example, the type of rice is encoded (such as using one-hot encoding to represent different types of rice as a vector), and other numerical data (such as the amount of rice, the amount of water, etc.) is normalized to the same scale range, usually [0, 1], to finally form a sample data point containing all related features and target cooking time.
[0076] During the idle period of the electric rice cooker (for example, the gap between two cookings, and the system confirms that there is no other important task to be performed at present), the main control chip inputs the organized new sample data into the cooking model. For a model constructed based on deep belief networks and long short-term memory networks, the new sample first passes through the deep belief network part to extract features from the input data and generate new feature representations.
[0077] Then, according to the features extracted from the deep belief network, or directly using the sorted input data, which is then sent to the long short-term memory network for forward propagation. The data passes through the LSTM layer and the fully connected layer in sequence, and finally the predicted cooking time is output by the model. Then, the model predicted cooking time is compared with the user's actual adjusted cooking time (as the target value of the new sample), and the loss function (such as mean square error MSE) consistent with the previous training is used to calculate the error between the predicted value and the target value, to evaluate the prediction performance of the model.
[0078] Based on the calculated loss, the gradients of the loss function with respect to the weights and biases of each layer of the model are calculated by the backpropagation algorithm. Taking the Adam optimizer as an example, the first moment estimate mt and the second moment estimate vt are calculated according to the gradient, and the bias correction is performed to obtain and Then, the weights and biases of the model are updated according to the update formula of the Adam optimizer, so that the model can more accurately predict the cooking time that meets the user's taste when it encounters similar rice and water combinations next time.
[0079] In addition, in order to ensure the performance of the model in learning the user's preferences, the updated model will be evaluated regularly. Evaluation can be performed immediately after each model update, or after a certain number of update operations are completed. During evaluation, a portion of historical data (excluding new samples used for model updating) is used as an evaluation dataset, and these data are input into the model to calculate the loss (such as MSE, MAE, etc.) and other evaluation indicators (such as RMSE) of the model on this dataset, to comprehensively measure the performance of the model.
[0080] The host chip will continuously monitor the evaluation indicators of the model and track its performance changes. If it is found that the performance of the model has decreased significantly after updating (for example, the loss value has increased significantly), it may indicate that there is abnormal data in the new sample or there is a problem in the model updating process. In this case, the host chip will take appropriate measures, such as ignoring this update, or re-executing the update operation after further checking and processing the new sample, to ensure the stability and prediction accuracy of the model.
[0081] In summary, through the deep learning-based electric rice cooker cooking time control method and electric rice cooker provided by the present application, the following technical effects can be achieved: ① Precise cooking: through the deep learning-based cooking model, the influence of various factors such as rice and water on cooking time can be fully considered, and the cooking time can be accurately controlled to cook rice suitable for different user tastes and improve the cooking quality of rice.
[0082] ②Personalized learning: The cooking time adjustment button combined with the online learning function of the cooking model enables the electric rice cooker to automatically learn the user's taste preference, continuously optimize the cooking scheme, and increasingly meet the user's personalized needs with the increase of the number of uses.
[0083] ③Intelligent control: The pressure type electric rice cooker cooperates with the deep learning model to realize intelligent control of the cooking process, reduce user manual intervention, and improve user convenience.
[0084] Figure 2 is a structural schematic diagram of an electronic device according to an embodiment of the present application. Please refer to Figure 2 At the hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The memory can include a memory such as a random-access memory (RAM), and can also include a non-volatile memory such as at least one disk memory. Of course, the electronic device can also include other hardware required by the business.
[0085] The processor, network interface, and memory can be connected to each other through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 2 only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or only one type of bus.
[0086] The memory is used to store programs. Specifically, the program can include program code including computer operation instructions. The memory can include a memory and a non-volatile memory, and provide instructions and data to the processor.
[0087] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs, and forms a data processing apparatus at the logical level. The processor executes the program stored in the memory, and is specifically used to execute the deep learning-based electric rice cooker cooking time control method provided by the present embodiment.
[0088] The electronic device can also execute Figure 1 the method shown in the figure, and realize the deep learning-based electric rice cooker cooking time control apparatus in Figure 1The functions of the embodiments shown, the embodiments of the present application are not described here.
[0089] Of course, in addition to the software implementation, the electronic device of the present application does not exclude other implementation manners, such as logic devices or software and hardware combined manner, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but also can be hardware or logic device.
[0090] In any event, the above-described embodiments are merely desirable embodiments of the present application, and are not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0091] The system, device, module or unit illustrated in the above embodiments can be specifically implemented by a computer chip or entity, or by a product with certain functions. A typical implementation device is a computer. Specifically, the computer may, for example, be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0092] The computer readable medium includes permanent and non-permanent, removable and non-removable media, which can be implemented by any method or technology to store information. The information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape disk storage or other magnetic storage device, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition herein, computer readable medium does not include transitory medium, such as modulated data signal and carrier wave.
[0093] It is also to be noted that the terms "comprising", "including", and any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a... " does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the recited element.
[0094] The various embodiments described in this specification are presented as examples. Each example is provided by way of explanation of the overall subject matter and is not a limitation on the overall subject matter. Changes in, or replacements to, parts of certain embodiments described in this specification are within the scope of the overall subject matter. Changes in, or replacements to, parts of certain embodiments described in this specification are within the scope of the overall subject matter. Changes in, or replacements to, parts of certain embodiments described in this specification are within the scope of the overall subject matter. Changes in, or replacements to, parts of certain embodiments described in this specification are within the scope of the overall subject matter. Changes in, or replacements to, parts of certain embodiments described in this specification are within the scope of the overall subject matter.
Claims
1. A method for controlling the cooking time of a rice cooker based on deep learning, characterized in that, include: The first training dataset was constructed based on experimental cooking data from rice cookers under different cooking conditions; The preset deep belief network is trained using the first training dataset, and features are extracted from the complex nonlinear relationship between the experimental cooking data and cooking time in the first training dataset based on the deep belief network to obtain the second training dataset. The second training dataset is used as input to a preset long short-term memory network to train the long short-term memory network and establish a cooking model based on the second training dataset. The current cooking data of the rice cooker under the current cooking conditions is input into the cooking model to obtain the cooking time control strategy of the rice cooker.
2. The method according to claim 1, characterized in that, The deep belief network comprises multiple restricted Boltzmann machines, each of which includes a visible layer and a hidden layer. The nodes of the visible layer include various features of the experimental cooking data, which includes rice variety, rice quantity, water quantity, initial rice temperature and water temperature, ambient temperature and humidity. The nodes of the hidden layer are used to learn the latent feature representation of the complex nonlinear relationship between the experimental cooking data and cooking time. The step of training a preset deep belief network using the first training dataset includes: The first training dataset is input into the visible layer of the first Boltzmann machine in the deep belief network, and the first training dataset is forward propagated in the visible layer to obtain the node states of the hidden layer. Starting from the node state of the hidden layer, calculate the reconstruction activation probability of the visible layer node, and obtain the reconstructed visible layer state by sampling; The weights and biases of the hidden layer and the reconstructed visible layer of the first restricted Boltzmann machine are updated using the contrastive divergence algorithm. The data obtained after the forward propagation is then input into the second restricted Boltzmann machine in the deep belief network, and the weights and biases of the hidden layer and the visible layer of the restricted Boltzmann machine are updated sequentially.
3. The method according to claim 2, characterized in that, The calculation formula for the contrastive divergence algorithm specifically includes: ; ; ; in, It is the connection weight between the i-th node in the updated visible layer and the j-th node in the hidden layer. b i It is the offset of the updated view layer nodes. c j The bias of the updated hidden layer nodes is ϵ, where ϵ is the learning rate, data represents the expectation based on the original data, recon represents the expectation based on the reconstructed data, and v is the learning rate. i and h i These are the original node state vectors of the visible layer and the original node state vectors of the hidden layer, respectively. and These are the visible layer node state vectors and hidden layer node state vectors obtained after training, respectively.
4. The method according to claim 2 or 3, characterized in that, Also includes: Extract the node state vectors of the last hidden layer of the multiple restricted Boltzmann machines to obtain the second training dataset.
5. The method according to claim 4, characterized in that, The step of inputting the second training dataset into the Long Short-Term Memory (LSTM) network to train the LTM network based on the second training dataset includes: The second training dataset is converted into sequence data format according to a preset dimension; The Long Short-Term Memory network was trained in a supervised manner using a second training dataset that had undergone sequence data format conversion.
6. The method according to claim 5, characterized in that, The cooking data includes optimal cooking time, and the Long Short-Term Memory (LSTM) network includes LSTM layers, an input layer, and fully connected layers; the supervised training of the LSM network using a second training dataset with completed sequence data format conversion includes: The second training dataset, after the sequence data format conversion is completed, is input into the input layer of the Long Short-Term Memory Network in sequence, and then passes through the LSTM layer and fully connected layer of the Long Short-Term Memory Network in sequence, and outputs the predicted optimal cooking time. The loss value between the predicted optimal cooking time and the actual optimal cooking time is calculated using a preset loss function, and the weight gradient of the loss function on the long short-term memory network is calculated using a backpropagation algorithm. Based on the weight gradient, the weight parameters of the long short-term memory network are updated using a preset optimizer to minimize the loss function; When the loss function after minimization meets the preset training termination condition, the long short-term memory network corresponding to the loss function is used as the cooking model.
7. The method according to claim 6, characterized in that, The step of updating the weight parameters of the Long Short-Term Memory network using a preset optimizer includes: The weight parameters are updated using the following formula: ; ; ; ; ; Among them, w t w represents the weight parameter value at the t-th iteration. t+1 This represents the weight parameter value at the (t+1)th iteration, m. t m represents the first moment estimate of the gradient. t−1 Let vt represent the first-order moment estimate of the gradient at the (t-1)th time step, and vt represent the second-order moment estimate of the gradient. t−1 This represents the second-order moment estimate of the (t-1)th time. This represents the corrected first-order moment estimate. The diagram shows the corrected second-order moment estimate, where α represents the learning rate, used to control the step size of parameter updates, and β1 represents the decay rate of the first-order moment, used to control the historical gradient on m. t The effect of β2, representing the decay rate of the second moment, is used to control the effect of the squared historical gradient on v. t The influence of g t This represents the gradient calculated for the current batch, i.e., the loss function with respect to the weight parameters w, where ϵ is a constant, used to avoid errors in the weight parameters w. When the value is very small, division by zero occurs.
8. The method according to claim 6, characterized in that, After inputting the current cooking data of the rice cooker under the current cooking conditions into the cooking model to obtain the cooking time control strategy of the rice cooker, the method further includes: When the actual cooking time set by the user differs from the optimal cooking time in the cooking time control strategy, the optimization loss value between the actual cooking time and the optimal cooking time is determined according to the loss function. Based on the optimized loss value, the weight gradient of the loss function with respect to the long short-term memory network is calculated using the backpropagation algorithm to update the cooking model.
9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the steps of the deep learning-based rice cooker cooking time control method as described in any one of claims 1 to 8.
10. An electric rice cooker, characterized in that, Including the electronic device as described in claim 9.