Dissolved oxygen concentration prediction method and device
By optimizing parameters through multi-scale feature extraction and an improved cloud drift optimization algorithm, the problems of high computational complexity and insufficient model robustness in dissolved oxygen concentration prediction are solved, achieving high-precision and stable real-time prediction, which is suitable for watershed management.
Patent Information
- Application Number
- CN202511925772.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-03-27
AI Technical Summary
Existing technologies for predicting dissolved oxygen concentration suffer from problems such as difficulty in obtaining parameters, low computational efficiency, and insufficient model robustness and generalization ability. Traditional mechanistic models have high computational complexity, and traditional machine learning models have shortcomings in feature extraction and hyperparameter optimization, resulting in poor prediction accuracy and stability.
A multi-scale feature extraction method is adopted, which extracts the correlation between variables through convolution operation. The improved cloud drift optimization algorithm (ICDO) is combined to optimize the model parameters. Multi-layer linear projection and residual connection mechanism are used to generate enhanced embedding vectors for prediction.
It improves the accuracy and stability of dissolved oxygen concentration prediction, achieves high-precision real-time prediction, adapts to water quality changes under different hydrological conditions, and provides technical support for watershed management.
Smart Images

Figure CN121743746A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of watershed management technology, and in particular to a method and apparatus for predicting dissolved oxygen concentration. Background Technology
[0002] Water quality monitoring and forecasting are crucial for ensuring water resource security and aquatic ecosystem health. Accurate prediction of dissolved oxygen (DO) concentration is of great significance for water environment assessment, pollution early warning, and watershed management. Dissolved oxygen concentration is influenced by multiple factors, including hydrodynamic conditions, biochemical reactions, and external pollution sources, exhibiting strong nonlinearity, multi-scale characteristics, and noise interference, making its prediction quite challenging.
[0003] Traditional mechanistic models used in international research, such as Streeter-Phelps and CE-QUAL-W2, have laid the foundation for water quality simulation, but problems such as difficulty in obtaining parameters and low computational efficiency still exist. Machine learning methods such as LSTM and CNN are gradually being applied to dissolved oxygen concentration prediction. For example, combining Empirical Mode Decomposition with LSTM can improve prediction accuracy, but limitations such as noise sensitivity and insufficient feature extraction still exist.
[0004] Domestic research primarily employs statistical methods such as grey prediction models and ARIMA, which have limited accuracy in nonlinear scenarios. Subsequently, particle swarm optimization and genetic algorithms were introduced to optimize BP neural networks and ELM models, achieving some progress, but these algorithms are prone to getting trapped in local optima. Improvement strategies such as chaotic mapping and differential evolution show potential, but the robustness and generalization ability of the models still need to be strengthened.
[0005] Traditional mechanistic models focus on explaining the underlying mechanisms, but their high computational complexity limits their application in scenarios with high real-time requirements. While traditional machine learning models have improved prediction accuracy, they have shortcomings in feature extraction and hyperparameter optimization. Summary of the Invention
[0006] Therefore, it is necessary to provide a method and apparatus for predicting dissolved oxygen concentration to address the above-mentioned technical problems and achieve high accuracy, robustness and real-time prediction of dissolved oxygen concentration.
[0007] Firstly, this application provides a method for predicting dissolved oxygen concentration. The method includes:
[0008] Acquire water quality monitoring time series data including multiple variables, and segment the time series data into several sequence segments; the variables include dissolved oxygen.
[0009] Sequence features are extracted from sequence segments at different time scales, and the sequence features are fused to obtain multi-scale features.
[0010] Based on multi-scale features, temporal and cross-channel dependencies are captured to obtain enhanced multi-scale features;
[0011] Based on enhanced multi-scale features, correlations between variables are extracted through convolution operations and fused with endogenous variables to generate enhanced embedding vectors.
[0012] The enhanced embedding vector is divided into several fixed-length sequence blocks, and each sequence block is mapped to a high-dimensional space using multi-layer linear projection to obtain high-dimensional features;
[0013] Input the high-dimensional features into the prediction head to obtain the dissolved oxygen concentration prediction results.
[0014] In one embodiment, extracting sequence features from sequence segments at different time scales and fusing the sequence features to obtain multi-scale features includes:
[0015] For each sequence segment, sequence features at different time scales are obtained through downsampling at different times;
[0016] Several sequence features corresponding to the same sequence segment are fused through a feedforward residual network to obtain a single-channel output, i.e., the sequence segment corresponds to multi-scale features.
[0017] In one embodiment, capturing temporal and cross-channel dependencies based on multi-scale features to obtain enhanced multi-scale features includes:
[0018] Stack the multi-channel outputs and divide them into several data blocks;
[0019] For each data block, a time-step-shared multilayer perceptron is used to aggregate time-mixed information along the time dimension to obtain the time dependency of each channel; through a transpose operation, another channel-shared multilayer perceptron is used to fuse channel-mixed information along the time domain to obtain cross-channel dependency.
[0020] Perform inverse block splitting and split the output information, including time-dependent and cross-channel-dependent information, into independent channels to obtain enhanced multi-scale features.
[0021] In one embodiment, based on enhanced multi-scale features, the correlation between variables is extracted through convolution operations, and the enhanced embedding vector is generated by fusing it with endogenous variables, including:
[0022] One-dimensional convolution operations are used to process the enhanced multi-scale features, extract the dependencies between endogenous and exogenous variables, and generate cross-correlation embeddings.
[0023] The original endogenous variables are fused with cross-correlation embeddings through residual connections to obtain enhanced embedding vectors.
[0024] In one embodiment, after segmenting the enhanced embedding vector into several fixed-length sequence blocks, the method further includes:
[0025] Learnable location embedding information is introduced, and the location embedding information is added to the sequence block through a residual fusion mechanism.
[0026] In one embodiment, the method further includes:
[0027] An improved cloud drift optimization algorithm, which integrates Sinusoidal chaotic mapping initialization, logarithmic spiral back learning, and firefly perturbation strategy, is used to optimize the parameters in the process of obtaining dissolved oxygen concentration prediction results.
[0028] Secondly, this application also provides a dissolved oxygen concentration prediction device. The device includes:
[0029] The data preprocessing module is used to acquire water quality monitoring time series data including multiple variables and to segment the time series data into several sequence segments; the variables include dissolved oxygen.
[0030] The multi-scale feature extraction module is used to extract sequence features from sequence segments at different time scales, fuse sequence features, and obtain multi-scale features.
[0031] The temporal dependency extraction module is used to capture temporal and cross-channel dependencies based on multi-scale features, and obtain enhanced multi-scale features.
[0032] The correlation extraction module is used to extract the correlation between variables based on enhanced multi-scale features through convolution operations, and then fuse it with endogenous variables to generate an enhanced embedding vector.
[0033] The linear processing module is used to segment the enhanced embedding vector into several fixed-length sequence blocks, and to map each sequence block to a high-dimensional space using multi-layer linear projection to obtain high-dimensional features;
[0034] The prediction module is used to input high-dimensional features into the prediction head to obtain the dissolved oxygen concentration prediction results.
[0035] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps in the dissolved oxygen concentration prediction method described above.
[0036] Fourthly, this application also provides a computer-readable storage medium. This computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps in the dissolved oxygen concentration prediction method described above.
[0037] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps in the dissolved oxygen concentration prediction method described above.
[0038] The aforementioned dissolved oxygen concentration prediction method and apparatus include the following steps: acquiring water quality monitoring time series data including multiple variables, and segmenting the time series data into several sequence segments; the variables include dissolved oxygen; extracting sequence features from the sequence segments at different time scales, fusing the sequence features to obtain multi-scale features; capturing time dependence and cross-channel dependence based on the multi-scale features to obtain enhanced multi-scale features; extracting the correlation between variables through convolution operations based on the enhanced multi-scale features, and fusing them with endogenous variables to generate an enhanced embedding vector; dividing the enhanced embedding vector into several fixed-length sequence blocks, mapping each sequence block to a high-dimensional space using multi-layer linear projection to obtain high-dimensional features; and inputting the high-dimensional features into a prediction head to obtain the dissolved oxygen concentration prediction result.
[0039] The above method obtains rich feature data through multi-scale feature extraction and fusion, and weakens redundancy and strengthens key dependencies by analyzing temporal dependencies and correlation analysis, thereby improving the accuracy and stability of water quality prediction and providing technical support for watershed management. Attached Figure Description
[0040] Figure 1 This is a flowchart illustrating a dissolved oxygen concentration prediction method in one embodiment;
[0041] Figure 2 This is a flowchart illustrating the multi-scale feature extraction process in one embodiment;
[0042] Figure 3 This is a flowchart illustrating the process of temporal dependency extraction in one embodiment;
[0043] Figure 4 This is a schematic diagram of the cross-linear fusion process in one embodiment; Figure 5 A flowchart illustrating the improved cloud drift optimization algorithm;
[0044] Figure 6 This is an industrial control computer deployment model in one embodiment;
[0045] Figure 7 This is a comparison chart of the convergence curves of the CEC2022 benchmark functions for six algorithms in one embodiment;
[0046] Figure 8 A diagram showing the comparison of the prediction performance of multiple models for dissolved oxygen concentration on the Brisbane River dataset;
[0047] Figure 9Test the model's performance on the Brisbane River dataset;
[0048] Figure 10 The residuals of the present invention after processing the original features and ICDO-optimized model on the Brisbane River dataset;
[0049] Figure 11 A diagram showing the comparison of the prediction performance of multiple models for dissolved oxygen concentration on the Gregory River dataset;
[0050] Figure 12 Test the model's performance on the Gregory River dataset;
[0051] Figure 13 The residuals of this invention after processing the original features and ICDO-optimized model on the Gregory River dataset. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0053] This application provides a method for predicting dissolved oxygen concentration, such as... Figure 1 As shown, it includes the following steps:
[0054] S1, acquire water quality monitoring time series data including multiple variables, and divide the time series data into several sequence segments.
[0055] Water quality monitoring instruments deployed at monitoring points collect real-time and continuous water quality data. These instruments integrate multiple sensors to measure variables such as dissolved oxygen, pH, conductivity, and temperature, thereby obtaining multivariate water quality monitoring time series data.
[0056] After receiving the original input sequence, the first step is dimensionality adjustment to ensure the time step is at the end of the sequence, conforming to the conventional input format for convolution and pooling operations. Subsequently, instance normalization (similar to RevIN) is applied to eliminate the non-stationarity of the time series data. The mean and standard deviation generated during the normalization process are precisely stored, which is crucial for ensuring that the prediction results can be accurately inversely normalized back to the physical scale of the original data in the post-processing stage.
[0057] Water quality monitoring time series data is divided into fixed-length sequence segments along the time step, and each segment is linearly mapped to a high-dimensional feature space. Each sequence segment still contains the values of all variables within the time window. During processing, all segments typically share the same set of linear mapping parameters to map to the high-dimensional feature space.
[0058] S2 extracts sequence features from sequence segments at different time scales, fuses sequence features, and obtains multi-scale features.
[0059] For each sequence segment, sequence features at different time scales are obtained by downsampling; several sequence features corresponding to the same sequence segment are fused through a feedforward residual network to obtain the sequence features corresponding to the sequence segment.
[0060] like Figure 2 The diagram shows a flowchart for multi-scale feature extraction. First, the original input information... Fine-grained details are already included, while coarse-grained information is extracted through average pooling. First-level temporal pattern. It is a single-channel input Next, by applying average pooling to the previous time pattern, different coarse-grained time patterns are extracted. ,in Indicates the number of downsampling operations. Indicates the downsampling rate. The decomposition of the layer-time pattern is expressed by the following formula:
[0061]
[0062] Secondly, from coarse-grained To fine granularity Different time patterns are mixed through a feedforward residual network, where Indicates mixed data, and . No. The formula for mixing layer time modes is as follows:
[0063]
[0064] Again, after completing After mixing the temporal patterns at each scale, mixed scale information is obtained. Single-channel output is , That is, sequence fragments The corresponding sequence features.
[0065] The core function of this step is to extract multi-scale features along the time dimension. It utilizes average pooling operations with different kernel sizes to perform hierarchical processing of the sequence, capturing features at different temporal granularities. Through a residual connection mechanism, pooling information at different scales is efficiently fused together, thereby effectively capturing multiple frequency and periodic patterns contained in the sequence and providing rich multi-scale feature representations for subsequent dependency modeling.
[0066] S3, based on multi-scale features, captures temporal and cross-channel dependencies to obtain enhanced multi-scale features.
[0067] Multi-time series systems exhibit cross-scale dynamic interactions, causing changes at a single scale to propagate and affect the entire system. Therefore, this embodiment employs the following... Figure 3 The illustrated process, by incorporating time and channel dependencies, models this complex process. First, it aggregates information from multiple channels in S2. Stacked into a matrix By using block operations Convert to For each data block, This represents the embedded output of the residual network. This represents multi-scale features. A multilayer perceptron with time-step sharing is used to aggregate temporal hybrid information along the time dimension to obtain the temporal dependencies of each channel. Next, through a transpose operation, another multilayer perceptron sharing the channels fuses the mixed channel information along the time domain. Finally, an inverse block operation is performed to split the output information into independent channels, resulting in... Residual operations ensure that the model effectively utilizes cross-channel dependencies while maintaining its ability to capture temporal dependencies. (Data blocks) The interaction is expressed by the following formula:
[0068]
[0069]
[0070] In the formula: Representation matrix The transpose of .
[0071] The above formula uses a combination of multi-scale information. This approach captures both temporal and cross-channel dependencies. The former models periodic interactions, while the latter characterizes variable relationships. To avoid noise introduced by irrelevant covariates, a scaling factor is introduced. Mechanisms are used to suppress interference and balance the contributions of the two types of dependencies.
[0072] This step, based on multi-scale features, aims to enhance the modeling of local temporal information. It strengthens the interaction between historical and current information through a sliding window-based aggregation mechanism. Simultaneously, it focuses on fine-tuning the dependencies between time steps, thereby further optimizing the model's local temporal pattern representation and providing a feature foundation with enhanced temporal dependencies for subsequent steps.
[0073] S4, based on enhanced multi-scale features, extracts the correlation between variables through convolution operations and fuses it with endogenous variables to generate an enhanced embedding vector. This embodiment, in order to effectively avoid the overfitting problem common in traditional channel dependency methods while explicitly modeling variable dependencies, uses methods such as... Figure 4 The correlation extraction process is shown below.
[0074] This paper employs lightweight one-dimensional convolution to capture the time-invariant direct dependency between the endogenous variable of the predicted target dissolved oxygen concentration and exogenous variables such as temperature, pH, and conductivity. Residual structures are used to stabilize training and retain key information. Methods such as Transformer or graph neural networks are prone to overfitting with limited or sparse data due to their complex dependency modeling mechanisms. This stems from the complex time-varying nature of the dependencies between variables and the large number of model parameters. Therefore, this embodiment uses a single-layer one-dimensional convolution to efficiently extract the dependency features between variables and construct cross-correlation embeddings. To further improve stability and suppress overfitting, residual connections are introduced to fuse the original endogenous variables with the cross-correlation embeddings, generating enhanced embedding vectors. This allows for the effective introduction of beneficial information from exogenous variables while preserving the core information of endogenous variables.
[0075] First, endogenous variables With exogenous variables The variables are stacked along the time dimension to form the input matrix. Then, a one-dimensional convolution operation, Conv1D, is applied to extract the dependencies between variables and generate cross-correlation embeddings. Its formula is:
[0076]
[0077] Finally, the original endogenous variables With the generated cross-related embeddings The final enhanced representation is obtained by fusing the residuals. Its formula is:
[0078]
[0079] In the formula: This indicates the concatenation of endogenous and exogenous variables along the time dimension. This is a one-dimensional convolution operation. It is a learnable weighting parameter used to balance the contributions of endogenous variables and cross-correlated variables.
[0080] This step uses one-dimensional convolution to process the enhanced multi-scale features obtained in S3 to extract cross-correlation embeddings between endogenous variables (the predicted target dissolved oxygen concentration) and exogenous variables (auxiliary features such as water temperature and pH). Subsequently, the original endogenous variable features (as residual terms) are fused with the newly generated cross-correlation embeddings using parametric residuals. This fusion is controlled by learnable weights, ensuring that while incorporating beneficial information from exogenous variables, the core temporal features of the endogenous variables are preserved to the greatest extent possible, effectively suppressing overfitting.
[0081] S5 divides the enhanced embedding vector into several fixed-length sequence blocks, and uses multi-layer linear projection to map each sequence block to a high-dimensional space to obtain high-dimensional features.
[0082] The sequence fragments are linearly mapped to a high-dimensional space, and positional information is added to each sequence fragment to preserve the sequence characteristics. Multi-scale features, historical fragment dependencies, and correlations are embedded in the vector for feature fusion, and the dissolved oxygen concentration prediction results are obtained through the prediction head.
[0083] Specifically, the feature sequence is cut into multiple fixed-length sequence patches, and then each patch is mapped to a high-dimensional model space using multi-layer linear projection to capture local short-term patterns.
[0084] In other embodiments, learnable location embedding information can be introduced and added to the block embedding results through another controlled parameterized residual fusion mechanism, thereby giving the sequence blocks explicit, learnable location information.
[0085] S6 inputs the high-dimensional features into the prediction head to obtain the dissolved oxygen concentration prediction result. The linear prediction head, also known as the inverse block module, is responsible for converting the encoded high-dimensional features into the final predicted value. The features are first flattened and then received by the linear prediction head. This prediction head contains multiple layers of linear transformations, and its core function is to accurately project the high-dimensional feature vector onto the length of the target prediction sequence.
[0086] S7, Post-processing Destandardization. The final step in the model is the post-processing stage. The standardized results output by the linear prediction head need to be destandardized using the mean and standard deviation stored in the first step of data preprocessing. This crucial step restores the predicted values to the physical scale of the original data, thus obtaining the final usable prediction output.
[0087] In one embodiment, the method further includes optimizing the parameters in the dissolved oxygen concentration prediction process using an improved cloud drift optimization algorithm that integrates Sinusoidal chaotic mapping initialization, logarithmic spiral back learning, and firefly perturbation strategy.
[0088] A dissolved oxygen concentration prediction model was constructed based on S2 to S6. To further improve prediction accuracy and avoid the arbitrariness of manual hyperparameter selection, the ICDO (Improved Cloud Drift Optimization) algorithm was used during model training to optimize the learning rate, hidden layer dimension of the feedforward network, and model dimension parameters in the dissolved oxygen concentration prediction model. ICDO dynamically adjusts the search strategy based on the current fitness, enabling the model to quickly converge to a better parameter configuration within a limited number of iterations, and then transmits the result to the model for prediction. The model hyperparameter settings are shown in Table 1.
[0089] Table 1 Model hyperparameter settings
[0090]
[0091] Cloud Drift Optimization (CDO) is a nature-inspired optimization method inspired by the drift behavior of cloud particles in the atmosphere. It exhibits advantages such as fast convergence and high accuracy on both unimodal and multimodal benchmark functions.
[0092] The algorithm is based on The search begins with random initialization of candidate solutions (cloud particles) within the search space, ensuring unbiased exploration of the entire space:
[0093]
[0094] In the formula, This represents a uniform random distribution in the range [0, 1]. This step simulates the random initial distribution of cloud particles in the sky, where the initial positions are unknown and scattered.
[0095] During the development phase, the cloud particles move towards the best solution found so far (i.e., the globally optimal position). The position update equation is:
[0096]
[0097] In the formula, It is iteration The best known solution at that time. Indicates the factor Small-scale random adjustments to control the development level.
[0098] During the exploration phase, cloud particles are allowed to move randomly within the search space to ensure the diversity of the search:
[0099]
[0100] In the formula, It is another random factor affecting particle motion, whose parameter decreases over time, causing the algorithm to shift from exploration to development.
[0101] The algorithm reaches a predetermined threshold when the fitness of the optimal solution is achieved. or maximum number of iterations When the algorithm converges.
[0102] To improve the global search capability and convergence accuracy of cloud drift optimization algorithms (CDOs) in complex optimization problems, an improved cloud drift optimization algorithm (ICDO) is proposed. This algorithm retains the original CDO's focus on the dynamic drift behavior of cloud particles while introducing sinusoidal chaotic mapping initialization, logarithmic spiral back learning, and a firefly perturbation strategy. The algorithm flow is as follows: Figure 5 As shown
[0103] First, in the initialization phase, ICDO uses a sinusoidal chaotic map to generate the initial population. This chaotic system possesses the characteristics of ergodic uniformity and non-repetition, enabling a more uniform distribution of the initial solutions within the search space. Its formula is:
[0104]
[0105] In the formula, The current generation's chaos value. For the next generation of chaos values, This is a control parameter, and its value is 2.
[0106] Secondly, to enhance the algorithm's search capability and population diversity, a joint exploration strategy based on logarithmic spiral (LS) and off-balance learning (OBL) is adopted, namely logarithmic spiral off-balance learning (LS-OBL). LS simulates the spiral trajectory in nature and is often used for smooth and decreasing local exploration in the search space. Its formula is:
[0107]
[0108] In the formula, Indicates the first Representing individual position, As the elite individuals of the current population, The spiral growth factor has a value of 1. This is a random variable, taking values in the range [-1, 1], used to control the search amplitude and the degree of local development. The absolute value operation ensures the positive directionality of the distance, causing the spiral motion to unfold around the elite point.
[0109] OBL is used to increase population diversity, and its formula is:
[0110]
[0111] In the formula, For the current individual position, and These are the upper and lower bounds of the search space, respectively. This is the scaling factor, with a value of 1.
[0112] Combining LS with OBL forms the LS-OBL strategy, which utilizes elite points... Reverse individuals A logarithmic spiral trajectory is established between these points to achieve a broader search; its formula is:
[0113]
[0114] Finally, a firefly perturbation strategy is introduced. In the later stages of iteration, the attraction behavior between individuals in a firefly swarm is simulated to apply a targeted perturbation to the current solution, which helps to escape local optima and improve convergence accuracy. The formula is:
[0115]
[0116] In the formula, The new position after the disturbance. For the current individual position, This is the maximum attraction level (usually set to 1.0). The light absorption coefficient is... Let be the distance between individual i and individual j. To achieve a better position for individual j, For the current individual Location, Step size factor It is a random vector.
[0117] This invention deploys water quality prediction models on both embedded platforms and industrial control computer platforms. The hardware system architecture adopts a unified modular design, equipped with display, power supply, and communication modules, constructing a lightweight water quality monitoring terminal. In the embedded solution, Convolutional Neural Network (CNN) and Long Short-Term Memory (LSTM) models are converted to ONNX format and deployed on the STM32H743 platform using the STM32CubeMX.AI toolchain. Water quality data is collected by sensors, standardized, and preprocessed before being input into the model to achieve real-time prediction of dissolved oxygen concentration. The prediction results are directly presented through a local display module and transmitted to an IoT cloud platform via a communication module. Experiments show that this embedded solution can operate stably in environments with strictly limited computing resources, storage space, and power consumption, providing a feasible technical path for lightweight, low-cost water quality monitoring terminals. To further improve performance, prediction models are also deployed on an industrial control computer platform, such as... Figure 6 As shown in the diagram, this solution adopts a unified modular hardware architecture, connecting multiple sensors via industrial standard communication interfaces such as RS-485 to collect key parameters such as dissolved oxygen concentration and pH value in real time. Model diagnostic results will be visualized locally on a high-resolution LCD display and uploaded to an IoT cloud platform via the MQTT protocol over 4G / 5G networks, supporting remote storage and big data analysis. The industrial control platform will maintain the same data processing flow as the embedded platform, leveraging its powerful computing capabilities to significantly improve model execution efficiency and prediction accuracy. This solution is primarily aimed at smart watershed management scenarios requiring continuous monitoring and large-scale data processing, and is expected to provide more reliable technical support for high-performance water quality monitoring. Furthermore, drawing on techniques from research on carbon fiber surface modification and its enhanced inorganic bonding coating high-temperature tribological mechanisms, precise sensor data acquisition and high-precision data processing technologies are employed in water quality prediction. For sensor calibration, noise suppression, and multivariate coupled data processing, standardized measurement and analysis procedures from composite material surface modification experiments can be referenced to improve data quality.
[0118] To evaluate the performance differences between the improved Cloud Drift Optimization Algorithm (ICDO) and other algorithms such as Cloud Drift Optimization Algorithm (CDO), Cobra Optimization Algorithm (COA), Whale Optimization Algorithm (WOA), Giant Cane Rat Optimization Algorithm (GCRA), and Osprey Optimization Algorithm (OOA), comparative experiments were conducted based on 12 benchmark functions in the CEC2022 test set. The algorithm population size, maximum number of iterations, and dimension were set to 30, 500, and 10, respectively. Each test function was run independently 30 times, and the optimization results are shown in Table 2.
[0119] Table 2. Performance Comparison of Six Optimization Algorithms under the CEC2022 Benchmark Function
[0120]
[0121] As shown in Table 2, in terms of optimal value accuracy, ICDO almost reaches the theoretical minimum with a result of 300.0001 in the unimodal function F1, outperforming CDO and other comparative algorithms. In the multimodal functions F2–F5, ICDO consistently achieves results closer to the theoretical minimum than other algorithms, for example, 400.0043 for F2. In the mixed functions F6–F8, ICDO continues to maintain its leading position, for example, 1832.7719 for the F6 function, verifying its stability and accuracy advantages in complex multimodal environments. In the composite functions F9–F… 12 In practice, ICDO continues to perform excellently; for example, the F11 function's value of 2600.009 almost perfectly matches the theoretical minimum of 2600. Furthermore, ICDO demonstrates good stability and robustness. For instance, in the F1 function, ICDO's standard deviation is only 0.001, far lower than CDO's 2.216, indicating a high degree of consistency across multiple runs. In the F3 function, ICDO's worst value is only 601.55, while CDO's reaches 615.33.
[0122] The ICDO algorithm also exhibits excellent convergence performance. Its dynamic balancing mechanism effectively coordinates the global exploration and local development processes, thereby significantly improving optimization efficiency. The convergence curves of the unimodal function F1 and the multimodal function F5 are shown below. Figure 7 As shown, Figure 7 (a) shows the convergence curve of the F1 algorithm with a single-peaked function. Figure 7 (b) shows the convergence curve of the multimodal function F5 algorithm. Figure 7 (c) shows the convergence curve of the F7 algorithm with mixed functions. Figure 7 (d) is a composite and multimodal F 10 The convergence curve of the function algorithm. The figure visually demonstrates the fast and stable convergence characteristics of the algorithm on different types of problems.
[0123] To demonstrate the advantages of the prediction model provided by this invention, performance was compared with multiple models through experiments. Two water quality monitoring datasets were used in the experiments, both publicly available from the Queensland Government Open Data Portal in Australia. The first dataset was the Brisbane River - Moggill Reach Site dataset, with a monitoring period from April to May 2023 and a sampling interval of 30 minutes. The monitoring point was located below the Moggill Reach ferry crossing (latitude 27°35′50.9″S, longitude 152°51′35.0″E), at a water depth of approximately 5 meters. The observation equipment was a YSI DB600 buoy. The YSI EXO3 multi-parameter water quality probe installed on the buoy was located 0.4 meters below the water surface and was used to collect physicochemical parameters such as dissolved oxygen percentage saturation, water temperature, and pH value. Simultaneously, a Doppler current meter was used to measure flow velocity and direction. The second dataset was the Gregory River - Buoy 3 - Quality dataset, with a monitoring period from December 2020 to January 2022 and a sampling interval of 10 minutes. The monitoring point is located approximately 6.0 km upstream of the Gregory River estuary (latitude 20°10′07.7″S, longitude 148°27′50.4″E), with a water depth of approximately 5 m. The deployed buoys are also equipped with water quality analyzers to collect water quality parameters. The two datasets differ in water body type, watershed characteristics, meteorological conditions, and data volume, allowing for the testing of the model's adaptability and generalization ability under different water quality environments. Since the original data were unverified measured results, missing values and outliers existed; therefore, data preprocessing was performed. Dissolved oxygen concentration (DO-mgL) was used as the prediction target for water quality monitoring, and key input parameters for the model were closely related to water quality changes (dissolved oxygen percentage saturation, water temperature, pH, conductivity, turbidity, and fluorescence intensity of dissolved organic matter). The coefficient of determination (R²), mean square error (MSE), root mean square error (RMSE), and mean absolute error (MAE) were used to reflect the model's fitting ability and prediction accuracy.
[0124] The performance of the model provided in this invention, before and after optimization with ICDO, was evaluated on the Brisbane River dataset using LSTM, CNN, and ICDO. The prediction results are as follows: Figure 8Table 3 shows the performance comparison of (a), (b), (c), and (d) models. Experimental results show that the LSTM model has low prediction accuracy, with an R² of 0.9095. The CNN model performs slightly better than LSTM, with an R² of 0.9184. Before ICDO optimization, the model of this invention outperforms both models in all metrics, achieving an R² of 0.9690. Finally, after introducing ICDO for optimization within this framework, the model of this invention achieves optimal performance, with an R² as high as 0.9714, an MSE of only 0.0003260, an RMSE of 0.01806, and a MAE as low as 0.01348, demonstrating superior overall prediction accuracy and stability compared to other models.
[0125] Table 3. Performance metrics for multi-model prediction of dissolved oxygen concentration (Brisbane River dataset)
[0126]
[0127] Figure 9 By comparing the prediction performance of the LSTM baseline model and the ICDO-optimized model of this invention on the test set, the superior performance of the proposed model is demonstrated. Figure 9 (a) The predicted values corresponding to the LSTM model show significant bias at multiple peaks and troughs. Figure 9 (b) Corresponding to the predicted value of the model of the present invention after optimization by ICDO, the predicted curve has a higher degree of agreement with the actual value curve and the fluctuation pattern is more consistent, which verifies the effectiveness of the proposed model in capturing the complex temporal variation law of dissolved oxygen concentration.
[0128] Figure 10 The optimization effect of the model was further analyzed from the perspective of feature space. Figure 10 (a) shows the distribution of the true values in the original feature space, while Figure 10 (b) Presents the residual distribution in the feature space after ICDO-optimized model processing according to this invention. The comparison shows that after model processing, the residual distribution is more concentrated and closer to zero, indicating that the model can effectively learn the inherent patterns in the Brisbane River data and significantly reduce prediction errors. This explains the underlying mechanism of the improved model performance from the perspective of feature engineering.
[0129] A comparative analysis was also conducted on the Gregory River dataset, evaluating the performance of LSTM, CNN, and the models before and after ICDO optimization. The prediction results are as follows: Figure 11 Table 4 shows a comparison of performance metrics for (a), (b), (c), and (d). The experimental results also demonstrate that the model of this invention, optimized by ICDO, still achieves optimal performance.
[0130] Table 4. Performance metrics of multi-model prediction for dissolved oxygen concentration (Gregory River dataset)
[0131] LSTM CNN The model before ICDO optimization ICDO optimized model <![CDATA[R 2 ]]> 0.8739 0.9407 0.9496 0.9506 MSE 0.06892 0.03240 0.02755 0.02702 RMSE 0.2625 0.1800 0.1660 0.1644 MAE 0.2131 0.1281 0.1165 0.1145
[0132] Figure 12 By comparing the prediction performance of the LSTM baseline model and the model of this invention optimized by ICDO on the test set, the generalization ability of the proposed model is further verified. Figure 12 (a) represents the predictions made by LSTM. Figure 12 (b) is the model of the present invention optimized by ICDO. As can be seen from the comparison, the latter's prediction curve is significantly better than the actual value curve. Especially in the section with large concentration fluctuations, the model proposed in this invention can more accurately track the actual change trend and shows stronger adaptability.
[0133] Figure 13 The model's performance on the Gregory River dataset was analyzed from the perspective of feature space. Figure 13 (a) shows the distribution characteristics of the true values in the original feature space, while Figure 13 (b) The residual distribution in the feature space after processing by the ICDO-optimized model of this invention is presented. As can be seen from the comparison, the residual distribution after model processing is more concentrated near the zero value, and the distribution range is significantly narrowed. This indicates that the model can effectively extract key features and reduce prediction errors on the Gregory River dataset, further proving that the proposed model has good generalization performance and stability.
[0134] The model was trained and evaluated under consistent and optimal configurations of basic parameters. R² and other metrics were calculated based on a fixed random number seed to ensure repeatability of results. If multiple runs were performed under different random number seeds and the average value was taken, the specific values may fluctuate. However, on the Brisbane River and Gregory River datasets, the performance ranking of each model remained basically consistent, and the ICDO-optimized model of this invention remained the best overall.
[0135] In summary, this invention proposes a water quality prediction model that integrates multi-scale feature extraction and an improved optimization algorithm. The proposed improved cloud drift optimization algorithm (ICDO) combines sinusoidal chaotic mapping initialization, logarithmic spiral back learning, and a firefly perturbation strategy, demonstrating excellent comprehensive search capabilities on the CEC2022 test function. Applying this algorithm to model hyperparameter optimization effectively improves prediction accuracy and stability, providing a new solution for complex optimization problems. Experimental validation on two typical river datasets shows that the proposed model significantly outperforms the comparison model in the dissolved oxygen concentration prediction task. On the Brisbane River dataset, R² reaches 0.9714, and MSE is as low as 0.0003260; on the Gregory River dataset, R² is 0.9506, with all error indices being optimal, demonstrating the model's good adaptability and generalization ability under different hydrological conditions, providing reliable technical support for accurate watershed water quality prediction.
[0136] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0137] Based on the same inventive concept, this application also provides a dissolved oxygen concentration prediction device for implementing the dissolved oxygen concentration prediction method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations of one or more dissolved oxygen concentration prediction device embodiments provided below can be found in the limitations of the dissolved oxygen concentration prediction method described above, and will not be repeated here.
[0138] In one embodiment, a dissolved oxygen concentration prediction device is provided, comprising:
[0139] The data preprocessing module is used to acquire water quality monitoring time series data including multiple variables and to segment the time series data into several sequence segments; the variables include dissolved oxygen.
[0140] The multi-scale feature extraction module is used to extract sequence features from sequence segments at different time scales, fuse sequence features, and obtain multi-scale features.
[0141] The temporal dependency extraction module is used to capture temporal and cross-channel dependencies based on multi-scale features, and obtain enhanced multi-scale features.
[0142] The correlation extraction module is used to extract the correlation between variables based on enhanced multi-scale features through convolution operations, and then fuse it with endogenous variables to generate an enhanced embedding vector.
[0143] The linear processing module is used to segment the enhanced embedding vector into several fixed-length sequence blocks, and to map each sequence block to a high-dimensional space using multi-layer linear projection to obtain high-dimensional features;
[0144] The prediction module is used to input high-dimensional features into the prediction head to obtain the dissolved oxygen concentration prediction results.
[0145] Each module in the aforementioned dissolved oxygen concentration prediction device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0146] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in all of the above method embodiments.
[0147] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in all of the above method embodiments.
[0148] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in all of the above method embodiments.
[0149] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0150] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0151] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0152] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for predicting dissolved oxygen concentration, characterized in that, The method includes: Acquire water quality monitoring time series data including multiple variables, and segment the time series data into several sequence segments; the variables include dissolved oxygen. Sequence features are extracted from the sequence segments at different time scales, and the sequence features are fused to obtain multi-scale features. Based on the multi-scale features, temporal dependence and cross-channel dependence are captured to obtain enhanced multi-scale features; Based on the enhanced multi-scale features, the correlation between variables is extracted through convolution operations and fused with endogenous variables to generate an enhanced embedding vector; The enhanced embedding vector is divided into several fixed-length sequence blocks, and each sequence block is mapped to a high-dimensional space using multi-layer linear projection to obtain high-dimensional features; The high-dimensional features are input into the prediction head to obtain the dissolved oxygen concentration prediction result.
2. The method according to claim 1, characterized in that, The step of extracting sequence features from the sequence fragments at different time scales and fusing the sequence features to obtain multi-scale features includes: For each sequence segment, the sequence features at different time scales are obtained by downsampling at different times; Several sequence features corresponding to the same sequence segment are fused through a feedforward residual network to obtain a single-channel output, that is, the sequence segment corresponds to the multi-scale features.
3. The method according to claim 1, characterized in that, The process of capturing temporal and cross-channel dependencies based on the multi-scale features to obtain enhanced multi-scale features includes: Stack the multi-channel outputs and divide them into several data blocks; For each data block, a time-step-shared multilayer perceptron is used to aggregate time-mixed information along the time dimension to obtain the time dependency of each channel; through a transpose operation, another channel-shared multilayer perceptron is used to fuse channel-mixed information along the time domain to obtain cross-channel dependency. Perform an inverse block operation and split the output information, including time-dependent and cross-channel-dependent information, into independent channels to obtain the enhanced multi-scale features.
4. The method according to claim 1, characterized in that, The enhanced multi-scale features, which extract correlations between variables through convolution operations and fuse with endogenous variables to generate enhanced embedding vectors, include: The enhanced multi-scale features are processed using one-dimensional convolution operations to extract the dependencies between endogenous and exogenous variables and generate cross-correlation embeddings. The enhanced embedding vector is obtained by fusing the original endogenous variables with the cross-correlation embedding through residual connections.
5. The method according to claim 1, characterized in that, After segmenting the enhanced embedding vector into several fixed-length sequence blocks, the method further includes: Learnable location embedding information is introduced, and the location embedding information is added to the sequence block through a residual fusion mechanism.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: An improved cloud drift optimization algorithm, which integrates Sinusoidal chaotic mapping initialization, logarithmic spiral back learning, and firefly perturbation strategy, is used to optimize the parameters in the process of obtaining dissolved oxygen concentration prediction results.
7. A dissolved oxygen concentration prediction device, characterized in that, The device includes: The data preprocessing module is used to acquire water quality monitoring time series data including multiple variables, and to segment the time series data into several sequence segments; the variables include dissolved oxygen; A multi-scale feature extraction module is used to extract sequence features from the sequence fragment at different time scales, and fuse the sequence features to obtain multi-scale features. The temporal dependency extraction module is used to capture temporal dependencies and cross-channel dependencies based on the multi-scale features, and obtain enhanced multi-scale features. The correlation extraction module is used to extract the correlation between variables based on the enhanced multi-scale features through convolution operations, and fuse them with endogenous variables to generate an enhanced embedding vector. A linear processing module is used to segment the enhanced embedding vector into several fixed-length sequence blocks, and to map each sequence block to a high-dimensional space using multi-layer linear projection to obtain high-dimensional features; The prediction module is used to input the high-dimensional features into the prediction head to obtain the dissolved oxygen concentration prediction result.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
