Multivariable cross-correlation spatial-temporal feature fusion dissolved oxygen content prediction method and system
By using a multivariate inter-correlation spatiotemporal feature fusion method and a long short-term memory network with graph attention and multi-channel attention mechanisms, the problem of traditional models being unable to capture spatial features is solved, achieving high-precision dissolved oxygen prediction, ensuring the suitability of dissolved oxygen in freshwater aquaculture environments, and improving fish survival rates and economic value.
Patent Information
- Application Number
- CN202510887182.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-11-28
AI Technical Summary
Traditional dissolved oxygen prediction models cannot effectively capture the potential spatial information characteristics between different influencing factors, resulting in the accuracy of dissolved oxygen concentration prediction in water bodies not meeting the requirements of actual engineering and failing to meet the survival needs of fish in freshwater aquaculture.
A multivariate inter-correlation spatiotemporal feature fusion method is adopted. The influencing factor sequence is screened by the maximum information coefficient. Combined with graph attention mechanism, multi-channel attention mechanism and improved encoder-decoder long short-term memory network, the potential inter-correlation spatial features and temporal dependence features among water quality factors are extracted.
It improves the accuracy of dissolved oxygen content prediction, enabling pre-control of aerators by predicting changes in dissolved oxygen, maintaining dissolved oxygen in the water within a range suitable for fish growth, thereby improving fish survival rate and aquaculture economic value.
Smart Images

Figure CN121034467A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to a kind of multivariate intercorrelation space-time feature fusion dissolved oxygen content prediction method and system, belong to big data and environmental information processing technical field. BACKGROUND
[0002] Dissolved oxygen is one of the important indicators for evaluating water quality and its own self-purification capacity, and is also a basic condition for maintaining fish survival. In fish growth and reproduction, water dissolved oxygen below 2 mg / L can cause physiological metabolism disorder of fish, causing stress reaction and seriously affecting fish survival rate.
[0003] In freshwater aquaculture, traditional dissolved oxygen information collection is generally measured by a single sensor, and the collected information inevitably has problems such as low precision, information lag, data loss, etc. It can only roughly reflect the content of dissolved oxygen in the current water environment, but cannot reflect its future changes. The change of dissolved oxygen has certain trend and periodicity, and when the dissolved oxygen content is too low, it usually indicates that the water environment has deteriorated, which seriously affects the survival of fish and reduces its overall economic value. Therefore, in response to the requirements of national intelligent and intelligent breeding, it is necessary to predict the dissolved oxygen content in freshwater aquaculture water environment and use artificial intervention means in advance.
[0004] In recent years, researchers have proposed using traditional machine learning to predict dissolved oxygen sequence, and have achieved good results on this basis. However, when the data volume is large, the performance of machine learning-based methods is not satisfactory. Today, to solve the above problems, deep learning-based dissolved oxygen prediction methods with higher computing performance have gradually been studied by domestic and foreign scholars. The dissolved oxygen prediction model based on traditional attention mechanism can better capture the long-term time dependence features of dissolved oxygen sequence and achieve certain effect in predicting dissolved oxygen. However, it only focuses on the time dimension features of time steps of time series, ignores the potential intercorrelation space feature information between different influencing factors, and limits the model's understanding ability of complex spatial relationships. Thus leading to the prediction accuracy of water dissolved oxygen concentration does not meet the actual engineering requirements. SUMMARY
[0005] Therefore, the present application provides a kind of multivariate intercorrelation space-time feature fusion dissolved oxygen content prediction method, system, computer equipment and storage medium, which can solve the problem that traditional dissolved oxygen prediction model cannot capture the potential spatial information features of the interaction between feature variables, improve the model's understanding ability of complex spatial relationships, reduce the output channel feature redundancy of convolutional neural network, and effectively improve the prediction accuracy of dissolved oxygen content.
[0006] The first objective of this invention is to provide a method for predicting dissolved oxygen content by fusing spatiotemporal features of multivariate intercorrelation.
[0007] The second objective of this invention is to provide a multivariate inter-correlation spatiotemporal feature fusion system for predicting dissolved oxygen content.
[0008] A third objective of this invention is to provide a computer device.
[0009] A fourth objective of this invention is to provide a computer-readable storage medium.
[0010] The first objective of this invention can be achieved by adopting the following technical solution:
[0011] A method for predicting dissolved oxygen content by fusing spatiotemporal features of multivariate cross-correlation, the method comprising:
[0012] Obtain water quality sample dataset;
[0013] For the water quality sample dataset, the maximum information coefficient was used to screen the influencing factor sequences that were correlated with dissolved oxygen greater than a preset value, and the dissolved oxygen sequence was also screened.
[0014] The screened influencing factor sequences and dissolved oxygen sequences were standardized to obtain standardized data.
[0015] The dissolved oxygen content prediction model is trained using standardized data to obtain a trained dissolved oxygen content prediction model. The dissolved oxygen content prediction model includes a spatial feature extraction network, a local feature extraction network, a multi-channel attention network, and a long short-term memory network of encoder-decoder that combines attention mechanism.
[0016] The water quality data to be tested is input into the trained dissolved oxygen content prediction model for prediction, and the predicted dissolved oxygen content at the next moment is output.
[0017] Furthermore, the step of using the maximum information coefficient to screen the influencing factor sequences with a correlation greater than a preset value to dissolved oxygen, and then screening the dissolved oxygen sequences, specifically includes:
[0018] Calculate the joint probability density and individual marginal probability density of the impact factor sequence and dissolved oxygen sequence, and calculate the mutual information value and maximum information coefficient between the impact factor sequence and dissolved oxygen sequence.
[0019] The sequence of influencing factors with the largest information coefficient greater than the preset value and the dissolved oxygen sequence of the first n-1 time steps are selected.
[0020] Furthermore, the standardized processing of the screened influencing factor sequences and dissolved oxygen sequences to obtain standardized data specifically includes:
[0021] Calculate the mean and standard deviation for each influencing factor sequence and each dissolved oxygen sequence;
[0022] The mean and standard deviation are substituted into the standardization formula to perform standardization processing, resulting in standardized data.
[0023] Furthermore, the step of training the dissolved oxygen content prediction model using standardized data to obtain a trained dissolved oxygen content prediction model specifically includes:
[0024] Standardized data is input into a spatial feature extraction network to extract spatial features between different variables;
[0025] Spatial features are input into a local feature extraction network to extract local features of spatial features at time steps;
[0026] For local features, a multi-head channel attention network is used to assign weights to each output channel to calculate the updated spatial features;
[0027] The updated spatial features are input into a long short-term memory network combining an encoder-decoder with an attention mechanism to extract temporal features, and the dissolved oxygen value at the next time step is calculated.
[0028] When the number of iterations reaches the preset number, a well-trained dissolved oxygen content prediction model is obtained.
[0029] Furthermore, the spatial feature extraction network is a graph attention neural network;
[0030] The step of inputting standardized data into a spatial feature extraction network to extract spatial features between different variables specifically includes:
[0031] Construct a graph structure and node feature matrix, use standardized data as input nodes, and calculate the attention weight of associated monitoring points to the central node;
[0032] The attention weights are subjected to a nonlinear transformation to obtain the normalized attention weights.
[0033] Based on the normalized attention weights, the node feature matrix of the central monitoring node is calculated and used as the central node feature matrix.
[0034] Construct multiple subgraph attention layers, and then perform a weighted average of the outputs of these subgraph attention layers to obtain the updated center node feature matrix.
[0035] Furthermore, for local features, a multi-head channel attention network is used to assign weights to each output channel to calculate the updated spatial features, specifically including:
[0036] The average and peak feature information of each channel within the time window is extracted through feature fusion using a global average pooling layer and a global max pooling layer. A Gaussian error linear unit activation function and a fully connected layer are used to nonlinearly process the global average and peak feature matrices, followed by adaptive weighted fusion. Simultaneously, multiple sub-channel attention layers are constructed and concatenated to enhance the representational capability of the channel attention network. Finally, a linear layer restores the original feature dimension, and matrix multiplication is used to assign weights to each channel in the feature matrix extracted by the original local feature extraction network, resulting in updated spatial features.
[0037] Furthermore, the encoder-decoder long short-term memory network incorporating the attention mechanism includes a bidirectional long short-term memory network portion, an attention mechanism portion, and a long short-term memory network portion.
[0038] The bidirectional long short-term memory network is used in the encoder stage to generate the hidden state and context vector for each time step by passing the sequence input to the encoder through the bidirectional long short-term memory network.
[0039] The attention mechanism is used to calculate similarity weights based on the hidden state output by the encoder and the hidden state of the decoder at the previous time step, distribute the similarity weights to the hidden state of the encoder output at each time step, and obtain the updated context vector by summing them.
[0040] The long short-term memory network is used in the decoder stage. The updated encoder context vector and the previous hidden state of the decoder are input into the long short-term memory neural network of the decoder. The hidden state of the decoder at the current time step is mapped through a linear layer, and the dissolved oxygen value of the next time step is output.
[0041] The second objective of this invention can be achieved by adopting the following technical solution:
[0042] A multivariate inter-correlation spatiotemporal feature fusion system for predicting dissolved oxygen content, the system comprising:
[0043] The acquisition module is used to acquire water quality sample datasets;
[0044] The filtering module is used to filter the series of influencing factors that are more correlated with dissolved oxygen than a preset value for the water quality sample dataset using the maximum information coefficient, and to filter the dissolved oxygen series.
[0045] The standardization module is used to standardize the screened impact factor sequences and dissolved oxygen sequences to obtain standardized data.
[0046] The training module is used to train the dissolved oxygen content prediction model using standardized data to obtain a trained dissolved oxygen content prediction model. The dissolved oxygen content prediction model includes a spatial feature extraction network, a local feature extraction network based on a multi-head channel attention mechanism, and a long short-term memory network combining an encoder-decoder with an attention mechanism.
[0047] The prediction module is used to input the water quality data to be tested into the trained dissolved oxygen content prediction model for prediction, and output the predicted dissolved oxygen content at the next moment.
[0048] The third objective of this invention can be achieved by adopting the following technical solution:
[0049] A computer device includes a processor and a memory for storing a processor-executable program, wherein when the processor executes the program stored in the memory, it implements the above-described method for predicting dissolved oxygen content by fusing spatiotemporal features of multivariate inter-correlation.
[0050] The fourth objective of this invention can be achieved by adopting the following technical solution:
[0051] A computer-readable storage medium storing a program that, when executed by a processor, implements the above-described method for predicting dissolved oxygen content by fusing spatiotemporal features with multivariate inter-correlation.
[0052] The present invention has the following advantages over the prior art:
[0053] This invention designs a method and system for predicting dissolved oxygen content by fusing spatiotemporal features of multivariate interrelationships. It introduces an innovative spatiotemporal fusion feature extraction network, cleverly using a graph attention mechanism to extract the potential interrelationships between water quality factors. Simultaneously, a multi-channel attention mechanism is designed to assign weights to the output channels of each convolutional neural network, enhancing important channel features and de-emphasizing unimportant ones. Finally, a long short-term memory neural network combining an encoder-decoder with an improved attention mechanism is used to extract the temporal dependence features of the sequence. This aims to improve the shortcomings of traditional time series prediction algorithms in extracting spatial features, achieving high-precision prediction. Through accurate dissolved oxygen prediction, it can be applied to freshwater aquaculture. By predicting changes in dissolved oxygen content, aerators can be pre-controlled, ensuring that dissolved oxygen in the water remains within a suitable range for fish growth. This prevents fish from becoming sluggish due to oxygen deficiency, reducing their breathing and feeding abilities, thus affecting their foraging and migration activities, improving fish survival rates, and increasing the overall economic value of aquaculture. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0055] Figure 1 This is a flowchart of the multivariate inter-correlation spatiotemporal feature fusion method for predicting dissolved oxygen content according to Embodiment 1 of the present invention.
[0056] Figure 2 This is a schematic diagram of the graph structure of the graph attention neural network in Embodiment 1 of the present invention.
[0057] Figure 3 This is a schematic diagram of the local feature extraction network after multi-channel attention optimization in Embodiment 1 of the present invention;
[0058] Figure 4 This is a schematic diagram of the structure of the encoder-decoder long short-term memory neural network that incorporates an attention mechanism according to Embodiment 1 of the present invention.
[0059] Figure 5 Fit a scatter plot to the existing GRU model.
[0060] Figure 6 Fit a scatter plot to the existing LSTM model.
[0061] Figure 7 Fit a scatter plot to the existing PCA-LSTM model.
[0062] Figure 8 Fit a scatter plot to the existing LSTM-TCN model.
[0063] Figure 9 Fit a scatter plot to the existing PatchTST model.
[0064] Figure 10 Fit a scatter plot to the existing IEDLSTM model.
[0065] Figure 11 Fit a scatter plot to the existing MIC-IEDLSTM model.
[0066] Figure 12 Fit a scatter plot to the existing MIC-GAT-IEDLSTM model.
[0067] Figure 13 The scatter plot is the fitting plot of the dissolved oxygen content prediction model in Embodiment 1 of the present invention.
[0068] Figure 14This is a structural block diagram of the multivariate inter-correlation spatiotemporal feature fusion dissolved oxygen content prediction system of Embodiment 2 of the present invention.
[0069] Figure 15 This is a structural block diagram of the computer device according to Embodiment 3 of the present invention. Detailed Implementation
[0070] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0071] Example 1:
[0072] like Figure 1 As shown in the figure, this embodiment provides a method for predicting dissolved oxygen content by fusing spatiotemporal features of multivariate cross-correlation. The method includes the following steps:
[0073] S101. Obtain water quality sample dataset.
[0074] The water quality sample data in this embodiment include water temperature, pH, conductivity, turbidity, permanganate, ammonia nitrogen, total phosphorus, total nitrogen, and dissolved oxygen.
[0075] S102. For the water quality sample dataset, the maximum information coefficient is used to screen the influencing factor sequences that are more correlated with dissolved oxygen than the preset value, and the dissolved oxygen sequence is also screened.
[0076] To reduce data dimensionality and minimize the impact of redundant variables on prediction accuracy, the maximum information coefficient was used to screen the influencing factor sequences that were correlated with dissolved oxygen more than a preset value, and the dissolved oxygen sequence was also screened.
[0077] Furthermore, step S102 specifically includes:
[0078] S1021. Calculate the joint probability density and individual marginal probability densities of the impact factor sequence and the dissolved oxygen sequence, and calculate the mutual information value and maximum information coefficient between the impact factor sequence and the dissolved oxygen sequence. The calculation formulas are as follows:
[0079]
[0080] Where p(x,y) is the joint probability density function of variables X and Y, p(x) and p(y) are the marginal probability density functions of variables X and Y respectively, I(X,Y) is the mutual information value of variables X and Y, MIC(X,Y) is the maximum information coefficient of variables X and Y, and X and Y refer to the influencing factor sequence and dissolved oxygen sequence respectively.
[0081] S1022. Filter the sequence of influencing factors with the largest information coefficient greater than the preset value and the dissolved oxygen sequence of the first n-1 time steps.
[0082] In this embodiment, the preset value is 0.3. The influence factor sequences with the maximum information coefficient greater than 0.3 are selected so that each influence factor sequence has the same scale, thereby reducing the impact of redundant variables on prediction accuracy, and the dissolved oxygen sequence of the first n-1 time steps is selected.
[0083] S103. Standardize the selected influencing factor sequences and dissolved oxygen sequences to obtain standardized data.
[0084] In this embodiment, the selected influencing factor sequences and dissolved oxygen sequences are divided into training, validation, and test sets in a 6:2:2 ratio. Specifically, 60% of the data samples are used to train the model, 20% of the data samples are used for model validation, and the hyperparameters of the model, including learning rate, batch size, number of iterations, and number of neurons, are adjusted to ensure that the model does not overfit. The remaining 20% of the data samples are used for model testing to test the model's performance on unknown datasets, and the three datasets are standardized.
[0085] Furthermore, step S103 specifically includes:
[0086] S1031. Calculate the mean and standard deviation of each influencing factor sequence and each dissolved oxygen sequence.
[0087] S1032. Substitute the mean and standard deviation into the standardization formula to perform standardization processing and obtain standardized data.
[0088] The standardization method used in this embodiment is the z-score standardization method. The mean and standard deviation are substituted into the standardization formula for standardization. The calculation formula is as follows:
[0089]
[0090] Where μ and σ are the mean and standard deviation of variable x, respectively, X represents the standardized data, and x refers to the selected influencing factor sequence or dissolved oxygen sequence.
[0091] S104. The dissolved oxygen content prediction model is trained using standardized data to obtain a trained dissolved oxygen content prediction model.
[0092] The dissolved oxygen content prediction model in this embodiment includes a spatial feature extraction network, a local feature extraction network, a multi-channel attention network, and a long short-term memory (LSTM) network combining an encoder-decoder with an attention mechanism. It can divide the standardized datasets into time windows, that is, it constructs multiple batches of data samples in the form of a sliding window. The number of data samples in each batch is the set time window length value, and the set time window size is 84.
[0093] Furthermore, step S104 specifically includes:
[0094] S1041. Input standardized data into a spatial feature extraction network to extract spatial features between different variables.
[0095] The spatial feature extraction network in this embodiment is a graph attention neural network (GAT). The GAT has 32 hidden layer nodes and 4 heads, and its structure is as follows: Figure 2 As shown; specifically, a graph structure and node feature matrix are constructed, standardized data are used as input nodes, and the attention weights of associated monitoring points to the central node are calculated; the attention weights are subjected to a nonlinear transformation to obtain normalized attention weights; based on the normalized attention weights, the node feature matrix of the central monitoring node is calculated as the central node feature matrix; the output of the graph attention neural network is averaged to obtain the updated central node feature matrix.
[0096] Furthermore, by constructing a graph structure and a node feature matrix, the input is {X1,X2,…X...} m}, where X i For the input node, calculate the attention weight e of the associated monitoring points to the central node. cs , specific e cs This can be expressed by the following formula:
[0097] e cs =α(WX c WX s (4)
[0098] Where α is the weight vector, W is the learnable shared weight matrix, and X... c and X s These are the node feature matrices for the central monitoring node c and other associated monitoring source nodes s, respectively.
[0099] Furthermore, regarding the calculated attention weight e cs The attention weights between nodes are nonlinearly transformed using the LeakReLU activation function to obtain the normalized attention weights α. cs The calculation formula is as follows:
[0100]
[0101] Furthermore, based on the normalized attention weights, the node feature matrix of the central monitoring node is calculated, which serves as the central node feature matrix. The calculation formula is as follows:
[0102]
[0103] Furthermore, to extract richer feature information, multiple subgraph attention layers are constructed, and the outputs of these subgraph attention layers are weighted and averaged to obtain the updated center node feature matrix. The calculation formula is as follows:
[0104]
[0105] S1042. Input the spatial features into the local feature extraction network to extract the local features of the spatial features at the time step.
[0106] The local feature extraction network in this embodiment includes convolutional layers, max pooling layers, and residual layers. The first convolutional layer and max pooling layer have 16 channels, the second convolutional layer and max pooling layer have 32 channels, and the kernel size of the convolutional layers is 3×3. The residual layer is composed of convolutional layers with 1×1 kernels and 32 output channels. The local feature extraction network extracts the local features of the updated center node feature matrix at the time step.
[0107] S1043. For local features, a multi-head channel attention network is used to assign weights to each output channel to calculate the updated spatial features.
[0108] The multi-channel attention network in this embodiment includes a global max pooling layer, a global average pooling layer, and a linear layer. It extracts the average and peak feature information of each channel within a time window through feature fusion of the global average pooling layer and the global max pooling layer, obtaining a global average feature matrix and a global peak feature matrix. The global average and peak feature matrices are then non-linearly processed using a Gaussian error linear unit activation function (GeLU) and a fully connected layer, followed by adaptive weighted fusion. Simultaneously, multiple sub-channel attention layers are constructed and concatenated to enhance the representational capability of the channel attention network. Finally, a linear layer restores the original feature dimension, and matrix multiplication is used to assign weights to each channel in the feature matrix extracted by the original local feature extraction network, resulting in updated spatial features. The local feature extraction network optimized by multi-channel attention is as follows: Figure 3 As shown.
[0109] Furthermore, an adaptive fusion coefficient γ is introduced to adaptively weight and fuse the global average information feature matrix and the global peak information feature matrix. The calculation formula is as follows:
[0110] w c =γ*w avg +(1-γ)*w max (8)
[0111] Among them, w avg and w max These are the global average information feature matrix and the global peak information feature matrix, respectively.
[0112] Furthermore, by constructing multiple sub-attention layers and performing concatenation operations, the model can capture the importance of features from different angles and subspaces. The calculation formula is as follows:
[0113] β=Linear(concentrate(head1,head 2, …,head p (9)
[0114] Among them, head i For different independent attention heads.
[0115] Furthermore, the original feature dimension is restored through a linear layer, and weights are assigned to each channel of the original local feature extraction network using matrix multiplication. The updated spatial feature calculation formula is as follows:
[0116] X′ conv =Linear(β×X) conv (10)
[0117] Where β is the channel weight, X conv As the initial spatial feature, X′ conv This refers to the updated spatial features.
[0118] S1044. Input the updated spatial features into the long short-term memory network of the encoder-decoder combined with the attention mechanism to extract the temporal features and calculate the dissolved oxygen value at the next time step.
[0119] In this embodiment, the encoder-decoder long short-term memory network incorporating an attention mechanism is as follows: Figure 4 As shown, it includes a bidirectional long short-term memory network, an attention mechanism, and a long short-term memory network. The long short-term memory network, which combines an encoder-decoder with an attention mechanism, captures the temporal features of the long-term dependencies of updated spatial features in the time series. The calculation formula is as follows:
[0120] f t=sigmoid(W hf h t-1 +W if x t +b f (11)
[0121] i t =sigmoid(W hi h t-1 +W ii x t +b i (12)
[0122] o t =sigmoid(W ho h t-1 +W io x y +b o (13)
[0123]
[0124] h t =o t ⊙tanh(C t (16)
[0125] Where x and h represent the input state and hidden state, respectively, t represents the current time step, ⊙ represents an element-wise multiplication, and W and b are the learnable weights and biases between each gate, respectively. C represents the current cell state. y-1 f represents the cell state at a past moment. t i t and o t These represent the forget gate, input gate, and output gate, respectively.
[0126] Furthermore, the bidirectional long short-term memory network is used in the encoder stage to generate the output of the last time step by passing the sequence input to the encoder through the bidirectional long short-term memory network; wherein, the number of hidden layer nodes in the bidirectional long short-term memory network is 64.
[0127] Specifically, the sequence F = {F1, F2, ..., F...} t The input is fed into the encoder, and at each time step, the current input F is... t-τ The hidden state h of the previous time step t-τ-1 The input is fed into the bidirectional long short-term memory network to generate the hidden state h at each time step. t-τ The context vector C is calculated using the following formula:
[0128] h t-τ =BiLSTM(ht-τ-1 ,F t-τ (17)
[0129] C = h t (18)
[0130] Furthermore, the attention mechanism is used to calculate the similarity weights based on the hidden state of the encoder output and the hidden state of the decoder at the previous time step, distribute the similarity weights to the hidden state of the encoder output at each time step, and obtain the updated context vector by summing them.
[0131] Specifically, the encoder outputs the hidden state h. t-τ The hidden state S of the decoder at the previous moment t-1 The similarity weights are calculated and then assigned to the hidden states at each time step of the encoder output. The updated context vector is obtained by summing these weights, as shown in the following formula:
[0132] z t-τ =softmax(Linear(concentrate(h t-τ ,S t-1 ))) (19)
[0133]
[0134] Among them, z t-τ For the similarity weight at each time step, h t-τ For the encoder's output hidden state, C ′ This is the context vector updated with similarity weights.
[0135] Furthermore, the Long Short-Term Memory (LSTM) network is used in the decoder stage. The updated encoder context vector and the decoder's previous hidden state are input into the LSM network of the decoder. A linear layer maps the current hidden state of the decoder to the output, yielding the dissolved oxygen value y for the next time step. t The hidden layer of the Long Short-Term Memory (LSTM) network has 64 nodes, calculated as follows:
[0136] y t =Linear(LSTM(C ′ ,S t-1 )) (twenty one)
[0137] S1045. When the number of iterations reaches the preset number, the trained dissolved oxygen content prediction model is obtained.
[0138] The preset number of iterations in this embodiment is 100. In order to verify the generalization ability of the model, three indicators, namely mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE), are used to compare the generalization ability of the current mainstream model with that of the model in this embodiment. At the same time, ablation experiments are conducted to verify the impact of different modules on the generalization ability of the model.
[0139] Specifically, the formulas for calculating the mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE) are as follows:
[0140]
[0141] Where n is the total number of sample classes, i is a certain sample, and y i For the true value, These are predicted values.
[0142] This embodiment compares the trained dissolved oxygen content prediction model (denoted as MIC-GAT-MCA-IEDLSTM) with GRU (Gated Recurrent Unit), LSTM (Long Short-Term Memory), PCA-LSTM (Principal Component Analysis-Long Short-Term Memory), TCN-LSTM (Temporal Convolutional Network-Long Short-Term Memory), and PatchTST (Patch Time Series Transformer Network) to predict three performance indicators of dissolved oxygen for the next day (6 time steps). Specific performance indicator comparison results and scatter plots of the different models are shown in Table 1 and... Figures 5 to 9 , Figure 13 As shown.
[0143] Table 1 Comparison of Model Performance Indicators
[0144]
[0145] As shown in Table 1, compared with the single models GRU and LSTM, the MIC-GAT-MCA-IEDLSTM proposed in this embodiment reduces MAE, RMSE, and MAPE by 23.4%, 20%, and 24.4%, and by 35.7%, 30%, and 36%, respectively. Meanwhile, compared with the hybrid models PCA-LSTM and LSTM-TCN, the model proposed in this paper shows a significant improvement in predicting dissolved oxygen content, reducing MAE, RMSE, and MAPE by 17.9%, 16.3%, and 18.3%, and by 18.5%, 15.5%, and 18.3%, respectively. Finally, compared with PathTST, which is popular among scholars for its high accuracy in time series prediction, the model proposed in this embodiment reduces MAE, RMSE and MAPE by 7.3%, 6.2% and 6.7% respectively. Therefore, it can be concluded that the MIC-GAT-MCA-IEDLSTM proposed in this embodiment has higher accuracy in dissolved oxygen content prediction compared with other models, and its prediction performance is better.
[0146] To investigate the impact of each module on the model's generalization ability, ablation experiments are necessary. The specific performance index comparison results after ablation experiments and the model's fitting scatter plot are shown in Table 2 and... Figures 10 to 13 As shown.
[0147] Table 2 Comparison of performance indicators of ablation experimental models
[0148]
[0149] As shown in Table 2, each network designed in this invention improves the model accuracy, proving that each network has an improving effect on the model.
[0150] S105. Input the water quality data to be tested into the trained dissolved oxygen content prediction model for prediction, and output the predicted dissolved oxygen content at the next moment.
[0151] This embodiment verifies the accuracy of the dissolved oxygen content prediction model and applies it to the prediction of dissolved oxygen content. By inputting the water quality data to be measured into the trained dissolved oxygen content prediction model, the model is used to make predictions and outputs the predicted dissolved oxygen content for the next time step.
[0152] It should be noted that although the above-described method operations are depicted in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the illustrated operations must be performed to achieve the desired result. On the contrary, the order of execution of the depicted steps can be changed. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0153] Example 2:
[0154] like Figure 14 As shown in the figure, this embodiment provides a multivariate inter-correlation spatiotemporal feature fusion dissolved oxygen content prediction system. The system includes an acquisition module 1401, a screening module 1402, a standardization processing module 1403, a training module 1404, and a prediction module 1405. The specific functions of each module are as follows:
[0155] Module 1401 is used to acquire water quality sample datasets;
[0156] The screening module 1402 is used to screen the series of influencing factors that are correlated with dissolved oxygen greater than a preset value using the maximum information coefficient for the water quality sample dataset, and to screen the dissolved oxygen series.
[0157] The standardization processing module 1403 is used to standardize the screened impact factor sequences and dissolved oxygen sequences to obtain standardized data;
[0158] Training module 1404 is used to train the dissolved oxygen content prediction model using standardized data to obtain a trained dissolved oxygen content prediction model. The dissolved oxygen content prediction model includes a spatial feature extraction network, a local feature extraction network based on a multi-head channel attention mechanism, and a long short-term memory network combining an encoder-decoder with an attention mechanism.
[0159] The prediction module 1405 is used to input the water quality data to be tested into the trained dissolved oxygen content prediction model for prediction and output the predicted dissolved oxygen content at the next moment.
[0160] The specific implementation of each module in this embodiment can be found in Embodiment 1 above, and will not be repeated here. It should be noted that the system provided in this embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure can be divided into different functional units to complete all or part of the functions described above.
[0161] Example 3:
[0162] This embodiment provides a computer device, such as... Figure 15As shown, it includes a processor 1502, a memory, an input device 1503, a display device 1504, and a network interface 1505 connected via a device bus 1501. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium 1506 and internal memory 1507. The non-volatile storage medium 1506 stores operating devices, computer programs, and a database. The internal memory 1507 provides an environment for the operation of the operating devices and computer programs in the non-volatile storage medium. When the processor 1502 executes the computer program stored in the memory, it implements the multivariate cross-correlation spatiotemporal feature fusion dissolved oxygen content prediction method of Embodiment 1 above, as follows:
[0163] A water quality sample dataset is obtained. For this dataset, the maximum information coefficient is used to filter influencing factor sequences with a correlation greater than a preset value to dissolved oxygen, and a dissolved oxygen sequence is also selected. The selected influencing factor sequences and dissolved oxygen sequences are standardized to obtain standardized data. The standardized data is used to train a dissolved oxygen content prediction model, which includes a spatial feature extraction network, a local feature extraction network, a multi-channel attention network, and a long short-term memory network combining an encoder and decoder with an attention mechanism. The water quality data to be tested is input into the trained dissolved oxygen content prediction model for prediction, and the predicted dissolved oxygen content for the next time step is output.
[0164] Example 4:
[0165] This embodiment provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the multivariate cross-correlation spatiotemporal feature fusion dissolved oxygen content prediction method of Embodiment 1 above, as follows:
[0166] A water quality sample dataset is obtained. For this dataset, the maximum information coefficient is used to filter influencing factor sequences with a correlation greater than a preset value to dissolved oxygen, and a dissolved oxygen sequence is also selected. The selected influencing factor sequences and dissolved oxygen sequences are standardized to obtain standardized data. The standardized data is used to train a dissolved oxygen content prediction model, which includes a spatial feature extraction network, a local feature extraction network, a multi-channel attention network, and a long short-term memory network combining an encoder and decoder with an attention mechanism. The water quality data to be tested is input into the trained dissolved oxygen content prediction model for prediction, and the predicted dissolved oxygen content for the next time step is output.
[0167] It should be noted that the computer-readable storage medium in this embodiment can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0168] In this embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this embodiment, the computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable program. This propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable storage medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0169] The aforementioned computer-readable storage medium can be used to write computer programs for executing this embodiment in one or more programming languages or combinations thereof. These programming languages include object-oriented programming languages—such as Java, Python, and C++—and conventional procedural programming languages—such as C or similar programming languages. The program can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0170] In summary, this invention designs a multivariate inter-correlation spatiotemporal feature fusion method and system for predicting dissolved oxygen content. It introduces an innovative spatiotemporal fusion feature extraction network, cleverly using a graph attention mechanism to extract potential inter-correlation spatial features between water quality factors. Simultaneously, a multi-channel attention mechanism is designed to assign weights to the output channels of each convolutional neural network, enhancing important channel features and de-emphasizing unimportant ones. Finally, a long short-term memory neural network combining an encoder-decoder with an improved attention mechanism is used to extract the temporal dependence features of the sequence. This aims to improve the shortcomings of traditional time series prediction algorithms in extracting spatial features, achieving high-precision prediction. Through accurate dissolved oxygen prediction, it can be applied to freshwater aquaculture. By predicting changes in dissolved oxygen content, aerators can be pre-controlled, ensuring that dissolved oxygen in the water remains within a suitable range for fish growth. This prevents fish from becoming sluggish due to oxygen deficiency, reducing their breathing and feeding abilities, thus affecting their foraging and migration activities, improving fish survival rates, and increasing the overall economic value of aquaculture.
[0171] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope disclosed in the present invention, based on the technical solution and inventive concept of the present invention, shall fall within the scope of protection of the present invention.
Claims
1. A method for predicting dissolved oxygen content by fusing spatiotemporal features of multivariate cross-correlation, characterized in that, The method includes: Obtain water quality sample dataset; For the water quality sample dataset, the maximum information coefficient was used to screen the influencing factor sequences that were correlated with dissolved oxygen greater than a preset value, and the dissolved oxygen sequence was also screened. The screened influencing factor sequences and dissolved oxygen sequences were standardized to obtain standardized data. The dissolved oxygen content prediction model is trained using standardized data to obtain a trained dissolved oxygen content prediction model. The dissolved oxygen content prediction model includes a spatial feature extraction network, a local feature extraction network, a multi-channel attention network, and a long short-term memory network of encoder-decoder that combines attention mechanism. The water quality data to be tested is input into the trained dissolved oxygen content prediction model for prediction, and the predicted dissolved oxygen content at the next moment is output.
2. The method for predicting dissolved oxygen content by fusing multivariate inter-correlation spatiotemporal features according to claim 1, characterized in that, The process of using the maximum information coefficient to screen the influencing factor sequences with a correlation greater than a preset value to dissolved oxygen, and then screening the dissolved oxygen sequences, specifically includes: Calculate the joint probability density and individual marginal probability density of the impact factor sequence and dissolved oxygen sequence, and calculate the mutual information value and maximum information coefficient between the impact factor sequence and dissolved oxygen sequence. The sequence of influencing factors with the largest information coefficient greater than the preset value and the dissolved oxygen sequence of the first n-1 time steps are selected.
3. The method for predicting dissolved oxygen content by fusing multivariate inter-correlation spatiotemporal features according to claim 1, characterized in that, The process of standardizing the screened influencing factor sequences and dissolved oxygen sequences to obtain standardized data specifically includes: Calculate the mean and standard deviation for each influencing factor sequence and each dissolved oxygen sequence; The mean and standard deviation are substituted into the standardization formula to perform standardization processing, resulting in standardized data.
4. The method for predicting dissolved oxygen content by fusing multivariate inter-correlation spatiotemporal features according to claim 1, characterized in that, The process of training the dissolved oxygen content prediction model using standardized data to obtain a trained dissolved oxygen content prediction model specifically includes: Standardized data is input into a spatial feature extraction network to extract spatial features between different variables; Spatial features are input into a local feature extraction network to extract local features of spatial features at time steps; For local features, a multi-head channel attention network is used to assign weights to each output channel to calculate the updated spatial features; The updated spatial features are input into a long short-term memory network combining an encoder-decoder with an attention mechanism to extract temporal features, and the dissolved oxygen value at the next time step is calculated. When the number of iterations reaches the preset number, a well-trained dissolved oxygen content prediction model is obtained.
5. The method for predicting dissolved oxygen content by fusing multivariate inter-correlation spatiotemporal features according to claim 4, characterized in that, The spatial feature extraction network is a graph attention neural network; The step of inputting standardized data into a spatial feature extraction network to extract spatial features between different variables specifically includes: Construct a graph structure and node feature matrix, use standardized data as input nodes, and calculate the attention weight of associated monitoring points to the central node; The attention weights are subjected to a nonlinear transformation to obtain the normalized attention weights. Based on the normalized attention weights, the node feature matrix of the central monitoring node is calculated and used as the central node feature matrix. Construct multiple subgraph attention layers, and then perform a weighted average of the outputs of these subgraph attention layers to obtain the updated center node feature matrix.
6. The method for predicting dissolved oxygen content by fusing multivariate inter-correlation spatiotemporal features according to claim 4, characterized in that, For local features, a multi-head channel attention network is used to assign weights to each output channel to calculate the updated spatial features, specifically including: The average and peak feature information of each channel within the time window is extracted through feature fusion using a global average pooling layer and a global max pooling layer. A Gaussian error linear unit activation function and a fully connected layer are used to nonlinearly process the global average and peak feature matrices, followed by adaptive weighted fusion. Simultaneously, multiple sub-channel attention layers are constructed and concatenated to enhance the representational capability of the channel attention network. Finally, a linear layer restores the original feature dimension, and matrix multiplication is used to assign weights to each channel in the feature matrix extracted by the original local feature extraction network, resulting in updated spatial features.
7. The method for predicting dissolved oxygen content by fusing multivariate inter-correlation spatiotemporal features according to claim 4, characterized in that, The encoder-decoder long short-term memory network incorporating an attention mechanism includes a bidirectional long short-term memory network component, an attention mechanism component, and a long short-term memory network component. The bidirectional long short-term memory network is used in the encoder stage to generate the hidden state and context vector for each time step by passing the sequence input to the encoder through the bidirectional long short-term memory network. The attention mechanism is used to calculate similarity weights based on the hidden state output by the encoder and the hidden state of the decoder at the previous time step, distribute the similarity weights to the hidden state of the encoder output at each time step, and obtain the updated context vector by summing them. The long short-term memory network is used in the decoder stage. The updated encoder context vector and the previous hidden state of the decoder are input into the long short-term memory neural network of the decoder. The hidden state of the decoder at the current time step is mapped through a linear layer, and the dissolved oxygen value of the next time step is output.
8. A multivariate inter-correlation spatiotemporal feature fusion system for predicting dissolved oxygen content, characterized in that, The system includes: The acquisition module is used to acquire water quality sample datasets; The filtering module is used to filter the series of influencing factors that are more correlated with dissolved oxygen than a preset value for the water quality sample dataset using the maximum information coefficient, and to filter the dissolved oxygen series. The standardization module is used to standardize the screened impact factor sequences and dissolved oxygen sequences to obtain standardized data. The training module is used to train the dissolved oxygen content prediction model using standardized data to obtain a trained dissolved oxygen content prediction model. The dissolved oxygen content prediction model includes a spatial feature extraction network, a local feature extraction network based on a multi-head channel attention mechanism, and a long short-term memory network combining an encoder-decoder with an attention mechanism. The prediction module is used to input the water quality data to be tested into the trained dissolved oxygen content prediction model for prediction, and output the predicted dissolved oxygen content at the next moment.
9. A computer device comprising a processor and a memory for storing a processor-executable program, characterized in that, When the processor executes the program stored in the memory, it implements the multivariate inter-correlation spatiotemporal feature fusion dissolved oxygen content prediction method according to any one of claims 1-7.
10. A computer-readable storage medium storing a program, characterized in that, When the program is executed by the processor, it implements the multivariate cross-correlation spatiotemporal feature fusion dissolved oxygen content prediction method according to any one of claims 1-7.
Citation Information
Cited By
Phytoplankton monitoring scheme design method based on multivariable time sequence model
CN122087351A