Downloads · 30 days
19
100% of all-time downloads
OneScience-Group/NABP-LSTM-Att
NABP-LSTM-Att is a machine learning model from OneScience-Group. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
<p align="center" <strong <span style="font-size: 30px;"NABP-LSTM-Att</span </strong </p
Downloads · 30 days
19
100% of all-time downloads
All-time downloads
19
Public
Repo size
858 MB
Likes
0
Public
Click a slice to open those files.
.pickle1.1 GB · 69%
From the Hugging Face model README
NABP-LSTM-Att is a binary classification model that predicts whether a nanobody binds to an antigen using sequence information only.
The model separately encodes the nanobody CDR and antigen sequences, extracts interaction features through one-dimensional convolution, bidirectional LSTM, and a soft attention mechanism, and finally outputs a binding probability between 0 and 1.
The default model uses the following inputs and architecture:
| Use Case | Description |
|---|---|
| Nanobody–antigen binding prediction | Predict the probability of binding from CDR and antigen sequence features. |
| Official test-set evaluation | Evaluate the official pretrained model using AUROC and AUPR. |
| Model retraining | Train the model from randomly initialized weights using the precomputed training and validation datasets. |
| DCU compatibility validation | Validate inference, backward propagation, parameter updates, and device placement on DCU. |
You can use the OneCode online environment for an intelligent one-click AI4S programming experience:
Try OneCode for AI4S Programming
Hardware Requirements
Install the Hugging Face command-line tool and download the model repository:
python -m pip install -U huggingface_hub
hf download OneScience-Group/NABP-LSTM-Att --local-dir ./NABP-LSTM-Att
cd NABP-LSTM-Att
conda create -n onescience311 python=3.11 -y
conda activate onescience311
python -m pip install "onescience[bio-dcu]" \
-i http://mirrors.onescience.ai:3141/pypi/simple/ \
--trusted-host mirrors.onescience.ai
This project requires an upgraded DTK and TensorFlow environment.
Load DTK and install the additional dependencies:
module load compiler/dtk/26.04
python -m pip install --upgrade --no-deps -r requirements.txt
The Hugging Face model package already contains the precomputed features, k-mer vocabularies, and official pretrained weights required for inference and training.
No additional dataset download is required for the default workflow.
The default assets are:
conf/data/features/cdr_kmer3_ag_kmer1/
weight/cdr_kmer3_ag_kmer1/Model99.h5
Purpose: Evaluate the complete official test set using the pretrained weights. The script reports AUROC, AUPR, runtime, and throughput, and can optionally save the prediction results.
python scripts/evaluate_test_set.py \
--batch-size 64 \
--output output/test_predictions.npz
Purpose: Train the model from randomly initialized weights using the complete training dataset and evaluate it on the validation set.
By default, training runs for 100 epochs.
Checkpoints are written to:
output/checkpoints/
The official pretrained weights are not overwritten.
Run:
python scripts/train.py
To validate the complete training pipeline with only one epoch, run:
python scripts/train_one_epoch.py \
--batch-size 64 \
--output-dir output/one_epoch_run1
Use the following commands to perform lightweight inference and training validation:
python scripts/verify_minimal_inference.py --samples 8
python scripts/verify_minimal_training.py \
--batch-size 8 \
--steps 3
Custom sequences must first be converted into CDR and antigen feature objects that are compatible with the pickle format used by the official dataset.
Scripts for data acquisition, dataset splitting, k-mer TSV generation, and feature encoding are provided in:
scripts/
When rebuilding the dataset from the original SAbDab-nano data, additional external tools such as CD-HIT and Clustal Omega are also required.
| Platform | OneScience Main Repository | Skills Repository |
|---|---|---|
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |