Giter Club home page Giter Club logo

using-sobel-edge-detector-on-activation-map-of-convolutional-neural-networks's Introduction

Using-sobel-edge-detector-on-activation-map-of-convolutional-neural-networks

Use the activation map (or feature map) of convolutional neural net (cnn) as images for sobel edge and gradient detector

Using edge detector on deep layers of convolutional neural network. Use the feature map resulting from deep convolutional neural network as images for edge detector and display the results. (Note this code use Tensorflow implementation of VGG network by David Frossard, 2016. to use it you first need to download the pretrained model weights from here: http://www.cs.toronto.edu/~frossard/post/vgg16/ And put them in the code folder.) The response of convolutional neural network in each layer is a matrix of size DxDyd were d is the number of filters in this layer (can be considered as the layer depth). Dx and Dy are is the x,y dimension of the layer and is some fraction of the input image dimensions. By using the the response map of a given filter in in given layer (after RELU) as 2d image of dimension (Dx,Dy,1) and applying the sobel operator on this image, it possible to get the gradient/edge map of this filter in this layer. Summing the absolute value of the sobel operator of all feature in an image give the Total gradient/edge map for this layer , which seem to be rather similar to gradient map of input image. The code involve 3 steps: 1) Find the feature map of the of the image by applying the convolutional layers of the network. The network used here is the VGG implementation for Tensorflow by David Frossard. The weight for this pre trained net should be download from here:http://www.cs.toronto.edu/~frossard/post/vgg16/ and put in code directory. 2) Use the sobel operator to to get gradient map for each filter in a given convolutional layer. 3) Take the average of response map of all filters in a given layer to get the total edge map of this layer. 4) Resize the edge map to feet the original image size.

using-sobel-edge-detector-on-activation-map-of-convolutional-neural-networks's People

Contributors

sagieppel avatar

Watchers

James Cloos avatar Wang Pengfei 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.