TL;DR
Standard joint finetuning of encoders and decoders often causes models to overfit to specific training environments, destroying the "general" knowledge in pretrained weights. DeFT (Decoupled FineTuning) solves this by splitting the training into two stages and two parallel pathways, using exponential moving averages to keep the model's parameters closer to their generalizable starting points while still learning the task at hand.
The Problem with Joint Finetuning
In semantic segmentation, the "de facto" standard is to take a pretrained encoder (like one trained on ImageNet) and attach a randomly initialized decoder. You then train them together on a specific dataset (the "source domain").
The problem? This joint finetuning is surprisingly fragile. Because the decoder starts from scratch, its early, noisy gradients can "distort" the high-quality, general features already present in the pretrained encoder. This leads to domain shift issues: a model trained on sunny synthetic data (like GTAV) might completely fail when it sees a rainy real-world street in a different city.
The authors argue that the very act of training the encoder and decoder together causes the model to overfit to the source domain's specific style, sacrificing its ability to generalize to unseen environments. As seen in the loss curves above, joint finetuning causes the target domain loss to spike, while DeFT keeps it steadily decreasing.
The DeFT Approach
To combat this, the authors propose DeFT, which operates in two distinct stages:
- Stage 1: Decoder Warm-up: The pretrained encoder is frozen. Only the randomly initialized decoder is trained. This allows the decoder to learn basic task-relevant knowledge (how to segment) without "corrupting" the encoder's general features.
- Stage 2: Decoupled Finetuning: This is the core innovation. The model is split into two parallel pathways ($f_1$ and $f_2$). Each pathway consists of an Adaptive Component (AC) and a Retentive Component (RC):
- Pathway 1: Uses an Adaptive Encoder (updated via standard gradients) and a Retentive Decoder.
- Pathway 2: Uses a Retentive Encoder and an Adaptive Decoder (updated via standard gradients).
- The RC Update: Retentive components are updated using a variant of the Exponential Moving Average (EMA). Instead of following gradients directly, they slowly track the weights of their adaptive counterparts in the other pathway, biased heavily toward their initial state.
For final inference, the model combines the two "best-behaved" parts: the Retentive Encoder and the Retentive Decoder. This setup effectively prevents the encoder and decoder from "colluding" to overfit the source domain.
Key Insights and Ideas
- Distance is the Enemy of Generalization: The authors show empirically that the further a model's parameters move from their pretrained initialization, the worse it generalizes. DeFT explicitly minimizes this "parameter distance."
- Breaking the Feedback Loop: In joint training, a bad decoder forces the encoder to change, which then forces the decoder to change further. By decoupling them into AC/RC pairs, DeFT breaks this cycle of overfitting.
- Virtual Parameter Reduction: By splitting the task into two pathways where only half the model is "adaptive" at a time, the framework effectively reduces the complexity of the optimization problem, leading to tighter generalization bounds.
Datasets and Key Results
The researchers evaluated DeFT across several standard domain generalization benchmarks, using GTAV and Cityscapes as source domains, and testing on unseen targets like BDD100K, Mapillary Vistas, and SYNTHIA.
DeFT achieved state-of-the-art results in nearly every category:
- GTAV $\rightarrow$ Real World: Using a ResNet-50, DeFT reached an average mIoU (mean Intersection-over-Union) of 47.91% across three target datasets, a massive jump from the standard baseline of 32.05% and significantly higher than previous top methods like TLDR (45.09%).
- Transformer Performance: When using a MiT-B5 backbone, DeFT achieved 55.49% average mIoU, outperforming specialized domain-adaptive architectures like DAFormer.
- Qualitative Improvement: Visual results show that DeFT produces much cleaner segmentation masks in unseen domains, correctly identifying sidewalks and vegetation where baseline models often see "noise" or incorrect classes.
Limitations and Future Work
- Training Overhead: Because DeFT maintains two parallel pathways during training, it requires more memory and computational power than standard finetuning (though inference speed remains identical).
- Hyperparameter Sensitivity: The method relies on an EMA update ratio ($\beta$). While 0.9999 worked best in their tests, finding the optimal balance between "adapting" and "retaining" might vary for different tasks.
Summary updated