Vector Activation Map (VAM)
- 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 be a pretrained, differentiable deep network and let denote one of its convolutional layers. For an input , the layer output is
where is the number of channels and are the spatial dimensions. For a target class , let
denote the gradient of the pre-softmax score with respect to that feature map (Wang et al., 2022).
A concept is represented by a set of guidance images 0 that depict only that concept, together with a negative set 1 of random or “other” concepts. For each guidance image, all spatial activations at layer 2 are collected:
3
These samples are labeled 4 for concept-5 activations and 6 for random-concept activations. A simple linear classifier
7
is then trained on the resulting 8-dimensional samples. Its normal vector
9
is the Spatial Activation Concept Vector for concept 0 at layer 1 (Wang et al., 2022).
Once 2 is learned, two spatial maps can be defined on a new image 3. The relevance map
4
measures how strongly each spatial activation matches concept 5:
6
The contribution map
7
weights that relevance by the directional sensitivity of the network output to each activation:
8
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 9, a layer index 0, a target class 1, a query concept 2 with guidance set 3, and a random or negative concept set 4. Each image in 5 is forward-propagated through the network, and the corresponding tensor 6 is extracted. These tensors are flattened into
7
samples in 8, with activations from 9 labeled 0 and activations from 1 labeled 2 (Wang et al., 2022).
A standard binary logistic or SVM problem is then solved on these samples to obtain the weight vector 3. The description emphasizes that no intercept is strictly required; the direction 4 suffices for mapping. For a new image 5, one computes 6 by a forward pass and 7 by backpropagating from the logit 8. At each spatial location 9, the relevance score 0 and the contribution score 1 are obtained by dotting the local activation and the local gradient, respectively, with 2 (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 3 or 4 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 5 by dotting the global average pooled activation with 6, then testing sign changes under random perturbations of class-7 logits. SACV, by contrast, yields full 8 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 9 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 0, 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 1, computed by evaluating 2 on a held-out set of zebra versus non-zebra images. At features.25, zebra images had mean max 3, while non-zebra images had mean max 4, 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 5. Here, 6 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 7 true-positive coverage with less than 8 background coverage, outperforming standard Grad-CAM, reported at approximately 9, and Class Activation Mapping, reported at approximately 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 1 and backpropagate to obtain 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 3 must be large enough to linearly separate concept versus random activations, and that in practice 4–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 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 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 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).