模型概述
模型特點
模型能力
使用案例
🚀 ProtT5-XL-BFD模型
ProtT5-XL-BFD是一個基於蛋白質序列預訓練的模型,採用掩碼語言模型(MLM)目標。它能夠從蛋白質序列中提取重要特徵,在蛋白質相關的下游任務中具有廣泛的應用前景。
🚀 快速開始
ProtT5-XL-BFD是基於t5 - 3b
模型,以自監督的方式在大量蛋白質序列語料庫上進行預訓練的模型。以下是在PyTorch中使用該模型提取給定蛋白質序列特徵的示例代碼:
from transformers import T5Tokenizer, T5Model
import re
import torch
tokenizer = T5Tokenizer.from_pretrained('Rostlab/prot_t5_xl_bfd', do_lower_case=False)
model = T5Model.from_pretrained("Rostlab/prot_t5_xl_bfd")
sequences_Example = ["A E T C Z A O","S K T Z P"]
sequences_Example = [re.sub(r"[UZOB]", "X", sequence) for sequence in sequences_Example]
ids = tokenizer.batch_encode_plus(sequences_Example, add_special_tokens=True, padding=True)
input_ids = torch.tensor(ids['input_ids'])
attention_mask = torch.tensor(ids['attention_mask'])
with torch.no_grad():
embedding = model(input_ids=input_ids,attention_mask=attention_mask,decoder_input_ids=None)
# For feature extraction we recommend to use the encoder embedding
encoder_embedding = embedding[2].cpu().numpy()
decoder_embedding = embedding[0].cpu().numpy()
✨ 主要特性
- 自監督預訓練:在大量蛋白質序列上進行自監督學習,無需人工標註數據,可利用大量公開數據。
- 特徵提取能力:從該自監督模型中提取的特徵(LM - 嵌入)能夠捕捉到決定蛋白質形狀的重要生物物理特性。
- 特定的訓練目標:與原始T5模型不同,採用類似Bart的MLM去噪目標進行預訓練。
📚 詳細文檔
模型描述
ProtT5-XL-BFD基於t5 - 3b
模型,以自監督的方式在大型蛋白質序列語料庫上進行預訓練。這意味著它僅在原始蛋白質序列上進行預訓練,沒有任何人工標註(因此可以使用大量公開數據),並通過自動過程從這些蛋白質序列中生成輸入和標籤。
該T5模型與原始T5版本的一個重要區別在於去噪目標。原始T5 - 3B模型使用跨度去噪目標進行預訓練,而該模型使用類似Bart的MLM去噪目標進行預訓練。掩碼概率與原始T5訓練一致,隨機掩碼輸入中15%的氨基酸。
預期用途與限制
該模型可用於蛋白質特徵提取或在下游任務中進行微調。在某些任務中,微調模型比將其用作特徵提取器可以獲得更高的準確性。此外,對於特徵提取,建議使用編碼器提取的特徵而非解碼器的特徵。
訓練數據
ProtT5-XL-BFD模型在BFD數據集上進行預訓練,該數據集包含21億個蛋白質序列。
訓練過程
預處理
蛋白質序列先轉換為大寫,使用單個空格進行分詞,詞彙表大小為21。將罕見氨基酸“U,Z,O,B”映射為“X”。模型的輸入形式為:
Protein Sequence [EOS]
預處理步驟是動態執行的,將蛋白質序列裁剪和填充至最多512個標記。
每個序列的掩碼過程細節如下:
- 15%的氨基酸被掩碼。
- 90%的情況下,被掩碼的氨基酸被
[MASK]
標記替換。 - 10%的情況下,被掩碼的氨基酸被一個與它們所替換的氨基酸不同的隨機氨基酸替換。
預訓練
模型在單個TPU Pod V3 - 1024上總共訓練120萬步,使用序列長度512(批量大小4k)。它總共有約30億個參數,採用編碼器 - 解碼器架構進行訓練。預訓練使用的優化器是AdaFactor,採用逆平方根學習率調度。
評估結果
當模型用於特徵提取時,取得了以下結果:
任務/數據集 | 二級結構(3狀態) | 二級結構(8狀態) | 定位 | 膜蛋白 |
---|---|---|---|---|
CASP12 | 77 | 66 | ||
TS115 | 85 | 74 | ||
CB513 | 84 | 71 | ||
DeepLoc | 77 | 91 |
BibTeX引用
@article {Elnaggar2020.07.12.199554,
author = {Elnaggar, Ahmed and Heinzinger, Michael and Dallago, Christian and Rehawi, Ghalia and Wang, Yu and Jones, Llion and Gibbs, Tom and Feher, Tamas and Angerer, Christoph and Steinegger, Martin and BHOWMIK, DEBSINDHU and Rost, Burkhard},
title = {ProtTrans: Towards Cracking the Language of Life{\textquoteright}s Code Through Self-Supervised Deep Learning and High Performance Computing},
elocation-id = {2020.07.12.199554},
year = {2020},
doi = {10.1101/2020.07.12.199554},
publisher = {Cold Spring Harbor Laboratory},
abstract = {Computational biology and bioinformatics provide vast data gold-mines from protein sequences, ideal for Language Models (LMs) taken from Natural Language Processing (NLP). These LMs reach for new prediction frontiers at low inference costs. Here, we trained two auto-regressive language models (Transformer-XL, XLNet) and two auto-encoder models (Bert, Albert) on data from UniRef and BFD containing up to 393 billion amino acids (words) from 2.1 billion protein sequences (22- and 112 times the entire English Wikipedia). The LMs were trained on the Summit supercomputer at Oak Ridge National Laboratory (ORNL), using 936 nodes (total 5616 GPUs) and one TPU Pod (V3-512 or V3-1024). We validated the advantage of up-scaling LMs to larger models supported by bigger data by predicting secondary structure (3-states: Q3=76-84, 8 states: Q8=65-73), sub-cellular localization for 10 cellular compartments (Q10=74) and whether a protein is membrane-bound or water-soluble (Q2=89). Dimensionality reduction revealed that the LM-embeddings from unlabeled data (only protein sequences) captured important biophysical properties governing protein shape. This implied learning some of the grammar of the language of life realized in protein sequences. The successful up-scaling of protein LMs through HPC to larger data sets slightly reduced the gap between models trained on evolutionary information and LMs. Availability ProtTrans: \<a href="https://github.com/agemagician/ProtTrans"\>https://github.com/agemagician/ProtTrans\</a\>Competing Interest StatementThe authors have declared no competing interest.},
URL = {https://www.biorxiv.org/content/early/2020/07/21/2020.07.12.199554},
eprint = {https://www.biorxiv.org/content/early/2020/07/21/2020.07.12.199554.full.pdf},
journal = {bioRxiv}
}
作者信息
Created by Ahmed Elnaggar/@Elnaggar_AI | LinkedIn











