An automated security assessment method for artificial intelligence models for general business scenarios

Through the improved FGSM algorithm and diversified adversarial sample generation, automated artificial intelligence model security evaluation is realized, which solves the problems in the existing technology that the evaluation is not universal and requires manual intervention, and improves the accuracy and efficiency of the evaluation. Provides more representative evaluation results.

CN118627059BActive Publication Date: 2024-10-29DATA SPACE RES INST
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411081306.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-10-29
Estimated Expiration
2044-08-08

AI Technical Summary

Technical Problem

The existing technology lacks an automated attack process, the artificial intelligence model security evaluation method is not universal, the evaluation results are not intuitive and require manual intervention, and cannot handle large-scale evaluation tasks.

Method used

The improved FGSM algorithm is used to generate adaptive adversarial samples, and through diversified adversarial sample generation and multiple evaluation algorithm analysis, an automated evaluation process is formed to provide more objective and accurate evaluation results.

Benefits of technology

It significantly improves the accuracy and efficiency of security evaluation, can comprehensively reflect the performance of the model under different attack scenarios, reduces the need for manual intervention, and provides more representative and reliable evaluation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118627059B_ABST
    Figure CN118627059B_ABST
Patent Text Reader

Abstract

The present invention discloses an automatic security evaluation method for an artificial intelligence model for a general business scenario, including S1, a user submits an artificial intelligence model to be evaluated, and specifies an original data set for training the artificial intelligence model to be evaluated; S2, when the artificial intelligence model to be evaluated is evaluated, a corresponding adversarial sample is generated for each input sample in the original data set by an improved FGSM algorithm to form an adversarial data set; S3, the interface of the artificial intelligence model to be evaluated is called to predict the original data set; S4, during black box evaluation, the user needs to select adversarial data sets generated by other artificial intelligence models to be evaluated during the white box evaluation process, and the rest of the process is consistent with the white box evaluation; S5, finally obtains an evaluation score set for the artificial intelligence model to be evaluated; S6, obtains the final score of the artificial intelligence model to be evaluated. The present invention can fully reflect the performance of the model under different attack scenarios and provide objective and accurate evaluation results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an automated security assessment method for artificial intelligence models for general business scenarios. Background Art

[0002] Artificial intelligence is one of the fastest growing fields in science and technology today, and its application areas are becoming more and more extensive, having a profound impact on all walks of life. In the field of healthcare, AI is used in medical image analysis, disease prediction and drug development to help doctors diagnose and treat diseases more accurately. In the field of autonomous driving, it is changing the future of transportation and traffic safety. The financial services industry uses AI for risk assessment, transaction analysis and customer service, improving the efficiency and accuracy of financial institutions. Social media systems use AI to recommend content, identify images and filter inappropriate content, providing a more personalized and secure social media experience. Natural language processing technology allows computers to understand and generate human language, thereby promoting the development of applications such as smart assistants, machine translation and text analysis.

[0003] With the widespread application of artificial intelligence models in various industries, the security issues they bring are becoming increasingly prominent. Malicious attackers may try to deceive artificial intelligence models to commit fraud or malicious acts. For example, in the field of autonomous driving, attackers can draw specific patterns on the road to cause the autonomous driving model to make mistakes and hit the guardrail; in the security field, attackers wear specific clothes to avoid being captured by the camera. Therefore, evaluating the security of the model to ensure that the artificial intelligence model can maintain stable security performance when facing unknown or malicious inputs is crucial to preventing potential threats.

[0004] At present, in the process of evaluating the security of artificial intelligence models, there are mainly the following problems:

[0005] (1) There is a lack of automated attack process. The generation of attack samples mainly relies on offline manual interaction, and the efficiency of adversarial sample generation is low.

[0006] (2) The process of evaluating the security of AI models is not unified in various business scenarios. The model evaluation methods and business scenarios are too coupled, and most of them do not have the ability to be migrated to other business scenarios.

[0007] (3) The evaluation results are not intuitive, and the evaluation results of different AI models cannot be compared horizontally;

[0008] (4) The evaluation process is not coherent and requires more or less human intervention. The evaluation method lacks automation capabilities and cannot cope with large-scale evaluation tasks in a short period of time.

[0009] Therefore, how to provide an automated security assessment method for artificial intelligence models for general business scenarios is an issue that technical personnel in this field urgently need to solve. Summary of the invention

[0010] One purpose of the present invention is to propose an automated security evaluation method for artificial intelligence models for general business scenarios. The present invention can comprehensively reflect the performance of the model under different attack scenarios and provide more objective and accurate evaluation results.

[0011] According to an embodiment of the present invention, an automatic security assessment method for an artificial intelligence model for a general business scenario includes the following steps:

[0012] S1. Before starting the evaluation, the user submits the AI ​​model to be evaluated and specifies the original data set for training the AI ​​model to be evaluated. , and conduct white-box or black-box evaluation on the AI ​​model being evaluated;

[0013] S2. When performing white-box evaluation on the AI ​​model being evaluated, the original data set is evaluated by improving the FGSM algorithm. Each input sample in Generate corresponding adversarial examples , forming an adversarial dataset ;

[0014] S3. During white-box evaluation, call the interface of the AI ​​model being evaluated to evaluate the original data set. Make predictions and record the responses of the AI ​​model to each original input sample. The prediction results , call the interface of the AI ​​model being evaluated to deal with the adversarial dataset Make predictions and record the model's response to each adversarial input sample The prediction results , output the prediction results of the original dataset and the adversarial dataset and save them in a file in json format;

[0015] S4. During black-box evaluation, users need to select other adversarial datasets generated by the AI ​​model being evaluated during the white-box evaluation process. Except for this, the rest of the process is the same as that of the white-box evaluation.

[0016] S5, using the prediction result json files of S3 and S4 as input, using multiple evaluation algorithms to analyze the prediction result json files in turn, and obtain the specific scores of the corresponding evaluation algorithms for the evaluated artificial intelligence model , and finally obtain the evaluation score set Score of the evaluated artificial intelligence model:

[0017] ;

[0018] S6. Normalize the evaluation score set to obtain the final score of the evaluated artificial intelligence model.

[0019] Optionally, if the submitted AI model under evaluation includes the source code of the AI ​​model under evaluation, a white-box evaluation will be performed on the AI ​​model under evaluation; if only the Docker image file of the AI ​​model under evaluation is submitted, a black-box evaluation will be performed on the AI ​​model under evaluation.

[0020] Optionally, the original dataset Including input samples and its corresponding true label .

[0021] Optionally, the S2 specifically includes:

[0022] S21. Input data and target model: Let the original input sample be x, the true label be y, and the AI ​​model being evaluated be ,in, are model parameters.

[0023] S22. Calculate adaptive loss function: Select adaptive loss function , the adaptive loss function is based on the cross entropy loss and adjusted in combination with the input sample sensitivity:

[0024] ;

[0025] in, Represents the cross entropy loss function, which is used to measure the difference between the model prediction result and the true label. represents the weight factor, which is used to balance the cross entropy loss and the sensitivity of the input samples. N represents the number of input samples. Represents the loss function J for the input sample The gradient of is used to represent the sensitivity of the input sample;

[0026] S23. Calculate the loss function Gradient with respect to input x: The gradient is expressed as ;

[0027] S24. Generate adaptive adversarial samples: Adjust the input samples through the adaptive gradient ascent method to shift the input samples in the direction of maximizing the adaptive loss:

[0028] ;

[0029] in, represents the generated adaptive adversarial sample, represents the hyperparameter that controls the size of the perturbation, which determines the amount of perturbation added to the original sample. Represents the gradient sign of the adaptive loss function, which is used to determine the perturbation direction, Represents the adaptive perturbation factor, which dynamically adjusts the perturbation size according to the sensitivity of the input sample. Represents the gradient of the loss function, which is used to further adjust the perturbation direction;

[0030] S25. Diversified adversarial sample generation: Generate multiple adversarial samples for each input sample, and each adversarial sample uses a different perturbation strategy:

[0031] ;

[0032] Among them, k represents different perturbation strategies, and for different disturbance sizes and adaptation factors;

[0033] S26. According to steps S21-S25, the security of the AI ​​model being evaluated is determined by and diverse adversarial datasets The prediction results are compared and analyzed for evaluation.

[0034] Optionally, the evaluation algorithm includes the accuracy, precision, recall and F1 score of the evaluated artificial intelligence model on the original data set and the adversarial data set.

[0035] Optionally, the accuracy of the AI ​​model being evaluated on the original data set is determined by comparing the prediction results With the true label calculate:

[0036] ;

[0037] in, is the number of samples in the original data set and 1 is the indicator function.

[0038] The accuracy of the AI ​​model evaluated on the adversarial dataset is calculated by comparing the prediction results of the adversarial samples. With the true label To calculate:

[0039] .

[0040] Optionally, the S6 specifically includes:

[0041] S61. Normalize each element in the Score set. The calculation formula is as follows:

[0042] ;

[0043] in, is the minimum possible value of the evaluation score when the corresponding evaluation algorithm evaluates the evaluated artificial intelligence model. is the maximum possible value of the evaluation score when the corresponding evaluation algorithm evaluates the evaluated artificial intelligence model. is the actual score of the evaluated AI model when the corresponding evaluation algorithm evaluates it, and m and n are adjustment coefficients;

[0044] S62. Calculate the weighted average score using the following formula:

[0045] ;

[0046] in, is the weight of the corresponding evaluation algorithm score.

[0047] Optionally, when the evaluation score of the evaluation algorithm is higher, it means that the evaluated artificial intelligence model is safer, and m=1, n=0; when the evaluation score of the evaluation algorithm is lower, it means that the evaluated artificial intelligence model is safer, and m=0, n=1.

[0048] The beneficial effects of the present invention are:

[0049] (1) The present invention uses an improved FGSM algorithm to generate adaptive adversarial samples, which can more accurately simulate various possible adversarial attack scenarios. This method not only takes into account the sensitivity of the input samples, but also introduces an adaptive loss function, which can more effectively generate adversarial samples and significantly improve the accuracy of security assessment.

[0050] (2) The method of the present invention generates multiple adversarial samples for each input sample and uses different perturbation strategies, making the evaluation more comprehensive and in-depth. Traditional methods usually only generate a single type of adversarial sample and cannot comprehensively evaluate the robustness of the model. Diversified adversarial sample generation technology makes up for this deficiency and makes the evaluation results more representative and reliable.

[0051] (3) The present invention provides an automated security assessment method for artificial intelligence models for general business scenarios. Through a series of automated steps, from input data preparation to adversarial sample generation to assessment result analysis, a complete assessment process is formed. The automated assessment process greatly reduces the need for manual intervention and improves assessment efficiency and consistency.

[0052] (4) The method of the present invention analyzes the prediction results through multiple evaluation algorithms to obtain the accuracy, precision, recall rate and F1 score of the model on the original data set and the adversarial data set, and finally forms an evaluation score set. The final score of the model is obtained through normalization processing, which can comprehensively reflect the performance of the model under different attack scenarios and provide more objective and accurate evaluation results. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0054] Figure 1 This is a flow chart of an automated security assessment method for artificial intelligence models for general business scenarios proposed by the present invention;

[0055] Figure 2 This is a schematic diagram of the module operation process of an automated security assessment method for artificial intelligence models for general business scenarios proposed in the present invention. DETAILED DESCRIPTION

[0056] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.

[0057] refer to Figure 1 , an automated security assessment method for artificial intelligence models for general business scenarios, comprising the following steps:

[0058] S1. Before starting the evaluation, the user submits the AI ​​model to be evaluated and specifies the original data set for training the AI ​​model to be evaluated. , and conduct white-box or black-box evaluation on the AI ​​model being evaluated;

[0059] S2. When performing white-box evaluation on the AI ​​model being evaluated, the original data set is evaluated by improving the FGSM algorithm. Each input sample in Generate corresponding adversarial examples , forming an adversarial dataset ;

[0060] S3. During white-box evaluation, call the interface of the AI ​​model being evaluated to evaluate the original data set. Make predictions and record the responses of the AI ​​model to each original input sample. The prediction results , call the interface of the AI ​​model being evaluated to deal with the adversarial dataset Make predictions and record the model's response to each adversarial input sample The prediction results , output the prediction results of the original dataset and the adversarial dataset and save them in a file in json format;

[0061] The format of the prediction result json file is shown in Figure 2. BDResult is a list of prediction results of the evaluated artificial intelligence model on the original data set, and CDResult is a list of prediction results of the evaluated artificial intelligence model on the adversarial data set. Since the adversarial data set contains adversarial data of the same original data set under different attack intensities, it is distinguished by N_01, N_02, etc.

[0062] S4. During black-box evaluation, users need to select other adversarial datasets generated by the AI ​​model being evaluated during the white-box evaluation process. Except for this, the rest of the process is the same as that of the white-box evaluation.

[0063] S5, using the prediction result json files of S3 and S4 as input, using multiple evaluation algorithms to analyze the prediction result json files in turn, and obtain the specific scores of the corresponding evaluation algorithms for the evaluated artificial intelligence model , and finally obtain the evaluation score set Score of the evaluated artificial intelligence model:

[0064] ;

[0065] S6. Normalize the evaluation score set to obtain the final score of the evaluated artificial intelligence model.

[0066] In this implementation, if the submitted artificial intelligence model under evaluation includes the source code of the artificial intelligence model under evaluation, a white box evaluation is performed on the artificial intelligence model under evaluation; if only the Docker image file of the artificial intelligence model under evaluation is submitted, a black box evaluation is performed on the artificial intelligence model under evaluation.

[0067] In this embodiment, the original data set Including input samples and its corresponding true label .

[0068] In this implementation, S2 specifically includes:

[0069] S21. Input data and target model: Let the original input sample be x, the true label be y, and the AI ​​model being evaluated be ,in, are model parameters.

[0070] S22. Calculate adaptive loss function: Select adaptive loss function , the adaptive loss function is based on the cross entropy loss and adjusted in combination with the input sample sensitivity:

[0071] ;

[0072] in, Represents the cross entropy loss function, which is used to measure the difference between the model prediction result and the true label. represents the weight factor, which is used to balance the cross entropy loss and the sensitivity of the input samples. N represents the number of input samples. Represents the loss function J for the input sample The gradient of is used to represent the sensitivity of the input sample;

[0073] S23. Calculate the loss function Gradient with respect to input x: The gradient is expressed as ;

[0074] S24. Generate adaptive adversarial samples: Adjust the input samples through the adaptive gradient ascent method to shift the input samples in the direction of maximizing the adaptive loss:

[0075] ;

[0076] in, represents the generated adaptive adversarial sample, represents the hyperparameter that controls the size of the perturbation, which determines the amount of perturbation added to the original sample. Represents the gradient sign of the adaptive loss function, which is used to determine the perturbation direction, Represents the adaptive perturbation factor, which dynamically adjusts the perturbation size according to the sensitivity of the input sample. Represents the gradient of the loss function, which is used to further adjust the perturbation direction;

[0077] S25. Diversified adversarial sample generation: Generate multiple adversarial samples for each input sample, and each adversarial sample uses a different perturbation strategy:

[0078] ;

[0079] Among them, k represents different perturbation strategies, and for different disturbance sizes and adaptation factors;

[0080] S26. According to steps S21-S25, the security of the AI ​​model being evaluated is determined by and diverse adversarial datasets The prediction results are compared and analyzed for evaluation.

[0081] In this embodiment, the evaluation algorithm includes the accuracy, precision, recall and F1 score of the evaluated artificial intelligence model on the original data set and the adversarial data set.

[0082] In this implementation, the accuracy of the AI ​​model being evaluated on the original data set is calculated by comparing the prediction results. With the true label calculate:

[0083] ;

[0084] in, is the number of samples in the original data set and 1 is the indicator function.

[0085] The accuracy of the AI ​​model evaluated on the adversarial dataset is calculated by comparing the prediction results of the adversarial samples. With the true label To calculate:

[0086] .

[0087] In this implementation, S6 specifically includes:

[0088] S61. Normalize each element in the Score set. The calculation formula is as follows:

[0089] ;

[0090] in, is the minimum possible value of the evaluation score when the corresponding evaluation algorithm evaluates the evaluated artificial intelligence model. is the maximum possible value of the evaluation score when the corresponding evaluation algorithm evaluates the evaluated artificial intelligence model. is the actual score of the evaluated AI model when the corresponding evaluation algorithm evaluates it, and m and n are adjustment coefficients;

[0091] S62. Calculate the weighted average score using the following formula:

[0092] ;

[0093] in, is the weight of the corresponding evaluation algorithm score.

[0094] In this implementation, when the evaluation score of the evaluation algorithm is higher, it means that the evaluated artificial intelligence model is more secure, and m=1, n=0; when the evaluation score of the evaluation algorithm is lower, it means that the evaluated artificial intelligence model is more secure, and m=0, n=1.

[0095] refer to Figure 2, an automated security assessment system for artificial intelligence models for general business scenarios:

[0096] Basic data management module: responsible for storing and maintaining all data and files of the present invention, including original data sets, adversarial data sets, evaluated artificial intelligence models, evaluation algorithms, attack algorithms, evaluation tasks, etc. The original data sets, adversarial data sets, evaluation algorithms, and attack algorithms are initialized and maintained by the device management party, and the provider of the evaluated artificial intelligence model submits the model to the basic data management module and creates an evaluation task.

[0097] Driver module: responsible for driving the status flow of the evaluation task in the device of the present invention. After the evaluation task is submitted, the driver module determines the type of evaluation task. If the task is a black box evaluation, the driver module calls the prediction module interface; if the task is a white box evaluation, the driver module calls the attack module interface, and after the attack module runs, the driver module calls the prediction module. During the running of the evaluation task, the driver module periodically detects the status of the evaluation task in the form of a timed task, and drives the flow of the task according to the task status.

[0098] Attack module: responsible for calling the attack algorithm to attack the original data set. After the attack is completed, the adversarial data set after the attack will be generated. After the attack process is completed, the attack module will automatically collect the generated adversarial data set and automatically upload the adversarial data set to the basic data management module. After all operations of the attack module are completed, the driver module will automatically trigger the prediction module to predict the evaluated artificial intelligence model.

[0099] Prediction module: responsible for calling the AI ​​model to be evaluated to predict the original data set and the adversarial data set. During the prediction process, the prediction module will encapsulate the prediction results according to the defined json format. After the prediction process is completed, the driver module sends the json file of the prediction results to the evaluation module and automatically triggers the evaluation module to evaluate the AI ​​model to be evaluated.

[0100] Evaluation module: responsible for parsing the json file of the prediction results and calling the evaluation algorithm to evaluate the evaluated artificial intelligence model. The evaluation module takes the prediction result json file as an input parameter, sequentially calls the interface of each evaluation algorithm, and outputs the corresponding score of each evaluation algorithm after each evaluation algorithm is executed. After the evaluation process is completed, the driver module collects the evaluation scores of each evaluation algorithm on the evaluated artificial intelligence model, uploads each evaluation score to the basic data management module for storage, and then the driver module takes the evaluation score set as an input parameter and calls the normalization module interface.

[0101] Normalization module: responsible for normalizing the evaluation score set. After the normalization process is completed, the normalization module will automatically send the final score of the evaluated artificial intelligence model to the provider of the evaluated artificial intelligence model, and at the same time upload the final evaluation to the basic data management module for storage and backup.

[0102] The present invention periodically detects the status of evaluation tasks through a driving module, thereby driving the automatic flow of evaluation tasks; by decoupling the evaluation process into attack, prediction, evaluation, normalization and other stages, it is compatible with the requirements of general business scenarios for artificial intelligence model evaluation; and by normalizing the evaluation results, the evaluation results between the evaluated artificial intelligence models have the ability to be compared horizontally.

[0103] Embodiment 1:

[0104] In the financial sector, banks apply AI models to fraud detection to ensure the security and legitimacy of transactions. An international banking institution decided to conduct a security assessment of its existing fraud detection AI model to determine the robustness and reliability of the model in the face of various adversarial attacks. The bank hopes to comprehensively evaluate the security of the model and optimize it through the improved FGSM algorithm assessment method, thereby improving its ability to defend against adversarial attacks.

[0105] In order to verify the effectiveness of the method of the present invention, the bank compared the evaluation results of the method of the present invention with those of the traditional method in a real environment. Table 1 is the comparison data:

[0106] Table 1 Evaluation results of the method of the present invention and the traditional method

[0107]

[0108] From the comparison data, it can be seen that the method of the present invention is significantly better than the traditional method in various evaluation indicators on the adversarial dataset, especially in terms of accuracy, precision, recall and F1 score. These results show that the adversarial samples generated by the improved FGSM algorithm can more effectively evaluate the security of the model, making the model more robust in the face of adversarial attacks.

[0109] Through practical applications and data comparison in the financial field, this embodiment demonstrates the actual effect of the artificial intelligence model security automatic evaluation method of the present invention. The improved FGSM algorithm improves the comprehensiveness and accuracy of the evaluation through adaptive loss function and diversified adversarial sample generation, solves the shortcomings of traditional methods in adversarial attack evaluation, and significantly improves the security evaluation effect of the model.

[0110] The present invention uses an improved FGSM algorithm to generate adaptive adversarial samples, which can more accurately simulate various possible adversarial attack scenarios. This method not only takes into account the sensitivity of the input samples, but also introduces an adaptive loss function, which can more effectively generate adversarial samples and significantly improve the accuracy of security assessment.

[0111] The method of the present invention generates multiple adversarial samples for each input sample and uses different perturbation strategies to make the evaluation more comprehensive and in-depth. Traditional methods usually only generate a single type of adversarial sample and cannot fully evaluate the robustness of the model. Diversified adversarial sample generation technology makes up for this deficiency and makes the evaluation results more representative and reliable.

[0112] This invention provides an automated security assessment method for artificial intelligence models for general business scenarios. Through a series of automated steps, from input data preparation to adversarial sample generation to assessment result analysis, a complete assessment process is formed. The automated assessment process greatly reduces the need for manual intervention and improves assessment efficiency and consistency.

[0113] The method of the present invention analyzes the prediction results through multiple evaluation algorithms, obtains the accuracy, precision, recall rate and F1 score of the model on the original data set and the adversarial data set, and finally forms an evaluation score set. The final score of the model is obtained through normalization processing, which can comprehensively reflect the performance of the model in different attack scenarios and provide more objective and accurate evaluation results.

[0114] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. An automated security assessment method for artificial intelligence models for general business scenarios, characterized in that: The steps include: S1. Before starting the evaluation, the user submits the AI ​​model to be evaluated and specifies the original data set for training the AI ​​model to be evaluated. , and conduct white-box or black-box evaluation on the AI ​​model being evaluated; S2. When performing white-box evaluation on the AI ​​model being evaluated, the original data set is evaluated by improving the FGSM algorithm. Each input sample in Generate corresponding adversarial examples , forming an adversarial dataset ; S3. During white-box evaluation, call the interface of the AI ​​model being evaluated to evaluate the original data set. Make predictions and record the responses of the AI ​​model to each original input sample. The prediction results , call the interface of the AI ​​model being evaluated to deal with the adversarial dataset Make predictions and record the model's response to each adversarial input sample The prediction results , output the prediction results of the original dataset and the adversarial dataset and save them in a file in json format; S4. During black-box evaluation, users need to select other adversarial datasets generated by the AI ​​model being evaluated during the white-box evaluation process. Except for this, the rest of the process is the same as that of the white-box evaluation. S5, using the prediction result json files of S3 and S4 as input, using multiple evaluation algorithms to analyze the prediction result json files in turn, and obtain the specific scores of the corresponding evaluation algorithms for the evaluated artificial intelligence model , and finally obtain the evaluation score set Score of the evaluated artificial intelligence model: ; S6. Normalize the evaluation score set to obtain the final score of the evaluated artificial intelligence model; The S2 specifically includes: S21. Input data and target model: Let the original input sample be x, the true label be y, and the AI ​​model being evaluated be ,in, are model parameters; S22. Calculate adaptive loss function: Select adaptive loss function , the adaptive loss function is based on the cross entropy loss and adjusted in combination with the input sample sensitivity: ; in, Represents the cross entropy loss function, which is used to measure the difference between the model prediction result and the true label. represents the weight factor, which is used to balance the cross entropy loss and the sensitivity of the input samples. N represents the number of input samples. Represents the loss function J for the input sample The gradient of is used to represent the sensitivity of the input sample; S23. Calculate the loss function Gradient with respect to input x: The gradient is expressed as ; S24. Generate adaptive adversarial samples: Adjust the input samples through the adaptive gradient ascent method to shift the input samples in the direction of maximizing the adaptive loss: ; in, represents the generated adaptive adversarial sample, represents the hyperparameter that controls the size of the perturbation, which determines the amount of perturbation added to the original sample. Represents the gradient sign of the adaptive loss function, which is used to determine the perturbation direction, Represents the adaptive perturbation factor, which dynamically adjusts the perturbation size according to the sensitivity of the input sample. Represents the gradient of the loss function, which is used to further adjust the perturbation direction; S25. Diversified adversarial sample generation: Generate multiple adversarial samples for each input sample, and each adversarial sample uses a different perturbation strategy: ; Among them, k represents different perturbation strategies, and for different disturbance sizes and adaptation factors; S26. According to steps S21-S25, the security of the AI ​​model being evaluated is determined by and diverse adversarial datasets The prediction results are compared and analyzed for evaluation.

2. According to claim 1, an automated security assessment method for artificial intelligence models for general business scenarios is characterized in that: If the submitted AI model under evaluation includes the source code of the AI ​​model under evaluation, a white-box evaluation will be conducted on the AI ​​model under evaluation; if only the Docker image file of the AI ​​model under evaluation is submitted, a black-box evaluation will be conducted on the AI ​​model under evaluation.

3. According to claim 2, an automatic security assessment method for artificial intelligence models for general business scenarios is characterized in that: The original dataset Including input samples and its corresponding true label .

4. According to claim 1, an automated security assessment method for artificial intelligence models for general business scenarios is characterized in that: The evaluation algorithm includes the accuracy, precision, recall and F1 score of the evaluated artificial intelligence model on the original data set and the adversarial data set.

5. According to claim 4, an automatic security assessment method for artificial intelligence models for general business scenarios is characterized in that: The accuracy of the AI ​​model being evaluated on the original dataset is calculated by comparing the prediction results. With the true label calculate: ; in, is the number of samples in the original data set, and 1 is the indicator function; The accuracy of the AI ​​model evaluated on the adversarial dataset is calculated by comparing the prediction results of the adversarial samples. With the true label To calculate: 。 6. According to claim 5, an automated security assessment method for artificial intelligence models for general business scenarios is characterized in that: The S6 specifically includes: S61. Normalize each element in the Score set. The calculation formula is as follows: ; in, is the minimum possible value of the evaluation score when the corresponding evaluation algorithm evaluates the evaluated artificial intelligence model. is the maximum possible value of the evaluation score when the corresponding evaluation algorithm evaluates the evaluated artificial intelligence model. is the actual score of the evaluated AI model when the corresponding evaluation algorithm evaluates it, and m and n are adjustment coefficients; S62. Calculate the weighted average score using the following formula: ; in, is the weight of the corresponding evaluation algorithm score.

7. According to claim 6, an automatic security assessment method for artificial intelligence models for general business scenarios is characterized in that: When the evaluation score of the evaluation algorithm is higher, it means that the evaluated artificial intelligence model is safer, m=1, n=0; when the evaluation score of the evaluation algorithm is lower, it means that the evaluated artificial intelligence model is safer, then m=0, n=1.

Citation Information

Patent Citations

  • Algorithm component library for adaptively enhancing artificial intelligence algorithm security

    CN116204890A