Next Article in Journal
Contrasting Hydropower Development Strategies in Central Asia’s Water–Energy–Food Nexus Through Spatially Explicit System Dynamics Modelling
Previous Article in Journal
Adaptive Interwoven Deep Learning Framework for Extracting Fragmented Water Bodies in Complex Hydrological Environments: Application in Myanmar
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

HarmonicFormer: Cross-Phase Harmonic Modeling for Efficient Long-Term Water Quality Forecasting

1
School of Data Science, Zhuhai College of Science and Technology, Zhuhai 519041, China
2
School of Computer Science, Zhuhai College of Science and Technology, Zhuhai 519041, China
3
Department of Industrial Electronics, University of Minho, 4800-058 Guimaraes, Portugal
*
Authors to whom correspondence should be addressed.
These authors contributed equally to this work.
Water 2026, 18(16), 2005; https://doi.org/10.3390/w18162005
Submission received: 1 July 2026 / Revised: 10 August 2026 / Accepted: 14 August 2026 / Published: 16 August 2026

Abstract

Water quality time series exhibit multi-scale periodicities, including daily and weekly cycles, driven by solar radiation, tidal forcing, and seasonal variation. Existing deep learning methods typically rely on patch-based attention or adaptive period decomposition, which suffer from parameter redundancy and high computational cost while failing to explicitly align with physical periodicities. To address this challenge, we propose HarmonicFormer, which restructures sequences into phase-period matrices, explicitly injects multi-scale periodic priors via harmonic temporal encoding, and achieves linear-complexity interactions through a lightweight cross-phase routing mechanism. Evaluated on hourly data from 37 monitoring stations in the Pearl River Basin (2020–2026) across nine water quality parameters and six forecast horizons, HarmonicFormer achieves the lowest average MSE of 0.3809 and MAE of 0.3753 over 54 experimental configurations, while maintaining high training efficiency and significantly reducing long-term error accumulation. Ablation studies confirm the effectiveness of harmonic encoding, reversible instance normalization, and key hyperparameters. This work offers an efficient and reliable explicit-periodicity modeling approach for water quality forecasting in the Pearl River Basin. Although the model currently adopts a fixed period length, future work can further enhance its generalization capability by introducing adaptive period discovery mechanisms.

1. Introduction

River water quality is central to ecosystem health and water security, yet global degradation has emerged as a prominent issue under the compounded pressures of climate change and human activity. Climate extremes are profoundly reshaping land-river connectivity, altering the physical, chemical, and biological composition of inland waters and directly affecting water availability assessments [1]. As China’s second-largest river system, the Pearl River has faced significant water quality deterioration over the past decade due to rapid urbanization, agricultural expansion, and socioeconomic disparities between upstream and downstream regions [2]. Comprehensive water quality index assessment methods [3] reveal significant spatiotemporal heterogeneity in key indicators such as total phosphorus and ammonia nitrogen within the Pearl River basin, with some areas falling into lower quality classes [2]. Accurate prediction of water quality dynamics is essential for resource management and risk mitigation, yet multiple challenges persist. Water chemistry encompasses thousands of variables governed by complex interactive processes [4]. More critically, water quality data are far sparser than hydrological data: global temporal coverage for total suspended solids is approximately 1%, compared to over 84% for streamflow [4]. Traditional statistical methods and process-based models struggle to capture nonlinear relationships in water quality dynamics, particularly under extreme conditions [4,5]. Deep learning offers new opportunities to address these challenges by leveraging multi-source data to fill spatiotemporal gaps and reveal complex patterns in high-dimensional datasets [4,5]. However, its application to river water quality prediction still faces challenges in capturing complex temporal dependencies, particularly the multi-scale periodic patterns inherent in water quality time series.
Summing up, below we enumerate the following challenges or limitations of existing methods:
1.
Traditional statistical models such as ARIMA and Prophet assume linearity and stationarity, failing to capture nonlinear and complex seasonal fluctuations in water quality dynamics. Conventional machine learning methods including SVR, Random Forest, and XGBoost remain heavily dependent on manual feature engineering and have limited capacity for high-dimensional, long-sequence data.
2.
Deep learning models like LSTM and CNN-based hybrid architectures have achieved promising results, but adaptively capturing key information from long sequences remains challenging.
3.
Periodicity-aware methods, including frequency-domain approaches like FreqCycle, adaptive period discovery methods such as TimesNet, and phase-based methods like PhaseFormer, still face limitations including global implicit representations, inaccurate decomposition under noise, and lack of explicit multi-scale periodic modeling mechanisms.
To address these challenges, this paper proposes HarmonicFormer, a model that improves prediction performance by explicitly modeling multi-scale periodic features in water quality data. The model adopts a phase-based representation paradigm, reorganizing time series into phase-period matrices where each phase token extracts observations at the same offset position across periods. This representation provides stronger global stationarity and lower feature dimensionality. Building on this foundation, HarmonicFormer innovatively introduces a harmonic temporal encoding mechanism that explicitly embeds periodic priors at different time scales through multi-period sinusoidal functions, enabling the model to simultaneously capture periodic variation patterns of water quality parameters across multiple time scales and effectively incorporating physical-ecological processes in water quality data. Additionally, the model employs a lightweight cross-phase routing mechanism that achieves efficient cross-phase dependency modeling through two-stage attention, avoiding the quadratic complexity of full attention mechanisms. This framework specifically addresses the limitations of existing methods in explicit multi-scale periodic modeling. The main contributions of this paper include:
1.
Based on multi-site water quality monitoring data from the Pearl River basin, we systematically analyzed the multi-scale periodic characteristics of parameters such as dissolved oxygen, pH, and ammonia nitrogen, providing a data foundation for explicit periodic modeling.
2.
We proposed the HarmonicFormer model, which explicitly embeds multi-scale prior knowledge such as diurnal and seasonal cycles through harmonic temporal encoding, achieving efficient modeling of inherent periodic structures in water quality data.
3.
We conducted extensive experiments on long-term prediction tasks for multiple water quality parameters. Results demonstrate that HarmonicFormer achieves optimal or near-optimal prediction performance across most water quality parameters and prediction horizons with extremely low parameter count and training cost, validating the effectiveness of explicit multi-scale periodic modeling in improving water quality prediction accuracy.

2. Related Work

Early water quality prediction research primarily relied on statistical time series models such as ARIMA and Prophet, which assume linearity and stationarity. These approaches struggle to capture nonlinear and complex seasonal fluctuations in water quality dynamics, and exhibit poor robustness to missing data and extreme events. Subsequently, machine learning methods such as SVR, Random Forest, and XGBoost were introduced. While these methods can capture nonlinear relationships to some extent, they remain heavily dependent on manual feature engineering and have limited capacity for high-dimensional, long-sequence data.
The rise of deep learning brought breakthrough progress to water quality prediction. Long short-term memory networks, as an improved recurrent neural network architecture, effectively addressed the vanishing gradient problem through gating mechanisms and cell states, enabling the capture of long-term temporal dependencies [6]. LSTM has demonstrated strong capability in water quality prediction, with confirmed higher prediction accuracy and robustness compared to traditional machine learning methods in inland water quality modeling [7]. In practical applications, deep LSTM networks combined with Pearson correlation coefficient analysis to identify parameter associations have successfully achieved high-precision short-term and long-term prediction of pH and water temperature in marine aquaculture [8]. Gated recurrent units, as a simplified LSTM variant, reduced computational complexity by decreasing the number of gating units [9]. The proposal of sequence-to-sequence learning frameworks further expanded deep learning applications in sequence modeling, enabling end-to-end learning of variable-length sequences through encoder-decoder structures [10]. However, standalone LSTM models struggle to avoid noise interference and can only perform unidirectional prediction based on historical information. Researchers therefore began exploring hybrid architectures. Convolutional neural networks were introduced to temporal modeling for their strong local feature extraction capability. Temporal convolutional networks demonstrated superior performance to LSTM and longer effective memory in multiple sequence modeling tasks [11]. Building on this foundation, hybrid models integrating ensemble empirical mode decomposition with CNN-BiLSTM were proposed. These models eliminate noise influence through EEMD decomposition, extract local features via CNN, and leverage BiLSTM to simultaneously consider forward and backward temporal dependencies, thereby effectively improving dissolved oxygen prediction performance [12]. The success of these hybrid architectures indicates that combining the strengths of different deep learning techniques can more effectively address the complex characteristics of water quality data.
Although hybrid architectures combining LSTM and CNN significantly improved water quality prediction performance, adaptively capturing key information from long-sequence data remains challenging. The attention mechanism provided a new solution to this problem. By automatically searching for parts of the source sequence relevant to target prediction, attention mechanisms effectively addressed the information bottleneck of fixed-length vectors in encoder-decoder architectures [13]. In water quality prediction, attention mechanisms were combined with LSTM to enhance the influence of key features by assigning differentiated weights to sequences at different time steps, successfully achieving single-step and multi-step prediction of dissolved oxygen in the Burnett River, Australia [14]. Building on this, LSTM models based on multi-head attention were further proposed to capture multi-faceted temporal relationships in water quality data through multi-head mechanisms, improving prediction performance by approximately 5% to 8% compared to existing models on Irish water quality datasets [15].
Building on attention mechanisms, the proposal of the Transformer architecture changed the sequence modeling paradigm. It abandoned recurrent structures and relied solely on self-attention mechanisms to capture global dependencies, achieving remarkable success in natural language processing and other fields [16]. However, directly applying it to long-sequence time series prediction faces two major challenges: first, the time and memory complexity of self-attention mechanisms grows quadratically with sequence length, limiting input sequence length; second, point-wise attention struggles to effectively extract local semantic information from time series. Addressing the complexity problem, researchers proposed improvements from different angles. Informer introduced a probabilistic sparse self-attention mechanism to select important query-key pairs, reducing complexity to log-linear level, and adopted a generative decoder to achieve one-step prediction of long sequences [17]. Autoformer incorporated series decomposition as an internal module and designed an auto-correlation mechanism leveraging series periodicity to perform dependency discovery and aggregation at the sub-series level, also achieving logarithmic complexity [18]. For the local semantic information deficiency, PatchTST segmented time series into sub-sequence-level patches as input tokens, preserving local information while dramatically reducing computational cost, and adopted a channel-independent strategy to avoid noise interference between multiple variables [19]. Building on this foundation, iTransformer further reconstructed the responsibility allocation of Transformer modules by inverting the operational dimension, applying attention mechanisms to the variable dimension to capture multivariate correlations while using feed-forward networks for independent time series representation learning for each variable [20]. In water quality prediction applications, STGFT, a long-term water quality prediction model based on spatiotemporal graph-fused Transformer, was proposed. It integrates a spatial attention encoder, temporal attention encoder, and adaptive dynamic adjacency matrix generator to separately capture spatial correlations and temporal features across different monitoring stations, and reflects latent spatial relationships in river networks by generating adaptive and dynamic graphs [5]. These Transformer-based methods demonstrated powerful long-range dependency modeling capability, providing new technical pathways for water quality prediction.
Beyond temporal dependencies, spatial relationships among water quality monitoring stations also affect prediction performance. Graph neural networks have been widely applied to spatiotemporal sequence prediction due to their capability to process non-Euclidean data. Graph convolutional networks effectively capture local structure and features among nodes by performing convolution operations directly on graph structures [21]. Graph attention networks were further proposed to assign different weights to neighboring nodes through attention mechanisms, enhancing model expressiveness [22]. Spatiotemporal graph convolutional network STGCN combined graph convolution with temporal convolution, demonstrating the capability to simultaneously model spatial and temporal dependencies in traffic flow prediction [23]. In the water quality prediction domain, temporal-relational graph neural networks extracted parameter correlations through weighted adjacency matrices, achieving multivariate multi-step prediction of coastal seawater quality parameters [24]. For plain river networks, spatiotemporal graph neural network ST-GNN was proposed, integrating adaptive multi-period enhancement and temporal periodic dependency modules to capture complex spatiotemporal dependencies [25]. However, GNN methods have limitations in river water quality prediction: Pearl River basin water quality data exhibits unidirectional flow characteristics, with highly sparse adjacency matrices between upstream and downstream stations, limiting GNN effectiveness in capturing complex spatial dependencies.
Many real-world time series exhibit clear periodic or quasi-periodic structures, such as urban traffic flow, electricity and gas loads, cloud and data center resource utilization, and network traffic. The water quality data used in this study are influenced by multiple factors including seasonal variations, tidal cycles, and human activities, also exhibiting significant periodic patterns. Beyond spatiotemporal dependencies, these inherent periodic features are critical to prediction performance. Targeting this characteristic, researchers proposed a series of methods from frequency-domain analysis and multi-period modeling perspectives. FEDformer embedded seasonal-trend decomposition into Transformer, leveraging Fourier transform to capture sparse representations in the frequency domain to extract global characteristics [26]. Pyraformer constructed a multi-resolution tree structure through pyramid attention modules, aggregating global features via cross-scale connections and modeling local dependencies through same-scale adjacency relationships [27]. TimesNet further decomposed complex variations into intra-period and inter-period categories, converting one-dimensional sequences into two-dimensional tensors to enable convolutional kernels to simultaneously capture both types of variations [28]. These methods were subsequently introduced to the water quality prediction domain. Temporal Fusion Transformer was used to integrate features across different time scales, achieving modeling and prediction of river water quality indices [29]. An ensemble model integrating Informer, Autoformer, and FEDformer also achieved excellent performance in wastewater treatment plant water quality parameter prediction [30]. These methods provided new technical pathways for water quality prediction.
Empirical studies demonstrate that river water quality data exhibit significant multi-timescale periodic patterns. Through continuous monitoring of the tidal freshwater zone in the Potomac River, water temperature, dissolved oxygen, and pH showed strong and consistent diurnal cycles under stable conditions, while conductivity exhibited semi-diurnal cycles. These periodic patterns are influenced by seasonal variations in driving factors such as light, tides, and freshwater inflow [31]. Spatiotemporal variation assessments of the middle and lower reaches of the Han River revealed significant seasonal variation patterns in water quality parameters, with the lowest water quality indices occurring in summer and autumn [32]. In studies of the Xijiang River basin, correlations between water quality parameters and meteorological factors were further confirmed, with the temperature-dissolved oxygen relationship indicating that meteorological influences must be incorporated into water quality prediction processes [33]. These studies collectively demonstrate that water quality data simultaneously contain multi-scale periodic features such as diurnal and seasonal cycles, and that these cycles are driven by physical-ecological processes including light, temperature, and human activities.
While several periodicity-aware forecasting methods have been developed—including frequency-domain approaches such as FreqCycle [34], adaptive period discovery methods such as TimesNet [28], and phase-based methods such as PhaseFormer [35]—they still face limitations in explicitly modeling the multi-scale periodicities inherent in water quality data. Overall, existing approaches lack explicit mechanisms for capturing multiple periodic scales simultaneously, motivating the need for a more effective solution.

3. Method

This paper focuses on forecasting tasks for multivariate time series. Given a historical observation sequence X = { x 1 , x 2 , , x L in } R L in × C , the model predicts the future sequence Y = { y 1 , y 2 , , y L out } R L out × C for L out time steps. Due to significant differences in physical meaning and variation patterns among different water quality parameters, this paper adopts the channel-independent paradigm [19,36], training separate models for different water quality parameters without sharing parameters. In the spatial dimension, the model input consists of historical data from 37 monitoring stations, with output being future data for these stations. Subsequent descriptions use a single parameter as an example, with multivariate cases independently generalizable.
Water quality time series exhibit significant multi-scale periodic characteristics. Setting the fundamental period length as L phase , such as 24 for hourly data corresponding to diurnal cycles, the number of periods contained in the input sequence P in and the number of periods in the output sequence P out are respectively:
P in = L in / L phase P out = L out / L phase
The core idea of HarmonicFormer is to improve water quality prediction accuracy by explicitly modeling these multi-scale periodic features.

3.1. Data Preprocessing

Water quality parameters have significantly different dimensions and value ranges. To eliminate the influence of different parameter dimensions and accelerate model convergence, this paper adopts Reversible Instance Normalization [37] to normalize the input sequence. Unlike conventional normalization methods that rely on global statistics, RevIN normalizes each input instance independently using its own mean and standard deviation. This instance-wise strategy avoids the distribution mismatch problem between training and test sets, and enhances robustness against non-stationarity and outliers in water quality time series. Its reversible design further ensures that predictions can be accurately restored to the original scale. Given an input sequence x R L in , the mean and standard deviation are first calculated:
μ = 1 L in t = 1 L in x t σ = 1 L in t = 1 L in ( x t μ ) 2 + ϵ
The normalized sequence is x ˜ = x μ σ . The model performs prediction on the normalized sequence, obtaining the normalized prediction result y ˜ . In the output stage, the original dimension is recovered through denormalization:
y = y ˜ · σ + μ
After RevIN normalization, the model adopts Phase Tokenization to reorganize the one-dimensional time series into a two-dimensional phase-period matrix, explicitly modeling the periodic characteristics of water quality data. Setting the fundamental period length as L phase and the input sequence length as L in , to ensure the sequence length is an integer multiple of the period length, the input sequence is first cyclically padded to length P in × L phase , where P in = L in / L phase is the number of periods contained in the input. The padded sequence x pad R P in × L phase is reorganized into a phase-period matrix according to the following formula:
X phase [ , p ] = x pad [ ( p 1 ) · L phase + ]
where { 1 , , L phase } is the phase index and p { 1 , , P in } is the period index. Each row phase token of this matrix contains observations at the same phase across multiple periods. Phase tokens possess stronger global stationarity and lower feature dimensionality [35], providing an efficient representational foundation for subsequent periodic modeling.
In the prediction stage, the model outputs a phase-period matrix Y phase R L phase · P out or Y phase R C · L phase · P out in the multivariate case. This is reorganized into a one-dimensional prediction sequence y R L out through phase detokenization, completing the mapping from phase space to temporal space.

3.2. HarmonicFormer Model

The overall architecture of HarmonicFormer is shown in Figure 1. The model adopts an encoder-predictor structure, mainly comprising a phase embedding layer, harmonic temporal encoding, cross-phase routing layers, and a predictor. Given the preprocessed phase-period matrix X phase R C × L phase × P in , the model first maps it to the latent space through the phase embedding layer, subsequently introduces harmonic temporal encoding to explicitly embed multi-scale periodic priors, then performs feature interaction and extraction through multiple cross-phase routing layers, and finally generates predictions for the future P out periods through the predictor.

3.2.1. Harmonic Time Encoding

Harmonic time encoding aims to explicitly model multi-scale periodic features driven by physical-ecological processes in water quality data. Water quality parameters are influenced by factors such as light, temperature, and human activities, exhibiting periodic variation patterns at multiple time scales including diurnal and weekly cycles. To capture these inherent periodicities, this paper designs a harmonic time encoding mechanism based on multi-period sinusoidal functions.
For a phase sequence with period length L phase , a set of periods P = { p 1 , p 2 , , p k } is defined. This paper sets P = { 1 , L phase , 7 · L phase } , where p = 1 corresponds to capturing fundamental high-frequency fluctuations, p = L phase corresponds to diurnal cycle patterns driven by factors such as light and temperature, and p = 7 · L phase corresponds to weekly cycle patterns driven by factors such as human activities. For each period p k , cosine and sine encodings are generated at phase index { 0 , 1 , , L phase 1 } :
cos 2 π p k sin 2 π p k
Concatenating the sine and cosine encodings of all periods yields a 2 k -dimensional harmonic feature vector:
h = cos 2 π p 1 , sin 2 π p 1 , , cos 2 π p k , sin 2 π p k T R 2 k
Subsequently, a linear projection layer maps the harmonic features to the model’s latent dimension d:
e = W h h R d
where W h R d × 2 k is a learnable projection matrix. The encoding vectors of all phases form the harmonic time encoding matrix:
E time = [ e 0 , e 1 , , e L phase 1 ] T R L phase × d
Finally, the harmonic time encoding is added to the phase embeddings, explicitly injecting multi-scale periodic prior knowledge into the model.

3.2.2. Phase Embedding

The phase embedding layer is responsible for mapping the phase-period matrix X phase R C × L phase × P in to the model’s latent representation space. For each phase { 1 , , L phase } , the corresponding phase token is a column vector:
x = [ X phase [ , 1 ] , X phase [ , 2 ] , , X phase [ , P in ] ] T R P in
The phase embedding layer maps the phase token to the d-dimensional latent space through linear transformation:
z = W e x R d
where W e R d × P in is a learnable embedding matrix. Stacking the embedding vectors of all phases yields the phase embedding matrix:
Z = [ z 1 , z 2 , , z L phase ] T R L phase × d
Subsequently, the harmonic time encoding E time is added to the phase embedding Z , obtaining a phase representation that incorporates periodic priors:
Z ˜ = Z + E time
This representation serves as the input to subsequent cross-phase routing layers.

3.2.3. Cross-Phase Routing Layer

The cross-phase routing layer is responsible for modeling dependencies between different phases and capturing cross-period temporal dynamic features. Directly applying full attention across all phases would yield time complexity of O ( L phase 2 ) , which incurs significant computational overhead when the period length is large. To improve efficiency, this paper introduces a two-stage attention mechanism based on routers [35]. Specifically, K learnable routers are set:
R = [ r 1 , r 2 , , r K ] T R K × d
serving as intermediaries for information exchange. First, phase-to-router aggregation is performed, using routers as queries and phase representations as keys and values, aggregating phase information through multi-head attention:
H = MultiHeadAttn ( Q r , K z , V z )
where Q z = Z ˜ W Q dist , K r = H W K dist , V r = H W V dist . Finally, residual connections, layer normalization, and feed-forward networks are applied for further processing:
Z = LayerNorm ( Z ˜ + Dropout ( Z attn ) )
Z out = LayerNorm ( Z + Dropout ( FFN ( Z ) ) )
where FFN consists of two linear transformations and a GELU activation function. The model stacks N cross-phase routing layers to progressively extract higher-level feature representations. Through the router mechanism, time complexity is reduced to O ( L phase · K · d ) .

3.2.4. Phase Predictor

After processing through multiple cross-phase routing layers, the model obtains phase representations Z ( L ) R C × L phase × d that integrate multi-scale periodic information. The predictor module employs linear projection to map each phase token from latent dimension d to the output period count P out :
Y phase = Z ( L ) W pred + b pred
where W pred R d × P out and b pred R P out are learnable parameters, and Y phase R B × C × L phase × P out is the prediction result in phase space.

3.2.5. Phase Detokenization

The phase-period matrix Y phase R B × C × L phase × P out output by the predictor needs to be converted back to time series form through phase detokenization, which is the inverse operation of phase tokenization. First, the phase-period matrix is reorganized into a period-phase matrix through dimension permutation:
Y periods = Permute ( Y phase , [ 0 , 1 , 3 , 2 ] )
yielding Y periods R B × C × P out × L phase . Subsequently, the period dimension and phase dimension are flattened into a continuous time series:
Y flat = Reshape ( Y periods , [ B , C , P out × L phase ] )
Since period alignment may generate redundant time steps, the target prediction length is truncated:
Y ^ = Y flat [ , , L pred ]
where L pred = L out is the prediction sequence length. Finally, the standard time series format is restored through dimension permutation:
Y ^ R B × C × L pred
Then the original scale is recovered through RevIN denormalization:
y final = y ^ σ + μ
where μ and σ are the statistics saved during input sequence normalization, and ⊙ denotes element-wise multiplication.

3.3. Model Complexity Analysis

The computational complexity of HarmonicFormer primarily consists of three components: the phase embedding layer, cross-phase routing layers, and the predictor. In the phase embedding layer, for each variable’s phase sequence X phase R L phase × P in , the linear projection has complexity O ( C · L phase · P in · d ) . Since P in = L in / L phase is typically small, the computational overhead of this component is limited.
Each cross-phase routing layer contains a two-stage attention mechanism. In the phase-to-router aggregation stage, attention is computed between L phase phase tokens and K router tokens, with complexity O ( C · L phase · K · d ) . The router-to-phase distribution stage has identical complexity. Therefore, the total complexity of a single cross-phase routing layer is O ( C · L phase · K · d ) . For L routing layers, the total complexity is:
O ( L · C · L phase · K · d )
By introducing a fixed number of router tokens as intermediaries, this mechanism avoids the O ( L phase 2 ) complexity of full attention. Since the period length P, router count K, number of layers L, and feature dimension d are all fixed hyperparameters, the model’s computational cost grows linearly with input length L in and output length L out . The linear projection of the predictor has complexity O ( C · L phase · d · P out ) . Synthesizing the above analysis, the overall time complexity of HarmonicFormer is:
O ( L · C · L phase · K · d )
Compared to the O ( T 2 · d ) complexity of standard Transformer, this provides significant computational advantages when processing long sequences. Additionally, the phase-based representation reduces the feature dimension from T to L phase , further decreasing model parameter count and memory usage.

4. Dataset

The Pearl River is the largest river system in southern China, with a basin area of approximately 45.4 × 10 4 km 2 , formed by the confluence of three major water systems: the Xijiang, Beijiang, and Dongjiang. Located in the subtropical monsoon climate zone, the Pearl River basin receives abundant rainfall, with annual precipitation of 1500–2000 mm and runoff ranking second nationally after the Yangtze River. The basin is densely populated and economically developed, serving as a vital water source for the Guangdong-Hong Kong-Macao Greater Bay Area. Water quality directly affects regional ecological security and drinking water safety for tens of millions of residents.
The data used in this study were collected from 37 cross-section monitoring stations of the Pearl River basin automatic water quality monitoring system. These 37 stations are distributed across the river network of the Pearl River Delta, with the following administrative divisions: 14 stations in the Guangzhou section, located at 113°15′–113°40′ E, 22°50′–23°10′ N; 6 stations in the Foshan section, located at 113°00′–113°15′ E, 22°50′–23°05′ N; 10 stations in the Zhongshan section, located at 113°15′–113°30′ E, 22°25′–22°45′ N; and 7 stations in the Zhuhai section, located at 113°25′–113°40′ E, 22°05′–22°25′ N. The stations cover the complete hydrological propagation chain from upstream inputs to estuary discharge, distributed across major cities including Zhaoqing, Guangzhou, Foshan, Zhongshan, Jiangmen, and Zhuhai, encompassing the Xijiang and Beijiang main streams, their major tributaries, and estuarine channels such as Modaomen and Jitimen. The station layout fully considers basin hydrological connectivity, facilitating capture of pollutant migration and transformation processes within the basin. Stations in estuarine areas including Zhuhai, Jiangmen, and Zhongshan are located at river-sea convergence zones, subject to dual influences from Pearl River runoff and South China Sea tides. Complex hydrodynamic conditions exist with tidal backflow and saltwater intrusion phenomena, causing water quality parameters to exhibit semi-diurnal tidal periodic fluctuations, presenting unique challenges for water quality prediction.
Data from the Pearl River basin automatic water quality monitoring system span from April 2020 to April 2026, covering nearly six years. The dataset includes 37 monitoring stations with a sampling interval of 4 h, totaling 14,081 time steps, providing substantial sample support for water quality prediction. To facilitate parameter-independent modeling, we aggregated the raw data by water quality parameter and monitoring site, generating separate feature files for each of the nine water quality parameters, each with a unified spatiotemporal dimension for consistent model loading and processing. The overall missing rate of the dataset is 1.15%, which is relatively low; therefore, linear interpolation based on adjacent observations was applied for imputation. For outliers, we performed outlier detection using the Interquartile Range (IQR) method with a threshold of 3 × I Q R . Values exceeding Q 1 3 × I Q R or Q 3 + 3 × I Q R were flagged as potential outliers. To avoid gaps in the time series caused by sample removal and to mitigate the adverse effects of extreme values on model training, we adopted Winsorization to cap the detected outliers to the corresponding boundary values. In the dataset, approximately 2.14% of the observations were corrected, while the overall statistical characteristics of each feature remained largely unchanged before and after processing, indicating that this method effectively suppresses extreme outliers while preserving the original data distribution.
Monitoring parameters include nine indicators: water temperature, pH, dissolved oxygen, ammonia nitrogen, total nitrogen, total phosphorus, conductivity, permanganate index, and turbidity, covering the physical, chemical, and biological characteristics of water bodies. Table 1 lists the statistical characteristics of each parameter across the entire dataset, including mean, standard deviation, minimum, maximum, and missing rate. The overall missing rates are low, indicating stable and reliable monitoring system operation.
Water quality parameters exhibit significant spatial variability. As shown on the horizontal axis of Figure 2, stations are arranged in numerical order, displaying spatiotemporal variation patterns of dissolved oxygen across all 37 monitoring stations during 2025. From the spatial dimension, dissolved oxygen levels differ markedly across stations. Upstream stations generally exhibit higher concentrations during winter and spring, while midstream and downstream stations show lower values in summer. These differences reflect the combined influences of geographic location, hydrological conditions, and human activities. From the temporal dimension, most stations exhibit seasonal fluctuations with low dissolved oxygen in summer and high in winter, consistent with the temperature-dependent solubility of gases. Seasonal patterns are not perfectly synchronized across stations. Several stations remain in the deep blue low-value zone throughout summer, while a few show red high-value anomalies in specific months, reflecting the impact of extreme weather events or sudden pollution incidents. This spatiotemporal heterogeneity indicates that water quality prediction models must possess the capability to simultaneously adapt to multiple stations and different temporal characteristics.
To evaluate model performance, the dataset is divided chronologically into training, validation, and test sets with a 7:1:2 ratio, yielding 9857, 1408, and 2816 time steps, respectively. The training set is used for model parameter learning, the validation set for hyperparameter tuning and early stopping strategy, and the test set for final performance evaluation. The input sequence length is set to 96 time steps, with prediction horizons of 24, 48, 96, 192, 336, and 720 time steps, corresponding to short-term, medium-term, and long-term prediction tasks, respectively. Training samples are generated via a sliding window strategy, with the sample count ranging from 9041 to 9737 depending on the prediction horizon. Following the widely adopted practice in time series forecasting [18,35,36], we select Mean Squared Error (MSE) and Mean Absolute Error (MAE) as the primary evaluation metrics. MSE assigns a heavier penalty to larger errors, making it suitable for measuring extreme deviations:
MSE = 1 N i = 1 N ( y i y ^ i ) 2
MAE, on the other hand, is insensitive to outliers and provides a more stable measure of the average prediction error:
MAE = 1 N i = 1 N | y i y ^ i |
To further assess model performance from multiple perspectives, we additionally adopt Root Mean Squared Error (RMSE), Residual Standard Error (RSE), and the General Performance Index (GPI) as supplementary metrics. RMSE shares the same origin as MSE but is scale-aligned with the target variable, while RSE measures the dispersion of prediction residuals, reflecting the stability of the model:
RMSE = MSE
RSE = 1 N p 1 i = 1 N ( y i y ^ i ) 2
where p denotes the number of model parameters.
For the General Performance Index (GPI), we follow the formulation of Maroufi and Mehdinejadiani [38], which combines several component metrics as follows:
MBE = 1 N i = 1 N ( y i y ^ i )
TS = ( N 1 ) × MBE 2 RMSE 2 MBE 2
U 95 = 1.96 × RSE 2 + RMSE 2
GPI = MBE × RMSE × TS × U 95 × ( 1 R 2 )
For a perfect model, MBE = 0, RMSE = 0, TS = 0, U 95 = 0 , and R 2 = 1 , yielding GPI = 0. Therefore, a GPI value closer to zero indicates better overall prediction performance.

5. Results and Discussion

This chapter comprehensively evaluates and analyzes the performance of HarmonicFormer in water quality time series prediction tasks. First, the experimental setup is introduced, including dataset configuration, evaluation metrics, and comparison models. Subsequently, detailed analysis is conducted across multiple dimensions including overall performance, performance across different prediction horizons, training convergence, ablation experiments, and computational efficiency, validating HarmonicFormer’s advantages in prediction accuracy and computational efficiency. Finally, the sources of model effectiveness, applicable scenarios, and limitations are discussed, providing reference for future research.

5.1. Experimental Setup

The water quality time series dataset used in experiments contains observations of nine water quality parameters at 37 monitoring stations. The prediction task adopts a multi-site mode, utilizing historical data from all 37 stations to simultaneously predict future values at all stations, fully exploiting spatiotemporal correlation information among sites. Independent models are trained separately for each water quality parameter, with all models sharing identical network architecture and hyperparameters. Input data are standardized using Reversible Instance Normalization (RevIN), with normalization parameters fitted only on the training set to avoid test set information leakage.
To validate the effectiveness of HarmonicFormer, it is compared against eight representative baseline models, including temporal Transformer models (TimesNet [28], Autoformer [18]), linear models (DLinear [36]), periodic modeling methods (FreqCycle [34], PhaseFormer [35]), and spatiotemporal graph neural networks (GWN [39], ASTGCN [40], STGCN [23]). Key hyperparameter configurations of HarmonicFormer are as follows: harmonic period length P = 24 (corresponding to 24-h diurnal cycles), number of phase routing layers N = 2, number of routers M = 16, latent dimension of 64, with RevIN normalization enabled to eliminate non-stationarity. These parameter selections will be validated in detail through ablation experiments in Section 5.3.
For training configuration, batch size is set to 32, the Adam optimizer is employed with an initial learning rate of 0.0001, and the learning rate is dynamically adjusted based on validation set loss to accelerate convergence. Maximum training epochs are set to 10, with an early stopping strategy (patience = 3) that terminates training when validation loss fails to improve for three consecutive epochs, avoiding overfitting. All experiments are conducted on a server equipped with two NVIDIA A100-PCIE-40GB GPUs, using Python 3.12.3, PyTorch 2.5.1 framework, and CUDA 12.4. To ensure reproducibility, all experiments use a fixed random seed of 2021.

5.2. Overall Performance and Stepwise Analysis

This section evaluates the prediction performance of HarmonicFormer from an overall perspective. Experiments cover nine water quality parameters and six prediction horizons (24, 48, 96, 192, 336, 720 steps), totaling 54 experimental configurations. HarmonicFormer is compared against eight baseline models using both MSE and MAE metrics for evaluation. The following analysis examines HarmonicFormer’s effectiveness from three perspectives: performance-efficiency tradeoff, complete experimental results, and prediction curve comparison.

5.2.1. Overall Performance

The tradeoff between prediction performance and computational efficiency across different models is compared through the bubble chart in Figure 3. The horizontal axis represents average training time per epoch (logarithmic scale), while the vertical axis represents average MSE. Solid circles denote harmonic or phase modeling methods, dashed circles represent graph neural networks, and dotted circles indicate other Transformer-based models. Ideal models should be located in the upper-left region, corresponding to short training time and low prediction error.
As shown in the figure, HarmonicFormer is located in the optimal upper-left region, achieving the best performance-efficiency balance among periodic modeling methods. Compared to PhaseFormer and FreqCycle, HarmonicFormer achieves lower prediction error while maintaining similar training speed. In contrast, graph neural network models (GWN, ASTGCN, STGCN) exhibit significantly longer training times and markedly higher prediction errors, indicating that spatial dependency modeling based on fixed or globally shared graph structures struggles to capture the nonlocal and time-varying dependencies in water quality data, while also introducing substantial computational burden. Among Transformer-based models, TimesNet has the longest training time with high prediction error, while Autoformer shows unsatisfactory efficiency and performance. The linear model DLinear demonstrates moderate training speed but limited prediction accuracy.
Examining the overall error distribution, Figure 4 presents a holistic view through bar charts of average MSE and MAE across 54 configurations for each model, further validating the aforementioned conclusions. HarmonicFormer achieves an average MSE of 0.38 and average MAE of 0.37, both representing the lowest values. The second-best models are PhaseFormer with MSE of 0.38 and MAE of 0.38, and FreqCycle with MSE of 0.38 and MAE of 0.37, showing small gaps from HarmonicFormer. Spatiotemporal graph models demonstrate relatively weaker overall performance, with STGCN showing average MSE of 0.51 and MAE of 0.47, and ASTGCN showing average MSE of 0.44 and MAE of 0.43, notably higher than periodic modeling methods.
To further quantify performance across parameters and horizons, Table 2 presents complete MSE and MAE results for nine water quality parameters at six prediction horizons for each model. From an overall perspective, HarmonicFormer achieves an average MSE of 0.3809 and average MAE of 0.3753, both representing the lowest values among all models. With average MSE rank of 2.65 and average MAE rank of 2.96, it significantly outperforms baseline models including TimesNet, Autoformer, GWN, ASTGCN, and STGCN, only slightly higher than FreqCycle’s average MAE rank of 2.83, demonstrating clear advantages across most configurations. For parameters with strong periodicity, HarmonicFormer’s advantages are more pronounced. Taking dissolved oxygen as an example, in 24-step prediction, HarmonicFormer achieves MSE of 0.1515, superior to PhaseFormer’s 0.1581 and FreqCycle’s 0.1718. For pH parameter in 96-step prediction, HarmonicFormer’s MSE of 0.3905 is significantly lower than TimesNet’s 0.5708 and FreqCycle’s 0.4090. These results fully demonstrate that harmonic encoding effectively captures periodic fluctuation patterns, substantially improving prediction accuracy for periodic parameters.
For parameters with relatively weaker periodicity, HarmonicFormer maintains its leading position. In 24-step prediction for conductivity, HarmonicFormer’s MSE of 0.2385 closely approaches the best-performing PhaseFormer’s 0.2354. In 336-step prediction for turbidity, HarmonicFormer’s MSE of 0.4525 essentially matches the best-performing FreqCycle’s 0.4503. Additionally, for temperature parameters, HarmonicFormer achieves optimal or near-optimal results in short-term predictions at 24 and 48 steps. Overall, HarmonicFormer achieves optimal or near-optimal prediction performance across parameters with varying periodicity strengths, demonstrating clear advantages in both prediction accuracy and computational efficiency, validating the effectiveness of harmonic temporal encoding in multi-scale periodic modeling.
We additionally report RMSE, RSE, and GPI as auxiliary metrics to evaluate model performance from broader perspectives. Table 3 reports the average values of these metrics across all variables and forecasting horizons, along with the corresponding average ranks. HarmonicFormer achieves an RMSE of 0.5941, outperforming all baseline models, and its RSE of 0.6941 ranks second best, indicating superior performance in both overall error magnitude and prediction stability. In terms of GPI, FreqCycle attains the lowest average GPIabs of 34.0141 and the best average GPI rank of 2.63, slightly outperforming HarmonicFormer. Nevertheless, HarmonicFormer maintains a competitive GPI rank of 3.30 and outperforms all other baseline models, further confirming its comprehensive advantage across multiple evaluation dimensions.
To quantify model training efficiency, Table 4 compiles average epoch time, average train time, and average epochs for each model across 54 configurations. HarmonicFormer achieves an average epoch time of 5.78 s and average train time of 49.0 s. Although PhaseFormer has shorter average train time (42.6 s), HarmonicFormer demonstrates superior prediction accuracy. Compared to FreqCycle’s average train time of 86.3 s, HarmonicFormer holds advantages in both training speed and prediction accuracy. In contrast, graph neural network models GWN, ASTGCN, and STGCN exhibit average train times of 558.9, 936.3, and 237.9 s, respectively. The Transformer-based models TimesNet and Autoformer reach 3266.5 and 404.0 s, all far exceeding HarmonicFormer. These results indicate that HarmonicFormer achieves favorable balance between prediction accuracy and training efficiency, demonstrating high practical application value.

5.2.2. Performance Across Prediction Horizons

This section further examines how prediction horizon affects model performance. To intuitively illustrate how the performance differences among the models evolve with increasing forecast horizons, Figure 5 compares the MSE values of HarmonicFormer, GWN, ASTGCN, and STGCN for total nitrogen, pH, and conductivity. The MSE of all models increased with the prediction horizon, but the graph-based models exhibited a more pronounced increase. At the 720-step horizon, HarmonicFormer achieved an MSE of approximately 0.54 for total nitrogen, whereas the three graph-based models produced MSE values ranging from 0.86 to 1.07, corresponding to reductions of 36.9–49.2%. For pH and conductivity, HarmonicFormer similarly reduced the MSE by 35.6–39.4% and 19.8–32.5%, respectively. STGCN already exhibited a relatively high error baseline at shorter prediction horizons, whereas the performance gaps between HarmonicFormer and both GWN and ASTGCN widened progressively as the prediction horizon increased. These observations indicate that the differences developed gradually as the prediction range expanded rather than emerging only at the longest horizon.
To verify that the above differences were not attributable to chance, we further examined the late forecast segment, covering steps 193–336 as the prediction progressed from shorter leads toward the 336-step horizon, using experiments with five random seeds. The results are presented in Table 5. In the table, MSE 193 : 336 denotes the mean of the exact-lead MSE values over the 144 forecast steps within this interval, obtained from the same directly trained 336-step forecasting model. The MSE reductions were calculated relative to the corresponding graph-based models, while the mean lead-wise 95% confidence interval width was used to characterize training stability across random seeds.
HarmonicFormer achieved a three-variable mean MSE of 0.6608, compared with 0.8944, 1.0235, and 0.9480 for GWN, ASTGCN, and STGCN, respectively, corresponding to reductions of 26.1%, 35.4%, and 30.3%. Its mean lead-wise 95% confidence interval width was only 0.0103, representing a reduction of 95.8–97.2% relative to the three graph-based models. These results indicate that HarmonicFormer maintained both lower prediction errors and greater cross-seed stability in the late forecast segment, where the performance gaps between the models became more pronounced.
To further elucidate the sources of the error differences between HarmonicFormer and GWN, ASTGCN, and STGCN in the late forecast segment, conductivity was selected as a representative variable, and the MSE over forecast steps 193–336 was decomposed into squared bias and residual variance. This decomposition determines whether the observed MSE differences primarily arise from systematic trajectory bias or residual variability. The results are presented in Table 6. In the table, Δ Bias 2 and Δ Var represent the differences in the corresponding components relative to HarmonicFormer, which serves as the reference model.
The results show that HarmonicFormer achieved the lowest conductivity MSE in this interval, indicating that the sum of its squared bias and residual variance was lower than those of the three graph-based models. Relative to HarmonicFormer, GWN and ASTGCN exhibited increased squared bias but decreased residual variance, indicating that the reduction in residual dispersion was insufficient to offset the increase in bias caused by systematic trajectory deviations. For STGCN, the MSE difference was primarily attributable to squared bias. Overall, the decomposition results indicate that the higher conductivity MSE values of the three graph-based models in the late forecast segment were mainly associated with systematic trajectory bias rather than a simple increase in residual variability.
These observations are consistent with the structural assumptions of the different models. ASTGCN and STGCN rely on fixed spatial topologies to propagate information among monitoring stations. However, water quality parameters may also be influenced by nonlocal and time-varying factors, including hydrological processes, meteorological conditions, and delayed pollutant transport, which may not be adequately represented by a fixed topology. Although GWN can adaptively learn relationships among monitoring stations, the learned structure is globally shared across different samples and forecast steps and lacks a mechanism for dynamic adjustment according to periodic phases. In contrast, HarmonicFormer directly models historical states at corresponding phases through organization according to phase and periodicity and through cross-phase interaction. This reduces its reliance on fixed or globally shared spatial topologies and enables it to preserve long-term forecast trajectories more consistently.
Taken together, the performance and efficiency bubble chart, the complete experimental results, and the prediction curve comparisons show that HarmonicFormer achieved the best average ranking across 54 experimental configurations while maintaining a favorable balance between predictive accuracy and computational efficiency. The bias and variance decomposition further indicated that the higher conductivity MSE of the graph-based models was mainly associated with systematic trajectory bias. Overall, the results suggest that the performance advantage of HarmonicFormer arises from the coordinated effects of organization according to phase and periodicity, cross-phase interaction, and stable temporal modeling, which enable the model to effectively represent periodic variations in water quality parameters and maintain low and stable prediction errors as the forecast horizon increases.
In water quality prediction practice, short-term predictions (24 to 48 steps) primarily serve emergency response and real-time scheduling, while long-term predictions (336 to 720 steps, corresponding to 2 to 4 weeks) support water resource planning and decision-making. Prediction tasks at different time scales impose significantly different requirements on models: short-term prediction relies on near-term trend continuation, whereas long-term prediction requires capturing periodic patterns and suppressing error accumulation. This section reveals model performance characteristics in short-term, medium-term, and long-term predictions by analyzing HarmonicFormer’s performance variations across different prediction horizons. Figure 6 displays the trends of MSE and MAE variation with prediction horizon for HarmonicFormer on three representative water quality parameters.
As shown, prediction errors for all parameters increase monotonically with horizon, but curve shapes and growth rates differ markedly across parameters. Observing the MSE and MAE curves, MSE growth rate generally exceeds that of MAE, indicating that individual large errors have more significant impact on mean squared error in long-term predictions, while mean absolute error exhibits stronger robustness to outliers. For pH parameter, MSE increases from 0.2338 at 24 steps to 0.9320 at 720 steps, with MAE rising from 0.2816 to 0.6466. The curve rises rapidly within the first 96 steps, then continues growing at a slower rate. This pattern reflects that pH values are significantly influenced by diurnal cycles. Harmonic encoding effectively captures short-term fluctuations, but as prediction horizons extend to week-scale timeframes, cumulative errors gradually emerge. For dissolved oxygen parameter, MSE increases from 0.1515 at 24 steps to 0.7445 at 720 steps, with MAE rising from 0.2462 to 0.6277. The curve shows notably slower growth after 336 steps, reflecting harmonic encoding’s effective capture of diurnal fluctuations driven by day-night photosynthesis and respiration. For conductivity parameter, MSE increases from 0.2385 at 24 steps to 0.6532 at 720 steps, with MAE rising from 0.2510 to 0.5393. The curve shape resembles that of dissolved oxygen, with growth slowing after 192 steps. Although conductivity exhibits weaker periodicity, error growth remains stable. Comparing curve shapes across the three parameters horizontally, all exhibit similar two-stage growth patterns: rapid error increase within 96 steps, followed by relatively stable linear growth. This characteristic indicates the model possesses certain stability in long-term prediction, effectively controlling the acceleration of error accumulation.
To intuitively demonstrate fitting quality at different prediction horizons, Figure 7 compares the alignment between model outputs and true values at 24-step, 48-step, and 96-step predictions. The x-axis represents the time step index, while the y-axis represents the normalized water quality parameter values after RevIN normalization. As shown, in 24-step short-term prediction, the model prediction curve closely overlaps with true values, accurately tracking short-term fluctuations. In 48-step medium-term prediction, the prediction curve still maintains good synchronization with true values. Although slight local deviations exist, the overall trend and fluctuation patterns remain consistent. In 96-step long-term prediction, deviation between the prediction curve and true values increases somewhat, but the model still captures major variation trends and periodic characteristics.
Further analyzing model performance across different prediction horizons reveals distinct stage-wise characteristics in performance gaps. In the short-term prediction stage (24 and 48 steps), MSE differences between HarmonicFormer and PhaseFormer or FreqCycle remain within 10%. In the medium-term prediction stage (96 and 192 steps), HarmonicFormer’s advantages begin to emerge, achieving approximately 6% and 24% reductions compared to PhaseFormer and Autoformer respectively for pH parameter. In the long-term prediction stage (336 and 720 steps), performance gaps further widen. Notably, spatiotemporal graph neural network models exhibit error divergence after 336 steps, indicating that spatial dependency modeling struggles to ensure long-term prediction stability when lacking periodic modeling mechanisms.
Synthesizing the above analysis, HarmonicFormer maintains stable competitiveness in short-term predictions, with advantages progressively expanding in medium-term and long-term predictions. This characteristic stems from harmonic encoding’s effective capture of diurnal cycle patterns, RevIN normalization’s mitigation of distribution shift, and the phase routing mechanism’s enhancement of long-term dependencies.

5.2.3. Training Efficiency and Convergence

This section validates model efficiency from the training dynamics perspective. Training convergence speed directly impacts time costs for model tuning and deployment. A fast-converging and stable training process serves as an important guarantee for model practicality. Figure 8 displays the training convergence curves of HarmonicFormer on two representative parameters.
As shown, HarmonicFormer exhibits rapid convergence characteristics across different parameters and prediction horizons. In pH parameter training, training loss rapidly decreases from an initial 0.62, stabilizing and converging to 0.58 after epoch 3, while validation loss decreases from 0.65 and stabilizes at 0.62 after epoch 5. In conductivity parameter training, convergence occurs even faster, with training loss converging from 0.56 to 0.53 after epoch 2, and validation loss stabilizing at 0.58 after epoch 3. Training for both parameters completes convergence within 5 epochs. Compared to typical Transformer models requiring dozens or even hundreds of epochs to converge, HarmonicFormer demonstrates significantly higher training efficiency. Observing the gap between training and validation losses, the interval between the two curves consistently remains within 0.05, with validation loss showing no upward trend after convergence, indicating good generalization capability without overfitting. Additionally, both curves exhibit smooth declining trends without severe oscillations or sudden jumps, reflecting training process stability.
Combining training time statistics from Table 4 in Section 5.2.1, HarmonicFormer requires only 5.78 s per epoch on average, with average train time of approximately 49 s, maintaining competitiveness among periodic modeling methods. The model essentially converges within 5 epochs, far lower than graph neural network models ASTGCN at 936 s, STGCN at 238 s, and TimesNet at 3266 s. This efficiency advantage stems from harmonic encoding’s structured periodic modeling approach. Compared to self-attention mechanism’s global dependency computation or graph convolution’s adjacency matrix operations, harmonic encoding reduces model computational complexity through explicit periodic decomposition, while RevIN normalization accelerates gradient propagation, further improving training efficiency. Overall, HarmonicFormer achieves efficient training while ensuring prediction performance, providing a feasible foundation for rapid deployment in practical water quality prediction systems.

5.3. Ablation Study

We examine the effects of harmonic encoding, RevIN normalization, period length, router count, and network depth on prediction performance through multiple ablation experiments. All experiments are conducted under fixed data partitioning and hyperparameters, using MSE and MAE at prediction horizons of 24, 48, and 96 steps as evaluation metrics. First, we analyze the contributions of core modules, with results shown in the Module section of Table 7. As shown, after removing the harmonic encoding module, MSE for 24-step prediction increases from 0.0578 to 0.0639, representing a 10.6% error increase, indicating that harmonic encoding serves as the model’s core module, with its explicit periodic decomposition effectively capturing diurnal cycle patterns of water quality parameters. After removing RevIN normalization, 24-step prediction error increases by only 4.7%, but 96-step prediction error increases by 14.6%, revealing RevIN’s critical role in mitigating distribution shift for long-term predictions.
Further examination reveals the effects of period length, router count, and network depth. For period length, 24-step prediction MSE with P = 12, 48, and 168 increases by 24.2%, 17.1%, and 71.3% respectively compared to P = 24 . P = 24 significantly outperforms other settings, consistent with the diurnal cycle characteristics of water quality parameters. For router count, MSE values for M = 4 , 8 , and 16 are very close, with M = 16 slightly superior. At M = 32 , MSE increases by 3.8%, indicating onset of overfitting. Therefore, M = 16 achieves optimal balance between capacity and generalization. For network depth, N = 1 shows 5.0% higher MSE than N = 2 , while N = 3 demonstrates performance close to N = 2 but with larger parameter count. Thus, N = 2 achieves optimal balance between expressiveness and efficiency. Synthesizing the above ablation experiments, harmonic encoding serves as the core module, RevIN is crucial for long-term predictions, and P = 24 , M = 16 , N = 2 constitute the optimal configuration.

5.4. Discussion

The effectiveness of HarmonicFormer primarily arises from the coordinated use of periodic information modeling and normalization. Harmonic encoding introduces periodic priors, while phase tokenization and cross-phase interaction establish connections between states at corresponding phases across different cycles, enabling the model to preserve cross-cycle information. RevIN further alleviates distribution shifts in nonstationary sequences, thereby improving the stability of long-horizon forecasting.
ASTGCN and STGCN rely on fixed spatial topologies to propagate information among monitoring stations. Such structures are suitable for describing relatively stable local spatial correlations but may not adequately represent the nonlocal and time-varying dependencies induced by hydrological processes, meteorological conditions, and delayed pollutant transport. GWN can adaptively learn relationships among monitoring stations, but the learned graph structure is globally shared across samples and forecast steps and lacks a mechanism for dynamic adjustment according to periodic phases. HarmonicFormer does not require an explicit spatial topology and directly models temporal dependencies through organization according to phase and periodicity. This structural difference is consistent with the systematic trajectory bias observed for the graph-based models in the late forecast segment and provides a plausible explanation for the greater stability of HarmonicFormer over longer forecast horizons.
The current model adopts a fixed period length of P = 24 and primarily focuses on univariate forecasting. Future research will investigate adaptive period discovery and incorporate external meteorological and hydrological variables to improve the applicability of the model to datasets with different sampling frequencies and to multivariate forecasting tasks.

6. Conclusions

To explicitly model multi-scale periodic features of water quality data and improve long-term prediction performance, this paper proposes the HarmonicFormer model. The model employs a harmonic temporal encoding mechanism that explicitly injects periodic priors such as diurnal cycles through multi-period sinusoidal functions. Combined with phase representation and cross-phase routing layers, it achieves efficient modeling of multi-scale periodicity.
Based on nearly six years of hourly water quality data from 37 monitoring stations in the Pearl River basin, this paper conducts systematic evaluation across nine water quality parameters and six prediction horizons, comparing against eight baseline models. Experimental results demonstrate that HarmonicFormer achieves optimal average MSE and MAE rankings across 54 experimental configurations, with particularly pronounced advantages for parameters with strong periodicity. The model trains efficiently (average 49 s per configuration), with error accumulation effectively controlled in long-term predictions, outperforming compared baseline models. Ablation experiments validate the effectiveness of harmonic encoding, RevIN normalization, and hyperparameter configurations (P = 24, M = 16, N = 2). Through large-scale experiments, this paper validates the superiority of explicit periodic modeling in water quality prediction.
Although HarmonicFormer achieves favorable results, limitations remain including fixed period length and univariate prediction mode. Future work will introduce adaptive period discovery mechanisms, extend to multivariate joint prediction, and incorporate external covariates such as meteorological and hydrological factors to further enhance model generalization capability and practicality.

Author Contributions

Conceptualization, C.Z. (Canjia Zhang), J.Z. and J.B.; methodology, C.Z. (Canjia Zhang) and J.Z.; software, C.Z. (Canjia Zhang) and J.Z.; validation, C.Z. (Canjia Zhang) and J.Z.; formal analysis, C.Z. (Canjia Zhang) and J.Z.; investigation, C.Z. (Canjia Zhang), A.T. and J.Z.; data curation, C.Z. (Canjia Zhang) and J.Z.; writing—original draft, C.Z. (Canjia Zhang) and J.Z.; visualization, C.Z. (Canjia Zhang) and J.Z.; resources, J.B.; writing—review and editing, C.Z. (Chunfu Zhang), A.T., Y.L. and J.B.; supervision, C.Z. (Chunfu Zhang), A.T., Y.L. and J.B.; project administration, C.Z. (Chunfu Zhang) and J.B.; funding acquisition, Y.L. and C.Z. (Chunfu Zhang). All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the National Natural Science Foundation of China, grant number 62372494, the National Training Program of Innovation and Entrepreneur-ship for Undergraduates, grant number 202513684010, the 2024 Guangdong Provincial Teaching Quality and Teaching Reform Projects for Colleges and Universities, grant number 2024006 and Guangdong Province College Youth Innovative Talent Project, grant number 2024KQNCX013.

Data Availability Statement

The datasets used in this study have been made publicly available and are stored in Google Drive: https://drive.google.com/drive/folders/1YR6iYvfnw_c0rTwgYc1WmejSsMjPE9nG (accessed on 10 August 2026). Code is available at https://github.com/ChoujiajunStats/HarmonicFormer (accessed on 10 August 2026).

Acknowledgments

Thanks to Qingyue Data (data.epmap.org) for providing the water quality data and Tri-level Talents Development Project of Zhuhai College of Science and Technology. During the preparation of this manuscript, the authors used DeepSeek-V3.2 for partial text polishing. The authors have reviewed and edited the content of this publication and take full responsibility for it.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
RevINReversible Instance Normalization
FFNFeed-Forward Network
GELUGaussian Error Linear Unit

Appendix A. Supplementary Results of Auxiliary Metrics

This appendix provides the complete results of the auxiliary evaluation metrics (RMSE, RSE, and GPI) for all models across the 54 experimental configurations (nine water quality parameters × six forecasting horizons). Table A1 reports the full RMSE and RSE values for each configuration, and Table A2 reports the corresponding GPI values.
Table A1. Cross-variable forecasting results. Each entry reports RMSE and RSE. Input length is 96. Best results are in bold, second best are in underline.
Table A1. Cross-variable forecasting results. Each entry reports RMSE and RSE. Input length is 96. Best results are in bold, second best are in underline.
VariableHorizonHarmonicFormer
(Ours)
TimesNet
(ICLR 2023) [28]
FreqCycle
(AAAI 2026) [34]
PhaseFormer
(ICLR 2026) [35]
DLinear
(AAAI 2023) [36]
Autoformer
(NIPS 2021) [18]
GWN
(IJCAI 2019) [39]
ASTGCN
(AAAI 2019) [40]
STGCN
(IJCAI 2018) [23]
RMSE RSE RMSE RSE RMSE RSE RMSE RSE RMSE RSE RMSE RSE RMSE RSE RMSE RSE RMSE RSE
AN240.51380.59490.55500.64270.52800.61130.53420.61860.52400.60670.68510.79330.51780.59950.53840.62340.56840.6581
480.57730.66810.67520.78130.58800.68050.59030.68300.58230.67380.71960.83270.57290.66300.59370.68700.67010.7754
960.66340.76580.77510.89480.67260.77650.67040.77390.65860.76040.81100.93630.64560.74530.66570.76860.76820.8868
1920.77070.88580.87591.00670.77840.89470.77270.88810.74090.85150.86200.99070.73150.84080.74400.85510.78800.9057
3360.85720.97920.96151.09840.86900.99270.85810.98030.80220.91640.93781.07130.79470.90790.79730.91080.82830.9462
7200.90751.02771.01811.15300.92271.04490.90721.02730.86810.98311.03521.17230.85630.96980.87490.99080.90491.0248
N240.45210.42560.49450.46550.45920.43230.46430.43710.46730.43990.61250.57660.45930.43240.48680.45830.54980.5176
480.48580.45820.57530.54250.49080.46280.49520.46700.50650.47770.61750.58240.50560.47680.53810.50740.62740.5917
960.52850.49930.62840.59360.53060.50120.53510.50550.56200.53090.70490.66590.57780.54590.59400.56110.70750.6683
1920.58530.55450.67330.63790.58390.55320.58910.55810.63950.60590.67090.63560.68040.64460.74120.70220.77720.7363
3360.64330.61070.73870.70120.64000.60760.64550.61280.71990.68340.69250.65730.78380.74400.85160.80840.83560.7932
7200.73610.69860.84540.80220.73420.69670.73370.69620.87800.83320.83410.79160.92720.87980.99890.94791.03250.9798
DO240.38930.43990.43890.49600.41450.46840.39770.44930.41520.46920.51000.57630.40670.45950.40770.46070.42270.4776
480.44340.50130.53040.59950.46260.52300.44990.50860.46240.52270.65420.73960.45360.51280.45960.51950.48140.5442
960.52220.59090.62490.70720.53510.60560.52810.59760.53570.60620.71690.81120.52040.58890.54360.61520.55960.6333
1920.62070.70330.68940.78110.62920.71290.62390.70690.62420.70720.75150.85140.60480.68520.63460.71900.66160.7495
3360.71550.80960.78310.88620.71870.81330.71980.81450.71710.81140.89811.01620.71520.80940.72310.81830.76140.8615
7200.86290.99250.87551.00710.85160.97960.86840.99890.92731.06661.05991.21920.95711.10090.99801.14790.89301.0273
Perm240.50270.50710.53950.54430.51380.51840.51900.52360.51960.52430.70280.70910.52610.53080.55560.56050.58580.5910
480.55160.55820.63850.64610.55860.56530.56320.57000.56580.57250.70370.71210.57880.58580.60760.61490.62970.6372
960.60830.61870.70380.71590.61080.62120.61770.62820.62250.63320.77850.79180.64160.65260.66400.67530.71580.7280
1920.67910.69700.73940.75890.67580.69370.68200.70000.68970.70790.77650.79700.70530.72400.73710.75660.76070.7808
3360.73720.76580.80670.83800.72920.75750.73760.76620.74250.77130.81930.85110.74290.77170.77320.80320.82300.8549
7200.87330.93840.91070.97860.86760.93230.87640.94170.84300.90590.93861.00860.81970.88080.83640.89880.87030.9352
P240.41220.59750.43890.63620.41520.60180.41810.60610.41720.60480.64370.93310.40800.59140.41780.60570.42060.6097
480.44580.64820.52800.76770.44990.65420.45220.65750.45270.65820.64870.94330.44260.64350.45240.65780.45890.6673
960.49630.72340.56910.82950.49920.72750.50270.73270.50290.73290.70651.02970.49500.72140.51030.74380.51120.7450
1920.56070.82060.61510.90030.56090.82090.56390.82530.56260.82330.68641.00470.55440.81150.57860.84680.60290.8824
3360.60250.88620.67580.99410.59980.88220.60330.88730.60780.89400.68111.00180.59010.86800.62290.91620.64010.9415
7200.65920.98260.74471.11020.65520.97670.65960.98330.69351.03390.85651.27690.67751.00990.75141.12020.73181.0909
pH240.48360.44960.54960.51100.51150.47550.49310.45840.50890.47310.67950.63170.51070.47480.52770.49060.59410.5523
480.54210.50390.65690.61070.56210.52260.54920.51060.56670.52690.84100.78180.57330.53300.58990.54840.67840.6307
960.62490.58070.75510.70170.63950.59430.63180.58710.65250.60630.82210.76390.66010.61340.68220.63390.79400.7378
1920.73660.68280.83690.77570.74630.69180.74070.68660.76150.70590.89320.82790.77200.71560.78600.72860.89710.8316
3360.83670.77390.95230.88080.84670.78310.83890.77590.87030.80490.91220.84370.89030.82340.91460.84600.98840.9142
7200.96540.90081.09461.02140.98070.91510.96960.90471.06910.99771.08261.01021.20241.12201.21781.13641.24031.1573
Tur240.53260.69010.56310.72960.53480.69300.54050.70030.54080.70070.65590.84990.52760.68360.54190.70220.53590.6944
480.57190.74310.66670.86620.57440.74630.58410.75880.57860.75180.68560.89080.56560.73490.57710.74980.57520.7473
960.61630.80390.72810.94970.61600.80350.61740.80520.62030.80900.72880.95060.60400.78780.63420.82710.62590.8163
1920.65550.86440.76811.01290.65430.86280.65440.86290.65730.86680.70940.93550.63850.84200.65710.86650.75831.0000
3360.67270.89950.74500.99630.67110.89740.67120.89760.68230.91240.76211.01920.66150.88460.69150.92470.93931.2561
7200.72380.97790.82901.12010.72190.97530.72450.97890.73780.99680.86081.16290.78711.06340.79621.07561.03761.4019
Temp240.16360.28880.18170.32070.16610.29330.16580.29270.18910.33390.23290.41110.16280.28750.16680.29450.17240.3044
480.20040.35470.21460.37990.19440.34410.20110.35600.20880.36960.40860.72340.19170.33930.19710.34890.23040.4080
960.24750.44150.28290.50460.24050.42900.25880.46170.25310.45140.35810.63880.23360.41670.25390.45300.35030.6249
1920.33140.60010.29980.54290.29640.53660.33610.60850.30920.55980.91431.65550.28980.52480.29640.53680.41920.7591
3360.43600.80460.37910.69950.35590.65680.44170.81510.39980.73780.85241.57290.37680.69520.36040.66500.45840.8458
7200.63711.23650.62831.21930.49470.96000.63421.23080.75271.46081.50892.92840.73061.41790.77861.51110.79861.5499
Cond240.48830.52060.52550.56020.50110.53420.48520.51730.50220.53540.55150.58800.50000.53310.50780.54130.51560.5496
480.51940.55430.59940.63960.53030.56590.51700.55180.53280.56860.61650.65800.52710.56250.53700.57310.55390.5911
960.56120.59900.66740.71230.57050.60890.56290.60090.57640.61520.65280.69680.56710.60540.58720.62680.60540.6462
1920.63170.67310.72950.77740.63710.67890.63190.67330.64350.68570.76830.81870.64080.68280.64670.68910.69510.7407
3360.69230.73600.81170.86300.69640.74040.69200.73570.71360.75870.79200.84200.71300.75800.72020.76570.83100.8835
7200.80820.85450.94591.00010.80220.84810.80270.84870.90320.95491.10471.16790.90350.95520.97811.03410.98381.0401
Avg.0.59410.69410.66810.77620.59430.69010.59860.69940.61260.71470.76130.91390.61340.71210.63600.73830.68270.7949
Avg. Rank2.332.337.197.192.962.963.543.544.504.508.378.373.073.075.695.697.357.35
Table A2. Cross-variable forecasting results using GPI metric. Each entry reports GPI_abs. Input length is 96. Best results are in bold, second best are in underline.
Table A2. Cross-variable forecasting results using GPI metric. Each entry reports GPI_abs. Input length is 96. Best results are in bold, second best are in underline.
VariableHorizonHarmonicFormer
(Ours)
TimesNet
(ICLR 2023) [28]
FreqCycle
(AAAI 2026) [34]
PhaseFormer
(ICLR 2026) [35]
DLinear
(AAAI 2023) [36]
Autoformer
(NIPS 2021) [18]
GWN
(IJCAI 2019) [39]
ASTGCN
(AAAI 2019) [40]
STGCN
(IJCAI 2018) [23]
GPI_abs GPI_abs GPI_abs GPI_abs GPI_abs GPI_abs GPI_abs GPI_abs GPI_abs
AN240.11020.19250.22880.27970.791626.78851.70222.835721.6364
480.56970.69521.20070.30624.17135.98909.974123.146044.9319
963.80696.53793.68625.144715.859211.443825.211855.601779.2561
19217.146014.644012.10345.760358.820116.7574115.186098.2085342.5202
33626.184410.576117.248127.2394141.7310141.2164204.6088176.9115346.9314
720195.18771.786947.8944199.0816445.5295803.5205404.6067518.8139599.5185
N240.03510.00000.01310.17020.36130.04470.13401.48260.0003
480.06410.09580.06160.32661.87477.11710.49970.00732.2826
960.05951.12620.07260.05197.63540.64449.09480.373511.9054
1920.80434.10830.14030.055035.85240.000156.294755.1332213.4563
3360.007821.71110.00980.0628116.30060.0047192.8615389.3440512.0277
7209.74653.97341.550116.1118801.78364.18301565.28822851.11133010.2128
DO240.22870.00740.03290.29600.21570.22020.14930.02640.9383
480.11150.05780.02670.19711.20860.00000.02312.17548.0394
960.59391.68740.00032.24746.77742.95903.673417.248038.1391
1922.753832.19700.29082.709344.7059438.68339.614684.539939.7899
3361.001579.00321.59820.3901224.35711339.805744.9912154.532510.8243
72076.13411366.511668.095678.98944657.4325425.13513658.23378167.23962795.7935
Perm240.13210.02630.37951.09850.33983.34970.02000.01200.0409
481.39170.03721.76751.39801.78310.18340.13530.31480.0821
967.24960.00875.75568.21285.005025.33383.05460.08185.0804
19236.80880.234630.448338.022621.03520.72090.425735.707829.2690
336130.84798.4887108.5664124.936046.155187.88666.174017.4011138.8716
720989.840299.9727963.81461022.4874258.6467416.8387599.1480983.04563332.3403
P240.00030.02880.06880.32531.154410.39210.03780.04620.1076
480.00270.01260.21310.18005.8013108.69741.418214.166410.4714
960.13070.21850.70740.134416.849081.65517.209084.473239.6755
1921.73790.44623.89851.635888.0964129.556654.705642.688685.5319
3364.500665.624511.19645.5332252.3296815.6277118.2594772.8632769.3215
7208.8062427.380645.58257.46611523.14154410.747710,474.93804957.30175222.6942
pH240.59830.02130.01340.64130.99912.16111.49855.00245.7742
481.02510.05210.05091.47425.26100.41742.703122.309818.8522
965.05470.17700.86097.823224.715645.078225.326383.73695.9515
19215.789423.91511.332722.2747128.5219316.485396.6469190.280918.5577
33626.0927111.38720.461749.6234435.7817398.9661620.78821113.1331905.8134
720123.7476708.11866.2206125.93974998.42841225.132646,714.753511,766.859522,619.9673
Tur240.18240.06840.11230.01191.87229.73220.41351.38940.0109
480.01491.12500.35680.02918.604049.91349.274627.66998.8936
960.15577.73520.21620.967028.388012.475014.6568115.270384.5976
19213.733310.31300.826913.6116102.17068.863942.8517203.4249580.5209
3364.5038168.86990.13863.0350272.7931578.0640520.8020474.729915392.1793
72010.2031862.43600.83778.6210913.66292833.40786993.24881125.580158,975.3268
Temp240.00400.10970.00220.01200.00180.16550.00020.01990.0065
480.01140.07380.00190.00860.032417.47980.04310.50240.0628
960.08060.92530.01430.57630.545639.41670.07490.068410.4214
1924.66773.55980.14616.11484.798849.849317.06741.5001101.5003
33654.763032.93421.274281.230153.34828173.8849308.576116.3838320.7105
720873.8195843.526750.90081496.67109671.6638343,420.135312,871.493816,840.108830,823.8448
Cond240.04310.48490.02370.08010.371721.87880.00312.41860.0108
480.00152.15520.12590.01172.3634530.52200.38214.04395.6052
963.22757.98471.00381.363310.5444627.33799.033420.10749.3834
1924.332211.27037.46036.998454.5658351.905619.059971.825644.5876
33646.3262173.171938.764434.1752218.35091559.0175239.8393333.0293392.8412
720495.77922955.3679398.9614417.05332301.694427,982.016718,133.00486187.77836221.5995
Avg.59.2621149.503234.014170.9110518.98567362.40391929.80031076.18532856.6428
Avg. Rank3.303.432.633.935.896.725.526.567.04

References

  1. Li, L.; Knapp, J.L.A.; Lintern, A.; Ng, G.-H.C.; Perdrial, J.; Sullivan, P.L.; Zhi, W. River water quality shaped by land–river connectivity in a changing climate. Nat. Clim. Change 2024, 14, 225–237. [Google Scholar] [CrossRef] [Scilit]
  2. Wu, J.; Cheng, S.-P.; He, L.-Y.; Wang, Y.-C.; Yue, Y.; Zeng, H.; Xu, N. Assessing water quality in the Pearl River for the last decade based on clustering: Characteristic, evolution and policy implications. Water Res. 2023, 244, 120492. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  3. Chidiac, S.; El Najjar, P.; Ouaini, N.; El Rayess, Y.; El Azzi, D. A comprehensive review of water quality indices (WQIs): History, models, attempts and perspectives. Rev. Environ. Sci. Bio/Technol. 2023, 22, 349–395. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  4. Zhi, W.; Appling, A.P.; Golden, H.E.; Podgorski, J.; Li, L. Deep learning for water quality. Nat. Water 2024, 2, 228–241. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  5. Bi, J.; Wang, Z.; Yuan, H.; Wu, X.; Wu, R.; Zhang, J.; Zhou, M.C. Long-term water quality prediction with transformer-based spatial-temporal graph fusion. IEEE Trans. Autom. Sci. Eng. 2025, 22, 11392–11404. [Google Scholar] [CrossRef] [Scilit]
  6. Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  7. Pyo, J.; Pachepsky, Y.; Kim, S.; Abbas, A.; Kim, M.; Kwon, Y.S.; Ligaray, M.; Cho, K.H. Long short-term memory models of water quality in inland water environments. Water Res. X 2023, 21, 100207. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  8. Hu, Z.; Zhang, Y.; Zhao, Y.; Xie, M.; Zhong, J.; Tu, Z.; Liu, J. A water quality prediction method based on the deep LSTM network considering correlation in smart mariculture. Sensors 2019, 19, 1420. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  9. Cho, K.; Van Merriënboer, B.; Gulçehre, Ç.; Bahdanau, D.; Bougares, F.; Schwenk, H.; Bengio, Y. Learning phrase representations using RNN encoder–decoder for statistical machine translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP); Association for Computational Linguistics: Stroudsburg, PA, USA, 2014; pp. 1724–1734. [Google Scholar]
  10. Sutskever, I.; Vinyals, O.; Le, Q.V. Sequence to sequence learning with neural networks. In Proceedings of the Advances in Neural Information Processing Systems; Curran Associates, Inc.: Red Hook, NY, USA, 2014. [Google Scholar]
  11. Bai, S.; Kolter, J.Z.; Koltun, V. An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv 2018, arXiv:1803.01271. [Google Scholar]
  12. Wang, Z.; Duan, L.; Shuai, D.; Qiu, T. Research on water environmental indicators prediction method based on EEMD decomposition with CNN-BiLSTM. Sci. Rep. 2024, 14, 1676. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  13. Bahdanau, D.; Cho, K.; Bengio, Y. Neural machine translation by jointly learning to align and translate. In Proceedings of the International Conference on Learning Representations (ICLR), San Diego, CA, USA, 7–9 May 2015. [Google Scholar]
  14. Chen, H.; Yang, J.; Fu, X.; Zheng, Q.; Song, X.; Fu, Z.; Wang, J.; Liang, Y.; Yin, H.; Liu, Z.; et al. Water quality prediction based on LSTM and attention mechanism: A case study of the Burnett River, Australia. Sustainability 2022, 14, 13231. [Google Scholar] [CrossRef] [Scilit]
  15. Rahman, A.; Syeed, M.M.M.; Fatema, K.; Karim, M.R.; Khan, R.H.; Hossain, M.S.; Uddin, M.F. An enhanced multi-head attention-based LSTM model for forecasting the surface water quality index. Water Pract. Technol. 2025, 20, 896–914. [Google Scholar] [CrossRef] [Scilit]
  16. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł.; Polosukhin, I. Attention is all you need. In Proceedings of the Advances in Neural Information Processing Systems; Curran Associates, Inc.: Red Hook, NY, USA, 2017; Volume 30. [Google Scholar]
  17. Zhou, H.; Zhang, S.; Peng, J.; Zhang, S.; Li, J.; Xiong, H.; Zhang, W. Informer: Beyond efficient transformer for long sequence time-series forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence; AAAI Press: Washington, DC, USA, 2021; Volume 35, pp. 11106–11115. [Google Scholar]
  18. Wu, H.; Xu, J.; Wang, J.; Long, M. Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting. In Proceedings of the Advances in Neural Information Processing Systems; Curran Associates, Inc.: Red Hook, NY, USA, 2021; Volume 34, pp. 22419–22430. [Google Scholar]
  19. Nie, Y.; Nguyen, N.H.; Sinthong, P.; Kalagnanam, J. A time series is worth 64 words: Long-term forecasting with transformers. In Proceedings of the International Conference on Learning Representations (ICLR), Kigali, Rwanda, 1–5 May 2023. [Google Scholar]
  20. Liu, Y.; Hu, T.; Zhang, H.; Wu, H.; Wang, S.; Ma, L.; Long, M. iTransformer: Inverted transformers are effective for time series forecasting. In Proceedings of the International Conference on Learning Representations (ICLR), Vienna, Austria, 7–11 May 2024. [Google Scholar]
  21. Kipf, T.N.; Welling, M. Semi-supervised classification with graph convolutional networks. In Proceedings of the International Conference on Learning Representations (ICLR), Toulon, France, 24–26 April 2017. [Google Scholar]
  22. Veličković, P.; Cucurull, G.; Casanova, A.; Romero, A.; Liò, P.; Bengio, Y. Graph attention networks. In Proceedings of the International Conference on Learning Representations (ICLR), Vancouver, BC, Canada, 30 April–3 May 2018. [Google Scholar]
  23. Yu, B.; Yin, H.; Zhu, Z. Spatio-temporal graph convolutional networks: A deep learning framework for traffic forecasting. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence (IJCAI); Curran Associates, Inc.: Red Hook, NY, USA, 2018; pp. 3634–3640. [Google Scholar]
  24. Zhu, Q.; Shen, Z.; Wu, Z.; Zhang, H.; Yuan, J.; Chen, Y. Temporal-relational graph neural network for nearshore seawater quality parameters multivariate multi-step prediction and correlation modelling. Expert Syst. Appl. 2025, 265, 126020. [Google Scholar] [CrossRef] [Scilit]
  25. Yuan, M.; Li, Y.; Zhang, L.; Zhao, W.; Zhang, X.; Li, J. Rapid prediction approach for water quality in plain river networks: A data-driven water quality prediction model based on graph neural networks. Water 2025, 17, 2543. [Google Scholar] [CrossRef] [Scilit]
  26. Zhou, T.; Ma, Z.; Wen, Q.; Wang, X.; Sun, L.; Jin, R. FEDformer: Frequency enhanced decomposed transformer for long-term series forecasting. In Proceedings of the International Conference on Machine Learning (ICML); Proceedings of Machine Learning Research: Baltimore, MD, USA, 2022; pp. 27268–27286. [Google Scholar]
  27. Liu, S.; Yu, H.; Liao, C.; Li, J.; Lin, W.; Liu, A.X.; Dustdar, S. Pyraformer: Low-complexity pyramidal attention for long-range time series modeling and forecasting. In Proceedings of the International Conference on Learning Representations (ICLR), Virtual, 3–7 May 2021. [Google Scholar]
  28. Wu, H.; Hu, T.; Liu, Y.; Zhou, H.; Wang, J.; Long, M. TimesNet: Temporal 2D-variation modeling for general time series analysis. In Proceedings of the International Conference on Learning Representations (ICLR), Kigali, Rwanda, 1–5 May 2023. [Google Scholar]
  29. Jitha, P.; Vijaya, M.S. Temporal fusion transformer: A deep learning approach for modeling and forecasting river water quality index. Int. J. Intell. Syst. Appl. Eng. 2023, 11, 277–293. [Google Scholar]
  30. Ramya, S.; Srinath, S.; Tuppad, P. Data driven multi-stage transformer based framework for intelligent water quality monitoring. Sci. Rep. 2025, 15, 41680. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  31. Graziano, A.P.; Jones, R.C. Diel and seasonal patterns in continuously monitored water quality at fixed sites in two adjacent embayments of the tidal freshwater Potomac River. Water 2017, 9, 624. [Google Scholar] [CrossRef] [Scilit]
  32. Deng, L.; Chen, K.; Liu, Z.; Wu, B.; Chen, Z.; He, S. Spatiotemporal variation evaluation of water quality in middle and lower Han River, China. Sci. Rep. 2022, 12, 14125. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  33. Ding, X.; Chen, Y.; Zeng, H.; Du, Y. Time series prediction of water quality based on NGO-CNN-GRU model: A case study of Xijiang River, China. Water 2025, 17, 2413. [Google Scholar] [CrossRef] [Scilit]
  34. Zhang, B.; Yin, S.; Zhu, H.; He, X. FreqCycle: A Multi-Scale Time-Frequency Analysis Method for Time Series Forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence (AAAI), Singapore, 20–27 January 2026. [Google Scholar]
  35. Niu, Y.; Deng, J.; Tong, Y. PhaseFormer: From patches to phases for efficient and effective time series forecasting. In Proceedings of the International Conference on Learning Representations (ICLR), Rio de Janeiro, Brazil, 23–27 April 2026. [Google Scholar]
  36. Zeng, A.; Chen, M.; Zhang, L.; Xu, Q. Are transformers effective for time series forecasting? In Proceedings of the AAAI Conference on Artificial Intelligence (AAAI), Washington, DC, USA, 7–14 February 2023. [Google Scholar]
  37. Kim, T.; Kim, J.; Tae, Y.; Park, C.; Choi, J.-H.; Choo, J. Reversible Instance Normalization for Accurate Time-Series Forecasting against Distribution Shift. In Proceedings of the International Conference on Learning Representations (ICLR), Virtual, 25–29 April 2022. [Google Scholar]
  38. Maroufi, H.; Mehdinejadiani, B. A comparative study on using metaheuristic algorithms for simultaneously estimating parameters of space fractional advection-dispersion equation. J. Hydrol. 2021, 602, 126757. [Google Scholar] [CrossRef] [Scilit]
  39. Wu, Z.; Pan, S.; Long, G.; Jiang, J.; Zhang, C. Graph WaveNet for Deep Spatial-Temporal Graph Modeling. In Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence (IJCAI-19), Macao, China, 10–16 August 2019. [Google Scholar]
  40. Guo, S.; Lin, Y.; Feng, N.; Song, C.; Wan, H. Attention Based Spatial-Temporal Graph Convolutional Networks for Traffic Flow Forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence (AAAI), Honolulu, HI, USA, 27 January–1 February 2019. [Google Scholar]
Figure 1. Overall architecture of the proposed HarmonicFormer.
Figure 1. Overall architecture of the proposed HarmonicFormer.
Water 18 02005 g001
Figure 2. Spatiotemporal variation of dissolved oxygen in the Pearl River Basin (2025).
Figure 2. Spatiotemporal variation of dissolved oxygen in the Pearl River Basin (2025).
Water 18 02005 g002
Figure 3. Performance-efficiency trade-off of different models on water quality forecasting.
Figure 3. Performance-efficiency trade-off of different models on water quality forecasting.
Water 18 02005 g003
Figure 4. Average MSE and MAE of different models across all 54 configurations.
Figure 4. Average MSE and MAE of different models across all 54 configurations.
Water 18 02005 g004
Figure 5. Comparison of MSE across prediction horizons for three representative parameters: (a) total nitrogen; (b) pH; (c) conductivity. All three subfigures compare HarmonicFormer with GWN, ASTGCN, and STGCN over six prediction horizons (24, 48, 96, 192, 336, and 720 steps).
Figure 5. Comparison of MSE across prediction horizons for three representative parameters: (a) total nitrogen; (b) pH; (c) conductivity. All three subfigures compare HarmonicFormer with GWN, ASTGCN, and STGCN over six prediction horizons (24, 48, 96, 192, 336, and 720 steps).
Water 18 02005 g005
Figure 6. MSE and MAE trends across prediction horizons for three representative parameters: (a) pH; (b) dissolved oxygen; (c) conductivity.
Figure 6. MSE and MAE trends across prediction horizons for three representative parameters: (a) pH; (b) dissolved oxygen; (c) conductivity.
Water 18 02005 g006
Figure 7. Comparison of model predictions and true values at different prediction horizons: (a) 24-step; (b) 48-step; (c) 96-step predictions.
Figure 7. Comparison of model predictions and true values at different prediction horizons: (a) 24-step; (b) 48-step; (c) 96-step predictions.
Water 18 02005 g007
Figure 8. Training and validation loss convergence curves for pH (a) and conductivity (b).
Figure 8. Training and validation loss convergence curves for pH (a) and conductivity (b).
Water 18 02005 g008
Table 1. Statistical Summary of Water Quality Parameters.
Table 1. Statistical Summary of Water Quality Parameters.
ParameterUnitMeanStdMinMaxMissing Rate (%)
Water Temperature°C24.3894.7920.00038.2600.23%
pH7.4930.5514.05010.6700.37%
Dissolved Oxygenmg/L7.1412.0660.00529.3700.23%
Ammonia Nitrogenmg/L0.1210.2290.00022.2042.37%
Total Nitrogenmg/L2.4491.0270.00048.3822.09%
Total Phosphorusmg/L0.0700.0490.0002.4311.61%
ConductivityμS/cm1330.6153433.9250.00137,565.1101.67%
Permanganate Indexmg/L2.7681.7470.00047.0541.51%
TurbidityNTU42.75386.1540.0018934.3450.31%
Table 2. Cross-variable forecasting results. Each entry reports MSE and MAE. Input length is 96. Best results are in bold, second best are in underline.
Table 2. Cross-variable forecasting results. Each entry reports MSE and MAE. Input length is 96. Best results are in bold, second best are in underline.
VariableHorizonHarmonicFormer
(Ours)
TimesNet
(ICLR 2023) [28]
FreqCycle
(AAAI 2026) [34]
PhaseFormer
(ICLR 2026) [35]
DLinear
(AAAI 2023) [36]
Autoformer
(NIPS 2021) [18]
GWN
(IJCAI 2019) [39]
ASTGCN
(AAAI 2019) [40]
STGCN
(IJCAI 2018) [23]
MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE MSE MAE
AN240.26400.27430.30810.30530.27880.28360.28540.29620.27460.32480.41900.40230.26810.31280.28990.32670.32300.3573
480.33330.31860.45590.38320.34580.32060.34840.33150.33900.37280.51320.46010.32830.35760.35250.37550.44920.4175
960.44010.37400.60070.44460.45240.37130.44940.38020.43380.43480.67780.54000.41680.41710.44320.43720.59050.4904
1920.59400.44510.76710.50940.60590.43930.59710.44720.54890.50410.74080.53920.53510.49060.55340.50320.62100.5461
3360.73480.50820.92470.57220.75510.50420.73630.50880.64350.56260.88670.59120.63160.55190.63570.53870.68590.5756
7200.82350.55201.03010.62410.85130.55240.82290.55080.75360.63501.06670.69220.73310.62600.76550.64420.81880.6561
N240.20440.26070.24590.30090.21090.27020.21560.27620.21830.29370.38960.44970.21090.27680.23700.29980.30230.3328
480.23600.29190.32790.36070.24080.29850.24520.30370.25660.32900.38660.43850.25560.31710.28950.34410.39370.4006
960.27930.33080.39510.40580.28150.33360.28640.33840.31580.37960.49150.50840.33380.37700.35290.39270.50050.4601
1920.34260.38060.44900.44360.34100.37910.34710.38470.40900.44720.40080.43760.46300.45250.54950.48360.60390.5298
3360.41380.42720.55250.49980.40960.42330.41670.42930.51830.51280.47600.48580.61430.52970.72570.55780.70690.5879
7200.54190.49460.72160.57740.53900.49250.53830.49320.77090.62920.69540.61650.85920.63010.99760.68021.06750.7402
DO240.15150.24620.19310.28500.17180.26690.15810.25340.17240.27750.27160.38130.16540.26660.16620.26730.17860.2820
480.19660.28520.27990.35090.21400.30230.20240.29140.21380.31310.41790.48730.20580.30460.21120.31010.23180.3352
960.27270.34330.38720.41730.28640.35530.27890.34860.28700.37120.44440.49730.27080.35690.29560.38020.31320.3992
1920.38530.41720.46420.46540.39590.42520.38930.42020.38960.44700.57330.57550.36570.42610.40270.44950.43770.4854
3360.51190.49270.60100.53470.51660.49600.51810.49630.51420.53230.74670.66280.51140.52670.52290.52460.60660.5912
7200.74450.62770.76810.61490.72530.61920.75410.63160.85980.71791.22010.85960.91540.73400.99580.77420.79750.6926
Perm240.25270.29440.29560.33240.26400.30520.26940.30650.27000.32950.39200.42240.27670.31540.30860.32840.34320.3377
480.30430.32860.41700.40350.31200.33480.31720.33830.32010.36640.57330.53040.33490.35860.36920.36770.39700.3775
960.37010.36970.49340.44370.37300.37130.38150.37630.38760.41400.63570.56430.41170.40170.44080.41340.51280.4476
1920.46120.42280.55260.47200.45680.41920.46520.42550.47560.47150.60620.53080.49750.44700.54340.47660.57880.5017
3360.54350.46610.65600.52190.53180.46020.54400.46710.55130.51780.65780.56770.55200.48640.59790.51650.67730.5650
7200.76260.56310.83780.60550.75270.55850.76800.56560.71070.60410.92880.70890.67190.57770.69950.59250.75740.6381
P240.16990.24540.19900.27410.17240.25140.17480.25520.17410.27000.39070.45430.16650.25230.17460.26510.17690.2651
480.19880.27380.28060.33660.20240.27830.20450.28170.20490.30220.44510.48390.19590.28550.20470.29470.21060.3036
960.24630.31270.32500.37110.24920.31490.25270.31980.25290.34720.49180.51920.24500.33760.26050.35650.26140.3529
1920.31440.36190.38410.41110.31460.36090.31800.36490.31650.40210.60060.57540.30740.38880.33480.42100.36360.4394
3360.36300.39750.43420.44220.35970.39310.36390.39740.36940.44830.49400.52180.34820.42120.38790.46280.40850.4754
7200.43450.45100.55210.51710.42930.44540.43510.45110.48100.53390.74400.68210.45880.51730.56460.59020.53600.5795
pH240.23380.28160.30030.33270.26160.30540.24310.29300.25900.32530.44670.47420.26080.31130.27850.32710.35290.3670
480.29380.32550.43040.40200.31600.34380.30170.33550.32120.37010.63590.59520.32860.35660.34790.37450.46030.4281
960.39050.38730.57080.47460.40900.40160.39920.39420.42570.43970.77120.64520.43580.42260.46540.44790.63050.5122
1920.54250.46960.71900.54530.55690.48030.54860.47410.57990.52770.78970.62400.59590.50750.61780.52640.80530.5902
3360.70010.54400.91060.62810.71680.55320.70370.54640.75740.61630.83320.65520.79250.60430.83660.62320.97660.6636
7200.93200.64661.22540.74320.96170.65800.94000.65011.14300.76941.25930.83641.44640.85771.48280.87671.53700.9017
Tur240.28360.31110.31810.33630.28600.31340.29210.32350.29240.34240.44920.46620.27830.32470.29370.34940.28720.3332
480.32710.34270.44620.41130.33000.33940.34110.35920.33480.37640.47090.47690.31990.36150.33310.37880.33080.3698
960.37990.38160.52990.45720.37950.37050.38110.38060.38480.41960.49710.48360.36480.39760.40220.45290.39180.4312
1920.42970.41660.55970.47690.42810.40450.42820.41460.43210.46550.50770.48290.40770.43970.43180.46770.57510.5951
3360.45250.43460.56310.49410.45030.42140.45060.43390.46560.50280.56520.53950.43760.48180.47810.52490.88290.7913
7200.52390.48050.69630.56710.52120.46370.52490.48080.54440.57110.74330.65940.61940.62530.63390.63511.07610.9066
Temp240.02680.10350.03480.12130.02760.10590.02750.10580.03580.12850.05670.18210.02650.10730.02780.10980.02970.1182
480.04020.13100.04680.14300.03780.12640.04040.13240.04360.14180.08710.22710.03670.13110.03880.13220.05320.1657
960.06130.16420.08010.18900.05780.15930.06700.17730.06400.17560.11760.27080.05460.16280.06450.17750.12280.2497
1920.10980.23700.09060.20250.08780.20580.11290.24200.09560.22391.16990.68670.08400.21520.08790.20960.17660.3145
3360.19010.32260.14160.24520.12670.25620.19510.32680.15990.29970.27240.39900.14190.29370.12990.26610.20830.3477
7200.40590.49050.32980.36760.24470.37050.40220.48700.56660.58232.10101.32320.53380.56420.60620.60680.63790.6280
Cond240.23850.25100.27510.27900.25110.26490.23540.26490.25220.28330.43730.45180.25000.26600.25770.27740.26580.2868
480.26970.28470.35700.33380.28120.29430.26730.29400.28380.31110.38790.41930.27790.30450.28840.31310.30680.3338
960.31490.32440.45160.38820.32540.33210.31690.33070.33220.35420.53140.51490.32170.34770.34490.36780.36660.3743
1920.39900.39000.54730.45240.40590.39120.39930.39350.41410.41940.52650.50430.41060.42640.41820.43200.48320.4557
3360.47920.44940.65650.51830.48500.44890.47880.45060.50930.48930.77310.65750.50840.49570.51890.48890.69110.5938
7200.65320.53930.90410.64200.64350.54110.64440.53920.81580.65221.21430.86590.81460.65210.95660.70950.96820.7242
Avg.0.38090.37530.48300.42550.38210.37370.38570.38080.40810.42450.61890.54870.41300.41480.44470.43430.50870.4749
Avg. Rank2.652.967.767.432.702.834.064.374.916.578.769.133.245.116.397.007.598.04
Table 3. Average performance summary of auxiliary metrics across all variables and forecasting horizons. Each entry reports the average RMSE, RSE, GPIabs, and the corresponding average ranks. Best results are in bold, second best are in underline. Detailed results for all configurations are provided in Table A1 and Table A2 in the Appendix A.
Table 3. Average performance summary of auxiliary metrics across all variables and forecasting horizons. Each entry reports the average RMSE, RSE, GPIabs, and the corresponding average ranks. Best results are in bold, second best are in underline. Detailed results for all configurations are provided in Table A1 and Table A2 in the Appendix A.
ModelAvg. RMSEAvg. RSEAvg. GPI_absAvg. Rank (RMSE/RSE)Avg. Rank (GPI)
HarmonicFormer0.59410.694159.26212.333.30
TimesNet0.66810.7762149.50327.193.43
FreqCycle0.59430.690134.01412.962.63
PhaseFormer0.59860.699470.91103.543.93
DLinear0.61260.7147518.98564.505.89
Autoformer0.76130.91397362.40398.376.72
GWN0.61340.71211929.80033.075.52
ASTGCN0.63600.73831076.18535.696.56
STGCN0.68270.79492856.64287.357.04
Table 4. Training efficiency comparison. Epoch time is averaged over all available variable-horizon runs. Lower values are better for time and rank.
Table 4. Training efficiency comparison. Epoch time is averaged over all available variable-horizon runs. Lower values are better for time and rank.
ModelRunsAvg. Epoch Time (s)Median Epoch Time (s)Avg. EpochsAvg. Train Time (s)Avg. MSE RankAvg. MAE Rank
HarmonicFormer545.786.618.549.02.652.96
FreqCycle549.6110.699.086.32.702.83
GWN5475.0781.217.4558.93.245.11
PhaseFormer545.525.537.742.64.064.37
DLinear538.208.339.779.44.916.57
ASTGCN54126.09134.697.4936.36.397.00
TimesNet54812.86256.374.03266.57.767.43
STGCN5429.5330.898.1237.97.598.04
Autoformer5476.8264.385.3404.08.769.13
Table 5. Five-seed forecasting performance and uncertainty over forecast steps 193–336.
Table 5. Five-seed forecasting performance and uncertainty over forecast steps 193–336.
VariableHarmonicFormerGWNASTGCNSTGCN
Total Nitrogen MSE193:3360.50560.77400.99780.8493
pH MSE193:3360.88681.14841.17431.0958
Conductivity MSE193:3360.59010.76080.89840.8990
Three-variable Mean MSE0.66080.89441.02350.9480
MSE Reduction by HF (%)26.1%35.4%30.3%
Mean Lead-wise 95% CI Width0.01030.33360.24440.3745
CI-width Reduction by HF (%)96.9%95.8%97.2%
Table 6. Bias–variance decomposition of conductivity during the late forecast segment (steps 193–336).
Table 6. Bias–variance decomposition of conductivity during the late forecast segment (steps 193–336).
ModelMean MSE193:336MSE Reduction by HF (%) Δ Bias 2 Δ Var Identified Mechanism
HarmonicFormer0.5901ReferenceReferenceReference
GWN0.760822.4>0<0Offsetting-bias
ASTGCN0.898434.3>0<0Offsetting-bias
STGCN0.899034.4Dominant increaseNon-dominantBias-dominant
Table 7. Ablation studies of HarmonicFormer on the water quality forecasting benchmark. Each cell reports MSE and MAE under prediction lengths L out { 24 , 48 , 96 } . The best result in each block is highlighted in bold, and the second-best result is underlined.
Table 7. Ablation studies of HarmonicFormer on the water quality forecasting benchmark. Each cell reports MSE and MAE under prediction lengths L out { 24 , 48 , 96 } . The best result in each block is highlighted in bold, and the second-best result is underlined.
StudyVariant L out = 24 L out = 48 L out = 96
MSE MAE MSE MAE MSE MAE
ModuleHarmonicFormer0.05780.18270.09830.23870.16030.3047
w/o Harmonic Enc.0.06390.19140.10350.24390.16760.3121
w/o RevIN0.06050.18520.09820.23370.18370.3282
Period P = 12 0.07180.20790.10850.25390.17290.3194
P = 24 0.05780.18270.09830.23870.16030.3047
P = 48 0.06770.19750.11640.26310.16790.3136
P = 168 0.09900.24520.11870.26700.17120.3189
Routers M = 4 0.05860.18310.09520.23200.15770.3018
M = 8 0.05820.18260.09500.23330.16170.3068
M = 16 0.05780.18270.09830.23870.16030.3047
M = 32 0.06000.18670.09580.23420.16070.3054
Layers N = 1 0.06070.18780.09670.23630.16110.3067
N = 2 0.05780.18270.09830.23870.16030.3047
N = 3 0.06040.18670.09590.23390.15990.3040
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Zhang, C.; Zhou, J.; Liang, Y.; Zhang, C.; Tavares, A.; Bai, J. HarmonicFormer: Cross-Phase Harmonic Modeling for Efficient Long-Term Water Quality Forecasting. Water 2026, 18, 2005. https://doi.org/10.3390/w18162005

AMA Style

Zhang C, Zhou J, Liang Y, Zhang C, Tavares A, Bai J. HarmonicFormer: Cross-Phase Harmonic Modeling for Efficient Long-Term Water Quality Forecasting. Water. 2026; 18(16):2005. https://doi.org/10.3390/w18162005

Chicago/Turabian Style

Zhang, Canjia, Jiajun Zhou, Yanchun Liang, Chunfu Zhang, Adriano Tavares, and Jing Bai. 2026. "HarmonicFormer: Cross-Phase Harmonic Modeling for Efficient Long-Term Water Quality Forecasting" Water 18, no. 16: 2005. https://doi.org/10.3390/w18162005

APA Style

Zhang, C., Zhou, J., Liang, Y., Zhang, C., Tavares, A., & Bai, J. (2026). HarmonicFormer: Cross-Phase Harmonic Modeling for Efficient Long-Term Water Quality Forecasting. Water, 18(16), 2005. https://doi.org/10.3390/w18162005

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop