Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,73 @@
|
|
1 |
-
---
|
2 |
-
license: mit
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
metrics:
|
4 |
+
- accuracy
|
5 |
+
tags:
|
6 |
+
- biology
|
7 |
+
pipeline_tag: text-classification
|
8 |
+
---
|
9 |
+
# Model descriptions
|
10 |
+
PPPSL-ESM2(PPPSL, Prediction of prokaryotic protein subcellular localization) is a protein language model fine-tuned from ESM2 pretrained model [facebook/esm2_t36_3B_UR50D](https://huggingface.co/facebook/esm2_t36_3B_UR50D) on a prokaryotic protein subcellular localization dataset. It achieves the following results on the evaluation set:
|
11 |
+
Train Loss: 0.0015
|
12 |
+
Train Accuracy: 0.9893
|
13 |
+
Validation Loss: 0.0155
|
14 |
+
Validation Accuracy: 0.9702
|
15 |
+
Epoch: 20
|
16 |
+
# The dataset for training PPPSL-ESM2
|
17 |
+
The full dataset contains 11,970 protein sequences, including Cellwall (87), Cytoplasmic (6,905), CYtoplasmic Membrane (2,567), Extracellular (1,085), Outer Membrane (758), and Periplasmic (568).
|
18 |
+
The highly imbalanced sample sizes across the six categories in this dataset pose a significant challenge for classification.
|
19 |
+
# How to use
|
20 |
+
|
21 |
+
### An example
|
22 |
+
Pytorch and transformers libraries should be installed in your system.
|
23 |
+
### Install pytorch
|
24 |
+
```
|
25 |
+
pip install torch torchvision torchaudio
|
26 |
+
|
27 |
+
```
|
28 |
+
### Install transformers
|
29 |
+
```
|
30 |
+
pip install transformers
|
31 |
+
|
32 |
+
```
|
33 |
+
### Run the following code
|
34 |
+
```
|
35 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
36 |
+
import torch
|
37 |
+
|
38 |
+
# Load the fine-tuned model and tokenizer
|
39 |
+
model_name = "sihuapeng/ESM2-finetuned-PPSL"
|
40 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
41 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
42 |
+
|
43 |
+
# Protein sequence for prediction the subcelluar localization
|
44 |
+
protein_sequence = "MSKKVLITGGAGYIGSVLTPILLEKGYEVCVIDNLMFDQISLLSCFHNKNFTFINGDAMDENLIRQEVAKADIIIPLAALVGAPLCKRNPKLAKMINYEAVKMISDFASPSQIFIYPNTNSGYGIGEKDAMCTEESPLRPISEYGIDKVHAEQYLLDKGNCVTFRLATVFGISPRMRLDLLVNDFTYRAYRDKFIVLFEEHFRRNYIHVRDVVKGFIHGIENYDKMKGQAYNMGLSSANLTKRQLAETIKKYIPDFYIHSANIGEDPDKRDYLVSNTKLEATGWKPDNTLEDGIKELLRAFKMMKVNRFANFN"
|
45 |
+
|
46 |
+
# Encode the sequence as model input
|
47 |
+
inputs = tokenizer(protein_sequence, return_tensors="pt")
|
48 |
+
|
49 |
+
# Perform inference using the model
|
50 |
+
with torch.no_grad():
|
51 |
+
outputs = model(**inputs)
|
52 |
+
|
53 |
+
# Get the prediction results
|
54 |
+
logits = outputs.logits
|
55 |
+
predicted_class_id = torch.argmax(logits, dim=-1).item()
|
56 |
+
|
57 |
+
# Output the predicted class
|
58 |
+
print ("===========================================================================================================================================")
|
59 |
+
print ("ID to Label mapping: {0: 'CYtoplasmicMembrane', 1: 'Cellwall', 2: 'Cytoplasmic', 3: 'Extracellular', 4: 'OuterMembrane', 5: 'Periplasmic'}")
|
60 |
+
print(f"Predicted class ID: {predicted_class_id}")
|
61 |
+
print ("===========================================================================================================================================")
|
62 |
+
```
|
63 |
+
|
64 |
+
## Funding
|
65 |
+
This project was funded by the CDC to Justin Bahl (BAA 75D301-21-R-71738).
|
66 |
+
### Model architecture and implementation
|
67 |
+
[Sihua Peng](https://publichealth.uga.edu/staff/sihua-peng/)
|
68 |
+
## Group, Department and Institution
|
69 |
+
### Lab: [Justin Bahl](https://vet.uga.edu/person/justin-bahl/)
|
70 |
+
### Department: [College of Veterinary Medicine Department of Infectious Diseases](https://vet.uga.edu/education/academic-departments/infectious-diseases/)
|
71 |
+
### Institution: [The University of Georgia](https://www.uga.edu/)
|
72 |
+
|
73 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/64c56e2d2d07296c7e35994f/2rlokZM1FBTxibqrM8ERs.png)
|