Skip to content

riotu-lab/GLADE-Net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

GLADE-Net

Python 3.8+ PyTorch License: MIT

learning framework for perceptual dehazing of high-resolution remote sensing images: Phase 1 (Global Attention Stage): Uses a UFormer-based encoderโ€“decoder with grid patching to capture global atmospheric and ecological context. Phase 2 (Laplacian-Guided GAN Stage): Refines outputs via a dual-branch GAN that operates in both RGB and Laplacian domains, enhancing edges, textures, and perceptual realism. GLADE-Net achieves state-of-the-art PSNR and LPIPS on SateHaze1k and RICE datasets, balancing structural fidelity and visual quality for environmental and ecological monitoring applications.


๐Ÿง  Overview

Phase 1 โ€” Global Attention Dehazing

This stage focuses on coarse haze removal and global feature restoration using a UFormer-based encoderโ€“decoder optimized for remote sensing imagery.

Key Features:

  • ๐ŸŒ Global Attention Encoderโ€“Decoder (UFormer): Captures large-scale atmospheric and ecological dependencies.
  • โšก PyTorch Lightning Framework: Streamlined training loop with mixed-precision (FP16) support.
  • ๐Ÿงฉ Grid-Based Dataset Loader: Performs on-the-fly tiling, augmentation, and efficient handling of high-resolution inputs.
  • ๐Ÿ“ˆ Gradual Frequency Loss: Charbonnier-based loss with PSNR/SSIM evaluation metrics for stable optimization.
  • ๐Ÿ›ฐ๏ธ Inference Tools: Enable large-scale aerial image restoration through automated grid merging and tiling scripts.

Phase 2 โ€” Laplacian-Guided Perceptual Refinement

This stage enhances visual quality and perceptual realism of the dehazed outputs generated by Phase 1.
It integrates adversarial learning and frequency-domain guidance for fine detail enhancement.

Key Features:

  • ๐ŸŽจ Dual-Branch GAN: Operates jointly in RGB and Laplacian domains to restore both structural and textural details.
  • ๐Ÿ” Laplacian Pyramid Guidance: Multi-scale refinement of edges and textures using Laplacian-based supervision.
  • ๐Ÿ‘๏ธ Perceptual and Adversarial Losses: Improve realism and visual fidelity while maintaining quantitative accuracy.
  • ๐Ÿ”ฌ High-Resolution Enhancement: Designed for ecological monitoring and environmental analysis applications.

โš™๏ธ Installation

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Tested with Python 3.8+ and PyTorch โ‰ฅ 2.0.


๐Ÿงฉ Dataset Layout

Example folder structure:

/path/to/RICE_DATASET/ โ”œโ”€โ”€ train/ โ”‚ โ”œโ”€โ”€ cloud/ # hazy or cloudy input images โ”‚ โ””โ”€โ”€ label/ # clean ground-truth targets โ””โ”€โ”€ test/ โ”œโ”€โ”€ cloud/ โ””โ”€โ”€ label/


๐Ÿ“Š Datasets

No. Dataset Year Pub. Number Image Size Type Download
01 SateHaze1k 2017 WACV 400ร—3 512ร—512 Synthetic ๐Ÿ”— Download
02 RICE (RICE1 & RICE2) 2019 arXiv 950 512ร—512 Synthetic ๐Ÿ”— Download

Notes:

  • SateHaze1k is divided into Thin, Moderate, and Thick subsets simulating different haze densities.
  • RICE1 and RICE2 include paired cloudy and clear-sky remote sensing images for evaluating dehazing and cloud removal performance.

๐Ÿงฑ Step 1: Grid-Based Dataset Preparation

To generate 128ร—128 tiles for training and validation:

python GLADE-Net/tools/grid_crop_pairs.py \
  --root    dataset \ #path to your dataset train[cloud, label], test[cloud, label]
  --out_root dataset_grid \
  --tile_w 128 --tile_h 128 --overlap 0

Output tiles will be created under: dataset_grid/train/ dataset_grid/test/


๐Ÿš€ Step 2: Training Phase 1

Run training from the project root:

cd GLADE-Net
python -m src.train \
  --train_dir dataset_grid/train \
  --val_dir   dataset_grid/test \
  --img_size 128 --batch_size 1 --epochs 2500 --devices 1 \
  --precision 16 --accumulate 2 --lr 2e-4 \
  --save_ckpt Phase_1.ckpt

You can resume training with:

python -m src.train --train_dir ... --val_dir ... --resume /path/to/checkpoint.ckpt


๐Ÿ” Step 3: Inference Phase 1 (Grid UFormer)

Run inference on cloudy test images using the trained checkpoint:

python GLADE-Net/tools/inference_grid.py \
  --weights Phase_1.ckpt \
  --input   dataset/test/cloud \
  --output  dataset/test/output_phase_1 \
  --tile 512

The script will:

  • Load each image, pad to a multiple of the tile size.
  • Partition into non-overlapping grids.
  • Apply the UFormer model patch-by-patch.
  • Reconstruct and crop back to the original size.
  • Save restored outputs under output_phase_1/.

Example output folders: dataset/test/cloud/ # input hazy images dataset/test/label/ # ground truth dataset/test/output_phase_1/ # Phase 1 restored results


๐Ÿงฎ Step 4: Training Phase 2 โ€“ Perceptual GAN Refinement

The next phase will use the output from Phase 1 (restored dehazed images) paired with their ground-truth targets to train a perceptual enhancement GAN.
This stage focuses on:

  • Fine texture recovery and color correction.
  • Multi-domain learning (RGB + Laplacian).
  • Perceptual and adversarial loss integration.
python GLADE-Net/Phase_2/code/train.py\
     -opt GLADE-Net/Phase_2/code/options/train/train_second_phase.json

๐Ÿ” Step 5: Inference Phase 2

Run inference on cloudy test images using the trained weight:

python GLADE-Net/Phase_2/code/test.py\
     -opt GLADE-Net/Phase_2/code/options/test/test_second_phase.json 

๐Ÿš€ Quick Demo โ€“ Try GLADE-Net in One Notebook

If you want to quickly test GLADE-Net (Phase 1 + Phase 2) without setting up the entire training pipeline, we provide an interactive demo notebook.
You can open and run it directly on GitHub or in Google Colab.

Demo Notebook:
train_inference_Phase_1_and_2_demo_tutorial.ipynb

๐Ÿ“˜ This notebook demonstrates:

  • Loading pretrained Phase 1 and Phase 2 models
  • Running inference on sample remote-sensing images
  • Visualizing haze removal and perceptual enhancement results

๐Ÿง  Model Weights

Pretrained model weights for GLADE-Net are available for both phases and all datasets.
You can download them from the shared Google Drive folder below.

๐Ÿ”— GLADE-Net Weights (Google Drive)

Folder Structure:

Phase Folder Dataset File Name Description
1 pahse_1 SateHaze1k SateHaze1k.ckpt Global attention model trained on synthetic haze data.
RICE-1 RICE_1.ckpt Phase 1 model trained on RICE1 dataset.
RICE-2 RICE_2.ckpt Phase 1 model trained on RICE2 dataset.
2 phase_2 SateHaze1k SateHaze1k.pth Laplacian-Guided GAN model for perceptual refinement.
RICE-1 Rice_1.pth Phase 2 refinement model trained on RICE1 dataset.
RICE-2 Rice_2.pth Phase 2 refinement model trained on RICE2 dataset.

Notes:

  • Each .ckpt file corresponds to the Phase 1 (UFormer) stage for global dehazing.
  • Each .pth file corresponds to the Phase 2 (GAN Refinement) stage for perceptual enhancement.
  • Models can be directly loaded using the provided demo notebook or inference scripts.

๐Ÿงพ Output Results

The final qualitative and quantitative results of GLADE-Net are available for each dataset and test condition.
You can browse and download them from the shared Google Drive folder below.

๐Ÿ”— GLADE-Net Results (Google Drive)

Folder Structure:

Folder Description
Grid_SPSR_test_thin Results on SateHaze1kโ€“Thin (light haze conditions).
Grid_SPSR_test_Moderate Results on SateHaze1kโ€“Moderate (medium haze).
Grid_SPSR_test_thick Results on SateHaze1kโ€“Thick (dense haze).
RICE_results Dehazing results on RICE1 and RICE2 datasets.
test real images hazing Visual qualitative results on real-world hazy aerial images.

๐Ÿงฉ Each subfolder contains restored RGB images from the Phase 1 (Global Attention) and Phase 2 (Laplacian-Guided GAN) pipelines, organized according to haze intensity and dataset type.


๐Ÿง  Citation

If you use this repository, please cite the paper: Common soon


About

Two-phase deep learning framework for remote-sensing image dehazing (Global + Local Attention)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors