🚀 ProtT5-XL-BFDモデル
タンパク質配列に対してマスク言語モデリング(MLM)の目的で事前学習されたモデルです。このモデルは、この論文で紹介され、このリポジトリで最初に公開されました。このモデルは大文字のアミノ酸で学習されており、大文字のアミノ酸のみで動作します。
✨ 主な機能
ProtT5-XL-BFDは、t5-3b
モデルをベースにしており、大量のタンパク質配列コーパスを自己教師付き学習で事前学習されています。これは、人間が何らかの形でラベル付けを行わず、生のタンパク質配列のみを使用して事前学習されたことを意味します(そのため、大量の公開データを利用できます)。そして、それらのタンパク質配列から自動的に入力とラベルを生成するプロセスがあります。
このT5モデルと元のT5バージョンの重要な違いの1つは、ノイズ除去の目的です。元のT5-3Bモデルはスパンノイズ除去目的で事前学習されていましたが、このモデルはBartのようなMLMノイズ除去目的で事前学習されています。マスキング確率は、入力のアミノ酸の15%をランダムにマスキングする点で元のT5学習と一致しています。
この自己教師付きモデルから抽出された特徴(LM埋め込み)は、タンパク質の形状を支配する重要な生体物理的特性を捉えていることが示されています。これは、タンパク質配列に実現された生命の言語の文法の一部を学習したことを意味します。
📦 インストール
このモデルを使用するには、必要なライブラリをインストールする必要があります。以下のコマンドを使用して、transformers
ライブラリをインストールできます。
pip install transformers
💻 使用例
基本的な使用法
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)
encoder_embedding = embedding[2].cpu().numpy()
decoder_embedding = embedding[0].cpu().numpy()
📚 ドキュメント
意図された用途と制限
このモデルは、タンパク質の特徴抽出や下流タスクでの微調整に使用できます。いくつかのタスクでは、モデルを微調整することで、特徴抽出器として使用するよりも高い精度を得ることができることがわかっています。また、特徴抽出には、デコーダーではなくエンコーダーから抽出された特徴を使用する方が良いこともわかっています。
訓練データ
ProtT5-XL-BFDモデルは、BFDという21億のタンパク質配列からなるデータセットで事前学習されています。
訓練手順
前処理
タンパク質配列は大文字に変換され、単一の空白を使用してトークン化されます。語彙サイズは21で、まれなアミノ酸 "U,Z,O,B" は "X" にマッピングされます。モデルの入力は次の形式になります。
Protein Sequence [EOS]
前処理ステップは、タンパク質配列を最大512トークンに切断し、パディングすることでオンザフライで実行されます。
各配列のマスキング手順の詳細は以下の通りです。
- アミノ酸の15%がマスクされます。
- 90%の場合、マスクされたアミノ酸は
[MASK]
トークンに置き換えられます。
- 10%の場合、マスクされたアミノ酸は、置き換えるアミノ酸とは異なるランダムなアミノ酸に置き換えられます。
事前学習
このモデルは、シーケンス長512(バッチサイズ4k)を使用して、合計120万ステップ、単一のTPU Pod V3-1024で学習されました。総計約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