Facial landmarks, head pose, face parsing, and action-unit (AU) analysis on unconstrained video, all from one DIME encoder in a plain baseline setting: lightweight task heads, no specialized modules.
Sequence 1. Head pose, landmarks, parsing, and AU activations on a frontal talking face.Sequence 2. The same pipeline on an interview clip with head turns, speech, and changing expressions.
Panels, left to right: input · head pose · landmarks · face parsing · action units.
What the encoder has learned
The same encoder, with no labels and no task head, already carries facial semantics. Querying one patch lights up the same anatomical region across different people, and a dense-feature projection separates eyes, nose, mouth, and skin far more cleanly than generic encoders trained on natural images or a plain MAE trained on faces.
Facial semantics emerge in DIME's representations. (a) Cosine similarity to the query token marked with +, for eyebrow, eye, nose, cheek, and mouth queries; brighter is more similar. (b) UMAP-PCA views of dense features from DINOv3-L, MAE-L, and DIME-L. View full size ↗
Key idea
Learning the variation within an identity
Faces share one canonical layout, so a masked autoencoder can fill in a plausible face from context while subtle changes vanish into the residual. DIME fixes the identity, recovers two mixed observations, and supervises how the recovered pair differs.
identity term \(\boldsymbol{\mu}\): the person's average patch, → 0 when \(s_a=s_b\) observation term \(\mathbf{r}\): what changed, and all that is left in \(\boldsymbol{\Delta}_{\ell}\)
Across people, a mouth shape may reflect who someone is or what they are doing. Within one person the identity baseline is shared, so it cancels in the difference. Identity labels only form pairs; they are never an input or a target.
02 Mix, mask, recover, without peeking
\(\tilde{\mathbf{T}}^{a}\)
\(\tilde{\mathbf{T}}^{b}\)
→shared encoder attention only within a source→
\(\hat{\mathbf{y}}^{a}\)
\(\hat{\mathbf{y}}^{b}\)
tokens of \(\mathbf{x}^{a}\) tokens of \(\mathbf{x}^{b}\) · one random 50% mask, applied in both orders
The two faces look alike, so copying the missing patch from the other one would be the easy way out. Source-isolated attention makes that impossible: every patch of \(\hat{\mathbf{y}}^{a}\) and \(\hat{\mathbf{y}}^{b}\) is predicted from its own visible half, by a decoder branch in which that patch was masked.
03 EDDS: align the direction of change
loss \(=1-\cos\theta_{\ell}\)length ignored
reversed change flipped
erased both recoveries equal
aligned smaller, same direction
Two reconstructions can each look right and still flatten or reverse a small change, paying almost nothing in RGB loss. EDDS compares the centered differences with a cosine, so only direction counts: a subtle change matters as much as a large one, and reproducing shared appearance alone cannot satisfy it.
Notation. \(\ell\) indexes the image patches, each with \(P\) pixels, so a patch is a \(P\times 3\) RGB matrix. \(\mathbf{y}^{a}_{\ell},\mathbf{y}^{b}_{\ell}\) are the raw pixels of patch \(\ell\) in the two observations; \(\hat{\mathbf{y}}^{a}_{\ell},\hat{\mathbf{y}}^{b}_{\ell}\) are the recovered patches, mapped from the decoder's normalized output back to raw pixels so that both faces are compared in the same space. \(\mathbf{H}_{P}=\mathbf{I}_{P}-\tfrac{1}{P}\mathbf{1}_{P}\mathbf{1}_{P}^{\top}\) subtracts each channel's spatial mean, so a uniform color offset is not counted as change. \(\theta_{\ell}\) is the angle between \(\boldsymbol{\delta}_{\ell}\) and \(\hat{\boldsymbol{\delta}}_{\ell}\), the angle drawn in step 03; \(\langle\cdot,\cdot\rangle_{F}\) and \(\|\cdot\|_{F}\) are the Frobenius inner product and norm, \(\varepsilon\) a small stabilizer. \(\Gamma\) is the set of supervised patches: a fixed fraction with the largest \(\|\boldsymbol{\delta}_{\ell}\|_{F}\), chosen from the targets only; if the pair changes little relative to the rest of the minibatch, \(\Gamma\) is empty and the term is zero, which \(\max(1,|\Gamma|)\) keeps well defined.
What follows. Because the loss only sees the difference \(\hat{\boldsymbol{\delta}}_{\ell}\), the two recovered patches receive equal and opposite gradients, \(\nabla_{\hat{\mathbf{y}}^{a}_{\ell}}\mathcal{L}_{\mathrm{edds}}=-\nabla_{\hat{\mathbf{y}}^{b}_{\ell}}\mathcal{L}_{\mathrm{edds}}\): they are pushed apart along the true direction, and each update depends on the other face's current state. Since \(\mathbf{H}_{P}\) removes the mean, these gradients have zero mean per channel, \(\mathbf{1}_{P}^{\top}\nabla_{\hat{\mathbf{y}}^{i}_{\ell}}\mathcal{L}_{\mathrm{edds}}=\mathbf{0}\), so EDDS never touches the constant appearance component; RGB reconstruction keeps anchoring what the face looks like and gradient orientation keeps local structure. Swapping \(a\) and \(b\) negates both \(\boldsymbol{\delta}_{\ell}\) and \(\hat{\boldsymbol{\delta}}_{\ell}\) and leaves the loss unchanged, so no temporal order, reference expression, or identity code is needed. After pretraining only the encoder is kept: downstream inference takes a single image, with no pairs and no mask.
Brief abstract
Conventional pretext tasks show diminishing returns on fine-grained facial analysis: they model the appearance of each image, which is dominated by identity, pose, and illumination, so the subtle within-identity differences that such analysis depends on contribute little to the training signal. DIME is a differential masked autoencoder built on a simple observation: two images of the same person share identity-specific appearance, so their difference exposes how the face changes. DIME reconstructs both masked images of an identity-matched pair and, through Explicit Differential Direction Supervision (EDDS), aligns the direction of their reconstructed difference with the true difference, while source isolation makes each reconstruction depend only on its own image. Because EDDS ignores magnitude, subtle facial changes count as much as large pose or illumination changes. Identity labels are used only to form pairs, and no dense annotations are required. Pretrained on Face-20M, 20 million high-resolution facial images consolidated from existing face datasets, DIME keeps improving as the data grows: +5.9 BP4D AU F1 from 6M to 20M images, versus +0.5 for MAE on the same subsets. The resulting single-image encoder outperforms generic foundation models and specialized facial methods on seven tasks: AU detection, AU intensity estimation, cross-domain anti-spoofing, landmark localization, head pose estimation, face parsing, and face generation.
Method
Same-identity pairs are mixed reciprocally at the patch level. A shared encoder with source-isolated attention and complementary decoder branches recovers both faces. RGB reconstruction, gradient-orientation recovery, and EDDS jointly preserve appearance, local structure, and inter-observation variation.
Overall DIME architecture. Only the encoder is retained for downstream single-image inference. View full size ↗
Results
On Face-20M, DIME-B keeps gaining from larger pretraining subsets, +5.9 BP4D F1 from 6M to 20M images, while a matched MAE-B baseline gains only 0.5 and changes little beyond approximately 6 million images. DIME is evaluated on seven face-related tasks.
73.2%BP4D AU macro F1 · DIME-L
5.43%Cross-domain FAS HTER · DIME-L ↓
6.12RAEv2 256px FID at 100K steps · DIME-L ↓
Headline numbers from the paper's BP4D action-unit, cross-domain face anti-spoofing (leave-one-domain-out over O, C, I, M), and FFHQ generation tables; the generation table is reproduced below.
Scaling with facial data
From 6M to 20M images, DIME-B's BP4D mean F1 rises from 66.1% to 72.0%; MAE-B moves from 64.5% to approximately 65.0%. View full size ↗
DIME as the latent space for face generation
Latent diffusion models do not generate pixels directly. An encoder first maps every training image into a latent space, the diffusion model learns to generate inside that space, and a decoder turns the result back into pixels. The encoder therefore decides what the generator can express at all. We plug DIME in as that encoder in two recent frameworks: RAEv2, which builds its generative latent space directly from a pretrained representation encoder, and REPA, which aligns the internal features of the diffusion model with the encoder's representation. Only the encoder changes; the diffusion architecture and the FFHQ training data are the same for every encoder compared in the table below: MAE, MixMAE, DINOv2, DINOv3, the face-pretrained MAE-Face, and DIME.
Faster convergence with DIME in RAEv2 on FFHQ. (a) Training loss and FID (lower is better) with MAE, DINOv3, and DIME as the encoder. At 10K steps DIME's FID is already 18.43 versus 24.46 for DINOv3 and 26.15 for MAE; at 50K steps the gap widens to 9.41 versus 17.76 and 21.37. (b) Samples from 1K to 50K steps. DIME resolves recognisable eyes, mouth, and hair by 10K to 20K steps, while DINOv3 samples remain blurred or noisy. View full size ↗Samples from RAEv2 with the DIME-L encoder after 100K steps. FID 6.12 at 256 × 256 and 6.59 at 512 × 512 with RAEv2, and 7.26 and 7.93 with REPA, the best of all encoders in the table below.
FID on FFHQ (lower is better) with different representation encoders. Same diffusion framework and data; only the encoder changes. Bold is best, underlined is second best. DINOv3-L is additionally run for 200K and 400K steps.
Encoder
Steps
RAEv2
REPA
256²
512²
256²
512²
DINOv3-L
100K
12.48
14.83
13.46
16.15
DINOv3-L
200K
9.83
11.53
10.61
11.80
DINOv3-L
400K
8.53
8.94
8.22
8.36
DINOv2-L
100K
14.83
16.79
15.31
18.82
MAE-L
100K
16.72
18.22
18.34
21.31
MixMAE-L
100K
17.44
19.65
17.15
20.83
MAE-Face
100K
11.03
16.50
13.67
18.67
DIME-B
50K
9.52
9.98
10.92
11.03
DIME-B
100K
7.41
8.06
8.47
9.25
DIME-L
50K
8.69
9.41
8.85
10.16
DIME-L
100K
6.12
6.59
7.26
7.93
Why a representation encoder changes generation. Generic encoders organise their latent space around object semantics or, for face-pretrained MAE, around predictable identity appearance. DIME's pretraining is instead about how one face varies: expression, geometry, and local texture must be encoded because EDDS supervises them directly. The resulting latent space is face-focused and variation-aware, so the diffusion model finds coherent facial structure earlier, resolves fine detail sooner, and reaches a lower final FID. Relative to DINOv3-L at 100K steps, DIME-L lowers FID by 51.0% and 55.6% with RAEv2 and by 46.1% and 50.9% with REPA at 256 and 512 resolution. The space also scales better: moving from 256 to 512 output raises DIME-L's FID by only 0.47 with RAEv2 and 0.67 with REPA, compared with 1.50 to 5.47 for the other encoders at the same 100K steps, and at that budget DIME-B already outperforms the larger generic encoders. The generation results thus echo the pretraining motivation: representing variation, not just appearance, gives a richer and better-conditioned space to generate from.
BibTeX
Suggested citation for the 2026 manuscript; update the venue when the formal publication is available.
@article{yu2026dime,
title={DIME: Scaling Facial Representation Learning via Differential Masked Autoencoding},
author={Yu, Hao and Chen, Haoyu and Wei, Hui and Jiang, Yan and Sebe, Nicu and Zhao, Guoying},
year={2026}
}