• Stars
    star
    175
  • Rank 218,059 (Top 5 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ•΅οΈβ€β™‚οΈ Interpreting Convolutional Neural Network (CNN) Results.

Interpreting Convolutional Neural Network (CNN) Results

This repo contains the code for our talk "Demystifying the neural network black box". Slides are available on Speaker Deck.

Motivation

Convolutional Neural Networks (CNN) are state of the art when it comes to computer vision tasks such as image recognition and object detection. However, due to the high amount of architectural complexity, it is often difficult to interpret the decisions made by these networks. Luckily, there are several techniques available which can enhance our comprehension of CNN decisions. These techniques are generally divided into attribution and visualisation methods.

In one of our image classification projects at idealo, we wished to recognise the area of hotel property depicted in the images. There were several cases where images depicting a Swimming Pool area were misclassified as belonging to the Bathroom area. Some examples of such images are as below:

Misclassified Images

Using an attribution technique called Gradient Class Activation Maps (Grad-CAM), we were able to draw a heatmap that indicates the relative importance of different image areas in making the classification decision. Heatmaps for the above images are as below:

Heatmaps

This helped us discover a bias for using metallic rails as a means to misclassify images as belonging to Bathroom area.

On the other hand, visualization techniques helped us understand the patterns that neurons at different layers in the CNN might be learning. Some visualisations for a specific layer of MobileNet architecture fitted to our data are as below:

vis

These patterns usually get increasing complex as one progresses towards the output layer of a CNN.

Getting Started

In this repository, several interpretation techniques have been demonstrated with Google Colab notebooks. There is no need to clone this repository. Google Colab notebooks for attribution and visualisation methods can be launched in the browser by simply clicking the 'Open in Colab' icon in the respective sections below. Additionally, the 'Hardware accelerator' for Colab notebooks should be set to 'GPU' for a quicker run through the code. For a quick tutorial on Colab notebooks, check out this blog post.

Attribution techniques:

Open In Colab

Some of the attribution methods we have tried to explore are:

Visualization techniques

Open In Colab

Some of the visualization methods we have tried to explore are:

Acknowledgement

Several awesome Python packages have been used for this work:

LICENSE

See LICENSE for details.

More Repositories

1

imagededup

😎 Finding duplicate images made easy!
Python
5,072
star
2

image-super-resolution

πŸ”Ž Super-scale your images and run experiments with Residual Dense and Adversarial Networks.
Python
4,595
star
3

image-quality-assessment

Convolutional Neural Networks to predict the aesthetic and technical quality of images.
Python
2,059
star
4

imageatm

Image classification for everyone.
Python
215
star
5

mongodb-slow-operations-profiler

This java web application collects slow operations from one or multiple mongoDB system(s) in order to visualize and analyze them.
Java
192
star
6

mongodb-performance-test

multithreaded test tool to test mongodb performances, such as throughput and latency
Java
85
star
7

php-rdkafka-ffi

PHP Kafka client - binding librdkafka via FFI
PHP
76
star
8

terraform-aws-opensearch

Terraform module to provision an OpenSearch cluster with SAML authentication.
HCL
67
star
9

nvidia-docker-keras

Workflow that shows how to train neural networks on EC2 instances with GPU support and compares training times to CPUs
Python
60
star
10

falcon-prediction-app

Simple Machine Learning Web API Example with Falcon
Jupyter Notebook
50
star
11

terraform-emr-pyspark

Quickstart PySpark with Anaconda on AWS/EMR using Terraform
HCL
47
star
12

cloudwatch-alarm-to-ms-teams

Send CloudWatch Alarms to Microsoft Teams via an SNS topic.
TypeScript
33
star
13

terraform-aws-mwaa

Terraform module to setup Managed Workflows with Apache Airflow. (Airflow as managed service by AWS)
HCL
32
star
14

php-middleware-stack

Lightweight PHP 7+ middleware stack based on PSR-15 spec
PHP
29
star
15

jenkins-ci

Minimal example to setup a Jenkins-CI pipeline for data science projects on OpenShift in a couple of minutes.
Dockerfile
27
star
16

logback-redis

Logback Redis Appender with Pipeline-Support for maximum throughput
Java
24
star
17

spring-cloud-stream-binder-sqs

Amazon SQS for Spring Cloud Stream
Java
23
star
18

terraform-provider-controltower

Use AWS Control Tower from Terraform
Go
21
star
19

deckard

Easy-to-use Spring Kafka Producers
Java
16
star
20

flask-openshift-example

Simple Flask example using Docker to deploy on OpenShift 3.
Dockerfile
15
star
21

aws-signing-proxy

Golang HTTP Reverse Proxy to transparently sign requests to AWS endpoints
Go
10
star
22

idealo-orders-api-php-sdk

idealo Direktkauf PHP SDK
PHP
9
star
23

spring-cloud-stream-binder-sns

Amazon SNS for Spring Cloud Stream
Java
9
star
24

logstash-logback-http

Logstash Logback HTTP/HTTPS Appender
Java
8
star
25

idealo.design

idealo Design System Catalog hosted on https://idealo.design
JavaScript
6
star
26

spring-endpoint-exporter

A command-line utility that allows you to export all Endpoints of your Spring Boot Application in OpenAPI 3 format by scanning for specific classes in a jar file or on the file system without actually loading them.
Kotlin
6
star
27

aiven-metadata-prometheus-exporter

A prometheus exporter that provides metadata metrics on Aiven's "service" level
Go
5
star
28

idealo.github.io

Landing page for idealo.
JavaScript
3
star
29

setup-aaga-credentials-action

Securely access AWS from GitHub Actions
TypeScript
3
star
30

terraform-provider-csd

Terraform provider for the common domain product
Go
3
star
31

wheelwright

🎑 Automated build repo for Python wheels (based on spaCy's wheelwright repo)
Python
3
star
32

ds-example-project

Simple Python web application using Anaconda as the package manager. It is intended to be used along Jenkins-CI which is deployed on OpenShift.
Python
3
star
33

test-logger

Junit rule to silence logging for specific tests
Java
1
star
34

offerpage-pairing-task

Java
1
star
35

cctray-hub

github actions to cctray proxy
Kotlin
1
star
36

kafka-ex1

Java
1
star
37

spring-endpoint-exporter-action

An action for the Spring Endpoint Exporter that allows you to export all Endpoints of your Spring Boot Application in OpenAPI 3 format by scanning for specific classes in a jar file or on the file system without actually loading them.
Dockerfile
1
star