Unified multi-task learning for hydrological processes using a shared transformer framework Authors: Bekir Z Demiray, Ibrahim Demir Published: 2026 ABSTRACT AbstractMost deep learning studies in hydrology adopt single-task frameworks that address individual variables such as rainfall or streamflow independently, limiting opportunities for shared learning across related environmental processes. This study introduces a unified multi-task, multi-modal deep learning framework capable of performing both 24-hour horizon streamflow forecasting and rainfall temporal super-resolution within a shared architecture. The model employs a shared Transformer encoder with task-specific decoders to integrate temporal and spatial hydrological information within a single architecture. To assess the influence of joint optimization, the same model is also trained individually for each task, enabling direct comparison between single-task and multi-task configurations and performance. Results show that multi-task training improves streamflow forecasting accuracy while maintaining comparable rainfall reconstruction performance relative to individually trained counterparts and established baselines. The framework demonstrates stable streamflow forecasts and hydrologically consistent rainfall reconstructions, highlighting the potential of unified, process-aware architectures for representing multiple components of the hydrological cycle within one coherent learning system.Keywords: Multi-task learning (MTL), Transformer, Hydrology, Streamflow, Rainfall, Deep learning, Multi-modalSubject terms: Climate sciences, Environmental sciences, Hydrology Introduction Hydrological extremes such as floods and droughts pose significant challenges to societies worldwide, causing devastating economic losses, threatening lives, and undermining sustainable water management1. The increasing frequency and intensity of extreme precipitation events, combined with long-term shifts in climate variability, have amplified the demand for accurate and reliable hydrological forecasting systems2,3. Two variables are especially critical in this context: rainfall, which acts as the primary driver of surface hydrological processes, and streamflow, which represents the integrated catchment response. Together, these variables are fundamental to flood forecasting, drought monitoring, reservoir management, and ecological assessments4. However, the ability to accurately capture their dynamics is complicated by both the heterogeneity of hydrological processes and the limitations of available observational datasets. One persistent obstacle in rainfall-driven hydrology lies in the mismatch between temporal and geospatial scales of the data. Rainfall products derived from radars, satellites, or reanalysis are often limited by coarse spatial and temporal resolution, while hydrological processes such as infiltration, runoff generation, and peak flow response evolve at fine temporal scales. Inadequate temporal resolution of rainfall inputs can severely compromise predictive accuracy, as demonstrated by Atencia et al.5, who showed that reducing radar rainfall time resolution degrades the skill of distributed hydrological models. Similarly, streamflow forecasting is strongly dependent on the temporal alignment and fidelity of input forcings: even modest improvements in rainfall resolution can propagate into substantial gains in discharge forecasts. As such, improving the temporal fidelity of rainfall datasets and enhancing streamflow prediction are interconnected priorities in hydrological modeling6. Streamflow forecasting has undergone a paradigm shift over the past decade, largely driven by the adoption of machine learning and deep learning methods7–9. Traditional hydrological models—whether lumped conceptual or distributed physics-based—have provided valuable insights into runoff generation but are constrained by parameter calibration, limited transferability, and reliance on simplifying assumptions about catchment behavior10. In contrast, data-driven methods have demonstrated remarkable capacity to directly learn nonlinear, multi-scale relationships between meteorological inputs, catchment states, and discharge outputs11–13. Among early breakthroughs, recurrent neural networks (RNNs) such as Long Short-Term Memory (LSTM) networks and Gated Recurrent Units (GRUs) gained prominence for their ability to capture long-term dependencies in hydrological time series14–18. By incorporating memory cells and gating mechanisms, these architectures effectively mitigated vanishing gradient issues inherent to classical RNNs, enabling them to model snowmelt dynamics, baseflow recession, and delayed precipitation–discharge relationships. Subsequent studies validated their robustness across diverse hydroclimatic regions, including large-sample prediction settings spanning hundreds of basins19–23. The rise of attention-based models has further accelerated progress. Transformer architectures24 have been successfully adapted to hydrology, with recent studies reporting strong performance in streamflow forecasting tasks25–30. Transformers capture long-range temporal dependencies through self-attention mechanisms, allowing them to simultaneously model short-term rainfall–runoff responses and seasonal or interannual memory effects. Demiray et al.31 demonstrated the effectiveness of a compact Transformer encoder for 24-hour horizon streamflow forecasting, achieving superior performance relative to LSTM and GRU baselines. Similarly, large-basin studies have shown that Transformer-based models can generalize across heterogeneous conditions, offering improved interpretability through attention weights28,32. Beyond attention-based designs, several other architectures have contributed to recent progress in streamflow modeling. Graph neural networks (GNNs) have been used to capture spatial dependencies between interconnected basins and stream gauges, effectively integrating topological and hydrometeorological information33–35. Hybrid approaches that combine physical knowledge with deep learning have also gained traction—for instance, physics-guided neural networks and decomposition–ensemble frameworks that merge data-driven and conceptual hydrological principles36,37. More recently, state-space models such as Mamba38 have been explored for hydrological forecasting39,40, offering an efficient alternative for long-sequence modeling through selective memory mechanisms. These innovations, alongside recurrent and attention-based networks, illustrate the growing methodological diversity in hydrological forecasting. Together, RNNs, Transformers, graph-based, hybrid, and state-space architectures represent a rapidly expanding toolkit that has redefined the state of the art in streamflow prediction. Nevertheless, most studies remain confined to single-task formulations, focusing exclusively on discharge forecasting while neglecting synergies with related hydrological processes. Parallel to the rise of deep learning in streamflow forecasting, considerable attention has been directed toward improving rainfall datasets through temporal super-resolution. Quantitative Precipitation Estimation (QPE) systems, whether derived from weather radar networks or satellite sensors, are foundational for flood forecasting and climate impact studies. However, these systems often produce products at coarse temporal resolutions (e.g., 10–30 min), which may not adequately capture the rapid evolution of convective storms. Interpolating rainfall fields to finer time steps is thus a critical step for enhancing predictive accuracy in hydrological models. Classical approaches to rainfall temporal interpolation include optical flow methods, which estimate pixel-wise motion fields to advection of precipitation patterns forward in time41,42. While physically intuitive, such methods are sensitive to noise, fail under non-linear storm dynamics, and often introduce artifacts. More recently, deep learning has enabled direct frame interpolation for rainfall products by leveraging advances from video super-resolution in computer vision. Sit et al.43 introduced TempNet, a residual CNN designed to generate intermediate rainfall frames between consecutive radar snapshots. TempNet was shown to outperform optical flow–based methods, establishing a baseline for neural network–driven rainfall temporal super-resolution. Building on this foundation, Demiray et al.44 proposed EfficientTempNet, a model based on EfficientNetV2 that integrates modified MBConv and SimpleConv blocks for enhanced efficiency. Applied to the IowaRain dataset, EfficientTempNet achieved superior accuracy relative to TempNet and classical baselines, reducing mean absolute error and improving event-level detection metrics such as Probability of Detection (POD), False Alarm Ratio (FAR), and Critical Success Index (CSI). These improvements underscore the potential of CNN-based temporal super-resolution to provide rainfall inputs that are more suitable for high-resolution hydrological modeling. Despite these advances, rainfall temporal super-resolution research remains relatively nascent, with limited exploration beyond Iowa-based datasets and CNN-family architectures. Furthermore, these studies treat rainfall enhancement as an isolated objective, largely divorced from downstream applications such as streamflow forecasting. This siloed approach overlooks the inherent coupling between precipitation inputs and hydrological responses, constraining progress toward more integrated modeling systems. While most hydrological deep learning studies still follow a single-task paradigm, research in other scientific domains has demonstrated the advantages of multi-task learning (MTL). MTL trains a single model to perform several related objectives simultaneously, leveraging shared representations to enhance generalization, robustness, and efficiency45,46. It has transformed fields such as computer vision and natural-language processing, where large foundation models are jointly optimized for diverse objectives, from image segmentation to language translation47–49. The underlying principle—that tasks with shared structure can mutually benefit from one another—aligns closely with hydrological processes, which are physically coupled across space, time, and variables. Only recently has the hydrological community begun to explore this paradigm. Sadler50 demonstrated that a joint model predicting daily streamflow and water temperature across more than 100 U.S. sites achieved better accuracy and physical consistency than single-task networks. Hu51 extended this idea to simultaneous prediction of streamflow and multiple water-quality parameters using stacked LSTMs, while Li et al.52 integrated CNN-LSTM architectures to estimate runoff and actual evapotranspiration in the Tibetan Plateau. These studies collectively show that shared modeling of physically related variables can strengthen representation learning and exploit process interdependencies. More recently, Demiray and Demir53 investigated a generalized multi-task architecture for daily streamflow and soil-moisture forecasting using Transformer- and state-space-based encoders. By introducing task embeddings rather than task-specific branches, their model demonstrated that a single shared backbone could differentiate distinct hydrological processes without loss of predictive skill. Such results suggest that MTL provides a scalable route toward unified hydrological forecasting systems capable of handling multiple variables and lead times. Despite these early successes, applications of MTL in hydrology remain limited in number and scope—typically constrained to variables with similar temporal characteristics (e.g., daily streamflow and soil moisture) and rarely extending to multimodal data such as radar imagery or gridded precipitation products. A key limitation of existing research is the separation between tasks that rely on fundamentally different data modalities. Rainfall temporal super-resolution and streamflow forecasting exemplify this divide. The former operates on spatially continuous raster data—two-dimensional radar maps describing precipitation intensity over a grid—while the latter focuses on temporally continuous point series representing discharge measured at gauges. These modalities differ not only in data structure and dimensionality but also in the relative emphasis of the dependencies they encode, with rainfall fields exhibiting coupled spatial and temporal dynamics, and river discharge primarily reflecting integrated temporal responses to hydrometeorological forcing. Deep learning has achieved strong results within each modality independently. CNN-based networks such as TempNet43 and EfficientTempNet44 demonstrated that temporal super-resolution of rainfall frames can substantially enhance the quality of precipitation products. Similarly, sequence-modeling approaches including LSTM, GRU, and Transformer architectures have established new standards for short- and medium-range streamflow prediction14,31,54. Yet these efforts remain siloed: rainfall enhancement is treated as a computer-vision problem, and streamflow prediction as a time-series task. As a result, no existing model jointly learns from both spatial and temporal modalities despite their direct physical linkage. The disconnection between modalities limits both scientific understanding and practical forecasting capability. In operational settings, rainfall products are often used as external inputs to hydrological models after separate processing, introducing inconsistencies between datasets and models. A unified framework that jointly trains rainfall temporal refinement and streamflow forecasting within a shared architecture could, in principle, encourage more consistent representation learning across related hydrometeorological processes. Improved temporal characterization of rainfall could enhance streamflow predictions, while hydrological responses could provide indirect supervision for rainfall interpolation. Such an approach would also align with emerging trends in multimodal learning, where models are designed to integrate heterogeneous data sources—text, images, and time series—within a single architecture48,55. Extending this approach to hydrology represents a critical step toward data-driven environmental intelligence systems that learn across both spatial and temporal dimensions of the water cycle. In this study, we explored a multi-task, multi-modal deep learning framework designed to handle two hydrological tasks—rainfall temporal super-resolution and streamflow forecasting—within a single unified model. Here, temporal super-resolution denotes the interpolation of an intermediate rainfall frame between two temporally adjacent radar observations, rather than general temporal upsampling of an entire sequence. Rather than combining rainfall and streamflow inputs concurrently, the model processes one task at a time, receiving either spatial rainfall maps or temporal hydrological sequences depending on the designated objective. A shared encoder extracts generalizable hydrometeorological representations, while two task-specific heads are used for prediction. One reconstructs temporally refined rainfall maps, and the other forecasts hourly streamflow over a 24-hour horizon. This formulation enables the model to share and transfer knowledge across related yet distinct modalities, allowing improvements learned in one task to inform the other and encouraging more coherent hydrological representation learning across spatial and temporal domains. Both tasks are evaluated on datasets from the state of Iowa to maintain consistency in data quality and physical interpretation. The rainfall component builds upon the IowaRain dataset used in TempNet43 and EfficientTempNet44, while the streamflow component focuses on the Clarinda gauge in the WaterBench dataset, representing a 24-hour horizon hourly prediction problem. The model is trained end-to-end with an adaptive loss formulation that balances task performance based on gradient magnitudes. In addition to the joint training configuration, single-task versions of the same architecture are trained separately to isolate the effects of multi-task learning and provide a controlled comparison with conventional single-task approaches. The main contributions of this study are threefold. First, we propose a unified multi-task deep learning framework built around a shared Transformer encoder that learns common representations across spatial rainfall maps and temporal streamflow series within a single architecture, advancing representation learning across heterogeneous hydrological data modalities. Second, the proposed model is trained both jointly and individually on two complementary objectives—rainfall temporal super-resolution and 24-hour horizon hourly streamflow forecasting—demonstrating that shared hydrometeorological representations can maintain or enhance predictive consistency across domains. Third, we benchmark the framework against established baseline models, including Transformer-based streamflow predictors31 and CNN-based rainfall networks43,44, providing a quantitative assessment of the trade-offs between joint and independent training strategies. Overall, the results confirm the feasibility of multi-task learning across heterogeneous hydrological modalities, demonstrating that a single shared architecture can effectively process distinct data types without loss of accuracy. By jointly training rainfall and streamflow tasks within one unified framework, this study moves beyond variable-specific forecasting toward a more holistic, process-aware paradigm for hydrological modeling. The findings suggest that shared representation learning can help narrow the gap between remote-sensing observations and in-situ hydrological predictions, paving the way for scalable, data-driven models of the water cycle. The remainder of this paper is organized as follows. Section 2 describes the datasets employed in this study, detailing the rainfall and streamflow observations and the preprocessing steps applied. Section 3 outlines the methodological framework, including the proposed multi-task architecture, baseline configurations, and the evaluation metrics used to assess performance. Section 4 presents and analyzes the experimental results, comparing the proposed framework with single-task benchmarks. Finally, Sect. 5 summarizes the key findings and highlights potential avenues for future research. Dataset This study focuses on two hydrological prediction tasks—hourly streamflow forecasting and rainfall temporal super-resolution—using independent datasets tailored for data-driven modeling. Both datasets provide high-quality, open-access hydrometeorological observations that are widely used in deep learning research. The selection of these datasets enables consistent data quality and sufficient temporal coverage for evaluating the proposed multi-task framework. Streamflow dataset The streamflow forecasting task employs the WaterBench dataset56, a standardized benchmark developed for flood and streamflow prediction research following the FAIR (findable, accessible, interoperable, and reusable) data principles. WaterBench consolidates hydrometeorological variables such as streamflow, precipitation, watershed area, slope, soil type, and evapotranspiration from multiple federal and state agencies, including NASA, NOAA, U.S. Geological Survey (USGS), and Iowa Flood Center. Its structure is optimized for machine learning applications and includes benchmark results from various deep learning architectures to facilitate fair comparison across studies. In this study, only the USGS 06817000 station on the Nodaway River at Clarinda, Iowa was used. This single-station setup was selected to keep the dataset size consistent with the rainfall task while maintaining sufficient temporal coverage for model training. The dataset spans October 2011 to September 2018, providing continuous hourly discharge and meteorological records. Following Demiray et al.31, data from October 2011 to September 2017 were used for training, 15% of the remaining data were allocated for validation, and the rest for testing. For this investigation, the model input consisted of a 96-hour sequence comprising: (i) historical discharge values from the preceding 72 h, and (ii) forecast precipitation and evapotranspiration for the subsequent 24-hour horizon. This resulted in an input tensor of dimension [batch size,96,3], where the three features correspond to discharge, precipitation, and evapotranspiration. All continuous variables were normalized using a Min–Max scaling approach. Scaling parameters were computed using the training set only and then applied to validation and test sets to prevent data leakage. Missing values were removed following the original WaterBench preprocessing protocol. Identical preprocessing and input configurations were applied across all models to ensure fair comparison. The dataset and associated benchmark models are publicly available56. Rainfall dataset The rainfall temporal super-resolution task uses the IowaRain dataset57,58, which provides radar-derived quantitative precipitation estimates (QPE) with a 5-minute temporal and 500 m spatial resolution. The dataset covers multiple rainfall events recorded between 2016 and 2019, offering high-frequency radar observations suitable for evaluating temporal interpolation of precipitation fields. To reduce computational cost, a 768 × 768 pixel region from the eastern part of the IowaRain domain was selected and downsampled to a 3 km grid, producing rainfall maps of 128 × 128 pixels. Rainfall events were identified using IowaRain’s event detection criteria, resulting in 82, 83, 90, and 110 events for the years 2016 through 2019, respectively. Following the setup in Demiray et al.44, events prior to 2019 were assigned to the training set, and 2019 events were reserved for testing, yielding 255 training and 110 testing events. Each event was decomposed into three consecutive rainfall frames, corresponding to times. ts−5, ts+5, and ts as shown in Fig. 1. The first two frames served as inputs, while the middle frame (ts) was used as the prediction target, allowing the model to learn intermediate rainfall evolution. This structure produced 19,264 training and 7,762 testing samples, with 15% of the training set used for validation. The data preparation process followed the same configuration as in Demiray et al.44 to ensure comparability with prior rainfall super-resolution studies. Input and output data for rainfall temporal super-resolution task. Methods This section presents the proposed multi-task model, the single-task baselines used for comparison, and the evaluation metrics. Section 3.1 details the unified architecture—task-specific embedders, a shared Transformer encoder, and task-specific heads—along with the training objective and optimization protocol. Section 3.2 summarizes the baseline models for each task and points readers to prior publications for architectural and training specifics. Section 3.3 describes the metrics used to evaluate both the streamflow and rainfall tasks. Unified multi-task model The proposed Multi-Task Model is a unified deep learning framework designed to perform two independent hydrological prediction tasks—(i) hourly streamflow forecasting and (ii) rainfall temporal super-resolution—under a shared architecture. Rather than processing multiple data types simultaneously, the model handles one task at a time, adapting its processing flow according to the input modality. This design enables shared-representation learning across tasks while preserving task-specific specialization, allowing the network to learn generalizable hydrometeorological representations across spatial and temporal domains. The architecture consists of three main components: (i) task-specific embedders that convert raw inputs into latent token representations, (ii) a shared Transformer encoder that captures task-agnostic dependencies, and (iii) task-specific decoder heads responsible for final predictions. Task-Specific Embedders For the streamflow forecasting task, input sequences of meteorological and hydrological variables are represented as tensors of dimension (batch × sequence × features). Each sequence is first projected into a latent embedding space using a linear transformation, followed by sinusoidal positional encoding to preserve temporal ordering. The resulting embeddings are processed by the shared Transformer encoder to model long-term dependencies in the time series. For the rainfall temporal super-resolution task, the input is a four-dimensional tensor (N, 2, H, W), where the two channels correspond to the earlier and later rainfall frames. The rainfall embedding module is a lightweight convolutional encoder composed of updated MBConv59 blocks with max-pool downsampling between stages. This design progressively builds a hierarchy of spatial features, capturing both fine-grained rainfall textures and broader structural patterns. The feature maps from each stage are preserved as skip connections to support high-fidelity reconstruction during decoding. The final, low-resolution feature map is projected through a strided convolutional layer to produce a compact grid of patch tokens, which is flattened into a sequence and augmented with a learned positional embedding before being passed to the shared Transformer encoder. This structure ensures that the Transformer operates on spatially informative tokens rather than raw pixels, effectively linking local spatial detail with global contextual understanding. Shared Transformer Encoder A shared Transformer encoder acts as a modality-agnostic backbone for modeling global dependencies across both tasks. Configured with two layers, four attention heads, and an embedding dimension of 128, it processes token sequences originating from either the rainfall or streamflow embedders. This configuration enables the encoder to capture long-range spatial relationships in rainfall data and complex temporal dynamics in streamflow sequences within a unified representation space. A residual connection—defined as output = input + encoder(input)—is applied to stabilize training and integrate local and global contextual information. Through parameter sharing, the encoder facilitates implicit knowledge transfer between the two related yet distinct hydrological prediction tasks. Task-Specific Heads Following the shared encoder, two independent, task-specific decoder heads translate the context-aware embeddings into the final predictions for their respective domains. For the streamflow forecasting head, a fully connected layer projects the encoded representation into the target output space, producing the 24-hour-ahead discharge predictions. For the rainfall temporal super-resolution head, a U-Net–style decoder reconstructs the high-resolution intermediate rainfall frame. The encoded token sequence is first reshaped into a low-resolution spatial feature map, which is then progressively upsampled to the original resolution through a series of decoder blocks. Each block consists of a transposed convolution for spatial upsampling followed by an updated MBConv block for feature refinement. At every stage, the decoder feature map is concatenated channel-wise with the corresponding skip connection preserved from the rainfall encoder. This design enables the decoder to combine the Transformer’s global contextual information with fine-grained spatial details from the input frames. The network predicts a residual correction that is added to the first input frame, and a final LeakyReLU activation is applied to enforce non-negativity in rainfall intensity, yielding the interpolated rainfall map. Training objective and optimization procedure The model is trained using an uncertainty-weighted multi-task loss that adaptively balances the contributions of the streamflow and rainfall objectives based on their predictive uncertainty. Instead of manually tuning task weights, a learnable log-variance parameter is associated with each task, allowing the model to estimate and adjust their relative importance during training. Tasks with higher uncertainty are automatically downweighted, while those with lower uncertainty are emphasized. The total training loss (Eq. 1) follows the uncertainty-weighted formulation from Kendall et al.60, expressed as: where and denote the mean absolute error losses for the streamflow and rainfall tasks, respectively. The terms are directly optimized for numerical stability, enabling the network to dynamically balance gradients between tasks as their difficulty evolves. Optimization is performed jointly over the model and uncertainty parameters using the AdamW optimizer. The learning rate is set to 3 × 10−4 with a weight decay of 0.01, and both model and loss parameters are included in the optimizer. Training proceeds for 150 epochs with a batch size of 64, alternating batches from the rainfall and streamflow datasets so the shared encoder receives gradient updates from both modalities. A cosine learning-rate scheduler with a 250-step warm-up is employed to improve convergence stability. Early stopping with a patience of 15 epochs monitors the total uncertainty-weighted validation loss to prevent overfitting. This adaptive optimization strategy enables the model to maintain stable training dynamics across heterogeneous tasks and ensures that performance improvements in one domain do not come at the expense of the other. In addition to the joint training setup, the same model architecture was also trained independently for each task to establish single-task baselines. In these experiments, a standard L1 loss was used in place of the uncertainty-weighted formulation, as no task balancing was required. This dual training strategy enables a direct comparison between single-task and multi-task configurations, clarifying the influence of joint optimization on model performance and stability. Baseline methods To evaluate the performance of the proposed framework, results were compared with several established single-task models for both the streamflow forecasting and rainfall temporal super-resolution tasks. The baseline results for each task were obtained from prior studies that used the same datasets, ensuring direct comparability. For the streamflow forecasting task, four baseline models were considered: Persistence, GRU, LSTM, and Transformer. The Persistence model predicts future discharge values by repeating the most recent observation, serving as a simple reference benchmark. The GRU (Gated Recurrent Unit) and LSTM (Long Short-Term Memory) models are recurrent neural networks capable of capturing sequential dependencies in hydrological time series. The Transformer model employs self-attention mechanisms to learn long-range temporal dependencies without recurrence. Although the baseline architectures follow the general structure described in Demiray et al.31, their hidden dimensions and depth were increased in the present study (GRU/LSTM: hidden_dim = 128, num_layers = 4; Transformer: d_model = 128, nhead = 8, num_layers = 2, dim_feedforward = 512) to ensure comparable representational capacity. All neural baselines were trained using the same data splits, preprocessing pipeline, optimizer settings, and training configuration as our single-task model for fair comparison. While the proposed framework also employs a Transformer encoder, its configuration differs from the standalone Transformer baseline in positional encoding strategy, output head design, and architectural scaling; therefore, the baseline Transformer serves as an independent reference model. For the rainfall temporal super-resolution task, four baselines were used: Nearest Frame, Optical Flow, TempNet, and EfficientTempNet. The Nearest Frame method directly selects the most recent frame as the prediction, while the Optical Flow approach estimates pixel-wise motion between input frames to interpolate the intermediate rainfall field. TempNet applies a convolutional encoder–decoder architecture to predict the temporal transition between consecutive rainfall maps, and EfficientTempNet improves upon it with more efficient convolutional blocks and reduced computational complexity. The baseline results for these models were obtained from Demiray et al.44, which provides detailed descriptions of each architecture and its training setup. Performance metrics and evaluation For the streamflow forecasting task, model performance was evaluated using three metrics: Nash–Sutcliffe Efficiency (NSE), Normalized Root Mean Square Error (NRMSE), and Pearson’s correlation coefficient (r). The NSE (Eq. 2) assesses how well the predicted streamflow matches the observed values, with a value of 1.0 indicating perfect agreement and values below 0 suggesting predictions worse than the mean of observations. The NRMSE (Eq. 4) provides a scale-independent measure of model accuracy by normalizing the root mean square error by the mean of the observed discharge, allowing comparison across different flow magnitudes. Pearson’s correlation coefficient (Eq. 3) quantifies the linear relationship between observed and predicted discharges, reflecting the model’s ability to capture the timing and pattern of streamflow variations. Together, these metrics provide a comprehensive evaluation of both the accuracy and consistency of streamflow forecasts across temporal scales. where For the rainfall temporal super-resolution task, four metrics were used: Mean Absolute Error (MAE), Probability of Detection (POD), False Alarm Ratio (FAR), and Critical Success Index (CSI). The MAE measures the average of the absolute differences between the predicted and ground-truth rainfall intensities over the test set, providing an overall measure of pixel-wise reconstruction accuracy. The POD, FAR, and CSI metrics are computed in a binary manner using the number of hits (H), false alarms (F), and misses (M). Here, H represents the number of correctly predicted rainfall cells (true positives), F corresponds to pixels where rainfall was predicted but not observed (false positives), and M indicates missed rainfall occurrences (false negatives). POD (Eq. 5) and CSI (Eq. 7) values closer to 1.0 denote better detection and overall event-level accuracy, whereas lower FAR (Eq. 6) values (approaching 0.0) indicate fewer false detections. All categorical metrics were computed using a rainfall threshold of 0.0001 mm/h, consistent with prior studies44,58. Collectively, these metrics assess both the quantitative precision, and the categorical detection capability of the rainfall interpolation models. Results This section presents and discusses the results of the two hydrological prediction tasks—24-hour horizon streamflow forecasting and rainfall temporal super-resolution—conducted within the proposed multi-task, multi-modal learning framework. The primary aim of the analysis is twofold: first, to assess whether a unified architecture can perform two heterogeneous hydrological tasks simultaneously without a decline in task-specific performance; and second, to explore how multi-task training affects predictive behavior compared to the same model trained individually for each task. For the streamflow forecasting task, comparisons were conducted against Persistence, LSTM, GRU, and Transformer baselines trained under the same data splits and preprocessing pipeline. For rainfall temporal super-resolution, the baselines include Nearest Frame, Optical Flow, TempNet, and EfficientTempNet, as reported in Demiray et al.44. The overall quantitative results are summarized in Tables 1, 2, and 3, and the hourly Nash–Sutcliffe Efficiency (NSE) variations for the streamflow forecasting task are shown in Fig. 2. Table 1Quantitative results for the streamflow prediction task for baseline and proposed models.PersistenceLSTMGRUTransformerOur modelSingle-taskMulti-taskNSE ↑0.480.73 ± 0.060.68 ± 0.040.70 ± 0.040.73 ± 0.050.79 ± 0.03r ↑0.740.86 ± 0.040.82 ± 0.030.85 ± 0.030.88 ± 0.030.91 ± 0.01NRMSE ↓1.230.89 ± 0.110.97 ± 0.070.94 ± 0.060.89 ± 0.080.79 ± 0.06 Quantitative results for the streamflow prediction task for baseline and proposed models. Table 2Additional quantitative results for the streamflow prediction task.LSTMGRUTransformerOur modelSingle-taskMulti-taskNSE High Flow ↑0.502 ± 0.1130.376 ± 0.0580.458 ± 0.0690.516 ± 0.0860.614 ± 0.065NRMSE High Flow↓0.625 ± 0.0720.686 ± 0.0470.655 ± 0.0420.618 ± 0.0570.552 ± 0.046Peak Magnitude Error ↓67.2 ± 25.4036.8 ± 28.7160.9 ± 22.7396.2 ± 83.0442.3 ± 25.15Peak Timing Error ↓4.4 ± 0.5484.8 ± 0.4476.4 ± 3.6466.6 ± 3.2867.8 ± 4.439 Additional quantitative results for the streamflow prediction task. Table 3Quantitative results for the rainfall temporal super-resolution task.MetricNearest frameOptical flowTempNetEfficient TempNetOur modelSingle-taskMulti-taskMAE (mm/h)↓0.630.3240.2720.2080.2110.209CSI ↑0.840.8570.8980.9230.8900.903POD ↑0.9110.9780.9190.9720.9410.913FAR ↓0.08780.1270.02520.05240.05810.011 Quantitative results for the rainfall temporal super-resolution task. Hourly Nash–Sutcliffe Efficiency (NSE) scores over a 24-hour forecast horizon for streamflow prediction models. Table 1 summarizes streamflow prediction performance for all models, reported as mean ± standard deviation across multiple seeds. The comparison across baselines in Table 1 reflects consistent patterns with prior studies, though the results here are specific to the Clarinda station and should not be generalized across regions or sensors. The Persistence model provides a reference (NSE = 0.48, r = 0.74), illustrating the challenge of maintaining predictive accuracy over extended hourly horizons. Among the neural baselines, the LSTM achieves the strongest performance, indicating robust modeling of sequential hydrological dynamics at this station. Although configured with the same depth and hidden dimension, the GRU attains comparatively lower performance, suggesting that the additional gating mechanisms in the LSTM may provide advantages in capturing longer-term dependencies under the current setup. The Transformer demonstrates competitive performance, reflecting its ability to model temporal relationships through attention mechanisms, though it does not surpass the recurrent LSTM architecture in this configuration. The proposed model, when trained solely on the streamflow task, attains NSE = 0.73, r = 0.88, and NRMSE = 0.89 on averages. When trained jointly with rainfall temporal super-resolution, the multi-task configuration achieves NSE = 0.79, r = 0.91, and NRMSE = 0.79. The proposed multi-task model maintains consistency across all metrics while simultaneously performing the rainfall super-resolution task. To assess training stability, both configurations were evaluated across multiple seeds; the multi-task model consistently outperformed the single-task configuration on average, with limited variability across runs (mean ± standard deviation values are provided in Appendix Table 4–15). These results indicate that adding a secondary objective does not reduce streamflow forecasting skill and may enhance overall consistency due to the influence of joint optimization. As the evaluation is limited to a single watershed, these findings should be regarded as indicative rather than conclusive. Table 4Multi-seed streamflow forecasting performance for the single-task configuration (Our model).Metric010100100042MeanStdNSE ↑0.715770.809200.687130.724550.708650.729060.04689r ↑0.904860.903610.896440.864760.842810.882500.02752NRMSE ↓0.913940.748790.958880.899700.925300.889320.08154 Multi-seed streamflow forecasting performance for the single-task configuration (Our model). Table 15Multi-seed rainfall temporal super-resolution performance for the multi-task configuration (Our model).Metric010100100042MeanStdMAE(mm/h)↓0.2150.2170.2130.2160.2090.2140.00316CSI ↑0.8970.8820.9070.8950.9030.89680.00955POD ↑0.9240.890.920.9050.9130.91040.01350FAR ↓0.0320.0090.0150.0110.0110.01560.00942 Multi-seed rainfall temporal super-resolution performance for the multi-task configuration (Our model). To assess hydrological performance beyond aggregate metrics, additional evaluations were conducted focusing on high-discharge behavior and peak characteristics. Table 2 reports high-flow NSE and NRMSE, computed for discharge values exceeding the 90th percentile of observed flows, together with peak magnitude and peak timing errors evaluated over each 24-hour forecast window. Peak magnitude error represents the absolute difference between predicted and observed maximum discharge within a forecast window, while peak timing error denotes the absolute difference in hours between the predicted and observed occurrence of that peak; median values are reported to provide a robust summary across forecast instances. Experiments were conducted across multiple seeds, and the results reported in table correspond to mean ± standard deviation computed from these seed-level statistics. Among the baseline models, LSTM achieves the strongest high-flow NSE (0.502) and the lowest high-flow NRMSE (0.625), indicating relatively stable performance during elevated discharge conditions. GRU and Transformer exhibit comparatively lower high-flow skill (NSE = 0.376 and 0.458, respectively), with relatively higher normalized errors compared to LSTM, reflecting the increased difficulty of modeling extreme discharge conditions. The proposed single-task configuration attains high-flow NSE and NRMSE comparable to the Transformer, but shows higher peak magnitude and timing errors, indicating reduced robustness during extreme discharge events. In contrast, the multi-task configuration achieves the highest high-flow NSE (0.614) and the lowest high-flow NRMSE (0.552) among all models. It also reduces peak magnitude error relative to the single-task configuration, although variability remains across seeds. The peak timing error is slightly higher compared to some baselines, indicating that improvements are more pronounced in magnitude estimation than in temporal alignment. Overall, these results suggest that joint optimization with rainfall temporal super-resolution improves predictive performance under high-flow conditions, particularly in terms of NSE and NRMSE, while highlighting trade-offs in peak magnitude and timing estimation and the inherent variability of event-based metrics. The hourly NSE trajectories plotted in Fig. 2 provide additional insight into model behavior across the 24-hour forecasting horizon. All models exhibit the expected decline in predictive efficiency as the lead time increases, reflecting growing uncertainty in extended hourly forecasting. The Persistence model attains the highest skill at the first hour (NSE ≈ 0.99) but its performance deteriorates rapidly thereafter, becoming unsatisfactory after only before midpoint. Among the neural baselines, the LSTM consistently demonstrates the strongest performance across nearly the entire horizon, maintaining NSE values around 0.70 even at the 24th hour. The GRU shows a similar but slightly lower trajectory, remaining above 0.50 throughout the horizon but declining more steadily over time. The Transformer exhibits competitive early performance (NSE ≈ 0.93 at hour 1) but experiences a more pronounced reduction in efficiency beyond mid-horizon, falling below 0.60 after hour 20. The proposed model, when trained solely on the streamflow task, begins with very high accuracy (NSE ≈ 0.96, very good) and remains above 0.75 for the first 10 h, retaining good skill (NSE > 0.60) through the 16th hour, and gradually decreasing to around 0.50 toward the final hours without a sharp breakdown. In contrast, the multi-task version, which is trained jointly with the rainfall temporal super-resolution task, sustains very good performance (NSE > 0.75) throughout nearly the entire forecast horizon, remaining above this threshold for all but the final hour, where it still achieves an NSE of approximately 0.72. This stability highlights the model’s ability to preserve long-horizon predictive skill while performing two hydrologically distinct tasks simultaneously. The difference between the single- and multi-task models widens progressively across the forecast horizon, as the multi-task configuration maintains steadier accuracy while the single-task model exhibits a sharper loss of efficiency over time. This behavior suggests that joint optimization with the rainfall task enhances temporal consistency and slows the rate of forecast degradation, though broader evaluation across additional basins would be needed to confirm this trend. From a hydrological perspective, the slower decay of the multi-task model’s NSE curve suggests that exposure to rainfall-related learning helps the shared encoder capture broader hydrometeorological dependencies that support more stable streamflow predictions. Although the rainfall and streamflow datasets are independent in this study, both tasks involve precipitation-driven processes, and the shared parameters may learn transferable temporal structures associated with rainfall variability and discharge response. This aligns with the concept of inductive transfer, where training on related tasks promotes the development of generalized representations that improve model stability and temporal coherence, even without explicit physical coupling between datasets. Table 3 presents the quantitative results for the rainfall temporal super-resolution task. Overall, convolution-based deep learning methods outperform motion-based techniques such as Nearest Frame and Optical Flow, which tend to over-smooth rainfall structures and underestimate local intensity variations. Among the baselines, EfficientTempNet achieves the strongest single-task accuracy, consistent with earlier studies. The proposed model, when trained solely on the rainfall task, delivers comparable pixel-wise accuracy and event-detection skill, confirming that the lightweight architecture can reconstruct fine-scale rainfall patterns effectively. When trained jointly with the streamflow forecasting task, the multi-task configuration maintains nearly identical accuracy while improving event discrimination, reflected in higher CSI and a markedly reduced false-alarm ratio. These results indicate that joint training neither compromises nor destabilizes rainfall reconstruction performance; instead, it yields slightly sharper rainfall delineation and fewer spurious detections. This consistency suggests that features learned through shared temporal representations in the encoder contribute to more selective rainfall activation, aligning reconstructed precipitation fields with hydrologically plausible spatial patterns. The proposed framework demonstrates strong flexibility by reproducing rainfall intensity with accuracy comparable to single-task models while also performing streamflow forecasting within the same shared architecture. As shown in Table 3, the model maintains competitive MAE and categorical detection scores (CSI, POD, FAR), indicating that joint training does not compromise rainfall reconstruction performance. This temporal coherence mirrors the stable discharge dynamics observed in the streamflow forecasts. This behavior suggests that the model learns shared hydrometeorological representations that capture complementary spatiotemporal patterns across the two tasks. The shared Transformer encoder serves as the central mechanism enabling this representation sharing, extracting generalizable temporal structures from streamflow sequences and spatial features from rainfall fields. Meanwhile, the uncertainty-weighted loss function ensures that gradients from both objectives are adaptively balanced, promoting stable convergence and preventing one task from overwhelming the shared learning process. Together, these mechanisms allow the model to maintain hydrological realism while enhancing efficiency through cooperative features learning across modalities. The results collectively demonstrate that the model can learn rainfall and streamflow dynamics concurrently within a unified architecture without compromising the accuracy or stability of either task. The joint training process preserved the predictive capability of both domains, while also promoting smoother temporal dynamics and slower error accumulation in streamflow forecasting. Such behavior indicates that the inclusion of rainfall reconstruction as a secondary task may act as a form of implicit regularization, guiding the shared encoder toward representations that are both physically coherent and statistically stable. The observed performance consistency across evaluation metrics suggests that multi-task learning not only matches single-task accuracy but may contribute to improved long-horizon resilience—an aspect particularly relevant for flood forecasting and early warning applications. Although the quantitative improvements are moderate, their consistency across temporal horizons underscores the reliability of the approach, especially in maintaining predictive skill over extended lead times where many data-driven models tend to degrade. These findings, while promising, should be interpreted within the scope of the present study. In particular, more controlled experimental setups would be beneficial to further disentangle the contribution of the multi-task learning formulation from other training-related factors. Such analyses would help clarify whether performance gains arise primarily from shared representation learning or from auxiliary effects related to optimization and training dynamics. In addition, the experiments were conducted using data from a single watershed and rainfall domain, and the two datasets were not physically coupled. Consequently, the transfer of information between tasks arises from shared statistical patterns rather than direct hydrological feedback. Future research could explore physically connected setups in which rainfall super-resolution outputs directly drive streamflow prediction, providing a stronger basis for assessing causal rainfall–runoff relationships. Expanding evaluation to multiple basins and climatic regimes would also help quantify the generalization capacity of the framework, particularly in environments characterized by diverse rainfall–runoff dynamics, snowmelt contributions, or land-use heterogeneity. Such extensions would not only strengthen the empirical validation of multi-task learning in hydrology but also inform how model design can adapt to basin-scale variability and non-stationary hydroclimatic conditions. From a broader perspective, these outcomes emphasize the potential of multi-task architectures to advance process-aware, data-driven hydrological modeling. The consistent performance across metrics and horizons suggests that shared representation learning can produce more physically coherent forecasts, reducing redundancy between independent models while preserving interpretability through common latent representations. This approach offers a foundation for scalable, multi-modal hydrological frameworks capable of incorporating additional components such as soil moisture estimation, evapotranspiration mapping, or flood-inundation prediction. In doing so, it aligns with the growing movement toward integrated Earth system modeling, where data-driven techniques complement traditional physics-based approaches. This study highlights the feasibility and scientific potential of unified, process-aware deep-learning frameworks that integrate multiple components of the hydrological cycle within a single, coherent architecture. In this sense, the work serves as a conceptual step toward holistic, data-informed hydrological models capable of representing complex environmental interactions through shared learning across tasks and modalities. Conclusion This study introduced a unified multi-task, multi-modal deep learning framework capable of performing two distinct hydrological prediction tasks—24-hour horizon streamflow forecasting and rainfall temporal super-resolution—within a single architecture. The framework integrates temporal and spatial information through a shared Transformer encoder with task-specific decoders, enabling joint optimization across heterogeneous data modalities. Comparative experiments demonstrate that the proposed framework not only matches but, in several aspects, outperforms single-task models, maintaining or improving predictive skill across both domains. The results confirm that shared multi-task learning across heterogeneous hydrological modalities can be achieved without compromising accuracy, establishing the feasibility of unified architectures for coordinated prediction across diverse hydrometeorological data types. For the streamflow forecasting task, the multi-task model achieved the highest overall efficiency among all tested configurations, surpassing the Transformer and GRU baselines as well as the single-task version of the same model. It maintained high predictive stability across the 24-hour horizon and exhibited slower degradation in skill over extended lead times. This improvement suggests that joint optimization with rainfall reconstruction provides a regularizing effect, enhancing the temporal consistency of streamflow predictions. In the rainfall temporal super-resolution task, the multi-task configuration achieved accuracy comparable to EfficientTempNet—the strongest convolutional baseline—while yielding fewer false alarms and improved event discrimination. These outcomes indicate that the shared encoder effectively transfers knowledge between tasks, allowing the model to learn complementary hydrometeorological features across heterogeneous data modalities. Importantly, this transfer occurs even though the rainfall and streamflow datasets are not explicitly coupled within the modeling framework, suggesting that the shared encoder captures generalizable hydrometeorological structures beyond task-specific supervision. While promising, the experiments were conducted using data from a single watershed and rainfall domain, and the two datasets were not physically coupled. Model behavior may differ across climatic or geomorphological settings, and further testing across diverse basins is required to assess generalization. As an initial step toward unified multi-task hydrological modeling, this study prioritizes architectural feasibility and controlled comparison under a consistent evaluation protocol; more extensive benchmarking against additional multi-task time-series methods and rainfall nowcasting frameworks represents an important direction for future research. Future work should also extend the framework to physically linked datasets—where rainfall super-resolution outputs directly inform streamflow forecasting—and to additional hydrological variables such as soil moisture, evapotranspiration, and flood inundation mapping. The broader significance of this work lies in establishing a foundation for scalable, process-aware multi-task architectures that unify multiple environmental prediction objectives within a shared learning framework. While the results indicate consistent performance trends, more controlled experiments would be required to fully assess the contribution of the multi-task learning formulation relative to factors such as optimization dynamics or loss weighting, and this will be explored in future work. In this sense, the present study can be viewed as a proof-of-concept for shared representation learning across heterogeneous hydrological tasks. As environmental monitoring and Earth observation systems continue to expand, proposed approach offers a pathway to reduce redundancy among task-specific models while promoting physically consistent and interpretable learning across the hydrological cycle. This study highlights that deep learning in hydrology can advance beyond variable-specific forecasting toward multi-objective, process-oriented modeling, providing a conceptual step toward holistic and interconnected Earth system prediction frameworks. Appendix See Tables 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, and 15. Table 5Multi-seed streamflow forecasting performance for the multi-task configuration (Our model).Metric010100100042MeanStdNSE ↑0.796430.754020.744990.811820.820560.785560.03419r ↑0.909140.888750.915450.911700.912080.907420.01068NRMSE ↓0.773450.850200.865680.743630.726150.791820.06292 Multi-seed streamflow forecasting performance for the multi-task configuration (Our model). Table 6Multi-seed streamflow forecasting performance for GRU.Metric010100100042MeanStdNSE ↑0.692140.647920.626680.737190.684550.677700.04267r ↑0.827920.801450.797330.859760.823330.821960.02497NRMSE ↓0.951161.017171.047400.878810.962800.971470.06505 Multi-seed streamflow forecasting performance for GRU. Table 7Multi-seed streamflow forecasting performance for LSTM.Metric010100100042MeanStdNSE ↑0.689480.652200.707390.803410.777750.726040.06285r ↑0.833250.816150.845390.904860.885760.857080.03703NRMSE ↓0.955251.010970.927290.760060.808150.892340.10469 Multi-seed streamflow forecasting performance for LSTM. Table 8Multi-seed streamflow forecasting performance for Transformer.Metric010100100042MeanStdNSE ↑0.738400.732310.659350.660370.715540.701200.03865r ↑0.876250.869300.814900.815700.854340.846100.02921NRMSE ↓0.876780.886921.000520.999030.914290.935510.06025 Multi-seed streamflow forecasting performance for Transformer. Table 9Multi-seed additional quantitative results for the single-task configuration (Our model).Metric010100100042MeanStdNSE High Flow ↑0.47850.65590.43240.52970.48200.51570.0856NRMSE High Flow↓0.64300.52230.67080.61060.64080.61750.0573Peak Magnitude Error ↓15.15442.10393.216232.8797.73196.21583.943Peak Timing Error ↓3.04.010.06.010.06.63.2863 Multi-seed additional quantitative results for the single-task configuration (Our model). Table 10Multi-seed additional quantitative results for the multi-task configuration (Our model).Metric010100100042MeanStdNSE High Flow ↑0.63840.54620.54290.66280.67830.61370.0647NRMSE High Flow↓0.53540.59980.60200.51710.50510.55190.0461Peak Magnitude Error ↓81.61547.04020.93842.07719.81742.29725.150Peak Timing Error ↓6.015.09.05.04.07.84.4385 Multi-seed additional quantitative results for the multi-task configuration (Our model). Table 11Multi-seed additional quantitative results for LSTM.Metric010100100042MeanStdNSE High Flow ↑0.43510.37090.46990.64280.59250.50220.1126NRMSE High Flow↓0.66920.70620.64830.53220.56840.62490.0723Peak Magnitude Error ↓78.34397.13581.05433.93445.55567.20426.397Peak Timing Error ↓4.05.05.04.04.04.40.5477 Multi-seed additional quantitative results for LSTM. Table 12Multi-seed additional quantitative results for GRU.Metric010100100042MeanStdNSE High Flow ↑0.43410.33990.31500.51630.41520.40410.0801NRMSE High Flow↓0.66980.72340.73690.61930.68090.68610.0467Peak Magnitude Error ↓26.11030.55487.42417.80221.94536.76728.713Peak Timing Error ↓5.05.05.04.05.04.80.4472 Multi-seed additional quantitative results for GRU. Table 13Multi-seed additional quantitative results for Transformer.Metric010100100042MeanStdNSE High Flow ↑0.52940.50890.38000.38910.48010.45750.0690NRMSE High Flow↓0.61080.62400.70110.69600.64200.65480.0415Peak Magnitude Error ↓56.85432.59775.42290.82648.95460.93122.730Peak Timing Error ↓4.05.012.08.03.06.43.6469 Multi-seed additional quantitative results for Transformer. Table 14Multi-seed rainfall temporal super-resolution performance for the single-task configuration (Our model).Metric010100100042MeanStdMAE(mm/h)↓0.2090.2130.210.2150.2110.21160.00241CSI ↑0.910.8890.9130.8920.8890.89860.01189POD ↑0.9240.910.9310.9280.940.92660.01099FAR ↓0.0160.0250.0210.0430.0580.03260.01747 Multi-seed rainfall temporal super-resolution performance for the single-task configuration (Our model). Author contributions Bekir Z. Demiray: Conceptualization, Methodology, Software, Investigation, Formal analysis, Writing—Original Draft, Writing—Review & Editing, Visualization. Ibrahim Demir: Conceptualization, Resources, Writing—Review & Editing, Visualization, Supervision, Project administration. Funding This material is based upon work supported by the Department of Interior (DOI) - US Geological Survey (USGS) under Award No. G25AP00137 and U.S. National Science Foundation (NSF) under Award No. 2243776. Data availability The data used in this study are publicly available at https://github.com/uihilab/HydroMTL-RainStream. Declarations Competing interests The authors declare no competing interests. Declaration of generative AI in scientific writing During the preparation of this work, the author(s) used ChatGPT (OpenAI) to assist in improving the readability and clarity of the manuscript. After using this tool, the author(s) reviewed and edited the content as needed and take full responsibility for the content of the published article. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. References Associated Data Data Availability Statement The data used in this study are publicly available at https://github.com/uihilab/HydroMTL-RainStream.