---
title: 'DPSformer: Dual‑Path SegFormer for Rainfall Correction'
url: https://www.emergentmind.com/topics/dpsformer
type: topic
---

# DPSformer: Dual‑Path SegFormer for Rainfall Correction

DPSformer is a **Dual‑Path Spatial feature‑enhancement SegFormer** designed for short‑range quantitative precipitation forecast correction under a strongly long‑tailed rainfall distribution. It treats heavy rainfall prediction explicitly as a long‑tailed learning problem and attributes poor extreme‑event performance primarily to **insufficient representation of heavy rainfall events**, rather than only to classifier bias. In the reported experiments, DPSformer post‑processes ECMWF TIGGE ensemble control forecasts against TRMM 3B42 V7 observations, and for heavy rainfall events $\geq 50$ mm/6 h it lifts the Critical Success Index (CSI) of the baseline Numerical Weather Prediction (NWP) model from 0.012 to 0.067; for the top 1% coverage of heavy rainfall events, its Fraction Skill Score (FSS) exceeds 0.45 [2509.25208].

## 1. Problem formulation and long-tailed rainfall regime

The forecasting task is a **short‑range quantitative precipitation forecast (QPF) correction** problem. The data sources are the ECMWF TIGGE ensemble control member for forecasts and TRMM 3B42 V7 for observations. The spatial domain is a 64 × 64 grid over a rainfall‑active region of China, spanning 19.5°–35.25°N and 103.5°–119.25°E, with 0.25° × 0.25° grid spacing and 6‑hourly accumulated rainfall. The input tensor contains 27 meteorological predictors from TIGGE, including upper-, mid-, and low-level fields at 500/700/850/925 hPa and surface fields such as 2 m temperature, 10 m wind, total precipitation, total column water, CAPE, and MSLP. The target is 6‑hour accumulated rainfall on the same grid, discretized into six classes using thresholds 0, 0.1, 3, 10, 20, and 50 mm/6 h; levels 4 and 5 correspond to heavy and extreme rainfall [2509.25208].

The paper characterizes the rainfall distribution as a classic **long‑tailed** regime. The probability density is well fit by a gamma distribution, most pixels belong to no‑rain or light‑rain classes, and heavy and extreme rainfall account for only a small fraction of samples. This produces the familiar failure mode in which optimization is dominated by head classes, feature learning is concentrated on common patterns, and predictions for tail classes are biased toward weaker intensities with poor detection and localization.

A central conceptual claim is that heavy rainfall forecasting in this setting is limited by two distinct mechanisms from long‑tailed learning: **representation deficiency** and **classifier bias**. The paper argues that direct transfer of class‑balanced losses, focal loss, logit adjustment, and resampling addresses decision boundaries more than feature quality, and that in rainfall this is inadequate because both training and test distributions are long‑tailed. This suggests that a model specialized for rare-event representation is more appropriate than a classifier-only correction.

## 2. Architectural organization

DPSformer has three main components: a **multi‑scale transformer backbone** based on SegFormer‑b0, a **high‑resolution spatial branch** dedicated to heavy rainfall, and an **adaptive feature fusion** module with learned offsets [2509.25208].

The backbone branch uses convolutional patch embedding and a multi‑scale encoder built from Transformer Blocks with progressive downsampling. Its role is to capture large‑scale atmospheric patterns and common rainfall regimes. It produces multi‑level feature maps denoted $F_b$. The spatial branch uses the same Transformer Block modules but does **not downsample** spatially. Instead, it maintains a fixed high‑resolution pathway, preserving fine‑grained spatial details and convective boundaries. Its output feature maps are denoted $F_s$, and the branch is explicitly trained to focus on heavy rainfall regions.

The model input is a stack of the 27 meteorological variables on a 64 × 64 grid. The output is pixel‑wise multi‑class logits for rainfall levels 0–5; for threshold-based evaluation, the logits are binarized into event versus non-event. The division of labor between branches is explicit: the backbone emphasizes global and multi‑scale structure, whereas the spatial branch acts as a **tail expert branch** for rare heavy-rainfall patterns that can be washed out by backbone downsampling.

Feature fusion is not implemented as simple concatenation. Let $\mathcal{Z}^l$ denote a preliminarily fused feature at level $l$. For each pixel, DPSformer computes a cosine-similarity matrix $\mathcal{S}^l$ with its eight neighbors, then predicts offsets through 3 × 3 convolutions:

$$
\mathcal{D}^l = \mathrm{Conv}_{3\times3}(\mathrm{Concat}(\mathcal{Z}^l,\mathcal{S}^l)),
$$

$$
\mathcal{A}^l = \mathrm{Sigmoid}\big(\mathrm{Conv}_{3\times3}(\mathrm{Concat}(\mathcal{Z}^l,\mathcal{S}^l))\big),
$$

$$
\mathcal{O}^l = \mathcal{D}^l \cdot \mathcal{A}^l,
$$

with $\mathcal{O}^l \in \mathbb{R}^{2G \times H \times W}$, where $G$ is the number of feature groups. The adaptive resampling stage uses these offsets so that groups with coherent strong signals can pull weaker or misaligned features into better alignment, especially at heavy-rainfall boundaries. After fusion, an UpBlock decoder upsamples and aggregates multi-scale fused features to produce the final rainfall logits.

## 3. Long-tail-aware optimization strategy

The optimization scheme couples the dual-branch architecture to a dual-loss design intended to improve representation before classifier calibration [2509.25208]. The overall loss is

$$
\mathcal{L}_{\mathrm{overall}} = (1 - \alpha)\,\mathcal{L}_{\mathrm{main}} + \alpha\,\mathcal{L}_{\mathrm{spatial}},
$$

with $\alpha = 0.5$ in the experiments.

The spatial branch is optimized with a combination of Dice loss and weighted cross-entropy with **Balancing Logit Variation (BLV)**:

$$
\mathcal{L}_{\mathrm{spatial}} = \gamma \cdot \mathcal{L}_{\mathrm{Dice}} + (1 - \gamma) \cdot \mathcal{L}_{\mathrm{WCE}(\hat{z})},
$$

where $\gamma = 0.7$. Dice loss is computed only on **heavy rainfall versus background**: classes 0–3 are merged into background, and classes 4–5 are treated as positive. The weighted cross-entropy uses class weights proportional to $\sqrt{1 / \text{freq}(k)}$. BLV perturbs logits according to

$$
\hat{z}_{i}^{k} = z_{i}^{k} + \frac{c_k}{\max_{j}c_j}\,\mathcal{N}(0,\sigma^{2}),
$$

with

$$
c_k = \log\left(\frac{\sum_{j=0}^{C-1} q_j}{q_k}\right),
$$

and $\sigma = 0.5$. The perturbation magnitude is larger for rare classes, which is intended to promote variability and discourage degenerate low-variance logits.

The main branch uses cross-entropy and Dice loss with **logit adjustment (LA)**:

$$
\mathcal{L}_{\mathrm{main}} = (1 - \gamma)\,\mathcal{L}_{\mathrm{CE}(\tilde{z})} + \gamma\,\mathcal{L}_{\mathrm{Dice}},
$$

where

$$
\tilde{z}_{i}^{k} = z_{i}^{k} + \tau \cdot \log \pi_k,
$$

and $\tau = 0.5$. Here $\pi_k$ is the empirical prior probability of class $k$. The paper’s specific claim is that LA alone on a plain SegFormer has limited or negative impact, whereas LA applied on top of the improved dual-branch representation sharpens decision boundaries in favor of tail classes while keeping head-class performance acceptable.

This design differs from standard long-tail fixes by treating **feature space separability** as the primary bottleneck. A plausible implication is that the architectural specialization and the loss design are intended to operate sequentially: the spatial branch first amplifies tail-relevant structure, and the main branch then calibrates the classifier on a more discriminative representation.

## 4. Data, protocol, and evaluation

The dataset construction is temporally partitioned into 2007–2010 for training, 2011 for validation, and 2012 for testing, corresponding to 11,688, 2,920, and 2,928 samples, respectively [2509.25208]. TIGGE forecasts are used at 6, 12, 18, and 24 h lead times starting at 00 and 12 UTC, and TRMM 3B42 V7 is aggregated to 6‑hour accumulations to match TIGGE. All variables are z‑score standardized using training-set statistics.

Training is implemented in PyTorch on an NVIDIA RTX A6000 GPU with AdamW, learning rate $1\times10^{-3}$, weight decay $1\times10^{-4}$, batch size 64, and 30 epochs. Model size is reported as 16.93M parameters for DPSformer, compared with 3.75M for SegFormer‑b0, 13.76M for SegFormer‑b1, and 27.43M for SegFormer‑b2.

The primary verification metrics are the **Critical Success Index** and the **Fractions Skill Score**. With confusion-matrix entries $(TP, FP, FN, TN)$, the CSI is

$$
\mathrm{CSI} = \frac{TP}{TP + FN + FP},
$$

which is appropriate for rare events because it penalizes both misses and false alarms while ignoring true negatives. The FSS at neighborhood size $n$ is

$$
\mathrm{FSS}(n) = 1 - \frac{\mathrm{MSE}(n)}{\mathrm{MSE}_{\mathrm{ref}}(n)},
$$

and is used to tolerate small spatial displacement by comparing fractional event coverage in forecast and observation within an $n \times n$ neighborhood. The study also reports ETS, POD, FAR, MAR, F1, and SEDI.

For heavy-rainfall stress testing, the evaluation includes the thresholds 20 and 50 mm/6 h and a special subset of **high‑coverage heavy rainfall events**. In that analysis, test maps are ranked by the fraction of pixels with rainfall $\geq 50$ mm/6 h, and the top 25%, 10%, 5%, and 1% subsets are evaluated separately. The top 1% subset corresponds to the most spatially widespread extreme rainfall cases.

## 5. Reported performance and ablation behavior

At the threshold $\geq 50$ mm/6 h, the baseline TIGGE forecast has CSI = 0.012, POD = 0.013, and FSS$(n=5) \approx 0.008$, whereas DPSformer reaches CSI = 0.067, POD = 0.220, F1 = 0.126 versus 0.024 for TIGGE, $\Delta$SEDI = 0.117, and FSS$(n=5) \approx 0.197$ [2509.25208]. The same section reports that DPSformer has the highest CSI, POD, F1, and SEDI among all methods at both 20 and 50 mm/6 h thresholds.

Relative to the principal learned baselines, the reported values at $\geq 50$ mm/6 h are: SegFormer with CSI = 0.050, POD = 0.126, FSS $\approx 0.160$, and $\Delta$SEDI = 0.049; WMSE‑MS‑SSIM with CSI = 0.048, POD = 0.170, FSS $\approx 0.126$, and $\Delta$SEDI = 0.066; and OBDice with CSI = 0.056, FSS $\approx 0.199$, and $\Delta$SEDI = 0.053. At $\geq 20$ mm/6 h, DPSformer reports CSI = 0.174 versus 0.070 for TIGGE and 0.156 for SegFormer, with FSS $\approx 0.433$, close to OBDice at 0.431 but accompanied by higher CSI, F1, and SEDI.

The gains are especially pronounced in the tail of the test distribution. For the top 1% most spatially extensive $\geq 50$ mm/6 h events, DPSformer reports CSI $\approx 0.18$, which is approximately twice OBDice at $\approx 0.09$ and approximately 90 times TIGGE at $\approx 0.002$; its FSS is above 0.40 at neighborhood 5, whereas other methods remain below 0.30 and often fail to produce coherent spatial structures. This is consistent with the model’s stated objective of improving representation for the rarest and most severe events.

The paper also presents a temporal evolution case for Tropical Storm Doksuri on 29 June 2012. TIGGE is described as underestimating heavy rainfall and failing to track the propagating rainband, with FSS collapsing to near zero in the middle periods. DPSformer maintains high FSS values—up to 0.889 at 00–06 UTC for $\geq 50$ mm/6 h, then 0.686 at 06–12 and 0.502 at 12–18—while remaining skillful at 18–24 UTC.

Ablation studies isolate the effects of high-resolution features (HRF), the dual path, and the dual loss. At $\geq 50$ mm/6 h, plain SegFormer‑b0 gives CSI = 0.050 and POD = 0.126. Adding HRF alone gives CSI = 0.055 and POD $\sim 0.127$, with lower Bias (1.452) and FAR. Adding HRF and Dual Path without Dual Loss gives CSI = 0.060 and POD = 0.170, but Bias rises to 1.993. The full DPSformer reaches CSI = 0.067, POD = 0.220, F1 = 0.126, $\Delta$SEDI = 0.117, and FSS = 0.197. The paper interprets this as a synergy between representation and tailored loss.

Feature-quality analysis reinforces that interpretation. Reported values for heavy-rainfall samples show Calinski–Harabasz (CH) and Fisher scores of approximately 2.3–2.6 and 0.008–0.010 for SegFormer, OBDice, BLV, LA, and Resample; DPSformer backbone features improve to CH = 4.8 and Fisher = 0.210; the spatial branch reaches CH = 18.7 and Fisher = 0.227; and the full model reaches CH = 19.7 and Fisher = 0.363. Parameter scaling alone is not sufficient: SegFormer‑b2 with WCE reports CSI = 0.046 and CH $\approx 2.8$, despite having 27.43M parameters.

## 6. Interpretation, relation to adjacent work, and limitations

The interpretability analysis uses **Integrated Gradients** and reports that variable importance changes with rainfall intensity [2509.25208]. For general rainfall, the model emphasizes NWP precipitation (TP), low-level humidity (Q850), and geopotential height at 500 hPa (Z500). For heavy rainfall, TP becomes more important and the attribution shifts toward deep moisture (Q500, total column water) and mid-level meridional winds (V500, V700), while geopotential height and MSLP become relatively less important. The paper states that this is consistent with **ingredients‑based forecasting**, where extreme rainfall requires co-location of deep moisture and dynamical lifting.

Within the broader literature, DPSformer is positioned against two families of methods. One is generic long‑tailed learning, including resampling, reweighting, decoupled training, logit adjustment, and BLV. The other is meteorological deep learning, including global weather models and precipitation nowcasting or post‑processing systems. The paper’s explicit claim is that direct transfer of LA, BLV, focal loss, and resampling to a SegFormer backbone does not materially improve heavy-rainfall CSI or feature quality in this problem, because the feature extractor itself is deficient for rare events and because both train and test distributions are long‑tailed. In that sense, DPSformer’s distinctive contribution is **representation‑level long‑tail learning** through a high‑resolution tail expert branch and offset-guided fusion.

The operational interpretation is as a **post‑processing tool** for NWP. It leverages physically constrained NWP simulations and corrects them through learned nonlinear mappings, with particular emphasis on early warning of floods and high‑impact rainfall. The paper also states that it could be integrated into ensemble systems either by correcting each member or by correcting the ensemble mean and then generating calibrated probabilistic products. A conformal prediction analysis is reported to give well-calibrated uncertainty with PICP $\approx 94.6\%$ for nominal 95%.

Several limitations are stated directly. DPSformer’s outputs can be spatially smooth and somewhat overpredictive, reducing missed detections but increasing false alarms. The model is trained on TIGGE and TRMM over a specific region in China during 2007–2012, so transfer to other climatological regimes may depend on differences in NWP characteristics and satellite biases. The dual‑branch transformer is heavier than simple CNN post‑processors, although still much cheaper than running full NWP. The paper also notes that, despite physically coherent Integrated Gradients, further visualization tools may be required for operational interpretability.

Taken together, these results define DPSformer as a meteorological transformer architecture in which **high-resolution tail representation**, **similarity-guided offset fusion**, and **branch-specific long-tail losses** are designed as a single system. The reported evidence suggests that the model’s gains do not arise primarily from parameter count, but from explicitly separating global context from heavy-rainfall representation and then recombining them in a way that improves the separability of rare-event features [2509.25208].

Source: https://www.emergentmind.com/topics/dpsformer