Code Monkey home page Code Monkey logo

ace's Introduction

ACE

ACE: Towards Automatic Concept Based Explanations

Getting Started

Here is the tensorflow implementations of the paper Towards Automatic Concept-based Explanations presented at NeurIPS 2019.

Prerequisites

Required python libraries:

  Scikit-image: https://scikit-image.org/
  Tensorflow: https://www.tensorflow.org/
  TCAV: https://github.com/tensorflow/tcav

Installing

An example run command:

python3 run_ace.py --num_parallel_runs 0 --target_class Zebra --source_dir SOURCE_DIR ---working_dir SAVE_DIR --model_to_run InceptionV3 --model_path PATH_TO_MODEL_CHECKPOINT --bottlenecks mixed_8 --num_test 20 --num_random_exp 40 --max_imgs 50 --min_imgs 30 --test_dir TEST_DIR 

where:

num_parallel_runs: Number of parallel jobs (loading images, etc). If 0, parallel processing is deactivated.
target_class: Name of the class to be explained.
SOURCE_DIR: Directory where the discovery images (refer to the paper) are saved. 
It should contain (at least) two folders: 
1-"target_class" which contains images of the class to be explained. 
2-"random_discovery" which contains randomly selected images of the same dataset.
SAVE_DIR: Where the experiment results (both text report and the discovered concept examples) are saved.
model_to_run: One of InceptionV3 or GoogleNet is supported. You can change the "make_model" function in ace_helpers.py to have your own customized model.
model_path: Path to the model's saved graph.
TEST_DIR: Used for the profile classifier experiment (not part of the paper).
If None, the profile classifier experiment is not performed.
Same as source_dir:
1-"Name of the target class (here zebra)" which contains test images of the class to be explained. 
2-"random_test" which contains test images randomly selected from the test data.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

Work was done as part of Google Brain internship.

ace's People

Contributors

tabularml avatar

Watchers

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