神经网络层的输出在哪些方面有用? [英] In what ways are the output of neural network layers useful?

查看:145
本文介绍了神经网络层的输出在哪些方面有用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在与keras合作,并希望可视化每个图层的输出.可视化神经网络输出的层时(如下面的示例),用于MNIST手写体数字识别.

I'm currently working with keras and want to visualize the output of each layer. When having a visualisation of a layer of a neural networks output, like the example below, which is for MNIST handwriting number recognition.

  1. 研究人员从这些图像中获得什么信息或见识
  2. 这些图像如何解释
  3. 如果您选择查看图层的输出,那么选择的标准是什么?

任何评论或建议,我们将不胜感激.谢谢.

Any comment or suggestion is greatly appreciated. Thank you.

推荐答案

前言:卷积网络是应用于图像各部分(步幅,在gif中可见)的滤镜的集合. .如果给定的图像子部分与滤镜匹配,它们会产生true/false标签.

Preface: A convolutional network is a collection of filters applied to sections of an image (strides, which are seen in the gif). They produce true/false labels for if a given sub-section of the image matches the filter.

在我看来,您所提供的图像中所看到的并不是这些可视化工作方式的最佳表示,因为它们可视化了CNN如何通过每个神经元感知整个图像.这意味着它们看起来都非常相似.

What you're seeing in the images you provide is not the best representation of how these visualizations work in my opinion, as they visualise how the CNN percieves the whole image, through each neuron. This means all of them look very similar.

在此可以更好地表示网络的基本过滤器的外观.其中一些会在直线上触发,另一些会在水平线上触发.这也是您链接的图像所显示的内容,除了对整个图像而言,它是在视觉上简单的对象上显示的,这使它变得有点难以理解. 当您找到基于这些基本过滤器的更复杂的过滤器时,最好将整个图像可视化.

Here is a better representation of how the basic filters of a network might look like. Some of them will trigger on straight lines, others will trigger on horizontal lines. That is also what the image you linked shows, except it does so for the whole image, on a visually simple object, which makes it a bit more difficult to understand. When you get to more complex filters which build on top of these basic filters, you might be better off visualizing the entire image.

还有一个称为转移学习的概念,您可以在其中采用受到高度重视的现有通用模型,然后尝试将其应用于您的特定问题.这些模型通常需要进行调整,这可能意味着删除一些不需要的层(因为我们保留的每一层通常通常要花更多的时间进行训练),和/或添加更多的层.

There is also a concept called transfer learning, where you take existing generalized models that are highly regarded, and try to apply these to your specific problem. These models often need to be tuned, which might mean removing some layers that are not needed (as each layer we keep means it's usually more time-consuming to train), and/or adding more layers.

研究人员将能够更好地解释网络中的每一层如何建立在先前的层上,以及它们如何解决当前的问题.这通常是基于直觉的(可以通过良好的可视化来简化,例如深度可视化工具箱视频)

A researcher will better be able to interpret how each layer in the network builds on the previous layers, and how they contribute to solving the problem at hand. This is often based on gut-feeling (Which can be simplified by good visualizations such as this deep visualization toolbox video)

例如,假设我使用的是VGG16,这是在 image-网.我想对其进行更改,以对家具的不同类别进行分类,而不是将最初打算进行分类的完全不同的东西归为1000类.因为它是一个通用模型,所以它可以识别很多不同的事物,从人类到动物,从汽车到家具.但是许多事情对我来说,要对性能造成损失是没有意义的,因为它们并不能真正帮助我对家具进行分类.

As an example, let's say I'm using VGG16, which is the name of a general model trained on image-net. I want to change it to classify distinct categories of furniture, instead of the 1000 classes from of completely different things it was originally intended to classify. Because it is such a general model, it can recognize a lot of different things, from humans to animals, to cars, to furniture. But a lot of these things don't make sense for me to incur a performance-penalty for, since they don't really help me classifying my furniture.

由于我们对这些类进行的许多最重要的发现都发生在网络的不同层,因此我可以将其移回卷积层,并删除对于我正在执行的任务而言似乎太复杂的所有内容.这可能意味着我删除了一些似乎专门用于对人的特征进行分类的图层,例如耳朵,嘴巴,眼睛和面部.

Since a lot of the most important discoveries we make about these classes happen at different layers in the network, I can then move back up the convolutional layers, and remove everything which seem to be too complex for the task I'm doing. This might mean I remove some layers that seem to have specialized in categorising human features such as ears, mouths, eyes and faces.

据我所知,人们会可视化尽可能多的图层,然后通常根据本能做出判断,然后判断要保留或丢弃哪些图层.

As far as I know, people visualize as many layers as they find useful, and then usually make a judgement call based on instinct as to which layers to keep or throw away after that.

借来的图像:

可视化ConvNet学习的内容

对卷积神经网络的直观解释

这篇关于神经网络层的输出在哪些方面有用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆