Code Monkey home page Code Monkey logo

mdl4ow's Introduction

MDL4OW

Source code and annotations for :

Shengjie Liu, Qian Shi, and Liangpei Zhang. Few-shot Hyperspectral Image Classification With Unknown Classes Using Multitask Deep Learning. IEEE TGRS, 2020. doi:10.1109/TGRS.2020.3018879

Contact: [email protected]

Code and annotations are released here, or check https://github.com/sjliu68/MDL4OW

Overview

Ordinary: misclassify road, house, helicopter, and truck

Below is a normal/closed classification. If you are familiar with hyperspectral data, you will notice some of the materials are not represented in the training samples. For example, for the upper image (Salinas Valley), the road and the houses between farmlands cannot be classified into any of the known classes. But still, a deep learning model has to assign one of the labels, because it is never taught to identify an unknown instance.

What we do: mask out the unknown in black

What we do here is, by using multitask deep learning, enpowering the deep learning model with the ability to identify the unknown: those masked with black color. For the upper image (Salinas Valley), the roads and houses between farmlands are successfully identified. For the lower image (University of Pavia Campus), helicopters and trucks are successfully identified.

Key packages

tensorflow-gpu==1.9
keras==2.1.6
libmr

Tested on Python 3.6, Windows 10

Recommend Anaconda, Spyder

How to use

Hyperspectral satellite images

The input image is with size of imx×imy×channel.

The satellite images are standard data, downloaded here: http://www.ehu.eus/ccwintco/index.php/Hyperspectral_Remote_Sensing_Scenes

The above data is in matlab format, the numpy format can be found here (recommended): https://drive.google.com/file/d/1cEpTuP-trfRuphKWqKHjAaJhek5sqI3C/view?usp=sharing

Quick usage

python demo_salinas.py

Arguments

--nos: number of training samples per class. 20 for few-shot, 200 for many-shot
--key: dataname: 'salinas', 'paviaU', 'indian'
--gt: gtfile path
--closs: classification loss weight, default=50 (0.5)
--patience: if the training loss does not decrease for {patience} epoches, stop training
--output: save path for output files (model, predict probabilities, predict labels, reconstruction loss)
--showmap: save classification map

Evaluation code update on 18 May 2021

When using the evaluation code "z20210518a_readoa.py", you should change the parameter "mode" for different settings. The inputs are output files from the training script.

Mode

mode==0: closed-set
mode==1: MDL4OW
mode==2: MDL4OW/C
mode==3: closed-set with probablity
mode==4: softmax with threshold
mode==5: openmax

mdl4ow's People

Contributors

sjliu68 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mdl4ow's Issues

anyone blocked in pip install libmr

i create a new virtual env using anaconda, and i get a error when pip install libmr and cant solve it.
the log is:
Collecting libmr
Cache entry deserialization failed, entry ignored
Using cached https://files.pythonhosted.org/packages/f3/48/f9d43abb742cbebec15933a052042da84d682da2142e803a0c1fa4524210/libmr-0.1.9.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-ht5g3565/libmr/setup.py", line 17, in
language="c++",
File "/home/lz/.conda/envs/polar_sar/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 579, in cythonize
aliases=aliases)
File "/home/lz/.conda/envs/polar_sar/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 503, in create_extension_list
explicit_modules = set([m.name for m in patterns if isinstance(m, Extension)])
TypeError: 'Extension' object is not iterable

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ht5g3565/libmr/

if anyone has useful advice, thanks very much

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.