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.
| 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 |
Eleuthia-v3 reads two text segments as a pair:
<cls> K E <eos> [500 residues of the mutant protein window] <eos>
The model gets the exact change directly. In earlier versions the model had to find the change by itself.
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
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.
| 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.
| 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 |
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 |
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 | 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.
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.
model.safetensors 134 MBtraining_args.bin 5.3 kBbiohub/esm2_t12_35M_UR50D