Training method of temperature field mathematical model
1. A training method of a temperature field mathematical model is characterized in that a first temperature sensor and a second temperature sensor are respectively arranged on the inner wall of an inner container at intervals and are respectively and electrically connected with a controller so as to respectively detect the temperatures of an A position and a B position of the inner container, and the control method of the cooking equipment comprises the following steps:
respectively detecting the temperatures of the inner container A and the inner container B to obtain a first temperature value X1 and a second temperature value X2, and then carrying out sample normalization processing on the first temperature value X1 and the second temperature value X2;
constructing a mathematical model comprising an input layer, a hidden layer and an output layer;
acquiring training samples in a training sample library to train the mathematical model, and calculating and processing a first temperature value X1 and a second temperature value X2 through the constructed mathematical model;
calculating the parameters of the mathematical model to obtain the partial derivatives corresponding to each parameter
Calculating through a calculation formula to obtain an objective function value E;
calculating through a calculation formula to obtain a target function mean value H after the training samples in the training sample library are obtained;
and determining to finish the training work of the mathematical model by judging whether the target function mean value H meets a preset training condition.
2. The method for training the mathematical model of temperature field according to claim 1, wherein the step of performing calculation processing on the first temperature value X1 and the second temperature value X2 by the constructed mathematical model comprises:
ω 11x1+ ω 12x2+ b1 ═ a1, and z1 ═ Φ (a1) after the introduction of the nonlinear function,
ω 21x1+ ω 22x2+ b2 ═ a2, and z2 ═ Φ (a2) after the introduction of the nonlinear function,
and (3) performing calculation processing on z1 and z2 through the constructed mathematical model:
ω1z1+ω2z2+b=y,
wherein ω is a weighted weight coefficient of the mathematical model hidden layer, x1 is a first temperature value, x2 is a second temperature value, b is a preset threshold value of the mathematical model hidden layer, a is an unknown value corresponding to each temperature value, z is boundary information corresponding to each temperature value, Φ is a sigmoid function, and y is an actual cooking degree value;
the expression of the sigmoid function phi is as follows:
φ(x)=1/(1+e-x),
then the expression for the derivative of phi is:
Φ’(x)=φ(x)[1-φ(x)];
wherein phi is a sigmoid function, and e is a set value.
3. A method for training a mathematical model of a temperature field according to claim 2, wherein the parameters of the mathematical model are calculated to obtain the partial derivatives corresponding to each parameterComprises the following steps:
wherein saidThe temperature is a partial derivative, Y is an actual cooking degree value, Y is a preset cooking degree value, phi is a sigmoid function, x1 is a first temperature value, and x2 is a second temperature value.
4. A training method of a mathematical model of temperature field according to claim 3, wherein the objective function value E is obtained by the following calculation formula:
E=(y-Y)2a/2, wherein E is an objective function value, Y is an actual cooking degree value, and Y is a preset cooking degree value;
the target function mean value H is obtained by the following calculation formula:
H/N, wherein H is an objective function mean, E is an objective function value, and N is the number of training samples in the training sample library.
5. The method for training the temperature field mathematical model according to claim 4, wherein the step of deciding to end the training of the mathematical model by determining whether the objective function mean value H satisfies a preset training condition comprises:
judging whether the target function mean value H meets a preset training condition or not;
if so, finishing the training work of the mathematical model;
and if not, determining to correct the parameters of the mathematical model, and training the corrected mathematical model again.
6. The method for training the mathematical model of temperature field according to claim 5, wherein the predetermined training condition is whether the objective function mean value H is smaller than a predetermined training coefficient K, and the training coefficient K is greater than 0 and smaller than 0.1.
7. A training method of a temperature field mathematical model according to claim 5, wherein the step of deciding to modify the parameters of the mathematical model comprises:
the parameters of the mathematical model comprise a weighting coefficient omega of the mathematical model hidden layer and a preset threshold b of the mathematical model hidden layer;
calculating according to the parameters of the current training of the mathematical model to obtain the parameters of the next training of the mathematical model, and correcting the parameters of the current training of the mathematical model into the calculated parameters of the next training of the mathematical model;
the parameters of the next training of the mathematical model are obtained by the following calculation formula:
wherein, ω (after) is the weighting coefficient of the next training of the mathematical model, ω (before) is the weighting coefficient of the current training of the mathematical model, and a is the learning rate,is a partial derivative;
wherein b (after) is a preset threshold value of the next training of the mathematical model, b (before) is a preset threshold value of the current training of the mathematical model, and a is a learning rate,is the partial derivative.
8. The method for training the mathematical model of temperature field according to any one of claims 1 to 7, wherein the step after finishing the training of the mathematical model comprises:
obtaining a verification sample in a verification sample library to verify the mathematical model, and calculating through a calculation formula to obtain an actual cooking degree value;
and after the verification samples in the verification sample library are obtained, comparing the actual cooking degree value corresponding to each verification sample with a preset verification condition, and determining whether to finish the verification work of the mathematical model according to a comparison result.
9. The method for training the mathematical model of temperature field according to claim 8, wherein the step of determining whether to end the verification of the mathematical model according to the comparison result by comparing the actual cooking degree value corresponding to each verification sample with a preset verification condition comprises:
judging whether the actual cooking degree value corresponding to each verification sample meets a preset verification condition or not;
if yes, finishing the verification work of the mathematical model;
if not, returning to continuously obtain the training samples in the training sample library to train the mathematical model again.
10. The method for training the temperature field mathematical model according to claim 9, wherein the preset verification condition is whether an absolute value of a difference between an actual cooking degree value Y corresponding to each verification sample and a preset cooking degree value Y is less than or equal to 10% of the preset cooking degree value Y;
the actual cooking degree value is obtained by the following calculation formula: and y is ω 1z1+ ω 2z2+ b, wherein y is an actual cooking degree value, ω is a weighted weight coefficient of the hidden layer of the mathematical model, b is a preset threshold value, and z is boundary information corresponding to each temperature value.
Background
In the related art, most of the inner cavities of the steaming ovens are usually provided with ntc type temperature sensors for sensing the temperature change of the inner cavities, so that the controller takes corresponding temperature control measures according to the temperature change. For cost, ntc temperature sensors are not suitable to be too many, and one temperature sensor is mostly used, but the problem is that only the temperature of a certain point of the inner cavity can be detected, and the change situation of the whole temperature field of the inner cavity cannot be reflected. The two temperature sensors can detect the temperatures of two points of the inner cavity, but the temperature field condition of the steam oven is the comprehensive performance of the inner cavity and is not in a strict linear relation with the temperature values of the two points, so the two temperature sensors are required to detect the temperatures of the two points and simulate the temperatures into a nonlinear mathematical model, and the model is trained according to a sample, so that the model has the capability of distinguishing the temperature field performance and controls the heating pipe combination to start and stop.
Disclosure of Invention
The invention aims to solve one of the problems in the prior related art at least to a certain extent, and therefore, the invention provides a training method of a temperature field mathematical model, which is simple and feasible, can effectively solve the problem that the change condition of the whole temperature field cannot be accurately detected in an inner container, and can also intelligently judge the current cooking stage of food.
The above purpose is realized by the following technical scheme:
a training method of a temperature field mathematical model is characterized in that the cooking equipment is provided with an inner container, a first temperature sensor and a second temperature sensor are respectively arranged on the inner wall of the inner container at intervals, the first temperature sensor and the second temperature sensor are respectively and electrically connected with a controller so as to respectively detect the temperature of the inner container at the A position and the B position, and the control method of the cooking equipment comprises the following steps:
respectively detecting the temperatures of the inner container A and the inner container B to obtain a first temperature value X1 and a second temperature value X2, and then carrying out sample normalization processing on the first temperature value X1 and the second temperature value X2;
constructing a mathematical model comprising an input layer, a hidden layer and an output layer;
acquiring training samples in a training sample library to train the mathematical model, and calculating and processing a first temperature value X1 and a second temperature value X2 through the constructed mathematical model;
calculating the parameters of the mathematical model to obtain the partial derivatives corresponding to each parameter
Calculating through a calculation formula to obtain an objective function value E;
calculating through a calculation formula to obtain a target function mean value H after the training samples in the training sample library are obtained;
and determining to finish the training work of the mathematical model by judging whether the target function mean value H meets a preset training condition.
In some embodiments, the step of computationally processing the first temperature value X1 and the second temperature value X2 through the constructed mathematical model comprises:
ω 11x1+ ω 12x2+ b1 ═ a1, and z1 ═ Φ (a1) after the introduction of the nonlinear function,
ω 21x1+ ω 22x2+ b2 ═ a2, and z2 ═ Φ (a2) after the introduction of the nonlinear function,
and (3) performing calculation processing on z1 and z2 through the constructed mathematical model:
ω1z1+ω2z2+b=y,
wherein ω is a weighted weight coefficient of the mathematical model hidden layer, x1 is a first temperature value, x2 is a second temperature value, b is a preset threshold value of the mathematical model hidden layer, a is an unknown value corresponding to each temperature value, z is boundary information corresponding to each temperature value, Φ is a sigmoid function, and y is an actual cooking degree value;
the expression of the sigmoid function phi is as follows:
φ(x)=1/(1+e-x),
then the expression for the derivative of phi is:
Φ’(x)=φ(x)[1-φ(x)];
wherein phi is a sigmoid function, and e is a set value.
In some embodiments, the calculating of the parameters of the mathematical model is performed to obtainPartial derivatives corresponding to each parameterComprises the following steps:
wherein saidThe temperature is a partial derivative, Y is an actual cooking degree value, Y is a preset cooking degree value, phi is a sigmoid function, x1 is a first temperature value, and x2 is a second temperature value.
In some embodiments, the objective function value E is obtained by the following calculation formula:
E=(y-Y)2and/2, wherein E is an objective function value, Y is an actual cooking degree value, and Y is a preset cooking degree value.
In some embodiments, the objective function mean H is obtained by the following calculation formula:
H/N, wherein H is an objective function mean, E is an objective function value, and N is the number of training samples in the training sample library.
In some embodiments, the step of deciding to end the training of the mathematical model by determining whether the objective function mean H satisfies a preset training condition includes:
judging whether the target function mean value H meets a preset training condition or not;
if so, finishing the training work of the mathematical model;
and if not, determining to correct the parameters of the mathematical model, and training the corrected mathematical model again.
In some embodiments, the preset training condition is whether the objective function mean H is smaller than a preset training coefficient K, where the training coefficient K is greater than 0 and smaller than 0.1.
In some embodiments, the step of determining a correction to a parameter of the mathematical model comprises:
the parameters of the mathematical model comprise a weighting coefficient omega of the mathematical model hidden layer and a preset threshold b of the mathematical model hidden layer;
calculating according to the parameters of the current training of the mathematical model to obtain the parameters of the next training of the mathematical model, and correcting the parameters of the current training of the mathematical model into the calculated parameters of the next training of the mathematical model;
the parameters of the next training of the mathematical model are obtained by the following calculation formula:
wherein, ω (after) is the weighting coefficient of the next training of the mathematical model, ω (before) is the weighting coefficient of the current training of the mathematical model, and a is the learning rate,is a partial derivative;
wherein b (after) is a preset threshold value of the next training of the mathematical model, b (before) is a preset threshold value of the current training of the mathematical model, and a is a learning rate,is the partial derivative.
In some embodiments, the step of ending the training of the mathematical model comprises:
obtaining a verification sample in a verification sample library to verify the mathematical model, and calculating through a calculation formula to obtain an actual cooking degree value;
and after the verification samples in the verification sample library are obtained, comparing the actual cooking degree value corresponding to each verification sample with a preset verification condition, and determining whether to finish the verification work of the mathematical model according to a comparison result.
In some embodiments, the step of determining whether to end the verification of the mathematical model according to the comparison result by comparing the actual cooking degree value corresponding to each verification sample with a preset verification condition includes:
judging whether the actual cooking degree value corresponding to each verification sample meets a preset verification condition or not;
if yes, finishing the verification work of the mathematical model;
if not, returning to continuously obtain the training samples in the training sample library to train the mathematical model again.
In some embodiments, the preset verification condition is whether an absolute value of a difference between an actual cooking degree value Y and a preset cooking degree value Y corresponding to each verification sample is less than or equal to 10% of the preset cooking degree value Y;
the actual cooking degree value is obtained by the following calculation formula: and y is ω 1z1+ ω 2z2+ b, wherein y is an actual cooking degree value, ω is a weighted weight coefficient of the hidden layer of the mathematical model, b is a preset threshold value, and z is boundary information corresponding to each temperature value.
Compared with the prior art, the invention at least comprises the following beneficial effects:
1. the training method of the temperature field mathematical model is simple and feasible, can effectively solve the problem that the change condition of the whole temperature field cannot be accurately detected in the liner, and can intelligently judge the current cooking stage of food.
Drawings
Fig. 1 is a flowchart illustrating a control method of a cooking apparatus according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of an inner container in an embodiment of the present invention;
FIG. 3 is a schematic diagram of a temperature field decision surface in an embodiment of the present invention;
FIG. 4 is a graph of a sigmoid function in an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, shall fall within the scope of the claims of the present invention.
As shown in fig. 1 to 4, the present embodiment provides a training method for a temperature field mathematical model, which converts the temperature field sensing problem into a non-linear mathematical model capable of quantitative calculation by detecting temperature values at two arbitrary positions in the inner container of the cooking device, and the mathematical model adapts to different inner container structures by a sample training method, the training work of the mathematical model is determined to be finished by judging whether the average value of the target function meets the preset training condition, so that the current cooking stage of the food can be accurately distinguished, further facilitating the optimization iteration of subsequent control software, so that the heating state of the heating device can be determined and adjusted according to the deduced current cooking condition, the method is simple and feasible, can effectively solve the problem that the change condition of the whole temperature field cannot be accurately detected in the liner, and can intelligently judge the current cooking stage of food.
In this embodiment, the cooking apparatus has an inner container, and the inner wall of the inner container is respectively provided with a first temperature sensor and a second temperature sensor at intervals, preferably, the first temperature sensor is located at the upper end position of the inner wall of the inner container and the second temperature sensor is located at the lower end position of the inner wall of the inner container, the first temperature sensor and the second temperature sensor are respectively electrically connected with the controller, the temperature at the liner a can be detected by the first temperature sensor to obtain a first temperature value X1, meanwhile, the temperature of the liner B is detected by a second temperature sensor to obtain a second temperature value X2, namely, the temperature of the upper end and the lower end of the inner wall of the inner container is respectively detected by a first temperature sensor and a second temperature sensor, in addition, the heating device is arranged in the inner container and electrically connected with the controller, and the heating device heats food materials to cook. In this embodiment, the temperature sensor is preferably an NTC temperature sensor, and certainly, other more suitable temperature detection devices may be selected according to actual requirements, and in addition, the cooking device in this embodiment is a steam box, an oven, a steam oven, a micro-steam box, a micro-steam oven, or a steam-and-bake all-in-one machine, but not limited to the above device, and of course, other more suitable steam cooking devices may also be selected, and the cooking device in this embodiment is described by way of example of a steam oven, and the rest will not be described again.
In this embodiment, the method for controlling the cooking apparatus specifically includes the following steps:
step S101, after the temperatures of the inner container A and the inner container B are respectively detected to obtain a first temperature value X1 and a second temperature value X2, sample normalization processing is carried out on the first temperature value X1 and the second temperature value X2.
In the embodiment, the first temperature sensor is started to detect the temperature at the liner a to obtain the first temperature value X1, and the second temperature sensor is started to detect the temperature at the liner B to obtain the second temperature value X2. In addition, the input sample first temperature value X1 and second temperature value X2 need to be constrained between the range of 0 ℃ to 200 ℃, for example, the first temperature value X1 is 100 ℃, after the sample is normalized: 100/200 ═ 0.5; the second temperature value X2 is 105 ℃, then after sample normalization: 105/200-0.525.
Step S102, a mathematical model comprising an input layer, a hidden layer and an output layer is constructed.
In this embodiment, the temperature field inside the liner is simulated by constructing a mathematical model, which includes an input layer, a hidden layer, and an output layer.
Step S103, obtaining training samples in the training sample library to train a mathematical model, and calculating and processing the first temperature value X1 and the second temperature value X2 through the constructed mathematical model.
In this embodiment, a mathematical model is used to simulate a temperature field inside the liner, a first temperature value X1 and a second temperature value X2 are respectively input into an input layer of the mathematical model, and are calculated by adding a weight coefficient ω and a threshold b to a hidden layer, and then are output to an output layer of the mathematical model, an output value y is calculated, y represents the probability that food cooking reaches a certain stage, that is, y is an actual cooking level value, and the whole mathematical model is expressed by the following expression:
ω 11x1+ ω 12x2+ b1 ═ a1, and z1 ═ Φ (a1) after the introduction of the nonlinear function,
ω 21x1+ ω 22x2+ b2 ═ a2, and z2 ═ Φ (a2) after the introduction of the nonlinear function,
and (3) performing calculation processing on z1 and z2 through the constructed mathematical model:
ω1z1+ω2z2+b=y,
wherein ω is a weighted weight coefficient of the mathematical model hidden layer, x1 is a first temperature value, x2 is a second temperature value, b is a preset threshold value of the mathematical model hidden layer, a is an unknown value corresponding to each temperature value, z is boundary information corresponding to each temperature value, φ is a sigmoid function, and y is an actual cooking degree value;
the activation function adopts a sigmoid function, the curve of which is shown in FIG. 4, and the expression of the sigmoid function phi is as follows:
φ(x)=1/(1+e-x),
then the expression for the derivative of phi is:
Φ’(x)=φ(x)[1-φ(x)];
wherein phi is sigmoid function, and e is set value.
In this embodiment, the relationship between Y and Y is specifically that Y is an actual cooking degree value calculated by the mathematical model, Y is a preset cooking degree value, that is, a cooking degree value preset by a user according to an actual required cooking state during cooking, Y is 1 when food is just cooked, and Y is not cooked when food is not cooked<1, when the food is overcooked Y>1, therefore, by setting the objective function value E, E ═ Y (Y-Y)2And/2, wherein E is an objective function value, Y is an actual cooking degree value, and Y is a preset cooking degree value, and the objective function value E is used for considering the deviation condition of the mathematical model calculation value and the training sample.
Step S103, calculating the parameters of the mathematical model to obtain the partial derivatives corresponding to each parameter
In the present embodiment, the partial derivative corresponding to each parameterThe expression (c) is specifically:
whereinIs a partial derivative, Y is an actual cooking degree value, Y is a preset cooking degree value, phi is a sigmoid function, x1 is a first temperature value, and x2 is a second temperature value.
And step S104, calculating through a calculation formula to obtain an objective function value E.
And step S105, calculating through a calculation formula to obtain the target function mean value H after the training samples in the training sample library are obtained.
In this embodiment, it is determined whether the training samples in the training sample library are completely obtained, that is, the training samples in the training sample library respectively train the mathematical model, if the training samples in the training sample library are completely obtained, the target function mean value H is obtained by calculating through a calculation formula, and if the training samples in the training sample library are not completely obtained, the method returns to continuously obtain the training samples in the training sample library to train the mathematical model.
Step S106, judging whether the target function mean value H meets a preset training condition;
if yes, finishing the training work of the mathematical model;
if not, determining to correct the parameters of the mathematical model, and training the corrected mathematical model again.
In this embodiment, the partial derivatives are used for the purpose of: the key of the mathematical model is the determination of parameters ω 11, ω 12, ω 21, ω 22, ω 1, ω 2, b1, b2, b, which relates to the final discrimination capability of the mathematical model, the parameters of the mathematical model can be gradually approximated to optimal values by using partial derivatives, and the parameters in the initial training of the mathematical model are not constant, so that the parameter values need to be selected randomly, preferably, the parameters ω 11 ═ ω 12 ═ ω 21 ═ ω 22 ═ ω 1 ═ ω 2 ═ b1 ═ b2 ═ b ═ 0.5 can be predefined, the actual cooking degree value Y and the values of the partial derivatives can be obtained by combining the parameters with the first temperature value x1 and the second temperature value x2, and the calculated actual cooking degree value Y is substituted into the formula E ═ Y2The objective function value E can be obtained, and the calculated partial derivative is substituted into the calculation formula of the next training parameter of the following mathematical model, so that the parameters omega (after) and b (after) for the next training can be obtained.
In this embodiment, the step of determining to modify the parameters of the mathematical model includes:
the parameters of the mathematical model comprise a weighting coefficient omega of the hidden layer of the mathematical model and a preset threshold b of the hidden layer of the mathematical model;
calculating according to the parameters of the current training of the mathematical model to obtain the parameters of the next training of the mathematical model, and correcting the parameters of the current training of the mathematical model into the calculated parameters of the next training of the mathematical model;
the parameters of the next training of the mathematical model are obtained by the following calculation formula:
wherein, omega (back) is the weighting coefficient of the next training of the mathematical model, omega (front) is the weighting coefficient of the current training of the mathematical model, a is the learning rate,is a partial derivative;
wherein b (back) is the preset threshold value of the next training of the mathematical model, b (front) is the preset threshold value of the current training of the mathematical model, a is the learning rate,is the partial derivative. In the present embodiment, a is preferably a number greater than 0, that is, the model parameters are updated each time at a learning rate of a.
In the present embodiment, the partial derivatives corresponding to each parameter are determinedSubstituting the parameters of the current training of the mathematical model to obtain the parameters of the next training of the mathematical model, which specifically comprises the following steps:
in this embodiment, the preset training condition is preferably set to be the preset training condition whether the objective function mean H is smaller than the preset training coefficient K, the training coefficient K being greater than 0 and smaller than 0.1, and when the objective function mean H becomes the minimum, the parameters ω 11, ω 12, ω 21, ω 22, ω 1, ω 2, b1, b2, b of the mathematical model can be determined. In addition, E is calculated by substituting the same batch of parameters ω 11, ω 12, ω 21, ω 22, ω 1, ω 2, b1, b2, b and different training samples x1, x2, Y into the mathematical model, and if there are n training samples, n values of E can be calculated, and finally, the objective function mean H ═ E/n can be calculated.
And step S107, acquiring a verification sample in the verification sample library to verify the mathematical model, and calculating through a calculation formula to obtain an actual cooking degree value.
Step S108, after the verification samples in the verification sample library are obtained, whether the actual cooking degree value corresponding to each verification sample meets the preset verification condition is judged;
if yes, finishing the verification work of the mathematical model;
if not, returning to continuously obtain the training samples in the training sample library to train the mathematical model again.
In this embodiment, it is determined whether the verification samples in the verification sample library are completely acquired, that is, the verification samples in the verification sample library respectively perform verification work on the mathematical model, if the verification samples in the verification sample library are completely acquired, the actual cooking degree value corresponding to each verification sample is counted, the actual cooking degree value corresponding to each verification sample is compared with the preset verification condition, and if the verification samples in the verification sample library are not completely acquired, the step of returning to continuously acquiring the verification samples in the verification sample library to perform verification on the mathematical model is performed. In addition, after the model training is finished, a verification sample can be input to verify the parameters of the mathematical model, the discrimination capability of the mathematical model is verified, the corresponding actual cooking degree value is obtained by calculating the first temperature value x1 and the second temperature value x2, and then whether the calculated data meet the preset verification condition or not is judged to decide to end the verification work of the mathematical model. In this embodiment, the preset verification condition is preferably set to determine whether the absolute value of the difference between the actual cooking degree value Y corresponding to each verification sample and the preset cooking degree value Y is less than or equal to 10% of the preset cooking degree value Y, that is, whether the actual cooking degree value Y corresponding to each verification sample is near the preset cooking degree value Y, so that the degree of fitting between the actual cooking degree value Y corresponding to each verification sample and the preset cooking degree value Y is higher, which indicates that the mathematical model and the training method are valid, and if the preset cooking degree value Y when the user presets that the food is just cooked is set to 1, it is determined whether the absolute value of the difference between the actual cooking degree value Y corresponding to each verification sample and the preset cooking degree value Y meets the condition that the absolute value is greater than or equal to 0.9 and less than or equal to 1.1.
What has been described above are merely some embodiments of the present invention. It will be apparent to those skilled in the art that various changes and modifications can be made without departing from the inventive concept thereof, and these changes and modifications can be made without departing from the spirit and scope of the invention.