Skip to content

present091/DegFlow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Continuous Degradation Modeling via Latent Flow Matching for Real-World Super-Resolution [AAAI 2026]

Hyeonjae Kim*, Dongjin Kim*, Eugene Jin, Tae Hyun Kim

* Equal contribution. Corresponding author.

arXiv   Project_page  


Overview

This repository contains the official implementation of Continuous Degradation Modeling via Latent Flow Matching for Real-World Super-Resolution.

image

We propose DegFlow, a continuous degradation modeling framework for real-world super-resolution. During training, DegFlow learns continuous degradation trajectories, modeled with a natural cubic spline, in a constrained latent space using Latent Flow Matching (LFM). At inference time, given only a single HR input, it synthesizes realistic LR images at continuous scales. The generated continuous-scale LR images provide realistic supervision beyond limited discrete real HR–LR pairs, leading to improved real-world arbitrary-scale super-resolution (ASSR) performance.

image

LPIPS-based Perceptual Supervision for Nonlinear Flow Matching

image

Illustration of applying LPIPS to nonlinear flow matching for perceptually meaningful degradation modeling.

For unseen intermediate degradation scales, we extrapolate an intermediate latent toward the next discrete degradation level using a third-order Taylor expansion:

$$ \hat{z}_{t_{k+1}} = z_t + \hat{z}'_t \Delta t + \frac{1}{2} z''_t \Delta t^2 + \frac{1}{6} z'''_t \Delta t^3 $$

We then decode the extrapolated latent and compute the LPIPS loss against the ground-truth LR image at the next degradation level:

$$ \mathcal{L}_{\mathrm{LPIPS}} = \mathrm{LPIPS}\left(I_{s_{k+1}}, D_\theta\left(\hat{z}_{t_{k+1}}\right)\right) $$

This enables perceptual supervision even at unseen intermediate degradation scales, without requiring direct ground-truth LR images.


Results

Generated Continuous-Scale LR Images

image

Quantitative Results on Unseen-Scale Super-Resolution

🟥 Best and 🟦 second-best are highlighted in the table.

Table 2. Fixed-scale SR results on the RealSR ×3 test set.

image

Table 3. Arbitrary-scale SR results on the RealSR ×3 and RealArbiSR test sets.

image

Qualitative Results on Unseen-Scale Super-Resolution

image

Dataset Preparation

We use the RealSR Version 2 dataset for both training and evaluation.

To be specific, we use a dataset reconstructed from InterFlow (Learning Controllable Degradation for Real-World Super-Resolution via Constrained Flows), containing only overlapping HR–LR pairs.

You may refer to the official InterFlow repository, where the dataset is available for download.

After downloading, set the dataset root path in the config files:

configs/datasets/realsr_train.yaml

configs/datasets/realsr_train_allscale.yaml

configs/datasets/realsr_test.yaml

configs/datasets/realsr_test_allscale.yaml

dataset:
  params:
    dataroot: '/path/to/RealSR_v2_ordered/'

We assume an ordered dataset structure such as RealSR_v2_ordered. Please modify the dataset loader if your directory structure differs.


Training

Training consists of two stages.

Stage 1 — Train RAE (Residual Autoencoder)

python main.py --config configs/train_lit_ae.yaml

This stage trains the latent autoencoder to construct a constrained latent space.


Stage 2 — Train LFM (Latent Flow Matching)

python main.py --config configs/train_lit_rf.yaml

This stage trains the latent flow model in the learned latent space.


Dataset Generation

To generate arbitrary-scale real LR samples or latent trajectories, configure:

configs/generate.yaml

Set pretrained checkpoint paths:

model:
  params:
    ae_config:
      checkpoint: /path/to/autoencoder_checkpoint.ckpt
    rf_config:
      checkpoint: /path/to/flow_model_checkpoint.ckpt

Run generation:

python generate.py --config configs/generate.yaml

Generation with External HR-Only Datasets

Furthermore, DegFlow generation can also be performed using external datasets that contain HR images only.

For example, DIV2K is currently supported. You can enable generation by configuring the data section as follows:

data:
  target: datasets.data_module.GenerationDataModule
  params:
    dataset:
      target: datasets.dataset.DIV2K_HR_only_dataset
      params:
        root_dir: '/path/to/DIV2K dataset'

You can also perform generation with any custom dataset that contains HR images only by implementing or adapting a compatible dataset class.


Pretrained Checkpoints

We provide pretrained checkpoints for both the autoencoder and flow models.

Residual Autoencoder

Model Download
Autoencoder Google Drive

Flow Models

Model Download
Flow Model Google Drive

Citation

If you find this work useful, please cite:

@inproceedings{kim2026degflow,
  title     = {Continuous Degradation Modeling via Latent Flow Matching for Real-World Super-Resolution},
  author    = {Kim, Hyeonjae and Kim, Dongjin and Jin, Eugene and Kim, Taehyun},
  booktitle = {Proceedings of the AAAI Conference on Artificial Intelligence},
  year      = {2026}
}

Acknowledgements

This project builds upon ideas from the following works:

  • Learning Controllable Degradation for Real-World Super-Resolution via Constrained Flows (ICML 2023)
  • Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow (ICLR 2023)
  • Improving the Training of Rectified Flows (NeurIPS 2024)

We sincerely thank the authors for their inspiring and foundational contributions.

About

Continuous Degradation Modeling via Latent Flow Matching for Real-World Super-Resolution, in AAAI 2026

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors