Giter VIP home page Giter VIP logo

deeplearn_hsi's Introduction

Deep Learning on Hyperspectral Image Classification

This repository guarantees you to reproduce the results reported in the following two papers:

If you think it helpful, we would appreciate if you cite these papers in your work.

Setup

Install Dependencies

  • Theano

If you were using Ubuntu, simply type

    sudo apt-get install python-numpy python-scipy python-dev python-pip python-nose g++ libopenblas-dev git
    sudo pip install Theano

in your terminal. If you were not in Ubuntu, you can find all the information you need at here.

  • scikit-learn

Scikit-learn is used to run control group experiments, you can skip it if you don't care about reproducing those SVM results or confusion matrices. To install it, simply type the following command:

    pip install -U scikit-learn
  • PIL

PIL is used to visualize weights and classification results on the whole image. It could also be skipped. To install it, type:

    sudo apt-get install libjpeg libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev
    pip install PIL
  • CUDA

If you have a CUDA enabled GPU with you, that would save you a lot of time. But it is still OK to run all the experiments without GPU, at the expense of more patience.

Download and prepare the datasets

Download the two datasets used in the paper by typing the corresponding commands into your terminal:

  • Pavia University scene

     wget http://www.ehu.eus/ccwintco/uploads/e/ee/PaviaU.mat
     wget http://www.ehu.eus/ccwintco/uploads/5/50/PaviaU_gt.mat
    
  • Kennedy Space Center (KSC)

     wget http://www.ehu.es/ccwintco/uploads/2/26/KSC.mat
     wget http://www.ehu.es/ccwintco/uploads/a/a6/KSC_gt.mat
    

Change the loading directory in each .py file to wherever you store your datasets.

Reproducing the results

  1. To train a stacked autoencoder on spectral information, execute

     python pavia_SdA.py
    

    for Pavia dataset, or

     python ksc_SdA.py
    

    for KSC dataset.

    These experiments correspond to the classical way of classifying spectra, without considering the spatial correlations in HSI.

  2. To train the model on spatial information, execute

     python pavia_spatial_SdA.py
    

    for Pavia dataset, or

     python ksc_spatial_SdA.py
    

    for KSC dataset.

    These experiments extract features in a novel way. Those features emphasize on spatial correlations in an HSI dataset. It shows that even discarding the majority of spectral dimensions, classification could still be performed successfully.

  3. To train the model on joint spectral-spatial information, execute

     python pavia_joint_SdA.py
    

    for Pavia dataset, or

     python ksc_joint_SdA.py
    

    for KSC dataset.

    These experiments utilizes both spectral and spatial information. They reach the state-of-the-art on both datasets, surpassing a SVM with heavily tuned parameters.

Contact:

Zhouhan Lin: zhouhan.lin [at] umontreal.ca

deeplearn_hsi's People

Contributors

hantek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.