Next Article in Journal
Optimizing Laboratory Workflow Through Prediction of Test Demand and Quality Control
Previous Article in Journal
Quantum Computing as a Disruptive Technology: Implications for Advanced Manufacturing and Industry 5.0
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Structure-Aware Protein Language Model with Multi-Branch Ensemble for Nanobody–Antigen Interaction Prediction

1
Department of Computer Science and Engineering, State Key Laboratory of Bioreactor Engineering, East China University of Science and Technology, Shanghai 200237, China
2
International College of Digital Innovation, Chiang Mai University, Chiang Mai 50200, Thailand
3
Department of Creative Arts, Film and Media Technologies, University of Technology, Mauritius, La Tour Koenig, Port Louis 11134, Mauritius
*
Author to whom correspondence should be addressed.
Appl. Sci. 2026, 16(10), 4864; https://doi.org/10.3390/app16104864
Submission received: 19 April 2026 / Revised: 8 May 2026 / Accepted: 11 May 2026 / Published: 13 May 2026
(This article belongs to the Section Computing and Artificial Intelligence)

Abstract

Nanobodies have emerged as highly valuable biotherapeutic and diagnostic reagents due to their high specificity, low immunogenicity, and superior tissue penetration. However, traditional nanobody discovery methods rely on camelid immunization and phage display techniques, which are time-consuming and labor-intensive. Meanwhile, existing computational prediction methods for Nanobody–Antigen Interaction (NAI) suffer from several limitations: first, general Protein–Protein Interaction (PPI) models cannot adapt to the specific binding patterns of NAI; second, sequence-based models struggle to capture critical binding features, resulting in unsatisfactory prediction accuracy. To address these challenges, we propose an NAI prediction method based on Protein Language Models (PLMs). Specifically, a structure-aware PLM is first fine-tuned on PPI datasets to learn universal protein binding patterns. This model performs joint encoding of amino acid sequences and protein local structure-related sequences. It can implicitly learn spatial structural priors solely from sequence inputs, which alleviates the limitation of conventional sequence-based models in capturing structural binding characteristics. Subsequently, we use mean, max and min pooling to extract complementary global sequence features that a single pooling method cannot fully capture. We then apply voting fusion to reduce prediction bias and improve model robustness under class imbalance and small-sample scenarios. Evaluated on the NAI benchmark dataset constructed from SAbDab-nano, the proposed model outperforms the best baseline methods in key metrics including Accuracy, Recall, F1-score, AUC-ROC, and AUPR. It exhibits robust performance under class imbalance and small-sample scenarios, validating the effectiveness of the framework.

1. Introduction

Nanobodies are the variable domains derived from camelid heavy-chain antibodies. Their compact size, exceptional specificity, low immunogenicity, and superior tissue penetration have made them transformative reagents for both biotherapeutic and diagnostic applications [1,2]. Their unique structural and physicochemical advantages have driven applications in diverse fields including infectious disease detection, anti-tumor therapy, and autoimmune disease treatment [3], making nanobody discovery a central focus in biomedical research. However, conventional nanobody development relies heavily on camelid immunization. This process is followed by phage display screening, which is laborious, time-consuming, and costly [4]. Therefore, there is an urgent demand to develop rapid and accurate computational methods for predicting NAI, which can reduce reliance on wet experiments and accelerate translational research [4]. PPI prediction has laid a critical foundation for understanding biomolecular recognition. Significant progress has been achieved by both sequence-based methods (e.g., D-SCRIPT [5], Topsy-Turvy [6]) and structure-based methods (e.g., MaSIF [7], Parasurf [8]). Nevertheless, NAI prediction poses unique challenges distinct from general PPI prediction. First, NAI depends on specialized structural complementarity and non-covalent forces that differ from non-immune PPIs and are not fully captured by existing PPI-trained models [9]. Second, nanobodies achieve high binding specificity through the structural diversity of their Complementarity-Determining Regions (CDRs). The hypervariable CDR3 loop is particularly important. Its conformational flexibility and sequence variability make it difficult to model using sequence-only approaches. Accordingly, researchers have developed methods for NAI prediction (e.g., NABP-BERT [10]), yet existing computational approaches rely solely on sequence information and fail to effectively capture structure-related features affecting nanobody–antigen binding. Recent advances in Transformer-based PLMs help address some of these challenges. These models can learn contextual semantics and evolutionary information directly from large-scale protein sequence data without manual feature engineering [11]. This makes it easier to model the sequence variability found in CDRs. However, vanilla PLMs cannot satisfy the requirement for structural information. Although structure-aware PLMs (e.g., SaProt [12], ProstT5 [13]) have been developed to incorporate protein structural features, they still have several limitations. They cannot effectively transfer general PPI knowledge to the specialized context of NAI. As a result, they are unable to fully resolve the core challenges of NAI prediction.
To address these challenges, we propose an NAI prediction method based solely on protein sequences, integrating transfer learning and ensemble voting mechanisms. The method takes the structure-aware PLM SaProt as its core, which jointly represents amino acid sequences and protein local structure encoding sequences. By doing so, it implicitly learns spatial structural priors from sequence-only inputs. This mitigates a key limitation of traditional sequence models, which cannot capture structure-dependent binding features. First, the model is fine-tuned on a large-scale general PPI dataset to learn universal protein binding patterns, alleviating poor generalization caused by the scarcity of NAI data. Then a multi-branch parallel encoding framework is constructed. It uses mean, max, and min pooling strategies. These strategies generate complementary sequence representations and each representation performs an independent prediction. Finally, stable and robust interaction predictions are output via voting fusion, which further enhance performance under class-imbalanced and small-sample conditions. On the standard dataset constructed from SAbDab-nano, the proposed method outperforms existing sequence models and traditional machine learning approaches across key metrics including Accuracy, Recall, F1-score, AUC-ROC, and AUPR. Experimental results show that high-precision NAI prediction can be achieved using only sequence information and reasonable transfer fine-tuning strategies. This provides a lightweight and efficient computational solution for low-cost, high-throughput nanobody virtual screening.

2. Related Works

PPI prediction serves as a foundational framework for understanding biomolecular recognition, while NAI prediction has emerged as a specialized focus to address the unique challenges of nanobody-based biotherapeutics. In this section, we review existing research across several domains and summarize key advances as well as current limitations.

2.1. Protein–Protein Interaction Prediction

PPI prediction methods can be broadly categorized into two mainstream paradigms [14]: sequence-based and structure-based approaches, both of which have advanced general interaction modeling but face constraints when extended to NAI tasks. Sequence-based methods leverage amino acid sequences and evolutionary information to avoid reliance on structures. Representative works include D-SCRIPT [5], which integrates PLMs with an interpretable neural network to achieve genome-scale PPI prediction and cross-species generalization, and Topsy-Turvy [6], which employs transfer learning to enhance sequence-driven interaction inference. Structure-based approaches, by contrast, capitalize on the spatial arrangements of proteins and residues, which are critical for capturing interface complementarity. Examples include Struct2Graph [15], a graph attention network that converts 3D protein structures into graph representations, and HIGH-PPI [16], a hierarchical graph neural network with an interpreter module to identify key interacting residues. Notably, a critical limitation of these PPI-focused methods lies in the pattern divergence between immune and non-immune interactions [9]. Therefore, models trained on general PPI datasets fail to adapt to the specialized binding mechanisms of NAIs.

2.2. Nanobody–Antigen Interaction Prediction

To address the specificity of NAIs, researchers have developed dedicated methods, including traditional machine learning and PLM-driven models. Traditional machine learning methods include Feng’s [17] work, which explored 12 algorithms to model correlations between nanobody–ligand affinity and non-covalent interactions, achieving moderate accuracy. Sardar U’s [18] approach uses gapped k-mers and Random Forests (RFs) for sequence-based NAI prediction. PLM-driven models have advanced NAI prediction by capturing contextual sequence semantics: NABP-BERT [10] adopts a BERT-based architecture with gapped 3-mers, including self-supervised PROT-BERT and PPI-fine-tuned PPI-PROT-BERT, outperforming traditional machine learning methods. However, existing NAI prediction methods do not incorporate 3D structural information of proteins, leading to insufficient representation of potential binding capabilities.

2.3. Structure-Based Pre-Training

The initial goal of Foldseek [19] is to facilitate fast and accurate protein structure searches. It employs a Vector Quantized–Variational AutoEncoder (VQ-VAE) model [20] for encoding protein structures into informative tokens. These tokens, derived from 20 distinct 3Di states, are represented as P = ( f 1 , f 2 , , f n ) , where f i represents the structure token at the ith position and n is the sequence length. Such 3Di tokens discretize local protein structures into one-dimensional sequences, making structural information compatible with standard PLMs. Based on this foundation, SaProt [12] proposes a joint vocabulary by concatenating amino acid residues and 3Di structure tokens, and pre-trains a BERT [21,22]-style model to capture both sequence and structural information simultaneously. Similarly, ProstT5 [13] constructs a unified sequence–structure language model by learning the translation between protein sequences and 3Di tokens. Both models effectively inject structural priors into PLMs while maintaining sequence-only input. These structure-aware pre-training strategies provide a feasible way to introduce protein structural information into sequence-only models, which helps alleviate the issue of insufficient structural representation in existing NAI prediction methods.

3. Materials and Methods

3.1. Network

The model architecture is shown in Figure 1 which consists of two main components: (a) fine-tuning stage and (b) end-to-end prediction stage. During the fine-tuning phase, the structure-aware PLM is fine-tuned on general PPI data to create a specialized Nano-Encoder, which provides high-quality joint sequence–structure features for the prediction stage.
Figure 1a shows the fine-tuning process of our approach. First, Foldseek processes each input protein sequence to generate structural representations. It uses VQ-VAE to discretize the local 3D conformation of every amino acid residue into fixed-length structural symbols called 3Di tokens. This produces a 1D token sequence that is strictly length-matched to the original amino acid sequence. As a result, structural information is represented in a sequence-compatible form. Second, each amino acid residue is concatenated with its corresponding 3Di token. This constructs a unified Residue–3Di paired sequence. The paired sequence simultaneously encodes both the primary amino acid sequence and the local tertiary structural context. Third, the paired sequences of the proteins are separately fed into SaProt. To reduce computational cost while preserving modeling capacity, SaProt is fine-tuned efficiently using LoRA, thereby obtaining independent high-dimensional feature representations. Fourth, the two feature vectors are concatenated and passed to a downstream prediction network for binding interaction prediction. Specifically, the downstream network consists of a two-layer fully connected classifier with a ReLU activation function, which maps the concatenated joint features to a two-dimensional output for binary PPI prediction. Finally, we obtained the fine-tuned model Nano-Encoder.
In the end-to-end prediction stage, we use the Nano-Encoder as a sequence encoder, where only its last hidden layer is fine-tuned and all other parameters are frozen to save GPU memory. The nanobody sequence S N and antigen sequence S A are first processed by Foldseek to obtain structural tokens. Each amino acid residue is first encoded into a corresponding 3Di structural token using vector-quantized structure encoding. This structural token is then concatenated with the original residue to form a unified residue-structure paired sequence. In this way, the paired sequence integrates both sequence information and local structural information. Then they are fed into the Nano-Encoder to obtain the residue-level hidden feature matrices H N R L N × d and H A R L A × d , where L N is the length of the nanobody sequence, L A is the length of the antigen sequence, and d denotes the hidden dimension of the Nano-Encoder, representing the length of the high-dimensional feature vector for each amino acid residue encoded by the model. Three parallel branches are constructed using mean, max, and min pooling to extract complementary global representations:
f N avg = 1 L N i = 1 L N H N , i f N max = max 1 i L N H N , i f N min = min 1 i L N H N , i
f A avg = 1 L A i = 1 L A H A , i f A max = max 1 i L A H A , i f A min = min 1 i L A H A , i
where f N avg , f N max , and f N min denote the global features of the nanobody obtained by mean, max, and min pooling, respectively; f A avg , f A max , and f A min denote the global features of the antigen obtained by mean, max, and min pooling, respectively; and H N , i and H A , i represent the i-th residue-level hidden feature vector of the nanobody and antigen, respectively.
For each branch, the nanobody feature and antigen feature are directly concatenated to form the joint representation:
f avg = f N avg ; f A avg f max = f N max ; f A max f min = f N min ; f A min
where f avg , f max , and f min are the joint feature vectors of the three branches, and [ · ; · ] denotes vector concatenation along the feature dimension.
Each joint representation is fed into an independent MLP predictor to obtain a preliminary prediction score:
y ^ avg = σ MLP avg ( f avg ) y ^ max = σ MLP max ( f max ) y ^ min = σ MLP min ( f min )
where y ^ avg , y ^ max , and y ^ min are the predicted scores of the three branches; MLP avg , MLP max , and MLP min denote three independent multi-layer perceptron networks; and σ ( · ) is the sigmoid activation function.
Finally, hard voting fusion is adopted to generate the stable final interaction prediction:
y ^ = Vote y ^ avg , y ^ max , y ^ min
where y ^ is the final predicted label of NAI, and Vote ( · ) denotes the hard voting fusion mechanism that outputs the final prediction result.

3.2. Datasets

In this work we employed the NAI dataset collected from the SAbDab-nano database [23]. SAbDab-nano contains all available nanobody–antigen complex structures in the Protein Data Bank (PDB) [24]. This curated dataset excludes nanobodies with lengths exceeding 150 residues and multi-chain antigen binding cases, with negative samples generated by limiting the antigen homology when exchanging nanobodies and antigen, following a recent NAI study [18]. To reflect the intuition that true positive NAIs are likely rare, the negative-to-positive ratio in the training and test sets was 10:1. Finally, samples that failed to be predicted by Foldseek were removed. A training dataset consisting of 9944 NAI pairs was then created. From this dataset, 5% of the training data was reserved for validation. We constructed a test set comprising 501 samples, which was also derived from the SAbDab-nano database. To rigorously evaluate potential data leakage, we performed a cross-homology assessment between the training and test sets at the sequence level using the CD-Hit tool [25]. The results showed that across all pairing combinations, only 0.8% of the antigen–nanobody pairs in the test set exhibited 90% sequence homology with those in the training set. This low level of redundancy indicates that the current split between the NAI training and test data effectively minimizes data leakage, thereby ensuring a high degree of independence between the two datasets at the sequence level. Table 1 shows the number of samples in the training and test datasets.
The binary PPI dataset was sourced from the Gold Standard Dataset [26], which contains positive protein pairs from HIPPIEv2.3 [27] and negative pairs that were generated by randomly sampling. The dataset was partitioned using the KaHIP [28] partitioning strategy, resulting in three distinct sets (training, validation, and test) with no overlap between them and extremely low sequence similarity. To further reduce sequence redundancy, these sets were processed with CD-HIT [25] using a 40% threshold. Additionally, sequences with a length exceeding 800 were removed. We further conducted a homology analysis between all protein pairs in this dataset and those in the nanobody dataset. The results demonstrated that the sequence similarity of all paired combinations was below 40% across the two datasets. Generally, we obtain 68,805 sequences for the training set, 19,857 sequences for the test set, and 13,727 sequences for the validation set. Table 2 shows the number of samples for PPI datasets.

3.3. Implementation Details

In this work, we use LoRA [29] to fine-tune SaProt. The core idea of LoRA is to freeze the weights of the pre-trained model and insert trainable low-rank decomposition matrices into the model for fine-tuning. This approach avoids the high computational costs associated with directly fine-tuning the entire large model. We integrate LoRA with parameters set to α = 16 and dropout = 0.1, and this integration is applied to the modules of [query, key, value, intermediate.dense, output.dense]. The entire training process spanned 20 epochs, utilizing an NVIDIA A100 GPU with BFloat16 mixed-precision. A batch size of four was employed, with gradient accumulation over two batches. In the second stage, we froze the parameters of the Nano-Encoder to use it as a sequence encoder, and only fine-tuned its last hidden layer while freezing the other layers to save GPU memory. The network was trained using mini-batch gradient descent. During training, the batch size was set to 32 samples, and the model parameters were optimized via the backpropagation algorithm with a binary cross-entropy loss function. The Adam [30] optimizer was employed to minimize the loss function, with the learning rate set to 5 × 10 5 . The entire training procedure was conducted for 100 epochs.

4. Results

4.1. Comparative Experiments

In the comparative experiment, we compared our model against several categories of baseline methods: traditional machine learning methods (SVM, NB, MLP, KNN, RF, LR, DT), general PPI prediction models (Topsy-Turvy, D-SCRIPT), structure-based PPI models (Struct2Graph), and PLM-based NAI-specific approaches (NABP-PPI-PROT-BERT, NABP-PROT-BERT). All models were trained on the same dataset with default parameters. For all baseline models, we adopted their optimally reported hyperparameters from the original publications, which are the best-performing parameters officially recommended by their authors. These parameters have been validated to achieve stable and competitive performance on similar interaction prediction tasks. We did not perform additional arbitrary tuning to avoid potential bias, and this setup ensures a rigorous, objective, and reproducible comparison between our method and existing approaches.
In Figure 2, we present the ROC curves of several deep learning models. Meanwhile, we compared the performance of the model trained on the NAI dataset with its counterpart trained on the human PPI dataset when evaluated on an independent NAI test set. The results show improvement in prediction metrics for the model trained on NAI data: the AUC-ROC increased from 0.764 to 0.9004, and the AUPR rose substantially from 0.293 to 0.723. It can also be observed that the model trained on NAI data demonstrates a stronger ability to distinguish both positive and negative samples. These results underscore the importance of domain-specific training data for accurate NAI prediction, as models trained on general PPI data exhibit limited generalization to immune-specific interactions due to inherent pattern and data-level distinctions. Retraining on the NAI dataset has yielded performance improvements, which validates the necessity of customizing dedicated computational frameworks for specific biological interaction tasks. Table 3 shows the quantitative results of comparison experiments. The experimental results show that our model achieves superior performance across all evaluation metrics, attaining an Accuracy of 0.9501, Recall of 0.5625, F1-score of 0.6835, AUC-ROC of 0.9004, AUPR of 0.7233, MCC of 0.6764, and BA of 0.7768. Specifically, among traditional machine learning methods, RF achieves the highest Accuracy of 0.9202, but its Recall is only 0.121, with an F1-score of 0.2157 and an AUC-ROC of 0.7998. This indicates that traditional methods, when faced with the highly imbalanced NAI dataset, tend to predict most samples as the majority negative class, making it difficult to effectively identify positive interaction pairs.
Struct2Graph, a representative structure-aware graph neural network designed for general PPI prediction, yields an Accuracy of 0.8942 but completely fails to detect positive samples (Recall = 0), leading to zero F1-score and very low AUPR (0.0958). This result reveals that structure-based models developed for generic protein interactions lack sensitivity to the unique binding characteristics of nanobody–antigen pairs and perform poorly on imbalanced NAI data. The general PPI prediction models, Topsy-Turvy and D-SCRIPT, outperform most traditional machine learning approaches but are still constrained by the domain gap. Topsy-Turvy achieves 0.8932 Accuracy, 0.2667 Recall, and 0.6669 AUC-ROC, while D-SCRIPT achieves 0.8723 Accuracy, 0.2444 Recall, and 0.6337 AUC-ROC. This suggests that general PPI models cannot be directly transferred to the NAI task without specialized adaptation.
The existing NAI-specific models, NABP-PPI-PROT-BERT and NABP-PROT-BERT, achieve better performance than the above categories. Among them, NABP-PPI-PROT-BERT serves as the strongest baseline, achieving 0.9115 Accuracy, 0.5 Recall, 0.5641 F1-score, 0.7994 AUC-ROC, and 0.5763 AUPR. In comparison, our model shows consistent and substantial improvements across all metrics. The relatively more pronounced improvement in AUPR reflects the distinct advantages of our model in positive sample identification and ranking under class imbalance. Overall, these results provide solid evidence supporting the effectiveness of our approach for improving NAI prediction performance.

4.2. Ablation Experiments

Table 4 shows the results of ablation studies. In the ablation experiment, we first validated the effectiveness of PPI fine-tuning. The baseline model without PPI fine-tuning but with triple-pooling ensemble (Baseline (no fine-tune)) achieved 0.9361 Accuracy and 0.5294 F1-score. After introducing PPI fine-tuning, even the models using a single pooling strategy generally outperformed this baseline. For instance, the model with mean pooling achieved an AUC-ROC of 0.9126, the model with max pooling attained 0.9501 Accuracy, and the model with min pooling achieved 0.5417 Recall.
Furthermore, by combining PPI fine-tuning with the triple-pooling voting ensemble, our complete model achieved optimal performance across all metrics: Accuracy improved to 0.9501, Recall increased to 0.5625, F1-score rose to 0.6835, and AUPR reached 0.7233. These results demonstrate that PPI fine-tuning effectively transfers knowledge from general PPIs, enhancing the model’s ability to represent nanobody–antigen binding patterns. Under the condition that all models underwent PPI fine-tuning, we systematically evaluated the impact of different pooling strategies on model performance. Among these, mean pooling achieved the best AUC-ROC (0.9126), max pooling matched the full model’s Accuracy (0.9501), and min pooling attained a Recall of 0.5417. Remarkably, after integrating the three pooling strategies through a voting mechanism, the model achieved optimal or near-optimal performance across all key metrics: Accuracy tied with max pooling at 0.9501, Recall reached the highest value of 0.5625, F1-score improved to 0.6835, and AUPR reached the highest value of 0.7233. These results indicate that different pooling strategies capture complementary global features from sequence representations: mean pooling excels at representing overall semantics, max pooling highlights critical signals, and min pooling captures conservative features. The fusion of these three strategies through voting effectively reduces the bias of any single pooling approach, thereby enhancing the model’s comprehensive prediction capability under class-imbalanced conditions.

4.3. Docking Performance on the Test Dataset

For further evaluation, we performed global docking predictions on the positive samples in the test set using ClusPro2.0 [31]. ClusPro2.0 is a widely used automated protein–protein docking server that employs a Fast Fourier Transform (FFT)-based rigid body docking algorithm to perform exhaustive global conformational sampling, generating billions of potential binding poses. It retains low-energy conformations favored by favorable van der Waals forces, electrostatic interactions, and desolvation energies. The ClusPro server returned between 20 and 30 models for each case, and we selected the top 10 models for further analysis. The specific results are shown in Figure 3. The top 10 ranked models from global docking methods were assessed for near-native predictions using Critical Assessment of Predicted Interactions (CAPRI) criteria of High, Medium, Acceptable or Incorrect accuracy [32]. The amino acids on two interacting monomers (i.e., the antigen and nanobody) that are within 4.5 Å of the other monomer are defined as interface amino acids. After superimposing the same root-mean-square deviation (RMSD) interface amino acids between two complex structures, the RMSD of the heavy atoms (non-hydrogen atoms) on the interface amino acids is calculated, which is referred to as I-RMSD. I-RMSD describes the prediction accuracy of the antigen–nanobody interface at the atomic level. If the I-RMSD of a simulated docking structure compared to the corresponding experimentally determined crystal structure is less than 2.0 Å, the simulated docking structure is considered a near-native structure [33]. Here cases are sorted by binding I-RMSD. As noted in prior work [33], the success or failure of a prediction clearly depends more on the characteristics of the target than on the methodology itself. These characteristics include the magnitude of conformational rearrangements upon binding, the uniqueness of paratope–epitope recognition modes, interface area and shape complementarity, as well as the presence of flexible loops such as CDR3 in nanobodies. Targets with large conformational changes, non-canonical binding modes, or small, shallow interfaces typically lead to poor docking performance regardless of the algorithm used. In contrast, stable complexes with well-defined, rigid interfaces and conventional binding patterns are more likely to yield accurate predictions even with standard docking strategies. This indicates that the docking results can reflect the inherent prediction difficulty of a sample. This also explains the consistency between docking results and model classification performance. Targets that are inherently difficult to dock, such as those with significant conformational changes, non-canonical epitope patterns, or small featureless interfaces, are also the most challenging samples for sequence-based prediction models. In contrast, complexes with well-defined, rigid, and canonical interaction interfaces can not only yield high-quality docking models but also be classified accurately with high confidence by classification models. We can observe several challenging samples, such as 6tyl and 4lgs, for which our model yielded correct predictions. Meanwhile, it also accurately predicted cases that were missed by NABP, including 7a0v and 6oyz.

4.4. Binding Site Selection and Residue Importance Analysis Strategy

To verify the biological interpretability of the features learned by the model, residue-level importance analysis was performed on the independent test set for the NAI prediction process. First, based on the nanobody–antigen complex structure information provided by the SAbDab-nano database, amino acid residues with a distance less than 5 Å between the antigen and nanobody were defined as binding sites, and their position indices were used as standard labels for subsequent validation. During model inference, the Nano-Encoder was employed to encode nanobody and antigen sequences, and high-dimensional representation vectors of each residue were obtained by freezing the backbone parameters and extracting the hidden features of the last layer. To quantify the contribution of each residue to the final interaction prediction, the L2 norm of the hidden feature vector of each residue was calculated as the raw residue importance score. Special tokens including CLS and EOS, as well as padding positions, were strictly removed, and only valid residue scores corresponding to the original amino acid sequences were retained to ensure alignment between scores and true residue positions. Subsequently, min–max normalization was applied to the residue importance scores of all samples to map the scores into the range of 0–1 for comparable analysis across samples and sequences. According to the annotations of true binding sites, all residues were divided into two groups: binding sites and non-binding sites. The distribution characteristics of importance scores for the two groups were statistically analyzed, and violin plots combined with box plots were presented in Figure 4b. Meanwhile, the global positional distribution of binding sites across the nanobody sequence was exhibited in Figure 4a, from which three enriched regions can be clearly observed.
A total of 9566 binding site samples and 48,793 non-binding site samples were statistically analyzed. The numerical distribution results show that the mean value of binding sites is 0.6231, while that of non-binding sites is 0.5384, with a mean difference of 0.0847. In terms of the median, the value is 0.6402 for binding sites and 0.5452 for non-binding sites. Both the mean and median values of binding sites are higher than those of non-binding sites, indicating that the residue importance score possesses discriminative capacity for binding interfaces and can reliably characterize the functional properties of nanobody binding regions. Notably, the positional distribution analysis reveals that predicted binding sites are clearly concentrated in three distinct regions along the nanobody sequence, which is highly consistent with the locations of the three CDRs CDR1, CDR2, and CDR3. These results demonstrate that the model can identify key residues on nanobodies that determine antigen binding through the proposed binding site selection strategy, and the learned features possess clear biological significance rather than simple memorization of training data.
To further demonstrate the advantages of our model over other deep learning methods, we selected a representative difficult nanobody–antigen pair (PDB: 4lgs) for analysis. This pair was classified as “Incorrect” in docking tests, and only our model made the correct prediction. The specific results are shown in the Figure 5. For this case, the average importance score of binding sites was 0.67, compared to 0.54 for non-binding sites, highlighting that our model effectively captures biologically meaningful binding characteristics even for challenging targets. From the overall residue level importance analysis, although our model was not explicitly supervised with labeled binding sites during training, it still implicitly learned biologically critical information related to authentic binding interfaces. This indicates that the model captures genuine biological patterns rather than performing trivial memorization.

5. Conclusions

In this work, we propose an NAI prediction method based solely on protein sequences, integrating transfer learning and ensemble voting mechanisms. The method takes the structure-aware PLM SaProt as its core, which jointly represents amino acid sequences and protein local structure encoding sequences, thereby implicitly learning spatial structural priors from sequence-only inputs and mitigating the limitation that traditional sequence models cannot capture structure-dependent binding features. The model is fine-tuned on a large-scale general PPI dataset to learn universal protein binding patterns, alleviating poor generalization caused by the scarcity of NAI data. A multi-branch parallel encoding framework is constructed using mean, max, and min pooling strategies to generate complementary sequence representations and perform independent predictions, and stable interaction predictions are output via voting fusion.
Evaluated on the NAI benchmark dataset constructed from SAbDab-nano, the proposed model outperforms existing baseline methods across key metrics including Accuracy, Recall, F1-score, AUC-ROC, and AUPR. Ablation experiments demonstrate that PPI fine-tuning effectively transfers knowledge from general PPIs, enhancing the model’s ability to represent nanobody–antigen binding patterns, and that different pooling strategies capture complementary global features, with their fusion through voting reducing the bias of any single pooling approach. Experimental results validate that high-precision nanobody–antigen binding prediction can be achieved using only sequence information and reasonable transfer fine-tuning strategies, providing a lightweight and efficient computational solution for low-cost, high-throughput nanobody virtual screening. Future work may explore the integration of more flexible structure learning mechanisms and the extension of this framework to predict binding affinities or hot-spot residues.

Author Contributions

Conceptualization, R.D. and F.Y.; methodology, Z.L. and J.M.; software, Z.L. and Z.L.; validation, F.Y., J.M. and L.S.; formal analysis, F.Y.; investigation, Z.L. and J.M.; resources, F.Y.; data curation, Z.L. and F.Y.; writing—original draft preparation, F.Y. and Z.L.; writing—review and editing, F.Y., Z.L. and R.D.; visualization, Z.L.; supervision, F.Y.; funding acquisition, F.Y.; project administration, F.Y., A.P. and R.D. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by National Major Scientific Instruments and Equipments Development Project of National Natural Science Foundation of China, No. 32327801. This research was partially funded by National Key Research and Development Program of China, No. 2020YFA0907800. This research was partially funded by Research and Development Plan in Shandong Province No. 2022CXGC020206. This research was partially funded by the Key R & D Program of Shandong Province, China, grant number 2022SFGC0104.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data and source code presented in this study are available on request from the corresponding author. The data are not publicly available due to privacy.

Acknowledgments

The authors gratefully acknowledge the contributions of all co-authors in this work, including conceptualization, methodology, software implementation, data analysis, and manuscript preparation.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
NAINanobody–Antigen Interaction
PPIProtein–Protein Interaction
PLMProtein Language Model
CDRComplementarity-Determining Region
VQ-VAEVector Quantized–Variational Autoencoder
3Di3D interaction (structure token)
BERTBidirectional Encoder Representations from Transformers
MLPMultilayer Perceptron
LoRALow-Rank Adaptation
SVMSupport Vector Machine
NBNaive Bayes
KNNK-Nearest Neighbors
RFRandom Forest
LRLogistic Regression
DTDecision Tree
AUC-ROCArea Under the Receiver Operating Characteristic Curve
AUPRArea Under the Precision–Recall Curve
MCCMatthews Correlation Coefficient
BABalanced Accuracy
PDBProtein Data Bank
CAPRICritical Assessment of Predicted Interactions
RMSDRoot-mean-square deviation
I-RMSDInterface root-mean-square deviation

References

  1. Noor, S.; Fatima, A.; Fatima, I.; Javed, A. Antigen-Antibody Interaction in Cell Signaling. Cell Signal. 2025, 92, 125. [Google Scholar]
  2. Jain, T.; Sun, T.; Durand, S.; Hall, A.; Houston, N.; Nett, J.; Sharkey, B.; Bobrowicz, B.; Caffry, I.; Yu, Y. Biophysical Properties of the Clinical-Stage Antibody Landscape. Proc. Natl. Acad. Sci. USA 2017, 114, 944–949. [Google Scholar] [CrossRef] [PubMed]
  3. Salvador, J.; Vilaplana, L.; Marco, M. Nanobody: Outstanding Features for Diagnostic and Therapeutic Applications. Anal. Bioanal. Chem. 2019, 411, 1703–1713. [Google Scholar] [CrossRef]
  4. Sun, S.; Ding, Z.; Yang, X.; Zhao, X.; Zhao, M.; Gao, L.; Chen, Q.; Xie, S.; Liu, A.; Yin, S. Nanobody: A Small Antibody with Big Implications for Tumor Therapeutic Strategy. Int. J. Nanomed. 2021, 16, 2337–2356. [Google Scholar] [CrossRef]
  5. Sledzieski, S.; Singh, R.; Cowen, L.; Berger, B. D-SCRIPT Translates Genome to Phenome with Sequence-Based, Structure-Aware, Genome-Scale Predictions of Protein-Protein Interactions. Cell Syst. 2021, 12, 969–982. [Google Scholar] [CrossRef]
  6. Singh, R.; Devkota, K.; Sledzieski, S.; Berger, B.; Cowen, L. Topsy-Turvy: Integrating a Global View into Sequence-Based PPI Prediction. Bioinformatics 2022, 38, i264–i272. [Google Scholar] [CrossRef]
  7. Gainza, P.; Sverrisson, F.; Monti, F.; Rodola, E.; Boscaini, D.; Bronstein, M.; Correia, B. Deciphering Interaction Fingerprints from Protein Molecular Surfaces Using Geometric Deep Learning. Nat. Methods 2020, 17, 184–192. [Google Scholar] [CrossRef] [PubMed]
  8. Papadopoulos, A.; Axenopoulos, A.; Iatrou, A.; Stamatopoulos, K.; Alvarez, F.; Daras, P. ParaSurf: A Surface-Based Deep Learning Approach for Paratope-Antigen Interaction Prediction. Bioinformatics 2025, 41, btaf062. [Google Scholar] [CrossRef] [PubMed]
  9. Akbar, R.; Robert, P.; Pavlović, M.; Jeliazkov, J.; Snapkov, I.; Slabodkin, A.; Weber, C.; Scheffer, L.; Miho, E.; Haff, I. A Compact Vocabulary of Paratope-Epitope Interactions Enables Predictability of Antibody-Antigen Binding. Cell Rep. 2021, 34, 108855. [Google Scholar] [CrossRef]
  10. Ahmed, F.; Aly, S.; Liu, X. NABP-BERT: Nanobody-Antigen Binding Prediction Based on Bidirectional Encoder Representations from Transformers (BERT) Architecture. Brief. Bioinform. 2025, 26, bbae518. [Google Scholar] [CrossRef]
  11. Rao, R.; Bhattacharya, N.; Thomas, N.; Duan, Y.; Chen, P.; Canny, J.; Abbeel, P.; Song, Y. Evaluating Protein Transfer Learning with TAPE. Adv. Neural Inf. Process. Syst. 2019, 32, 9689–9701. [Google Scholar]
  12. Su, J.; Han, C.; Zhou, Y.; Shan, J.; Zhou, X.; Yuan, F. Saprot: Protein Language Modeling with Structure-Aware Vocabulary. bioRxiv 2023. [Google Scholar] [CrossRef]
  13. Heinzinger, M.; Weissenow, K.; Sanchez, J.; Henkel, A.; Mirdita, M.; Steinegger, M.; Rost, B. Bilingual Language Model for Protein Sequence and Structure. NAR Genom. Bioinform. 2024, 6, lqae150. [Google Scholar] [CrossRef]
  14. Akbarzadeh, S.; Coşkun, Ö.; Günçer, B. Studying Protein-Protein Interactions: Latest and Most Popular Approaches. J. Struct. Biol. 2024, 216, 108118. [Google Scholar] [CrossRef] [PubMed]
  15. Baranwal, M.; Magner, A.; Saldinger, J.; Turali-Emre, E.; Elvati, P.; Kozarekar, S.; VanEpps, J.; Kotov, N.; Violi, A.; Hero, A. Struct2Graph: A Graph Attention Network for Structure Based Predictions of Protein-Protein Interactions. BMC Bioinform. 2022, 23, 370. [Google Scholar] [CrossRef]
  16. Gao, Z.; Jiang, C.; Zhang, J.; Jiang, X.; Li, L.; Zhao, P.; Yang, H.; Huang, Y.; Li, J. Hierarchical Graph Learning for Protein-Protein Interaction. Nat. Commun. 2023, 14, 1093. [Google Scholar] [CrossRef]
  17. Feng, H.; Sun, X.; Li, N.; Xu, Q.; Li, Q.; Zhang, S.; Xing, G.; Zhang, G.; Wang, F. Machine Learning-Driven Methods for Nanobody Affinity Prediction. ACS Omega 2024, 9, 47893–47902. [Google Scholar] [CrossRef]
  18. Sardar, U.; Ali, S.; Ayub, M.; Shoaib, M.; Bashir, K.; Khan, I.; Patterson, M. Sequence-Based Nanobody-Antigen Binding Prediction. In International Symposium on Bioinformatics Research and Applications; Springer Nature: Singapore, 2023; pp. 227–240. [Google Scholar]
  19. Van Kempen, M.; Kim, S.; Tumescheit, C.; Mirdita, M.; Lee, J.; Gilchrist, C.; Söding, J.; Steinegger, M. Fast and Accurate Protein Structure Search with Foldseek. Nat. Biotechnol. 2024, 42, 243–246. [Google Scholar] [CrossRef]
  20. Van Den Oord, A.; Vinyals, O.; Kavukcuoglu, K. Neural Discrete Representation Learning. Adv. Neural Inf. Process. Syst. 2017, 30, 6309–6318. [Google Scholar]
  21. Devlin, J.; Chang, M.; Lee, K.; Toutanova, K. BERT: Pre-Training of Deep Bidirectional Transformers for Language Understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers); Association for Computational Linguistics: Stroudsburg, PA, USA, 2019; Volume 1, pp. 4171–4186. [Google Scholar]
  22. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.; Kaiser, Ł.; Polosukhin, I. Attention Is All You Need. Adv. Neural Inf. Process. Syst. 2017, 30, 5998–6008. [Google Scholar]
  23. Schneider, C.; Raybould, M.; Deane, C. SAbDab in the Age of Biotherapeutics: Updates Including SAbDab-nano, the Nanobody Structure Tracker. Nucleic Acids Res. 2022, 50, D1368–D1372. [Google Scholar] [CrossRef]
  24. Berman, H.; Battistuz, T.; Bhat, T.; Bluhm, W.; Bourne, P.; Burkhardt, K.; Feng, Z.; Gilliland, G.; Iype, L.; Jain, S.; et al. The Protein Data Bank. Acta Crystallogr. Sect. D Biol. Crystallogr. 2002, 58, 899–907. [Google Scholar] [CrossRef]
  25. Fu, L.; Niu, B.; Zhu, Z.; Wu, S.; Li, W. CD-HIT: Accelerated for Clustering the Next-Generation Sequencing Data. Bioinformatics 2012, 28, 3150–3152. [Google Scholar] [CrossRef]
  26. Bernett, J.; Blumenthal, D.; List, M. Cracking the Black Box of Deep Sequence-Based Protein–Protein Interaction Prediction. Brief. Bioinform. 2024, 25, bbae202. [Google Scholar]
  27. Alanis-Lobato, G.; Andrade-Navarro, M.; Schaefer, M. HIPPIE v2.0: Enhancing Meaningfulness and Reliability of Protein–Protein Interaction Networks. Nucleic Acids Res. 2016, 44, gkw985. [Google Scholar] [CrossRef]
  28. Sanders, P.; Schulz, C. Think Locally, Act Globally: Highly Balanced Graph Partitioning. In International Symposium on Experimental Algorithms; Springer: Berlin/Heidelberg, Germany, 2013; pp. 164–175. [Google Scholar]
  29. Hu, E.; Shen, Y.; Wallis, P.; Allen-Zhu, Z.; Li, Y.; Wang, S.; Wang, L.; Chen, W. LoRA: Low-Rank Adaptation of Large Language Models. ICLR 2022, 1, 3. [Google Scholar]
  30. Kingma, D.; Ba, J. Adam: A Method for Stochastic Optimization. arXiv 2014, arXiv:1412.6980. [Google Scholar]
  31. Kozakov, D.; Hall, D.; Xia, B.; Porter, K.; Padhorny, D.; Yueh, C.; Beglov, D.; Vajda, S. The ClusPro Web Server for Protein–Protein Docking. Nat. Protoc. 2017, 12, 255–278. [Google Scholar] [CrossRef]
  32. Janin, J.; Henrick, K.; Moult, J.; Eyck, L.; Sternberg, M.; Vajda, S.; Vakser, I.; Wodak, S. CAPRI: A Critical Assessment of Predicted Interactions. Proteins Struct. Funct. Bioinform. 2003, 52, 2–9. [Google Scholar] [CrossRef]
  33. Méndez, R.; Leplae, R.; De Maria, L.; Wodak, S. Assessment of Blind Predictions of Protein–Protein Interactions: Current Status of Docking Methods. Proteins Struct. Funct. Bioinform. 2003, 52, 51–67. [Google Scholar] [CrossRef]
Figure 1. The workflow of our model. (a) Fine-tuning stage: Each protein is converted by Foldseek into a paired “Residue-3Di” sequence, where a 3Di token is a discretized structural encoding that represents the local three-dimensional spatial configuration of each residue. The paired sequences are used to fine-tune a structure-aware PLM (SaProt), resulting in the Nano-Encoder, which captures universal binding patterns. (b) End-to-end prediction stage: The nanobody and antigen sequences are similarly converted and independently encoded by the frozen Nano-Encoder (only fine-tune its last hidden layer) to obtain residue-level hidden feature matrices. Three parallel pooling branches—mean, max, and min pooling—extract complementary global features. For each branch, features from both proteins are concatenated and fed into an independent MLP predictor to generate a preliminary score. A hard voting fusion method then integrates the prediction results of the three branches to output the final interaction label, thereby reducing the bias introduced by single pooling and improving the robustness of the model.
Figure 1. The workflow of our model. (a) Fine-tuning stage: Each protein is converted by Foldseek into a paired “Residue-3Di” sequence, where a 3Di token is a discretized structural encoding that represents the local three-dimensional spatial configuration of each residue. The paired sequences are used to fine-tune a structure-aware PLM (SaProt), resulting in the Nano-Encoder, which captures universal binding patterns. (b) End-to-end prediction stage: The nanobody and antigen sequences are similarly converted and independently encoded by the frozen Nano-Encoder (only fine-tune its last hidden layer) to obtain residue-level hidden feature matrices. Three parallel pooling branches—mean, max, and min pooling—extract complementary global features. For each branch, features from both proteins are concatenated and fed into an independent MLP predictor to generate a preliminary score. A hard voting fusion method then integrates the prediction results of the three branches to output the final interaction label, thereby reducing the bias introduced by single pooling and improving the robustness of the model.
Applsci 16 04864 g001
Figure 2. (a) ROC curves and Precision–Recall curves of selected deep learning models. (b) Comparisons on the NAI test set were conducted between the model trained on NAIs and trained on human PPIs.
Figure 2. (a) ROC curves and Precision–Recall curves of selected deep learning models. (b) Comparisons on the NAI test set were conducted between the model trained on NAIs and trained on human PPIs.
Applsci 16 04864 g002
Figure 3. Docking performance on the test dataset. Based on the docking results, samples are classified into four categories: High, Medium, Acceptable, and Incorrect.
Figure 3. Docking performance on the test dataset. Based on the docking results, samples are classified into four categories: High, Medium, Acceptable, and Incorrect.
Applsci 16 04864 g003
Figure 4. (a) Global positional distribution of nanobody binding sites. The x-axis represents residue positions from 1 to the maximum sequence length, and the y-axis represents the occurrence count of binding sites. Three prominent enrichment regions are observed, which are highly consistent with CDR1, CDR2, and CDR3. (b) Violin and box plots of normalized residue importance scores. Binding sites show higher importance scores than non-binding sites, indicating the model effectively captures biologically meaningful binding characteristics.
Figure 4. (a) Global positional distribution of nanobody binding sites. The x-axis represents residue positions from 1 to the maximum sequence length, and the y-axis represents the occurrence count of binding sites. Three prominent enrichment regions are observed, which are highly consistent with CDR1, CDR2, and CDR3. (b) Violin and box plots of normalized residue importance scores. Binding sites show higher importance scores than non-binding sites, indicating the model effectively captures biologically meaningful binding characteristics.
Applsci 16 04864 g004
Figure 5. Normalized importance scores (PDB:4lgs) per residue position. Red: binding sites; blue: non-binding sites. Higher scores (approaching 1) indicate greater contribution to interaction prediction. The average importance scores of binding sites and non-binding sites are shown above the table.
Figure 5. Normalized importance scores (PDB:4lgs) per residue position. Red: binding sites; blue: non-binding sites. Higher scores (approaching 1) indicate greater contribution to interaction prediction. The average importance scores of binding sites and non-binding sites are shown above the table.
Applsci 16 04864 g005
Table 1. Number of samples for Nb-Ag datasets.
Table 1. Number of samples for Nb-Ag datasets.
DatasetTraining DatasetTest Dataset
Pos SetNeg SetPos SetNeg Set
Nb-Ag932901248453
Table 2. Number of samples for PPI datasets.
Table 2. Number of samples for PPI datasets.
DatasetTraining DatasetValidation DatasetTest Dataset
Pos SetNeg SetPos SetNeg SetPos SetNeg Set
PPI35,16433,64110,021983671256602
Table 3. Performance comparison of different models.
Table 3. Performance comparison of different models.
MethodsAcc ↑Rec ↑F1 ↑AUC ↑AUPR ↑MCC ↑BA ↑
SVM [18]0.9092000.49340.097200.5
NB [18]0.89090.00490.00690.42340.0747−0.03180.4917
MLP [18]0.75830.19840.13040.50940.09380.02290.5049
KNN [18]0.90780.20630.28890.70590.28270.27860.5961
RF [18]0.92020.12100.21570.79980.52320.32880.5588
LR [18]0.9092000.34270.064100.5
DT [18]0.86280.32340.29920.61990.15220.21850.6157
Struct2Graph [15]0.8942000.49450.0958−0.03270.4945
Topsy-Turvy  [6]0.89320.26670.36920.66690.38560.26570.6147
D-Script [5]0.87230.24440.30980.63370.35350.18200.5856
NABP-PPI-PROT-BERT [10]0.91150.50000.56410.79940.57630.48760.7307
NABP-PROT-BERT [10]0.91410.46340.53520.75730.51220.45450.7147
Ours0.95010.56250.68350.90040.72330.67640.7768
Table 4. The results of ablation experiments.
Table 4. The results of ablation experiments.
MethodsAcc ↑Rec ↑F1 ↑AUC ↑AUPR ↑MCC ↑ BA ↑
Baseline (no ppi fine-tune)0.93610.37500.52940.90190.66010.55710.6853
Baseline (mean pooling)0.94610.54170.65820.91260.71090.64820.7653
Baseline (max pooling)0.95010.52080.66670.89120.71360.67310.7582
Baseline (min pooling)0.94410.54170.65000.91050.69500.63600.7642
mean, max, min pooling0.95010.56250.68350.90040.72330.67640.7768
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Ying, F.; Li, Z.; Mao, J.; Sun, L.; Phaphuangwittayakul, A.; Dhuny, R. Structure-Aware Protein Language Model with Multi-Branch Ensemble for Nanobody–Antigen Interaction Prediction. Appl. Sci. 2026, 16, 4864. https://doi.org/10.3390/app16104864

AMA Style

Ying F, Li Z, Mao J, Sun L, Phaphuangwittayakul A, Dhuny R. Structure-Aware Protein Language Model with Multi-Branch Ensemble for Nanobody–Antigen Interaction Prediction. Applied Sciences. 2026; 16(10):4864. https://doi.org/10.3390/app16104864

Chicago/Turabian Style

Ying, Fangli, Zilong Li, Junjie Mao, Lihua Sun, Aniwat Phaphuangwittayakul, and Riyad Dhuny. 2026. "Structure-Aware Protein Language Model with Multi-Branch Ensemble for Nanobody–Antigen Interaction Prediction" Applied Sciences 16, no. 10: 4864. https://doi.org/10.3390/app16104864

APA Style

Ying, F., Li, Z., Mao, J., Sun, L., Phaphuangwittayakul, A., & Dhuny, R. (2026). Structure-Aware Protein Language Model with Multi-Branch Ensemble for Nanobody–Antigen Interaction Prediction. Applied Sciences, 16(10), 4864. https://doi.org/10.3390/app16104864

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop