Skip to content

UNIC-Lab/radiodiff-inverse

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RadioDiff-Inverse

πŸ“‘ Welcome to the RadioDiff Family

Radio map construction via generative diffusion models β€” UNIC Lab, Xidian University


πŸ”· Base Backbone

RadioDiff β€” The foundational diffusion model for radio map construction. Β Β πŸ“„ Paper Β |Β  πŸ’» Code Β |Β  IEEE TCCN


πŸ”¬ Physics-Informed Extensions

RadioDiff-kΒ² β€” PINN-enhanced diffusion guided by the Helmholtz equation. Β Β πŸ“„ Paper Β |Β  πŸ’» Code Β |Β  IEEE JSAC

iRadioDiff β€” Indoor radio map construction with physical information integration. Β Β πŸ“„ Paper Β |Β  πŸ’» Code Β |Β  IEEE ICC Β Best Paper


⚑ Efficiency & Dynamics

RadioDiff-Turbo β€” Efficiency-enhanced RadioDiff for accelerated inference. Β Β πŸ“„ Paper Β |Β  INFOCOM Workshop

RadioDiff-Flux β€” Adaptive reconstruction under dynamic environments and base station location changes. Β Β πŸ“„ Paper Β |Β  IEEE TCCN


🌐 Extended Scenarios

RadioDiff-3D β€” 3D radio map construction with the UrbanRadio3D dataset. Β Β πŸ“„ Paper Β |Β  πŸ’» Code Β |Β  IEEE TNSE

RadioDiff-FS β€” Few-shot learning for radio map construction with limited measurements. Β Β πŸ“„ Paper Β |Β  πŸ’» Code Β |Β  arXiv


πŸ“Ά Sparse Measurement & Localization

RadioDiff-Inverse β€” Sparse measurement-based radio map recovery for ISAC applications. Β Β πŸ“„ Paper Β |Β  πŸ’» Code Β |Β  IEEE TWC

RadioDiff-Loc β€” Sparse measurement-based NLoS localization using diffusion models. Β Β πŸ“„ Paper Β |Β  arXiv


πŸ“š For a comprehensive categorized overview of radio map research, visit Awesome-Radio-Map-Categorized.

Diffusion posterior sampling for radio-map style inpainting / inverse problems.

This repository applies the FPS-SMC diffusion posterior sampling pipeline to radio map reconstruction tasks, using building masks as conditioning signals and the RadioMapSeer dataset.


1. Environment

conda create -n radiodiff python=3.8 -y
conda activate radiodiff
pip install -r requirements.txt

A CUDA-compatible PyTorch build is strongly recommended. The code was tested with PyTorch 2.0.0+cu118.


2. Dataset: RadioMapSeer

This project uses the RadioMapSeer dataset for radio map reconstruction experiments.

After downloading, organize the data under data/ as follows:

data/
β”œβ”€β”€ samples/           # radio map images (used as ground truth)
β”œβ”€β”€ buildings_complete/# building footprint masks
β”œβ”€β”€ antennas/          # antenna position maps
└── val_images/        # validation split images

See data/README.md for more details.


3. Pretrained Checkpoints

Download the pretrained score estimation models and place them in models/.

File Dataset Source
ffhq_10m.pt FFHQ Google Drive (from DPS2022)
imagenet256.pt ImageNet Google Drive (from DPS2022)
256x256_diffusion_uncond.pt ImageNet (alt.) OpenAI
models/
β”œβ”€β”€ ffhq_10m.pt
└── imagenet256.pt      # or 256x256_diffusion_uncond.pt

See models/README.md for details.


4. Run Experiments

All scripts default to repository-relative output paths under results/. You can override the output directory by passing it as the first argument.

Random mask β€” with building-mask conditioning

./run_random_cond.sh
# or specify output directory:
./run_random_cond.sh results/my_run

Random mask β€” unconditional

./run_random_uncond.sh

Sensor-rectangle mask β€” with building-mask conditioning

./run_sensor_cond.sh

Sensor-rectangle mask β€” unconditional

./run_sensor_uncond.sh

Run directly with Python

python3 sample_condition.py \
    --task_config configs/inpainting_config_random_cond.yaml \
    --save_dir results/my_run \
    --gpu 0 \
    --num_images 10 \
    --mask_ratios 0.9 \
    --noise_levels 0.05

Interpolation baselines (no diffusion)

python3 sample_interpolation.py \
    --task_config configs/inpainting_config_random_cond.yaml \
    --save_dir results/interp \
    --gpu 0

5. Compute Metrics

Evaluate all experiments under results/:

python3 advanced_metric_calculator.py --base_dir results --gpu 0

Evaluate a single experiment directory:

python3 advanced_metric_calculator.py --exp_dir results/random_cond --gpu 0

Outputs per experiment: metrics.json, per_sample_metrics.json Summary outputs: all_result.json, summary_metrics_vMMDD_HHMM.json


6. Project Structure

.
β”œβ”€β”€ sample_condition.py        # main conditional pipeline
β”œβ”€β”€ sample_condition_uncond.py # main unconditional pipeline
β”œβ”€β”€ sample_interpolation.py    # interpolation baselines (RBF, Linear, etc.)
β”œβ”€β”€ advanced_metric_calculator.py
β”œβ”€β”€ configs/                   # task / model / diffusion YAML configs
β”œβ”€β”€ data/                      # datasets (git-ignored except README)
β”œβ”€β”€ models/                    # checkpoints (git-ignored except README)
β”œβ”€β”€ results/                   # experiment outputs (git-ignored except README)
β”œβ”€β”€ guided_diffusion/          # diffusion model and sampler internals
β”œβ”€β”€ util/                      # metrics, image utilities, logging
β”œβ”€β”€ ImageNet/                  # ImageNet-specific entry scripts
β”œβ”€β”€ scripts/                   # utility scripts
β”œβ”€β”€ run_random_cond.sh
β”œβ”€β”€ run_random_uncond.sh
β”œβ”€β”€ run_sensor_cond.sh
└── run_sensor_uncond.sh

7. Experimental Components

The road-conditioned path is kept for reference but is not part of the default reproducible pipeline:

  • run_cond_road.sh is intentionally disabled
  • sample_road.py requires additional dataset wiring before use

Acknowledgements

This codebase builds on the diffusion posterior sampling / FPS-SMC framework. Pretrained checkpoints are from DPS2022. Radio map data is from the RadioMapSeer dataset.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 92.7%
  • Shell 3.0%
  • Cuda 2.5%
  • TeX 1.4%
  • Other 0.4%