Coder Social home page Coder Social logo

sodagh / gain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ngxbac/gain

0.0 0.0 0.0 89 KB

Pytorch implementation of paper: [Tell Me Where to Look: Guided Attention Inference Network](http://openaccess.thecvf.com/content_cvpr_2018/papers/Li_Tell_Me_Where_CVPR_2018_paper.pdf)

Dockerfile 3.26% Shell 2.06% Python 94.69%

gain's Introduction

GAIN Framework

GAIN framework allows model to focus on a specific areas of object by changing the attention maps (Grad-CAM).
The flow of the framework is summarized as follow:

  • First, we should register the feed-forward and backward of the last convolution layer (or block).
  • Model generates the attention maps (Grad-CAM) from forward features and backward features then normalize it by using threshold and sigmoid function.
  • Now, the attention maps covers almost important information of the object. We want to tell the model those kind of areas are important for the task. It can be done by applying attention maps into the original image. Let imagine that the masked_image now is containing useless information. When we feed masked_image into the model again, we expect that the prediction score is as low as possible. That is the idea of attention mining in the paper.
  • The losses are computed at GAINCriterionCallback

In this implementation, I select resnet50 as the base-model to perform GAIN framework. You can change the backbone and it's gradient layer as you want.

Train GAIN

bash bin/train_gain.sh 

gain's People

Contributors

ngxbac 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.