EpiClock: A family of transformer epigenetic clocks

EpiClock is a family of five transformer models that estimate age from DNA methylation (Illumina 450K / EPIC beta values). All five were trained on an audited set of healthy-control profiles and tested on 40 studies that were never used for training.

These are research models. They are not a medical device and are not validated for clinical decisions.

Results

Test set: 2,830 healthy controls from 40 held-out ComputAge Bench studies (2,699 of them blood). Lower error is better. The interval is a 95% bootstrap over whole studies.

Model Parameters Median abs. error (years) Mean abs. error r
EpiClock-T 2.1 M 3.49 [2.69, 5.07] 4.85 0.917
EpiClock-S 3.2 M 3.44 [2.64, 5.05] 4.83 0.919
EpiClock-B 6.3 M 3.38 [2.63, 4.94] 4.84 0.917
EpiClock-L 11.2 M 3.34 [2.57, 4.86] 4.78 0.918
EpiClock-XL 48.0 M 3.42 [2.55, 4.99] 4.89 0.915
Elastic net, same training data 9,098 weights 3.27 [2.57, 4.76] 4.62 0.921
Ridge, same training data 9,098 weights 3.56 [2.73, 5.19] 4.89 0.917

Published clocks on the same test samples, restricted to the same 9,098-CpG panel:

Clock Median abs. error (years)
Horvath V2 (skin and blood) 4.18
Horvath V1 (pan-tissue) 5.37
Lin 7.57
PhenoAge (83% of its CpGs are in the panel) 8.03
Hannum 8.38

Age error of every model on the held-out healthy controls

What these numbers mean

  • The family is more accurate than the published clocks in this benchmark. The published clocks are handicapped here: CpGs they need that are outside the panel are filled with reference values.
  • The family does not beat an elastic net trained on the same data. Elastic net scores 3.27 y; the best family member scores 3.34 y.
  • Model size made no measurable difference. The five intervals overlap almost completely, and each size was trained once.
  • Age accuracy is not biological-age usefulness. In our tests, age acceleration from these models separated patients from same-study controls about as weakly as ridge and Horvath V2 did (AUC around 0.56).

The full comparison, including paired differences and the data audit, is in report.md.

EpiClock-L predicted age against chronological age

How the models work

  • Each CpG is a token: a learned identity, genome context (chromosome, CpG-island relation, regulatory class, position), and its beta value.
  • A sample is a random subset of its measured CpGs. Predictions over several subsets are averaged.
  • Pre-training hides 25% of the CpGs and reconstructs them, without labels.
  • Fine-tuning predicts age as a linear clock over all CpGs (initialised from ridge) plus a correction learned by the transformer.

Training data

  • 25,765 profiles with an age and 11,526 without, on a fixed panel of 9,098 CpGs.
  • Sources: ComputAge Bench training studies, public GEO series, and the public MethylGPT / EWAS Data Hub collection.
  • Every profile passed an audit: no cancer, no other disease, no cell cultures, no study shared with the test set, no copy of a test sample. Counts for every exclusion are at the end of report.md.
  • 16,508 of the labelled profiles measure only 3,709 of the 9,098 panel CpGs.

Use

Download epiclock.py and a model folder from this repository, then:

from epiclock import epiclock_predict

# rows = samples, columns = CpG ids (cg...), values = beta in [0, 1]; missing values are allowed
res = epiclock_predict("EpiClock-B/model.pt", betas_dataframe)
ages = res["epigenetic_age"]

The weight files are standard PyTorch checkpoints saved with pickle. Load them only from this repository.

Limitations

  • Restricted to a 9,098-CpG panel.
  • Trained and tested mostly on blood, and mostly on adults.
  • Trained on chronological age in healthy people; it is not a predictor of disease or mortality.
  • Expects beta values from 450K or EPIC arrays that have already been processed.

Files

  • EpiClock-T/ โ€ฆ EpiClock-XL/: weights (model.pt), configuration and a short card for each model.
  • FAMILY.md: the family table.
  • report.md: the full study report and data audit.
  • epiclock.py: the training and prediction script.

Licence

Released under CC BY-SA 4.0, the same licence as ComputAge Bench, whose studies are the test set and part of the training data.

Data terms

The training data came from many public studies, each with its own terms. Check the terms of ComputAge Bench and of the individual GEO series before redistributing derived data.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support