This repository contains the code for reproducing the experiments in Semi-NMF Regularization-Based Autoencoder Training for Hyperspectral Unmixing. Design of the semi-NMF objective can be found in Algorithm.pdf
.
- Docker 19.03.12
- PyTorch 1.9.0
- Python 3.7.10
The dataset is publicly available and can be found here.
Download the Samson dataset from the above-mentioned source. Follow the directory tree given below:
|-- [root] HyperspecAE\
|-- [DIR] data\
|-- [DIR] Samson\
|-- [DIR] Data_Matlab\
|-- samson_1.mat
|-- [DIR] GroundTruth
|-- end3.mat
|-- end3_Abundances.fig
|-- end3_Materials.fig
Using a docker image requires an NVIDIA GPU. If you do not have a GPU please follow the directions for installing from source. In order to get GPU support you will have to use the nvidia-docker2 plugin. The docker image is cached on the GPU with id 0. In case of OOM errors at training, pass two GPUs.
# Build the Dockerfile to create a Docker image.
docker build -t dgoel04/snreg:1.0 .
# This will create a container from the image we just created.
docker run -it --gpus '"device=gpu-ids"' dgoel04/snreg:1.0
-
Install the data by following the steps shown under installation.
-
Clone this repository.
git clone https://github.com/dv-fenix/SemiNMF-Autoencoders.git
cd SemiNMF-Autoencoders
-
Install the requirements given in
requirements.txt
.
python -m pip install -r requirements.txt
-
Change working directory.
cd run
The code is fairly modular and can be run from the terminal.
# For more information on the optional experimental setups and configurations.
python ../src/train.py --help
# You can manually change the arguments in samson_train.sh to choose the different autoencoder configurations.
sh samson_train.sh
Please make sure that all the arguments are to your liking before getting started with the training!
Please ensure that the arguments contained within extract.sh
match those used in samson_train.sh
during training.
# You can manually change the arguments in experiments.sh to choose the different configurations.
sh extract.sh
If you use this code, please cite our paper:
@inproceedings{goel2024semi,
title={Semi-NMF Regularization-Based Autoencoder Training for Hyperspectral Unmixing},
author={Goel, Divyam and Khanna, Saurabh},
booktitle={2024 National Conference on Communications (NCC)},
pages={1--6},
year={2024},
organization={IEEE}
}