How li-yapeng/mambahsi works
MambaHSI is a hyperspectral-image classification research application. Its main workflow loads a selected dataset, samples labeled pixels into training, validation, and test splits, trains the spatial-spectral Mamba model, and reports classification metrics. The model implementation and evaluation utilities are sampled; some training-script sections are omitted, so uncertain connections to visualization and artifact-writing helpers are not asserted.
Main entry points: train_MambaHSI.py Training runner · MambaHSI.py MambaHSI network · data_load_operate.py Label sampling · evaluation.py Metric evaluation
Components 18
Data preparation
- Dataset loading
utils/data_load_operate.py - Image preparation
utils/HSICommonUtils.py - Label sampling
utils/data_load_operate.py - Image split maps
utils/data_load_operate.py
Classification model
- MambaHSI network
model/MambaHSI.py - Spatial Mamba
model/MambaHSI.py - Spectral Mamba
model/MambaHSI.py - Spatial-spectral fusion
model/MambaHSI.py - Classification head
model/MambaHSI.py
Training and evaluation
- Training runner
train_MambaHSI.py - Segmentation loss
utils/Loss.py - Metric evaluation
utils/evaluation.py
Results and visualization
- Classification metrics
- Prediction visualization
utils/visual_predict.py - Prediction and GT maps
Other components
- Researcher
- HSI datasets
- Mamba SSM
Connections 20
- Researcher → Training runner: starts run
- HSI datasets → Dataset loading: loads files
- Training runner → Dataset loading: loads dataset
- Training runner → Image preparation: stretches image
- Training runner → Label sampling: requests splits
- Label sampling → Image split maps: creates label maps
- Training runner → Image split maps: uses splits
- Training runner → MambaHSI network: constructs and trains
- MambaHSI network → Spatial Mamba: applies spatial modeling
- MambaHSI network → Spectral Mamba: applies spectral modeling
- MambaHSI network → Spatial-spectral fusion: combines branches
- Spatial-spectral fusion → Spatial Mamba: evaluates branch
- Spatial-spectral fusion → Spectral Mamba: evaluates branch
- MambaHSI network → Classification head: produces logits
- Spatial Mamba → Mamba SSM: invokes
- Spectral Mamba → Mamba SSM: invokes
- Training runner → Segmentation loss: computes loss
- Training runner → Metric evaluation: updates metrics
- Metric evaluation → Classification metrics: reports
- Prediction visualization → Prediction and GT maps: saves maps