← 开源
raghakot

keras-vis

Neural network visualization toolkit for keras

Model DevelopmentInterpretabilityPython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
2.99k
Star
633
Fork
+0
本周
8
贡献者
创建于 2016-11-11 · 更新于 2026-10-13 · 今日第 8216 名
主要开发者
raghakotkeisenahmedhosny

raghakot/keras-vis 排名第 8,216,有 2,992 个星标。

同类别比较

raghakot/keras-vis 排名第 8,216,此处有 8 个同类条目;benedekrozemberczki/pytorch_geometric_temporal 排名第 8,215。

同类别比较
名称排名指标
divamgupta/image-segmentation-keras8,207
语言:
Python
星标数:
3,001
分叉数:
1,145
简介:
Implementation of Segnet, FCN, UNet , PSPNet and other models in Keras.
keithito/tacotron8,210
语言:
Python
星标数:
2,998
分叉数:
935
简介:
A TensorFlow implementation of Google's Tacotron speech synthesis with pre-trained model (unofficial)
libffcv/ffcv8,212
语言:
Python
星标数:
2,995
分叉数:
181
简介:
FFCV: Fast Forward Computer Vision (and other ML workloads!)
benedekrozemberczki/pytorch_geometric_temporal8,215
语言:
Python
星标数:
2,992
分叉数:
402
简介:
PyTorch Geometric Temporal: Spatiotemporal Signal Processing with Neural Machine Learning Models (CIKM 2021)
sovrasov/flops-counter.pytorch8,220
语言:
Python
星标数:
2,982
分叉数:
307
简介:
Flops counter for neural networks in pytorch framework
ekzhu/datasketch8,231
语言:
Python
星标数:
2,971
分叉数:
323
简介:
MinHash, LSH, LSH Forest, Weighted MinHash, HyperLogLog, HyperLogLog++, LSH Ensemble and HNSW
zju3dv/LoFTR8,232
语言:
Jupyter Notebook
星标数:
2,971
分叉数:
419
简介:
Code for "LoFTR: Detector-Free Local Feature Matching with Transformers", CVPR 2021, T-PAMI 2022
mit-nlp/MITIE8,239
语言:
C++
星标数:
2,962
分叉数:
532
简介:
MITIE: library and tools for information extraction
关键参数与规格
关键参数与规格
参数值
语言Python
类别Model Development
子类别Interpretability
星标数2,992
分叉数633
贡献者8
创建日期2016-11-11
更新日期2026-10-13
1 天星标数0
7 天星标数0
排名8,216
上次排名8,277
排名变化61
7 天星标排名11,917
上次 7 天星标排名11,967
7 天星标排名变化50
总星标排名4,531
上次总星标排名4,529
总星标排名变化-2
国家USA
README 摘录

Keras Visualization Toolkit keras-vis is a high-level toolkit for visualizing and debugging your trained keras neural net models. Currently supported visualizations include: Activation maximization Saliency maps Class activation maps All visualizations by default support N-dimensional image inputs. , it generalizes to N-dim image inputs to your model. The toolkit generalizes all of the above as energy minimization problems with a clean, easy to use, and extendable interface. Compatible with both theano and tensorflow backends with 'channels_first

', 'channels_last' data format. Quick links Read the documentation at Join the slack channel for questions/discussions. We are tracking new features/tasks in waffle. Would love it if you lend us a hand and submit PRs. Getting Started In image backprop problems, the goal is to generate an input image that minimizes some loss function. Setting up an image backprop problem is easy. **Define weighted loss function** Various useful loss functions are defined in losses. A custom loss function

can be defined by implementing Loss. **Configure optimizer to minimize weighted loss** In order to generate natural looking images, image search space is constrained using regularization penalties. Some common regularizers are defined in regularizers. Like loss functions, custom regularizer can be defined by implementing Loss. Concrete examples of various supported visualizations can be found in examples folder. Installation 1) Install keras with theano or tensorflow backend. Note that this library requires Keras > 2. 0 2) Install keras-vis From sources

PyPI package Visualizations **NOTE: The links are currently broken and the entire documentation is being reworked. In the recent years, several approaches for understanding and visualizing Convolutional Networks have been developed in the literature. They give us a way to peer into the black boxes, diagnose mis-classifications, and assess whether the network is over/under fitting. Guided backprop can also be used to create trippy art, neural/texture style transfer among the list of other growing applications. Various visualizations

, documented in their own pages, are summarized here. Conv filter visualization *Convolutional filters learn 'template matching' filters that maximize the output when a similar template pattern is found in the input image. Visualize those templates via Activation Maximization. * Dense layer visualization *How can we assess whether a network is over/under fitting or generalizing well? * Attention Maps *How can we assess whether a network is attending to correct parts of the image in order to generate a decision? * Generating animated

gif of optimization progress It is possible to generate an animated gif of optimization progress by leveraging callbacks. Following example shows how to visualize the activation maximization for 'ouzel' class (output_index: 20). This is because we used Jitter, a kind of ImageModifier that is known to produce crisper activation maximization images. As an exercise, try: Without Jitter Varying various loss weights Citation Please cite keras-vis in your publications if it helped your research.

常见问题

记录了多少星标和分叉?

raghakot/keras-vis 有 2,992 个星标和 633 个分叉。

仓库排名是多少?

raghakot/keras-vis 排名第 8,216。

记录的语言和类别是什么?

raghakot/keras-vis 有 2,992 个星标,语言为 Python,类别为 Model Development。

哪个仓库排名最接近?

raghakot/keras-vis 与 benedekrozemberczki/pytorch_geometric_temporal 比较,后者排名第 8,215,有 2,992 个星标。

README

Keras Visualization Toolkit

keras-vis is a high-level toolkit for visualizing and debugging your trained keras neural net models. Currently supported visualizations include:

  • Activation maximization
  • Saliency maps
  • Class activation maps

All visualizations by default support N-dimensional image inputs. i.e., it generalizes to N-dim image inputs to your model.

The toolkit generalizes all of the above as energy minimization problems with a clean, easy to use, and extendable interface. Compatible with both theano and tensorflow backends with 'channels_first', 'channels_last' data format.

Quick links

Getting Started

In image backprop problems, the goal is to generate an input image that minimizes some loss function. Setting up an image backprop problem is easy.

Define weighted loss function

Various useful loss functions are defined in losses. A custom loss function can be defined by implementing Loss.build_loss.

from vis.losses import ActivationMaximization
from vis.regularizers import TotalVariation, LPNorm

filter_indices = [1, 2, 3]

# Tuple consists of (loss_function, weight)
# Add regularizers as needed.
losses = [
    (ActivationMaximization(keras_layer, filter_indices), 1),
    (LPNorm(model.input), 10),
    (TotalVariation(model.input), 10)
]

Configure optimizer to minimize weighted loss

In order to generate natural looking images, image search space is constrained using regularization penalties. Some common regularizers are defined in regularizers. Like loss functions, custom regularizer can be defined by implementing Loss.build_loss.

from vis.optimizer import Optimizer

optimizer = Optimizer(model.input, losses)
opt_img, grads, _ = optimizer.minimize()

Concrete examples of various supported visualizations can be found in examples folder.

Installation

  1. Install keras with theano or tensorflow backend. Note that this library requires Keras > 2.0

  2. Install keras-vis

From sources

sudo python setup.py install

PyPI package

sudo pip install keras-vis

Visualizations

NOTE: The links are currently broken and the entire documentation is being reworked. Please see examples/ for samples.

Neural nets are black boxes. In the recent years, several approaches for understanding and visualizing Convolutional Networks have been developed in the literature. They give us a way to peer into the black boxes, diagnose mis-classifications, and assess whether the network is over/under fitting.

Guided backprop can also be used to create trippy art, neural/texture style transfer among the list of other growing applications.

Various visualizations, documented in their own pages, are summarized here.

Conv filter visualization

Convolutional filters learn 'template matching' filters that maximize the output when a similar template pattern is found in the input image. Visualize those templates via Activation Maximization.

Dense layer visualization

How can we assess whether a network is over/under fitting or generalizing well?

Attention Maps

How can we assess whether a network is attending to correct parts of the image in order to generate a decision?

Generating animated gif of optimization progress

It is possible to generate an animated gif of optimization progress by leveraging callbacks. Following example shows how to visualize the activation maximization for 'ouzel' class (output_index: 20).

from keras.applications import VGG16

from vis.losses import ActivationMaximization
from vis.regularizers import TotalVariation, LPNorm
from vis.input_modifiers import Jitter
from vis.optimizer import Optimizer
from vis.callbacks import GifGenerator

# Build the VGG16 network with ImageNet weights
model = VGG16(weights='imagenet', include_top=True)
print('Model loaded.')

# The name of the layer we want to visualize
# (see model definition in vggnet.py)
layer_name = 'predictions'
layer_dict = dict([(layer.name, layer) for layer in model.layers[1:]])
output_class = [20]

losses = [
    (ActivationMaximization(layer_dict[layer_name], output_class), 2),
    (LPNorm(model.input), 10),
    (TotalVariation(model.input), 10)
]
opt = Optimizer(model.input, losses)
opt.minimize(max_iter=500, verbose=True, input_modifiers=[Jitter()], callbacks=[GifGenerator('opt_progress')])

Notice how the output jitters around? This is because we used Jitter, a kind of ImageModifier that is known to produce crisper activation maximization images. As an exercise, try:

  • Without Jitter
  • Varying various loss weights

Citation

Please cite keras-vis in your publications if it helped your research. Here is an example BibTeX entry:

@misc{raghakotkerasvis,
  title={keras-vis},
  author={Kotikalapudi, Raghavendra and contributors},
  year={2017},
  publisher={GitHub},
  howpublished={\url{https://github.com/raghakot/keras-vis}},
}
排名相邻
同类项目