{"id":19217013,"url":"https://github.com/hustvl/saunet","last_synced_at":"2025-05-12T23:42:35.823Z","repository":{"id":107700659,"uuid":"591347789","full_name":"hustvl/SAUNet","owner":"hustvl","description":"A Simple Adaptive Unfolding Network for Hyperspectral Image Reconstruction","archived":false,"fork":false,"pushed_at":"2023-02-01T14:16:17.000Z","size":3820,"stargazers_count":33,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-12T23:42:29.608Z","etag":null,"topics":["hyperspectral-imaging","low-level-vision","unfolding-algorithm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hustvl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-20T14:38:24.000Z","updated_at":"2025-03-04T11:06:37.000Z","dependencies_parsed_at":"2023-03-13T14:33:43.058Z","dependency_job_id":null,"html_url":"https://github.com/hustvl/SAUNet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustvl%2FSAUNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustvl%2FSAUNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustvl%2FSAUNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustvl%2FSAUNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hustvl","download_url":"https://codeload.github.com/hustvl/SAUNet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253843168,"owners_count":21972867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hyperspectral-imaging","low-level-vision","unfolding-algorithm"],"created_at":"2024-11-09T14:19:52.128Z","updated_at":"2025-05-12T23:42:35.818Z","avatar_url":"https://github.com/hustvl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1\u003eSAUNet\u003c/h1\u003e\n\u003ch3\u003eA Simple Adaptive Unfolding Network for Hyperspectral Image Reconstruction\u003c/h3\u003e\n\n[Junyu Wang](https://github.com/Junyu99)\u003csup\u003e1\u003c/sup\u003e \\*, [Shijie Wang](https://github.com/simonJJJ)\u003csup\u003e1\u003c/sup\u003e \\*, [Wenyu Liu](http://eic.hust.edu.cn/professor/liuwenyu/)\u003csup\u003e1\u003c/sup\u003e, Zengqiang Zheng\u003csup\u003e2\u003c/sup\u003e, [Xinggang Wang](https://xinggangw.info/)\u003csup\u003e1 :email:\u003c/sup\u003e,\n \n\u003csup\u003e1\u003c/sup\u003e [School of EIC, HUST](http://eic.hust.edu.cn/English/Home.htm), \u003csup\u003e2\u003c/sup\u003e [Wuhan Jingce Electronic Group](http://www.wuhanjingce.com/index.html).\n\n(\\*) equal contribution, (\u003csup\u003e:email:\u003c/sup\u003e) corresponding author.\n\nArxiv Preprint ([arxiv 2301.10208](https://arxiv.org/abs/2301.10208))\n\n\u003c/div\u003e\n\n#\n\n|                          *Scene 2*                           |                          *Scene 3*                           |                          *Scene 5*                           |                          *Scene 7*                           |\n| :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: |\n| \u003cimg src=\"figures/scene2 00_00_00-00_00_30.gif\"  height=170 width=170\u003e | \u003cimg src=\"figures/scene3 00_00_00-00_00_30.gif\" width=170 height=170\u003e | \u003cimg src=\"figures/scene5 00_00_00-00_00_30.gif\" width=170 height=170\u003e | \u003cimg src=\"figures/scene7 00_00_00-00_00_30.gif\" width=170 height=170\u003e |\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"figures/SAUNet.png\" width=100%\u003e\n\u003c/p\u003e\n\n### Quantitative Comparison on Simulation Dataset\n\u003e Results from the [paper](https://arxiv.org/abs/2301.10208)\n\nModels and visualization results are available at [here](https://github.com/hustvl/Storage/releases/), [Google Drive](https://drive.google.com/drive/folders/1S001KwzzbyFy90tBoe5deSopUoS1RbJ5?usp=sharing) or [Baidu Drive](https://pan.baidu.com/s/133CUEhuJ1hDwSi60_X14EA?pwd=moma) (password: moma).\n|                            Method                            | Params (M) | FLOPS (G) | PSNR  | SSIM  |                   Training GPU-hours                          |                   Inference Speed (FPS)                      |\n| :----------------------------------------------------------: | :--------: | :-------: | :---: | :---: | :----------------------------------------------------------: | :----------------------------------------------------------: |\n|       [SAUNet-1stg](https://github.com/hustvl/Storage/releases/download/v1.0/1stg_model_epoch_284.pth)        |    0.78    |   9.52   | 34.84 | 0.946 | 14.3 | 56.4 |\n|       [SAUNet-2stg](https://github.com/hustvl/Storage/releases/download/v1.0/2stg_model_epoch_264.pth)        |    1.50    |   17.91   | 36.73 | 0.961 | 29.3 | 31.5 |\n|       [SAUNet-3stg](https://github.com/hustvl/Storage/releases/download/v1.0/3stg_model_epoch_281.pth)        |    2.23    |   26.31   | 37.54 | 0.966 | 43.9 | 22.0 |\n|       [SAUNet-5stg](https://github.com/hustvl/Storage/releases/download/v1.0/5stg_model_epoch_282.pth)        |    3.68    |   43.10   | 38.16 | 0.970 | 71.5 | 13.1 |\n|       [SAUNet-9stg](https://github.com/hustvl/Storage/releases/download/v1.0/9stg_model_epoch_271.pth)        |    6.59    |   76.68   | 38.57 | 0.973 | 149.0 | 7.8 |\n|       [SAUNet-13stg](https://github.com/hustvl/Storage/releases/download/v1.0/13stg_model_epoch_247.pth)       |    9.50    |   110.25  | 38.79 | 0.974 | 215.0 | 5.5 |\n\n\u003cdetails\u003e\n  \u003csummary\u003eTable Notes (click to expand)\u003c/summary\u003e\n  \n  - Training GPU-hours and Inference Speed are obtained by a Tesla v100 GPU.  \n  - Training GPU-hours only includes the time of forward and backward propagation.  \n  - Inference Speed averages the input measurement of 256 x 310 at 800 times with batchsize = 1.\n\u003c/details\u003e  \n\n### Create Environment:\n\n- Python 3 (Recommend to use [Anaconda](https://www.anaconda.com/download/#linux))\n\n- [PyTorch \u003e= 1.7](https://pytorch.org/)\n\n- NVIDIA GPU + [CUDA](https://developer.nvidia.com/cuda-downloads)\n\n- Python packages:\n\n  ```shell\n  pip install -r requirements.txt\n  ```\n\n### Prepare Dataset:\n\nDownload the dataset from https://github.com/mengziyi64/TSA-Net, put the dataset into the corresponding folder 'code/datasets/', and recollect them in the following form:\n\n    |--datasets\n        |--cave_1024_28\n            |--scene1.mat\n            |--scene2.mat\n            ：  \n            |--scene205.mat\n        |--CAVE_512_28\n            |--scene1.mat\n            |--scene2.mat\n            ：  \n            |--scene30.mat\n        |--KAIST_CVPR2021  \n            |--1.mat\n            |--2.mat\n            ： \n            |--30.mat\n        |--TSA_simu_data  \n            |--mask.mat   \n            |--Truth\n                |--scene01.mat\n                |--scene02.mat\n                ： \n                |--scene10.mat\n        |--TSA_real_data  \n            |--mask.mat   \n            |--Measurements\n                |--scene1.mat\n                |--scene2.mat\n                ： \n                |--scene5.mat\n### Training and Testing for simulation experiment\n#### Training \nPlease use checkpointing (--cp) when running out of memory.\n```python\n#SAUNet-1stg\npython simu_train.py --method saunet_1stg --outf ./exp/simu_saunet_1stg/ --seed 42 --gpu_id 0\n#SAUNet-2stg\npython simu_train.py --method saunet_2stg --outf ./exp/simu_saunet_2stg/ --seed 42 --gpu_id 0\n#SAUNet-3stg\npython simu_train.py --method saunet_3stg --outf ./exp/simu_saunet_3stg/ --seed 42 --gpu_id 0\n#SAUNet-5stg\npython simu_train.py --method saunet_5stg --outf ./exp/simu_saunet_5stg/ --seed 42 --gpu_id 0\n#SAUNet-9stg \npython simu_train.py --method saunet_9stg --outf ./exp/simu_saunet_9stg/ --seed 42 --gpu_id 0 \n#SAUNet-13stg \npython simu_train.py --method saunet_13stg --outf ./exp/simu_saunet_13stg/ --seed 42 --gpu_id 0 \n```\n#### Testing \na). Test our models on the HSI dataset. The results will be saved in 'code/evaluation/testing_result/' in the MatFile format. For example, we test the SAUNet-3stg:\n```python\npython simu_test.py --method saunet_3stg --outf ./test/simu_saunet_3stg  --pretrained_model_path [your saunet_3stg model path]\n```\nb). Calculate quality assessment. We use the same quality assessment code as DGSMP. So please use Matlab, get in 'code/analysis_tools/Quality_Metrics/', and then run 'Cal_quality_assessment.m'.\n\n### Training and Testing for real data experiment:\n#### Training\nPlease use checkpointing (--cp) when running out of memory.\n```python\n#SAUNet-1stg\npython real_train.py --method saunet_1stg --outf ./exp/real_saunet_1stg/ --seed 42 --gpu_id 0 --isTrain\n#SAUNet-2stg\npython real_train.py --method saunet_2stg --outf ./exp/real_saunet_2stg/ --seed 42 --gpu_id 0 --isTrain\n#SAUNet-3stg\npython real_train.py --method saunet_3stg --outf ./exp/real_saunet_3stg/ --seed 42 --gpu_id 0 --isTrain\n#SAUNet-5stg\npython real_train.py --method saunet_5stg --outf ./exp/real_saunet_5stg/ --seed 42 --gpu_id 0 --isTrain\n#SAUNet-9stg \npython real_train.py --method saunet_9stg --outf ./exp/real_saunet_9stg/ --seed 42 --gpu_id 0 --isTrain\n#SAUNet-13stg \npython real_train.py --method saunet_13stg --outf ./exp/real_saunet_13stg/ --seed 42 --gpu_id 0 --isTrain\n```\n#### Testing \na). Test our models on the HSI dataset. The results will be saved in 'code/evaluation/testing_result/' in the MatFile format. For example, we test the SAUNet-3stg:\n```\npython real_test.py --method saunet_3stg --outf ./test/real_saunet_3stg/ --pretrained_model_path [your saunet_3stg model path]\n```\n\nb). Calculate quality assessment. We use no reference image quality assessments (Naturalness Image Quality Evaluator, **NIQE** ). So please use Matlab, get in 'code/analysis_tools/Quality_Metrics/', and then run 'NIQE_metric.m'.\n\n### Inference FPS\nIf we want to get inference fps of SAUNet-3stg, run the following commond:\n```python\npython test_fps.py --method saunet_3stg --outf ./test/real_saunet_3stg --gpu_id 0\n```\n\n### Training time\nAfer you finish the training of model, please run these commands:\n```\ncd analysis_tools/\npython tranining_time.py [your training log path]\n```\n\n### Evaluating the Params and FLOPS of models\nYou can get the Params and FLOPS of models **at the begin of training**. Or use following commonds \n(for instance, we get these values of SAUNet-3stg. Other methods are similar):\n```python\npython test_fps.py --method saunet_3stg --outf [your log path to save]\n```\n\n### Acknowledgement\nThis project is based on [MST](https://github.com/caiyuanhao1998/MST). Thanks for the wonderful works.\n\n### License\n\nSAUNet is released under the [MIT License](LICENSE).\n\n### Citation\n\nIf you find our paper and code useful in your research, please consider giving a star :star: and citation :pencil: :)\n\n```BibTeX\n@article{SAUNet,\n  title={A Simple Adaptive Unfolding Network for Hyperspectral Image Reconstruction},\n  author={Wang, Junyu and Wang, Shijie and Liu, Wenyu and Zheng, Zengqiang and Wang, Xinggang},\n  journal={arXiv preprint arXiv:2301.10208},\n  year={2023}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustvl%2Fsaunet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhustvl%2Fsaunet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustvl%2Fsaunet/lists"}