{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/mask-guided-spectral-wise-transformer-for","title":"Mask-guided Spectral-wise Transformer for Efficient Hyperspectral Image Reconstruction","arxiv_id":"2111.07910","date":"2021-11-15","proceeding":"CVPR 2022 1","authors":["Yuanhao Cai","Jing Lin","Xiaowan Hu","Haoqian Wang","Xin Yuan","Yulun Zhang","Radu Timofte","Luc van Gool"],"abstract":"Hyperspectral image (HSI) reconstruction aims to recover the 3D spatial-spectral signal from a 2D measurement in the coded aperture snapshot spectral imaging (CASSI) system. The HSI representations are highly similar and correlated across the spectral dimension. Modeling the inter-spectra interactions is beneficial for HSI reconstruction. However, existing CNN-based methods show limitations in capturing spectral-wise similarity and long-range dependencies. Besides, the HSI information is modulated by a coded aperture (physical mask) in CASSI. Nonetheless, current algorithms have not fully explored the guidance effect of the mask for HSI restoration. In this paper, we propose a novel framework, Mask-guided Spectral-wise Transformer (MST), for HSI reconstruction. Specifically, we present a Spectral-wise Multi-head Self-Attention (S-MSA) that treats each spectral feature as a token and calculates self-attention along the spectral dimension. In addition, we customize a Mask-guided Mechanism (MM) that directs S-MSA to pay attention to spatial regions with high-fidelity spectral representations. Extensive experiments show that our MST significantly outperforms state-of-the-art (SOTA) methods on simulation and real HSI datasets while requiring dramatically cheaper computational and memory costs. Code and pre-trained models are available at https://github.com/caiyuanhao1998/MST/","url_abs":"https://arxiv.org/abs/2111.07910v2","url_pdf":"https://arxiv.org/pdf/2111.07910v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"mask-guided-spectral-wise-transformer-for","repo_url":"https://github.com/caiyuanhao1998/MST","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"mask-guided-spectral-wise-transformer-for","repo_url":"https://github.com/caiyuanhao1998/MST-plus-plus","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"mask-guided-spectral-wise-transformer-for","repo_url":"https://github.com/wxy11-27/gmsr","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"mask-guided-spectral-wise-transformer-for","repo_url":"https://github.com/cmhungsteve/Awesome-Transformer-Attention","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"compressive-sensing","task_name":"Compressive Sensing"},{"task_slug":"image-reconstruction","task_name":"Image Reconstruction"},{"task_slug":"image-restoration","task_name":"Image Restoration"},{"task_slug":"spectral-reconstruction","task_name":"Spectral Reconstruction"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[{"slug":"cave","name":"CAVE","full_name":"Multispectral imaging using multiplexed illumination."},{"slug":"kaist","name":"KAIST","full_name":"High-quality hyperspectral reconstruction using a spectral prior"}],"methods_introduced":[],"results":[{"leaderboard":"/sota/spectral-reconstruction-on-arad-1k","task":"Spectral Reconstruction","dataset":"ARAD-1K","model":"MST-L","rank_in_archive_order":2,"of":11,"metrics":{"MRAE":"0.1772","PSNR":"33.90","RMSE":"0.0256"},"uses_additional_data":false},{"leaderboard":"/sota/spectral-reconstruction-on-cave","task":"Spectral Reconstruction","dataset":"CAVE","model":"MST-L","rank_in_archive_order":8,"of":10,"metrics":{"PSNR":"35.18","SSIM":"0.948"},"uses_additional_data":false},{"leaderboard":"/sota/spectral-reconstruction-on-kaist","task":"Spectral Reconstruction","dataset":"KAIST","model":"MST-L","rank_in_archive_order":8,"of":10,"metrics":{"PSNR":"35.18","SSIM":"0.948"},"uses_additional_data":false},{"leaderboard":"/sota/spectral-reconstruction-on-real-hsi","task":"Spectral Reconstruction","dataset":"Real HSI","model":"MST","rank_in_archive_order":6,"of":9,"metrics":{"User Study Score":"12"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2111.07910","atlas_url":"https://app.syntology.ai/?focus=2111.07910","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2111.07910"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/caiyuanhao1998/MST","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/cmhungsteve/Awesome-Transformer-Attention","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/wxy11-27/gmsr","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/caiyuanhao1998/MST-plus-plus","reach":null}],"summary":{"ran_draft_wrong":1,"ran_fixture":2},"by_repo_kind":{"official":{"samples":3,"ran":3,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"013ca1b768620edd","entry":"conv","repo":"caiyuanhao1998/MST","repo_kind":"official","path":"real/test_code/architecture/MST.py","file_url":"https://github.com/caiyuanhao1998/MST/blob/HEAD/real/test_code/architecture/MST.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"013ca1b768620edd"}},{"code_sha256_prefix":"d8d6ba766e739efd","entry":"shift_back","repo":"caiyuanhao1998/MST","repo_kind":"official","path":"real/test_code/architecture/MST.py","file_url":"https://github.com/caiyuanhao1998/MST/blob/HEAD/real/test_code/architecture/MST.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d8d6ba766e739efd"}},{"code_sha256_prefix":"c76d18678f19d332","entry":"trunc_normal_","repo":"caiyuanhao1998/MST","repo_kind":"official","path":"real/test_code/architecture/MST.py","file_url":"https://github.com/caiyuanhao1998/MST/blob/HEAD/real/test_code/architecture/MST.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c76d18678f19d332"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}