Eigen-CAM

Learn about Eigen-CAM and how to use principal components for generating class activation maps.

Mathematical model for Eigen-CAM

Eigen decomposition-based CAM (Eigen-CAM) computes and visualizes the principle components of the final layer convolutional features for generating class activation maps. In other words, Eigen-CAM uses the elements of the highest principle component vector as weights for the linear combination in the CAM equation.

Let’s assume that FlRh×w\mathcal{F}_l \in \R^{h \times w} is the lthl^{th} feature map obtained from the penultimate convolutional layer (hh and ww are the height and width of the feature map) and Fl(i,j)\mathcal{F}_l(i,j) represents the activation of the (i,j)th(i,j)^{th} neuron in the lthl^{th} feature map (total LL feature maps in F\mathcal{F}).

The algorithm first transforms each feature map FlRh×w\mathcal{F}_l \in \R^{h \times w} into a flattened feature map FlRhw\mathcal{F}'_l \in \R^{hw}. It then combines these feature maps to create a feature matrix FRL×hw\mathcal{F}' \in \R^{L \times hw} as follows:

Get hands-on with 1400+ tech skills courses.