---
title: Age-weighted Loss in Age Estimation
url: https://www.emergentmind.com/topics/age-weighted-loss
type: topic
---

# Age-weighted Loss in Age Estimation

Searching arXiv for the cited works and closely related papers on age-weighted loss in age estimation.
arXiv search query: `all:"Progressive Margin Loss for Long-tailed Age Classification" OR all:"Stage-wise Adaptive Label Distribution for Facial Age Estimation" OR all:"Adaptive Mean-Residue Loss for Robust Facial Age Estimation" OR all:"Maximum Weighted Loss Discrepancy"`
Age-weighted loss denotes a family of objective constructions in which optimization pressure is modulated by age-dependent structure rather than assigning uniform importance to all samples, classes, groups, or past observations. In facial age estimation and long-tailed age classification, this modulation appears as class- and sample-dependent margins, stage-specific mixtures of cross-entropy and label-distribution losses, or penalties that suppress probability mass assigned to implausible ages while preserving ordinal neighborhoods. In fairness analysis, age can define groups whose loss discrepancies are explicitly weighted. In online prediction, the “age” of a loss can denote temporal recency, so older losses are discounted. Across these uses, the common premise is that age-related heterogeneity—ordinality, ambiguity, imbalance, demographic grouping, or temporal recency—should alter the loss landscape [2103.02140], [2509.00450], [1906.03518], [1005.1918].

## 1. Conceptual scope

Within the literature represented here, age-weighted loss is not a single formula but a set of related design patterns. In facial age modeling, the objective is typically to respect the ordinal structure of age labels and the nonuniform uncertainty associated with different ages or age stages. In fairness-oriented analysis, the aim is instead to quantify or reduce disparities between age groups. In online learning, weighting by “age” refers to discounting old losses so that the impact of old losses may gradually vanish.

| Setting | Mechanism | Representative quantity |
|---|---|---|
| Long-tailed age classification | Progressive, age-aware logit margins | \(M_{pj} = \lambda M_o^* + \beta M_v\) |
| Facial age estimation | Stage-wise weighting of KL and CE | \(L_{\mathrm{SAW}}\) |
| Facial age estimation | Mean-residue weighting over age probabilities | \(L = L_s + \lambda_1 L_m + \lambda_2 L_r\) |
| Age-group fairness | Weighted discrepancy between group and population loss | \(D_{\mathrm{age}}(w,\ell,f)\) |
| Online learning | Discounting older losses | \(L_t = \alpha_{t-1} L_{t-1} + \ell_t\) |

Two recurring premises connect the age-estimation formulations. First, age labels are ordinal; adjacent ages exhibit high visual similarity and correlated label distributions, so treating each age as an independent class can distort supervision [2103.02140]. Second, age ambiguity is not uniform across the lifespan: stage-wise patterns appear in embedding similarity analyses, motivating stage-specific variance and weighting rather than a fixed global label-distribution shape [2509.00450].

## 2. Progressive margins for long-tailed age classification

"Progressive Margin Loss for Long-tailed Age Classification" formulates age-weighted loss as a decision-boundary adjustment mechanism inside a globally tuned deep classifier [2103.02140]. The setting is unconstrained facial age classification under long-tailed age distributions, where standard cross-entropy or KL losses tend to optimize for head ages and underfit tail ages. The method maps a scalar age \(y \in \{0,\ldots,100\}\) to a Gaussian label distribution \(y \in \mathbb{R}^{101}\),

$$
y_k = \frac{1}{\sigma \sqrt{2\pi}} \exp\!\left(-\frac{(k-y)^2}{2\sigma^2}\right), \qquad k \in [0,100],
$$

and replaces the baseline KL/CE objective

$$
L = -\frac{1}{n}\sum_{i=1}^n y_i \log \hat y_i
$$

with

$$
L_{m_p} = -\frac{1}{n}\sum_{i=1}^n y_i \log \hat y_i^*.
$$

The modified prediction inserts progressive margins into the logits:

$$
\hat y_{i,k}^* =
\frac{\exp(s(x_i,W_k)-m_{pk})}
{\exp(s(x_i,W_k)-m_{pk}) + \sum_{t\neq k}\exp(s(x_i,W_t))},
$$

with dot-product similarity \(s(x_i,W_k)=W_k^\top x_i\). The key quantity is the class-specific margin \(m_{pk}\), which is derived from learned class geometry.

PML maintains a per-class center

$$
c_j = \frac{1}{N_j}\sum_{i=1}^{N_j} x_i
$$

and, for mini-batch training, uses the recursive update

$$
c_j^t = c_j^{t-1} + I(y_i=j)\frac{x_i - c_j^{t-1}}{N_j^{t-1}+1}.
$$

It further computes an inter-class variance vector

$$
\psi_j^t = [d(c_j^t,c_0),\ldots,d(c_j^t,c_c)],
$$

where \(d(\cdot)\) denotes cosine distance, and an intra-class variance

$$
\phi_j^t = \phi_j^{t-1} + I(y_i=j)\, d(x_i,c_j^{t-1})\, d(x_i-c_j^t).
$$

These statistics feed two margin components. The ordinal margin is learned as

$$
M_o = f^O([c,\phi,\psi]), \qquad M_o \in \mathbb{R}^{c\times 2},
$$

and discretized into a one-vs-all matrix \(M_o^* \in \mathbb{R}^{c\times c}\). Functionally, \(M_o^*\) enforces larger margins between more distant ages and smaller margins between adjacent ages. The variational margin is learned from residual dynamics between iterations or curricula,

$$
\Delta V = [c^t,\phi^t,\psi^t] - [c^{t-1},\phi^{t-1},\psi^{t-1}],
$$

$$
M_v = f^V(\Delta V), \qquad M_v \in \mathbb{R}^c.
$$

For a sample in class \(j\), the final progressive margin vector is

$$
M_{pj} = \lambda M_o^* + \beta M_v.
$$

The paper’s decision-boundary interpretation is central: subtracting \(m_{pk}\) from the logit is equivalent to multiplying the unnormalized score by \(\exp(-m_{pk})\). Larger \(m_{pk}\) down-weights a class’s score and shifts decision boundaries away from it. When larger margins are assigned to head ages, the mechanism reduces head dominance in a manner similar in effect to age-weighted losses, but it does so through structured, age-aware logit modification rather than explicit scalar loss weights.

Optimization is further stabilized by curriculum learning. PML uses a sequence of indicator curricula

$$
D_1 \subset D_2 \subset D_3 \subset D_4 \subset D_5, \qquad D_5 = D_{\mathrm{all}},
$$

with

$$
D_i = \{X_i,Y_i\}, \qquad X_i = x^{(0,\delta_i)} \cup \rho(x^{(\delta_i+1,c)}).
$$

Across curricula, a balanced instructor \(V_{\mathrm{pre}}=[c^*,\phi^*,\psi^*]\) from the previous, more balanced course is used to define

$$
\Delta V^* = [c^t,\phi^t,\psi^t] - V_{\mathrm{pre}},
$$

which in turn yields \(M_v^* = f^V(\Delta V^*)\). The gradients remain standard with respect to the shifted logits,

$$
\frac{\partial L_{m_p}}{\partial z_{ik}} = p_{ik}^* - y_{ik},
$$

and

$$
\frac{\partial L_{m_p}}{\partial x_i} = \sum_k (p_{ik}^* - y_{ik}) W_k.
$$

Because the margins alter \(p_{ik}^*\), head classes receive reduced gradient magnitude when assigned larger margins, whereas tail classes receive comparatively stronger updates.

## 3. Stage-wise adaptive weighting in label distribution learning

"Stage-wise Adaptive Label Distribution for Facial Age Estimation" treats age-weighted loss as a learned stage-wise convex combination of distribution matching and hard classification, coupled to stage-specific label uncertainty [2509.00450]. The method begins from a standard label distribution learning setup over discrete ages \(k \in \{0,1,\ldots,K-1\}\). For an image \(X\) with ground-truth age \(a\), the model outputs logits \(z_k(X,\theta)\) and probabilities

$$
q_k(X,\theta) = \frac{\exp\{z_k(X,\theta)\}}{\sum_{n=0}^{K-1}\exp\{z_n(X,\theta)\}}.
$$

The target soft label is a discrete normalized Gaussian centered at \(a\), but its standard deviation is stage-dependent:

$$
y_k(a,\sigma_{s(a)}) =
\frac{\exp\!\left(-\frac{(k-a)^2}{2\sigma_{s(a)}^2}\right)}
{\sum_{n=0}^{K-1}\exp\!\left(-\frac{(n-a)^2}{2\sigma_{s(a)}^2}\right)}.
$$

The KL term is

$$
L_{\mathrm{KL}}(X,a;\theta,\sigma_{s(a)}) =
\sum_{k=0}^{K-1} y_k(a,\sigma_{s(a)})\,
\log \frac{y_k(a,\sigma_{s(a)})}{q_k(X,\theta)}.
$$

Age stages are constructed data-dependently rather than by fixed decade bins. Using EfficientNetV2 embeddings \(f(X)\), the method computes age-class prototypes

$$
\mu_k = \frac{1}{|D_k|}\sum_{X\in D_k} f(X), \qquad k=0,\ldots,K-1,
$$

clusters \(\{\mu_k\}\) with K-means into \(S\) clusters,

$$
\{\mathcal{C}_1,\ldots,\mathcal{C}_S\} = \mathrm{KMeans}(\{\mu_k\},S),
$$

and then sorts and merges clusters into contiguous stage intervals \(\mathcal{S}_s\). The paper uses \(S=10\) stages. This construction is motivated by an embedding-similarity analysis showing that label ambiguity exhibits clear stage-wise patterns.

The stage-wise adaptive weighted loss, SAW, combines classification, distribution, and regression terms. The hard-label cross-entropy is

$$
L_{\mathrm{CE}}(X,a;\theta) = -\sum_{k=0}^{K-1} g_k(a)\log q_k(X,\theta) = -\log q_a(X,\theta),
$$

and the regression term is

$$
\hat a(X,\theta) = \sum_k k\,q_k(X,\theta), \qquad
L_{\mathrm{MSE}}(X,a;\theta) = \big(\hat a(X,\theta)-a\big)^2.
$$

Each stage \(s\) has a learned weight \(\alpha_s \in [0,1]\), with \(\alpha(a)=\alpha_{s(a)}\), and the per-sample loss is

$$
L_{\mathrm{SAW}}(X,a;\theta,\sigma,\alpha) =
\alpha_{s(a)}\,L_{\mathrm{KL}}(X,a;\theta,\sigma_{s(a)})
+ \big(1-\alpha_{s(a)}\big)\,L_{\mathrm{CE}}(X,a;\theta)
+ 0.01\,L_{\mathrm{MSE}}(X,a;\theta).
$$

The adaptive variance term, SAV, assigns a unique \(\sigma_s>0\) to each stage, typically via

$$
\sigma_s = \mathrm{softplus}(\rho_s) + \varepsilon.
$$

The paper states that SAW “learns the weights for classification and distribution at each stage”; a practical parameterization is \(\alpha_s=\sigma(\beta_s)\). The reported optimization protocol trains SAV jointly with the network, evaluates on a validation split, and accepts updates to \(\theta\) and \(\sigma_s\) when the validation \(L1\) age error improves.

Relative to standard LDL with a fixed-variance Gaussian target and unweighted KL, SA-LDL changes gradient behavior in two ways. SAV sharpens the target in low-ambiguity stages and broadens it in high-ambiguity ones. SAW emphasizes distribution matching where ambiguity is high and hard classification where ambiguity is low. This directly targets the claim that adjacent ages do not exhibit uniform ambiguity across the age spectrum.

## 4. Mean-residue weighting over age probabilities

"Adaptive Mean-Residue Loss for Robust Facial Age Estimation" defines an age-weighted loss without requiring a target label distribution [2203.17156]. Ages are modeled as ordered classes \(a \in \{1,2,\ldots,L\}\), and a CNN produces logits \(z \in \mathbb{R}^{N\times L}\) and softmax probabilities

$$
p_{i,j} = \frac{\exp(z_{i,j})}{\sum_{l=1}^L \exp(z_{i,l})}.
$$

The predicted mean age is the expectation of the age distribution,

$$
m_i = \sum_{j=1}^L j\,p_{i,j}.
$$

The first component, the mean loss, penalizes deviation between the expected age and the ground-truth age:

$$
L_m = \frac{1}{2N}\sum_{i=1}^N (m_i-y_i)^2
= \frac{1}{2N}\sum_{i=1}^N \left(\sum_{j=1}^L j\,p_{i,j} - y_i\right)^2.
$$

This term is age-weighted in the literal sense that the numeric magnitude of ages shapes the gradient through the expectation.

The second component, residue loss, acts on the probability mass outside an adaptive top-\(K\) neighborhood. For each sample, the rank of the ground-truth age is

$$
R_{y_i} = 1 + \left|\{j \in \{1,\ldots,L\} : p_{i,j} > p_{i,y_i}\}\right|,
$$

and the adaptive neighborhood size is

$$
K_i = \max\{2, R_{y_i}\}.
$$

Let \(S_{K_i}(p_i)\) denote the indices of the \(K_i\) largest probabilities. The residue loss is the entropy outside this set:

$$
L_r = -\frac{1}{N}\sum_{i=1}^N \sum_{j \notin S_{K_i}(p_i)} p_{i,j}\log p_{i,j}.
$$

The full objective is

$$
L = L_s + \lambda_1 L_m + \lambda_2 L_r,
$$

with hard-label softmax loss

$$
L_s = -\frac{1}{N}\sum_{i=1}^N \log p_{i,y_i}.
$$

The adaptive mechanism is intended to avoid the failure modes of a fixed neighborhood. Early in training, when \(p_i\) is diffuse and \(R_{y_i}\) is large, \(K_i\) is also large, so \(L_r\) does not over-constrain the distribution. As training progresses and the true age rises in rank, \(K_i\) shrinks automatically, sharpening the distribution around a plausible age neighborhood. The paper explicitly contrasts this design with Gaussian label-distribution learning, mean-variance losses, Earth Mover’s Distance, ordinal regression losses, and sample- or class-weighted cross-entropy. Its distinctive claim is that AMR performs “probability reweighting” within each sample by suppressing mass far from an adaptively chosen plausible set that is guaranteed to contain the true class.

## 5. Age-group weighting, discrepancy, and fairness

"Maximum Weighted Loss Discrepancy" uses age-weighted loss in a different but formally precise sense: age defines groups whose conditional losses are compared with the population loss under an explicit weighting function [1906.03518]. Let \(z=(x,y)\sim p^\star\), let \(f\) be a predictor, and let the bounded per-example loss satisfy \(\ell(f(x),y)\in[0,1]\). The population loss is

$$
L(f) = \mathbb{E}_{z\sim p^\star}[\ell(f(x),y)].
$$

Partition the population into age groups \(A_1,\ldots,A_K\), with indicators \(g_k(z)=1\) if \(A(z)=A_k\) and proportions \(p_k = \mathbb{P}(A(z)=A_k)\). The group loss is

$$
L_{g_k}(f) = \mathbb{E}[\ell(f(x),y)\mid g_k(z)=1].
$$

With a weighting function \(w:\mathcal{G}\to[0,1]\), the age-only maximum weighted loss discrepancy is

$$
D_{\mathrm{age}}(w,\ell,f) =
\max_{k\in\{1,\ldots,K\}} w(g_k)\,\left|L_{g_k}(f)-L(f)\right|.
$$

The paper studies the family

$$
w^{(k)}(g) = [g]^k, \qquad k\in(0,1],
$$

where \([g]\) is group mass. For finite age groups, estimation is straightforward via plug-in estimators for \(\widehat L\), \(\widehat L_{g_k}\), and \(\widehat p_k\):

$$
\widehat D_{\mathrm{age},n}(w^{(k)}) =
\max_{k\in\{1,\ldots,K\}}
\widehat p_k^{\,k}\,
\left|\widehat L_{g_k}(f)-\widehat L(f)\right|.
$$

A major theoretical distinction concerns group scope. The paper proves that it is statistically impossible to estimate \(D(w)\) when all groups have equal weight across the class of all measurable groups, but it explicitly notes that this impossibility does not apply when one restricts attention to a finite set of age groups. It also derives a tight relation between MWLD with \(k=1/2\) and loss variance:

$$
D(w^{(1/2)}) \le \sqrt{\mathrm{Var}[\ell]}
\le D(w^{(1/2)})\sqrt{2-4\ln(D(w^{(1/2)}))}.
$$

For age-only analysis, the corresponding coarse loss variance uses \(\mathrm{Var}(\mathbb{E}[\ell\mid A])\), and the paper recommends regularization objectives of the form

$$
\min_f \widehat L(f) + \lambda \sum_{k=1}^K \pi_k (m_k-\overline{\ell})^2,
$$

where \(m_k\) is the empirical mean loss for age bin \(A_k\). In this framework, age-weighted loss is not an age-estimation objective; it is a fairness or robustness criterion that controls age-dependent loss disparities.

## 6. Discounted loss and the temporal age of errors

"Prediction with Expert Advice under Discounted Loss" uses age-weighted loss in a temporal sense: the age of a loss is its recency, and older losses are discounted [1005.1918]. In the online protocol, the learner and experts incur round-wise losses \(\ell_t\) and \(\ell_t^{(i)}\). An “Accountant” announces a discount factor \(\alpha_{t-1}\in(0,1]\), and cumulative discounted loss evolves by

$$
L_t = \alpha_{t-1}L_{t-1} + \ell_t, \qquad L_0 = 0,
$$

with the same recursion for each expert:

$$
L_t^{(i)} = \alpha_{t-1}L_{t-1}^{(i)} + \ell_t^{(i)}.
$$

Defining

$$
B_t := \frac{1}{\alpha_1\alpha_2\cdots\alpha_{t-1}}, \qquad B_1=1,
$$

and

$$
S_T := \sum_{s=1}^T B_s,
$$

the weight of loss \(\ell_s\) inside \(L_T\) is

$$
\rho_{T,s} = \prod_{u=s}^{T-1}\alpha_u = \frac{B_s}{B_T},
$$

so that

$$
L_T = \sum_{s=1}^T \rho_{T,s}\,\ell_s
= \frac{1}{B_T}\sum_{s=1}^T B_s\,\ell_s.
$$

For exponential discounting with constant \(\alpha_t=\gamma\in(0,1)\),

$$
\rho_{T,s} = \gamma^{T-s},
\qquad
H_T := \frac{S_T}{B_T} = \sum_{j=0}^{T-1}\gamma^j
= \frac{1-\gamma^T}{1-\gamma}.
$$

The effective horizon \(H_T\) replaces the ordinary horizon \(T\) in regret bounds. Under mixability, the discounted Aggregating Algorithm yields

$$
L_T \le c\,L_T^{(i)} + \frac{c\ln N}{\eta}.
$$

For bounded convex losses, the discounted EWA or Weak AA guarantee is

$$
L_T \le L_T^{(i)} + \sqrt{\ln N}\,\sqrt{H_T}.
$$

The same formalism extends to discounted online regression. For linear predictors \(\theta\in\mathbb{R}^n\) and square loss, with discount matrix

$$
W_T = \mathrm{diag}\!\left(\frac{B_1}{B_T},\ldots,\frac{B_T}{B_T}\right),
$$

the paper gives a discounted Aggregating Algorithm for Regression bound,

$$
\sum_{t=1}^T \rho_{T,t}(\hat y_t-y_t)^2
\le
\sum_{t=1}^T \rho_{T,t}(\theta^\top x_t-y_t)^2
+ a\|\theta\|^2
+ \frac{(Y_2-Y_1)^2}{4}\ln\det\!\left(I+\frac{X^\top W_T X}{a}\right).
$$

In this literature, age-weighting is therefore a weighting by temporal age, not by chronological age label or demographic age group.

## 7. Empirical evidence, design implications, and limitations

The age-estimation papers report that age-weighted objectives improve performance when the data exhibit imbalance, ambiguity, or ordinal uncertainty. PML reports MAE \(=2.15\) on Morph II Setting I, \(2.31\) on Morph II Setting II, \(2.16\) on FG-NET, and \(3.455\) on ChaLearn LAP 2015 without pretraining; \(PML^\*\) attains \(2.915^\*\) and \(\epsilon=0.243^\*\) on ChaLearn. Its curriculum analysis shows MAE decreases as curricula progress from balanced to imbalanced, for example Morph II \(3.751\to2.314\) and ChaLearn \(6.720\to3.878\) [2103.02140]. SA-LDL reports MAE of \(1.74\) on MORPH-II and \(2.15\) on FG-NET. Its ablations isolate both components: on MORPH-II, SAV yields MAE \(2.01\) versus \(2.21\) for fixed variance, and SAW yields \(2.01\) versus \(2.10\) for unweighted KL+CE, \(2.73\) for KL only, and \(2.84\) for CE only; the combined SA-LDL objective reaches \(1.74\) versus \(1.89\) for SAV only and \(2.10\) for SAW only [2509.00450]. AMR reports, with ResNet-50, FG-NET MAE \(3.61\) and CLAP2016 \(\epsilon=0.3882\), outperforming the ablated softmax-only, mean-plus-softmax, variance-plus-softmax, mean-variance, and residue-plus-softmax variants listed in the paper [2203.17156].

These results suggest several distinct implementation rationales. PML is preferable when the age distribution is markedly long-tailed and decision-boundary shifts are more desirable than coarse scalar class weights. SA-LDL is tailored to the claim that label ambiguity is stage-dependent, so a fixed-variance Gaussian target is misspecified. AMR is useful when one wants to exploit ordinal expectation and adaptive neighborhood suppression without constructing a target label distribution. The fairness-oriented MWLD framework addresses a different question: not predictive accuracy on age estimation benchmarks, but whether average loss hides large discrepancies across age groups. In that setting, the paper reports that loss variance regularization can halve the loss variance of a classifier and reduce MWLD without suffering a significant drop in accuracy, and that coarse loss variance with sensitive attributes including age can halve \(\mathrm{Var}(\mathbb{E}[\ell\mid A])\) with approximately \(1\)–\(2\%\) average loss increase [1906.03518].

The main limitations are also formulation-specific. PML requires tuning \(\lambda\), \(\beta\), and \(\sigma\), as well as curriculum splits \(\delta_i\) and sampling function \(\rho(\cdot)\); mis-specified margins, noisy age labels, or unreliable centers for extremely sparse classes may destabilize training [2103.02140]. SA-LDL introduces trainable stage parameters \(\alpha_s\) and \(\sigma_s\), depends on stage construction by K-means, and uses validation \(L1\) acceptance for updating \(\theta\) and \(\sigma_s\) [2509.00450]. AMR is sensitive to \(\lambda_1\), \(\lambda_2\), and the behavior of adaptive \(K_i\), especially early in training when \(L_r\) may be inactive [2203.17156]. MWLD theory assumes bounded losses, shows impossibility for uniform weights over all measurable groups, and entails slower convergence for smaller weight exponents \(k\) when one seeks stronger protection for small groups [1906.03518]. Discounted-loss methods replace ordinary horizon dependence by the effective horizon \(H_T\), which is advantageous under nonstationarity but tied to the choice of \(\alpha_t\) or \(\gamma\) [1005.1918].

Taken together, these formulations show that age-weighted loss is best understood as a structured departure from uniform empirical risk. The structure may encode age ordinality, long-tail correction, stage-wise ambiguity, neighborhood plausibility, disparity across age groups, or temporal recency. The specific meaning of “weighting” therefore depends on whether the objective acts on logits, loss terms, group discrepancies, or time-discounted accumulation.

Source: https://www.emergentmind.com/topics/age-weighted-loss