duttaprat commited on
Commit
17c8ade
·
verified ·
1 Parent(s): 17265e8

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +121 -0
README.md ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ base_model: duttaprat/HViLM-base
4
+ datasets:
5
+ - duttaprat/HVUE-v2
6
+ pipeline_tag: text-classification
7
+ tags:
8
+ - genomics
9
+ - virology
10
+ - dna
11
+ - virus
12
+ - host-tropism
13
+ - hvue-v2
14
+ license: apache-2.0
15
+ ---
16
+
17
+ # HViLM-Tropism
18
+
19
+ **HViLM-Tropism** is the official HViLM model for binary host tropism classification: human-tropic versus non-human-tropic viruses.
20
+
21
+ - **Fine-tuned from:** [duttaprat/HViLM-base](https://huggingface.co/duttaprat/HViLM-base)
22
+ - **Benchmark:** [duttaprat/HVUE-v2](https://huggingface.co/datasets/duttaprat/HVUE-v2)
23
+ - **HVUE v2 configuration:** `Host_Tropism/standard_95_1000bp`
24
+ - **Checkpoint selection:** best validation F1 (`checkpoint-14000`)
25
+ - **Input:** virus nucleotide sequence
26
+ - **Output:** non-human-tropic vs. human-tropic
27
+
28
+ This repository contains a **standalone full fine-tuned checkpoint**, so users can load `duttaprat/HViLM-Tropism` directly without separately loading `HViLM-base`.
29
+
30
+ ## Label Mapping
31
+
32
+ | ID | Label |
33
+ |---:|---|
34
+ | 0 | `NON_HUMAN_TROPIC` |
35
+ | 1 | `HUMAN_TROPIC` |
36
+
37
+ ## Performance
38
+
39
+ Held-out HVUE v2 test set, standard 1000-nt configuration:
40
+
41
+ | Metric | Score |
42
+ |---|---:|
43
+ | Accuracy | 96.49 |
44
+ | F1 | 74.49 |
45
+ | MCC | 48.99 |
46
+ | Precision | 74.96 |
47
+ | Recall | 74.04 |
48
+
49
+ ## Class Imbalance
50
+
51
+ The HVUE v2 Host Tropism benchmark is strongly imbalanced. Accuracy should therefore be interpreted together with F1 and MCC. HViLM retains substantially stronger minority-class discrimination than vanilla DNABERT-2 trained on the same imbalanced setting and avoids majority-class collapse without explicit class balancing.
52
+
53
+ ## Training Details
54
+
55
+ - **Fine-tuning method:** LoRA
56
+ - **LoRA rank:** 8
57
+ - **LoRA alpha:** 16
58
+ - **Target modules:** query and value projections across all 12 transformer layers
59
+ - **Approximate trainable LoRA parameters:** ~0.3M
60
+ - **Learning rate:** 3e-5
61
+ - **Maximum input length:** 250 BPE tokens (approximately 1000 nt)
62
+ - **Early stopping:** patience 3, monitored using validation F1
63
+ - **Hardware:** NVIDIA A40 GPU
64
+
65
+ The released repository contains the full task-specific model weights rather than only the LoRA adapter.
66
+
67
+ ## Usage
68
+
69
+ ```python
70
+ import torch
71
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
72
+
73
+ model_id = "duttaprat/HViLM-Tropism"
74
+
75
+ tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
76
+ model = AutoModelForSequenceClassification.from_pretrained(
77
+ model_id,
78
+ trust_remote_code=True,
79
+ )
80
+
81
+ sequence = "ATGCGTACGTTAGCCGATCGATTACGCGTACGTAGCTAGC"
82
+ inputs = tokenizer(
83
+ sequence,
84
+ return_tensors="pt",
85
+ truncation=True,
86
+ max_length=250,
87
+ )
88
+
89
+ with torch.no_grad():
90
+ logits = model(**inputs).logits
91
+
92
+ prediction_id = logits.argmax(dim=-1).item()
93
+ print(model.config.id2label[prediction_id])
94
+ ```
95
+
96
+ Possible outputs are `NON_HUMAN_TROPIC` and `HUMAN_TROPIC`.
97
+
98
+ ## Intended Use
99
+
100
+ HViLM-Tropism is intended for research and benchmarking of virus sequence-based host association prediction. Host association is biologically context-dependent and may include multi-host, zoonotic, and reverse-zoonotic relationships; predictions should not be interpreted as definitive evidence of host range.
101
+
102
+ ## Related Resources
103
+
104
+ - [HViLM-base](https://huggingface.co/duttaprat/HViLM-base)
105
+ - [HViLM-Patho](https://huggingface.co/duttaprat/HViLM-Patho)
106
+ - [HViLM-R0](https://huggingface.co/duttaprat/HViLM-R0)
107
+ - [HVUE-v2](https://huggingface.co/datasets/duttaprat/HVUE-v2)
108
+ - [HViLM GitHub repository](https://github.com/duttaprat/HViLM)
109
+
110
+ ## Citation
111
+
112
+ ```bibtex
113
+ @article{dutta2026hvilm,
114
+ title={HViLM: A foundation model for viral genomics enables multi-task prediction of pathogenicity, transmissibility, and host tropism},
115
+ author={Dutta, Pratik and Vaska, Jack and Surana, Pallavi and Sathian, Rekha and Chao, Max and Zhou, Zhihan and Liu, Han and Davuluri, Ramana V},
116
+ journal={bioRxiv},
117
+ pages={2026--03},
118
+ year={2026},
119
+ publisher={Cold Spring Harbor Laboratory}
120
+ }
121
+ ```