GithubHelp home page GithubHelp logo

mugen-chen / c2am Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yiping-wang/c2am

0.0 0.0 0.0 28.89 MB

Causal Class Activation Map

License: MIT License

Shell 0.06% Python 2.33% Jupyter Notebook 97.61%

c2am's Introduction

Causal Class Activation Maps for Weakly-Supervised Semantic Segmentation

  • Causal CAM (C^2AM), is a simple yet effective algorithm for enhancing CAM quality. It requires no extra parameters, modification of the classification network architecture, or manipulating of the images. Further, the implementation of C^2AM is also straightforward, it only requires one additional line of code.
# Classification forward pass
x = cls_model(imgs) # x.shape == B * 20 
# Multiply with Global CAM
# x = x.unsqueeze(2).unsqueeze(2) * global_cam # x.shape == B * 20 * H * W
# Mean Pooling
# x = torch.mean(x, dim=(2, 3)) # x.shape == B * 20
# Ours
x = torch.mean(x.unsqueeze(2).unsqueeze(2) * global_cam, dim=(2, 3))
# Loss
loss = torch.nn.BCELoss()(x, labels)
  • We evaluated C^2AM on PASCAL VOC 2012 and achieved mIOU 69.6% of the pseudo mask generation on the training set, and mIOU 67.5% and 67.7% on validation and test set when training DeepLabV2 on the seed masks.

  • Weights are released at here.

Class Activation Map to Segmentation Pipeline

Structural Causal Models

Acknowledgement

Code is based on the IRN implemented by jiwoo-ahn.

c2am's People

Contributors

yiping-wang 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.