Litchi kernel temperature dynamic prediction method based on deep learning
Through deep learning technology, combined with LSTM model and Kalman filter, dynamic prediction of the litchi core temperature is achieved, solving the problem of low temperature control accuracy during freezing, and improving the freezing quality and prediction accuracy.
Patent Information
- Application Number
- CN202411307688.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-01-03
AI Technical Summary
The existing freezing methods cannot accurately predict and control the kernel temperature of litchi fruits, resulting in poor freezing quality, and traditional temperature measurement methods have problems of low accuracy and high cost.
Using a deep learning method, the data of frozen space temperature, litchi kernel temperature and fan speed are preprocessed, and the optimized LSTM model is input for preliminary prediction, and then updated through the Kalman filter to establish dynamic prediction of litchi kernel temperature. Model to achieve accurate prediction of lychee kernel temperature.
It realizes dynamic prediction of the temperature of frozen lychee kernel without damaging the lychee kernel, improves the freezing quality, enhances the robustness and noise resistance of prediction, and solves the sensitivity of a single neural network to noise data and time-varying systems. The problem of insufficient modeling ability.
Smart Images

Figure CN119249097A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of deep learning and litchi data processing, and in particular to a method for dynamically predicting litchi kernel temperature based on deep learning. Background Art
[0002] my country is the world's largest litchi industry country, but the litchi industry has problems such as concentrated marketing period, difficulty in preservation and extremely short shelf life. Liquid nitrogen quick freezing is an efficient food freezing technology that can reduce the temperature of food to below freezing point in a very short time, forming small and uniform ice crystals, thereby maintaining the taste, color and nutritional value of the food. The core temperature of litchi during the freezing process is a key factor affecting the preservation effect. Excessive freezing will cause excessive crystallization of water inside the cells, forming large ice crystals, destroying cell integrity, leading to tissue softening, water loss and nutrient loss. Insufficient freezing will lead to the inability to curb microbial activities and enzymatic reactions, making it difficult to achieve long-term preservation. The temperature control of existing freezing methods generally stays at the level of freezing space, and it is impossible to accurately predict and control the core temperature of litchi fruit, resulting in the core temperature of litchi fruit failing to reach the ideal value and affecting the freezing quality. Traditional infrared temperature measurement, ultrasonic temperature measurement and magnetic resonance imaging (MRI) temperature measurement methods have relatively low temperature measurement accuracy and high cost.
[0003] In recent years, the rapid development of machine learning and deep learning technologies has provided new possibilities for solving this problem. Methods based on deep learning can better capture the complex temperature change patterns and realize the dynamic prediction of litchi kernel temperature. Existing technologies make it difficult to obtain the litchi kernel temperature losslessly during the freezing process. After the litchi is frozen, it is necessary to insert a temperature sensor to detect whether the kernel temperature meets the freezing and freshness requirements, which will damage the litchi.
[0004] Therefore, a method for dynamically predicting the temperature of frozen litchi kernels is needed without damaging the litchi kernels. Summary of the invention
[0005] In order to overcome the problems existing in the related art, the purpose of the present invention is to provide a method for dynamic prediction of litchi kernel temperature based on deep learning, which can dynamically predict the temperature of frozen litchi kernel without damaging the litchi kernel.
[0006] A method for dynamic prediction of litchi kernel temperature based on deep learning, comprising:
[0007] Acquire raw data, and preprocess the raw data to obtain preprocessed data; wherein the raw data includes the temperature of the freezing space, the temperature of the litchi kernel, and the speed of the fan;
[0008] The preprocessed data is input into the optimized LSTM model for prediction to obtain a preliminary predicted temperature of the litchi kernel at time k;
[0009] The preliminary predicted temperature of the litchi kernel at time k is input into a Kalman filter for prediction and updating to obtain a final predicted temperature of the litchi kernel at time k.
[0010] In a preferred technical solution of the present invention, before inputting the preprocessed data into the optimized LSTM model for prediction, the method further includes:
[0011] Build LSTM model;
[0012] The Adam optimization algorithm is used to optimize the parameters of the LSTM model to obtain an optimized LSTM model.
[0013] In a preferred technical solution of the present invention, the construction of the LSTM model includes:
[0014] Construct the input layer, unidirectional LSTM layer and fully connected output layer;
[0015] Connecting the output end of the input layer to the input end of the LSTM layer;
[0016] Connect the output of the LSTM layer to the input of the fully connected output layer.
[0017] In a preferred technical solution of the present invention, the Adam optimization algorithm is used to optimize the parameters of the LSTM model to obtain an optimized LSTM model, including:
[0018] Determine the parameters to be optimized, and calculate the gradient of the loss function of the Adam optimization algorithm with respect to the parameters to be optimized;
[0019] Calculate a first-order moment estimate and a second-order moment estimate based on the gradient;
[0020] The first-order moment estimate and the second-order moment estimate are updated according to the gradient and the exponential decay rate to obtain an updated first-order moment estimate and an updated second-order moment estimate;
[0021] Performing deviation correction on the updated first-order moment estimate and the second-order moment estimate to obtain a corrected first-order moment estimate and a corrected second-order moment estimate;
[0022] The modified first-order moment estimate and the modified second-order moment estimate are used to update the parameters to be optimized to obtain an optimized LSTM model.
[0023] In a preferred technical solution of the present invention, the inputting the preliminary predicted temperature of the litchi kernel at time k into a Kalman filter for prediction and updating to obtain the final predicted temperature of the litchi kernel at time k comprises:
[0024] Inputting the preliminary predicted temperature of the litchi kernel at time k into a Kalman filter for iterative prediction to obtain a state equation and an observation equation;
[0025] Iteratively updating the state equation and the observation equation to obtain a state update equation, an error covariance matrix update equation, a Kalman gain matrix update equation, a state estimation measurement update equation, and an error covariance matrix measurement update equation;
[0026] The final predicted temperature of the litchi kernel at time k is calculated according to the state estimation measurement update equation.
[0027] In a preferred technical solution of the present invention, before inputting the preliminary predicted temperature of the litchi kernel at time k into the Kalman filter for prediction and update, the method further includes:
[0028] Build a Kalman filter;
[0029] The LSTM model is used as the state transition model of the Kalman filter.
[0030] In a preferred technical solution of the present invention, after obtaining the final predicted temperature of the litchi kernel at time k, the method further includes:
[0031] Calculating the final predicted temperature of the litchi kernel from time k+1 to time k+N;
[0032] The final predicted temperatures of the litchi kernel from time k to time k+N form a litchi kernel predicted temperature sequence;
[0033] Sending the predicted temperature sequence of the litchi kernel to a quick-freezing temperature control system;
[0034] The quick freezing temperature control system is controlled to adjust the valve opening to adjust the temperature in the freezing chamber.
[0035] In a preferred technical solution of the present invention, the preprocessing of the original data to obtain preprocessed data includes:
[0036] Perform outlier elimination on the original data to obtain data after outlier elimination;
[0037] The data after the outliers are removed is normalized to obtain preprocessed data.
[0038] In a preferred technical solution of the present invention, the step of removing outliers from the original data to obtain data after the outliers are removed includes:
[0039] Setting a first temperature threshold, a second temperature threshold and a rotation speed threshold;
[0040] Calculate a first temperature change of the freezing space temperature within a unit time, calculate a second temperature change of the litchi kernel temperature within a unit time, and calculate a speed change of the fan speed within a unit time;
[0041] If the absolute value of the first temperature change is greater than the first temperature threshold, it is determined that the corresponding refrigerated space temperature is abnormal, and an abnormal refrigerated space temperature value is obtained;
[0042] If the absolute value of the second temperature change is greater than the second temperature threshold, it is determined that the corresponding litchi kernel temperature is abnormal, and an abnormal litchi kernel temperature value is obtained;
[0043] If the absolute value of the speed change is greater than the speed threshold, it is determined that the corresponding fan speed is abnormal, and the fan speed abnormality value is obtained;
[0044] The abnormal value of the freezing space temperature, the abnormal value of the litchi kernel temperature and the abnormal value of the fan speed are eliminated from the original data to obtain data after the abnormal value is eliminated.
[0045] In a preferred technical solution of the present invention, the loss function of the Adam optimization algorithm adopts the RMSE function, and the independent variables of the RMSE function are the average temperature of the litchi kernel in the validation set and the predicted value of the litchi kernel temperature of each sample.
[0046] The beneficial effects of the present invention are:
[0047] The method for dynamic prediction of litchi kernel temperature based on deep learning provided by the present invention comprises obtaining raw data, preprocessing the raw data, and obtaining preprocessed data; wherein the raw data comprises freezing space temperature, litchi kernel temperature and fan speed. The preprocessed data is input into the optimized LSTM model for prediction, and the preliminary predicted temperature of the litchi kernel at time k is obtained. The preliminary predicted temperature of the litchi kernel at time k is input into the Kalman filter for prediction and update, and the final predicted temperature of the litchi kernel at time k is obtained. The present invention combines the LSTM model and the Kalman filter to establish a dynamic prediction model for the temperature of the frozen litchi kernel, which can accurately predict the temperature change of the litchi during the freezing process, and provide a basis for controlling the temperature of the frozen litchi kernel, thereby improving the freezing quality of the litchi. The LSTM model can better capture the long-term dependency in the time series data, and use the freezing space temperature to intelligently predict the temperature of the litchi kernel in real time. The Kalman filter has a better effect on linear Gaussian systems and can use the measurement noise covariance matrix to effectively suppress the impact of noise on state estimation, solving the problem that a single neural network is sensitive to noise data and has weak modeling capabilities for time-varying systems, making it difficult to obtain stable prediction results. This enhances the robustness and noise resistance of this aspect in predicting litchi kernel temperature. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a flow chart of the method for dynamic prediction of litchi kernel temperature based on deep learning of the present invention;
[0049] Figure 2 It is a schematic diagram of the Kalman filter of the present invention;
[0050] Figure 3 is a flow chart of the Adam optimization algorithm of the present invention;
[0051] Figure 4 It is a simulation result diagram of the final predicted temperature of the litchi kernel of the present invention. DETAILED DESCRIPTION
[0052] The preferred embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.
[0053] Example 1
[0054] like Figure 1 As shown, this embodiment provides a method for dynamically predicting litchi kernel temperature based on deep learning, including:
[0055] S1: acquiring raw data, and preprocessing the raw data to obtain preprocessed data; wherein the raw data includes a freezing space temperature, a litchi kernel temperature, and a fan speed.
[0056] S2: Input the preprocessed data into the optimized LSTM model for prediction to obtain a preliminary predicted temperature of the litchi kernel at time k.
[0057] S3: Input the preliminary predicted temperature of the litchi kernel at time k into the Kalman filter for prediction and update to obtain the final predicted temperature of the litchi kernel at time k.
[0058] The preprocessing in step S1 includes removing abnormal data and data normalization. The purpose of removing abnormal data is to remove abnormal data and use the remaining real data to predict the litchi kernel temperature. The purpose of data normalization is to unify the freezing space temperature, litchi kernel temperature and fan speed to the same standard.
[0059] Before inputting the preprocessed data into the optimized LSTM model for prediction, the method further includes:
[0060] S21': Build LSTM model.
[0061] S22': Use the Adam optimization algorithm to optimize the parameters of the LSTM model to obtain an optimized LSTM model.
[0062] LSTM (Long Short-Term Memory) is a time recurrent neural network that is specially designed to solve the long-term dependency problem of general RNN (Recurrent Neural Network). The LSTM model has the original version and multiple improved versions.
[0063] In this embodiment, the front-end layer includes an LSTM model, and the high-end layer includes a Kalman filter. The LSTM model is a time series prediction model used to establish the characteristics of the change of litchi kernel temperature over time, as well as the complex change pattern between the litchi kernel temperature, the temperature distribution of the freezing space, and the fan speed extracted through training. The LSTM model is trained using the Adam optimization algorithm, which effectively solves the problem of slow convergence speed and easy precision reduction in the early stage of the stochastic gradient descent algorithm.
[0064] The Kalman filter can receive the preliminary predicted temperature of the litchi kernel at time k provided by the LSTM model, take the preliminary predicted temperature of the litchi kernel at time k as the observation data, fuse and filter the observation data, and output the final predicted temperature of the litchi kernel at time k, providing reliable feedback for the refrigeration control system. The Kalman filter is used to optimize and correct the prediction results of the LSTM model, thereby improving the accuracy and robustness of the process of estimating the final predicted temperature of the litchi kernel.
[0065] After obtaining the final predicted temperature of the litchi kernel at time k, the method further includes:
[0066] S4: Calculate the final predicted temperature of the litchi kernel from time k+1 to time k+N.
[0067] S5: The final predicted temperatures of the litchi kernel from time k to time k+N are combined into a litchi kernel predicted temperature sequence.
[0068] S6: Sending the predicted temperature sequence of the litchi kernel to a quick-freezing temperature control system.
[0069] S7: Control the quick freezing temperature control system to adjust the valve opening to adjust the temperature in the freezing chamber.
[0070] Combining the LSTM model and the Kalman filter can solve the problem that a single neural network is sensitive to noise data and has a weak ability to model time-varying systems, making it difficult to obtain stable prediction results. The temperature prediction results can be directly fed back to the automatic control system of the liquid nitrogen refrigeration equipment. The liquid nitrogen refrigeration equipment can automatically adjust parameters such as the liquid nitrogen valve opening and the fan speed according to the predicted temperature change trend, thereby adjusting the temperature of the freezing space, so that the temperature of the litchi kernel is always kept within the ideal range.
[0071] The deep learning-based dynamic prediction method of litchi kernel temperature provided in this embodiment includes obtaining raw data, preprocessing the raw data, and obtaining preprocessed data; wherein the raw data includes the freezing space temperature, the litchi kernel temperature, and the fan speed. The preprocessed data is input into the optimized LSTM model for prediction to obtain the preliminary predicted temperature of the litchi kernel at time k. The preliminary predicted temperature of the litchi kernel at time k is input into the Kalman filter for prediction and update to obtain the final predicted temperature of the litchi kernel at time k. The present invention combines the LSTM model and the Kalman filter to establish a dynamic prediction model for the temperature of the frozen litchi kernel, which can accurately predict the temperature change of litchi during the freezing process, provide a basis for controlling the temperature of the frozen litchi kernel, and thus improve the freezing quality of litchi. The LSTM model can better capture the long-term dependencies in the time series data, and use the freezing space temperature to make intelligent predictions of the litchi kernel temperature in real time. The Kalman filter has a better effect on linear Gaussian systems and can use the measurement noise covariance matrix to effectively suppress the impact of noise on state estimation, solving the problem that a single neural network is sensitive to noise data and has weak modeling capabilities for time-varying systems, making it difficult to obtain stable prediction results. This enhances the robustness and noise resistance of this aspect in predicting litchi kernel temperature.
[0072] Example 2
[0073] This embodiment provides a method for dynamically predicting litchi kernel temperature based on deep learning. This embodiment only describes the differences from Embodiment 1. Before inputting the preprocessed data into the optimized LSTM model for prediction, it also includes:
[0074] S11': Build LSTM model.
[0075] S12': Use the Adam optimization algorithm to optimize the parameters of the LSTM model to obtain an optimized LSTM model.
[0076] Step S11' includes the following steps S111'-S113':
[0077] S111': Construct the input layer, unidirectional LSTM layer and fully connected output layer.
[0078] S112': Connect the output end of the input layer to the input end of the LSTM layer.
[0079] S113': Connect the output end of the LSTM layer to the input end of the fully connected output layer.
[0080] The input of the input layer is multi-dimensional. This embodiment takes the input as three-dimensional data as an example. The first dimension data is the pre-processed freezing space temperature, the second dimension data is the pre-processed litchi kernel temperature, and the third dimension data is the pre-processed fan speed. The input layer has three input channels. The pre-processed freezing space temperature is input from the first input channel, the pre-processed litchi kernel temperature is input from the second input channel, and the pre-processed fan speed is input from the third input channel.
[0081] The output of the fully connected output layer is one-dimensional. The output of the fully connected layer is the final predicted temperature of the litchi kernel at time k. The LSTM model is a model with multiple inputs and a single output. The unidirectional LSTM layer is controlled by three activation gates, namely the forget gate, input gate, and output gate. The training set of the LSTM model is represented as [xi(t)train, yi(t)train, fi(t)train], and xi(t)train, yi(t)train, and fi(t)train are represented as:
[0082]
[0083] Among them, xi(t)train is the freezer space temperature sequence of the measurement point, yi(t)train is the fan speed sequence, fi(t)train is the litchi kernel temperature sequence, m is the sequence length, a is the first sequence parameter, b is the second sequence parameter, and n is the third sequence parameter. The first element a in the training set is the element of the freezer space temperature sequence, the a+1th element to the a+bth element in the training set are the elements of the fan speed sequence, and the a+b+1th element to the nth element in the training set are the elements of the litchi kernel temperature sequence.
[0084] The refrigerated space temperature sensor is used to collect the refrigerated space temperature sequence, the speed sensor is used to collect the fan speed sequence, and the litchi core temperature sensor is used to collect the litchi core temperature sequence.
[0085] [x i (t)train,y i (t)train,f i The data at time t in (t)train] are recorded as x t ,y t and f t , then the calculation formula for updating the three control gates and unit information of the LSTM model is:
[0086] f t =σ(W f ·[h t-1 , x t ]+B f );
[0087] i t =σ(W i ·[h t-1 , x t ]+B i );
[0088]
[0089] o t =σ(W o ·[h t-1 ,x t ]+B o );
[0090]
[0091] Among them, W f is the weight matrix of the forget gate, W i is the weight matrix of the input gate, W o is the weight matrix of the output gate. f is the bias matrix of the forget gate, B i is the bias matrix of the input gate, B o is the bias matrix of the output gate. t 、i t , C t and t Corresponding to the current moment control forgetting, input, unit state update and output information proportional coefficients, x t 、h t and C t Respectively represent the input, output and unit state at the current moment, h t-1 and C t-1 Represent the output and unit state at the previous moment respectively. represents the matrix element product, σ is the sigmoid activation function, and the output is 0 to 1. tanh is the hyperbolic tangent activation function, and the output is -1 to 1. . represents the dot product.
[0092] The initial predicted temperature of the litchi kernel at time k output by the fully connected output layer of the LSTM model is:
[0093] T k =σ(W y h k +B y );
[0094] Among them, T k is the initial predicted temperature of the litchi kernel at time k, W y is the weight matrix of the fully connected output layer, B y is the bias matrix of the fully connected output layer.
[0095] Figure 3 is a flow chart of the Adam optimization algorithm, wherein the Adam optimization algorithm is used to optimize the parameters of the LSTM model to obtain the optimized LSTM model, including the following steps S121'-S125':
[0096] S121': Determine the parameters to be optimized, and calculate the gradient of the loss function of the Adam optimization algorithm with respect to the parameters to be optimized.
[0097] S122': Calculate a first-order moment estimate and a second-order moment estimate according to the gradient.
[0098] S123': updating the first-order moment estimate and the second-order moment estimate according to the gradient and the exponential decay rate to obtain an updated first-order moment estimate and an updated second-order moment estimate.
[0099] S124': performing deviation correction on the updated first-order moment estimate and the second-order moment estimate to obtain a corrected first-order moment estimate and a corrected second-order moment estimate.
[0100] S125': Use the corrected first-order moment estimate and the corrected second-order moment estimate to update the parameters to be optimized to obtain an optimized LSTM model.
[0101] Initialize the learning rate α to 0.001 and define the parameter to be optimized ω t , each time a batch is iterated, t represents the total number of iterations of the current batch. The loss function of the Adam optimization algorithm adopts the RMSE function, and the independent variables of the RMSE function are the average temperature of the litchi kernel in the validation set and the predicted value of the litchi kernel temperature of each sample.
[0102] The formula for the RMSE function is as follows:
[0103]
[0104] Among them, N V is the total number of samples in the validation set, k is the number of samples in the validation set, yk is the average temperature of the litchi kernel in the validation set, is the predicted value of litchi kernel temperature of the kth sample.
[0105] The formula for updating the first-order moment estimate is as follows:
[0106] m t=β 1 m t-1 +(1-β 1 ) t ;
[0107] Among them, m t is the first-order moment estimate at time t, β 1 is the exponential decay rate of the first-order moment estimate, m t-1 is the first-order moment estimate at time t-1, g t is the gradient of the RMSE function with respect to the parameter to be optimized.
[0108] The formula for updating the second-order moment estimate is as follows:
[0109]
[0110] Among them, V t is the second-order moment estimate at time t, β 2 is the exponential decay rate of the second-order moment estimate, V t-1 is the second-order moment estimate at time t-1.
[0111] The formula for bias correction of the updated first-order moment estimate is:
[0112]
[0113] Among them, m' t is the corrected first-order moment estimate.
[0114] The formula for bias correction of the updated second-order moment estimate is:
[0115]
[0116] Among them, V' t is the corrected second moment estimate.
[0117] The update formula of the parameters to be optimized is:
[0118]
[0119] Among them, ω t+1 is the parameter to be optimized at time t+1, ω t is the parameter to be optimized at time t, α is the learning rate, and eps is a positive number close to 0. In this embodiment, eps is 1*10 -8 For example.
[0120] Before inputting the preliminary predicted temperature of the litchi kernel at time k into the Kalman filter for prediction and updating, the method further includes:
[0121] S23': Establish a Kalman filter.
[0122] S24': Use the LSTM model as the state transition model of the Kalman filter.
[0123] Figure 2 The schematic diagram of the Kalman filter is used to calculate and update the minimum mean square error estimate of the state. The key process of the Kalman filter is to establish the state equation and the observation equation. The LSTM model is used as the state transition model of the Kalman filter. The litchi kernel preliminary predicted temperature T estimated by the LSTM model is LSTM As an observed quantity.
[0124] The step of inputting the preliminary predicted temperature of the litchi kernel at time k into a Kalman filter for prediction and updating to obtain the final predicted temperature of the litchi kernel at time k comprises:
[0125] Inputting the preliminary predicted temperature of the litchi kernel at time k into a Kalman filter for iterative prediction to obtain a state equation and an observation equation;
[0126] Iteratively updating the state equation and the observation equation to obtain a state update equation, an error covariance matrix update equation, a Kalman gain matrix update equation, a state estimation measurement update equation, and an error covariance matrix measurement update equation;
[0127] The final predicted temperature of the litchi kernel at time k is calculated according to the state estimation measurement update equation.
[0128] The iterative update process of the Kalman filter requires the following equations:
[0129] The state update equation is:
[0130]
[0131] The error cosquare matrix update equation is:
[0132]
[0133] The Kalman gain matrix update equation is:
[0134]
[0135] The state estimation measurement update equation is:
[0136]
[0137] The error covariance matrix measurement update equation is:
[0138]
[0139] Among them, T kis the state of the Kalman filter at time k, u k is the input of the Kalman filter at time k. LSTM,k is the measured value of the Kalman filter at time k, that is, the predicted value of the LSTM model. k and B k are the state transfer matrix and the control input matrix, T LSTM,k is the observed value at time k, H k is the transformation matrix from state variables to observations. k is the posterior error covariance matrix, is the prior error covariance matrix. is the posterior state estimate at time k, is the prior state estimate at time k, q k and r k They are system noise and observation noise respectively. The system noise and observation noise are independent of each other and are both Gaussian white noise.
[0140] After repeatedly executing the above five update equations, the final predicted temperature of the litchi kernel at time k is obtained: The final predicted temperature of the litchi kernel at time k The prediction result of litchi kernel temperature value based on LSTM model and Kalman filter is obtained by Matlab simulation to verify the effectiveness of the method of this embodiment. Figure 4 The experimental results are shown.
[0141] The Kalman filter of this embodiment has a better effect on linear Gaussian systems, and can use the measurement noise covariance matrix to effectively suppress the influence of noise on state estimation, solving the problem that a single neural network is more sensitive to noise data and has weak modeling capabilities for time-varying systems, making it difficult to obtain stable prediction results. The robustness and noise resistance of the temperature dynamic prediction method of this embodiment are enhanced. The Matlab simulation prediction results show that the mean absolute error, mean error and root mean square error are 0.66728, -0.072535 and 1.1058, respectively, and the fitting correlation coefficient is 0.94754.
[0142] Example 3
[0143] This embodiment provides a method for dynamically predicting litchi kernel temperature based on deep learning. This embodiment only describes the differences from Embodiment 1. The method of preprocessing the raw data to obtain preprocessed data includes:
[0144] S12: Eliminate outliers from the original data to obtain data after outliers have been eliminated.
[0145] S13: normalizing the data after the outliers are removed to obtain pre-processed data.
[0146] Before step S12, the method further includes step S11: acquiring original data.
[0147] The step of removing outliers from the original data to obtain data after the outliers have been removed includes:
[0148] S121: Setting a first temperature threshold, a second temperature threshold, and a rotation speed threshold.
[0149] S122: Calculate a first temperature change of the freezing space temperature within a unit time, calculate a second temperature change of the litchi kernel temperature within a unit time, and calculate a speed change of the fan speed within a unit time.
[0150] S123: If the absolute value of the first temperature change is greater than the first temperature threshold, it is determined that the corresponding refrigerating space temperature is abnormal, and an abnormal refrigerating space temperature value is obtained.
[0151] S124: If the absolute value of the second temperature change is greater than the second temperature threshold, it is determined that the corresponding litchi kernel temperature is abnormal, and an abnormal litchi kernel temperature value is obtained.
[0152] S125: If the absolute value of the speed change is greater than the speed threshold, it is determined that the corresponding fan speed is abnormal, and an abnormal fan speed value is obtained.
[0153] S126: Eliminate the abnormal value of the freezing space temperature, the abnormal value of the litchi kernel temperature and the abnormal value of the fan speed from the original data to obtain data after the abnormal value is eliminated.
[0154] The purpose of removing abnormal data in this embodiment is to remove abnormal data and use the remaining real data to predict the litchi kernel temperature. The purpose of data normalization is to unify the freezing space temperature, litchi kernel temperature and fan speed to the same standard.
[0155] Example 4
[0156] A computer device is also provided in an embodiment of the present application, which may be a server, wherein the computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store target word vectors, etc. The network interface of the computer device is used to communicate with an external terminal via a network connection. Furthermore, the above-mentioned computer device may also be provided with an input device and a display screen, etc.
[0157] An embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, a method for dynamically predicting the temperature of a litchi kernel based on deep learning is implemented. It can be understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.
[0158] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.
[0159] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for dynamic prediction of litchi kernel temperature based on deep learning, characterized in that: include: Acquire raw data, and preprocess the raw data to obtain preprocessed data; wherein the raw data includes the temperature of the freezing space, the temperature of the litchi kernel, and the speed of the fan; The preprocessed data is input into the optimized LSTM model for prediction to obtain a preliminary predicted temperature of the litchi kernel at time k; The preliminary predicted temperature of the litchi kernel at time k is input into a Kalman filter for prediction and updating to obtain a final predicted temperature of the litchi kernel at time k.
2. The method for dynamic prediction of litchi kernel temperature based on deep learning according to claim 1, characterized in that: Before inputting the preprocessed data into the optimized LSTM model for prediction, the method further includes: Build LSTM model; The Adam optimization algorithm is used to optimize the parameters of the LSTM model to obtain an optimized LSTM model.
3. The method for dynamic prediction of litchi kernel temperature based on deep learning according to claim 2, characterized in that: The LSTM model is constructed, including: Construct the input layer, unidirectional LSTM layer and fully connected output layer; Connecting the output end of the input layer to the input end of the LSTM layer; Connect the output of the LSTM layer to the input of the fully connected output layer.
4. The method for dynamic prediction of litchi kernel temperature based on deep learning according to claim 2, characterized in that: The Adam optimization algorithm is used to optimize the parameters of the LSTM model to obtain an optimized LSTM model, including: Determine the parameters to be optimized, and calculate the gradient of the loss function of the Adam optimization algorithm with respect to the parameters to be optimized; Calculate a first-order moment estimate and a second-order moment estimate based on the gradient; The first-order moment estimate and the second-order moment estimate are updated according to the gradient and the exponential decay rate to obtain an updated first-order moment estimate and an updated second-order moment estimate; Performing deviation correction on the updated first-order moment estimate and the second-order moment estimate to obtain a corrected first-order moment estimate and a corrected second-order moment estimate; The modified first-order moment estimate and the modified second-order moment estimate are used to update the parameters to be optimized to obtain an optimized LSTM model.
5. The method for dynamic prediction of litchi kernel temperature based on deep learning according to claim 1, characterized in that: The step of inputting the preliminary predicted temperature of the litchi kernel at time k into a Kalman filter for prediction and updating to obtain the final predicted temperature of the litchi kernel at time k comprises: Inputting the preliminary predicted temperature of the litchi kernel at time k into a Kalman filter for iterative prediction to obtain a state equation and an observation equation; Iteratively updating the state equation and the observation equation to obtain a state update equation, an error covariance matrix update equation, a Kalman gain matrix update equation, a state estimation measurement update equation, and an error covariance matrix measurement update equation; The final predicted temperature of the litchi kernel at time k is calculated according to the state estimation measurement update equation.
6. The method for dynamic prediction of litchi kernel temperature based on deep learning according to claim 1, characterized in that: Before inputting the preliminary predicted temperature of the litchi kernel at time k into the Kalman filter for prediction and updating, the method further includes: Build a Kalman filter; The LSTM model is used as the state transition model of the Kalman filter.
7. The method for dynamic prediction of litchi kernel temperature based on deep learning according to claim 1, characterized in that: After obtaining the final predicted temperature of the litchi kernel at time k, the method further includes: Calculating the final predicted temperature of the litchi kernel from time k+1 to time k+N; The final predicted temperatures of the litchi kernel from time k to time k+N form a litchi kernel predicted temperature sequence; Sending the predicted temperature sequence of the litchi kernel to a quick-freezing temperature control system; The quick freezing temperature control system is controlled to adjust the valve opening to adjust the temperature in the freezing chamber.
8. The method for dynamic prediction of litchi kernel temperature based on deep learning according to claim 1, characterized in that: The preprocessing of the original data to obtain preprocessed data includes: Perform outlier elimination on the original data to obtain data after outlier elimination; The data after the outliers are removed is normalized to obtain preprocessed data.
9. The method for dynamic prediction of litchi kernel temperature based on deep learning according to claim 8, characterized in that: The step of removing outliers from the original data to obtain data after the outliers have been removed includes: Setting a first temperature threshold, a second temperature threshold and a rotation speed threshold; Calculate a first temperature change of the freezing space temperature within a unit time, calculate a second temperature change of the litchi kernel temperature within a unit time, and calculate a speed change of the fan speed within a unit time; If the absolute value of the first temperature change is greater than the first temperature threshold, it is determined that the corresponding refrigerated space temperature is abnormal, and an abnormal refrigerated space temperature value is obtained; If the absolute value of the second temperature change is greater than the second temperature threshold, it is determined that the corresponding litchi kernel temperature is abnormal, and an abnormal litchi kernel temperature value is obtained; If the absolute value of the speed change is greater than the speed threshold, it is determined that the corresponding fan speed is abnormal, and the fan speed abnormality value is obtained; The abnormal value of the freezing space temperature, the abnormal value of the litchi kernel temperature and the abnormal value of the fan speed are eliminated from the original data to obtain data after the abnormal value is eliminated.
10. The method for dynamic prediction of litchi kernel temperature based on deep learning according to claim 4, characterized in that: The loss function of the Adam optimization algorithm adopts the RMSE function, and the independent variables of the RMSE function are the average temperature of the litchi kernel in the validation set and the predicted value of the litchi kernel temperature of each sample.
Citation Information
Cited By
Modeling method of temperature prediction model for efficient litchi thawing
CN120046506A
Modeling method of litchi fresh-keeping and unfreezing temperature control model based on thermodynamic model in electromagnetic field
CN120065699A
Modeling method of temperature control model for litchi preservation and thawing based on thermodynamic model in electromagnetic field
CN120065699B
