Home

Awesome

Semi-Supervised Hyperspectral Image Classification Using a Probabilistic Pseudo-Label Generation Framework

IEEE Transactions on Geoscience and Remote Sensing (2022)

PWC

Paper | [preprint]

Pytorch implementation of the residual center-based pseudo label generator (Res-CP) for classification of hyperspectral images. Please kindly note that this code cannot reproduce the exact results that reported in this Paper. The accuracy results are reported based on Keras-Tensorflow implementation, which will be released soon!

alt text

BibTeX

@article{seydgar2022semi,
title={Semi-Supervised Hyperspectral Image Classification Using a Probabilistic Pseudo-Label Generation Framework},
author={Seydgar, Majid and Rahnamayan, Shahryar and Ghamisi, Pedram and Bidgoli, Azam Asilian},
journal={IEEE Transactions on Geoscience and Remote Sensing},
year={2022},
publisher={IEEE}
}

Install

If you have installed Anaconda and Git on your operating system, simply run the following codes in your terminal (command prompt in Windows).

# step 1. clone this repo
git clone https://github.com/majidseydgar/Res-CP.git
cd Res-CP

# step 2. create a conda virtual environment and activate it
conda create -n ResCP python=3.6 -y
conda activate ResCP
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
pip install scikit-learn scipy tqdm matplotlib argparse

Alternatively, you can manually download the repository, and then install the packages by using pip.

# Optional solution for step 2: install libs step by step
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
pip install scikit-learn scipy tqdm matplotlib argparse

Model Zoo

News & Updates:

Datasets

The .mat files of the University of Pavia, Salinas, and Kennedy space center are publicly available at: www.ehu.eus To produce .mat files of University of Houston, please see the tutorial of Shuguang Dou.
Place University of Pavia and its ground truth in "Dataset/UP/" folder.
Place Salinas and its ground truth in "Dataset/SA/" folder.
Place Kennedy space center and its ground truth in "Dataset/KSC/" folder.
After generating University of Houston after .mat files, place them in "Dataset/UH/" folder.

Usage

The framework contains three main components, 1-RCN for feature embedding (encoding), 2-PLG for pseudo label generation, and 3-Classifications to perform classifications using the generated pseudo labels and test the model on real ground truth.

You can open the terminal in a main directory (Res-CP)

1-RCN (feature encoding)

If you want to reproduce the embedding features, open the terminal in the main directory ("Res-CP" folder) and then run:

# train University of Pavia
python 1-RCN/main.py --dataset SA --emb

You can replace UP, KSC, or UH instead of SA after--dataset to reproduce the features for other datasets, as well.
Note that --emb flag automatically create "log/1-RCN" parent folder and exports the embedded features in the "log/1-RCN/embeddings" folder.

2-PLG (pseudo label generator)

3-Classifications

After generating the pseudo labels, open the terminal in the main directory ("Res-CP" folder) and then run:

python 3-Classifications/main.py --dataset SA

You can add the --model flag to change the classification model. Currently, the SSRN is a default classification model.
The PRCLSTM and the PRCLSTMII will be added soon.

Acknowledgment

Our implementation is, mainly, based on the following repositories. We gratefully thank the authors for their wonderful works.

pytorch-center-loss, A2S2K-ResNet, ImageNet-Example,