Giter Club home page Giter Club logo

input-dropout-for-spatially-aligned-modalities's Introduction

Input Dropout for Spatially Aligned Modalities

PyTorch code for the paper Input Dropout for Spatially Aligned Modalities, ICIP 2020 (https://arxiv.org/pdf/2002.02852.pdf)

Two assumptions:

  1. All input modalities are spatially aligned (that must be true).
  2. RGB modality is the only modality available at test time (this assumption is for the paper only, you can make the change in the code).

Approach:

The additional modality is first channel-wise concatenated to the RGB image, and the resulting tensor is fed as input to the neural network. The first convolutional layer of the network must be adapted to this new input dimensionality. At training time, one of the input modalities is randomly set to 0 with probability between 0 and 1. This effectively “drops out” the corresponding modality. At test time, the additional modality is always set to 0. Since we assume a single additional modality is combined with an RGB image, we are faced with two options. We could randomly drop only the additional modality and always keep the RGB (we dub this option addit), or drop either the RGB or the additional modality (we dub this option both). In these two cases, a uniform probability distribution for the different possible cases is used.

How can I put Input Dropout in my problem? (InputDropout.py)

To use the proposed method, simply take the code block from the InputDropout.py file named InputDropout. This block is used exactly like a PyTorch transform function. As an argument, just put the drop mode (either both or addit). It is very easy to modify this code if you want to experiment with two additional modalities for example. The limits are your imagination.

Easy example, showing how to use Input Dropout, but not really improving performance (main_cifar10.py):

A simple example of how to use this code is as follows: take CIFAR-10, duplicate the dataset and make the copy black and white (BW). So now we have RGB and BW pairs. We just have to concatenate these pairs to obtain a 4-channel RGB-BW image. In this example, you can easily test the different Input Dropout modes. See the code for more details.

Poster:

Poster

input-dropout-for-spatially-aligned-modalities's People

Contributors

scienceseb avatar

Stargazers

 avatar  avatar

Forkers

zfangithub6666

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.