Fishery culture water environment quality prediction method
Through the HTDM prediction model, the time series decomposition and feature extraction module are used, combined with the attention mechanism and the cross attention mechanism, the problem of difficult to deal with long time series and capture short-term fluctuations and long-term trends in water quality data in the existing technology is solved, and the accurate prediction of the environmental quality of fishery aquaculture water bodies is achieved.
Patent Information
- Application Number
- CN202510050837.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-05-06
AI Technical Summary
The existing water quality prediction methods have high computational complexity when dealing with long time series, making it difficult to capture short-term fluctuations and long-term trends of water quality data at the same time, and cannot meet the needs of modern fisheries for dynamic water quality management.
A HTDM prediction model is proposed, including a time series decomposition module, a key feature extraction module and a prediction module. Through moving average filter denoising, polynomial fitting and boundary compensation decomposition of long-term trends and seasonal fluctuations, combined with feature selection attention mechanisms and cross attention mechanisms, higher-order features are extracted and deeply integrated to generate accurate predictive values for the environmental quality of fishery aquaculture water bodies.
It significantly improves the ability to capture time series features, enhances the model's ability to interpret data, can efficiently process long time series, accurately capture short-term fluctuations and long-term trends, and provides accurate prediction of water environmental quality.
Smart Images

Figure CN119941036A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of machine learning, and in particular relates to a method for predicting the environmental quality of aquaculture water bodies. Background Art
[0002] With the growth of global population and the increasing demand for aquatic products, fishery farming has become an important means to meet human protein needs. However, the quality of water environment directly affects fishery output and aquatic product safety. A good water environment is the basis for the healthy growth of farmed aquatic organisms. The main indicators include water temperature, pH value, dissolved oxygen, ammonia nitrogen, nitrite, etc. These indicators will change dynamically with factors such as season, weather, farming density and human intervention, affecting the ecological balance of water bodies. Once the water quality deteriorates, such as hypoxia and excessive concentration of pollutants, it is easy to cause fish diseases and even large-scale deaths, causing huge economic losses to farmers. Therefore, how to accurately monitor and predict the quality of water environment and take regulatory measures in advance is a key challenge facing modern fishery farming.
[0003] Traditional water quality prediction methods rely on manual sampling and laboratory analysis, which have long cycles and poor real-time performance, and are difficult to meet the needs of modern fisheries for dynamic water quality management. In recent years, Internet of Things technology and sensor equipment have made real-time collection of water environment data possible, but how to extract effective information from massive data and make high-precision predictions remains a challenge. Existing time series prediction methods have high computational complexity when processing long time series, and it is difficult to simultaneously capture both short-term fluctuations and long-term trends in water quality data.
[0004] Accurate prediction of the environmental quality of fishery aquaculture water is of great significance for ensuring the sustainable development of fishery production. On the one hand, the prediction results can help farmers regulate the water environment in real time, such as oxygenation, water exchange and feed control, to reduce the risks brought by water quality fluctuations. On the other hand, water quality prediction technology can provide a scientific decision-making basis for the government and relevant agencies, promote the development of smart fisheries, and assist in the green and intelligent management of aquaculture. Therefore, it is very important to use machine learning methods to solve the prediction of water environment quality in fishery aquaculture. Summary of the invention
[0005] The present invention provides a method for predicting the environmental quality of aquaculture water bodies. Aiming at the environmental quality-related data of aquaculture water bodies with short-term fluctuations and long-term trends, an HTDM prediction model is proposed, which consists of a time series decomposition module, a key feature extraction module and a prediction module.
[0006] The technical solution adopted by the present invention to achieve the above-mentioned purpose specifically comprises the following steps: S1. Collect data related to the environmental quality of fishery aquaculture water bodies, including characteristics and target variables, and pre-process the collected data; S2, using moving average filter to remove noise from fishery aquaculture water environment quality data, using Perform normalization operations and divide the data into training sets and test sets; S3. Build a time series decomposition module to process the long-term trend and seasonal fluctuations of the data, which includes the following steps: S31. Build a feature extractor and input Fishery aquaculture water environment quality data for time steps , combined with polynomial fitting and boundary compensation methods, the long-term trend is obtained With seasonal trends , and integrate the decomposition function to initialize the seasonal trend input Input with long term trend ; S32. Propose a feature selection attention mechanism, calculate the probability of attention distribution through a weighted kernel smoother, introduce JS divergence and define a distribution diversity metric to measure attention distribution With the benchmark distribution similarity; S33, calculating a weighted correlation function through dynamic time warping, and performing a normalization operation on the weighted correlation function; S34, the input fishery aquaculture water environment quality data is processed through the feature selection attention mechanism and the multi-layer perceptron to obtain the final output of the feature extractor ; S4. Construct a key feature extraction module for modeling seasonal trends and long-term trends and extracting high-order features, which specifically includes the following steps: S41. Seasonal trend input through decomposition function and feature selection attention mechanism and long-term trend input Perform first-order decomposition processing; S42, introduce the cross attention mechanism to realize the mutual modeling update of seasonal trend components and long-term trend components, and perform 2nd-order further processing on the updated seasonal trend components and long-term trend components; S43. The seasonal trend component and long-term trend component obtained by further processing the second order are subjected to nonlinear mapping through a multi-layer perceptron to extract high-order features, and the third-order seasonal trend component and long-term trend component are obtained. Finally, a prediction module is constructed to use a fusion network to integrate the final seasonal trend component and long-term trend component to obtain the predicted value of the environmental quality of aquaculture water. .
[0007] Preferably, in S1, the fishery aquaculture water environment quality related data include aquaculture water temperature data, water pH value data, water dissolved oxygen data, water ammonia nitrogen data, water nitrite data, and fishery aquaculture density data, and the mean method is used to fill in the missing data values. The specific formula is: ; In the formula, To fill the mean, is the number of missing values, is a non-missing value.
[0008] Preferably, in S2, a moving average filter is used to denoise the fishery aquaculture water environment quality data, and the specific formula is: ; In the formula, is the window width, is the output value at the nth sampling point after filtering, It is the relative index within the window, which will be used later. Perform normalization operation, the specific formula is: ; In the formula, For the environmental quality data of fishery aquaculture water bodies, is the normalized fishery aquaculture water environment quality data, It is the maximum value in the environmental quality data of fishery aquaculture water bodies. It is the minimum value in the environmental quality data of fishery aquaculture water bodies.
[0009] Preferably, in S3 and S31, a feature extractor is constructed and the input is decomposed and initialized. Fishery aquaculture water environment quality data for time steps , and decompose the second half of the data, and smooth the data by combining polynomial fitting and boundary compensation method to obtain the long-term trend. The specific formula is: ; In the formula, is the polynomial fitting function, For boundary compensation operation, The intermediate time step of the environmental quality data of aquaculture water To the last time step The seasonal trend is then calculated using the following formula: ; In the formula, For the long-term trend, for The environmental quality data of aquaculture water bodies at each time step, is the seasonal trend, and then the long-term trend and seasonal trend calculation process are integrated as the decomposition function. The specific formula is: ; In the formula, For the calculation of long-term trend and seasonal trend, the noise-based method is used to generate the initial noise matrix, and the long-term trend , Seasonal Trends Perform splicing operations respectively and initialize the input of the output generator. The specific formula is: ; ; In the formula, For seasonal trend input, For long-term trend input, For splicing operation, is the initial noise matrix, where , is the noise mean, is the noise standard deviation.
[0010] Preferably, the polynomial fitting and boundary compensation methods are combined to decompose the fishery water environment data into long-term trends and seasonal trends, and a noise matrix is generated for initial input, which decomposes the complex time series data into components with different dynamic characteristics, facilitating the subsequent modules to carry out specialized modeling of data with different characteristics, significantly improving the ability to capture time series characteristics and enhancing the model's interpretation of data.
[0011] Preferably, the feature selection attention mechanism proposed in S3 and S32 is based on the original low-rank attention mechanism, and the specific formula is: ; In the formula, For attention output, is the query matrix, is the key matrix, is the value matrix, is the low-rank projection matrix of the key, is a low-rank projection matrix of values, is the scaling factor, To normalize the attention weights, the probability of attention distribution is calculated through a weighted kernel smoother, so that each query vector The attention distribution is based on a weighted kernel smoother, and the specific formula is: ; In the formula, is the conditional probability, indicating the query vector For the key vector The attention weight, is the similarity score between the query vector and the key vector, is the key vector after low-rank projection, is the query vector, is the value vector after low-rank projection, is the low-rank projection dimension, is an exponential function, and then JS divergence is introduced to measure attention distribution With the benchmark distribution The specific formula is: ; In the formula, is the weight factor, is the natural logarithm, is the normalization factor, where is the sequence length of the key vector, is an exponential function, is the intermediate distribution vector, indicating the attention distribution With the benchmark distribution The weighted average distribution of is used to smooth and alleviate numerical differences, and at the same time define a distribution diversity metric to further measure the attention distribution With the benchmark distribution The similarity between them is as follows: ; In the formula, is the distribution diversity measure, is the low-rank projection dimension, is the key matrix, and the similarity of different time points in the environmental quality data of aquaculture water bodies is quantified by the delayed correlation function. The specific formula is: ; In the formula, For time delay, The environmental quality data of fishery aquaculture water bodies are collected in time. The value of is the length of the fishery aquaculture water environment quality data, is the autocorrelation function.
[0012] Preferably, a feature selection attention mechanism is proposed, low-rank projection is used to perform probability calculation on the attention distribution, and the similarity between the attention distribution and the benchmark distribution is measured by distribution diversity metric. By optimizing the attention distribution, the model's ability to focus on important features is enhanced, and the interference of irrelevant features is reduced, which significantly improves the model's feature extraction efficiency and the expression ability of key features.
[0013] Preferably, in S3 and S33, dynamic time warping is used to select Significant time delay , and combined with the distribution diversity metric for different time delays Re-weight the correlation function under , and get the weighted correlation function. The specific formula is: ; ; ; In the formula, The query matrix and key matrix Delay in time The related function below is is the normalization constant, is the alignment path in dynamic time warping, is a constraint condition, each pair of matching points in the path The time delay is , , For the query matrix and the key matrix in The value of the time step, To select an operation, For the selected The most relevant time delay points, is the time delay range, is a measure of distribution diversity Before Weight value, is the distribution diversity measure, The query matrix and key matrix Delay in time The weighted correlation function under The weighted correlation function is normalized, and the specific formula is: ; In the formula, The query matrix and key matrix Delay in time The normalized correlation function on , For the SoftMax function, the specific formula of the feature selection attention mechanism can be expressed as: ; In the formula, is the pair matrix Delay Scroll operation.
[0014] Preferably, dynamic time warping and weighted correlation functions are combined to re-weight the correlation under time delay, capture the delayed correlation in the data, be able to handle the characteristics of nonlinear time changes in the data, enhance the dependency modeling of important time points, and significantly improve the model's ability to model complex dependencies in time series.
[0015] Preferably, the feature extractor stack structure in S3 and S34 is defined as ,in , representing The input of the layer feature extractor is used to process the input fishery aquaculture water environment quality data through the feature selection attention mechanism and the multi-layer perceptron. The specific steps are as follows: ; ; ; In the formula, , For the In the layer feature extractor, the first and second order decomposition results are: For the The final output of the layer feature extractor, For the calculation of long-term trends and seasonal trends, To input to Fishery aquaculture water environment quality data based on layer feature extractor, The feature selection attention mechanism is used to process the input fishery aquaculture water environment quality data. It is the nonlinear mapping operation of the multilayer perceptron on the decomposition results.
[0016] Preferably, by stacking the feature selection attention mechanism and the multi-layer perceptron, nonlinear mapping is performed on the long-term trend and seasonal trend data, which can capture the nonlinear characteristics of the data, further enrich the diversity of feature representation, significantly improve the feature expression ability of the data, and provide high-quality input for subsequent prediction modules.
[0017] Preferably, in S4 and S41, an output generator stack is constructed, and the decomposition function and feature selection attention mechanism are used to select the output generator stack. Enter and Perform the first-order decomposition for the long-term trend input. The specific formula is: ; In the formula, , For the The seasonal trend component and long-term trend component obtained by the first-order decomposition of the layer output generator, For the calculation of long-term trends and seasonal trends, The feature selection attention mechanism is used to process the input fishery aquaculture water environment quality data. is the output of the previous layer output generator, where at layer 1 Input by seasonal trends and long-term trend input constitute.
[0018] Preferably, seasonal trends and long-term trends are decomposed and processed through decomposition functions and feature selection attention mechanisms, which can capture significant features in different trend data, provide a basis for subsequent cross-modeling, improve the modeling accuracy of data with different dynamic characteristics, and enhance the ability to predict trend changes.
[0019] Preferably, a cross attention mechanism is introduced in S4 and S42 to realize the mutual modeling update of seasonal trend components and long-term trend components. The specific formula is: ; ; In the formula, , For the The seasonal trend component and long-term trend component obtained by the first-order decomposition of the layer output generator, is the query matrix, is the key matrix, is the value matrix, For the cross attention processing operation, , is the updated seasonal trend component and long-term trend component, and then the updated seasonal trend component and long-term trend component are further processed in the second order. The specific formula is: ; In the formula, For the The final output of the layer feature extractor, For the calculation of long-term trends and seasonal trends, The feature selection attention mechanism is used to process the input fishery aquaculture water environment quality data. , For the The seasonal trend component and long-term trend component are obtained by further processing the second-order layer output generator.
[0020] Preferably, a cross-attention mechanism is introduced to interactively model and update seasonal trend components and long-term trend components respectively, which enhances the interaction between different trend components and improves the comprehensive prediction ability. The model can more accurately capture the interactive influence of different trends in complex time series.
[0021] Preferably, in S4 and S43, the seasonal trend component and the long-term trend component obtained by further processing the second order by a multilayer perceptron are subjected to nonlinear mapping to extract high-order features, respectively, to obtain the third-order seasonal trend component and the long-term trend component, and weighted summation is performed to obtain the output of the key feature extraction module. The specific formula is: ; ; ; In the formula, , For the The third-order seasonal trend component and long-term trend component of the layer output generator, , For the The seasonal trend component and long-term trend component obtained by further processing the second-order layer output generator, For the The long-term trend component obtained by the first-order decomposition of the layer output generator, For the calculation of long-term trends and seasonal trends, is the nonlinear mapping operation of the multilayer perceptron on the decomposition result. , , are the weighted parameter matrices of the current layer, For the The final seasonal trend component of the layer output generator output, For the The final long-term trend component of the layer output generator output, The final long-term trend component of the previous layer is used to construct a prediction module. The fusion network is used to integrate the final seasonal trend component and the long-term trend component to obtain the predicted value of the environmental quality of aquaculture water. The specific formula is: ; In the formula, To integrate the operation of the converged network, It is the predicted value of the environmental quality of fishery aquaculture water.
[0022] Preferably, high-order features are extracted through a multi-layer perceptron, nonlinear mapping is performed on the updated trend components, and key feature representations are generated, which enriches the expressive power of the data, provides multi-dimensional support for the final prediction, further enhances the expressive power of the model, and improves the accuracy of the final prediction results.
[0023] In summary, due to the adoption of the present technical solution, the beneficial effects of the present invention are as follows: the present invention proposes an HTDM prediction model applied to the scenario of fishery aquaculture water environment quality prediction, including a time series decomposition module, a key feature extraction module and a prediction module. The time series decomposition module is used to process the long-term trend and seasonal fluctuation of the data, the key feature extraction module is used to model and extract high-order features of seasonal trends and long-term trends, and the prediction module generates an accurate prediction value for the environmental quality of fishery aquaculture water bodies by deeply fusing different trend features and utilizing nonlinear modeling. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 This is a step-by-step diagram of a method for predicting environmental quality of fishery aquaculture water bodies.
[0025] Figure 2 This is the structural diagram of the HTDM prediction model.
[0026] Figure 3 This is the structural diagram of the time series decomposition module.
[0027] Figure 4 Module diagram for key feature extraction.
[0028] Figure 5 This is a fitting effect diagram for the HTDM prediction model to realize the prediction of fishery aquaculture water environment quality. DETAILED DESCRIPTION
[0029] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0030] See also Figure 1-Figure 5 The present invention provides a technical solution: a method for predicting the environmental quality of aquaculture water bodies, which proposes a HTDM prediction model, constructs a time series decomposition module for processing the long-term trend and seasonal fluctuation of data, and a key feature extraction module models and extracts high-order features for seasonal trends and long-term trends. The prediction module generates an accurate prediction value for the environmental quality of aquaculture water bodies by deeply fusing different trend features and using nonlinear modeling. The specific steps are as follows: Figure 1 shown.
[0031] Construct the HTDM prediction model, whose structure is as follows Figure 2 As shown, the specific steps are as follows:
[0032] S1. Collect data related to the environmental quality of aquaculture water, including characteristics and target variables, and pre-process the collected data.
[0033] Furthermore, the data related to the environmental quality of aquaculture water bodies include aquaculture water temperature data, water pH data, water dissolved oxygen data, water ammonia nitrogen data, water nitrite data, and aquaculture density data. The mean method is used to fill in the missing data values. The specific formula is: ; In the formula, To fill the mean, is the number of missing values, is a non-missing value.
[0034] S2, using moving average filter to remove noise from fishery aquaculture water environment quality data, using Perform normalization and divide the data into training set and test set in a ratio of 7:3.
[0035] Furthermore, a moving average filter is used to denoise the fishery aquaculture water environment quality data. The specific formula is: ; In the formula, is the window width, is the output value at the nth sampling point after filtering, It is the relative index within the window, which will be used later. Perform normalization operation, the specific formula is: ; In the formula, For the environmental quality data of fishery aquaculture water bodies, is the normalized fishery aquaculture water environment quality data, It is the maximum value in the environmental quality data of fishery aquaculture water bodies. It is the minimum value in the environmental quality data of fishery aquaculture water bodies.
[0036] S31. Build a feature extractor and input Fishery aquaculture water environment quality data for time steps , combined with polynomial fitting and boundary compensation methods, the long-term trend is obtained With seasonal trends , and integrate the decomposition function to initialize the seasonal trend input Input with long term trend .
[0037] Furthermore, we construct a time series decomposition module such as Figure 3 As shown, construct a feature extractor and decompose and initialize the input. Fishery aquaculture water environment quality data for time steps , and decompose the second half of the data, and smooth the data by combining polynomial fitting and boundary compensation method to obtain the long-term trend. The specific formula is: ; In the formula, is the polynomial fitting function, For boundary compensation operation, The intermediate time step of the environmental quality data of aquaculture water To the last time step The seasonal trend is then calculated using the following formula: ; In the formula, For the long-term trend, for The environmental quality data of aquaculture water bodies at each time step, is the seasonal trend, and then the long-term trend and seasonal trend calculation process are integrated as the decomposition function. The specific formula is: ; In the formula, For the calculation of long-term trend and seasonal trend, the noise-based method is used to generate the initial noise matrix, and the long-term trend , Seasonal Trends Perform splicing operations respectively and initialize the input of the output generator. The specific formula is: ; ; In the formula, For seasonal trend input, For long-term trend input, For splicing operation, is the initial noise matrix, where , is the noise mean, is the noise standard deviation.
[0038] S32. Propose a feature selection attention mechanism, calculate the probability of attention distribution through a weighted kernel smoother, introduce JS divergence and define a distribution diversity metric to measure attention distribution With the benchmark distribution similarity.
[0039] Furthermore, a feature selection attention mechanism is proposed, based on the original low-rank attention mechanism. The specific formula is: ; In the formula, For attention output, is the query matrix, is the key matrix, is the value matrix, is the low-rank projection matrix of the key, is a low-rank projection matrix of values, is the scaling factor, To normalize the attention weights, the probability of attention distribution is calculated through a weighted kernel smoother, so that each query vector The attention distribution is based on a weighted kernel smoother, and the specific formula is: ; In the formula, is the conditional probability, indicating the query vector For the key vector The attention weight, is the similarity score between the query vector and the key vector, is the key vector after low-rank projection, is the query vector, is the value vector after low-rank projection, is the low-rank projection dimension, is an exponential function, and then JS divergence is introduced to measure attention distribution With the benchmark distribution The specific formula is: ; In the formula, is the weight factor, is the natural logarithm, is the normalization factor, where is the sequence length of the key vector, is an exponential function, is the intermediate distribution vector, indicating the attention distribution With the benchmark distribution The weighted average distribution of is used to smooth and alleviate numerical differences, and at the same time define a distribution diversity metric to further measure the attention distribution With the benchmark distribution The similarity between them is as follows: ; In the formula, is the distribution diversity measure, is the low-rank projection dimension, is the key matrix, and the similarity of different time points in the environmental quality data of aquaculture water bodies is quantified by the delayed correlation function. The specific formula is: ; In the formula, For time delay, The environmental quality data of fishery aquaculture water bodies are collected in time. The value of is the length of the fishery aquaculture water environment quality data, is the autocorrelation function.
[0040] S33. Calculate the weighted correlation function through dynamic time warping, and perform normalization operation on the weighted correlation function.
[0041] Furthermore, by dynamic time warping, Significant time delay , and combined with the distribution diversity metric for different time delays Re-weight the correlation function under , and get the weighted correlation function. The specific formula is: ; ; ; In the formula, The query matrix and key matrix Delay in time The related function below is is the normalization constant, is the alignment path in dynamic time warping, is a constraint condition, each pair of matching points in the path The time delay is , , For the query matrix and the key matrix in The value of the time step, To select an operation, For the selected The most relevant time delay points, is the time delay range, is a measure of distribution diversity Before Weight value, is the distribution diversity measure, The query matrix and key matrix Delay in time The weighted correlation function under The weighted correlation function is normalized, and the specific formula is: ; In the formula, The query matrix and key matrix Delay in time The normalized correlation function on , For the SoftMax function, the specific formula of the feature selection attention mechanism can be expressed as: ; In the formula, is the pair matrix Delay Scroll operation.
[0042] S34, the input fishery aquaculture water environment quality data is processed through the feature selection attention mechanism and the multi-layer perceptron to obtain the final output of the feature extractor .
[0043] Furthermore, the feature extractor stack structure is defined as ,in , representing The input of the layer feature extractor is used to process the input fishery aquaculture water environment quality data through the feature selection attention mechanism and the multi-layer perceptron. The specific steps are as follows: ; ; ; In the formula, , For the In the layer feature extractor, the first and second order decomposition results are: For the The final output of the layer feature extractor, For the calculation of long-term trends and seasonal trends, To input to Fishery aquaculture water environment quality data based on layer feature extractor, The feature selection attention mechanism is used to process the input fishery aquaculture water environment quality data. It is the nonlinear mapping operation of the multilayer perceptron on the decomposition results.
[0044] S41. Seasonal trend input through decomposition function and feature selection attention mechanism and long-term trend input Perform a first-order decomposition.
[0045] Furthermore, we construct a key feature extraction module such as Figure 4 As shown, the output generator stack is constructed by decomposing the function and the feature selection attention mechanism. Enter and Perform the first-order decomposition for the long-term trend input. The specific formula is: ; In the formula, , For the The seasonal trend component and long-term trend component obtained by the first-order decomposition of the layer output generator, For the calculation of long-term trends and seasonal trends, The feature selection attention mechanism is used to process the input fishery aquaculture water environment quality data. is the output of the previous layer output generator, where at layer 1 Input by seasonal trends and long-term trend input constitute.
[0046] S42. Introduce the cross-attention mechanism to realize the mutual modeling update of seasonal trend components and long-term trend components, and perform further second-order processing on the updated seasonal trend components and long-term trend components.
[0047] Furthermore, a cross-attention mechanism is introduced to realize the mutual modeling update of seasonal trend components and long-term trend components. The specific formula is: ; ; In the formula, , For the The seasonal trend component and long-term trend component obtained by the first-order decomposition of the layer output generator, is the query matrix, is the key matrix, is the value matrix, For the cross attention processing operation, , is the updated seasonal trend component and long-term trend component, and then the updated seasonal trend component and long-term trend component are further processed in the second order. The specific formula is: ; In the formula, For the The final output of the layer feature extractor, For the calculation of long-term trends and seasonal trends, The feature selection attention mechanism is used to process the input fishery aquaculture water environment quality data. , For the The seasonal trend component and long-term trend component are obtained by further processing the second-order layer output generator.
[0048] S43. The seasonal trend component and long-term trend component obtained by further processing the second order are subjected to nonlinear mapping through a multi-layer perceptron to extract high-order features, and the third-order seasonal trend component and long-term trend component are obtained. Finally, a prediction module is constructed to use a fusion network to integrate the final seasonal trend component and long-term trend component to obtain the predicted value of the environmental quality of aquaculture water. .
[0049] Furthermore, the seasonal trend component and long-term trend component obtained by further processing the second order are subjected to nonlinear mapping through a multilayer perceptron to extract high-order features, respectively, to obtain the third-order seasonal trend component and long-term trend component, and then weighted summation is performed to obtain the output of the key feature extraction module. The specific formula is: ; ; ; In the formula, , For the The third-order seasonal trend component and long-term trend component of the layer output generator, , For the The seasonal trend component and long-term trend component obtained by further processing the second-order layer output generator, For the The long-term trend component obtained by the first-order decomposition of the layer output generator, For the calculation of long-term trends and seasonal trends, is the nonlinear mapping operation of the multilayer perceptron on the decomposition result. , , are the weighted parameter matrices of the current layer, For the The final seasonal trend component of the layer output generator output, For the The final long-term trend component of the layer output generator output, The final long-term trend component of the previous layer is used to construct a prediction module. The fusion network is used to integrate the final seasonal trend component and the long-term trend component to obtain the predicted value of the environmental quality of aquaculture water. The specific formula is: ; In the formula, To integrate the operation of the converged network, It is the predicted value of the environmental quality of fishery aquaculture water.
[0050] Furthermore, the HTDM prediction model was written in Python, the experiment was run on Windows operating system, Pytorch was used as the framework in CUDA11.27 environment, and training was performed on GeForce RTX 3090. The optimizer was selected ,The initial learning rate is set to 0.001, the training batch is set to 64, the training cycle is set to 100, and the data set is 60 days of wind power and photovoltaic integrated energy storage related data, which are input into the HTDM prediction model after preprocessing.
[0051] Furthermore, the HTDM prediction model can achieve the prediction fitting effect of fishery aquaculture water environment quality as shown in the figure below: Figure 5 As shown in the figure, the horizontal axis is time and the vertical axis is turbidity. Turbidity is an important indicator of water quality. The black solid line and dots in the figure represent actual data, and the gray dotted line and cross represent model predicted data. It can be seen from the figure that the model's predicted value and the actual value have a high degree of fit, indicating that the model performs well in the prediction of water environment quality, and the predicted value can well follow the changing trend of the actual value, especially in the two main rising stages from the 0th day to the 10th day and from the 20th day to the 30th day. The predicted curve and the actual curve are almost completely consistent, showing the high sensitivity of the model to trend changes. In the relatively stable stage (such as the 10th day to the 20th day), the prediction results of the model are basically consistent with the fluctuations of the actual data, indicating that the model's prediction ability in the stable stage is also relatively accurate. The experimental results cover a time range of up to 30 days and maintain a high prediction accuracy throughout the entire time period. Whether in the rapid change stage of water quality or the stable stage, it can provide credible prediction results, indicating that the model has a good prediction ability for the environmental quality of fishery aquaculture water.
Claims
1. A method for predicting the environmental quality of fishery aquaculture water bodies, characterized in that: The following steps are involved: S1. Collect data related to the environmental quality of fishery aquaculture water bodies, including characteristics and target variables, and pre-process the collected data; S2, using moving average filter to remove noise from fishery aquaculture water environment quality data, using Normalize and divide the data set; S3. Build a time series decomposition module to process the long-term trend and seasonal fluctuations of the data, which includes the following steps: S31. Construct a feature extractor and input the fishery aquaculture water environment quality data , combined with polynomial fitting and boundary compensation methods, the long-term trend is obtained With seasonal trends , and integrate the decomposition function to initialize the seasonal trend input Input with long term trend ; S32. Propose a feature selection attention mechanism, perform probability calculation of attention distribution, introduce JS divergence and define distribution diversity metric to measure attention distribution With the benchmark distribution similarity; S33, calculating a weighted correlation function by dynamic time warping, and normalizing the weighted correlation function; S34, process data through feature selection attention mechanism and multi-layer perceptron to obtain the final output of feature extractor ; S4, constructing a key feature extraction module for modeling seasonal trends and long-term trends and extracting high-order features, specifically including the following steps; S41. Seasonal trend input through decomposition function and feature selection attention mechanism and long-term trend input Perform first-order decomposition processing; S42, introduce the cross-attention mechanism to interactively update, and perform 2nd-order further processing on the updated seasonal trend component and long-term trend component; S43, nonlinearly map the seasonal trend component and long-term trend component obtained in S42 through a multi-layer perceptron to obtain the third-order seasonal trend component and long-term trend component. Finally, a prediction module is constructed and integrated using a fusion network to obtain the predicted value of the environmental quality of aquaculture water. .
2. A method for predicting the environmental quality of aquaculture water according to claim 1, characterized in that: In S31, a feature extractor is constructed and the input is decomposed and initialized. Fishery aquaculture water environment quality data for time steps , and decompose the second half of the data, and smooth the data by combining polynomial fitting and boundary compensation method to obtain the long-term trend. The specific formula is: ; In the formula, is the polynomial fitting function, For boundary compensation operation, The intermediate time step of the environmental quality data of aquaculture water To the last time step The seasonal trend is then calculated using the following formula: ; In the formula, For the long-term trend, for The environmental quality data of aquaculture water bodies at each time step, is the seasonal trend, and then the long-term trend and seasonal trend calculation process are integrated as the decomposition function. The specific formula is: ; In the formula, For the calculation of long-term trend and seasonal trend, the noise-based method is used to generate the initial noise matrix, and the long-term trend , Seasonal Trends Perform splicing operations respectively and initialize the input of the output generator. The specific formula is: ; ; In the formula, For seasonal trend input, For long-term trend input, For splicing operation, is the initial noise matrix, where , is the noise mean, is the noise standard deviation.
3. A method for predicting the environmental quality of aquaculture water according to claim 2, characterized in that: The feature selection attention mechanism proposed in S32 is based on the original low-rank attention mechanism. The specific formula is: ; In the formula, For attention output, is the query matrix, is the key matrix, is the value matrix, is the low-rank projection matrix of the key, is a low-rank projection matrix of values, is the scaling factor, To normalize the attention weights, the probability of attention distribution is calculated through a weighted kernel smoother, so that each query vector The attention distribution is based on a weighted kernel smoother, and the specific formula is: ; In the formula, is the conditional probability, indicating the query vector For the key vector The attention weight, is the similarity score between the query vector and the key vector, is the key vector after low-rank projection, is the query vector, is the value vector after low-rank projection, is the low-rank projection dimension, is an exponential function, and then JS divergence is introduced to measure attention distribution With the benchmark distribution The specific formula is: ; In the formula, is the weight factor, is the natural logarithm, is the normalization factor, where is the sequence length of the key vector, is an exponential function, is the intermediate distribution vector, indicating the attention distribution With the benchmark distribution The weighted average distribution of is used to smooth and alleviate numerical differences, and at the same time define a distribution diversity metric to further measure the attention distribution With the benchmark distribution The similarity between them is as follows: ; In the formula, is the distribution diversity measure, is the low-rank projection dimension, is the key matrix, and the similarity of different time points in the environmental quality data of aquaculture water bodies is quantified by the delayed correlation function. The specific formula is: ; In the formula, For time delay, The environmental quality data of fishery aquaculture water bodies are collected in time. The value of is the length of the fishery aquaculture water environment quality data, is the autocorrelation function.
4. A method for predicting the environmental quality of fishery aquaculture water according to claim 3, characterized in that: In S33, dynamic time warping is used to select Significant time delay , and combined with the distribution diversity metric for different time delays Re-weight the correlation function under , and get the weighted correlation function. The specific formula is: ; ; ; In the formula, The query matrix and key matrix Delay in time The related function below is is the normalization constant, is the alignment path in dynamic time warping, is a constraint condition, each pair of matching points in the path The time delay is , , For the query matrix and key matrix in The value of the time step, To select an operation, For the selected The most relevant time delay points, is the time delay range, is a measure of distribution diversity Before Weight value, is a measure of distribution diversity, The query matrix and key matrix Delay in time The weighted correlation function under The weighted correlation function is normalized, and the specific formula is: ; In the formula, The query matrix and key matrix Delay in time The normalized correlation function on , For the SoftMax function, the specific formula of the feature selection attention mechanism can be expressed as: ; In the formula, is the pair matrix Delay Scroll operation.
5. A method for predicting the environmental quality of aquaculture water according to claim 4, characterized in that: The feature extractor stack structure in S34 is defined as ,in , representing The input of the layer feature extractor is used to process the input fishery aquaculture water environment quality data through the feature selection attention mechanism and the multi-layer perceptron. The specific steps are as follows: ; ; ; In the formula, , For the In the layer feature extractor, the first and second order decomposition results are: For the The final output of the layer feature extractor, For the calculation of long-term trends and seasonal trends, To input to Fishery aquaculture water environment quality data based on layer feature extractor, The feature selection attention mechanism is used to process the input fishery aquaculture water environment quality data. It is the nonlinear mapping operation of the multilayer perceptron on the decomposition results.
6. A method for predicting the environmental quality of aquaculture water according to claim 5, characterized in that: The output generator stack is constructed in S41, and the decomposition function and feature selection attention mechanism are used to Enter and Perform the first-order decomposition for the long-term trend input. The specific formula is: ; In the formula, , For the The seasonal trend component and long-term trend component obtained by the first-order decomposition of the layer output generator, For the calculation of long-term trends and seasonal trends, The feature selection attention mechanism is used to process the input fishery aquaculture water environment quality data. is the output of the previous layer output generator, where at layer 1 Input by seasonal trends and long-term trend input constitute.
7. A method for predicting the environmental quality of aquaculture water according to claim 6, characterized in that: The cross attention mechanism is introduced in S42 to realize the mutual modeling update of seasonal trend components and long-term trend components. The specific formula is: ; ; In the formula, , For the The seasonal trend component and long-term trend component obtained by the first-order decomposition of the layer output generator, is the query matrix, is the key matrix, is the value matrix, For the cross attention processing operation, , is the updated seasonal trend component and long-term trend component, and then the updated seasonal trend component and long-term trend component are further processed in the second order. The specific formula is: ; In the formula, For the The final output of the layer feature extractor, For the calculation of long-term trends and seasonal trends, The feature selection attention mechanism is used to process the input fishery aquaculture water environment quality data. , For the The seasonal trend component and long-term trend component are obtained by further processing the second-order layer output generator.
8. A method for predicting the environmental quality of aquaculture water according to claim 7, characterized in that: In S43, the seasonal trend component and the long-term trend component obtained by further processing the second order are subjected to nonlinear mapping by a multilayer perceptron to extract high-order features, respectively, to obtain the third-order seasonal trend component and the long-term trend component, and weighted summation is performed to obtain the output of the key feature extraction module. The specific formula is: ; ; ; In the formula, , For the The third-order seasonal trend component and long-term trend component of the layer output generator, , For the The seasonal trend component and long-term trend component obtained by further processing the second-order layer output generator, For the The long-term trend component obtained by the first-order decomposition of the layer output generator, For the calculation of long-term trends and seasonal trends, is the nonlinear mapping operation of the multilayer perceptron on the decomposition result. , , are the weighted parameter matrices of the current layer, For the The final seasonal trend component of the layer output generator output, For the The final long-term trend component of the layer output generator output, The final long-term trend component of the previous layer is used to construct a prediction module. The fusion network is used to integrate the final seasonal trend component and the long-term trend component to obtain the predicted value of the environmental quality of aquaculture water. The specific formula is: ; In the formula, To integrate the operation of the converged network, It is the predicted value of the environmental quality of fishery aquaculture water.
9. A method for predicting the environmental quality of aquaculture water according to claim 1, characterized in that: In order to predict the environmental quality of fishery aquaculture water bodies, relevant data on the environmental quality of fishery aquaculture water bodies were collected, including aquaculture water temperature data, water pH value data, water dissolved oxygen data, water ammonia nitrogen data, water nitrite data, and fishery aquaculture density data. The collected relevant data were preprocessed to ensure that there were no missing values in the data. Then the processed data were divided into training sets and test sets for training and evaluating the performance of the fishery aquaculture water environment quality prediction model.
Citation Information
Patent Citations
Water level prediction method based on AutoFormer multi-feature space-time fusion
CN116151411A
Traffic sequence prediction method and device, electronic equipment and storage medium
CN116884211A
Water quality multi-index multi-step prediction method based on sequence decomposition and autocorrelation
CN117828443A
Deep learning work order quantity prediction method based on wavelet multi-resolution decomposition
CN118657255A
Koopman Neural Forecaster for Time Series with Temporal Distribution Shifts
US20240119265A1
Cited By
Water quality prediction method and system based on seasonal item enhanced modeling
CN122087432A