{"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/factoformer-factorized-hyperspectral","title":"FactoFormer: Factorized Hyperspectral Transformers with Self-Supervised Pretraining","arxiv_id":"2309.09431","date":"2023-09-18","proceeding":null,"authors":["Shaheer Mohamed","Maryam Haghighat","Tharindu Fernando","Sridha Sridharan","Clinton Fookes","Peyman Moghadam"],"abstract":"Hyperspectral images (HSIs) contain rich spectral and spatial information. Motivated by the success of transformers in the field of natural language processing and computer vision where they have shown the ability to learn long range dependencies within input data, recent research has focused on using transformers for HSIs. However, current state-of-the-art hyperspectral transformers only tokenize the input HSI sample along the spectral dimension, resulting in the under-utilization of spatial information. Moreover, transformers are known to be data-hungry and their performance relies heavily on large-scale pretraining, which is challenging due to limited annotated hyperspectral data. Therefore, the full potential of HSI transformers has not been fully realized. To overcome these limitations, we propose a novel factorized spectral-spatial transformer that incorporates factorized self-supervised pretraining procedures, leading to significant improvements in performance. The factorization of the inputs allows the spectral and spatial transformers to better capture the interactions within the hyperspectral data cubes. Inspired by masked image modeling pretraining, we also devise efficient masking strategies for pretraining each of the spectral and spatial transformers. We conduct experiments on six publicly available datasets for HSI classification task and demonstrate that our model achieves state-of-the-art performance in all the datasets. The code for our model will be made available at https://github.com/csiro-robotics/factoformer.","url_abs":"https://arxiv.org/abs/2309.09431v4","url_pdf":"https://arxiv.org/pdf/2309.09431v4.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":"factoformer-factorized-hyperspectral","repo_url":"https://github.com/csiro-robotics/factoformer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2309.09431","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2309.09431"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+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/csiro-robotics/factoformer","reach":{"status":"ok","spdx":"NOASSERTION"}}],"summary":{"ran":10,"unverified":3},"by_repo_kind":{"official":{"samples":13,"ran":10,"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":13,"samples":[{"code_sha256_prefix":"1dec89afc710fbfa","entry":"chooose_train_and_test_point","repo":"csiro-robotics/factoformer","repo_kind":"official","path":"utils/data_loader.py","file_url":"https://github.com/csiro-robotics/factoformer/blob/HEAD/utils/data_loader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"1dec89afc710fbfa"}},{"code_sha256_prefix":"68b2a45f838db749","entry":"choose_train_and_test_point","repo":"csiro-robotics/factoformer","repo_kind":"official","path":"pretraining/dataloader_utils.py","file_url":"https://github.com/csiro-robotics/factoformer/blob/HEAD/pretraining/dataloader_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"68b2a45f838db749"}},{"code_sha256_prefix":"c296f4a8cfc9ac54","entry":"gain_neighborhood_pixel","repo":"csiro-robotics/factoformer","repo_kind":"official","path":"pretraining/dataloader_utils.py","file_url":"https://github.com/csiro-robotics/factoformer/blob/HEAD/pretraining/dataloader_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"c296f4a8cfc9ac54"}},{"code_sha256_prefix":"e089eede6a58cbab","entry":"gen_mask","repo":"csiro-robotics/factoformer","repo_kind":"official","path":"pretraining/vit_models.py","file_url":"https://github.com/csiro-robotics/factoformer/blob/HEAD/pretraining/vit_models.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"e089eede6a58cbab"}},{"code_sha256_prefix":"28fcf01c3871bad4","entry":"get_sinusoid_encoding_table","repo":"csiro-robotics/factoformer","repo_kind":"official","path":"pretraining/utils.py","file_url":"https://github.com/csiro-robotics/factoformer/blob/HEAD/pretraining/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"28fcf01c3871bad4"}},{"code_sha256_prefix":"7afe3863c41fa95a","entry":"load_pretrained","repo":"csiro-robotics/factoformer","repo_kind":"official","path":"utils/misc.py","file_url":"https://github.com/csiro-robotics/factoformer/blob/HEAD/utils/misc.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"7afe3863c41fa95a"}},{"code_sha256_prefix":"0632677770db23ce","entry":"mirror_hsi","repo":"csiro-robotics/factoformer","repo_kind":"official","path":"pretraining/dataloader_utils.py","file_url":"https://github.com/csiro-robotics/factoformer/blob/HEAD/pretraining/dataloader_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"0632677770db23ce"}},{"code_sha256_prefix":"1d96301a106f92ef","entry":"mirror_hsi","repo":"csiro-robotics/factoformer","repo_kind":"official","path":"utils/data_loader.py","file_url":"https://github.com/csiro-robotics/factoformer/blob/HEAD/utils/data_loader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"1d96301a106f92ef"}},{"code_sha256_prefix":"80427e46046049d9","entry":"train_epoch","repo":"csiro-robotics/factoformer","repo_kind":"official","path":"utils/train_utils.py","file_url":"https://github.com/csiro-robotics/factoformer/blob/HEAD/utils/train_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"80427e46046049d9"}},{"code_sha256_prefix":"c78aaf57ee1ae7f8","entry":"valid_epoch","repo":"csiro-robotics/factoformer","repo_kind":"official","path":"utils/train_utils.py","file_url":"https://github.com/csiro-robotics/factoformer/blob/HEAD/utils/train_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"c78aaf57ee1ae7f8"}},{"code_sha256_prefix":"77e17928d8e92b17","entry":"accuracy","repo":"csiro-robotics/factoformer","repo_kind":"official","path":"pretraining/train_utils.py","file_url":"https://github.com/csiro-robotics/factoformer/blob/HEAD/pretraining/train_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"77e17928d8e92b17"}},{"code_sha256_prefix":"5637b67ff7832281","entry":"cal_results","repo":"csiro-robotics/factoformer","repo_kind":"official","path":"pretraining/train_utils.py","file_url":"https://github.com/csiro-robotics/factoformer/blob/HEAD/pretraining/train_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5637b67ff7832281"}},{"code_sha256_prefix":"dfc15802c2295917","entry":"output_metric","repo":"csiro-robotics/factoformer","repo_kind":"official","path":"pretraining/train_utils.py","file_url":"https://github.com/csiro-robotics/factoformer/blob/HEAD/pretraining/train_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dfc15802c2295917"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}