AgeSynth β Age Scalar β Chronological Age Regression Models
This directory stores regression models that convert the StyleGAN age scalar obtained when traversing the AgeSynth age-direction in StyleGAN2βs W space into an estimated chronological age (and vice-versa), depending on the original subject's age. The mappings were produced by fitting linear and polynomial regressions on a curated subset of images from the UTKFace dataset, after projecting each image into StyleGAN2 and measuring the scalar value along the learned age direction.
Overview
- Training: AgeSynth β Age Scalar was trained on UTKFace (age-annotated face dataset)
- Backbone: AgeSynth β Age Scalar is adapted from StyleGAN2-FFHQ (official NVIDIA release)
- Source model: https://github.com/NVlabs/stylegan2
- License: Nvidia Source Code License-NC
- Parameters:
- Linear fits: 2 coefficients per age bracket
- 5-th order polynomial fit: 6 coefficients per age bracket
- Task: Obtain a scalar mapping of Latent-space scalar β age regression. These models are used extensively in
agesynth/age_vector.pyfrom our original code base at https://gitlab.idiap.ch/biometric/code.ijcb2025.agesynth - Framework: NumPy
License
Copyright (c) 2025 Idiap Research Institute
CC BY-NC 4.0 (Creative Commons Attribution-NonCommercial 4.0 International) This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
Model output structure:
- Files:
age_fit_linear_pos.pkl: for linear fittings in the 'aging' direction.age_fit_linear_neg.pkl: for linear fittings in de 'de-aging' direction.age_fit_5_dict.pkl: for polynomial fittings in the 'aging' and 'de-aging' direction.
- Format:
dictwith keys corresponding to age brackets of the original subject's age, with lower bound inclusive and upper bound exclusive. The available keys are:['below-8', '8-to-13', '13-to-18', 18-to-25', '25-to-35', '35-to-45','45-to-55', '55-to-65', 'above-65']- Each value is a NumPy array containing the polynomial or linear coefficients (highest order first) that map latent scalar β chronological age for that bracket.
Minimal code to instantiate the model and perform inference:
Example for estimating a subject's age from a scalar offset in the latent space
import pickle
import numpy as np
# Load 5th-order polynomial model for the 25-35 age bracket
#original_subject_age = 30
with open("age_fit_5_dict.pkl", "rb") as f:
model_dict = pickle.load(f)
coeffs = model_dict["25-to-35"] # numpy array of length 6 (highest order first)
#
scalar_origin = 0.0 #corresponds to 30 years old in the 25-to-35 age group
# Predict chronological age in years
age_pred = np.polyval(coeffs, scalar_origin)
print(f"Predicted age: {age_pred:.1f} years")
Available Models
| File | Model type | Intended direction | Brief description |
|---|---|---|---|
age_fit_linear_pos.pkl |
Ordinary Least Squares β linear | Ageing (+) | Linear mapping for positive age deltas |
age_fit_linear_neg.pkl |
Ordinary Least Squares β linear | De-ageing (β) | Linear mapping for traversing the age direction in the negative direction |
age_fit_5_dict.pkl |
5-th order polynomial | Both | Captures non-linear relationship between latent scalar and real age |
Training Data & Procedure
- Curated UTKFace image lists (covering the 0β116 year span) were projected into StyleGAN2βs w space.
- The latent scalars were regressed against the chronological ages to obtain the linear and 5-th order polynomial mappings.
- Model selection was validated on a held-out split.
Usage
- Obtain the StyleGAN age scalar for a face (dot-product of the latent with the AgeSynth direction).
- Pick the corresponding age bracket (e.g.
25-to-35). - Retrieve the coefficients from the dictionary and evaluate the polynomial / linear function with NumPy to get the predicted age in years.
No additional libraries are required beyond NumPy and pickle for loading.
Limitations & Biases
- Trained on UTKFace; inherits demographic biases (age/ethnicity imbalance).
- Accuracy deteriorates outside the 0β116 y range.
- Not intended for biometric age estimation nor decision making.
Citation
If you use these models, please cite:
@InProceedings{luevano2024agesynth,
title={Identity-Preserving Aging and De-Aging of Faces in the StyleGAN Latent Space},
author={Luevano, Luis S. and Korshunov, Pavel and Marcel, SΓ©bastien},
booktitle={2025 IEEE International Joint Conference on Biometrics (IJCB)},
year={2025}
}
Third-Party Data
This model was derived from the UTKFace dataset. UTKFace images are licensed for non-commercial research purposes only. Any use of these regression models must therefore remain non-commercial.
The UTKFace dataset license states (excerpt):
The UTKFace dataset is available for non-commercial research purposes only.
Copyright for the original images belongs to the respective owners.
Full license text available at https://susanqq.github.io/UTKFace/.