Search code examples
machine-learningdeep-learningneural-networkartificial-intelligenceclassification

How do you tell a neural network's layer to look for/at specific traits such as eyes, and edges?


In an face recognition image classification, I understand that each layer looks at different key aspects of the image?

For example, layer-1 might look at the edges, and layer-2 might look at the colors, and layer-3 might look at the eyes, etc...

Each layer has an activation function, and takes the output from the previous layer as input.

How do you specifically tell a layer to look for a specific trait in the image? How do you know what each layer is looking for?


Solution

  • To know what features of the input image a layer of deep CNN is looking for, you can obtain the filters and filter activations/ feature maps of that layer and visualize them by plotting color-maps of the activations and kernel weights. Though we can visualize the activations of a layer and infer what the filter might be looking for, it is rather hard to enforce a network's layer to learn specific traits as the weights are randomly initialized before training such that any filter of the network might choose to learn any random specific feature of the input image.