Papers
Topics
Authors
Recent
Search
2000 character limit reached

Vector Activation Map (VAM)

Updated 8 July 2026
  • Vector Activation Map (VAM) is a hidden-layer interpretation method that generates spatial relevance and contribution maps, pinpointing where a concept is represented.
  • It improves on standard TCAV by operating on spatial activations, reducing background interference and providing precise visual explanations.
  • Quantitative evaluations demonstrate that VAM achieves higher true-positive coverage and lower background interference compared to traditional visualization methods.

Vector Activation Map (VAM), introduced in the Spatial Activation Concept Vector (SACV) framework, is a hidden-layer interpretation method for pretrained, differentiable deep networks that localizes where a user-defined concept is represented and how that concept contributes to a target-class prediction. The method was proposed to address a limitation of standard Testing with Concept Activation Vector (TCAV): when TCAV evaluates concept contribution from a whole hidden layer, redundant background features can interfere, particularly when the target object occupies only a small fraction of the image. VAM/SACV instead operates on spatial activations of a convolutional feature map, producing a relevance map for the concept and a contribution map for the target class, both defined over spatial locations rather than at the layer level (Wang et al., 2022).

1. Formal definition and notation

Let ff be a pretrained, differentiable deep network and let ll denote one of its convolutional layers. For an input xx, the layer output is

fl(x)RCl×Hl×Wl,f_l(x) \in \mathbb{R}^{C_l \times H_l \times W_l},

where ClC_l is the number of channels and Hl×WlH_l \times W_l are the spatial dimensions. For a target class cc, let

flc(x)scfl(x)RCl×Hl×Wl\nabla f_l^c(x) \equiv \frac{\partial s_c}{\partial f_l(x)} \in \mathbb{R}^{C_l \times H_l \times W_l}

denote the gradient of the pre-softmax score scs_c with respect to that feature map (Wang et al., 2022).

A concept kk is represented by a set of guidance images ll0 that depict only that concept, together with a negative set ll1 of random or “other” concepts. For each guidance image, all spatial activations at layer ll2 are collected:

ll3

These samples are labeled ll4 for concept-ll5 activations and ll6 for random-concept activations. A simple linear classifier

ll7

is then trained on the resulting ll8-dimensional samples. Its normal vector

ll9

is the Spatial Activation Concept Vector for concept xx0 at layer xx1 (Wang et al., 2022).

Once xx2 is learned, two spatial maps can be defined on a new image xx3. The relevance map

xx4

measures how strongly each spatial activation matches concept xx5:

xx6

The contribution map

xx7

weights that relevance by the directional sensitivity of the network output to each activation:

xx8

Both maps can be up-sampled, for example by bilinear interpolation, to the input resolution for visualization (Wang et al., 2022).

2. Computational procedure

The VAM/SACV pipeline begins by selecting a pretrained network xx9, a layer index fl(x)RCl×Hl×Wl,f_l(x) \in \mathbb{R}^{C_l \times H_l \times W_l},0, a target class fl(x)RCl×Hl×Wl,f_l(x) \in \mathbb{R}^{C_l \times H_l \times W_l},1, a query concept fl(x)RCl×Hl×Wl,f_l(x) \in \mathbb{R}^{C_l \times H_l \times W_l},2 with guidance set fl(x)RCl×Hl×Wl,f_l(x) \in \mathbb{R}^{C_l \times H_l \times W_l},3, and a random or negative concept set fl(x)RCl×Hl×Wl,f_l(x) \in \mathbb{R}^{C_l \times H_l \times W_l},4. Each image in fl(x)RCl×Hl×Wl,f_l(x) \in \mathbb{R}^{C_l \times H_l \times W_l},5 is forward-propagated through the network, and the corresponding tensor fl(x)RCl×Hl×Wl,f_l(x) \in \mathbb{R}^{C_l \times H_l \times W_l},6 is extracted. These tensors are flattened into

fl(x)RCl×Hl×Wl,f_l(x) \in \mathbb{R}^{C_l \times H_l \times W_l},7

samples in fl(x)RCl×Hl×Wl,f_l(x) \in \mathbb{R}^{C_l \times H_l \times W_l},8, with activations from fl(x)RCl×Hl×Wl,f_l(x) \in \mathbb{R}^{C_l \times H_l \times W_l},9 labeled ClC_l0 and activations from ClC_l1 labeled ClC_l2 (Wang et al., 2022).

A standard binary logistic or SVM problem is then solved on these samples to obtain the weight vector ClC_l3. The description emphasizes that no intercept is strictly required; the direction ClC_l4 suffices for mapping. For a new image ClC_l5, one computes ClC_l6 by a forward pass and ClC_l7 by backpropagating from the logit ClC_l8. At each spatial location ClC_l9, the relevance score Hl×WlH_l \times W_l0 and the contribution score Hl×WlH_l \times W_l1 are obtained by dotting the local activation and the local gradient, respectively, with Hl×WlH_l \times W_l2 (Wang et al., 2022).

Post-processing is optional. The maps may be upsampled to match the input resolution and may be normalized or smoothed, for example with Gaussian blur. Visualization can then proceed by overlaying Hl×WlH_l \times W_l3 or Hl×WlH_l \times W_l4 as heatmaps, or the maps can be summarized quantitatively by statistics such as the maximum or the mean within ground-truth masks (Wang et al., 2022).

3. Relation to TCAV and the shift from global to spatial concept analysis

The immediate methodological precursor is TCAV, which quantifies the contribution of a query concept, represented by user-defined guidance images, to a target class. TCAV therefore supports statements such as whether and to what extent the concept striped contributes to the model prediction zebra. The abstract further notes that TCAV has been applied to practical problems such as diagnosis (Wang et al., 2022).

The distinction between TCAV and VAM/SACV is structural. Standard TCAV computes a single directional-sensitivity score for an entire layer Hl×WlH_l \times W_l5 by dotting the global average pooled activation with Hl×WlH_l \times W_l6, then testing sign changes under random perturbations of class-Hl×WlH_l \times W_l7 logits. SACV, by contrast, yields full Hl×WlH_l \times W_l8 maps. This changes the object of interpretation from a layerwise scalar to a spatial field of relevance and contribution (Wang et al., 2022).

The illustrations reported in the description make this contrast explicit. For the concept striped on zebra versus non-zebra images, the relevance map Hl×WlH_l \times W_l9 at a deep layer, features.25, strongly activates on patches covering the animal’s stripes, whereas at a shallow layer, features.2, no location distinguishes stripes from random texture. Likewise, for the contribution map cc0, standard TCAV would only report that striped contributes positively to zebra, while SACV highlights exactly the tiger-like stripes on the animal’s body and assigns near-zero or negative contribution to the background (Wang et al., 2022).

4. Quantitative evaluation

Although SACV is primarily presented as a visualization tool, the paper description gives two quantitative evaluation procedures on an ImageNet + Textures benchmark. The first is concept-discriminability at layer cc1, computed by evaluating cc2 on a held-out set of zebra versus non-zebra images. At features.25, zebra images had mean max cc3, while non-zebra images had mean max cc4, indicating a clear separation. At features.2, both means clustered near zero, which was interpreted as indicating no stripe concept at that depth (Wang et al., 2022).

The second evaluation targets localization error of the contribution map for class cc5. Here, cc6 is thresholded at zero, and the fraction of true-positive pixels within the ground-truth animal bounding box is measured against background coverage. On VGG19/ImageNet, SACV achieved more than cc7 true-positive coverage with less than cc8 background coverage, outperforming standard Grad-CAM, reported at approximately cc9, and Class Activation Mapping, reported at approximately flc(x)scfl(x)RCl×Hl×Wl\nabla f_l^c(x) \equiv \frac{\partial s_c}{\partial f_l(x)} \in \mathbb{R}^{C_l \times H_l \times W_l}0 (Wang et al., 2022).

The description explicitly cautions that exact numbers vary by threshold and dataset. It also states that the code release includes a script to reproduce these curves on PASCAL-VOC and the Describable Textures Dataset. This suggests that the proposed evaluation is intended not only as an illustrative benchmark but also as a reproducible protocol for comparing concept-localization behavior across explanation methods (Wang et al., 2022).

5. Architectural assumptions and operational constraints

The method assumes a differentiable CNN or hybrid network from which one can extract an intermediate feature map flc(x)scfl(x)RCl×Hl×Wl\nabla f_l^c(x) \equiv \frac{\partial s_c}{\partial f_l(x)} \in \mathbb{R}^{C_l \times H_l \times W_l}1 and backpropagate to obtain flc(x)scfl(x)RCl×Hl×Wl\nabla f_l^c(x) \equiv \frac{\partial s_c}{\partial f_l(x)} \in \mathbb{R}^{C_l \times H_l \times W_l}2. The selected layer should have a reasonably fine spatial grid; the description lists mid- to high-level convolutional layers in architectures such as VGG and ResNet as typical choices. It further states that the channel dimensionality flc(x)scfl(x)RCl×Hl×Wl\nabla f_l^c(x) \equiv \frac{\partial s_c}{\partial f_l(x)} \in \mathbb{R}^{C_l \times H_l \times W_l}3 must be large enough to linearly separate concept versus random activations, and that in practice flc(x)scfl(x)RCl×Hl×Wl\nabla f_l^c(x) \equiv \frac{\partial s_c}{\partial f_l(x)} \in \mathbb{R}^{C_l \times H_l \times W_l}4–flc(x)scfl(x)RCl×Hl×Wl\nabla f_l^c(x) \equiv \frac{\partial s_c}{\partial f_l(x)} \in \mathbb{R}^{C_l \times H_l \times W_l}5 works well (Wang et al., 2022).

A further assumption concerns receptive fields. The spatial activations need only partially cover the concept pattern; SACV is intended to pick out only those positions flc(x)scfl(x)RCl×Hl×Wl\nabla f_l^c(x) \equiv \frac{\partial s_c}{\partial f_l(x)} \in \mathbb{R}^{C_l \times H_l \times W_l}6 whose receptive field actually overlaps the concept. This is important for the method’s stated ability to avoid interference from background features, because the learned concept direction is evaluated locally rather than after collapsing the entire layer into a single representation (Wang et al., 2022).

The method is therefore most naturally situated in architectures and layers where a spatially organized hidden representation still exists. A plausible implication is that the interpretive value of VAM/SACV depends on the joint availability of semantically meaningful channel directions and sufficiently resolved spatial structure. The description does not present a transformer-specific formulation beyond the general reference to hybrid networks (Wang et al., 2022).

6. Practical use, scope, and common misconceptions

The practical guidelines begin with guidance-set construction. The description recommends using 50–200 images that cleanly exemplify the concept, such as striped textures from DTD, and constructing the random set flc(x)scfl(x)RCl×Hl×Wl\nabla f_l^c(x) \equiv \frac{\partial s_c}{\partial f_l(x)} \in \mathbb{R}^{C_l \times H_l \times W_l}7 from a heterogeneous mix of other concepts so as to avoid trivial separation. Layer selection depends on concept granularity: for low-level concepts such as color, basic texture, and simple shape, early convolutional layers such as features.2–5 are recommended; for mid- and high-level concepts such as object parts and complex textures, deeper layers such as features.25–35 are recommended (Wang et al., 2022).

Post-processing recommendations are similarly explicit. A light Gaussian blur with flc(x)scfl(x)RCl×Hl×Wl\nabla f_l^c(x) \equiv \frac{\partial s_c}{\partial f_l(x)} \in \mathbb{R}^{C_l \times H_l \times W_l}8 pixels after upsampling is suggested to reduce checker-boarding artifacts, and min–max normalization per image is recommended to facilitate comparison across layers and images. The code is reported as available at https://github.com/AntonotnaWang/Spatial-Activation-Concept-Vector (Wang et al., 2022).

A common misunderstanding is to treat VAM/SACV as a replacement for TCAV. The method is instead positioned as complementary. TCAV is recommended when a global, scalar measure of concept importance to a class is needed, whereas SACV is recommended when spatially resolved explanations are required in order to locate precisely where in the image a concept is used by the network. Another misconception is that any layer should reveal the queried concept equally well; the reported zebra example instead shows that some concepts are absent or non-separable at shallow depths and become discriminable only at deeper layers (Wang et al., 2022).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Vector Activation Map (VAM).