/category_selectivity_cnn

Analyze filters category preferences in CNN

Primary LanguageJupyter NotebookMIT LicenseMIT

CNN filters category selectivity

Run notebooks online: Binder

This project helps to understand a CNN's properties:

  • which layer contains filters sensitive to a certain category
  • what kind of image categories activate particular filter
  • which layer to choose for latent feature extraction for a given category

VGG16 from keras.applications is used as a CNN model.

CNN Filters category selectivity

Prerequisites

Required libraries

keras
plotly
ipywidgets

How to:

  1. Put your images into a folder, containing subfolders for every category you are interested in.
  2. Lauch category_selectivity.ipynb to get the activations and measure category selectivity for each filter from chosen layers.
  3. Go to plot_filter_selectivity.ipynb to visualize the results.

Category Selectivity

To measure neuron's preferences towards a category, I propose to normalize the neurons responses first and, then, to measure a proportion of activativations related the category:

equation

equation

Authors

License

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