Task prediction method and device for nanobodies, electronic equipment and storage medium

By using a unified input template and adapter branch to update the trunk encoder, the cost and performance issues in multi-task prediction of nanobody are solved, and efficient and accurate nanobody task prediction is achieved under the same model framework.

CN122493937APending Publication Date: 2026-07-31PENG CHENG LAB
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
PENG CHENG LAB
Filing Date
2026-05-11
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

In existing technologies, multiple capability tests of nanobodies require separate training of corresponding test models, resulting in a linear increase in the number of models with the number of test tasks, which increases deployment and maintenance costs.

Method used

By updating the backbone encoder of the antibody task prediction model using a unified input template and adapter branches, unified processing of tasks with different supervision paradigms is achieved. Deterministic routing is adopted to avoid feature interference and improve the model's scalability and generalization ability.

Benefits of technology

Processing nanobody data for different tasks within the same model framework reduces model deployment and maintenance costs, and improves the accuracy and generalization ability of task predictions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122493937A_ABST
    Figure CN122493937A_ABST
Patent Text Reader

Abstract

This invention relates to the field of biotechnology and discloses a method, apparatus, electronic device, and storage medium for predicting the task of nanobodies. The method includes: determining the input sequence of an antibody task prediction model based on the antibody data to be tested and an input template; the input sequence includes task information, antigen information, and antibody information to be tested; generating characterization features corresponding to the input sequence based on the updated backbone encoder in the antibody task prediction model; the updated backbone encoder is obtained by updating the backbone encoder with low-rank trainable parameters in the adapter branch; determining the task route of the characterization features based on the antibody task prediction model and task information, and determining at least one target task head corresponding to the characterization features according to the task route; testing the characterization features based on the determined target task head to obtain at least one task prediction result for the antibody data to be tested. This invention can improve the generalization ability of antibody task prediction and solve the problem of balancing cost and performance in multi-task prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of biotechnology, and more specifically to methods, devices, electronic devices, and storage media for predicting the mission of nanobodies. Background Technology

[0002] Nanobodies (variable domain of heavy-chain-only antibody, VHH) possess advantages such as small molecular weight, structural stability, and ease of expression and modification, leading to continuously growing application demands in therapeutic drug development, molecular diagnostics, and molecular imaging. With the increase in sequencing throughput and screening scale, practical R&D projects now require simultaneous evaluation of the binding affinity, thermal stability, functional sites of residues, and sequence reconstruction capabilities of the complementarity-determining region (CDR) on the same candidate nanobodies.

[0003] In the existing technology, a corresponding test model is trained for each of the above-mentioned capabilities testing tasks, and then multiple capabilities of the same candidate nanobody are tested. This causes the number of models to increase linearly with the number of testing tasks, which increases the deployment and maintenance costs of the models. Summary of the Invention

[0004] This invention provides a method, apparatus, electronic device, and storage medium for predicting nanobody tasks, in order to solve the problem in the prior art where the number of models increases linearly with the number of test tasks, thereby increasing the deployment and maintenance costs of the models.

[0005] In a first aspect, the present invention provides a method for predicting the mission of nanobodies, comprising: The input sequence for the pre-trained antibody task prediction model is determined based on the antibody data to be tested and the input template; the input sequence includes task information, antigen information and antibody information to be tested. Based on the updated backbone encoder in the antibody task prediction model, the representation features corresponding to the input sequence are generated; wherein, the updated backbone encoder is obtained by updating the backbone encoder with low-rank trainable parameters in the adapter branch; Based on the antibody task prediction model and task information, the task route for the characterization features is determined, and at least one target task head corresponding to the characterization features is determined according to the task route. Based on at least one target task head in the antibody task prediction model, the characterization features are tested to obtain at least one task prediction result for the antibody data to be tested.

[0006] In one embodiment, the process of determining the updated backbone encoder includes: Freeze the pre-trained weights of the trunk encoder and determine the weight increment of the adapter branch based on the low-rank trainable parameters in the adapter branch. The adaptation weights are determined based on the pre-trained weights, weight increments, and magnitude parameters in the adapter branch. The trunk encoder is updated based on the adaptation weights to obtain the updated trunk encoder.

[0007] In one embodiment, the antibody data to be tested includes task metadata, and before determining the input sequence of the pre-trained antibody task prediction model based on the antibody data to be tested and the input template, the method further includes: Based on the task metadata, determine the task type of the antibody to be tested; When the task type is an antigen conditional task, the antigen residue representation corresponding to the original antigen information in the antibody data to be tested is obtained based on the antigen encoder; and the antigen residue representation is subjected to pooling and projection processing to obtain the antigen information in the input sequence. When the task type is a non-antigen conditional task, the antigen information unit in the input template is zeroed out to obtain the antigen information in the input sequence.

[0008] In one embodiment, after testing the characterization features based on at least one target task head in the antibody task prediction model to obtain at least one task prediction result for the antibody data to be tested, the method further includes: The input sequence for each candidate antibody is determined based on the antibody data and input template corresponding to multiple candidate antibodies. Input the input sequence corresponding to each candidate antibody into the antibody task prediction model to obtain at least one task prediction result for each candidate antibody. Based on at least one task prediction result for each candidate antibody and the task weight for each task, the task prediction score for each candidate antibody is determined. The target antibody is determined from among multiple candidate antibodies based on the task prediction score corresponding to each candidate antibody.

[0009] In one embodiment, the process of determining the pre-trained antibody task prediction model includes: The training samples for the initial antibody task prediction model are determined based on training antibody data and input templates; the training samples include task information, antigen information, and antibody information to be tested. The total loss function is determined based on the total number of training samples, the number of training samples corresponding to each task in the training samples, the task sample weights corresponding to each task, and the task loss corresponding to each task. The initial antibody task prediction model is updated based on the total loss function to obtain a pre-trained antibody task prediction model.

[0010] In one embodiment, before determining the input sequence of the pre-trained antibody task prediction model based on the antibody data to be tested, the method further includes: The training antigen residue representation corresponding to the original antigen information in the training antibody data is obtained based on the antigen encoder. Pooling and projection processing are performed on the training antigen residue representation to obtain antigen information in the training samples. When the number of original antigen information in the training antibody data is lower than a preset threshold, or the noise of the original antigen information in the training antibody data is greater than a preset noise threshold, projection layer normalization processing is performed on the original antigen information in the training antibody data during projection processing.

[0011] Secondly, this application also provides a nanobody task prediction device, comprising: The input determination module is used to determine the input sequence of the pre-trained antibody task prediction model based on the antibody data to be tested and the input template; the input sequence includes task information, antigen information and antibody information to be tested; The generation module is used to generate representation features corresponding to the input sequence based on the updated backbone encoder in the antibody task prediction model; wherein, the updated backbone encoder is obtained by updating the backbone encoder with low-rank trainable parameters in the adapter branch; The task head determination module is used to determine the task route of the characterization feature based on the antibody task prediction model and the task information of the input sequence, and to determine at least one target task head corresponding to the characterization feature according to the task route. The prediction module is used to test the characterization features based on at least one target task head in the antibody task prediction model to obtain at least one task prediction result for the antibody data to be tested.

[0012] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the nanobody task prediction method described in the first aspect or any corresponding embodiment thereof.

[0013] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the nanobody task prediction method of the first aspect or any corresponding embodiment described above.

[0014] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute the nanobody task prediction method of the first aspect or any corresponding embodiment described above.

[0015] The nanobody task prediction method in this invention enables the unified definition of antigen conditions and supervision granularity through task metadata in the antibody data to be tested. This allows the antibody task prediction model to complete tasks with different supervision paradigms based on a shared backbone encoder. Furthermore, by standardizing the structure of antibody data for different tasks using a unified input template, antibody data for different tasks can be processed within the same model framework, thereby improving the scalability and generalization ability of the antibody task prediction model. By updating the backbone encoder of the model through adapter branches, the antibody task prediction model can share general representation capabilities in multi-task scenarios and adapt to different task requirements, improving the generalization ability of the antibody task prediction model and solving the cost-performance balance problem in multi-task prediction. The antibody task prediction model adopts deterministic routing, which can avoid feature interference between different tasks and improve the accuracy of nanobody task prediction. Attached Figure Description

[0016] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0017] Figure 1 This is a flowchart illustrating the nanobody task prediction method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the task prediction process for nanobodies according to an embodiment of the present invention; Figure 3 This is a cross-task performance comparison chart of the antibody task prediction model and mainstream prediction models according to embodiments of the present invention on the NbBench benchmark; Figure 4 This is a reconstruction and resolution performance analysis diagram of the antibody task prediction model in the core region of CDR according to an embodiment of the present invention. Figure 5 This is a structural block diagram of a nanobody task prediction device according to an embodiment of the present invention. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] To simultaneously evaluate the binding ability, affinity, thermal stability, functional sites of residues, and sequence reconstruction capabilities of complementarity-determining regions (CDRs) on the same candidate nanobody, the relevant technical approaches are generally classified into the following categories: First, a corresponding model is trained for each capability testing task of the nanobody. The boundaries of each task are clear, but the number of models increases linearly with the number of tasks, thereby increasing the cost of task prediction. Second, for conventional multi-task approaches, a shared backbone scheme can share representations to a certain extent, but the input ports are not uniform and antigen information is usually fused at the back end, resulting in limited synergistic effects across tasks. Third, a full-parameter fine-tuning scheme is used to pursue peak performance in a single task, but the training resources are consumed at a high level and the iteration cycle is long. Therefore, this application proposes a nanobody task prediction method. By standardizing the structure of antibody data for different tasks using a unified input template, it enables the processing of antibody data from different tasks within the same model framework, thereby improving the versatility and scalability of the antibody task prediction model. By updating the model's backbone encoder through adapter branches, the antibody task prediction model can share general representation capabilities in multi-task scenarios, while adapting to different task requirements, thus improving the generalization ability of the antibody task prediction model and solving the cost-performance balance problem in multi-task prediction. The antibody task prediction model employs deterministic routing, which avoids feature interference between different tasks and improves the accuracy of nanobody task prediction.

[0020] According to an embodiment of the present invention, a method for predicting the task of nanobody is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0021] This embodiment provides a method for predicting the task of nanobodies. Figure 1 This is a flowchart of a nanobody task prediction method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Determine the input sequence of the pre-trained antibody task prediction model based on the antibody data to be tested and the input template; the input sequence includes task information, antigen information and antibody information to be tested.

[0022] The antibody data to be tested includes raw sample data and task metadata. Optionally, during the actual prediction phase using the antibody task prediction model, the raw sample data is denoted as... , Indicates the task identifier. This represents the nanobody sequence. This represents the antigen sequence (present only in antigen conditional tasks). For example, task identifiers may include binding ability prediction task identifiers, affinity prediction task identifiers, thermal stability prediction task identifiers, etc.; the nanobody sequence may be a sequence composed of amino acids; the antigen sequence may be the original antigen information, including the amino acid sequence of the antigen. The task metadata is denoted as... , The supervision granularity indicates the level of detail in the model's predictions. It can be sequence-level or residue-level. When the supervision granularity is sequence-level, the output is the prediction result for the entire sequence; when the supervision granularity is residue-level, the output is the prediction result for the position of each residue in the sequence. This represents the antigen condition switch, which controls the participation status of the antigen sequence under a unified input template. When the antigen condition switch is turned on, the antibody task prediction model will introduce the antigen information determined based on the original antigen information (i.e., the antigen sequence) into the model's calculation process. When the switch is turned off, the model will only perform calculations based on the antibody information to be tested.

[0023] In this embodiment, the antigen conditions and supervision granularity can be uniformly defined through task meta-information, enabling the antibody task prediction model to complete tasks with different supervision paradigms on the basis of a shared backbone encoder. This allows for multi-task training and inference within a single framework, improving the scalability and generalization ability of the antibody task prediction model.

[0024] In traditional technologies, introducing new tasks to an existing task set typically requires processes such as adding new input formats, expanding the tokenizer, and modifying service interfaces. This invention, by introducing a unified input template and fixing input template slots, avoids this repetitive work. Optionally, when adding new tasks to an existing task set, this invention reduces the cost of adding tasks from architectural modification to configuration expansion. This allows the model to support new tasks while maintaining a unified input template, through expanding task identifiers and the output layer (i.e., the task header), enhancing the model's scalability and structural stability without rewriting the input protocol.

[0025] For example, the input template is defined as ,in, It is a task information unit, which can be determined based on the task identifier and task meta-information in the original sample data, and is used to display the semantics of the injected task. It is an antigen information unit used to carry antigen conditions and can be determined based on the antigen sequence in the original sample data; The input template contains information units for the antibody to be tested, which are segmented nanobody sequences that can be determined based on the nanobody sequences in the original sample data. The positions of each unit in this input template remain fixed and the topology of the input template does not change due to changes in the task or the antibody data to be tested.

[0026] Furthermore, the task prediction results output by the antibody task prediction model can be uniformly structured using a unified output template. This template includes task identifier, predicted value, confidence level, key intermediate feature summary, comprehensive score, and version and time information. Unifying the model's task prediction results allows the model output to be directly integrated into the experimental scheduling system and data feedback system, avoiding the additional step of "aligning results before use" in traditional multi-model solutions. Optionally, the antibody task prediction model output can also include metadata for auditing and backtracking, enabling direct candidate screening and review based on unified fields. Since all tasks share a unified template, data access can be finely controlled at the object level, such as restricting the visibility of raw sequences, labels, and scoring fields, facilitating audit logging and increasing data privacy.

[0027] Based on the confidence level output by the antibody task prediction model, boundary candidate nanobodies with confidence levels close to the threshold are automatically marked as "requiring manual review" and the corresponding task sub-scores are also output to help experts quickly determine whether they should be included in the experimental list, thus achieving a balance between the efficiency of large-scale screening and expert experience.

[0028] In this embodiment, the data input to the antibody task prediction model is standardized. The supervision granularity and antigen dependence are described by introducing task meta-information, thereby mapping different types of nanobody testing tasks to the same expression form. This enables the antibody task prediction model to adaptively select the corresponding prediction paradigm based on task identifiers and meta-information, achieving unified modeling and collaborative optimization of multiple tasks such as sequence-level and residue-level, antigen conditions and non-antigen conditions. This avoids the complexity caused by multiple models and multiple input protocols in the nanobody task prediction process, and improves the versatility and scalability of the antibody task prediction model in this application.

[0029] Step S102: Based on the updated backbone encoder in the antibody task prediction model, generate the representation features corresponding to the input sequence; wherein, the updated backbone encoder is obtained by updating the backbone encoder with low-rank trainable parameters in the adapter branch.

[0030] The backbone encoder transforms the input of the antibody task prediction model into a high-dimensional feature representation. The adaptation branch is a trainable module mounted on the backbone encoder, used to adjust shared features. Low-rank trainable parameters are the trainable parameters. Optionally, the adaptation branch makes task-related lightweight adjustments to the backbone encoder using low-rank trainable parameters, thereby achieving efficient adaptation and prediction for different tasks without changing the backbone encoder parameters. The representation features are the numerical semantic representations obtained by encoding the input sequence using the updated backbone encoder.

[0031] Step S103: Determine the task route for the characterization features based on the antibody task prediction model and task information, and determine at least one target task head corresponding to the characterization features according to the task route.

[0032] During the inference and training process of the antibody task prediction model, the model relies on task metadata. The task route for characterizing features is determined. When the current task is determined to be a sequence-level task based on task metadata, the antibody task prediction model outputs the prediction results of the characterizing features through the sequence-level task header. For example, when the current task is determined to be a residue-level task based on task metadata, the antibody task prediction model outputs the prediction results of the characterizing features through the residue-level task header. The sequence-level task header is used to output classification or regression results, including but not limited to binding prediction results, affinity regression results, and stability assessment results; the residue-level task header is used to perform position-by-position modeling of the local features of each amino acid residue in the antibody sequence to output position-by-position tags or vocabulary probabilities, used for binding site identification, CDR region annotation, etc.

[0033] The aforementioned deterministic routing process directly determines the task route based on the task meta-information, without relying on additional gating networks or dynamic routing modules. This reduces training instability and improves the interpretability and controllability of the antibody task prediction model's prediction process.

[0034] Step S104: Based on at least one target task head in the antibody task prediction model, test the characterization features to obtain at least one task prediction result for the antibody data to be tested.

[0035] Based on at least one target task head in the antibody task prediction model, the characterization features are tested. Each target task head corresponds one-to-one with the specific task type of the antibody data to be tested, and is used to differentiate the output of features for different tasks, thereby obtaining at least one task prediction result corresponding to the antibody data. This task prediction result can be a classification result, a regression result, or a residue-level annotation result, etc. Furthermore, in this prediction process, the antibody task prediction model directly selects the corresponding target task head based on task metadata through a deterministic routing mechanism, so that the characterization features are directed to the predefined task head for computation.

[0036] In this application, the antigen conditions and supervision granularity can be uniformly defined through the task metadata in the antibody data to be tested, enabling the antibody task prediction model to complete tasks with different supervision paradigms based on a shared backbone encoder. Furthermore, the antibody data to be tested for different tasks are structurally standardized through a unified input template, allowing the antibody data to be tested for different tasks to be processed within the same model framework, thereby improving the scalability and generalization ability of the antibody task prediction model. By updating the backbone encoder of the model through adapter branches, the antibody task prediction model can share general representation capabilities in multi-task scenarios, while adapting to different task requirements, improving the generalization ability of the antibody task prediction model, and solving the cost and performance balance problem in multi-task prediction. The antibody task prediction model adopts deterministic routing, which can avoid feature interference between different tasks and improve the accuracy of nanobody task prediction.

[0037] In some optional implementations, the process of determining the updated backbone encoder includes: freezing the pre-trained weights of the backbone encoder and determining the weight increment of the adapter branch based on the low-rank trainable parameters in the adapter branch; determining the adaptation weights based on the pre-trained weights, the weight increments, and the magnitude parameters in the adapter branch; and updating the backbone encoder based on the adaptation weights to obtain the updated backbone encoder.

[0038] For example, in determining the updated backbone encoder, the backbone encoder uses a pre-trained protein language model, and the pre-trained weights W of the backbone encoder are frozen; only the relevant parameters of the adapter branch are updated. Taking the adapter branch as a low-rank adaptation branch as an example, the weight increment of the adapter branch is determined based on the low-rank trainable parameters in the adapter branch. Based on the pre-trained weights, weight increments, and magnitude parameters in the adapter branch, the adaptation weights are determined as follows: And based on this adaptation weight The trunk encoder is updated to obtain the updated trunk encoder. In the above, and For low-rank trainable parameters, For amplitude parameters, optionally, rank It can be configured in the range of 4 to 64. The value is linked to the task complexity.

[0039] In this embodiment, the pre-trained protein language model is used as the backbone encoder, and its pre-training weights are frozen. This allows model training to occur only on the adaptation branches attached to the backbone encoder, focusing trainable parameters on high-value paths. This enables rapid adaptation to prediction tasks while preserving the generalization ability of the pre-trained protein language model and reducing the cost of model training.

[0040] The way antigen information is used is a key factor affecting the upper limit of antibody task prediction model performance. Existing solutions typically concatenate antigen information at the output layer of the antibody task prediction model (i.e., late fusion), thus preventing the antigen information context from participating in the representation learning of intermediate layers. In antigen variant scenarios and complex regression tasks, the improvement in antibody task prediction performance is often unstable. This invention addresses the above problems by uniformly handling antigen conditional tasks and non-antigen tasks, sequence-level tasks and residue-level tasks within a single framework, and the output can be directly used for unified scoring of candidate selection.

[0041] Specifically, in some optional implementations, the antibody data to be tested includes task metadata. Before step S101, the method further includes: determining the task type of the antibody to be tested based on the task metadata; when the task type is an antigen conditional task, obtaining the antigen residue representation corresponding to the original antigen information in the antibody data to be tested based on the antigen encoder; and performing pooling and projection processing on the antigen residue representation to obtain the antigen information in the input sequence; when the task type is a non-antigen conditional task, setting the antigen information units in the input template to zero to obtain the antigen information in the input sequence.

[0042] This invention moves both task control and antigen conditions to the input side of the antibody task prediction model, allowing them to continuously participate in representation learning during the encoding phase. For example, based on the task metadata in the antibody data to be tested, the task type of the antibody is determined; when the task type is an antigen condition task, the antigen residue representation corresponding to the original antigen information in the antibody data to be tested is obtained by freezing the antigen encoder. Then, the antigen vector is obtained through pooling and projection. The antigen vector The expression is as follows:

[0043] This antigen vector Write the antigen information unit into the input template, i.e., write The slot is used to obtain the antigen information in the input sequence corresponding to the antibody data to be tested, so that the antigen information context can participate in the antibody task prediction model calculation from the encoding starting point.

[0044] When the task type is a non-antigen conditional task, The slots (antigen information units in the input template) are zeroed out and masked.

[0045] In this embodiment, antigen-conditional tasks and non-antigen-conditional tasks can be switched in the same computation graph only by a condition switch, without the need to maintain two sets of model definitions. At the same time, by bringing antigen information forward and fusing it, the effective information flow path is changed, allowing antigen information to continuously participate in representation learning during the encoding stage. This enables the model to reduce feature loss and bias, and enhance the accuracy of nanobody task prediction.

[0046] In some optional embodiments, after step S104 above, the method further includes: determining the input sequence corresponding to each candidate antibody based on the test antibody data and input template corresponding to multiple candidate antibodies; inputting the input sequence corresponding to each candidate antibody into the antibody task prediction model to obtain at least one task prediction result corresponding to each candidate antibody; determining the task prediction score of each candidate antibody based on the at least one task prediction result corresponding to each candidate antibody and the task weight corresponding to each task; and determining the target antibody among multiple candidate antibodies based on the task prediction score corresponding to each candidate antibody.

[0047] The input sequences corresponding to each candidate antibody are input into the antibody task prediction model to obtain at least one task prediction result for each candidate antibody. Based on the at least one task prediction result for each candidate antibody and the task weights corresponding to each task, the task prediction score for each candidate antibody is determined. The task prediction score for each candidate antibody is... The formula for determining it is as follows:

[0048] in, To combine capabilities to predict tasks, To combine the weights corresponding to the capability prediction task; For predicting tasks based on affinity, Weights corresponding to affinity prediction tasks; For stability prediction tasks, Weights corresponding to the stability prediction task; As a penalty for development potential, The weight corresponding to the exploitability penalty; For multi-reactive risks, These represent the weights corresponding to multi-reactivity risks. to The settings can be configured and dynamically adjusted based on actual circumstances. For example, they can be dynamically adjusted according to the R&D stage. In the early R&D stage, the weight of binding ability can be increased to emphasize recall; in the mid-stage R&D stage, the weights of stability and affinity can be increased to improve exploitability; and in the later R&D stage, risk constraints can be increased to control experimental costs. Since the scores are derived from the output of a unified model, the ranking criteria remain comparable across different stages.

[0049] In this embodiment, by constructing a unified scoring function to weight and fuse the prediction results of multiple tasks, the prediction results of different tasks can be mapped to a single scoring space. By dynamically adjusting the weights of each indicator, the screening of candidate antibodies can adapt to the needs of different R&D stages, thereby improving the accuracy and flexibility of target nanobody determination.

[0050] In some optional implementations, the process of determining the trained antibody task prediction model includes: determining training samples for the initial antibody task prediction model based on training antibody data and input templates; the training samples include task information, antigen information, and antibody information to be tested; determining the total loss function based on the total number of training samples, the number of training samples corresponding to each task in the training samples, the task sample weights corresponding to each task, and the task loss corresponding to each task; and updating the initial antibody task prediction model based on the total loss function to obtain the pre-trained antibody task prediction model.

[0051] In the training process of the antibody task prediction model, multi-task training adopts a unified aggregation objective to obtain the total loss function. The initial antibody task prediction model is then updated based on this total loss function to obtain the final antibody task prediction model. Specifically, the formula for determining the total loss function is as follows:

[0052] In the above formula, Let t be the task loss corresponding to task t, which is determined by the specific task type. For classification tasks, cross-entropy is used to determine the loss; for regression tasks, Smooth L1 is used to determine the loss; and for mask reconstruction tasks, mask position cross-entropy is used to determine the loss. The task sample weights corresponding to task t are used to balance the differences in task sample size; The number of training samples corresponding to task t in the training samples. This represents the total number of training samples.

[0053] In this embodiment, the total loss function integrates heterogeneous tasks into the same optimization framework, preserving the differences between tasks while maintaining the consistency of the optimization direction of the prediction model.

[0054] In the previous optional implementation, before determining the input sequence of the pre-trained antibody task prediction model based on the antibody data to be tested, the method further includes: obtaining the training antigen residue representation corresponding to the original antigen information in the training antibody data based on the antigen encoder; performing pooling and projection processing on the training antigen residue representation to obtain the antigen information in the training samples; wherein, when the number of original antigen information in the training antibody data is lower than a preset number threshold, or the noise of the original antigen information in the training antibody data is greater than a preset noise threshold, the original antigen information in the training antibody data is subjected to projection layer normalization processing in the projection processing.

[0055] Before training the initial antibody task prediction model based on training antibody data, this application allows for data preprocessing and quality control procedures on the data to be input into the model. Optionally, the training antibody data includes raw training data and task metadata, where the raw training data is denoted as... ,That The supervision signal corresponding to the task identifier can refer to the actual prediction result corresponding to the task identifier. When label conflict samples are identified in the training antibody data based on the original training data, the training antibody data with label conflicts are isolated and combined to avoid low-quality supervision signals contaminating the main training set of the initial antibody task prediction model. Label conflict samples refer to situations in the training antibody data where the prediction results for the same antibody and the same task are inconsistent. Furthermore, when the supervision signals between tasks differ significantly, this invention maintains task header decoupling, sharing only the backbone representation to avoid mutual interference between tasks. Simultaneously, the legality of the training antibody data can be verified, unifying capitalization and character sets, and marking, repairing, or removing data that does not conform to the rules.

[0056] When the original antigen information in the training antibody data is found to be short or noisy, potentially leading to insufficient information in the antigen vector (antigen information), this invention can mitigate this issue through projection layer normalization and a minimum length strategy. For example, when the number of original antigen information items is detected to be below a preset threshold or the noise level is detected to be above a preset noise threshold, normalization is performed on the antigen information during the projection processing of the training antigen residues corresponding to the original antigen information. When the amount of data for some tasks in the training antibody data is significantly less than that for other tasks, direct joint training can easily result in weak tasks being overwhelmed by strong tasks. This invention uses task weights and sampling strategies to collaboratively control the training balance.

[0057] In this embodiment, to address boundary conditions such as insufficient original antigen information in the training antibody data, imbalance in the amount of data corresponding to tasks, and semantic differences between tasks, antigen representation normalization and minimum length strategies, a collaborative adjustment mechanism for task weights and sampling strategies, and a task head decoupling structure are introduced. These measures can effectively improve the robustness and training stability of the antibody task prediction model in complex data environments and avoid performance degradation caused by differences in data quality or task conflicts.

[0058] In nanobody task prediction, the distribution of antibody data changes with experimental strategies, introducing new antigens, variant antigens, and new task identifiers. If the antibody task prediction model cannot stably scale after changes in antibody data, it will lead to inaccuracies in nanobody task prediction. This invention proposes a nanobody task prediction method that unifies input, training, and output objectives, allowing new tasks, new data, and new tasks to be smoothly superimposed on the existing antibody task prediction model framework. Furthermore, this invention shifts the model design from "single-point prediction" to "multi-objective comparable scoring," directly organizing the results into data objects that can be incorporated into the experimental process, reducing manual conversion between the antibody task prediction model output and experimental decisions.

[0059] In another alternative implementation, such as Figure 2 The diagram illustrates the task prediction process for nanobody tasks. Part a provides a unified input template. Task information is explicitly injected through the [TASK] slot, while antigen information is uniformly managed through the [AG] slot (i.e., Antigen in the diagram), enabling antigen and non-antigen tasks to be executed under the same input topology. Antibody information is injected through the VHH (i.e., the antibody information unit in the diagram). Part b shows the backbone encoder with efficient parameter adaptation, i.e., the updated backbone encoder. This part demonstrates the combination of the frozen backbone encoder and efficient parameter adaptation. The backbone encoder handles general protein semantic encoding, while the adaptation branch handles low-overhead task migration. Part c shows the task routing and task head structure. The antibody task prediction model can simultaneously support sequence-level classification / regression and residue-level annotation / reconstruction on the same backbone encoder representation. From the above, it can be concluded that this invention is not a single-module optimization, but a unified architecture with interconnected input, encoding, and output.

[0060] In this embodiment, a unified input template incorporates heterogeneous tasks into the same input semantics through fixed slots for [TASK] and [AG]; antigen information is injected into the input side of the in vivo task prediction model and participates in full-layer encoding, solving the limitation of traditional late fusion that only affects back-end prediction; the combination of frozen pre-trained weights of the backbone encoder and low-rank adaptation branches solves the cost and performance balance problem in multi-task prediction; deterministic routing and unified scoring closed loop connect training, inference, ranking and backflow into a sustainable engineering link.

[0061] Furthermore, in terms of test management for antibody task prediction models, this invention supports parallel operation of real-time mode and batch offline mode for single antibody data. The real-time mode serves interactive molecular design, while the offline mode serves large-scale candidate library screening. Since both modes share the same model and the same scoring function, the consistency problem of "offline superiority and online inferiority" can be avoided. For large-scale batch processing scenarios, this invention can also perform hierarchical scheduling by project, antigen type, or task set, improving resource utilization.

[0062] In another optional implementation, to verify the superiority of the nanobody task prediction method proposed in this invention, systematic validation was performed on 11 tasks in NbBench, covering antigen conditional classification, regression, residue labeling, and CDR reconstruction. The results were compared with single-task training, conventional multi-task late fusion schemes, and baseline schemes. Experimental results show that, compared with conventional multi-task schemes, this invention achieves an average improvement of approximately 0.508 (relative improvement of approximately 26.4%) in the average index across four backbone models for CDR reconstruction BLOSUM62 recovery score, an average improvement of approximately 0.151 (relative improvement of approximately 25.6%) in the Spearman correlation coefficient of the regression task, and an average improvement of approximately 0.072 (relative improvement of approximately 9.8%) in the F1 score of the binary classification task. Figure 3 As shown, this is a performance comparison chart of the antibody task prediction model and mainstream prediction models on the NbBench benchmark across tasks. Part a shows the relative improvement by task, which is a scatter plot comparison of the overall performance of AntiBERTa2-CSSP, ESM-2-650M, ProtBert, and the antibody task prediction model of this invention (i.e., VHHBERT in the figure) on all 11 nanobody tasks in NbBench. The results show that the antibody task prediction model of this invention outperforms other mainstream prediction models in the vast majority of tasks. Part b gives the distribution of indicators for each task under different training strategies. Specifically, it provides a more detailed box plot of key tasks (such as Thermo-seq thermal stability, Affinity-score, CDRinf, CDR filling, etc.) to intuitively compare the distribution differences and stability of different models on this task. Figure 3 The comparative results show that in regression, antigen-related, and CDR reconstruction tasks, the corresponding curves and box plots of this invention generally shifted upwards, indicating that the improvement was not due to a single backbone or a single task, but rather exhibited stability across backbones. These results demonstrate the technical conclusion that the antibody task prediction model of this invention possesses universal gain under multi-task conditions, verifying the advanced nature and effectiveness of the technical solution of this invention.

[0063] like Figure 4The figure shown is a reconstruction and resolution performance analysis of the antibody task prediction model in the core region of the Coronavirus Detection Representation (CDR). This figure focuses on the challenging task of CDR reconstruction, displaying both overall metrics and location-level details. Figure 4 The bar and box plots in section a show the comparison of quantitative metrics for CDR region sequence reconstruction tasks using AntiBERTa2-CSSP, ESM-2-650M, ProtBert, and the antibody task prediction model of this invention, including comprehensive metrics such as accurate matching rate, residue-level accuracy, and average Hamming distance. The results show that the antibody task prediction model proposed in this invention significantly outperforms other models in all three key metrics, demonstrating the extremely high accuracy of the antibody task prediction model in CDR sequence reconstruction. Figure 4 The line graph in section b shows the position resolution capability analysis of the three key regions CDR1, CDR2, and CDR3 by AntiBERTa2-CSSP, ESM-2-650M, ProtBert, and the antibody task prediction model of the present invention. It shows that the antibody task prediction model of the present invention maintains a higher prediction accuracy at each position in the CDR region. Figure 4 The sequence identifier map at the bottom shows the residue distribution characteristics at different positions, which is used to determine whether each model can learn reasonable patterns in the hypervariable and conserved regions respectively. Figure 4 This invention not only improves the overall reconstruction score, but also shows more stable recovery at key locations, which has direct value for subsequent sequence optimization and experimental verification.

[0064] Furthermore, from a task performance perspective, this invention demonstrates more stable gains in antigen-related tasks, indicating that the antigen pre-fusion proposed in this application alters the effective information flow path; it exhibits better ranking consistency in regression tasks, demonstrating that the unified representation provides stronger support for continuous value objectives; and in the CDR reconstruction task, key position recovery is more stable, indicating that shared representation and unified routing help improve performance on challenging tasks. From an engineering perspective, traditional solutions typically require maintaining 11 model instances across 11 task scenarios, while this invention allows for unified management within a single backbone framework, significantly reducing model governance complexity. The unified output object can directly enter the experimental scheduling and data feedback stages, shortening the "data to decision" path.

[0065] In practical applications, a unified antibody task prediction model is used to initially screen candidate nanobodies in the candidate library, obtaining a candidate set that meets the binding ability and risk constraints. Subsequently, a regression task is performed on this candidate set to evaluate it, resulting in a joint ranking of stability and affinity. Finally, boundary candidates are reconstructed and re-evaluated using CDR (Corrective Determination Reconstruction). This hierarchical decision-making allows experimental resources to be concentrated on higher-value candidate nanobodies, reducing the number of invalid validations. Compared to traditional multi-model assembly processes, this invention makes it easier to maintain consistency in screening strategies under the same resource conditions. Since all tasks share the same backbone encoder representation, adding a new task may also have a positive transfer effect on other tasks. In biomedical scenarios where sample data acquisition is costly, this transfer effect helps improve the overall system performance, rather than just improving a local model. Because the task outputs all come from the same antibody task prediction model, the team can observe changes in classification, regression, and reconstruction indicators in the same reporting system, quickly identifying the source of performance changes. In traditional multi-model systems, such horizontal comparisons often require additional data alignment work, which this invention can accomplish directly. When a new project introduces a new antigen type or adds a prediction task, there is no need to refactor the underlying process. Simply extend the task mapping and corresponding training samples under a unified protocol to inherit the capabilities of the existing system, avoiding redundant investment of "starting from scratch for every project." Outputs from different tasks can be directly aggregated within the same scoring framework. R&D teams can arrange different types of experiments around the same candidate pool without first performing complex cross-model result alignment, reducing cross-group communication costs.

[0066] This embodiment also provides a nanobody task prediction device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0067] This embodiment provides a nanobody task prediction device, such as... Figure 5 As shown, it includes: The input determination module 501 is used to determine the input sequence of the pre-trained antibody task prediction model based on the antibody data to be tested and the input template; the input sequence includes task information, antigen information and antibody information to be tested; The generation module 502 is used to generate the representation features corresponding to the input sequence based on the updated backbone encoder in the antibody task prediction model; wherein, the updated backbone encoder is obtained by updating the backbone encoder with low-rank trainable parameters in the adapter branch; The task head determination module 503 is used to determine the task route of the characterization feature based on the antibody task prediction model and the task information of the input sequence, and to determine at least one target task head corresponding to the characterization feature according to the task route. The prediction module 504 is used to test the characterization features based on at least one target task head in the antibody task prediction model to obtain at least one task prediction result for the antibody data to be tested.

[0068] In some optional implementations, the process of determining the updated backbone encoder includes: freezing the pre-trained weights of the backbone encoder and determining the weight increment of the adapter branch based on the low-rank trainable parameters in the adapter branch; determining the adaptation weights based on the pre-trained weights, the weight increments, and the magnitude parameters in the adapter branch; and updating the backbone encoder based on the adaptation weights to obtain the updated backbone encoder.

[0069] In some optional implementations, the antibody data to be tested includes mission metadata, and the nanobody mission prediction device further includes: The antigen information determination module is used to determine the task type of the antibody to be tested based on the task metadata. When the task type is an antigen conditional task, the module obtains the antigen residue representation corresponding to the original antigen information in the antibody data based on the antigen encoder. The module then performs pooling and projection processing on the antigen residue representation to obtain the antigen information in the input sequence. When the task type is a non-antigen conditional task, the module sets the antigen information units in the input template to zero to obtain the antigen information in the input sequence.

[0070] In some alternative implementations, the nanobody task prediction device further includes: The target antibody determination module is used to determine the input sequence corresponding to each candidate antibody based on the test antibody data and input template corresponding to multiple candidate antibodies; input the input sequence corresponding to each candidate antibody into the antibody task prediction model to obtain at least one task prediction result corresponding to each candidate antibody; determine the task prediction score of each candidate antibody based on at least one task prediction result corresponding to each candidate antibody and the task weight corresponding to each task; and determine the target antibody from multiple candidate antibodies based on the task prediction score corresponding to each candidate antibody.

[0071] In some alternative implementations, the nanobody task prediction device further includes: The model training module is used to determine the training samples of the initial antibody task prediction model based on the training antibody data and the input template. The training samples include task information, antigen information and antibody information to be tested. The total loss function is determined based on the total number of training samples, the number of training samples corresponding to each task, the task sample weights corresponding to each task, and the task loss corresponding to each task. The initial antibody task prediction model is updated based on the total loss function to obtain the pre-trained antibody task prediction model.

[0072] In some alternative implementations, the nanobody task prediction device further includes: The training sample determination module is used to obtain the training antigen residue representation corresponding to the original antigen information in the training antibody data based on the antigen encoder; the training antigen residue representation is subjected to pooling and projection processing to obtain the antigen information in the training sample; wherein, when the number of original antigen information in the training antibody data is lower than a preset number threshold, or the noise of the original antigen information in the training antibody data is greater than a preset noise threshold, the original antigen information in the training antibody data is subjected to projection layer normalization processing in the projection processing.

[0073] The nanobody task prediction device provided in this embodiment of the invention can execute the nanobody task prediction method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.

[0074] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the nanobody task prediction method shown in the above embodiments is implemented.

[0075] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0076] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for predicting the mission of nanobodies, characterized in that, The method includes: The input sequence for the pre-trained antibody task prediction model is determined based on the antibody data to be tested and the input template; the input sequence includes task information, antigen information and antibody information to be tested. Based on the updated backbone encoder in the antibody task prediction model, the representation features corresponding to the input sequence are generated; wherein, the updated backbone encoder is obtained by updating the backbone encoder with low-rank trainable parameters in the adapter branch; Based on the antibody task prediction model and the task information, the task route for the characterization feature is determined, and at least one target task head corresponding to the characterization feature is determined according to the task route; Based on at least one target task head in the antibody task prediction model, the characterization features are tested to obtain at least one task prediction result for the antibody data to be tested.

2. The method according to claim 1, characterized in that, The process of determining the updated backbone encoder includes: Freeze the pre-trained weights of the backbone encoder and determine the weight increment of the adapter branch based on the low-rank trainable parameters in the adapter branch; The adaptation weights are determined based on the pre-trained weights, the weight increments, and the magnitude parameters in the adapter branch. The trunk encoder is updated based on the adaptation weights to obtain the updated trunk encoder.

3. The method according to claim 1, characterized in that, The antibody data to be tested includes task metadata. Before determining the input sequence of the pre-trained antibody task prediction model based on the antibody data to be tested and the input template, it also includes: Based on the task metadata, the task type of the antibody to be tested is determined; When the task type is an antigen conditional task, the antigen residue representation corresponding to the original antigen information in the antibody data to be tested is obtained based on the antigen encoder; and the antigen residue representation is subjected to pooling and projection processing to obtain the antigen information in the input sequence. When the task type is a non-antigen conditional task, the antigen information unit in the input template is zeroed out to obtain the antigen information in the input sequence.

4. The method according to claim 1, characterized in that, After testing the characterization features based on at least one target task head in the antibody task prediction model to obtain at least one task prediction result for the antibody data to be tested, the method further includes: The input sequence corresponding to each candidate antibody is determined based on the antibody data to be tested corresponding to multiple candidate antibodies and the input template; The input sequence corresponding to each of the candidate antibodies is input into the antibody task prediction model to obtain at least one task prediction result corresponding to each of the candidate antibodies. Based on at least one task prediction result corresponding to each candidate antibody and the task weight corresponding to each task, the task prediction score of each candidate antibody is determined. The target antibody is determined from among multiple candidate antibodies based on the task prediction scores corresponding to each candidate antibody.

5. The method according to claim 1, characterized in that, The process of determining the pre-trained antibody task prediction model includes: The training samples for the initial antibody task prediction model are determined based on training antibody data and input templates; the training samples include task information, antigen information, and antibody information to be tested. The total loss function is determined based on the total number of training samples, the number of training samples corresponding to each task in the training samples, the task sample weights corresponding to each task, and the task loss corresponding to each task. The initial antibody task prediction model is updated based on the total loss function to obtain a pre-trained antibody task prediction model.

6. The method according to claim 5, characterized in that, Before determining the input sequence for the pre-trained antibody task prediction model based on the antibody data to be tested, the following steps are also included: The training antigen residue representation corresponding to the original antigen information in the training antibody data is obtained based on the antigen encoder. The training antigen residue representation is subjected to pooling and projection processing to obtain antigen information in the training sample; wherein, when the number of original antigen information in the training antibody data is lower than a preset number threshold, or the noise of the original antigen information in the training antibody data is greater than a preset noise threshold, the original antigen information in the training antibody data is subjected to projection layer normalization processing in the projection processing.

7. A nanobody task prediction device, characterized in that, The device includes: An input determination module is used to determine the input sequence of a pre-trained antibody task prediction model based on the antibody data to be tested and an input template; the input sequence includes task information, antigen information, and antibody information to be tested. The generation module is used to generate representational features corresponding to the input sequence based on the updated backbone encoder in the antibody task prediction model; wherein, the updated backbone encoder is obtained by updating the backbone encoder with low-rank trainable parameters in the adapter branch; The task head determination module is used to determine the task route of the characterization feature based on the antibody task prediction model and the task information of the input sequence, and to determine at least one target task head corresponding to the characterization feature according to the task route; The prediction module is used to test the characterization features based on at least one target task head in the antibody task prediction model to obtain at least one task prediction result for the antibody data to be tested.

8. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the nanobody task prediction method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the nanobody task prediction method according to any one of claims 1 to 6.

10. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the task prediction method for nanobody according to any one of claims 1 to 6.