SCARSE: Small-sample Cross-validation-Anchored Regression Solution for low resource peptide Engineering
Abstract
Reliable estimation of downstream performance in low-data peptide machine learning is critical for guiding early-stage AI-driven peptide engineering, yet it is often unclear how to assess whether a model will be effective in iterative discovery settings. Here we ask whether a cross-validation score computed on a handful of labelled peptides can serve as a simple and robust proxy for how well an active-learning workflow built on that model will eventually perform. To support this we introduce SCARSE, a machine learning framework combining ESM-2 protein language model embeddings with Gaussian process regression, designed for low-resource peptide property prediction (20–500 training samples). We benchmark SCARSE across 24 peptide and small-protein datasets covering substitution variants, indel variants, antimicrobial peptide potency and haemolytic activity, against three hand-engineered baselines — physicochemical descriptors, Morgan fingerprints and character n-grams — and across four ESM-2 checkpoints from 8M to 650M parameters. In simulated active learning workflows, SCARSE consistently outperforms the baseline and random sampling strategies. Notably, we demonstrate that CV R² computed from as few as 50 labeled peptides can be sufficient to estimate final active learning end-point performance, providing a practical, data-efficient criterion for deciding whether a given dataset combined with SCARSE is suitable for iterative peptide discovery. SCARSE is released as a pip package and is available via HuggingFace Spaces to facilitate integration into peptide engineering workflows.
Hugging Face Spaces
🚀 Live Demo
Try SCARSE directly in your browser (no installation required): https://huggingface.co/spaces/SCARSE/scarse
How SCARSE works
SCARSE is designed for peptide property prediction in low-data regimes by combining protein language model embeddings with classical machine learning methods.
The workflow consists of the following steps:
-
Input data
- A CSV file containing peptide sequences and one or more target variables.
- The sequence column (
seq_col) should contain amino acid sequences. - The target column(s) (
score_col) contain regression values.
-
Sequence embedding
- Sequences are converted into numerical representations using the ESM-2 protein language model.
-
Model
- Gaussian Process Regression is used as the downstream model, chosen for its robustness in small-sample settings.
-
Hyperparameter optimization
- Models are tuned using cross-validation and Optuna-based optimization.
- The number of folds and optimization trials can be controlled by the user.
- Optional wall-clock limits on the Optuna search are available
(
trial_timeoutfor a single trial,study_timeoutfor the whole search); both default to no limit.
-
Training output
- Cross-validation performance metrics are returned.
- A trained model environment is stored internally and reused for prediction.
-
Prediction
- New sequences are embedded using the same pipeline.
- The trained model generates predictions for each target variable.
Notes and best practices
-
Call order matters
You must runscarse.train()before callingscarse.pred(), as the trained model is stored internally. -
Data quality is important
- Ensure no missing or empty sequences
- Use consistent formatting (standard amino acid codes(ACDEFGHIKLMNPQRSTVWY))
-
Small datasets are supported
SCARSE have been evaluated for datasets as small as ~20 samples, but performance generally improves with more data.
Tested for Python version
- Python version == 3.12.10
Setup
pip install scarse
Usage
For training a regression model:
import scarse
scarse.train(data_path="../app/train.csv",
seq_col="sequence",
score_col=["score"])
Optional Optuna time limits:
import scarse
# Cap a single trial at 600 s and the whole search at 3600 s.
# Both default to None (no limit).
scarse.train(data_path="../app/train.csv",
seq_col="sequence",
score_col=["score"],
trial_timeout=600,
study_timeout=3600)
For predicting after model have been trained:
df_pred = scarse.pred(data_path="../app/test.csv", seq_col="sequence")
Tutorials
See the following tutorial, structured as a Python notebook:
Correlate to active learning end-point performance
Below we illustrate the relation between CV R² score and end-point active learning performance.
The y-axis display how many times better performance SCARSE guided active learning delivers compared to random sampling when looking at the accumulation of top 10% of peptides.
By comparing the CV R² score of your data to the corresponding figure below for your dataset size one can get and indication of how suitable your data is combined with SCARSE to perform active learning peptide engineering.
Citation
If using this work, please cite:
Andrekson L, Rydbergh R, Mercado R, Wenzel M. AI-guided discovery for low-resource peptide engineering using evolutionary scale modeling. bioRxiv. 2026. https://doi.org/10.64898/2026.06.25.734678.
Metadata
Release files for scarse 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| scarse-2.0.0.tar.gz | 18.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scarse-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.6 kB
Release files / scarse-2.0.0.tar.gz
| Download URL | scarse-2.0.0.tar.gz |
|---|---|
| Size | 18.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
33030815d951439fdf86914f3e2d722b90380c0d910764f9b6f75ba1c7ab2a91
|
|
BLAKE2b-256 checksum How to use checksums |
6b9bd934479240bc1410c6b553de117f9b3de355ee750f4ddb6b75c0889fec47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.13
|
Release files / scarse-2.0.0-py3-none-any.whl
| Download URL | scarse-2.0.0-py3-none-any.whl |
|---|---|
| Size | 15.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f2008ba5646f3fdc87e0c209ab3b531cb09977ba4f5d55d089c61c93896562d
|
|
BLAKE2b-256 checksum How to use checksums |
7b3ef7a3e2e1797a6f0d36dff8edad7ebf8d24f12c32dd06e3845be64e6f7018
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.13
|