S2Mamba
The official code for the paper "S2Mamba: A Spatial-spectral State Space Model for Hyperspectral Image Classification" The code will be available soon.
Install / Use
/learn @PURE-melo/S2MambaREADME
S2Mamba
The official code for the paper "S2Mamba: A Spatial-spectral State Space Model for Hyperspectral Image Classification"
Get Started
Installation
pip install -i requirement.txt
Data Preparation
Download HSI datasets and put them into the ./data directory. For example:
'./data/IndianPine.mat'
'./data/Pavia.mat'
'./data/Houston.mat'
'./data/WHU-Hi-LongKou/WHU_Hi_LongKou.mat'
Data download link: https://pan.baidu.com/s/18wTlU9ERczOfUo8WVoHVnA?pwd=aak6 Password: aak6
Training and Testing
CUDA_VISIBLE_DEVICES=0 python demo_mamba.py --dataset='Indian' --epoches=400 --patches=7 --sess s2mamba --dropout 0.4 --lr 5e-4
CUDA_VISIBLE_DEVICES=0 python demo_mamba.py --dataset='Pavia' --epoches=400 --patches=11 --sess s2mamba --dropout 0.1 --lr 5e-4
CUDA_VISIBLE_DEVICES=0 python demo_mamba.py --dataset='Houston' --epoches=100 --patches=9 --sess s2mamba --dropout 0.1 --lr 1e-4
CUDA_VISIBLE_DEVICES=0 python demo_mamba.py --dataset='WHU_Hi_LongKou' --epoches=400 --patches=9 --sess s2mamba --dropout 0.4 --lr 5e-4
Acknowledgment
Our detection code is built upon SpectralFormer and Vmamba. We are very grateful to all the contributors to these codebases.
Citation
If you appreciate our work and find this repository helpful, please consider giving a citation:
@ARTICLE{s2mamba,
author={Wang, Guanchun and Zhang, Xiangrong and Peng, Zelin and Zhang, Tianyang and Jiao, Licheng},
journal={IEEE Transactions on Geoscience and Remote Sensing},
title={S2Mamba: A Spatial-spectral State Space Model for Hyperspectral Image Classification},
year={2025},
pages={1-1},
doi={10.1109/TGRS.2025.3530993}}
Related Skills
ai-cmo
Collection of my Agent Skills and books.
next
A beautifully designed, floating Pomodoro timer that respects your workspace.
product-manager-skills
38PM skill for Claude Code, Codex, Cursor, and Windsurf: diagnose SaaS metrics, critique PRDs, plan roadmaps, run discovery, and coach PM career transitions.
devplan-mcp-server
3MCP server for generating development plans, project roadmaps, and task breakdowns for Claude Code. Turn project ideas into paint-by-numbers implementation plans.
