Documentation & tutorial
Using H.E.R.D.
A practical guide to running HERD, understanding its models, reading the performance metrics, and choosing a decision threshold for host-aware protein immunogenicity prediction.
01 · Overview
What HERD predicts
HERD (Host-aware Estimation of antigen immunogenicity and Ranking through Deep-learning) predicts, for a given protein and a chosen host species, the probability that the protein is immunogenic in that host. Unlike host-agnostic tools that assign one score per protein, HERD models immunogenicity as a protein-intrinsic signal shaped by the host in which it is evaluated.
It is trained on curated, protein-level, host-resolved immunogenicity data (manual literature curation + IEDB B-cell records), with length-matched, homology-filtered negatives so the classifier cannot exploit trivial sequence cues. Predictions can be used to prioritise and rank antigen candidates for reverse-vaccinology pipelines across veterinary and human hosts.
02 · How to use
Three ways to run HERD
Quick prediction
Submit sequences in the browser and get per-protein immunogenicity scores in minutes. No install.
Live on Hugging FaceGoogle Colab
Run batches in a pre-configured notebook with a GPU backend.
Coming soonInstall & CLI
Deploy on your machine or cluster for large-scale scoring.
Coming soonWeb tool — step by step
- Open the immunoHERD Space on Hugging Face.
- Paste one or more protein sequences in FASTA format (or upload a FASTA file).
- Select the host species whose immune context you want to model.
- Run the prediction and read the immunogenicity probability returned for each sequence.
- Rank your candidates by score, or apply a cutoff (see Decision threshold).
03 · Input & output
What goes in, what comes out
Input
- Format: protein sequences in FASTA (amino-acid, single-letter).
- Length: sequences shorter than 40 residues are outside the training regime; sequences longer than 1,022 residues are truncated before encoding.
- Residues: non-canonical residues / chemical modifications are not supported.
Output
- A probability in [0, 1] per protein for the selected host — higher means more likely immunogenic.
- Use the raw score to rank candidates, or a threshold to get a binary immunogenic / non-immunogenic call.
04 · The models
How the models are built
Every protein is first turned into features by a protein language model; those features then feed the predictors.
Protein representation — ESM-2
Each sequence is encoded with ESM-2 (esm2_t33_650M_UR50D, 650M parameters, 33 layers). The final-layer per-residue vectors are mean-pooled into a single 1,280-dimensional embedding per protein, which is the input to all downstream models.
Individual (host-specific) models
One model per core host: a multilayer perceptron over the 1,280-D embedding — a normalization layer, three fully connected layers (1,024 → 256 → 64 ReLU units, dropout after the first two) and a sigmoid output. Trained with Adam + binary cross-entropy, class weighting, and early stopping; dropout and learning rate tuned with Optuna (objective: validation AUROC).
Integrated (pan-species) model
A single network with a shared trunk (1,024–256–64) feeding one sigmoid head per host; the host identity selects its head. Joint training lets hosts share cross-species immunogenicity signal while keeping host-specific decision functions. It is trained on 15 hosts — the 6 core hosts plus 9 additional IEDB-only species — with a tunable per-host weighting so large datasets do not dominate.
Auxiliary models (the 9 additional heads)
Nine extra species were mined from IEDB and added primarily to broaden the shared antigen repertoire seen by the trunk — they were not used for model selection, hence "auxiliary". In practice their heads still classify accurately (AUROC 0.86–0.96), so several are usable predictors in their own right for additional hosts of applied interest (e.g. Capra hircus 0.900, Ovis aries 0.859).
05 · Species
Hosts covered
Core hosts (curated + IEDB, used for model selection)
Auxiliary hosts (IEDB-only, additional heads)
06 · Performance
Metrics
Discrimination is threshold-independent (AUROC, AUPRC); at the default 0.5 threshold we also report precision, recall, F1, Matthews correlation coefficient (MCC) and balanced accuracy. All values are pooled out-of-fold predictions from homology-aware nested cross-validation.
Individual models — nested cross-validation
| Host | N+ | N− | AUROC | AUPRC | Prec. | Recall | F1 | MCC | Bal.acc. |
|---|---|---|---|---|---|---|---|---|---|
| Homo sapiens | 3562 | 3473 | 0.916 | 0.929 | 0.893 | 0.786 | 0.836 | 0.693 | 0.845 |
| Bos taurus | 441 | 441 | 0.776 | 0.767 | 0.714 | 0.701 | 0.707 | 0.420 | 0.710 |
| Sus scrofa | 528 | 528 | 0.847 | 0.847 | 0.791 | 0.741 | 0.765 | 0.547 | 0.773 |
| Gallus gallus | 460 | 460 | 0.830 | 0.830 | 0.782 | 0.748 | 0.764 | 0.540 | 0.770 |
| Canis sp. | 338 | 338 | 0.794 | 0.790 | 0.760 | 0.636 | 0.692 | 0.441 | 0.717 |
| Equus caballus | 335 | 335 | 0.896 | 0.853 | 0.813 | 0.869 | 0.840 | 0.670 | 0.834 |
Generalisation to unseen pathogens — LOPO (Table 3)
| Host | AUROC | AUPRC | Prec. | Recall | F1 | MCC | Bal.acc. | Pathogens |
|---|---|---|---|---|---|---|---|---|
| Homo sapiens | 0.897 | 0.916 | 0.896 | 0.747 | 0.815 | 0.666 | 0.829 | 66 |
| Bos taurus | 0.784 | 0.786 | 0.717 | 0.726 | 0.722 | 0.440 | 0.720 | 16 |
| Sus scrofa | 0.806 | 0.806 | 0.801 | 0.723 | 0.760 | 0.546 | 0.772 | 15 |
| Gallus gallus | 0.744 | 0.741 | 0.715 | 0.604 | 0.655 | 0.367 | 0.682 | 8 |
| Canis sp. | 0.740 | 0.737 | 0.736 | 0.604 | 0.663 | 0.394 | 0.694 | 9 |
| Equus caballus | 0.855 | 0.808 | 0.771 | 0.812 | 0.791 | 0.571 | 0.785 | 10 |
Integrated (pan-species) model
Under the same nested-CV framework the integrated model matched or improved all six core hosts. Across all 15 species it reached a pooled AUROC 0.916 (AUPRC 0.922): 0.902 for the six core species and 0.929 for the nine auxiliary species. Some of the smallest auxiliary heads were among the best (Macaca sp. n=248, AUROC 0.963; Cavia porcellus n=124, AUROC 0.959).
| Host | AUROC (indiv.) | AUROC (integ.) | MCC (indiv.) | MCC (integ.) |
|---|---|---|---|---|
| Bos taurus | 0.776 | 0.826 | 0.420 | 0.520 |
| Homo sapiens | 0.916 | 0.927 | 0.693 | 0.725 |
Benchmark vs other predictors — veterinary hosts (Table 4)
| Host | Method | Prec. | Recall | F1 | MCC |
|---|---|---|---|---|---|
| Bos taurus | HERD (integrated) | 0.799 | 0.687 | 0.739 | 0.520 |
| HERD (individual) | 0.714 | 0.701 | 0.707 | 0.420 | |
| IApred | 0.691 | 0.653 | 0.671 | 0.361 | |
| Vaxign-ML | 0.588 | 0.580 | 0.584 | 0.173 | |
| Sus scrofa | HERD (integrated) | 0.831 | 0.718 | 0.770 | 0.577 |
| HERD (individual) | 0.791 | 0.741 | 0.765 | 0.547 | |
| IApred | 0.666 | 0.536 | 0.594 | 0.272 | |
| Vaxign-ML | 0.586 | 0.441 | 0.503 | 0.131 | |
| Gallus gallus | HERD (integrated) | 0.785 | 0.748 | 0.766 | 0.544 |
| HERD (individual) | 0.782 | 0.748 | 0.764 | 0.540 | |
| IApred | 0.561 | 0.583 | 0.571 | 0.126 | |
| Vaxign-ML | 0.627 | 0.204 | 0.308 | 0.107 | |
| Canis sp. | HERD (integrated) | 0.765 | 0.702 | 0.732 | 0.488 |
| HERD (individual) | 0.760 | 0.636 | 0.692 | 0.441 | |
| IApred | 0.643 | 0.562 | 0.600 | 0.252 | |
| Vaxign-ML | 0.667 | 0.253 | 0.367 | 0.161 | |
| Equus caballus | HERD (integrated) | 0.829 | 0.797 | 0.813 | 0.633 |
| HERD (individual) | 0.813 | 0.869 | 0.840 | 0.670 | |
| IApred | 0.682 | 0.672 | 0.677 | 0.358 | |
| Vaxign-ML | 0.653 | 0.272 | 0.384 | 0.242 |
Independent external benchmark (iBPA)
On the third-party iBPA bacterial protective-antigen set (131 positives / 115 negatives), under each method's native threshold, the integrated HERD model ranked first overall and is the best sequence-only predictor — matching a structure-based method without needing protein structures.
| Method | Input | Prec. | Recall | F1 | MCC |
|---|---|---|---|---|---|
| HERD (integrated) | Sequence | 0.832 | 0.794 | 0.812 | 0.610 |
| PLGDL | Seq + structure | 0.800 | 0.840 | 0.820 | 0.600 |
| HERD (individual) | Sequence | 0.792 | 0.786 | 0.789 | 0.551 |
| Vaxign-ML | Sequence | 0.750 | 0.810 | 0.760 | 0.510 |
| Vaxign-DL | Sequence | 0.730 | 0.830 | 0.740 | 0.490 |
| Vaxi-DL | Sequence | 0.670 | 0.920 | 0.700 | 0.460 |
| IApred | Sequence | 0.713 | 0.817 | 0.762 | 0.453 |
| VaxiJen3 | Sequence | 0.710 | 0.780 | 0.710 | 0.420 |
| VaxiJen | Sequence | 0.680 | 0.690 | 0.660 | 0.320 |
| Vaxign | Sequence | 0.790 | 0.320 | 0.560 | 0.270 |
Recovery of licensed vaccine antigens
As a real-world positive control, the final pan-species model scored 24 antigens from licensed/commercial vaccines across the six core hosts. HERD recovered 23 of 24 (95.8%) as immunogenic, mean predicted probability 0.914. Per-host recovery was 100% for all hosts except Canis (4/5). The single miss was Protein Q of LETIFEND (0.378), an engineered maltose-binding-protein fusion outside the natural antigen sequence space.
Full antigen panel (Table 6)
| Host | Pathogen (example vaccine) | Antigen | Score |
|---|---|---|---|
| Homo sapiens | HPV-16 (Gardasil/Cervarix) | L1 major capsid (VLP) | 0.999 |
| Homo sapiens | HBV (Engerix-B/Recombivax) | HBsAg (S protein) | 1.000 |
| Homo sapiens | C. tetani (DT/Td/DTaP) | Tetanus toxoid | 0.980 |
| Bos taurus | BVDV-1 (DIVENCE) | E2 glycoprotein | 0.840 |
| Bos taurus | BVDV-2 (DIVENCE) | E2 glycoprotein | 0.893 |
| Bos taurus | R. microplus (Gavac/TickGARD) | Bm86 | 0.963 |
| Bos taurus | Rhipicephalus sp. (NORAVAC) | Subolesin | 0.822 |
| Sus scrofa | PCV2 (CircoFLEX/Circovac/Porcilis) | ORF2 capsid | 1.000 |
| Sus scrofa | CSFV (Porcilis Pesti/Bayovac) | E2 glycoprotein | 0.995 |
| Gallus gallus | AIV H5N1 (VOLVAC B.E.S.T.) | Hemagglutinin H5 | 0.980 |
| Gallus gallus | IBDV (YEBIO VP2) | VP2 | 0.887 |
| Gallus gallus | FAdV-4 subunit | Fiber-2 | 0.952 |
| Gallus gallus | EDSV (Pulike multivalent) | Truncated Fiber (tFiber) | 0.747 |
| Canis sp. | L. infantum (Leish-Tec) | A2 | 0.989 |
| Canis sp. | B. burgdorferi (Vanguard/Nobivac Lyme) | OspA | 0.991 |
| Canis sp. | B. burgdorferi (Vanguard/Nobivac Lyme) | OspC | 0.991 |
| Canis sp. | B. burgdorferi B31 (Vanguard crLyme) | OspA (B31) | 0.996 |
| Canis sp. | L. infantum (LETIFEND) | Protein Q (MBP-fusion) | 0.378 |
| Equus caballus | C. tetani (Equilis Tetanus) | Tetanus toxoid | 0.927 |
| Equus caballus | S. equi (STRANGVAC) | Eq85 fusion | 0.954 |
| Equus caballus | S. equi (STRANGVAC) | CCE fusion | 0.896 |
| Equus caballus | S. equi (STRANGVAC) | CNEEAG fusion | 0.886 |
| Equus caballus | S. equi (STRANGVAC) | IE5 fusion | 0.927 |
| Equus caballus | S. equi (STRANGVAC) | CPCE fusion | 0.944 |
07 · Decision threshold
Choosing & adjusting the threshold
HERD returns a probability, not a hard label. The reported classification metrics use a default decision threshold of 0.5: scores above are called immunogenic, below non-immunogenic. AUROC and AUPRC do not depend on this choice.
How to move it
- Raise the threshold (e.g. 0.7–0.9) → higher precision, fewer false positives. Best when you can only take a short list of candidates forward to the lab.
- Lower the threshold → higher recall, fewer missed immunogens, at the cost of more false positives.
- Just rank — for prioritisation you often don't need a cutoff at all; sort candidates by score and take the top N.
08 · Interpretation
Reading a score & caveats
- A score is the estimated probability of humoral immunogenicity in the selected host — the principal correlate of protection for most licensed vaccines, and for T-dependent protein antigens it generally implies concomitant CD4⁺ T-helper recognition.
- Immunogenicity ≠ protection. A high score flags a promising candidate, not a guaranteed protective antigen.
- Host matters: the same protein can score differently across hosts by design. Pick the host that matches your application.
- Engineered / chimeric sequences (fusion constructs, artificial linkers) may fall outside the natural antigen space and score low even when protective (e.g. the LETIFEND Protein Q fusion).
09 · Cite & contact
Citation & contact
Manuscript in preparation — citation details will be updated after publication.
Isidro Sobrino · Noelia Vallez Enano · Gloria Bueno · Margarita Villar · José de la Fuente
Questions about the models, the data or running the tool:
isidro.sobrino@uclm.es