Upload file
Browse files
README.md
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- dna
|
4 |
+
- human_genome
|
5 |
+
---
|
6 |
+
|
7 |
+
# WARNING
|
8 |
+
This readme should be changed according to current model. Num steps: 2200000
|
9 |
+
|
10 |
+
# GENA-LM
|
11 |
+
|
12 |
+
GENA-LM is a transformer masked language model trained on human DNA sequence.
|
13 |
+
|
14 |
+
Differences between GENA-LM and DNABERT:
|
15 |
+
- BPE tokenization instead of k-mers;
|
16 |
+
- input sequence size is about 3000 nucleotides (512 BPE tokens) compared to 510 nucleotides of DNABERT
|
17 |
+
- pre-training on T2T vs. GRCh38.p13 human genome assembly.
|
18 |
+
|
19 |
+
Source code and data: https://github.com/AIRI-Institute/GENA_LM
|
20 |
+
|
21 |
+
## Examples
|
22 |
+
### How to load the model to fine-tune it on classification task
|
23 |
+
```python
|
24 |
+
from src.gena_lm.modeling_bert import BertForSequenceClassification
|
25 |
+
from transformers import AutoTokenizer
|
26 |
+
|
27 |
+
tokenizer = AutoTokenizer.from_pretrained('AIRI-Institute/gena-lm-bert-base')
|
28 |
+
model = BertForSequenceClassification.from_pretrained('AIRI-Institute/gena-lm-bert-base')
|
29 |
+
```
|
30 |
+
|
31 |
+
## Model description
|
32 |
+
GENA-LM model is trained in a masked language model (MLM) fashion, following the methods proposed in the BigBird paper by masking 85% of tokens. Model config for `gena-lm-bert-base` is similar to the bert-base:
|
33 |
+
|
34 |
+
- 512 Maximum sequence length
|
35 |
+
- 12 Layers, 12 Attention heads
|
36 |
+
- 768 Hidden size
|
37 |
+
- 32k Vocabulary size
|
38 |
+
|
39 |
+
We pre-trained `gena-lm-bert-base` using the latest T2T human genome assembly (https://www.ncbi.nlm.nih.gov/assembly/GCA_009914755.3/). Pre-training was performed for 500,000 iterations with the same parameters as in BigBird, except sequence length was equal to 512 tokens and we used pre-layer normalization in Transformer.
|
40 |
+
|
41 |
+
## Downstream tasks
|
42 |
+
Currently, gena-lm-bert-base model has been finetuned and tested on promoter prediction task. Its' performance is comparable to previous SOTA results. We plan to fine-tune and make available models for other downstream tasks in the near future.
|
43 |
+
|
44 |
+
### Fine-tuning GENA-LM on our data and scoring
|
45 |
+
After fine-tuning gena-lm-bert-base on promoter prediction dataset, following results were achieved:
|
46 |
+
|
47 |
+
| model | seq_len (bp) | F1 |
|
48 |
+
|--------------------------|--------------|-------|
|
49 |
+
| DeePromoter | 300 | 95.60 |
|
50 |
+
| GENA-LM bert-base (ours) | 2000 | 95.72 |
|
51 |
+
| BigBird | 16000 | 99.90 |
|
52 |
+
|
53 |
+
We can conclude that our model achieves comparable performance to the previously published results for promoter prediction task.
|
54 |
+
|