Blue-green algae concentration data prediction method and system based on singular spectrum analysis double predictor models
Through singular spectrum analysis and dual predictor models, combined with LSTM and ILSTNet, the problem of model complexity and data dependence in cyanobacteria concentration prediction is solved, efficient prediction of complex data is achieved, and prediction accuracy and system performance are improved.
Patent Information
- Application Number
- CN202410676231.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-09-17
AI Technical Summary
Among the existing cyanobacteria concentration prediction methods, the model of the process-driven method is complex and difficult to establish, while the results of the data-driven method depend on the quality of the data, making it difficult to effectively predict complex, high-frequency, and large-scale fluctuating data.
A dual predictor model based on singular spectrum analysis was used to predict the trend and period of cyanobacteria concentration and environmental variables through singular spectrum decomposition, autocorrelation criterion, LSTM and ILSTNet models, and the final prediction was made based on the prediction results.
It improves the accuracy and system performance of cyanobacteria concentration prediction, can effectively handle complex, high-frequency, and large-scale fluctuation data, and reduces the difficulty of modeling and the requirement for professional knowledge.
Smart Images

Figure CN118657242A
Abstract
Description
Technical Field
[0001] The patent application of this invention belongs to the field of data analysis and processing technology, and specifically relates to a method and system for time series prediction of cyanobacteria concentration. Background Art
[0002] Cyanobacteria as we know them are one of the oldest oxygenic photoautotrophic organisms on Earth and have strong vitality. They can respond quickly to environmental changes, such as temperature, nutrient levels or flow, so cyanobacteria can over-reproduce within a few days, and their population size is characterized by drastic fluctuations. However, the toxins released by the massive reproduction of cyanobacteria will bring countless adverse effects to aquatic ecosystems and human society, such as polluting water sources and endangering the health of humans and aquatic animals. Therefore, solving this problem requires a lot of money and manpower. In addition, timely monitoring and early warning systems are effective measures to prevent cyanobacterial outbreaks and reduce governance losses. At present, there are two main methods for predicting harmful cyanobacterial blooms, namely, process-driven and data-driven methods.
[0003] Process-driven methods are mathematical matrices built using knowledge from ecology, biochemistry, and physics. These models can reflect the dynamics of cyanobacterial reproduction and have been widely studied. However, these models involve complex equations, integrate multidisciplinary knowledge, and have many parameters to be determined. Therefore, it is difficult for modelers to accurately establish the model.
[0004] Data-driven modeling methods can be regarded as black-box modeling. They only need to input and output data to automatically build dynamic system models, which greatly reduces the difficulty of modeling and the requirements for modelers' expertise. However, the results of data-driven models depend largely on the quality of the data. If the input data is complex, high-frequency, and fluctuates over a large range, ordinary models are not capable enough to make direct predictions.
[0005] In summary, the process-driven approach uses knowledge from multiple fields to build mathematical models that can reflect dynamic processes, but the models are complex and require a large number of parameters to be determined; the data-driven approach is considered black box modeling, which only requires input and output data to automatically build the model, reducing the difficulty of modeling, but the results are highly dependent on data quality, and the predictive ability may be limited for complex, high-frequency, and widely fluctuating data. Summary of the invention
[0006] In order to overcome the above shortcomings, the present invention proposes a method and system for predicting cyanobacteria concentration data based on a dual prediction sub-model of singular spectrum analysis. It includes:
[0007] Step 1: Perform singular spectrum decomposition on the concentration data and four environmental variable data (water flow, water flow rate, water temperature and water salinity);
[0008] Step 2: Use the autocorrelation criterion to obtain the periodicity of the decomposed variables;
[0009] Step 3: Group according to periodicity: that is, trend data is grouped in its own group, and periodic data of the same period is grouped in its own group;
[0010] Step 4: Input the trend data group into the LSTM-based trend prediction sub-model for prediction;
[0011] Step 5: Input the periodic data set into the periodic prediction sub-model based on ILSTNet (Improved Long-and Short-term Time-series network) for prediction;
[0012] Step 6: Add the prediction results of all groups to get the final overall prediction result and complete the training.
[0013] In step 1, the input data includes: cyanobacteria concentration data (number of cells per milliliter of water), water flow (megaliters / day), water flow rate (meters / second), water temperature (degrees Celsius) and water salinity (microsiemens / cm). Among them, cyanobacteria concentration is the predicted variable, and water flow, water flow rate, water temperature and water salinity are environmental variables;
[0014] In addition, the singular spectrum decomposition is divided into four steps. Step 1: time series decomposition and embedding to form a trajectory matrix; Step 2: singular value decomposition; Step 3: intrinsic triple grouping; Step 4: anti-diagonal averaging. Through these four steps, the number of variables equal to the window length is decomposed.
[0015] The above step 1: time series decomposition and embedding step is to transform the original data X = [x1, x2, ..., x N ] is decomposed and embedded to form the trajectory matrix Y, which is expressed as:
[0016]
[0017] Also makes Y i =(x i-1 ,...,x i+L-2 ) T ,1≤i≤N-L+1 is the lag vector, and Y can also be expressed as Y=[Y1;…;Y K ].
[0018] The above step 2: In the singular value decomposition step, operations are performed according to the constructed trajectory matrix to extract the eigenvalue triples. Specifically, let S = YY T , thus obtaining the eigenvalues λ1,λ2,…,λ Land the orthonormal bases U1, U2, …, U of the corresponding eigenvectors L . Let Then We can denote as the eigen - triple.
[0019] The above step 3: In the eigen - triple grouping step, group Y1, Y2, …, Y L into non - overlapping subsets I1, I2, …, I m . Let I i ={i1, …, i p},then generate a new group Meanwhile, Y can be expressed as
[0020] The above step 4: In the anti - diagonal averaging step, first let K = N - L+1, w ij , 1≤i≤L, 1≤j≤K are the elements of W. At the same time, we also let N = L + K - 1, and L * =min(L, K), K * =max(L, K). Meanwhile, let If L < K, we let
[0021] Therefore, W can be transformed into a sequence f=(f0, …, f N-1 ) through the anti - diagonal averaging formula:
[0022]
[0023] Preferably, in the above steps 3 and 4, we take each eigen - triple as a group by itself. That is, Y Ik corresponds to I k . Therefore, according to the anti - diagonal averaging formula, these non - overlapping subsets I k can be transformed into
[0024] The autocorrelation criterion formula described in step 2 is as follows:
[0025]
[0026] This expression describes the correlation between a sequence and its delayed copy. Among them, is the variable obtained after decomposition in step 1, τ is the lag, μ is the mean, and σ 2 is the variance. In this paper, empirical unbiased estimation is used to calculate the autocorrelation. The time delay τ corresponding to the maximum autocorrelation value is the period of the periodic sequence.
[0027] Through the above-mentioned autocorrelation criterion, the periodicity of each product after singular spectrum decomposition is determined and recorded.
[0028] In step 3, the recorded periodicity is sorted out and grouped manually. Specifically, the data of the same periodicity are added together. For example, the concentration data with the same period obtained after decomposition are added together, and the four environmental variable data with the same period are added together. Then the concentration data and environmental variables with the same period are grouped together to obtain a group of periodic variable groups. Similarly, the trend variable group is obtained. Finally, the trend variable group t1 and the periodic variable groups p1, p2, ..., p n .
[0029] The trend prediction sub-model described in step 4 is a double-layer, 5-week, multi-input LSTM model. We input the trend group t1 that integrates the trend data of flow, flow velocity, temperature, salinity and concentration into the network, and finally output a variable, namely the cyanobacteria concentration data.
[0030] In the LSTM-based trend prediction sub-model, we adopt a double-layer LSTM structure. The main process is: the trend data group consisting of the trend data of the four environmental variables and the trend data of the concentration is first input into the first layer of LSTM for prediction, and the predicted results are then input into the second LSTM for prediction. Finally, the prediction results of the second layer of LSTM are input into the output layer, and the cyanobacteria concentration trend data with a dimension of 1 is output.
[0031] Furthermore, in the prediction model, the main calculation formula of each LSTM neuron is as follows:
[0032]
[0033] in, They are input gate, forget gate and output gate, which control the transmission of signals; and the three gates The calculation method of is as follows:
[0034]
[0035] is a memory unit, It is an alternative state. is the current moment input, is the output at the previous moment, b * l is bias.
[0036] Step 5 mainly divides the divided trend groups p1, p2, ..., p nThe input is fed into the period prediction sub-model based on ILSTNet for prediction. Like the trend prediction sub-model, the input data is time series data combining four environmental variables and one concentration data, and the output is the concentration data of the same period.
[0037] As a preferred method, ILSTNet is mainly divided into five parts: periodic integration link, convolution operation link, nonlinear prediction link, autoregressive operation link and addition link.
[0038] In the cycle integration phase, the data at the same position in different cycles are extracted and integrated from the obtained cycle data. This phase can well capture the long-term characteristics of the data.
[0039] In the convolution operation, the extracted data and the original data are passed through the convolutional neural network. Because of the existence of convolution, this link can well capture the characteristics between variables and the characteristics of short-term data.
[0040] In the nonlinear prediction link, the two sets of data extracted by the convolutional neural network are input to the GRU (Gated Recurrent Unit) for prediction, and then the predicted values of the two are input to the fully connected layer. The output of the fully connected layer is used as the output of this link.
[0041] In the autoregressive prediction link, the original data is fed into the autoregressive model for prediction, which uses the linear combination of random variables at several previous moments to describe the linear regression model of random variables at a certain moment in the future. Through this link, the defects of nonlinear neural networks in terms of input scale sensitivity can be solved.
[0042] In the addition stage, the output results of the nonlinear prediction stage and the autoregressive operation stage are added together, and finally the overall output result of the model can be obtained.
[0043] The output data obtained by adding the results of the two prediction sub-models in step 6 is the cyanobacteria concentration data. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is the overall flow chart of the method;
[0045] Figure 2 The overall framework diagram of a dual prediction sub-model based on singular spectrum analysis proposed in the patent application of the present invention;
[0046] Figure 3 Schematic diagram of the trend data set and period data set of cyanobacteria concentration and four environmental variables for a region as an example;
[0047] Figure 4 Schematic diagram of the internal structure of the trend prediction sub-model and LSTM;
[0048] Figure 5 It is a schematic diagram of the structure of the period prediction sub-model;
[0049] Figure 6 This is a schematic diagram of the structure of the GRU used in the model;
[0050] Figure 7 The model predicts the results in five regions.
[0051] Figure 8 The figure shows the results of comparative experiments on the model in five regions; DETAILED DESCRIPTION
[0052] The specific embodiments of the present invention are further described below in conjunction with the accompanying drawings. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0053] In order to solve the shortcomings of existing models in the field of cyanobacteria concentration prediction, make full use of the inherent characteristics of the original data, and improve the performance of the prediction system, this paper proposes a dual-predictor hybrid prediction model based on singular spectrum analysis for predicting cyanobacteria concentration. The overall idea of the algorithm is as follows: Figure 1 The overall framework is shown in Figure 2 As shown. The model proposed in this patent includes the following steps:
[0054] Step 1: Perform singular spectrum decomposition on the original data
[0055] Furthermore, the singular spectrum decomposition is divided into four steps: Step 1: time series decomposition and embedding to form a trajectory matrix; Step 2: singular value decomposition; Step 3: intrinsic triple grouping; Step 4: anti-diagonal averaging. Through these four steps, the number of variables equal to the window length is decomposed.
[0056] The above step 1: decompose the time series and embed it into a trajectory matrix. The specific formula is:
[0057] Let the original data be X = [x1, x2, ..., x N ], where N is the sequence length. Taking the window length as L, the original time series can be converted into a trajectory matrix Y. The expression of Y is as follows:
[0058]
[0059] At the same time, Y can also be expressed as: Y = [Y1; ...; Y K ], where Y i =(x i-1 ,...,x i+L-2 )T , where \(1\leq i\leq N - L + 1\) is the lag vector.
[0060] Step 2 above: Singular value decomposition of the obtained trajectory matrix is performed to obtain the corresponding eigen - triples. Specifically:
[0061] Let \(S = YY\) T , thus obtaining eigenvalues \(\lambda_1,\lambda_2,\cdots,\lambda\) L and the orthonormal basis \(U_1,U_2,\cdots,U\) of the corresponding eigen - vectors L . Let Then Therefore, we can obtain the eigen - triples:
[0062] Step 3 above: Group the eigen - triples.
[0063] Furthermore, group \(Y_1,Y_2,\cdots,Y\) L into non - overlapping subsets \(I_1,I_2,\cdots,I\) m . Let \(I\) i =\(\{i_1,\cdots,i\) p}\), then new groups are generated Meanwhile, \(Y\) can be expressed as
[0064] Step 4 above: Perform anti - diagonal averaging operation. Specifically:
[0065] In anti - diagonal averaging, first let \(K = N - L + 1\), \(w\) ij , where \(1\leq i\leq L\), \(1\leq j\leq K\) are the elements of \(W\). Meanwhile, we also let \(N = L+K - 1\), and \(L\) * =\(\min(L,K)\), \(K\) * =\(\max(L,K)\). At the same time, let If \(L < K\), we let
[0066] Therefore, \(W\) can be transformed into the sequence \(f=(f_0,\cdots,f\) N-1 ) through the anti - diagonal averaging formula:
[0067]
[0068] When grouping the eigen - triples, each eigen - triple with the remaining singular values forms a group by itself. That is corresponding to \(I\) k . Therefore, according to the anti - diagonal averaging formula, these non - overlapping subsets \(I\) k can be transformed into
[0069] Finally, the decomposed time series data can be obtained.
[0070] The present invention inputs the concentration data and four environmental variable data into the method respectively to obtain the eigentriples with the same number as the window length. At the same time, the contribution of isomorphic singular values is judged, and the data with a contribution of more than 90% is retained, and the rest is discarded as noise. The retained eigentriples are de-diagonally normalized to obtain the corresponding time series data, thereby realizing the decomposition and recombination of the time series data.
[0071] Step 2: Autocorrelation test
[0072] The time series data obtained after decomposition and retention is subjected to autocorrelation test to obtain its periodicity. The specific operation is as follows:
[0073]
[0074] This expression describes the correlation between a sequence and its delayed copy. is the variable obtained after decomposition in step 1, τ is the lag, μ is the mean, σ 2 is the variance. In this paper, empirical unbiased estimation is used to calculate the autocorrelation. The time delay τ corresponding to the maximum autocorrelation value is the period of the periodic series.
[0075] In this formula, the τ that maximizes the R(τ) value is the period of the time series.
[0076] Step 3: Determine whether it is periodic data
[0077] The recorded periodicity is sorted out and grouped manually. Specifically, the data of the same periodicity are added together. For example, the concentration data with the same period obtained after decomposition are added together, and the four environmental variable data with the same period are added together. Then the concentration data and environmental variables with the same period are grouped together to obtain a group of periodic variable groups. Similarly, the trend variable group is obtained. Finally, the trend variable group t1 and the periodic variable groups p1, p2, ..., p n The grouping results are as follows Figure 3 As shown in the figure, sub-figure (a) shows the data comparison before and after reconstruction, sub-figure (b) is a trend variable group, and sub-figure (c) is a period variable group.
[0078] Step 4: Use the trend prediction sub-model to predict trend data
[0079] Figure 4The figure shows the internal structure of the trend prediction submodel and LSTM of our model. In subfigure (a), C, Q, V, T, and S represent the concentration of cyanobacteria, flow rate, flow velocity, temperature, and salinity, respectively. They are combined together in chronological order and recorded as t1, and input into the calculation part of the trend prediction submodel. The output of the calculation part is then input into the fully connected layer for data calculation. The output of the fully connected layer is the output value of the cyanobacteria concentration trend part. (b) The figure shows the internal structure and calculation process of an LSTM neuron. It fully demonstrates the input-output relationship of data between the three-state gates and the calculation process of the neuron output.
[0080] Furthermore, in the prediction model, the main calculation formula of each LSTM neuron is as follows:
[0081]
[0082] in, They are input gate, forget gate and output gate, which control the transmission of signals; and the three gates The calculation method of is as follows:
[0083]
[0084] is a memory unit, It is an alternative state. is the current moment input, is the output at the previous moment, b * l is bias.
[0085] Step 5: Group the periodic data p1, p2, ..., p n Input into the period prediction sub-model for prediction, thus obtaining the prediction results for each period group.
[0086] Figure 5 The following is the structure diagram of the period prediction sub-model we used. From the figure, we can see that the model has five main components: period integration link, convolution operation link, nonlinear prediction link, autoregression operation link, and addition operation link.
[0087] From the figure we can clearly see that the P iThe data after combining the environmental variables of the periodic groups with the concentration data are simultaneously input into the periodic integration link and the autoregressive operation link. The two results output by the periodic integration link are also respectively input into the two convolutional neural networks of the convolution operation link. The output values of the two convolution links are then input into the nonlinear prediction link. The specific operation is as follows: the two GRUs predict the two data separately, and then input the prediction results into the fully connected layer. At the same time, the data input into the autoregressive operation link is linearly predicted by the autoregressive model to make up for the problem that the nonlinear neural system is insensitive to the scale of data changes. Finally, the results of the autoregressive operation link and the results of the nonlinear prediction link are added in the addition operation link. Finally, the output obtained by the addition link is the periodic prediction value of the cyanobacteria concentration.
[0088] Further, the following is a detailed explanation of these five links:
[0089] In the period integration phase: Ordinary LSTM and GRU are not enough to capture correlation in long time series. Therefore, introducing the period integration phase helps to solve this problem, especially for periodic series. In this part, the time series are reorganized according to their period, that is, different period groups at the same position are combined together, and the number of groups is the length of the period. Then the collected data set and the unprocessed data at the same position are passed to the neural network. The sum of the two outputs is the final output. Therefore, this part helps to alleviate the problem of capturing long-term series correlation.
[0090] In the convolution operation: This part performs convolution processing on the original data and the component data reconstructed by cyclic jumps at the same time. More importantly, in this part, a one-dimensional convolutional network (CNN) without pooling is used to extract the relationship between variables. The size of the convolution kernel is d×w, (d is the number of variables and w is the width of the kernel). The kth kernel The output is calculated by formula (8):
[0091]
[0092] Among them, the RELU function is RELU(x)=max(0,x), is the weight matrix, * is the convolution operation, is the input matrix, is the bias of the convolution kernel. The output size is d c ×T c Among them, d c is the number of cores, T c =N-w+1, N is the length of the input sequence.
[0093] In the nonlinear prediction link: GRU is also a recurrent neural network. Unlike LSTM, it has only two gates: update gate and reset gate Its internal structure is as follows Figure 6 In addition, the outputs of the two gates and neurons are calculated as follows:
[0094]
[0095] where ⊙ is the vector element-wise multiplication, is the output of the memory unit at the tth moment, is the standby state at the tth moment. σ(·) is a logic formula, and the output is 0 or 1. and is the adjustable gate recurrent unit parameter, For bias.
[0096] Furthermore, in the nonlinear prediction phase, two independent GRUs are used. One predicts the continuous time series, while the other predicts the data skipped by regression. The output of the GRU is then fed into the fully connected layer. And the output of the fully connected layer is fed to the next module.
[0097] In the autoregressive operation link: This link is added to solve the defects of nonlinear neural network in input scale sensitivity. The autoregressive operation contains an autoregressive model, which can linearly predict the next moment value using n historical values. The expression is:
[0098]
[0099] in, is the value at time t, is the weight of the past moment, b a is bias.
[0100] In the addition operation: the output of the nonlinear part and the output of the autoregressive model will be added together as the output of the integrated model. Through these parts, the periodic series can be accurately predicted. The calculation formula is as follows:
[0101]
[0102] in, is the final forecast output of the trend forecast sub-model, is the prediction result output of the i-th period group.
[0103] The period prediction sub-model proposed in the present invention can not only make targeted predictions on periodic sequences through the skip cycle component, but also improve system efficiency through its own structural design. Replacing the fully connected layer with a convolution can reduce the number of weight parameters and increase the calculation speed. Then, compared with LSTM, GRU has fewer parameters and computational complexity, and is generally trained faster. Therefore, introducing a period prediction sub-model to predict periodic sequences not only improves the prediction accuracy, but also improves the system efficiency by significantly reducing training time and cost.
[0104] Step 6: Addition operation: Add the cyanobacteria concentration trend prediction results and the results of the fusion of multiple period group outputs to obtain the overall output of the prediction system.
[0105] Furthermore, the dual prediction sub-model based on singular spectrum analysis proposed in this patent is applied to the field of cyanobacteria concentration prediction.
[0106] The present invention is specifically implemented as follows: The Murray River is the longest river in Australia, with a total length of 2,575 kilometers. However, the ecological environment of the Murray River has deteriorated, causing frequent outbreaks of blue algae. Therefore, we selected five areas along the Murray River as sampling points for monitoring harmful blue algae reproduction. The five areas are: Lock9, Mannum, Morgan, Murray Bridge and Tailem Bend.
[0107] Considering that the concentration of cyanobacteria at a certain moment is not only related to the historical concentration, but also closely related to environmental variables. For example, high-speed water flow will hinder the growth and aggregation of cyanobacteria; water temperature is closely related to the reproduction capacity of cyanobacteria; at the same time, salinity greatly affects the abundance of cyanobacteria. Therefore, we conducted weekly sampling of cyanobacterial cell concentrations and four environmental variables in five regions from 1994 to 2017. The four environmental variables are: water flow Q, water flow rate V, water temperature T and water salinity S. Subsequently, we obtained a data set with a dimension of [1248,5] in each region. We selected the data from the first 21 years as the training set and the data from the last 3 years as the test set. Therefore, the dimensions of the training set and the test set can also be expressed as [1092,5] and [156,5], respectively.
[0108] Preferably, in the experiment, four physical parameters, namely, water flow rate Q, water flow rate V, water temperature T and salinity S in water, are selected as input environmental variables. The number of cyanobacteria cells in water, that is, the cyanobacteria concentration C, is used as the output variable. These four environmental variables and concentration data are respectively grouped according to periodicity after singular spectrum decomposition. The grouped data are respectively input into two prediction sub-models for prediction. In the two prediction sub-models, the four environmental variables and concentration data are used as the input of the model, and the concentration data at the next moment is the output of the model.
[0109] Furthermore, in the singular spectrum decomposition, the window length should be consistent with the cycle length. Studies have shown that the growth cycle of cyanobacteria is related to the year, so the window length is selected as 52.
[0110] As a preference, the number of neurons in the input layer of the period prediction sub-model is the same as the number of input variables, both of which are 5. In the hidden layer, LSTM is selected as 2 layers, the number of neurons is in the range of [100, 200], and the last corresponding fully connected layer has an output number of 1. In addition, the time step is selected as 5; tanh is selected as the activation function; the batch size of the input into the neural network for training is 32; the learning rate is 0.01; the number of iterations is 500; and the random dropout rate is 0.3.
[0111] As a preferred method, in the trend prediction sub-model, the convolution operation selects a single-layer convolutional neural network without a pooling layer, the number of filters is 16, the convolution kernel size is 2, and the step size is 1. In the nonlinear prediction link, a 2-layer GRU is selected, and the number of neurons ranges from [100,200]. One fully connected layer, the output dimension is 1. The number of layers of the autocorrelation model is 1, the step size is 5, and the output is 1. In addition, the time step is selected as 5; the activation function of the convolution layer is relu, and the activation function of the nonlinear prediction link is tanh; the batch size is 32; the learning rate is 0.01; the number of iterations is 800; and the random inactivation rate is 0.2.
[0112] As a preference, we select CORR, MAE, and NSE as the evaluation criteria for model prediction results. The following is a detailed introduction to each indicator.
[0113] Furthermore, the correlation coefficient (CORR) measures the strength of the linear relationship between the predicted value and the observed value, and its range is -∞ to 1. The closer the value is to 1, the stronger the linear relationship between the prediction and the observation is. This paper marks it as CORR, and the calculation formula is as follows:
[0114]
[0115] Among them, P i and O i are the i-th prediction and observation, respectively, and are the means of the predicted values and the observed values, respectively, and m is the number of variables.
[0116] The mean absolute error (MAE) is the average of the absolute differences between the predicted value and the measured value, and is calculated as follows:
[0117]
[0118] Among them, P i and O i are the i-th prediction and observation respectively, and m is the number of variables.
[0119] The Nash-Sutcliffe efficiency (NSE) coefficient is used to evaluate the prediction performance of the model, ranging from -∞ to 1. The closer the value is to 1, the higher the prediction accuracy. The following formula gives the calculation formula of NSE:
[0120]
[0121] Among them, P i and O i are the i-th prediction and observation, respectively, is the mean of the predicted values, and m is the number of variables.
[0122] Furthermore, the prediction results are as follows Figure 7 As shown in the figure, the accuracy of our model's prediction results and the universality of the model are demonstrated. At the same time, we compare our model with the common time series prediction models GRU, BiLSTM, and CNN-LSTM. The prediction results on three indicators are shown in the following table. It can be found that the results of our proposed model are the best.
[0123] Table 1 Evaluation index results of four models
[0124] From the analysis of the results, we can see that our proposed model shows the best performance, with a CORR value of 0.987, a MAE of 460 cells per ml, a MRE of 0.331, and a NSE of 0.987. In this section, compared with the CNN-LSTM, BiLSTM, and GRU models, our proposed model has an average improvement of 8.72%-11.61% in CORR, 64.80%-71.77% in MAE, 85.05%-92.40% in MRE, and 8.72%-11.61% in NSE on five sites.
[0125] Furthermore, the prediction system also includes a computer-readable storage medium having a computer program stored thereon, and further includes:
[0126] A non-volatile semiconductor storage element, used to read the data information collected by the data acquisition module; the data information at least includes sample data in the training set and the test set, and data to be predicted;
[0127] and a data and processing unit, which calls the computer program through a processing circuit to execute and implement the steps of the double predictor model method based on singular spectrum analysis as described above;
[0128] There is also a data distribution circuit, which processes the predicted data read from the non-volatile semiconductor storage element by the data and processing unit in weekly processing units, and sends the obtained prediction results to one or more CAN buses to be sent to external devices through the gateway.
[0129] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions and variations of these embodiments are made without departing from the principles and spirit of the present invention, and still fall within the scope of protection of the present invention.
Claims
1. A method and system for predicting cyanobacteria concentration data based on a dual prediction sub-model of singular spectrum analysis, characterized in that: The following steps are involved: Step 1: Perform singular spectrum decomposition on the concentration data and environmental variable data respectively; Step 2: Use the autocorrelation criterion to obtain the periodicity of the decomposed variables; Step 3: Group according to periodicity: that is, trend data is grouped in its own group, and periodic data of the same period is grouped in its own group; Step 4: Input the trend data group into the LSTM-based trend prediction sub-model for prediction; Step 5: Input the periodic data set into the periodic prediction sub-model based on Improved Long-and Short-term Time-seriesnetwork, ILSTNet for prediction; Step 6: Add the prediction results of all groups to get the final overall prediction result and complete the training.
2. According to claim 1, a method and system for predicting cyanobacteria concentration data based on a dual prediction sub-model of singular spectrum analysis, characterized in that: The singular spectrum analysis method decomposes the data, specifically including: Step 1: Decomposition and embedding of time series into trajectory matrix: That is, the time series decomposition and embedding process is to transform the original data X = [x1, x2, ..., x N ] is decomposed and embedded to form the trajectory matrix Y, which is expressed as: At the same time, Y can also be expressed as Y=[Y1;…;Y K ], where Y i =(x i-1 ,...,x i+L-2 ) T ,1≤i≤N-L+1 is the lag vector; Step 2, singular value decomposition: According to the constructed trajectory matrix, the intrinsic triples are extracted by operation, which is specifically expressed as: Let S = YY T , thus obtaining the eigenvalues λ1,λ2,…,λ L and the corresponding orthonormal basis of eigenvectors U1,U2,…,U L ,make but At the same time, remember is the eigentriple; Step 3, grouping of intrinsic triples: Set Y1,Y2,…,Y L Classified into disjoint subsets I1,I2,…,I m , then Y can be expressed as Step 4, anti-diagonal averaging: Let \(K = N - L+1\), \(w\) ij , \(1\leq i\leq L\), \(1\leq j\leq K\) are the components of \(W\). Also, we let \(N = L + K - 1\), and \(L\) * \(=\min(L, K)\), \(K\) * \(=\max(L, K)\). At the same time, let (if \(L < K\), we let ). Thus, \(W\) can be transformed into the sequence \(f=(f_0,\ldots,f\) N-1 ) by the anti - diagonal averaging formula:
3. The method and system for predicting cyanobacteria concentration data based on a dual prediction sub-model of singular spectrum analysis according to claim 2, characterized in that The period of each decomposed data is determined by the autocorrelation criterion, specifically including: obtaining the maximum correlated delay through the discriminant of the correlation between the sequence and its delayed copy, and the delay is the period of the sequence, and the formula is as follows: Through this formula, the time delay τ corresponding to the maximum autocorrelation value can be obtained, that is, the period of the periodic sequence.
4. The method and system for predicting cyanobacteria concentration data based on a dual prediction sub-model of singular spectrum analysis according to claim 3, characterized in that: Through the above autocorrelation criterion, the periodicity of each singular spectrum decomposition data is judged and recorded, and grouped manually, including: adding a class of data with the same periodicity, and finally obtaining the trend variable group t1 and the period variable group p1, p2, ..., p n .
5. The method and system for predicting cyanobacteria concentration data based on a dual prediction sub-model of singular spectrum analysis according to claim 4, characterized in that The trend prediction sub-model is a double-layer, step-size 5, multi-input LSTM model. We input the trend group t1 with a dimension of [1248,5] into the network and finally output a variable, namely the cyanobacteria concentration data, which specifically includes: data input and output and neural network calculation. The formula of the neural network during calculation is as follows: in, They are input gate, forget gate and output gate, which control the transmission of signals. is a memory unit, It is an alternative state. is the current moment input, is the output at the previous moment, is bias.
6. The method and system for predicting cyanobacteria concentration data based on a dual prediction sub-model of singular spectrum analysis according to claim 5, characterized in that The period prediction sub-model ILSTNet is mainly divided into five parts, including: period integration link, convolution operation link, nonlinear prediction link, autoregressive operation link and addition link. In the cycle integration phase, the data at the same position in different cycles are extracted and integrated. This phase can well capture the long-term characteristics of the data. In the convolution operation, the extracted data and the original data are passed through the convolutional neural network. Because of the existence of convolution, this step can well capture the characteristics between variables and the characteristics of short-term data; In the nonlinear prediction link, the two sets of data extracted by the convolutional neural network are respectively input to the GRU (Gated Recurrent Unit) for prediction, and then the predicted values of the two are input to the fully connected layer, and the output of the fully connected layer is used as the output of this link; In the autoregressive prediction link, the original data is fed into the autoregressive model for prediction. The model uses the linear combination of random variables at several previous moments to describe the linear regression model of random variables at a certain moment in the future. Through this link, the defects of nonlinear neural networks in terms of input scale sensitivity can be solved. In the addition stage, the output results of the nonlinear prediction stage and the autoregressive operation stage are added together, and finally the overall output result of the model can be obtained.
7. The method and system for predicting cyanobacteria concentration data based on a dual prediction sub-model of singular spectrum analysis according to claim 6, characterized in that: The total output of the system is the sum of the outputs of each part, specifically including: the output data obtained by adding the results of the two prediction sub-models is the cyanobacteria concentration data, thereby completing the training.
8. A method and system for predicting cyanobacteria concentration data based on a dual prediction sub-model of singular spectrum analysis according to any one of claims 1 to 7, characterized in that: At least: Singular spectrum decomposition stage, used for data preprocessing; Periodic judgment and integration phase, used to make targeted predictions on the data; The LSTM-based trend prediction sub-model module is used to predict the integrated trend concentration data; The period prediction sub-model module based on ILSTNet is used to predict the integrated period concentration data; A result addition module is used to obtain the overall output concentration data of the model; A data acquisition module, used for collecting the data of the samples to be tested; The data prediction module inputs the data into the blue algae concentration data prediction method and system based on the double prediction sub-model of singular spectrum analysis for calculation to obtain the optimization result.
9. The method and system for predicting cyanobacteria concentration data based on a dual prediction sub-model of singular spectrum analysis according to claim 8, characterized in that: The data decomposition part and data prediction part of the model respectively use singular spectrum analysis, a trend prediction sub-model based on LSTM, and a period prediction sub-model based on ILSTNet, and specifically include the following steps: Step 9-1: Perform singular spectrum decomposition on the concentration data and four environmental variable data (water flow, water flow rate, water temperature and water salinity); Step 9-2: Use the autocorrelation criterion to obtain the periodicity of the decomposed variables; Step 9-3: Group according to periodicity: that is, trend data is grouped in its own group, and periodic data of the same period is grouped in its own group; Step 9-4: Input the trend data group into the LSTM-based trend prediction sub-model for prediction; Step 9-5: Input the periodic data set into the periodic prediction sub-model based on ILSTNet for prediction; Step 9-6: Add the prediction results of all groups to get the final overall prediction result and complete the training.
10. The method and system for predicting cyanobacteria concentration data based on a dual prediction sub-model of singular spectrum analysis according to claim 8, characterized in that: Also includes: A computer-readable storage medium having a computer program stored thereon; A non-volatile semiconductor storage element, used to read the data information collected by the data collection module; A data processing unit, which calls the computer program through a processing circuit to execute and implement the steps of a method for predicting cyanobacteria concentration data based on a double prediction sub-model of singular spectrum analysis according to any one of claims 1 to 7; The data distribution circuit processes the predicted data read from the non-volatile semiconductor storage element by the data processing unit according to each processing unit, and sends the obtained prediction results to one or more CAN buses to be sent to external devices through a gateway.
