Downloads · 30 days
0
huangruihua/EMFP
EMFP is a machine learning model from huangruihua. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as mit.
EMFP is designed to identify peptide sequences that may encode canonical functional proteins, as defined by molecular function annotations in the UniProt database. While many peptides can be bioactive, EMFP specifical…
Downloads · 30 days
0
Access
Public
Updated Jan 27, 2026
Repo size
7.8 GB
Likes
0
Public
Click a slice to open those files.
.pt7.8 GB · 100%
From the Hugging Face model README
EMFP is designed to identify peptide sequences that may encode canonical functional proteins, as defined by molecular function annotations in the UniProt database. While many peptides can be bioactive, EMFP specifically focuses on distinguishing peptides with protein-like molecular functions from those with other or unknown mechanisms of action.
Fine-tuned ESM-2 (650M) model for predicting peptides encoding canonical functional proteins.
| Task | EMFP | Random Forest | ESM+MLP | ProtBERT+MLP |
|---|---|---|---|---|
| Authenticity | 0.967 | 0.718 | 0.892 | 0.856 |
| Canonical Protein Function | 0.932 | 0.505 | 0.827 | 0.791 |
Note: "Canonical Protein Function" refers to peptides encoding proteins with molecular function annotations (enzyme activity, binding activity, etc.) as defined in UniProt.
import torch
import esm
model, alphabet = esm.pretrained.esm2_t33_650M_UR50D()
checkpoint = torch.load("best_model.pt")
class ESMClassifier(torch.nn.Module):
def __init__(self, esm_model, num_labels=2, hidden_dim=1280, dropout=0.1):
super().__init__()
self.esm = esm_model
self.classifier = torch.nn.Sequential(
torch.nn.Dropout(dropout),
torch.nn.Linear(hidden_dim, hidden_dim // 2),
torch.nn.ReLU(),
torch.nn.Dropout(dropout),
torch.nn.Linear(hidden_dim // 2, num_labels)
)
def forward(self, tokens):
results = self.esm(tokens, repr_layers=[33], return_contacts=False)
return self.classifier(results["representations"][33][:, 0, :])
classifier = ESMClassifier(model)
classifier.load_state_dict(checkpoint['model_state_dict'])
classifier.eval()
# Predict
batch_converter = alphabet.get_batch_converter()
data = [("protein1", "MKTAYIAKQRQISFVKSHFSRQLEERLG")]
labels, strs, tokens = batch_converter(data)
with torch.no_grad():
logits = classifier(tokens)
probs = torch.softmax(logits, dim=1)
print(f"Probability of encoding canonical functional protein: {probs[0, 1].item():.4f}")
esm2_t33_650M_UR50D)huggingface-cli download huangruihua/EMFP best_model.pt --local-dir ./
Full code: https://github.com/huangruihua/EMFP
@software{emfp_2026,
title={EMFP: ESM-2 Micropeptide Predictor for Canonical Functional Proteins},
author={Huang, Rui-Hua},
year={2026},
url={https://github.com/huangruihua/EMFP}
}
MIT - Rui-Hua Huang (@huangruihua)