Eleuthia-v3
Eleuthia-v3 classifies single amino acid substitutions (missense variants) in 12 cancer-related genes as pathogenic or benign. It is a fine-tuned ESM-2 35M protein language model with a two-class head.
This model was built for a Bachelor's Final Year Project at Universiti Teknologi MARA (UiTM). It is a research prototype. It is not a clinical tool.
Model details
| Item | Value |
|---|---|
| Base model | facebook/esm2_t12_35M_UR50D (12 layers, 35M parameters) |
| Head | Classification head on the first token, 2 outputs |
| Labels | 0 = Benign, 1 = Pathogenic |
| Genes | TP53, BRCA1, BRCA2, EGFR, APC, PTEN, RB1, MLH1, MSH2, KRAS, PIK3CA, CDH1 |
| Maximum input length | 505 tokens |
| Author | Mohamad Hariz Rafie bin Abd Rahim |
Input format
Eleuthia-v3 reads two text segments as a pair:
<cls> K E <eos> [500 residues of the mutant protein window] <eos>
- Segment 1: the wild-type letter and the mutant letter (here, K changed to E).
- Segment 2: a window of up to 500 residues from the mutant protein, centred on the mutation where possible.
The model gets the exact change directly. In earlier versions the model had to find the change by itself.
Window rule
Let pos0 be the 0-based mutation index and L the protein length.
start = max(0, min(pos0 - 250, L - 500))
wt_win = wild_type_sequence[start : start + 500]
mut_win = wt_win with the residue at (pos0 - start) replaced by the mutant letter
- Proteins with 500 residues or more always get a 500-residue window. Near the C-terminus the start moves left, so the mutation is not centred.
- Proteins with fewer than 500 residues use the whole protein.
How to use
You need the wild-type protein sequence (for example from UniProt), the 1-based position, the wild-type letter and the mutant letter.
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
MODEL_ID = "RizFie/Eleuthia-v3"
WINDOW = 500
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForSequenceClassification.from_pretrained(MODEL_ID).eval()
def predict(wt_seq: str, position: int, wt_aa: str, mut_aa: str) -> dict:
pos0 = position - 1
if wt_seq[pos0] != wt_aa:
raise ValueError("The wild-type letter does not match the sequence at this position.")
start = max(0, min(pos0 - WINDOW // 2, len(wt_seq) - WINDOW))
wt_win = wt_seq[start:start + WINDOW]
i = pos0 - start
mut_win = wt_win[:i] + mut_aa + wt_win[i + 1:]
inputs = tokenizer(wt_aa + mut_aa, mut_win, return_tensors="pt")
with torch.no_grad():
probs = torch.softmax(model(**inputs).logits, dim=-1)[0]
return {"benign": probs[0].item(), "pathogenic": probs[1].item()}
The label is pathogenic when the pathogenic probability is 0.5 or higher.
Training data
- Source: variants and clinical labels from the EMBL-EBI Proteins API (variation endpoint), which reports ClinVar annotations. Protein sequences are from UniProt.
- Labels: a variant is pathogenic (1) or benign (0) only when its annotations are clearly one class. Conflicting variants, variants of uncertain significance and variants with only a "likely" label are not in the data.
- Raw data: 11,454 rows (8,230 pathogenic, 3,224 benign).
- Cleaning:
- Keep only rows where the wild-type and the mutant letter are both one of the 20 standard amino acids. This removes stop codons and other symbols (2,959 rows).
- Remove repeated variants. A variant is dropped if its copies have different labels or sit on both sides of the v1 split.
- Keep only rows where the wild-type letter matches the UniProt sequence.
- Clean data: 8,340 rows (5,208 pathogenic, 3,132 benign).
| Split | Rows |
|---|---|
| Training (before oversampling) | 5,298 |
| Training (after oversampling benign rows) | 6,612 |
| Validation | 935 |
| Test | 2,107 (1,318 pathogenic, 789 benign) |
Oversampling was done on the training rows only, after the split. The test rows are the same as the v1 test rows that remain after cleaning, so v1 never trained on them.
The dataset is in a private repository.
Training procedure
| Setting | Value |
|---|---|
| Learning rate | 1e-5, cosine schedule |
| Batch size | 8 |
| Maximum epochs | 15 |
| Weight decay | 0.01 |
| Precision | fp16 |
| Loss | Focal loss (alpha 0.25, gamma 2.0) |
| Early stopping | Patience of 3 epochs, on the validation rows |
| Best-epoch metric | Macro F1 |
| Best epoch | 3 (checkpoint-2481) |
| Seed | 42 |
| Hardware | Google Colab, NVIDIA T4 |
Evaluation
All numbers use the same 2,107 test rows.
| Model | Accuracy | Balanced accuracy | Macro F1 | MCC | AUC |
|---|---|---|---|---|---|
| Eleuthia-v1 | 0.7119 | 0.7112 | 0.7021 | 0.4115 | 0.7827 |
| Eleuthia-v2 | 0.7029 | 0.6758 | 0.6781 | 0.3572 | 0.7437 |
| Eleuthia-v3 | 0.8657 | 0.8593 | 0.8574 | 0.7150 | 0.9307 |
| Majority-class baseline | 0.6255 |
Control: test rows without extreme substitutions
Some substitution types are almost always one class in this dataset. An "extreme" substitution type has at least 30 training rows with at least 95% of them in one class. The substitution lookup is a baseline that scores each row with the share of pathogenic training rows for its substitution type.
| Model | Accuracy (all 2,107 rows) | AUC (all rows) | Accuracy (1,485 rows without extreme) | AUC (without extreme) |
|---|---|---|---|---|
| Eleuthia-v1 | 0.7119 | 0.7827 | 0.7286 | 0.7749 |
| Eleuthia-v2 | 0.7029 | 0.7437 | 0.6896 | 0.7626 |
| Eleuthia-v3 | 0.8657 | 0.9307 | 0.8175 | 0.8902 |
| Substitution lookup | 0.7935 | 0.8805 | 0.7131 | 0.7886 |
| Majority baseline | 0.6255 | 0.5104 |
Eleuthia-v3 is above the substitution lookup on both sets. The gap is smaller on all rows (about 7 accuracy points) than without the extreme substitutions (about 10 points). Part of the v3 result is probably the substitution pattern in the data.
Version history
| Version | Input | Note |
|---|---|---|
| v1 | Mutated window only (up to 1,022 residues) | Did not know which residue changed. Trained and tested with stop-codon rows. Used the test rows to choose its best epoch, so its numbers can only be optimistic. |
| v2 | Wild-type window + mutant window (500 + 500) | Worse than v1. A probable reason is that ESM-2 has no segment marker, so the model must match residues 500 positions apart. This is an explanation and was not tested. |
| v3 | Wild-type and mutant letters + mutant window (2 + 500) | Same network, data, splits and training code as v2. Only the input changed. |
The Eleuthia-v2 repository holds the pair-window model above. An earlier 150M-parameter model was first published under that name. Its files may still be in the repository history.
Intended use
- Research and teaching on protein language models and variant effect prediction.
- Ranking or flagging variants for further study by a qualified person.
Out-of-scope use
- Clinical diagnosis, treatment decisions or patient reports.
- Genes outside the 12 listed genes. The model was not tested on them.
- Variant types other than single amino acid substitutions (insertions, deletions, stop-gain, frameshift).
Limitations
- Substitution pattern. Some substitution types are almost always one class in the data (for example Q to K, Q to E and E to Q are almost always pathogenic). The lookup baseline alone reaches 0.794 accuracy on all test rows. The cause is not known.
- Random split. Variants at nearby positions can be in both the training and the test rows. A test that holds out whole regions or whole genes would probably give lower numbers. This was not run for v3.
- Window size. v3 sees 500 residues, not the whole protein, for MLH1, CDH1, RB1 and MSH2 (the four genes of 500 to 1,022 residues). The five longest genes were already cut to a window in v1.
- Class imbalance in some genes. PTEN, KRAS and PIK3CA have very few benign examples (9, 9 and 6 in the raw data). Predictions for these genes should not be trusted.
- Label quality. Labels come from ClinVar annotations as reported by the EMBL-EBI API. Annotation errors are in the data.
- No evaluation on variants of uncertain significance. Those variants have no ground truth, so accuracy cannot be measured on them. Any prediction on them is unverified.
- Not calibrated. The probability is a model score, not a clinical risk.
Citation
Abd Rahim, M. H. R. (2026). Eleuthia: Predictive Classification of Amino Acid Sequence
Mutations in High-Impact Cancer Genes Using a Transformer-Based Architecture.
Final Year Project, Universiti Teknologi MARA.