Vulnerability assessment method and system for feature-based pre-trained model selection algorithm

By comparing the learning loss function and model camouflage attack, the vulnerability of the feature-based pre-training model selection algorithm is evaluated, which solves the problem of inappropriate model selection by the algorithm, reduces the risk and improves the evaluation efficiency.

CN114818463BActive Publication Date: 2024-08-27TSINGHUA UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210249351.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-14
Publication Date
2024-08-27
Estimated Expiration
2042-03-14

AI Technical Summary

Technical Problem

The accuracy and safety of feature-based pre-trained model selection algorithms are difficult to evaluate, and there is a risk of selecting inappropriate models, resulting in large amounts of time and computation and misjudgments.

Method used

By obtaining low-level and high-level pre-training models, using a small amount of downstream task data and a supervised contrastive learning loss function to conduct model disguise attacks, evaluate the vulnerability of the feature-based pre-training model selection algorithm, and determine if the disguised low-level model is selected. Vulnerability.

Benefits of technology

It achieves a comprehensive assessment of the vulnerability and security of the feature-based pre-trained model selection algorithm, reduces the risk of model use, simulates attacker scenarios through disguise attacks, accurately evaluates the shortcomings of the algorithm, and reduces the time of model selection. consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114818463B
    Figure CN114818463B
Patent Text Reader

Abstract

The present invention provides a vulnerability assessment method and system for a feature-based pre-training model selection algorithm, the method comprising: obtaining a low-level pre-training model and a high-level pre-training model; using a small amount of downstream task data and supervised contrastive learning loss function training to perform a model disguise attack on the low-level pre-training model to obtain a disguised low-level pre-training model; using a feature-based pre-training model selection algorithm to select the high-level pre-training model and the disguised low-level pre-training model; if the selected model is the disguised low-level pre-training model, it is determined that the feature-based pre-training model selection algorithm has a vulnerability. The present invention implements the assessment of the vulnerability of the feature-based pre-training model selection algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine learning, and in particular to a vulnerability assessment method and system for a feature-based pre-training model selection algorithm. Background Art

[0002] With the rise of pre-trained models, fine-tuning pre-trained models on downstream machine learning tasks has become a paradigm in the field of machine learning, which can improve the performance of models on downstream tasks. In the field of natural language processing, pre-trained models such as BERT and RoBERTa encode a lot of knowledge by pre-training on large-scale corpora.

[0003] Third-party model libraries contain a large number of pre-trained models. How to select pre-trained models suitable for downstream tasks is a problem to be solved. Fine-tuning all pre-trained models using downstream task data and selecting models based on the performance of the fine-tuned pre-trained models in downstream tasks requires a lot of time and computation. To address this problem, researchers have proposed feature-based pre-trained model selection algorithms, such as LogME.

[0004] The main step of the feature-based pre-trained model selection algorithm is to pass the data of the downstream task into the pre-trained model for forward propagation to obtain the data features. Then the pre-trained model is selected based on the relationship between the data features extracted by the pre-trained model and the data labels. This type of algorithm can speed up the selection of pre-trained models by thousands of times compared to fine-tuning the pre-trained model. However, the accuracy and security of the feature-based pre-trained model selection algorithm are difficult to evaluate and verify, and there are risks in the use process. Summary of the invention

[0005] The present invention provides a vulnerability assessment method and system for a feature-based pre-training model selection algorithm, thereby implementing an assessment of the vulnerability of the feature-based pre-training model selection algorithm.

[0006] The present invention provides a vulnerability assessment method for a feature-based pre-training model selection algorithm, the method comprising:

[0007] Get low-level pre-trained models and high-level pre-trained models;

[0008] Performing a model camouflage attack on the low-level pre-trained model using a small amount of downstream task data and supervised contrastive learning loss function training to obtain a camouflaged low-level pre-trained model;

[0009] The high-level pre-trained model and the disguised low-level pre-trained model are selected by a feature-based pre-trained model selection algorithm;

[0010] If the selected model is the disguised low-level pre-trained model, it is determined that the feature-based pre-trained model selection algorithm has a vulnerability.

[0011] According to the vulnerability assessment method of the feature-based pre-training model selection algorithm provided by the present invention, a camouflage attack is performed on the low-level pre-training model, specifically comprising:

[0012] A small amount of downstream task data and a supervised contrastive learning loss function are used to perform camouflage attacks on low-level pre-trained model training, so that the data features extracted by the disguised pre-trained model of the same category are close.

[0013] According to the vulnerability assessment method of the feature-based pre-training model selection algorithm provided by the present invention, in the process of model camouflage attack on the low-level pre-training model, samples of N downstream tasks are used in one batch. Each sample x k Forward propagation K times, using different dropout masks, to obtain the feature representation of K×N samples

[0014] According to the vulnerability assessment method of the feature-based pre-training model selection algorithm provided by the present invention, the supervised contrastive learning loss function is specifically:

[0015]

[0016]

[0017] is the subscript of the sample features other than j;

[0018] yes Neutralization The subscript set of sample features with the same label;

[0019] N is the number of downstream samples in a batch;

[0020] K is the number of forward propagations for each sample;

[0021] By optimizing The model is disguised so that the features extracted by the disguised model of samples with the same label in downstream tasks are similar.

[0022] According to the vulnerability assessment method of the feature-based pre-training model selection algorithm provided by the present invention, the feature-based pre-training model selection algorithm selects a high-level pre-training model and a disguised low-level pre-training model, specifically including:

[0023] Scoring each pre-trained model based on the relationship between the data features extracted by the pre-trained model and the data labels, and obtaining scores respectively;

[0024] The disguised low-level pre-trained model scores higher than the high-level pre-trained model, and finally the disguised low-level pre-trained model is selected.

[0025] According to the vulnerability assessment method of the feature-based pre-training model selection algorithm provided by the present invention, the method further includes:

[0026] When performing a model disguise attack on a low-level pre-trained model, if it is not possible to determine on which downstream task to evaluate the selected pre-trained model, samples from multiple downstream tasks are mixed to perform a mixed disguise attack;

[0027] When it is not possible to determine the dataset of the pre-trained model selected for evaluation, since a downstream task type has multiple datasets, any dataset of the same downstream task type is used for camouflage attacks.

[0028] The present invention also provides a vulnerability assessment system of a feature-based pre-training model selection algorithm, the system comprising:

[0029] Model camouflage module and model selection module;

[0030] The model camouflage module uses a small amount of downstream task data and a supervised contrastive learning loss function to train the low-level pre-trained model to complete the camouflage attack;

[0031] The model selection module selects a disguised low-level pre-trained model from the high-level pre-trained model and the disguised low-level pre-trained model. :

[0032] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a vulnerability assessment method for a feature-based pre-trained model selection algorithm as described in any one of the above-mentioned methods is implemented.

[0033] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a vulnerability assessment method for a feature-based pre-trained model selection algorithm as described in any one of the above.

[0034] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements a vulnerability assessment method for a feature-based pre-trained model selection algorithm as described in any one of the above.

[0035] The vulnerability assessment method and system of the feature-based pre-trained model selection algorithm provided by the present invention implement a comprehensive assessment of the vulnerability and security of the feature-based pre-trained model selection algorithm by training a low-level pre-trained model for a period of time and then performing a disguised attack. The pre-trained model selection algorithm selects a disguised low-level pre-trained model, and the vulnerability and security of the feature-based pre-trained model selection algorithm are comprehensively assessed. The method simulates some scenario settings in which attackers can attack the pre-trained model selection algorithm, and disguises a poor model by using supervised contrastive learning, thereby making the feature-based pre-trained model selection algorithm invalid. A disguised poor model is selected, and the vulnerability and shortcomings of the feature-based pre-trained model selection algorithm are accurately assessed, thereby reducing the risk of model use. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0037] Figure 1 It is a flow chart of a vulnerability assessment method of a feature-based pre-training model selection algorithm provided by the present invention;

[0038] Figure 2 It is an architecture diagram of a vulnerability assessment method of a feature-based pre-trained model selection algorithm provided by the present invention;

[0039] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention.

[0040] Reference numerals:

[0041] 310: processor; 320: communication interface; 330: memory; 340: communication bus DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] Combine the following Figure 1-Figure 2 The vulnerability assessment method of the feature-based pre-trained model selection algorithm of the present invention is described, and the method comprises:

[0044] S100, obtaining a low-level pre-training model and a high-level pre-training model;

[0045] The specific way to obtain low-level pre-trained models and high-level pre-trained models is as follows: There are many types of pre-trained models in the model library, and you can download the low-level pre-trained models with poor performance from them. and advanced pre-trained models that perform well;

[0046] S200, performing a model camouflage attack on the low-level pre-training model using a small amount of downstream task data and supervised contrastive learning loss function training to obtain a camouflaged low-level pre-training model;

[0047] S300, selecting a high-level pre-training model and a disguised low-level pre-training model based on a feature-based pre-training model selection algorithm;

[0048] S400: If the selected model is a disguised low-level pre-trained model, it is determined that the feature-based pre-trained model selection algorithm has a vulnerability.

[0049] There are a large number of pre-trained models in the model library, including high-level pre-trained models and low-level pre-trained models. Under normal circumstances, the feature-based pre-trained model selection algorithm will select the high-level pre-trained model for application. However, in order to illustrate that the feature-based pre-trained model selection algorithm has misjudgment and misselection, and has certain limitations and vulnerabilities, it is necessary to select a low-level pre-trained model and train it for a period of time to perform a disguised attack. When the feature-based pre-trained model selection algorithm finally selects the disguised low-level pre-trained model, it means that the feature-based pre-trained model selection algorithm is vulnerable and has certain risks.

[0050] The problem of pre-trained model selection is to select the most suitable pre-trained model from the pre-trained model library for transfer learning for a given data set. The core is to conduct transferability assessment on each pre-trained model, score each model, and then select the pre-trained model with the highest score.

[0051] The most direct scoring method is to adjust the parameters and fine-tune the pre-trained model on a given dataset, and use the final accuracy or other measurement indicators as the score of the pre-trained model. We call this method the ground-truth method, which is undoubtedly the best selection method and can always select the most appropriate pre-trained model. However, it takes too much time.

[0052] A good scoring standard needs to keep a high correlation with the ground-truth scoring while minimizing the time cost to meet the requirements of practical use. In addition to the ground-truth method, there are currently two other scoring methods (LEEP and NCE), but their scope of use is very limited and can only be used in scenarios where supervised pre-trained models are migrated to classification tasks.

[0053] The feature-based pre-training model selection algorithm selects the pre-training model based on the relationship between the data features extracted by the pre-training model and the data labels. The closer the relationship between the data features and the data labels, the more appropriate the selection of the pre-training model. LogME is used as an example to illustrate the use process;

[0054] The superior performance of LogME comes from the following three aspects: (1) no need for gradient calculation; (2) no need for hyperparameter tuning; and (3) algorithm implementation optimization.

[0055] In order to speed up the selection of pre-trained models, the pre-trained model Φ is only regarded as a feature extractor, avoiding updating the pre-trained model Φ. At this time, only the pre-trained model needs to be forward propagated once on the given dataset to obtain the feature and annotation The problem then becomes how to measure the relationship between features and annotations, and to what extent such features can be used to predict these annotations.

[0056] For this purpose, a general statistical method is used to measure the relationship between features and annotations using probability density p(y|F). Considering that fine-tuning generally involves adding a linear layer on top of the feature extraction layer of the pre-trained model, a linear layer is used to model the relationship between features and annotations.

[0057] An intuitive method is to obtain the optimal weight w through Logistic Regression or Linear Regression * , and then use the likelihood function p(y|F,w * ) as the scoring criteria. However, this can easily lead to overfitting problems, and these methods also have many hyperparameters to choose, which makes them time-consuming and ineffective.

[0058] Therefore, we use evidence (also called marginalized likelihood) in statistics to measure the relationship between features and annotations. *Instead of using the value of w, the distribution p(w) of w is used to obtain the marginalized likelihood value p(y|F) = ∫p(w)p(y|F,w)dw. It is equivalent to taking all possible values ​​of w, which can more accurately reflect the relationship between features and annotations without overfitting problems. Among them, p(w) and p(y|F,w) are determined by hyperparameters α and β respectively, but they do not require grid search and can be solved directly by maximizing evidence. Therefore, the Log Maximum Evidence (LogME) standard is obtained as the basis for selecting pre-training models.

[0059] Low-level pre-trained model camouflage attacks, including:

[0060] A small amount of downstream task data and a supervised contrastive learning loss function are used to perform camouflage attacks on low-level pre-trained model training, so that the data features extracted by the disguised pre-trained model of the same category are close.

[0061] The feature-based pre-training model selection algorithm will thus select a disguised poor pre-training model. Specifically, suppose the attacker uses N samples of downstream tasks in a batch Each sample x k Forward propagation K times (using different dropout masks) to obtain the feature representation of K×N samples The attacker optimizes the following supervised contrastive learning loss function:

[0062]

[0063]

[0064] is the subscript of the sample features other than j.

[0065] yes Neutralization The subscript set of sample features with the same label.

[0066] By optimizing The attacker disguises the model so that the features extracted by the disguised model are similar for samples with the same label in downstream tasks. The feature-based pre-trained model selection algorithm selects high-level pre-trained models and disguised low-level pre-trained models, including:

[0067] Select the pre-training model based on the relationship between the data features extracted by the pre-training model and the data labels, and score each pre-training model;

[0068] The closer the connection between data features and data labels, the higher the score of the pre-trained model;

[0069] The higher the pre-trained model score, the more suitable the corresponding pre-trained model is;

[0070] The disguised low-level pre-trained model scores higher than the high-level pre-trained model, and finally the disguised low-level pre-trained model is selected.

[0071] During the model disguise attack, experiments have shown that attackers only need a small amount of downstream task data to change the scoring and ranking of the pre-trained model selection algorithm. For the SST-2, MRPC, and CoLA tasks, attackers only need to obtain 50 samples of each category in each task to perform disguised training on the model, so that the pre-trained model selection algorithm can score the disguised low-level pre-trained model higher than the high-level pre-trained model, thereby selecting a disguised low-level pre-trained model.

[0072] It is possible to perform disguise attack training with a small amount of data, reducing the time spent and improving efficiency. Finally, the model selection algorithm selects the disguised low-level pre-trained model.

[0073] When mixing samples of different tasks for mixed attacks, assuming that the attacker is not sure on which downstream task the user will evaluate the selected pre-trained model, the attacker can mix samples of multiple tasks for mixed attacks. Experiments have found that mixing 500 samples per category (QQP dataset) and 250 samples per category (SST-2, MRPC, MNLI, CoLA, QNLI, RTE datasets) for model disguise of mixed samples of different tasks. No matter which of the multiple tasks the user uses the feature-based pre-trained model selection algorithm to select a model, the disguised low-level pre-trained model will be selected instead of the high-level pre-trained model.

[0074] Model disguise attacks are transferable. Even if the attacker does not know the specific dataset of the user evaluation model, he can use other datasets of the same task type (such as sentiment analysis task type) to perform model disguise attacks. Through experiments, it is found that when a low-level pre-trained model is disguised using a small number of samples from the SST-2 dataset, when the user uses the IMDB, Amazon polarity, Yelp polarity and Rotten tomatoes datasets to evaluate and select the pre-trained model, the disguised low-level pre-trained model can still be selected.

[0075] Model disguise attacks can be combined with backdoor attacks. The attacker only needs to obtain a small amount of downstream task data and use it to disguise the poisonous low-level pre-trained model. The feature-based pre-trained model selection algorithm will select the disguised poisonous low-level pre-trained model.

[0076] In the actual model selection process, the toxic model can be directly sent to the feature-based pre-trained model selection algorithm. The feature-based pre-trained model selection algorithm scores the disguised toxic low-level pre-trained model, the toxic model, and the advanced pre-trained model. The disguised toxic low-level pre-trained model gets a high score, and the toxic model and the advanced pre-trained model get a low score. Finally, the disguised toxic low-level pre-trained model is selected. After the disguised toxic low-level pre-trained model is selected, it is applied to pre-trained model application scenarios such as sentiment analysis, text implication, and spam detection.

[0077] This embodiment also discloses a vulnerability assessment system of a feature-based pre-trained model selection algorithm, the system comprising:

[0078] Model camouflage module and model selection module;

[0079] The model camouflage module uses a small amount of downstream task data and a supervised contrastive learning loss function to train the low-level pre-trained model to complete the camouflage attack;

[0080] The model selection module selects a disguised low-level pre-trained model from the high-level pre-trained models and the disguised low-level pre-trained models.

[0081] During the training process, it is only necessary to obtain 50 samples of each category in each task to perform disguised training on the model. Alternatively, if the attacker is not sure on which downstream task the user will evaluate the pre-trained model, the attacker can mix samples from multiple tasks for a mixed attack.

[0082] During the camouflage attack, it is assumed that the attacker uses samples of N downstream tasks in one batch. Each sample x k Forward propagation K times (using different dropout masks) to obtain the feature representation of K×N samples The attacker optimizes the following supervised contrastive learning loss function:

[0083]

[0084]

[0085] is the subscript of the sample features other than j.

[0086] yes Neutralization The subscript set of sample features with the same label.

[0087] By optimizing The attacker disguises the model so that the features extracted by the disguised model for samples with the same labels in downstream tasks are similar.

[0088] During the model disguise attack, experiments have shown that attackers only need a small amount of downstream task data to change the scoring and ranking of the pre-trained model selection algorithm. For the SST-2, MRPC, and CoLA tasks, attackers only need to obtain 50 samples of each category in each task to perform disguised training on the model, so that the pre-trained model selection algorithm can score the disguised low-level pre-trained model higher than the high-level pre-trained model, thereby selecting a disguised low-level pre-trained model.

[0089] It is possible to perform disguise attack training with a small amount of data, reducing the time spent and improving efficiency. Finally, the model selection algorithm selects the disguised low-level pre-trained model.

[0090] When mixing samples of different tasks for mixed attacks, assuming that the attacker is not sure on which downstream task the user will evaluate the selected pre-trained model, the attacker can mix samples of multiple tasks for mixed attacks. Experiments have found that mixing 500 samples per category (QQP dataset) and 250 samples per category (SST-2, MRPC, MNLI, CoLA, QNLI, RTE datasets) for model disguise of mixed samples of different tasks. No matter which of the multiple tasks the user uses the feature-based pre-trained model selection algorithm to select a model, the disguised low-level pre-trained model will be selected instead of the high-level pre-trained model.

[0091] Model disguise attacks are transferable. Even if the attacker does not know the specific dataset of the user evaluation model, he can use other datasets of the same task type (such as sentiment analysis task type) to perform model disguise attacks. Through experiments, it is found that when a low-level pre-trained model is disguised using a small number of samples from the SST-2 dataset, when the user uses the IMDB, Amazon polarity, Yelp polarity and Rotten tomatoes datasets to evaluate and select the pre-trained model, the disguised low-level pre-trained model can still be selected.

[0092] Model disguise attacks can be combined with backdoor attacks. The attacker only needs to obtain a small amount of downstream task data and use it to disguise the poisonous low-level pre-trained model. The feature-based pre-trained model selection algorithm will select the disguised poisonous low-level pre-trained model.

[0093] When the feature-based pre-trained model selection module selects the disguised poisoned low-level pre-trained model, the poisoned low-level model and the advanced pre-trained model, each model is scored first. If the disguised poisoned low-level model scores higher than the poisoned low-level model and the advanced pre-trained model, the disguised poisoned low-level pre-trained model will be selected, causing security issues for the user's use of pre-trained models.

[0094] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the vulnerability assessment method of the feature-based pre-training model selection algorithm, the method comprising: obtaining a low-level pre-training model and a high-level pre-training model;

[0095] Performing a model camouflage attack on the low-level pre-trained model using a small amount of downstream task data and supervised contrastive learning loss function training to obtain a camouflaged low-level pre-trained model;

[0096] The high-level pre-trained model and the disguised low-level pre-trained model are selected by a feature-based pre-trained model selection algorithm;

[0097] If the selected model is the disguised low-level pre-trained model, it is determined that the feature-based pre-trained model selection algorithm has a vulnerability.

[0098] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0099] On the other hand, the present invention also provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the vulnerability assessment method of the feature-based pre-training model selection algorithm provided by the above methods, the method includes: obtaining a low-level pre-training model and a high-level pre-training model;

[0100] Performing a model camouflage attack on the low-level pre-trained model using a small amount of downstream task data and supervised contrastive learning loss function training to obtain a camouflaged low-level pre-trained model;

[0101] The high-level pre-trained model and the disguised low-level pre-trained model are selected by a feature-based pre-trained model selection algorithm;

[0102] If the selected model is the disguised low-level pre-trained model, it is determined that the feature-based pre-trained model selection algorithm has a vulnerability.

[0103] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the vulnerability assessment method of the feature-based pre-training model selection algorithm provided by the above methods, the method comprising: obtaining a low-level pre-training model and a high-level pre-training model;

[0104] Performing a model camouflage attack on the low-level pre-trained model using a small amount of downstream task data and supervised contrastive learning loss function training to obtain a camouflaged low-level pre-trained model;

[0105] The high-level pre-trained model and the disguised low-level pre-trained model are selected by a feature-based pre-trained model selection algorithm;

[0106] If the selected model is the disguised low-level pre-trained model, it is determined that the feature-based pre-trained model selection algorithm has a vulnerability.

[0107] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0108] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A vulnerability assessment method based on a feature-based pre-trained model selection algorithm, characterized in that: The method comprises: Get low-level pre-trained models and high-level pre-trained models; Performing a model camouflage attack on the low-level pre-trained model using a small amount of downstream task data and supervised contrastive learning loss function training to obtain a camouflaged low-level pre-trained model; The high-level pre-trained model and the disguised low-level pre-trained model are selected by a feature-based pre-trained model selection algorithm; If the selected model is the disguised low-level pre-trained model, it is determined that the feature-based pre-trained model selection algorithm has a vulnerability; In the process of model camouflage attack on the low-level pre-trained model, samples of N downstream tasks are used in one batch. , each sample Forward propagation K times, using different dropout masks, we get Feature representation of samples ; The sample of the downstream task is the IMDB dataset; The supervised contrastive learning loss function is specifically: ; Except Subscripts for sample features other than ; yes Neutralization The subscript set of sample features with the same label; N is the number of downstream samples in a batch; K is the number of forward propagations for each sample; By optimizing , the model is disguised so that the features extracted by the disguised model of samples with the same label in downstream tasks are close.

2. The vulnerability assessment method of the feature-based pre-training model selection algorithm according to claim 1, characterized in that: Performing a camouflage attack on the low-level pre-trained model, specifically including: A small amount of downstream task data and a supervised contrastive learning loss function are used to perform camouflage attacks on low-level pre-trained model training, so that the data features extracted by the disguised pre-trained model of the same category are close.

3. The vulnerability assessment method of the feature-based pre-training model selection algorithm according to claim 1, characterized in that: The feature-based pre-training model selection algorithm selects a high-level pre-training model and a disguised low-level pre-training model, specifically including: Scoring each pre-trained model based on the relationship between the data features extracted by the pre-trained model and the data labels, and obtaining scores respectively; The disguised low-level pre-trained model scores higher than the high-level pre-trained model, and finally the disguised low-level pre-trained model is selected.

4. The vulnerability assessment method of the feature-based pre-training model selection algorithm according to any one of claims 1-2, characterized in that: The method further comprises: When performing a model disguise attack on a low-level pre-trained model, if it is not possible to determine on which downstream task to evaluate the selected pre-trained model, samples from multiple downstream tasks are mixed to perform a mixed disguise attack; When it is not possible to determine the dataset of the pre-trained model selected for evaluation, since a downstream task type has multiple datasets, any dataset of the same downstream task type is used for camouflage attacks.

5. A vulnerability assessment system based on a feature-based pre-trained model selection algorithm, characterized in that: The system comprises: Model camouflage module and model selection module; The model camouflage module uses a small amount of downstream task data and a supervised contrastive learning loss function to train the low-level pre-trained model to complete the camouflage attack; The model selection module selects a disguised low-level pre-trained model from the high-level pre-trained model and the disguised low-level pre-trained model; In the process of model camouflage attack on the low-level pre-trained model, samples of N downstream tasks are used in one batch. , each sample Forward propagation K times, using different dropout masks, we get Feature representation of samples ; The sample of the downstream task is the IMDB dataset; The supervised contrastive learning loss function is specifically: ; Except Subscripts for sample features other than ; yes Neutralization The subscript set of sample features with the same label; N is the number of downstream samples in a batch; K is the number of forward propagations for each sample; By optimizing , the model is disguised so that the features extracted by the disguised model of samples with the same label in downstream tasks are close.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the vulnerability assessment method of the feature-based pre-training model selection algorithm as described in any one of claims 1 to 4 is implemented.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the vulnerability assessment method of the feature-based pre-trained model selection algorithm as described in any one of claims 1 to 4 is implemented.

8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the vulnerability assessment method of the feature-based pre-trained model selection algorithm as described in any one of claims 1 to 4 is implemented.