CN111564201A - Particle swarm optimization-based intelligent prediction method and device for children diet - Google Patents
Particle swarm optimization-based intelligent prediction method and device for children diet Download PDFInfo
- Publication number
- CN111564201A CN111564201A CN202010383367.1A CN202010383367A CN111564201A CN 111564201 A CN111564201 A CN 111564201A CN 202010383367 A CN202010383367 A CN 202010383367A CN 111564201 A CN111564201 A CN 111564201A
- Authority
- CN
- China
- Prior art keywords
- child
- data
- hidden feature
- children
- swarm optimization
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 239000002245 particle Substances 0.000 title claims abstract description 128
- 238000005457 optimization Methods 0.000 title claims abstract description 63
- 238000000034 method Methods 0.000 title claims abstract description 47
- 230000037213 diet Effects 0.000 title claims abstract description 36
- 235000005911 diet Nutrition 0.000 title claims abstract description 36
- 239000011159 matrix material Substances 0.000 claims abstract description 83
- 239000000463 material Substances 0.000 claims abstract description 81
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 48
- 230000008569 process Effects 0.000 claims abstract description 25
- 238000012549 training Methods 0.000 claims abstract description 25
- 238000013500 data storage Methods 0.000 claims abstract description 20
- 230000003044 adaptive effect Effects 0.000 claims abstract description 17
- 230000006870 function Effects 0.000 claims description 33
- 230000006399 behavior Effects 0.000 claims description 5
- 238000012795 verification Methods 0.000 claims description 5
- 238000011156 evaluation Methods 0.000 claims description 4
- 238000004458 analytical method Methods 0.000 abstract description 8
- 235000016709 nutrition Nutrition 0.000 abstract description 6
- 235000006694 eating habits Nutrition 0.000 abstract description 4
- 238000012545 processing Methods 0.000 abstract description 3
- 235000020803 food preference Nutrition 0.000 abstract 1
- 230000035764 nutrition Effects 0.000 abstract 1
- 238000004364 calculation method Methods 0.000 description 4
- 238000011161 development Methods 0.000 description 4
- 230000001133 acceleration Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000001149 cognitive effect Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000000977 initiatory effect Effects 0.000 description 2
- OAICVXFJPJFONN-UHFFFAOYSA-N Phosphorus Chemical compound [P] OAICVXFJPJFONN-UHFFFAOYSA-N 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 235000005686 eating Nutrition 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012804 iterative process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16H—HEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
- G16H20/00—ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance
- G16H20/60—ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance relating to nutrition control, e.g. diets
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/004—Artificial life, i.e. computing arrangements simulating life
- G06N3/006—Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
Landscapes
- Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Biophysics (AREA)
- Data Mining & Analysis (AREA)
- Public Health (AREA)
- Medical Informatics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Biomedical Technology (AREA)
- Epidemiology (AREA)
- Computational Linguistics (AREA)
- Primary Health Care (AREA)
- Evolutionary Computation (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Nutrition Science (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a child diet intelligent prediction method and device based on a particle swarm optimization algorithm. The device comprises a data receiving module, a data processing module and a data processing module, wherein the data receiving module is used for receiving statistical data collected by a server; the data storage module is used for storing the child-food material scoring data, the hidden feature matrix and the related parameters received by the server; the self-adaptive parameter control module updates the hidden feature matrix by utilizing the stored data and automatically controls parameters by combining a particle swarm optimization algorithm; the prediction model generation module generates prediction data according to the training model and stores the data into the data storage module; and the hidden feature output module outputs a hidden feature matrix and scoring data. The method is mainly used for hidden feature analysis of food preference of children, adaptive control is carried out on the hyper-parameters in the hidden feature analysis process through a particle swarm optimization algorithm, the eating habits of the children are rapidly predicted for nutrition catering, and the problems of unreasonable and unscientific food collocation of the children and the like can be solved.
Description
Technical Field
The invention relates to a computer data processing technology, in particular to a child diet intelligent prediction method and device based on particle swarm optimization.
Background
With the continuous improvement of living standard, people have entered the high-quality era of pursuing quality of life from the era of satisfying temperature saturation in the past. Healthy growth of physical quality of children is a key concern of each family, however, the number of children is huge, the types of food materials for children to eat can not be enumerated, and parents can hardly select the most suitable and nutritional food collocation from a plurality of food materials according to different children. Therefore, a child-food material scoring matrix can be constructed by utilizing scoring data formed by the preference of the child to food, and the eating habits of the child can be predicted by utilizing the scoring degree, so that more complete diet collocation opinions can be provided. Generally, the variety of food materials is very large, and children cannot taste all the food material varieties, so the children-food material scoring matrix is extremely sparse.
At present, a hidden feature analysis prediction model is widely applied to multiple fields due to high efficiency and expandability, and can be used for detecting the eating habits of children, predicting the eating preferences of the children and recommending appropriate food materials to parents. However, the performance of the existing hidden feature analysis model is greatly influenced by the value of the super parameter, and a great amount of time is consumed to select a better super parameter value, so that the model can realize good diet service recommendation. The timeliness requirement of food material preference prediction for providing diet opinions for children is high, but the efficiency of the hidden feature analysis model is low, and high-efficiency and high-quality personalized food service for children cannot be provided for each family.
Therefore, it is very important for parents to know the physical development status of children in time and provide healthy and nutritional diet collocation for children at any time by rapidly detecting the eating habits of children.
Disclosure of Invention
In order to solve the problems of the foregoing technologies, a primary objective of the present invention is to provide a method and an apparatus for intelligent prediction of children's diet based on particle swarm optimization, which can adaptively adjust a value of a hyper-parameter learning rate to perform hidden feature analysis of children and food materials, and can quickly provide a suitable diet collocation for each child.
In order to achieve the above object, the present invention provides a method and a device for intelligent prediction of children diet based on particle swarm optimization, wherein the device comprises:
the data receiving module is used for receiving statistical data of the favorite behaviors of the children on the food, which are acquired by the server;
the data storage module is used for storing scoring data of favorite behaviors of children on food, hidden feature matrixes of the children and food material types, related parameters related to the control module and the like, wherein the scoring data are collected by the server;
the self-adaptive parameter control module is used for updating the child hidden feature matrix and the food material hidden feature matrix by utilizing the stored child-food material scoring data and automatically controlling parameters in the updating process of the child hidden feature matrix and the food material hidden feature matrix by combining a particle swarm optimization algorithm;
the adaptive parameter control module comprises:
the parameter initialization unit is used for initializing related parameters involved in the adaptive parameter control process;
the self-adaptive parameter control unit is used for automatically controlling the super-parameter learning rate by utilizing a particle swarm optimization algorithm in the hidden feature matrix updating process by combining the initial related parameters of the initialization unit;
the hidden feature matrix updating unit is used for updating the child hidden feature matrix and the food material hidden feature matrix by utilizing a random gradient descent algorithm in combination with the initial related parameters of the initialization unit;
the prediction model generation module is used for generating prediction data according to a training model generated by the child-food material scoring data and storing the generated child-food material scoring data into the data storage module;
and the hidden characteristic output module is used for outputting a hidden characteristic matrix of the children and the food materials and the scoring data of the children and the food materials.
According to the device for intelligently predicting the diet of the children based on the particle swarm optimization, the parameter initialization unit preferably comprises:
initializing relevant initialization parameters involved in the intelligent prediction process of a child's diet, wherein the child-dietScore data X ∈ RP×QX is an established matrix of P rows and Q columns, pi represents an observed data set, dimension d of a hidden feature space is initialized and is always a positive integer, and a child hidden feature matrix U ∈ R is initializedP×dU represents matrix of P rows and d columns, and initialized food hidden characteristic matrix I ∈ Rd×QI represents a matrix of Q columns and d rows; initializing a regularization parameter λUAnd λIIt is a constant that controls the regularization effect of the model during the update, usually initialized to a very small positive number; initializing a maximum iteration round number T which is a maximum variable value for controlling the training times of the model and is always a positive number; initializing an iteration round number variable t to be 0; initializing a convergence termination threshold theta; initializing the number G of population particles; initializing a dimension D of a particle search space; velocity Z of the initiating particleG×DWhich represents the flight velocity of the particle during flight, the position η of the initial particleG×DIt represents the position of the particle within the search range; initializing random number r in the update process1And r2It is to increase randomness; initializing an acceleration parameter c1And c2,c1Representing cognitive parameters, c2Representing social parameters for adjusting the maximum step size of learning, typically initialized to a positive number; initializing an inertia weight coefficient w, which is used for adjusting the search range of a solution space and is always a non-negative number; initializing the best position pbest found so far for each particle to fly past itself, which represents the particle's own flight experience; initializing the best position gbest found in all particles in the population, which represents the flight experience of the particle companion; initialising the maximum value of the particle velocity zmaxAnd minimum value zminFor limiting the flight size of the particle velocity, initializing a maximum value η of the particle positionmaxAnd minimum value ηminAnd is used to limit the range of particle positions whose values are related to the problem being solved.
According to the device for intelligently predicting the diet of the children based on the particle swarm optimization, preferably, the related parameters initialized above are combined to construct a child-food material scoring prediction model based on the particle swarm optimization, and the objective function of the model is as follows:
wherein r isp,qRepresenting an entity relation between the children p and the food materials q, namely the real scores of the children p on the food materials q; u. ofp,lShowing the hidden features of the children, namely the hidden features of the pth child in the ith dimension; i.e. iq,lThe implicit characteristics of the food materials are shown, namely the implicit characteristics of the ith food material in the ith dimension.
To enhance the generalization capability of the model and improve the prediction accuracy of the model, L is usually applied to the objective function2Regularization is constrained toThus, the objective function can be found to be:
wherein u isp,.Representing the p row vector in the hidden feature matrix U; i.e. iq,.Representing a q-th row vector in the hidden feature matrix I; i | · | purple wind2L representing a vector2And (4) norm.
According to the device for intelligently predicting the diet of the children based on the particle swarm optimization, the adaptive parameter control unit preferably comprises:
in the particle swarm optimization algorithm, each particle in the swarm is regarded as a learning rate needing adaptive control, and an updating formula of the speed and the position of the particle in the next iteration can be obtained:
where t denotes the t-th iteration, t +1 denotes the (t +1) -th iteration, zkDenotes the velocity of the kth particle, ηkThe position of the kth particle, k ∈ G, is indicated.
The updated particles are not randomly searched without boundaries, but are limited to a preset range. Thus, the velocity and position of the particles are limited to the following:
in general, selecting an appropriate fitness function enables the problem of optimization to find a better solution. In order to minimize an objective function and obtain the highest prediction accuracy and convergence efficiency, the following fitness function is adopted as an evaluation standard of a particle swarm optimization algorithm:
where Φ represents a set of validated particle swarm optimization algorithms and does not intersect Π.
According to the device for intelligently predicting the diet of the children based on the particle swarm optimization, preferably, the hidden feature matrix updating unit includes:
by utilizing a random gradient descent algorithm, the partial derivatives of the target function are solved, and the hidden feature vector updating process of the child hidden feature matrix and the food material hidden feature matrix can be obtained:
whereinRepresenting the error between the true score and the predicted score. Thus, a final hidden feature vector u is obtainedpAnd iqAnd implicit feature matrices U and I.
And repeating the iteration process on the training set pi and the verification set phi until the two sets converge, and obtaining a final child and food material hidden feature matrix. The model convergence condition is 1) the preset maximum iteration round number T is reached; 2) the prediction error value between the two iteration rounds is smaller than the convergence termination threshold value theta.
The invention also discloses a particle swarm optimization-based children diet intelligent prediction method, which comprises the following steps:
s1: receiving the child-food material scoring data collected by the server;
s2: storing the child-food material scoring data in the data receiving module, the hidden feature matrix of the child and the food material types and related parameters related to the control module;
s3: updating the child implicit characteristic matrix and the food implicit characteristic matrix by using the stored child-food material scoring data, and automatically controlling parameters in the updating process of the child implicit characteristic matrix and the food implicit characteristic matrix by combining a particle swarm optimization algorithm;
s4: generating prediction data according to a training model generated by the child-food material scoring data, and storing the generated child-food material scoring data in a data storage module;
s5: and outputting the implicit characteristics of the children and the food materials and scoring data of the children.
According to the particle swarm optimization-based children diet intelligent prediction method, the step S3 preferably comprises the following steps:
s3-1, initializing parameters, wherein the parameters are used for initializing related parameters involved in the intelligent prediction updating process of the children-food material score;
initializing relevant initialization parameters involved in the intelligent prediction process of the diet of the children, wherein the scoring data of the children-food materials X ∈ RP×QX is the established matrix of P rows and Q columns, Π representing the observed data set; initialize the dimension d of the hidden feature space, alwaysPositive integer, initializing child hidden feature matrix U ∈ RP×dU represents matrix of P rows and d columns, and initialized food hidden characteristic matrix I ∈ Rd×QI represents a matrix of Q columns and d rows; initializing a regularization parameter λUAnd λIIt is a constant that controls the regularization effect of the model during the update, usually initialized to a very small positive number; initializing a maximum iteration round number T which is a maximum variable value for controlling the training times of the model and is always a positive number; initializing an iteration round number variable t to be 0; initializing a convergence termination threshold theta; initializing the number G of population particles; initializing a dimension D of a particle search space; velocity Z of the initiating particleG×DWhich represents the flight velocity of the particle during flight, the position η of the initial particleG×DIt represents the position of the particle within the search range; initializing random number r in the update process1And r2It is to increase randomness; initializing an acceleration parameter c1And c2,c1Representing cognitive parameters, c2Representing social parameters for adjusting the maximum step size of learning, typically initialized to a positive number; initializing an inertia weight coefficient w, which is used for adjusting the search range of a solution space and is always a non-negative number; initializing the best position pbest found so far for each particle to fly past itself, which represents the particle's own flight experience; initializing the best position gbest found in all particles in the population, which represents the flight experience of the particle companion; initialising the maximum value of the particle velocity zmaxAnd minimum value zminFor limiting the flight size of the particle velocity, initializing a maximum value η of the particle positionmaxAnd minimum value ηminAnd is used to limit the range of particle positions whose values are related to the problem being solved.
And (3) constructing a child-food material scoring prediction model based on particle swarm optimization by combining the initialized related parameters, wherein the target function is as follows:
wherein r isp,qIndicates p and food for childrenThe entity relation among the materials q, namely the real score of the children p on the food materials q; u. ofp,lShowing the hidden features of the children, namely the hidden features of the pth child in the ith dimension; i.e. iq,lThe implicit characteristics of the food materials are shown, namely the implicit characteristics of the ith food material in the ith dimension.
To enhance the generalization capability of the model and improve the prediction accuracy of the model, L is usually applied to the objective function2Regularization is constrained toThus, the objective function can be found to be:
wherein u isp,.Representing the p row vector in the hidden feature matrix U; i.e. iq,.Representing a q-th row vector in the hidden feature matrix I; i | · | purple wind2L representing a vector2And (4) norm.
S3-2: and judging whether the iteration round number of the training model exceeds the set maximum iteration round number T.
Accumulating the iteration round number variables by 1, and then judging whether the iteration round number of the training model exceeds the set maximum iteration round number T;
s3-3: and judging whether the target function converges in the training set pi and the verification set phi or not.
Solving a difference value between the value of the current iteration and the value generated after the previous iteration of the target function, and if the absolute value of the difference value is smaller than a set threshold value theta, determining that the training process is converged; otherwise, it is regarded as not converging;
s3-4: and based on the child-food material scoring data in the data storage module, performing self-adaptive control on the hyper-parameter learning rate by utilizing a particle swarm optimization algorithm in combination with the parameters related to the parameter initialization unit.
In the particle swarm optimization algorithm, each particle in the swarm is regarded as a learning rate needing adaptive control, and an updating formula of the speed and the position of the particle in the next iteration can be obtained:
where t denotes the t-th iteration, t +1 denotes the (t +1) -th iteration, zkDenotes the velocity of the kth particle, ηkThe position of the kth particle, k ∈ G, is indicated.
The updated particles are not randomly searched without boundaries, but are limited to a preset range. Thus, the velocity and position of the particles are limited to the following:
in general, selecting an appropriate fitness function enables the problem of optimization to find a better solution. In order to minimize an objective function and obtain the highest prediction accuracy and convergence efficiency, the following fitness function is adopted as an evaluation standard of a particle swarm optimization algorithm:
where Φ represents a set of validated particle swarm optimization algorithms and does not intersect Π.
S3-5: based on the child-food material scoring data in the data storage module, combining parameters related to the parameter initialization unit and parameters adaptively controlled through a particle swarm optimization algorithm, solving partial derivatives of a target function by using a random gradient descent algorithm to obtain a child hidden feature matrix and a food material hidden feature matrix, wherein the updating process comprises the following steps:
whereinRepresenting the error between the true score and the predicted score. Thus, a final hidden feature vector u is obtainedpAnd iqAnd implicit feature matrices U and I.
In summary, due to the adoption of the technical scheme, the invention has the beneficial effects that:
the invention discloses a particle swarm optimization-based children-food material scoring intelligent prediction method and device, and aims to utilize a particle swarm optimization algorithm to perform adaptive control on parameters, improve the calculation efficiency of the whole algorithm, help parents to know the physical development conditions of children in time, provide healthy and nutritional diet collocation for the children at any time, and provide high-efficiency and high-quality personalized diet service for the children for each family.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a schematic structural diagram of an intelligent prediction device for children's diet based on particle swarm optimization according to the present invention;
FIG. 2 is a schematic flow chart of an intelligent prediction method for children's diet based on particle swarm optimization according to the present invention;
fig. 3 is a comparison graph of the consumption of training time for intelligent prediction of children-food material scores before and after the embodiment of the present invention is applied.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
The invention provides a particle swarm optimization-based intelligent prediction method and device for diet of children, aiming at carrying out self-adaptive control on parameters by utilizing a particle swarm optimization algorithm, improving the calculation efficiency of the whole algorithm, helping parents to know the physical development condition of the children in time, providing healthy and nutritional diet collocation for the children at any time and providing high-efficiency and high-quality personalized diet service for the children for each family.
As shown in fig. 1, a schematic structural diagram of a particle swarm optimization-based intelligent prediction device for children's diet (hereinafter referred to as device) of the present invention is provided, and the device includes:
the data receiving model 110 is used for receiving statistical data of the favorite behaviors of the children collected by the server;
the data storage module 120 is used for storing scoring data of favorite behaviors of children on food, hidden feature matrixes of the children and food material types, related parameters related to the control module and the like, wherein the scoring data are collected by the server;
the adaptive parameter control module 130 updates the child hidden feature matrix and the food hidden feature matrix by using the stored child-food material scoring data, and automatically controls parameters in the updating process of the child hidden feature matrix and the food hidden feature matrix by combining a particle swarm optimization algorithm, and includes: a parameter initialization unit 131, configured to initialize relevant parameters involved in the adaptive parameter control process; the adaptive parameter control unit 132 is used for automatically controlling the hyper-parameter learning rate by utilizing a particle swarm optimization algorithm in the hidden feature matrix updating process by combining the parameters related to the initial model of the initialization unit; the hidden feature matrix updating unit 133 is used for updating the child hidden feature matrix and the food material hidden feature matrix by using a random gradient descent algorithm in combination with the parameters related to the initial model of the initialization unit;
the prediction model generation module 140 generates prediction data according to a training model generated by the child-food material scoring data, and stores the generated child-food material scoring data in the data storage module;
the implicit characteristic output module 150 outputs implicit characteristics of the children and food materials and scoring data of the children food materials.
Fig. 2 is a flowchart of an intelligent prediction method for children's diet based on particle swarm optimization, which includes:
(1) the device receives the child-food material scoring data collected by the server.
(2) The device initializes the relevant parameters.
(3) The apparatus constructs an objective function on the known data set Π of the objective matrix X.
(5) The device judges whether the iteration round number of the training model exceeds the set maximum iteration round number T, if so, the step (8) is executed; if not, executing the step (5).
(5) The device judges whether the target function is converged on a training set pi and a verification set phi or not, and if yes, the step (8) is executed; if not, executing the step (6).
(6) The device utilizes a particle swarm optimization algorithm to carry out self-adaptive control on the parameters.
(7) The apparatus updates U and I on the known data set using a random gradient descent algorithm.
(8) The device outputs implicit feature matrices U and I.
(9) The device calculates predictive scoring data using the updated implicit feature matrices U and I.
Fig. 2 is a flow chart of an intelligent child diet prediction method based on particle swarm optimization in an embodiment of the invention. Referring to fig. 2, the process includes:
step 301: and receiving the child-food material scoring data collected by the server.
Step 302: relevant parameters are initialized.
In this step, the parameters to be initialized include: hidden feature space dimension d, child hidden feature matrix U, food hidden feature matrix I and regularization parameter lambdaUAnd λIMaximum iteration round number T, convergence termination threshold theta,population number of particles G, particle search space dimension D, velocity of particles Z, position of particles η, random number r1And r2Acceleration parameter c1And c2The inertial weight coefficient w, the best position found by each particle up to now pbest, the best position found by all particles in the population gbest, the maximum value of the particle velocity zmaxAnd minimum value zminMaximum value of particle position ηmaxAnd minimum value ηmin。
Wherein: the dimension d of the hidden feature space is initially a positive integer, such as 20.
The child latent features matrix U is a matrix of P rows, d columns, where each element is initialized to a random number within the interval (0, 0.05).
The food material hidden feature matrix I is a matrix of d rows and Q columns, wherein each element is initialized to a random number within the interval (0, 0.05).
Regularization penalty parameter λUAnd λIThe constants that control the regularization effects of the model during the update are typically initialized to a very small positive number, such as 0.003.
The maximum iteration round number T is a maximum variable value for controlling the training times of the model, and is initialized to 1000.
The convergence termination threshold θ is a threshold parameter for determining whether the iterative process of the training model converges, and is initialized to a very small positive number, such as 0.00001.
The population number G is the number of solutions to the optimization problem and is initialized to 10.
The particle search space dimension D is the dimension of each particle in the population, and is related to the problem of optimization, initialized to 1.
The velocity Z of the particle is a matrix of G rows and D columns, where each element is initialized to a random number in the interval (-1, 1).
Position η of the particle is a matrix of G rows and D columns in which each element is initialized to the interval (10)-12,10-8) The random number of (2).
Random number r1And r2The initialized interval is a random number of U (0, 1).
Acceleration parameter c1And c2Adjusting the maximum step length of the learning of the particle flight process, and initializing c1=c2=2;
The inertial weight coefficient w adjusts the search range for the solution space, and the initialized interval is a random number of U (0, 1).
Each particle's own best position found so far, pbest, is initialized to 0;
initializing the best position gbest found by all particles in the population to 0;
maximum value z of particle velocitymaxAnd minimum value zminIs the boundary of the particle flight velocity, initialized to zmax=1,zmin=-1。
Maximum value η of particle positionmaxAnd minimum value ηminIs the boundary of the flight position of the particle, initialized to ηmax=10-8,ηmin=10-12;
Step 303: constructing an objective function on the known data set Π of the objective matrix X as follows:
wherein r isp,qRepresenting an entity relation between the children p and the food materials q, namely the real scores of the children p on the food materials q; u. ofp,lThe hidden features represent children, namely the hidden features of the pth user in the ith dimension; i.e. iq,lThe hidden features of the food materials are represented, namely the hidden features of the ith child in the ith dimension.
To enhance the generalization capability of the model and improve the prediction accuracy of the model, L is usually applied to the objective function2Regularization is constrained toThus, the objective function can be found to be:
wherein u isp,.To representA p-th row vector in the hidden feature matrix U; i.e. iq,.Represents the qth row vector in the hidden feature matrix I, | · | | non-woven phosphor2L representing a vector2And (4) norm.
Step 304: judging whether the iteration round number of the training model exceeds the set maximum iteration round number T or not;
in the step, the iteration round number variable is accumulated to 1, and then whether the iteration round number of the training model exceeds the set maximum iteration round number T is judged;
step 305: judging whether the target function is converged in a training set pi and a verification set phi or not;
in this step, the value of the objective function in the current iteration and the value of the objective function generated after the previous iteration are subjected to difference calculation, and if the absolute value of the difference is smaller than a set threshold value theta, the training process is considered to be convergent; otherwise, it is regarded as convergence;
step 306: based on the child-food material scoring data in the data storage module, the parameters related to the parameter initialization unit are combined, and the particle swarm optimization algorithm is utilized to carry out self-adaptive control on the hyper-parameter learning rate;
in the particle swarm optimization algorithm, each particle in a swarm is regarded as a parameter needing adaptive control, and an updating formula of the speed and the position of the particle at the next time can be obtained:
where t denotes the t-th iteration, t +1 denotes the (t +1) -th iteration, zkDenotes the velocity of the kth particle, ηkThe position of the kth particle, k ∈ G, is indicated.
The updated particles are not randomly searched without boundaries, but are limited to a preset range. Thus, the velocity and position of the particles are limited to the following:
in general, selecting an appropriate fitness function enables the problem being solved to find a better solution. In order to minimize an objective function and obtain the highest prediction accuracy and convergence efficiency, the following fitness function is adopted as an evaluation standard of a particle swarm optimization algorithm:
where Φ represents a set of validated particle swarm optimization algorithms and does not intersect Π.
Step 307: based on the child-food material scoring data in the data storage module, combining parameters related to the parameter initialization unit and parameters subjected to self-adaptive control through a particle swarm optimization algorithm, and solving a partial derivative of a target function by using a random gradient descent algorithm to obtain a child implicit feature matrix and a food material implicit feature matrix;
by utilizing a random gradient descent algorithm, the partial derivatives of the target function are solved, and the hidden feature vector updating process of the child hidden feature matrix and the food material hidden feature matrix can be obtained:
whereinRepresenting the error between the true score and the predicted score. Thus, a final hidden feature vector u is obtainedpAnd iqAnd implicit feature matrices U and I.
Step 308: and outputting the updated child implicit characteristic matrix U and the food implicit characteristic matrix I.
Step 309: and calculating the prediction scoring data by using the updated hidden feature matrixes U and I.
In order to verify the performance of the method and the device for intelligently predicting the diet of the children based on particle swarm optimization, the device is installed on a server (configuration: Intel Core i5-4570CPU, 3.20GHz processor and 8.00G memory), and a simulation experiment is run for example analysis. Example analysis the training time consumption before and after application of the device was recorded.
Fig. 3 is a comparison of the child-food material score intelligent prediction time before and after the application of the embodiment of the present invention. As shown in fig. 3, the intelligent prediction time for the child-food material score is significantly reduced, wherein the first case represents the result without using the detection method and apparatus of the present invention, and the second case represents the result after implementing the present invention.
According to the technical scheme, the particle swarm optimization-based method and device for intelligently predicting the child-food material scoring aims at utilizing the particle swarm optimization algorithm to perform adaptive control on parameters, improving the calculation efficiency of the whole algorithm, helping parents to know the physical development conditions of the child in time, providing healthy and nutritional diet collocation for the child at any time and providing high-efficiency and high-quality personalized diet service for the child for each family.
While embodiments of the invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims (4)
1. A child diet intelligent prediction method and device based on a particle swarm optimization algorithm are characterized by comprising the following steps:
s1: receiving the child-food material scoring data collected by the server;
s2: storing the child-food material scoring data in the data receiving module, the hidden feature matrix of the child and the food material types and related parameters related to the control module;
s3: updating the child implicit characteristic matrix and the food implicit characteristic matrix by using the stored child-food material scoring data, and automatically controlling parameters in the updating process of the child implicit characteristic matrix and the food implicit characteristic matrix by combining a particle swarm optimization algorithm;
s4: generating prediction data according to a training model generated by the child-food material scoring data, and storing the generated child-food material scoring data in a data storage module;
s5: and outputting the implicit characteristics of the children and the food materials and scoring data of the children.
2. The intelligent prediction method for children' S diet based on particle swarm optimization algorithm according to claim 1, wherein step S3 comprises the following steps:
s3-1, initializing parameters, wherein the parameters are used for initializing related parameters involved in the intelligent prediction updating process of the children-food material score, and the objective function is as follows:
wherein u isp,.Representing the p row vector in the hidden feature matrix U; i.e. iq,.Representing a q-th row vector in the hidden feature matrix I; i | · | purple wind2L representing a vector2A norm;
s3-2, judging whether the iteration round number of the training model exceeds the set maximum iteration round number T;
s3-3: judging whether the target function is converged in a training set pi and a verification set phi or not;
s3-4: based on the child-food material scoring data in the data storage module, the parameters related to the parameter initialization unit are combined, the particle swarm optimization algorithm is utilized to carry out self-adaptive control on the super-parameter learning rate, and the updating formulas of the speed and the position of the particles in the next iteration are as follows:
where t denotes the t-th iteration, t +1 denotes the (t +1) -th iteration, zkDenotes the velocity of the kth particle, ηkThe position of the kth particle, k ∈ G, is indicated.
The updated particles are not randomly searched without boundaries, but are limited to a preset range. Thus, the velocity and position of the particles are limited to the following:
in general, selecting an appropriate fitness function enables the problem of optimization to find a better solution. In order to minimize an objective function and obtain the highest prediction accuracy and convergence efficiency, the following fitness function is adopted as an evaluation standard of a particle swarm optimization algorithm:
phi represents a set for verifying a particle swarm optimization algorithm and does not intersect pi;
s3-5: based on the child-food material scoring data in the data storage module, combining parameters related to the parameter initialization unit and parameters adaptively controlled through a particle swarm optimization algorithm, solving partial derivatives of a target function by using a random gradient descent algorithm to obtain a child hidden feature matrix and a food material hidden feature matrix, wherein the updating process comprises the following steps:
3. The prediction device of the intelligent children diet prediction method based on the particle swarm optimization algorithm according to any one of claims 1-2, characterized by comprising a data receiving module, a data storage module, an adaptive parameter control module, a prediction model generation module, and a hidden feature output module, wherein,
the data receiving module is connected with the data storage module and is used for receiving the statistical data of the favorite behaviors of the children collected by the server and storing the statistical data into the data storage module,
the data storage module is connected with the self-adaptive parameter control module, the self-adaptive parameter control module updates the child implicit characteristic matrix and the food implicit characteristic matrix by utilizing the stored child-food scoring data and automatically controls parameters in the updating process of the child implicit characteristic matrix and the food implicit characteristic matrix by combining a particle swarm optimization algorithm,
the adaptive parameter control module is connected with the prediction model generation module, the prediction model generation module generates prediction data according to a training model generated by the child-food material scoring data and stores the generated child-food material scoring data in the data storage module,
the data storage module is connected with the hidden feature output module, and the hidden feature output module outputs hidden features of the children and food materials and scoring data of the children food materials.
4. The prediction device of intelligent children diet prediction method based on particle swarm optimization algorithm according to claim 3, wherein the adaptive parameter control module comprises a parameter initialization unit, an adaptive parameter control unit, a hidden feature matrix update unit,
the parameter initialization unit is used for initializing relevant parameters related in the adaptive parameter control process;
the self-adaptive parameter control unit automatically controls the super-parameter learning rate by utilizing a particle swarm optimization algorithm in the process of updating the hidden feature matrix by combining the parameters related to the initial model of the initialization unit; and the hidden feature matrix updating unit is used for updating the child hidden feature matrix and the food material hidden feature matrix by utilizing a random gradient descent algorithm in combination with the parameters related to the initial model of the initialization unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010383367.1A CN111564201A (en) | 2020-05-08 | 2020-05-08 | Particle swarm optimization-based intelligent prediction method and device for children diet |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010383367.1A CN111564201A (en) | 2020-05-08 | 2020-05-08 | Particle swarm optimization-based intelligent prediction method and device for children diet |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111564201A true CN111564201A (en) | 2020-08-21 |
Family
ID=72071844
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010383367.1A Pending CN111564201A (en) | 2020-05-08 | 2020-05-08 | Particle swarm optimization-based intelligent prediction method and device for children diet |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111564201A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112489761A (en) * | 2020-11-19 | 2021-03-12 | 华中科技大学同济医学院附属协和医院 | Liquid and energy management system |
CN118692629A (en) * | 2024-08-29 | 2024-09-24 | 北京四海汇智科技有限公司 | Application diet intervention management method for hemodialysis patients with children nephropathy |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE102009013837A1 (en) * | 2009-03-22 | 2010-04-08 | Brandstetter Markus und Nora, als gesetzliche Vertreter des minderjährigen Brandstetter, Gregor | Device for predicting used quantity of insulin of diabetes child over time after food intake, has evaluator connected upstream to neural network, where neural network provides prediction about used quantity of insulin over time |
US20120254196A1 (en) * | 2009-10-13 | 2012-10-04 | Nestec S.A. | Systems for evaluating dietary intake and methods of using same |
CN105069741A (en) * | 2015-09-07 | 2015-11-18 | 深圳市万佳安物联科技股份有限公司 | Damaged image non-negative hidden feature extracting device and method |
CN106296521A (en) * | 2016-08-08 | 2017-01-04 | 统安易(北京)科技有限公司 | Child's catering system based on Nutrition Evaluation |
CN107742533A (en) * | 2017-09-13 | 2018-02-27 | 天津大学 | A kind of method based on dietary nutrient prediction gout |
CN108921670A (en) * | 2018-07-04 | 2018-11-30 | 重庆大学 | A kind of potential interest of fusion user, the Drug trading recommended method of space-time data and classification popularity |
CN109448853A (en) * | 2018-09-14 | 2019-03-08 | 天津科技大学 | A kind of food based on matrix decomposition-disease association prediction technique |
CN110175682A (en) * | 2019-04-22 | 2019-08-27 | 广东技术师范大学 | A kind of optimization core pivot element analysis fault monitoring method based on Chaos-Particle Swarm Optimization |
CN110413878A (en) * | 2019-07-04 | 2019-11-05 | 四川金赞科技有限公司 | User based on adaptive elastomeric network-commodity preference prediction meanss and method |
-
2020
- 2020-05-08 CN CN202010383367.1A patent/CN111564201A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE102009013837A1 (en) * | 2009-03-22 | 2010-04-08 | Brandstetter Markus und Nora, als gesetzliche Vertreter des minderjährigen Brandstetter, Gregor | Device for predicting used quantity of insulin of diabetes child over time after food intake, has evaluator connected upstream to neural network, where neural network provides prediction about used quantity of insulin over time |
US20120254196A1 (en) * | 2009-10-13 | 2012-10-04 | Nestec S.A. | Systems for evaluating dietary intake and methods of using same |
CN105069741A (en) * | 2015-09-07 | 2015-11-18 | 深圳市万佳安物联科技股份有限公司 | Damaged image non-negative hidden feature extracting device and method |
CN106296521A (en) * | 2016-08-08 | 2017-01-04 | 统安易(北京)科技有限公司 | Child's catering system based on Nutrition Evaluation |
CN107742533A (en) * | 2017-09-13 | 2018-02-27 | 天津大学 | A kind of method based on dietary nutrient prediction gout |
CN108921670A (en) * | 2018-07-04 | 2018-11-30 | 重庆大学 | A kind of potential interest of fusion user, the Drug trading recommended method of space-time data and classification popularity |
CN109448853A (en) * | 2018-09-14 | 2019-03-08 | 天津科技大学 | A kind of food based on matrix decomposition-disease association prediction technique |
CN110175682A (en) * | 2019-04-22 | 2019-08-27 | 广东技术师范大学 | A kind of optimization core pivot element analysis fault monitoring method based on Chaos-Particle Swarm Optimization |
CN110413878A (en) * | 2019-07-04 | 2019-11-05 | 四川金赞科技有限公司 | User based on adaptive elastomeric network-commodity preference prediction meanss and method |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112489761A (en) * | 2020-11-19 | 2021-03-12 | 华中科技大学同济医学院附属协和医院 | Liquid and energy management system |
CN118692629A (en) * | 2024-08-29 | 2024-09-24 | 北京四海汇智科技有限公司 | Application diet intervention management method for hemodialysis patients with children nephropathy |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Zhu et al. | Prototype augmentation and self-supervision for incremental learning | |
US11568310B2 (en) | Apparatus for generating temperature prediction model and method for providing simulation environment | |
Jia et al. | A new hybrid seagull optimization algorithm for feature selection | |
CN107563841B (en) | Recommendation system based on user score decomposition | |
US20210056384A1 (en) | Apparatus for generating temperature prediction model and method for providing simulation environment | |
US20170124400A1 (en) | Automatic video summarization | |
Alshabandar et al. | The application of Gaussian mixture models for the identification of at-risk learners in massive open online courses | |
CN111564201A (en) | Particle swarm optimization-based intelligent prediction method and device for children diet | |
CN105469145A (en) | Intelligent test paper method based on genetic particle swarm optimization algorithm | |
CN110738362A (en) | method for constructing prediction model based on improved multivariate cosmic algorithm | |
CN112434213B (en) | Training method of network model, information pushing method and related devices | |
CN111061959B (en) | Group intelligent software task recommendation method based on developer characteristics | |
CN110781595B (en) | Method, device, terminal and medium for predicting energy use efficiency (PUE) | |
CN115688913A (en) | Cloud-side collaborative personalized federal learning method, system, equipment and medium | |
CN110991621A (en) | Method for searching convolutional neural network based on channel number | |
Zhuang et al. | Multi-criteria selection of rehearsal samples for continual learning | |
CN110705794A (en) | Method for predicting window state based on support vector machine algorithm | |
CN109933720A (en) | A kind of dynamic recommendation method based on user interest Adaptive evolution | |
Setiawan et al. | Deep convolutional neural network alexnet and squeezenet for maize leaf diseases image classification | |
Zhai et al. | Rectified meta-learning from noisy labels for robust image-based plant disease classification | |
CN110751257A (en) | Method for constructing prediction model based on hunger game search algorithm | |
US20240160951A1 (en) | Control Simulation Method Based On Artificial Intelligence | |
CN116776948A (en) | Federal learning method, system and medium based on customer selection and weight distribution | |
CN116094977A (en) | Deep learning method of service Qos prediction based on time perception feature-oriented optimization | |
CN111612572A (en) | Adaptive local low-rank matrix approximate modeling method based on recommendation system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20200821 |
|
WD01 | Invention patent application deemed withdrawn after publication |