This repo is the implementation of paper "Residual Degradation Learning Unfolding Framework with Mixing Priors across Spectral and Spatial for Compressive Spectral Imaging"
Scene 1 | Scene 6 | Scene 8 | Scene 10 |
---|---|---|---|
- 2023.03.16: release pretrained weights in
simulation/test_code/checkpoints/
andreal/test_code/checkpoints/
To acquire a snapshot spectral image, coded aperture snapshot spectral imaging (CASSI) is proposed. A core problem of the CASSI system is to recover the reliable and fine underlying 3D spectral cube from the 2D measurement. By alternately solving a data subproblem and a prior subproblem, deep unfolding methods achieve good performance. However, in the data subproblem, the used sensing matrix is ill-suited for the real degradation process due to the device errors caused by phase aberration, distortion; in the prior subproblem, it is important to design a suitable model to jointly exploit both spatial and spectral priors. In this paper, we propose a Residual Degradation Learning Unfolding Framework (RDLUF), which bridges the gap between the sensing matrix and the degradation process. Moreover, a Mix
PSNR-Parameters comparisons with previous HSI reconstruction methods. The vertical axis is PSNR (in dB performance), and the horizontal axis is Parameters(memory cost). Our proposed Residual Degradation Learning Unfolding Framework with Mixing priors across Spatial and Spectral(RDLUF-Mix
The architecture of our RDLUF with
Diagram of the Mix
Download cave_1024_28 (Baidu Disk, code: fo0q
| One Drive), CAVE_512_28 (Baidu Disk, code: ixoe
| One Drive), KAIST_CVPR2021 (Baidu Disk, code: 5mmn
| One Drive), TSA_simu_data (Baidu Disk, code: efu8
| One Drive), TSA_real_data (Baidu Disk, code: eaqe
| One Drive), and then put them into the corresponding folders of datasets/
and recollect them as the following form:
|--RDLUF_MixS2
|--real
|-- test_code
|-- train_code
|--simulation
|-- test_code
|-- train_code
|--visualization
|--datasets
|--cave_1024_28
|--scene1.mat
|--scene2.mat
:
|--scene205.mat
|--CAVE_512_28
|--scene1.mat
|--scene2.mat
:
|--scene30.mat
|--KAIST_CVPR2021
|--1.mat
|--2.mat
:
|--30.mat
|--TSA_simu_data
|--mask_3d_shift.mat
|--mask.mat
|--Truth
|--scene01.mat
|--scene02.mat
:
|--scene10.mat
|--TSA_real_data
|--mask_3d_shift.mat
|--mask.mat
|--Measurements
|--scene1.mat
|--scene2.mat
:
|--scene5.mat
We use the CAVE dataset (cave_1024_28) as the simulation training set. Both the CAVE (CAVE_512_28) and KAIST (KAIST_CVPR2021) datasets are used as the real training set.
cd RDLUF_MixS2/simulation/train_code/
# RdLUF-MixS2 3stage
python train.py --template duf_mixs2 --outf ./exp/duf_mixs2_3stage/ --method duf_mixs2 --stage 3 --body_share_params 0 --clip_grad
# RdLUF-MixS2 5stage
python train.py --template duf_mixs2 --outf ./exp/duf_mixs2_5stage/ --method duf_mixs2 --stage 5 --body_share_params 1 --clip_grad
# RdLUF-MixS2 7stage
python train.py --template duf_mixs2 --outf ./exp/duf_mixs2_7stage/ --method duf_mixs2 --stage 7 --body_share_params 1 --clip_grad
# RdLUF-MixS2 9stage
python train.py --template duf_mixs2 --outf ./exp/duf_mixs2_9stage/ --method duf_mixs2 --stage 9 --body_share_params 1 --clip_grad
The training log, trained model, and reconstrcuted HSI will be available in RDLUF_MixS2/simulation/train_code/exp/
.
Place the pretrained model to RDLUF_MixS2/simulation/test_code/checkpoints/
Run the following command to test the model on the simulation dataset.
cd RDLUF_MixS2/simulation/test_code/
# RdLUF-MixS2 3stage
python test.py --template duf_mixs2 --stage 3 --body_share_params 0 --outf ./exp/duf_mixs2_3stage/ --method duf_mixs2 --pretrained_model_path ./checkpoints/RDLUF_MixS2_3stage.pth
# RdLUF-MixS2 5stage
python test.py --template duf_mixs2 --stage 5 --body_share_params 1 --outf ./exp/duf_mixs2_5stage/ --method duf_mixs2 --pretrained_model_path ./checkpoints/RDLUF_MixS2_5stage.pth
# RdLUF-MixS2 7stage
python test.py --template duf_mixs2 --stage 7 --body_share_params 1 --outf ./exp/duf_mixs2_7stage/ --method duf_mixs2 --pretrained_model_path ./checkpoints/RDLUF_MixS2_7stage.pth
# RdLUF-MixS2 9stage
python test.py --template duf_mixs2 --stage 9 --body_share_params 1 --outf ./exp/duf_mixs2_9stage/ --method duf_mixs2 --pretrained_model_path ./checkpoints/RDLUF_MixS2_9stage.pth
- The reconstrcuted HSIs will be output into
RDLUF_MixS2/simulation/test_code/exp/
- Place the reconstructed results into
RDLUF_MixS2/simulation/test_code/Quality_Metrics/results
and
Run cal_quality_assessment.m
to calculate the PSNR and SSIM of the reconstructed HSIs.
- Put the reconstruted HSI in
RDLUF_MixS2/visualization/simulation_results/results
and rename it as method.mat, e.g., RDLUF_MixS2_9stage.mat - Generate the RGB images of the reconstructed HSIs
cd RDLUF_MixS2/visualization/
Run show_simulation.m
cd RDLUF_MixS2/real/train_code/
# RDLUF-MixS2 3stage
python train.py --template duf_mixs2 --outf ./exp/rdluf_mixs2_3stage/ --method duf_mixs2 --stage 3 --body_share_params 1
The training log and trained model will be available in RDLUF_MixS2/real/train_code/exp/
cd RDLUF_MixS2/real/test_code/
# RDLUF-MixS2 3stage
python test.py --template duf_mixs2 --outf ./exp/rdluf_mixs2_3stage/ --method duf_mixs2 --stage 3 --body_share_params 1 --pretrained_model_path ./checkpoints/RDLUF_MixS2_3stage.pth
The reconstrcuted HSI will be output into RDLUF_MixS2/real/test_code/Results/
- Put the reconstruted HSI in
RDLUF_MixS2/visualization/real_results/results
and rename it as method.mat, e.g., RDLUF_MixS2_3stage.mat. - Generate the RGB images of the reconstructed HSI
cd RDLUF_MixS2/visualization/
Run show_real.m
Our code is heavily borrowed from MST and DGSMP, thanks for their generous open source.
If this code helps you, please consider citing our works:
@inproceedings{dong2023residual,
title={Residual Degradation Learning Unfolding Framework with Mixing Priors across Spectral and Spatial for Compressive Spectral Imaging},
author={Dong, Yubo and Gao, Dahua and Qiu, Tian and Li, Yuyan and Yang, Minxi and Shi, Guangming},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={22262--22271},
year={2023}
}