Official PyTorch implementation of the paper Entropic Gradient Archetypal Analysis for Blind Hyperspectral Unmixing
This repository mainly implements the entropic gradient archetypal analysis method for blind hyperspectral unmixing.
In addition, we include various unmixing methods (supervised and blind) on several standard real datasets.
The authors kindly ask users to cite EDAA in their publications if they use it in their research:
A. Zouaoui, G. Muhawenayo, B. Rasti, J. Chanussot, J. Mairal, "Entropic descent archetypal analysis for blind hyperspectral unmixing", in IEEE Transactions on Image Processing, doi: 10.1109/TIP.2023.3301769
This repository was developed using Ubuntu 20.04 LTS, Python 3.8.8 and MATLAB 2020b.
We recommend using conda
to handle the Python distribution and pip
to install the Python packages.
conda create --name edaa --file conda.txt
Activate the new conda
environment to install the Python packages and run the code:
conda activate edaa
git clone https://github.com/inria-thoth/EDAA
cd EDAA && pip install -r requirements.txt
It is possible to run the NMF-QMV code inside Python to make sure that the reported results are consistent across methods.
To install matlab.engine
, first visit the official webpage.
- Locate
matlabroot
(e.g.~/softwares/matlab-2020b/
) - Create a
matlab
build directory (e.g.~/matlab/
) - Locate your current
conda
environment (e.g.~/conda/envs/hsu
)
cd $matlabroot/extern/engines/python
conda activate edaa
python setup.py build -b ~/matlab install --prefix ~/conda/envs/edaa
The data can be downloaded from http://pascal.inrialpes.fr/data2/azouaoui/data.zip.
To extract it in the appropriate ./data
directory, simply run:
python -m utils.prepare_datasets
If for whatever reasons you were not able to use the script above:
- Download the file directly from the link.
- Create a new folder
./data
in the root folder of this repository. - Extract
data.zip
into./data
. - You should have all 7 datasets directly available in the
./data
folder.
This repository uses hydra to seamlessly manage different configurations over the command line.
To run the EDAA
model on the Samson
dataset, use the following command:
python main.py dataset=Samson mode=blind model=BlindEDAA
The different datasets available are listed under ./hsi_unmixing/config/dataset
:
- Samson
- JasperRidge
- Urban{4,5,6}
- TinyAPEX
- WDC
To run the EDAA
model on all datasets, use the following command:
python main.py dataset=Samson,JasperRidge,Urban4,Urban6,TinyAPEX,WDC mode=blind model=BlindEDAA --multirun
This repository implements other supervised and blind hyperspectral unmixing techniques:
- Supervised methods
- FCLSU using
VCA
(Python implementation) and DecompSimplex (DS
) fromSPAMS
. - FCLSU using
VCA
(Python implementation) andFCLS
frompysptools
(slower).
- FCLSU using
Command to run FCLSU using VCA+DS on Samson:
python main.py dataset=Samson mode=supervised torch=False model=DS initializer=VCA
- Blind methods
NMF-QMV
using a Python wrapper on the Matlab implementation.- Archetypal Analysis (
AA
) fromSPAMS
. - Robust AA (
RAA
) fromSPAMS
.
Command to run AA
on Samson:
python main.py dataset=Samson mode=blind torch=False model=AA