Image recognition example: what each hidden layer recognizes

I’m really interested how you managed to get pictures about what each layer recognizes.
First hidden layer recognizes lines, second - face objects etc.
Layer takes vector of numbers as an input, subjects it to computation which produces output vector of numbers. How do you get those pictures of eyes, noses, part of ears etc?

There’s a method already specified by François Chollet in his book “DEEP LEARNING with Python”.

I have never done it but it goes more or less like this:

DISCLAIMER: This is a general description of the process, not an implementation.

You have a CNN with a few ConvxD layers. This is your starting point.

The way that you can visualize intermediate results is by ‘splitting’ or ‘segmenting’ your CNN.

Say your CNN has 3 ConvD layers.

To see the transformations on layer 1, you build an alternate (parallel) network that gets the same input, passes through the 1st ConvD layer, and its activation, and you take that output into a Dense layer that you then turn into an image.

The details, I don’t have them, but with these tips you might either experiment to get it or search for this book or other references in the internet.

Thoughts?

Juan

I’ve got it.
Thanks you very much for explanation!
I’ll definitely spend time digging deeply into the question but you gave me a very good start.

1 Like

My pleasure @tory ,

Please share your findings! I would love to see what yo do about this amazing aspect of CNN!

Thank you,

Juan