An open-source HyperSpectral Unmixing Python Package
HySUPP is an open-source Python toolbox for hyperspectral unmixing practitioners.
- 3 unmixing categories
- 20 unmixing methods
- 4 metrics
- 3 simulated datasets (located under
./data/
) - 1 real-world dataset (located under
./data/
)
HySUPP is distributed under MIT license.
Rasti, B., Zouaoui, A., Mairal, J., & Chanussot, J. (2024). Image Processing and Machine Learning for Hyperspectral Unmixing: An Overview and the HySUPP Python Package. IEEE Transactions on Geoscience and Remote Sensing, doi: 10.1109/TGRS.2024.3393570 .
We recommend using a conda
virtual Python environment to install HySUPP.
In the following steps we will use conda
to handle the Python distribution and pip
to install the required Python packages.
If you do not have conda
, please install it using Miniconda.
conda create --name hysupp python=3.10
Activate the new conda
environment to install the Python packages.
conda activate hysupp
Clone the Github repository.
git clone [email protected]:BehnoodRasti/HySUPP.git
Change directory and install the required Python packages.
cd HySUPP && pip install -r requirements.txt
If you encounter any issue when installing spams
, we recommend reading the Installation section here.
For windows users, we suggest removing line 10 in the requirements.txt (spams==2.6.5.4), and after installing the requirements, install spams using pip install spams-bin.
This toolbox uses MLXP to manage multiple experiments built on top of hydra.
There are a few required parameters to define in order to run an experiment:
data
: hyperspectral unmixing datasetmodel
: unmixing modelSNR
: input SNR (optional)mode
: unmixing mode (no longer needed!)
An example of a corresponding command line is simply:
python unmixing.py data=DC1 model=SUnAA SNR=30
Datasets consist in a dedicated .mat
file containing the following keys:
Y
: original hyperspectral image (dimensionL
xN
)E
: ground truth endmembers (dimensionL
xp
)A
: ground truth abundances (dimensionp
xN
)H
: HSI number of rowsW
: HSI number of columnsp
: number of endmembersL
: number of channelsN
: number of pixels (N
==H
*W
)
For sparse unmixing, a dictionary D
containing M
atoms is required.
D
: endmembers library (dimensionL
xM
)M
: number of atoms
We provide a utility script to turn any existing datasets composed of separated files to fit the required format used throughout the toolbox (See utils/bundle_data.py
).
You may need to fine-tune the models' parameters for your application. Every method has a dedicated .yaml file located at config/model, which indicates the relevant parameters you can use for fine-tuning. For instance, for SUnCNN, the parameters are indicated in config/model/SUnCNN.yaml, and we can change the number of iterations and the input of the CNN with the following line.
python unmixing.py mode=semi data=DC1 model=SUnCNN projection=True model.niters=8000 model.noisy_input=False noise.SNR=30