CN116720620A - Grain storage ventilation temperature prediction method based on IPSO algorithm optimization CNN-BiGRU-Attention network model - Google Patents

Grain storage ventilation temperature prediction method based on IPSO algorithm optimization CNN-BiGRU-Attention network model Download PDF

Info

Publication number
CN116720620A
CN116720620A CN202310684014.9A CN202310684014A CN116720620A CN 116720620 A CN116720620 A CN 116720620A CN 202310684014 A CN202310684014 A CN 202310684014A CN 116720620 A CN116720620 A CN 116720620A
Authority
CN
China
Prior art keywords
bigru
cnn
grain
attention
model
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
Application number
CN202310684014.9A
Other languages
Chinese (zh)
Inventor
吕宗旺
柳航
王玉琦
孙福艳
甄彤
杨智清
王甜甜
牛贺杰
王琼
龚春艳
范泽仑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Henan University of Technology
Original Assignee
Henan University of Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Henan University of Technology filed Critical Henan University of Technology
Priority to CN202310684014.9A priority Critical patent/CN116720620A/en
Publication of CN116720620A publication Critical patent/CN116720620A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D21/00Measuring or testing not otherwise provided for
    • G01D21/02Measuring two or more variables by means not covered by a single other subclass
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial 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]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • G06N3/0442Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/0985Hyperparameter optimisation; Meta-learning; Learning-to-learn
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • G06Q10/087Inventory or stock management, e.g. order filling, procurement or balancing against orders
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/02Agriculture; Fishing; Forestry; Mining

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Economics (AREA)
  • Biophysics (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Human Resources & Organizations (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Tourism & Hospitality (AREA)
  • Operations Research (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Development Economics (AREA)
  • Quality & Reliability (AREA)
  • Accounting & Taxation (AREA)
  • Primary Health Care (AREA)
  • Game Theory and Decision Science (AREA)
  • Mining & Mineral Resources (AREA)
  • Marine Sciences & Fisheries (AREA)
  • Animal Husbandry (AREA)
  • Agronomy & Crop Science (AREA)
  • Finance (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a grain pile temperature prediction method in a grain storage ventilation process based on a CNN-Attention-BiGRU network model and adopting an IPSO optimization network model super parameter, which comprises the following steps: (1) The grain condition data acquired in real time are acquired in advance, are preprocessed and are divided into a training set and a testing set; (2) Constructing a CNN-Attention-BiGRU deep learning network, extracting data features by using CNN-Attention, and predicting a time sequence by using BiGRU; (3) Optimizing a CNN-Attention-BiGRU mixed prediction model by using an improved IPSO algorithm; (4) Training the established IPSO-CNN-attribute-BiGRU model by using a training set, and sending a test set into the trained model for operation to obtain a prediction result; the invention fully considers the characteristics of nonlinearity, time sequence and the like of the temperature of the grain storage ventilation grain pile, realizes the automatic acquisition of optimal model parameters, and effectively compensates for the fan loss and grain damage caused by the fact that the traditional mechanical ventilation can not accurately identify ventilation time.

Description

Grain storage ventilation temperature prediction method based on IPSO algorithm optimization CNN-BiGRU-Attention network model
Technical Field
The invention relates to the field of grain safety, in particular to a grain storage ventilation temperature prediction method based on an IPSO algorithm optimization CNN-BiGRU-Attention.
Background
Grain has been closely related to social stability, so countries maintain a certain amount of grain reserves each year; however, in the grain storage process, the grain loss is inevitably caused due to the problems of inaccurate grain condition grasp, untimely ventilation and the like; the traditional grain storage ventilation control method only makes judgment based on real-time grain condition information, lacks the ability of forecasting ventilation, and is easy to cause the problems of untimely ventilation and the like.
In recent years, intelligent ventilation is gradually applied to grain depot storage, in the intelligent ventilation, the key is temperature prediction of grain piles, most of previous research methods are to analyze temperature change curves by adopting mathematical modeling, and the nonlinearity and the non-stationarity of the grain pile temperature data cause certain difficulty in processing, so that deep learning is an effective method for processing the nonlinearity problem, and the intelligent ventilation is successfully applied to grain depot temperature prediction.
Because the conventional CNN model has weak recognition capability for high-dimensional features when features are extracted, although the biglu model has advantages in terms of prediction of short-time sequences, there is a certain limitation in terms of prediction of multi-dimensional long-sequence data such as reserve temperature, because time-sequence information is not completely mined, and in order to solve the problems, attention mechanisms (Attention) are introduced, which can weight input data and assign different probability weights to different features, so that the prediction accuracy and capability of the model are improved.
The neural network may be in a problem of local optimization when training a model, a particle swarm algorithm is used for optimizing an initial weight and a threshold value of the model when initializing the network, the network weight is adjusted to a region near a global optimal solution to avoid the model from being in a local extremum, the particle swarm algorithm is a swarm intelligent optimization algorithm obtained according to a bird foraging process, all particles are mutually coordinated when searching the optimal solution, global optimization is realized continuously and iteratively, and the particle swarm algorithm is characterized by simple parameters and high convergence speed and is widely applied to multiple fields such as solving the model, optimizing the structure and the like.
Disclosure of Invention
The method aims at solving the problem that the existing traditional method has low real-time performance and accuracy in predicting the ventilation safety of the stored grains. The invention provides a grain storage ventilation temperature prediction method based on an IPSO algorithm optimization CNN-BiGRU-Attention, which adopts a prediction model based on improvement and has the main advantages that: (1) Firstly, an Attention is added into a CNN model, so that the accuracy of high-dimensional feature extraction is solved, and the sensitivity of a prediction model to sample input can be greatly improved by using a feature selection strategy based on Attention; (2) The time characteristics are further extracted by using the BiGRU, and a serially connected deep learning granary temperature prediction model is provided, so that the deep learning model has strong static and dynamic characteristic extraction capacity, and the prediction precision is greatly improved; (3) The intelligent group algorithm is adopted to search out the optimal super-parameters of the deep learning network, so that the inaccuracy of the artificial parameter adjustment is overcome; the standard particle swarm search algorithm is improved, so that the convergence effect of the algorithm is better, the defect of early warning of the grain condition storage safety state is effectively overcome, the grain storage safety is ensured, and the grain storage loss is reduced.
In particular, the invention provides a grain storage ventilation temperature prediction method based on an IPSO algorithm optimization CNN-BiGRU-Attention, which comprises the following steps:
s1, acquiring grain condition data of stored grains by using a sensor, wherein the grain condition data comprise grain pile temperature, grain bin humidity, atmospheric temperature, atmospheric humidity, vent temperature, vent humidity and vent wind speed;
s2, filling missing values and normalizing the grain condition data, and dividing the grain condition data into a training set and a testing set according to a proportion;
s3, constructing an input feature vector at the moment of a predicted point, inputting the preprocessed feature vector into a CNN network, extracting static features of the feature vector through operations such as convolution, pooling and the like of the CNN network, inputting the static features extracted by the CNN network into a hidden layer of a BiGRU network for feature extraction, and calculating the feature vector extracted by the hidden layer by utilizing an attribute mechanism to obtain a CNN-BiGRU-attribute model;
s4, performing improved particle swarm optimization on the CNN-BiGRU-Attention model constructed in the step S3 by using training set data in the step S2, determining optimal parameters of a network model CNN-BiGRU-Attention on the basis of meeting optimal evaluation indexes of a prediction model, and reestablishing an optimized network model IPSO-CNN-BiGRU-Attention on the basis of the optimal parameters;
s5: and (3) using the test set data obtained in the step (S2) as input variables of the optimized network model IPOS-CNN-BiGRU-Attention in the step (S4), and finally outputting to obtain the grain storage ventilation temperature prediction data.
Further, the step S2 includes the following steps:
s2.1: the missing value of the grain condition data enables the average value of the adjacent time to be filled up, and the formula is as follows:
wherein: s is S t Is grain condition data at the moment;
s2.2: the data normalization formula is as follows:
wherein: s is grain condition data obtained after normalization treatment; smin is the minimum value of grain condition data; smax is the maximum value of grain condition data; s is grain condition data;
further, the step S3 of CNN-Attention-BiGRU comprises the following steps:
s3.1, an input layer: combining the grain storage ventilation process data as an input layer of the model; the input data may be represented as a matrix x= [ X of N (m+1) 1 ,x 2 ,…,x n ]Where N is the data length, x= [ t, c 1 ,c 2 ,…,c m ];
S3.2, CNN-Attention layer: the layer structure combines a CNN network with an attention mechanism to improve the characteristic attention; the method comprises the steps of adopting a double-layer CNN structure, outputting characteristics through a full connection layer, extracting important characteristics through an attention mechanism, and finally outputting characteristic vectors through characteristic weight vector processing;
s3.3, biGRU layer: the BiGRU layer has the main function of predicting the feature vector extracted from the previous layer as learning; biGRU is a two-way learning model; the BiGRU can express the bidirectional rule between a plurality of inputs and outputs, and is suitable for exploring a mechanism of the stimulation performance from related historical data; the BiGRU can consider the forward and backward dependency relationship at the same time, and consists of forward GRU and backward GRU, and the basic formula is represented by formulas (3) - (7);
z T =σ(W z ·[h T-1 ,x T ]+b z )
(3)
r T =σ(W r ·[h T-1 ,x T ]+b r )
(4)
wherein: sigma is a Sigmoid activation function, converting the input value between intervals (0, 1); x is x T An input matrix with a time step length of T; h is a T-1 A hidden state for the previous time T-1; w (W) z Updating a weight matrix of the gate; w (W) r A weight matrix for the reset gate; b z To update the bias matrix of the gate; b r A weight matrix for the reset gate;
the candidate hidden layer state may be defined as:
the hidden layer state may be defined as:
wherein: w (W) h A weight matrix for the candidate hidden state; b h A bias matrix for the candidate hidden state;a candidate hidden state for time T; h is a T A hidden state for time T;
wherein: y is Y t Calculation for reverse transfer;and->The hidden states of the forward GRU and the backward GRU; f is 2-direction output combining method such as multiplication function, average function, summation function, etc.;
s3.4, an output layer: and outputting a grain pile temperature prediction result: the output layer calculations are shown below:
y t =Sigmoid(w r r t +b) (8)
wherein: w (w) r And r t The weight and the bias of the full connection layer are respectively; r is (r) t For the output of BiGRU layer, y t =[y 1 ,y 2 ,...,y m ]To output the result.
Further, the process of optimizing the CNN-Attention-biglu network prediction model using the modified particle swarm IPSO in the step S4 is as follows:
s4.1 initializing parameters of the CNN-BiGRU-Attention mixed model constructed in the step S3, setting respective value ranges and search ranges of neuron number m and learning rate epsilon, and determining the maximum iteration times T max And the maximum value w of the mass scale ps and the inertia weight omega max And a minimum value w min Maximum and minimum acceleration factors c1, c 2;
w max ,w min respectively maximum and minimum weights, k max And k is equal to n The maximum iteration times and the current iteration times are respectively;
s4.2 initializing the particle swarm position in the sample set X, calculating the individual level value p according to the formula (10) i Calculating population extremum p according to equation (11) g Initializing each particle according to formula (12)A speed;
s4.3 updating the particle position according to the formula (13), updating the individual fitness value and the group fitness value at the moment, and recording the individual extremum p at the moment i And global extremum p g
S4.4, calculating the fitness value of each particle according to the fitness function formula (14), and updating the individual extremum p i And global extremum p g Updating group velocity according to (12)
S4.5 judging whether the iteration number reaches k at the moment max Or p g Less than the relative error; if yes, the optimal particles are assigned to the BiGRU model gating unit weight, otherwise, k=k+1, and the step (S4.3) is returned;
s4.6, training the BiGRU model with the optimal weight found by the IPSO algorithm according to formulas (3) - (8), and outputting a predicted value of the temperature of the grain storage ventilation grain pile.
Further, the prediction result obtained in the step S4 uses mean absolute percentage error MAE, root mean square error RMSE, and decision coefficient R 2 Performing model evaluation on three evaluation indexes, wherein the formula is as follows:
wherein: r is R 2 Are often used to represent predicted values and actual value variances;and Y i Respectively a grain temperature predicted value and an actual grain temperature of an ith sample; />Is the average value of the actual grain temperature; n (N) * Is the number of samples.
The beneficial technical effects of the invention are as follows:
the invention provides a grain storage ventilation temperature prediction method based on an IPSO algorithm optimization CNN-BiGRU-Attention; the prediction model has the main advantages that: (1) Firstly, an Attention is added into a CNN model, so that the accuracy of high-dimensional feature extraction is solved, and the sensitivity of a prediction model to sample input can be greatly improved by using a feature selection strategy based on Attention; (2) The time characteristics are further extracted by using the BiGRU, and a serial-connection deep learning grain storage ventilation temperature prediction model is provided, so that the deep learning model has strong static and dynamic characteristic extraction capacity, and the prediction precision is greatly improved; (3) The intelligent group algorithm is adopted to search out the optimal super-parameters of the deep learning network, so that the inaccuracy of the artificial parameter adjustment is overcome; the standard particle swarm search algorithm is improved, so that the convergence effect of the algorithm is better.
Drawings
FIG. 1 is a diagram of a CNN-BiGRU neural network model based on an attention mechanism of the present invention.
FIG. 2 is a flow chart of the optimization of network weights by the IPSO algorithm of the present invention.
FIG. 3 is a flow chart of a method for predicting the ventilation temperature of stored grains according to the invention.
Fig. 4 is a diagram of the CNN network structure of the present invention.
FIG. 5 is a block diagram of a BIGRU network of the invention.
Fig. 6 is a graph of the iterative result.
Fig. 7BP prediction result graph.
FIG. 8BiGRU prediction result graph.
FIG. 9BiGRU-Attention prediction result graph.
FIG. 10 is a graph of CNN-BiGRU-Attention prediction results.
FIG. 11 is a graph of PSO-CNN-BiGRU-Attention prediction results.
FIG. 12 model predictive outcome plots herein.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention; all other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
FIG. 1 is a diagram of a CNN-BiGRU neural network model based on an attention mechanism of the present invention. FIG. 2 is a flow chart of the optimization of network weights by the IPSO algorithm of the present invention. FIG. 3 is a flow chart of a method for predicting the ventilation temperature of stored grains according to the invention.
Fig. 4 is a diagram of the CNN network structure of the present invention. FIG. 5 is a block diagram of a BIGRU network of the invention. Fig. 6 is a graph of the iterative result. Fig. 7BP prediction result. FIG. 8BiGRU prediction results. FIG. 9BiGRU-Attention prediction results. FIG. 10CNN-BiGRU-Attention prediction results. FIG. 11PSO-CNN-BiGRU-Attention prediction results. FIG. 12 model predictive results herein.
The invention provides a grain storage ventilation temperature prediction method based on an IPSO optimized CNN-BiGRU-Attention mixed model, which comprises the following steps:
s1, acquiring grain condition data of stored grains by using a sensor, wherein the grain condition data comprise grain pile temperature, grain bin humidity, atmospheric temperature, atmospheric humidity, vent temperature, vent humidity and vent wind speed;
s2, filling missing values and normalizing the grain condition data, and dividing the grain condition data into a training set and a testing set according to a proportion;
s3, constructing an input feature vector at the moment of a predicted point, inputting the preprocessed feature vector into a CNN network, extracting static features of the feature vector through operations such as convolution, pooling and the like of the CNN network, inputting the static features extracted by the CNN network into a hidden layer of a BiGRU network for feature extraction, and calculating the feature vector extracted by the hidden layer by utilizing an attribute mechanism to obtain a CNN-BiGRU-attribute model;
s4, performing improved particle swarm optimization on the CNN-BiGRU-Attention model constructed in the step S3 by using training set data in the step S2, determining optimal parameters of a network model CNN-BiGRU-Attention on the basis of meeting optimal evaluation indexes of a prediction model, and reestablishing an optimized network model IPSO-CNN-BiGRU-Attention on the basis of the optimal parameters;
s5: and (3) using the test set data obtained in the step (S2) as input variables of the optimized network model IPOS-CNN-BiGRU-Attention in the step (S4), and finally outputting to obtain the grain storage ventilation temperature prediction data.
Further, the step S2 includes the following steps:
s2.1: the missing value of the grain condition data enables the average value of the adjacent time to be filled up, and the formula is as follows:
wherein: s is S t Is grain condition data at the moment;
s2.2: the data normalization formula is as follows:
wherein: s is grain condition data obtained after normalization treatment; smin is the minimum value of grain condition data; smax is the maximum value of grain condition data; s is grain condition data.
Further, the step S3 of CNN-Attention-BiGRU comprises the following steps:
s3.1, an input layer: combining the grain storage ventilation process data as an input layer of the model, the input data can be represented as a matrix x= [ X ] of N (m+1) 1 ,x 2 ,…,x n ]Where N is the data length, x= [ t, c 1 ,c 2 ,…,c m ];
S3.2, CNN-Attention layer: the layer structure combines a CNN network and an attention mechanism to improve the purpose of feature attention, wherein a double-layer CNN structure is adopted to output features through a full-connection layer, important features are extracted through the attention mechanism, and finally feature vectors are output through feature weight vector processing;
s3.3, biGRU layer: the BiGRU layer has the main function of predicting the feature vector extracted from the previous layer as learning, and the BiGRU is a bidirectional learning model; the BiGRU can express the bidirectional law between a plurality of inputs and outputs, is suitable for exploring the mechanism of the stimulation performance from the related historical data, can consider the forward and backward dependency relationship at the same time, and consists of forward GRU and backward GRU, and the basic formula is shown as formulas (3) - (7);
z T =σ(W z ·[h T-1 ,x T ]+b z )
(3)
r T =σ(W r ·[h T-1 ,x T ]+b r )
(4)
wherein: sigma is a Sigmoid activation function, converting the input value between intervals (0, 1); x is x T An input matrix with a time step length of T; h is a T-1 A hidden state for the previous time T-1; w (W) z Updating a weight matrix of the gate; w (W) r To resetA weight matrix of gates; b z To update the bias matrix of the gate; b r A weight matrix for the reset gate;
the candidate hidden layer state may be defined as:
the hidden layer state may be defined as:
wherein: w (W) h A weight matrix for the candidate hidden state; b h A bias matrix for the candidate hidden state;a candidate hidden state for time T; h is a T A hidden state for time T;
wherein: y is Y t Calculation for reverse transfer;and->The hidden states of the forward GRU and the backward GRU; f is 2-direction output combining method such as multiplication function, average function, summation function, etc.;
s3.4, an output layer: and outputting a grain pile temperature prediction result: the output layer calculations are shown below:
y t =Sigmoid(w r r t +b)
(8)
wherein: w (w) r And r t The weight and the bias of the full connection layer are respectively; r is (r) t For the output of BiGRU layer, y t =[y 1 ,y 2 ,...,y m ]To output the result.
Further, the process of optimizing the CNN-Attention-biglu network prediction model using the modified particle swarm IPSO in the step S4 is as follows:
s4.1 initializing parameters of the CNN-BiGRU-Attention mixed model constructed in the step S3, setting respective value ranges and search ranges of neuron number m and learning rate epsilon, and determining the maximum iteration times T max And the maximum value w of the mass scale ps and the inertia weight omega max And a minimum value w min Maximum and minimum acceleration factors c1, c 2;
w max ,w min respectively the maximum and minimum weights; k (k) max And k is equal to n The maximum iteration times and the current iteration times are respectively;
s4.2 initializing the particle swarm position in the sample set X, calculating the individual level value p according to the formula (10) i Calculating population extremum p according to equation (11) g Initializing a velocity of each particle according to equation (12);
s4.3 updating the particle position according to the formula (13), updating the individual fitness value and the group fitness value at the moment, and recording the individual extremum p at the moment i And global extremum p g
S4.4, calculating the fitness value of each particle according to the fitness function formula (14), and updating the individual extremum p i And global extremum p g Updating group velocity according to (12)
S4.5 judging whether the iteration number reaches k at the moment max Or p g Less than the relative error; if yes, the optimal particles are assigned to the BiGRU model gating unit weight, otherwise, k=k+1, and the step (S4.3) is returned;
s4.6, training the BiGRU model with the optimal weight found by the IPSO algorithm according to formulas (3) - (8), and outputting a predicted value of the temperature of the grain storage ventilation grain pile.
Further, the prediction result obtained in the step S4 uses mean absolute percentage error MAPE, root mean square error RMSE, and decision coefficient R 2 Performing model evaluation on three evaluation indexes, wherein the formula is as follows:
wherein: r is R 2 Are often used to represent predicted values and actual value variances;and Y i Respectively a grain temperature predicted value and an actual grain temperature of an ith sample; />Is the average value of the actual grain temperature; n (N) * Is the number of samples.
It should be further explained that the present embodiment has characteristics of complexity and time sequence aiming at factors affecting the change of the ventilation temperature of the stored grain, and the existing deep learning prediction method has the defect of selecting parameters according to experience, and provides a method for predicting the ventilation temperature of the stored grain based on optimization of the CNN-BiGRU-Attention by using the IPSO algorithm, wherein the CNN convolutional neural network is firstly utilized to fully extract high-dimensional characteristics in data, and then the ventilation Attention mechanism carries out weight training on the extracted high-dimensional characteristics, and the high-dimensional characteristics are constructed into a time sequence to be input into a BiGRU bidirectional gating circulation unit network model; and then, carrying out iterative optimization on super parameters (the number of hidden layer neurons and the learning rate) in the bidirectional gating circulation unit model by using an improved particle swarm algorithm, obtaining optimal parameters on the premise of highest prediction accuracy, and finally, completing the prediction of the grain storage ventilation temperature.
Examples: taking a grain depot of elm of Jilin province as a test object, respectively acquiring data of grain pile temperature, in-bin humidity, in-bin temperature, external environment humidity, vent wind speed, vent temperature and vent humidity every 30min during ventilation operation, and acquiring 2500 groups of data in total; in the test, the first 2000 groups of data are selected according to the time sequence order to be used in training, and the remaining 500 groups are used for testing;
optimizing network parameters by adopting an IPSO algorithm aiming at the constructed CNN-BiGRU-Attention neural network; the population scale of the IPSO algorithm is set to be 50, learning factors c1=c2=2, ω are dynamically updated by adopting a formula (9), r1=0.8, and r2=0.4, and the maximum iteration number is preset to be 500 before the grain pile temperature is predicted by using a model because the training time is influenced by the selection of the iteration number; FIG. 6 is a graph of fitness obtained after training.
By combining with an evaluation index, the IPSO-CNN-BiGRU-Attention mixed model provided by the invention is compared and analyzed with other prediction models, and the prediction result shows that the BP neural network model has the worst effect, wherein RMSE is 0.1245 and R 2 0.8542; GRU and BiGRU have better prediction effect than BP neural network, wherein RMSE value is reduced, R 2 The value is improved; RMSE and R of CNN-BiGRU model 2 0.0958,0.9172, reduced by 0.0067 compared to BiGRU model RMSE, R 2 The method improves 0.026, and the CNN has good effect on the processing of multiple feature dimensions, and the prediction effect is improved after the attention mechanism is added on the basis; in the method, the IPSO algorithm is adopted to optimize the model super-parameters, the obtained RMSE is 0.0468, R 2 For 0.9825, the RMSE was reduced by 0.0288, R compared to the CNN-Attention-BiGRU model 2 The prediction effect is improved by 0.033 8, and the prediction effect is the best in the comparison model. The prediction method adopting the IPSO optimization model CNN-Attention-BiGRU super parameter is better than other models in prediction effect.
Table 1 comparison of different prediction models
Model RMSE MAE R 2
BP 0.1245 0.0819 0.8542
GRU 0.1102 0.0780 0.8836
BIGRU 0.1026 0.0724 0.8912
CNN-BIGRU 0.0959 0.0446 0.9172
CNN-ATTENTION-BIGRU 0.0757 0.0346 0.9487
Model herein 0.0469 0.0315 0.9825
According to the grain storage ventilation temperature prediction method based on the improved particle swarm optimization CNN-BiGRU-Attention mixed model (IPSO-CNN-BiGRU-Attention), the optimal parameters of the bidirectional gate control circulation unit network model can be quickly searched and determined, the training efficiency is high, the problems of insufficient model fitting capability and low prediction precision caused by selecting parameters according to experience are solved, the grain storage ventilation temperature prediction precision is further improved, the fan loss is reduced, the energy is saved, and the grain quality is guaranteed.
The foregoing is only a preferred embodiment of the invention, it being noted that: it will be apparent to those skilled in the art that various modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the invention.

Claims (5)

1. The grain storage ventilation temperature prediction method based on the IPSO algorithm optimization CNN-BiGRU-Attention is characterized by comprising the following steps:
s1, acquiring grain condition data of stored grains by using a sensor, wherein the grain condition data comprise grain pile temperature, grain bin humidity, atmospheric temperature, atmospheric humidity, vent temperature, vent humidity and vent wind speed;
s2, filling missing values and normalizing the grain condition data, and dividing the grain condition data into a training set and a testing set according to a proportion;
s3, constructing an input feature vector at the moment of a predicted point, inputting the preprocessed feature vector into a CNN network, extracting static features of the feature vector through operations such as convolution, pooling and the like of the CNN network, inputting the static features extracted by the CNN network into a hidden layer of a BiGRU network for feature extraction, and calculating the feature vector extracted by the hidden layer by utilizing an attribute mechanism to obtain a CNN-BiGRU-attribute model;
s4, performing improved particle swarm optimization on the CNN-BiGRU-Attention model constructed in the step S3 by using training set data in the step S2, determining optimal parameters of a network model CNN-BiGRU-Attention on the basis of meeting optimal evaluation indexes of a prediction model, and reestablishing an optimized network model IPSO-CNN-BiGRU-Attention on the basis of the optimal parameters;
s5: and (3) using the test set data obtained in the step (S2) as input variables of the optimized network model IPOS-CNN-BiGRU-Attention in the step (S4), and finally outputting to obtain the grain storage ventilation temperature prediction data.
2. The method for predicting the ventilation temperature of the stored grains based on the optimization of the CNN-biglu-attribute by the IPSO algorithm according to claim 1, wherein the step S2 comprises the steps of:
s2.1: the missing value of the grain condition data enables the average value of the adjacent time to be filled up, and the formula is as follows:
wherein: s is S t Is grain condition data at the moment;
s2.2: the data normalization formula is as follows:
wherein: s is grain condition data obtained after normalization treatment; smin is the minimum value of grain condition data; smax is the maximum value of grain condition data; s is grain condition data.
3. The method for predicting the ventilation temperature of the grain storage based on the optimization of the CNN-biglu-Attention by the IPSO algorithm according to claim 1, wherein the CNN-Attention-biglu in the step S3 comprises the steps of:
s3.1 input layer: combining the grain storage ventilation process data as an input layer of the model; the input data may be represented as a matrix x= [ X of N (m+1) 1 ,x 2 ,…,x n ]Where N is the data length, x= [ t, c 1 ,c 2 ,…,c m ],
S3.2, CNN-Attention layer: the layer structure combines a CNN network with an attention mechanism to improve the characteristic attention; the method comprises the steps of adopting a double-layer CNN structure, outputting characteristics through a full connection layer, extracting important characteristics through an attention mechanism, and finally outputting characteristic vectors through characteristic weight vector processing;
s3.3, biGRU layer: the BiGRU layer has the main function of predicting the feature vector extracted from the previous layer as learning; biGRU is a two-way learning model; the BiGRU can express the bidirectional rule between a plurality of inputs and outputs, and is suitable for exploring a mechanism of the stimulation performance from related historical data; the BiGRU can consider the forward and backward dependency relationship at the same time, and consists of forward GRU and backward GRU, and the basic formula is represented by formulas (3) - (7);
z T =σ(W z ·[h T-1 ,x T ]+b z ) (3)
r T =σ(W r ·[h T-1 ,x T ]+b r ) (4)
wherein: sigma is a Sigmoid activation function, converting the input value between intervals (0, 1); x is x T An input matrix with a time step length of T; h is a T-1 A hidden state for the previous time T-1; w (W) z Updating a weight matrix of the gate; w (W) r A weight matrix for the reset gate; b z To update the bias matrix of the gate; b r A weight matrix for the reset gate;
the candidate hidden layer state may be defined as:
(5)
the hidden layer state may be defined as:
(6)
wherein: w (W) h A weight matrix for the candidate hidden state; b h A bias matrix for the candidate hidden state;a candidate hidden state for time T; h is a T A hidden state for time T;
wherein: y is Y t Calculation for reverse transfer;and->The hidden states of the forward GRU and the backward GRU; f is an output combining method of 2 directions;
s3.4, an output layer: and outputting a grain pile temperature prediction result: the output layer calculations are shown below:
y t =Sigmoid(w r r t +b)
(8)
wherein: w (w) r And r t The weight and the bias of the full connection layer are respectively; r is (r) t For the output of BiGRU layer, y t =[y 1 ,y 2 ,...,y m ]To output the result.
4. The grain storage ventilation temperature prediction method based on IPSO algorithm optimization CNN-biglu-Attention of claim 1, wherein the procedure of using modified particle swarm IPSO optimization CNN-Attention-biglu network prediction model in step S4 is as follows:
s4.1 initializing parameters of the CNN-BiGRU-Attention mixed model constructed in the step S3, setting respective value ranges and search ranges of neuron number m and learning rate epsilon, and determining the maximum iteration times T max And the maximum value w of the mass scale ps and the inertia weight omega max And a minimum value w min Maximum and minimum acceleration factors c1, c 2;
(9)
w max ,w min respectively the maximum and minimum weights; k (k) max And k is equal to n The maximum iteration times and the current iteration times are respectively;
s4.2 calculating the individual level value p at this time according to equation (10) i Calculating population extremum p according to equation (11) g According to formula (12)Initializing the velocity of each particle;
s4.3 updating the particle position according to the formula (13), updating the individual fitness value and the group fitness value at the moment, and recording the individual extremum p at the moment i And global extremum p g
S4.4, calculating the fitness value of each particle according to the fitness function formula (14), and updating the individual extremum p i And global extremum p g Updating group velocity according to (12)
S4.5 judging whether the iteration number reaches k at the moment max Or p g Less than the relative error; if yes, the optimal particles are assigned to the BiGRU model gating unit weight, otherwise, k=k+1, and the step (S4.3) is returned;
s4.6, training the BiGRU model with the optimal weight found by the IPSO algorithm according to formulas (3) - (8), and outputting a predicted value of the temperature of the grain storage ventilation grain pile.
5. The grain storage ventilation temperature prediction method based on the IPSO algorithm optimization CNN-BiGRU-Attention of claim 1, wherein,the prediction result obtained in the step S4 uses the mean absolute error MAE, the root mean square error RMSE and the determination coefficient R 2 Performing model evaluation on three evaluation indexes, wherein the formula is as follows:
wherein: r is R 2 Are often used to represent predicted values and actual value variances;and Y i Respectively a grain temperature predicted value and an actual grain temperature of an ith sample; />Is the average value of the actual grain temperature; n (N) * Is the number of samples.
CN202310684014.9A 2023-06-10 2023-06-10 Grain storage ventilation temperature prediction method based on IPSO algorithm optimization CNN-BiGRU-Attention network model Pending CN116720620A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310684014.9A CN116720620A (en) 2023-06-10 2023-06-10 Grain storage ventilation temperature prediction method based on IPSO algorithm optimization CNN-BiGRU-Attention network model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310684014.9A CN116720620A (en) 2023-06-10 2023-06-10 Grain storage ventilation temperature prediction method based on IPSO algorithm optimization CNN-BiGRU-Attention network model

Publications (1)

Publication Number Publication Date
CN116720620A true CN116720620A (en) 2023-09-08

Family

ID=87872851

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310684014.9A Pending CN116720620A (en) 2023-06-10 2023-06-10 Grain storage ventilation temperature prediction method based on IPSO algorithm optimization CNN-BiGRU-Attention network model

Country Status (1)

Country Link
CN (1) CN116720620A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117426758A (en) * 2023-12-20 2024-01-23 武汉纺织大学 Intelligent clothing system and method based on multi-sensing information fusion
CN117686555A (en) * 2024-02-04 2024-03-12 南京邮电大学 LC humidity sensor drift compensation method based on machine learning

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117426758A (en) * 2023-12-20 2024-01-23 武汉纺织大学 Intelligent clothing system and method based on multi-sensing information fusion
CN117426758B (en) * 2023-12-20 2024-04-05 武汉纺织大学 Intelligent clothing system and method based on multi-sensing information fusion
CN117686555A (en) * 2024-02-04 2024-03-12 南京邮电大学 LC humidity sensor drift compensation method based on machine learning
CN117686555B (en) * 2024-02-04 2024-05-14 南京邮电大学 LC humidity sensor drift compensation method based on machine learning

Similar Documents

Publication Publication Date Title
CN108564192B (en) Short-term photovoltaic power prediction method based on meteorological factor weight similarity day
CN110414788B (en) Electric energy quality prediction method based on similar days and improved LSTM
CN116720620A (en) Grain storage ventilation temperature prediction method based on IPSO algorithm optimization CNN-BiGRU-Attention network model
CN111563706A (en) Multivariable logistics freight volume prediction method based on LSTM network
CN108596327B (en) Seismic velocity spectrum artificial intelligence picking method based on deep learning
CN111401599B (en) Water level prediction method based on similarity search and LSTM neural network
CN110610225A (en) Multi-objective particle swarm optimization algorithm based on kriging proxy model plus-point strategy
CN113326969A (en) Short-term wind speed prediction method and system based on improved whale algorithm for optimizing ELM
CN113469426A (en) Photovoltaic output power prediction method and system based on improved BP neural network
CN106778838A (en) A kind of method for predicting air quality
CN114444378A (en) Short-term power prediction method for regional wind power cluster
CN113449919B (en) Power consumption prediction method and system based on feature and trend perception
CN115564114A (en) Short-term prediction method and system for airspace carbon emission based on graph neural network
CN114548591A (en) Time sequence data prediction method and system based on hybrid deep learning model and Stacking
CN116187835A (en) Data-driven-based method and system for estimating theoretical line loss interval of transformer area
CN115099461A (en) Solar radiation prediction method and system based on double-branch feature extraction
CN116881676B (en) Prediction method for water inflow of open pit
CN114648170A (en) Reservoir water level prediction early warning method and system based on hybrid deep learning model
CN113627240B (en) Unmanned aerial vehicle tree species identification method based on improved SSD learning model
CN117521511A (en) Granary temperature prediction method based on improved wolf algorithm for optimizing LSTM
CN113033898A (en) Electrical load prediction method and system based on K-means clustering and BI-LSTM neural network
CN112651499A (en) Structural model pruning method based on ant colony optimization algorithm and interlayer information
CN112711896A (en) Complex reservoir group optimal scheduling method considering multi-source forecast error uncertainty
CN115794805A (en) Medium-low voltage distribution network measurement data supplementing method
CN115713144A (en) Short-term wind speed multi-step prediction method based on combined CGRU model

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