---
title: 'LEAM: Facial Embedding Activation Mapping'
url: https://www.emergentmind.com/topics/layer-embedding-activation-mapping-leam
type: topic
---

# LEAM: Facial Embedding Activation Mapping

Searching arXiv for papers on LEAM and related terminology to ground the article in current literature.
arxiv_search({"query":"all:\"Layer Embedding Activation Mapping\" OR ti:LEAM", "max_results": 10, "sort_by": "relevance"})
arxiv_search({"query":"ti:\"Joint Embedding of Words and Labels for Text Classification\" OR ti:\"Explainable AI for Analyzing Person-Specific Patterns in Facial Recognition Tasks\" OR ti:\"Uncovering the Latent Potential of Deep Intermediate Representations\"", "max_results": 10, "sort_by": "relevance"})
Layer Embedding Activation Mapping (LEAM) is an explainability technique for facial recognition models that produce embeddings rather than class probabilities. It was introduced to visualize and quantify which facial regions contribute most to recognition for each individual face by adapting activation mapping to embedding similarity, thereby identifying person-specific recognition patterns in deep facial recognition systems [2509.17457]. In the supplied literature, the acronym LEAM is also used for an earlier and unrelated text-classification framework based on joint embeddings of words and labels [1805.04174]. Accordingly, the term requires disambiguation: in contemporary facial recognition research it denotes a layerwise activation-mapping method for embedding networks, whereas in earlier NLP work it denotes a label-aware attention mechanism over text.

## 1. Terminological scope and disambiguation

The acronym LEAM refers to two distinct constructions in the supplied literature. The later usage, "Layer Embedding Activation Mapping," concerns explainable AI for facial recognition and is explicitly designed to understand how embedding-based recognition systems work at the level of spatial facial evidence [2509.17457]. The earlier usage refers to the method introduced in "Joint Embedding of Words and Labels for Text Classification," where words and labels are embedded in a common latent space and attention is derived from their compatibility [1805.04174].

| Usage of LEAM | Domain | Core mechanism |
|---|---|---|
| Layer Embedding Activation Mapping | Facial recognition | Activation mapping for embedding similarity |
| LEAM in "Joint Embedding of Words and Labels for Text Classification" | Text classification | Joint word-label embedding with compatibility-based attention |

This terminological overlap matters because the two methods address different objects of explanation and different computational targets. The facial-recognition LEAM operates on intermediate activations and gradients in embedding networks, whereas the text-classification LEAM operates on word and label embeddings to construct an attended document representation. A plausible implication is that citation context is necessary whenever the acronym appears without expansion.

## 2. Formal construction of Layer Embedding Activation Mapping

In facial recognition, LEAM extends activation mapping to models whose outputs are embeddings rather than logits. The method adapts the LayerCAM approach, making it suitable for networks that output embeddings, and uses cosine similarity as the operative measure of recognition similarity [2509.17457]. For two embeddings $x_1$ and $x_2$, cosine similarity is defined as
$$
\operatorname{CosSim}(x_1, x_2) = \frac{x_1 \cdot x_2}{\|x_1\| \|x_2\|},
$$
with values in $[-1,1]$. For faces of the same individual, this score should approach $1$.

LEAM defines the same-identity loss as
$$
L(x_1, x_2) = 1 - \cos(x_1, x_2).
$$
Gradients with respect to inputs are computed and propagated through the network for each pixel, enabling localization of the image regions that most affect embedding similarity. If $A_k$ denotes the activation of channel $k$ from the forward pass and $g_{ij}$ the pixel-specific gradients during backpropagation, the embedding-associated channel weight is
$$
w_k^e = \mathrm{ReLU}(g_{ij}),
$$
so that only positive contributions are retained. The channel-wise activation map is then
$$
\hat{A}_{ij}^k = w_k^e \cdot A_{ij},
$$
and aggregation across channels yields the layer activation map
$$
M_e = \mathrm{ReLU}\left( \sum_k \hat{A}^k \right).
$$

The methodological significance of this construction is that it relocates activation mapping from class evidence to embedding evidence. In the supplied description, this is presented not as an adversarial attack, but as an explainability technique designed to understand how recognition systems work and to identify which facial areas contribute most to recognition at an individual level [2509.17457]. That distinction addresses a common misconception: LEAM is used to visualize and quantify critical regions, not to fool the model.

## 3. Layerwise behavior, facial semantics, and person-specific patterns

LEAM is explicitly layer-sensitive. The reported analysis states that different layers within facial recognition models vary significantly in their focus areas, and that early convolutional layers produce precise activations focused on smaller or more raw facial fragments such as hair, edges, and outlines, while later layers become coarser and more blobby because of lower spatial resolution, yet encapsulate semantic regions such as nose, eyes, and mouth [2509.17457]. This establishes the "layer" component of Layer Embedding Activation Mapping as methodological rather than merely nominal.

To relate activation maps to semantic anatomy, LEAM is integrated with a face parser. The supplied study uses FACER, built on FaRL, to label each pixel as belonging to one of $19$ semantic facial classes, including face, nose, left eye, upper lip, and earrings. The LEAM activation maps are then correlated with these semantic regions by determining, for each pixel, both its semantic assignment and its activation warmth. This permits region-level statistics such as the fraction of top activated pixels belonging to the nose or broader facial classes [2509.17457].

The empirical findings emphasize both commonality across models and specificity across individuals. Across $9$ pre-trained facial recognition models and data from $1000$ individuals, the analysis reports that models generally prioritize similar facial regions across architectures when considering their overall activation patterns, while different layers within those models vary significantly in their focus areas [2509.17457]. The central region of face images is prioritized, with nose areas accounting for $18.9$–$29.7\%$ of critical recognition regions, but attention remains distributed across multiple facial fragments. The supplied summary further notes that over $40\%$ of activated pixels are in the broad "face" class, indicating that recognition evidence is not confined to a single landmark.

The person-specific aspect is validated by similarity analyses on activation maps. When normalized activation maps are treated as two-dimensional probability distributions, the Bhattacharyya Coefficient is
$$
BC(P, Q) = \sum_{x \in X} \sqrt{P(x) Q(x)}.
$$
The reported values are substantially higher for images of the same individual, with Bhattacharyya Coefficient $0.32$–$0.57$, than for different individuals, with $0.04$–$0.13$ [2509.17457]. Earth Mover's Distance is also used as a metric to quantify similarity when perfect alignment is hard. Taken together, these results support the claim that facial recognition models exhibit person-specific recognition patterns, even though their aggregate spatial priorities are similar across architectures.

## 4. Validation by occlusion and cross-model transferability

The principal validation procedure is an occlusion experiment designed to test whether LEAM-identified regions are genuinely critical for recognition [2509.17457]. For a given image and model, the spatial locations of the top $1\%$ most relevant pixels are extracted from the LEAM map and replaced with black pixels. As a control, an equal number of randomly selected pixels is occluded. The impact is then measured by the drop in cosine similarity between the embedding of the unaltered anchor image and that of the occluded probe image.

The reported quantitative effect is marked. LEAM-guided occlusion of $1\%$ of image pixels yields an average cosine similarity decrease of $0.1148$, whereas random occlusion of the same number of pixels yields an average decrease of $0.0286$ [2509.17457]. The supplied interpretation is that LEAM regions are four times more disruptive to recognition than random occlusions while requiring minimal and inconspicuous image modification. Proper selection of relevant facial areas was confirmed using these validation occlusions, and the selected regions proved transferable across different models.

Cross-model transferability is presented as a practical consequence of the observed commonalities in recognition focus. Occlusion masks designed for one model were effective across other models; same-backbone models were most affected, but even different architectures were susceptible [2509.17457]. The study therefore suggests that person-specific privacy interventions need not be model-specific. This suggests a possible pathway from explanation to defense, but the supplied material remains careful to frame LEAM itself as analytic rather than adversarial.

The same study also reports demographic analyses. LEAM-guided occlusions are described as more effective for female faces, with cosine drop $0.1248$ versus $0.1038$ for males, and as effective across ethnic groups, with some differences depending on skin tone that are noted as possibly an artifact of black occlusion color [2509.17457]. The findings are also described as remaining relevant with aging, though large age gaps introduce more variability. These observations position LEAM as a tool not only for privacy analysis but also for auditing fairness-related disparities in region importance and vulnerability.

## 5. Earlier LEAM in text classification

Before the introduction of Layer Embedding Activation Mapping, LEAM had already been used as the name of a text-classification framework in which words and labels are embedded in the same space and attention is built from their compatibility [1805.04174]. In that formulation, each word position $l$ has embedding $v_l \in \mathbb{R}^P$, each label has embedding $\ell_k \in \mathbb{R}^P$, and the set of label embeddings is $E = [\ell_1, \ldots, \ell_K]$. If class names are available, their pre-trained word embeddings can be used to initialize label embeddings.

The basic linear compatibility between word $v_l$ and label embedding $\ell_k$ is
$$
g_{kl} = \frac{\ell_k^\top v_l}{\|\ell_k\| \|v_l\|}.
$$
A nonlinear phrase-level compatibility is then obtained through a contextual window:
$$
u_l = \text{ReLU}\left( W_1 [v_{l-r}; \ldots; v_{l+r}] + b_1 \right),
$$
followed by max pooling over labels,
$$
m_l = \max \{ u_l \},
$$
softmax normalization across word positions,
$$
\beta_l = \frac{\exp(m_l)}{\sum_{l'=1}^L \exp(m_{l'})},
$$
and a label-attended document embedding
$$
z = \sum_l \beta_l v_l.
$$

This earlier LEAM is motivated by the claim that standard text classifiers introduce label information only at the final classification step and therefore miss the opportunity to inform earlier representation learning with explicit knowledge of the labels [1805.04174]. The resulting attention weights provide a saliency map over the text, and the label embeddings act as anchors in the semantic space. In benchmark experiments on AGNews, Yahoo! Answers, Yelp Review Full/Binary, and DBPedia, the supplied summary states that the method outperforms or matches state-of-the-art models on all benchmarks, with an example of $77.42\%$ test accuracy on Yahoo versus previous best results of $75.8\%$ for HAN and $76.28\%$ for Bi-BloSAN [1805.04174]. It is also described as achieving the highest AUC and competitive F1 and Precision@5 on MIMIC-III in the multi-label setting.

The relevance of this earlier work to the present topic is terminological and conceptual rather than methodological. Both methods operate in embedding spaces and both emphasize interpretability, but they do so in different modalities, with different targets, and through different mathematical mechanisms. In one case, attention is induced by word-label compatibility; in the other, saliency is induced by gradients of embedding similarity through intermediate facial-recognition layers.

## 6. Relation to intermediate-representation analysis and open directions

A later study on intermediate representations in deep models explicitly positions LOES as a complement to LEAM [2605.23033]. That work argues that task-relevant information is distributed non-monotonically across layers and cannot be recovered by naive aggregation, and introduces Layer-wise Optimal Embedding Selection (LOES) together with Geometric Regularization Loss (GeoReg) to identify task-discriminative subspaces and stabilize their geometry during fine-tuning. In the supplied description, LEAM is characterized as mapping embeddings to activation patterns for interpretability, while LOES is described as providing a direct, systematic, spectral-geometric mechanism for diagnosing and selecting the most interpretable and transferable layer combinations [2605.23033].

This comparison is useful because it clarifies what LEAM does and does not do. LEAM localizes spatial evidence within a chosen layer of an embedding network, whereas LOES addresses the problem of selecting which layers encode task-discriminative structure in the first place. The LOES study further states that emphasis on isotropy and geometric structure can inspire geometry-aware extensions or regularizers for LEAM and similar post-hoc analysis tools, and points to the possibility of using layerwise geometric diagnostics to guide where in the model to insert adapters or parameter-efficient fine-tuning modules [2605.23033].

Two recurring misconceptions are addressed by this broader context. First, LEAM should not be reduced to a single-region explanation method: the facial-recognition study explicitly reports distributed attention across multiple facial fragments rather than exclusive reliance on one landmark [2509.17457]. Second, LEAM should not be conflated with generic last-layer interpretation: the broader literature on intermediate representations indicates that layers differ substantially in semantic and geometric content, and that those differences matter for interpretability and transfer [2605.23033]. A plausible implication is that future work may combine layer selection or geometry-aware diagnostics with LEAM-style spatial attribution to obtain more targeted analyses of embedding networks across modalities.

Within the supplied literature, LEAM therefore occupies two separate but thematically related positions. In facial recognition, it is a layerwise explainability technique for embedding similarity with demonstrated person-specificity, semantic region analysis, and occlusion-based validation [2509.17457]. In earlier NLP work, it is a joint embedding and attention framework that uses label-word compatibility to produce interpretable document representations [1805.04174]. The later representation-learning study suggests that both can be situated within a larger research program concerned with how information is distributed across embeddings and layers, and how that structure can be exploited for interpretability and transfer [2605.23033].

Source: https://www.emergentmind.com/topics/layer-embedding-activation-mapping-leam