A detection method for model inversion attacks
By generating and deploying deep honey points and detecting model inversion attacks, it solves the problem of insufficient defense capabilities of existing defense methods, achieves efficient and high-precision model inversion attack detection, and ensures the security of model data.
Patent Information
- Application Number
- CN202410822970.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-06-25
AI Technical Summary
Among existing defense methods against model inversion attacks, methods that limit output information have limited defense capabilities and are easily bypassed, methods that interfere with output information affect the normal function of the model, and there is a lack of efficient and high-precision detection solutions.
Randomly generate initial honey points, detect whether they meet the requirements based on the attacker's behavioral logic, generate deep honey points, and deploy them into the model. When the deep honey points are triggered, the model inversion attack is detected to ensure that during the model content generation process Detect and terminate attacks in real time.
While ensuring that the availability of the model is not affected, efficient and high-precision detection of model inversion attacks is achieved, the detection rate is improved, and the security of the model training set data is ensured.
Smart Images

Figure CN118400185B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network security and artificial intelligence security, and in particular to a detection method for model inversion attacks. Background Art
[0002] In recent years, deep learning models have shown performance close to or even exceeding that of human labor in many tasks and have been widely used in production and life. At the same time, with the emergence of large multimodal language and vision models, deep learning models have been more deeply applied in energy, medical and other fields. At the same time, the application of deep learning models in the security field has also attracted great attention from the public.
[0003] The construction of deep learning models requires a large amount of training data, which may contain high-value attack targets such as personal privacy data or commercial confidential information. Attackers will use various means to try to attack deep models to obtain training data, so ensuring the security of training data is an important issue in the field of deep learning models.
[0004] Among many attack methods, model inversion attack is an attack method that poses a serious threat to deep learning models. The attacker restores the features of the model training data by iteratively accessing the model, including but not limited to obtaining samples in the training set and reconstructing the privacy-sensitive features of the training set, thereby causing model data leakage.
[0005] Therefore, how to defend against model inversion attacks has become an important research topic. The existing defense methods against model inversion attacks mainly include limiting output information and interfering with output information. However, the defense method of limiting output information has the problem of limited defense capability and easy to be bypassed by attackers, and the defense method of interfering with output information has the problem of affecting the normal function of the model. Therefore, it is necessary to propose a solution to solve the above problems. Summary of the invention
[0006] The purpose of the present invention is to provide a detection method for model inversion attacks, which can improve the situation that the output information defense method is easily bypassed and the output information defense method is interfered with to affect the normal function of the model.
[0007] The present invention provides a detection method for model inversion attack, comprising:
[0008] The initial honey point is randomly generated, and the attacker's behavior logic is inverted based on the model to detect whether the initial honey point meets the requirements: multiple generation models are used to generate content based on the behavior logic until the outputs of all generation models contain the initial honey point. When the total number of iterative generation is less than the preset value, the initial honey point meets the requirements and is output as a deep honey point. Otherwise, the initial honey point is updated.
[0009] Deploy the deep honeypots into the original model to obtain a protected model;
[0010] When the deep sweet spot in the protected model is triggered, the protected model is attacked by model inversion.
[0011] The beneficial effects of a detection method based on model inversion attack provided by the present invention are:
[0012] The present invention generates deep honey spots by characterizing the behavioral logic of model inversion attackers and deploys them in the model through model fine-tuning, thereby achieving efficient and high-precision detection of model inversion attacks while ensuring that the availability of the model is not significantly affected.
[0013] Optionally, the attacker's behavior logic includes:
[0014] The attacker iteratively accesses the model and reconstructs the training set data or highly similar data through gradients targeting the training set data.
[0015] Optionally, when detecting the initial honey spot, the following steps may be performed:
[0016] Taking the initial honey point as the target, the input variables of multiple generative models are iteratively optimized until multiple generative models generate initial honey points. The total number of iterations of all generative models is recorded. When the total number of iterations is less than the preset value, the initial honey point is output as a deep honey point, otherwise the initial honey point is updated.
[0017] Optionally, when iteratively optimizing the input variables of the generated model, include:
[0018] The generative model generates content based on variables. When the generated result is different from the initial honey point, the distance between the generated result and the initial honey point is calculated, the first gradient of the distance with respect to the honey point is calculated, and the input variables are updated based on the first gradient and regenerated until the generated result is the initial honey point.
[0019] Optionally, when iteratively optimizing input variables, when the number of iterative updates reaches a preset threshold, if the final result is still not the same as the initial honey point, the second gradient of the initial honey point with respect to the final result is calculated, and the initial honey point is updated based on the second gradient; the final result is the new input variable of the generation model, and the updated initial honey point is the new target of the generation model.
[0020] The beneficial effects of a detection method based on model inversion attack provided by the present invention are:
[0021] Based on the behavioral logic characterization of the model inversion attacker, it detects whether the deep honey spot can be generated within the effective number of iterations, thereby ensuring that the deep honey spot is deployed on the critical path of the model inversion attack, which effectively improves the detection rate of the deep honey spot against the model inversion attack.
[0022] Optional, when deploying a deep honey spot, include:
[0023] A small amount of data is randomly sampled from the training set data of the original model to obtain a fine-tuning data set, and the sampled data in the training set is removed to obtain an unprocessed data set; the deep honey spot is combined with all the data in the fine-tuning data set to obtain a honey spot data set, and the original model is fine-tuned based on the honey spot data set and the unprocessed data set to obtain a protected model.
[0024] The beneficial effects of a detection method based on model inversion attack provided by the present invention are:
[0025] The deep honeypot is deployed in the protected model in the form of model fine-tuning, and the unprocessed dataset ensures that the normal performance of the model will not be significantly affected.
[0026] Optionally, when detecting whether a depth honey spot is triggered, include:
[0027] The intermediate layer features of the depth honey spot in the protected model are recorded. When the protected model generates content based on the input information, the intermediate layer features of the input information in the generation process are extracted, and the intermediate layer features of the input information are compared with the intermediate layer features of the depth honey spot.
[0028] Optionally, when comparing the intermediate layer features of the input layer information with the intermediate layer features of the depth honeypoint, including:
[0029] The feature cosine similarity between the intermediate layer features of the input information and the intermediate layer features of the deep honey spot is calculated. When the feature cosine similarity is higher than the preset value, the deep honey spot is triggered and the input information is identified as a model inversion attack.
[0030] The beneficial effect of a detection method based on model inversion attacks provided by the present invention is that the deep honey spot status is detected in real time during the process of model content generation, and when the deep honey spot is triggered, the content generation is terminated in time to ensure the security of the model training set data. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a flow chart of the detection method for model inversion attack;
[0032] Figure 2 Flowchart for deploying deep honeypots into protected models;
[0033] Figure 3 Flowchart of inverting attacks based on the deep honeyspot detection model for the protected system. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below. 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. Unless otherwise defined, the technical terms or scientific terms used herein should be the common meanings understood by people with general skills in the field to which the present invention belongs.
[0035] refer to Figure 1 The present invention provides a detection method for model inversion attack, comprising the following steps:
[0036] S1. Randomly generate an initial honey point, and detect whether the initial honey point meets the requirements based on the attacker's behavior logic. If it meets the requirements, it will be output as a deep honey point, otherwise the initial honey point will be updated;
[0037] S2, deploy deep honey spots to obtain a protected model;
[0038] S3. Detect the deep honey spot state. When the deep honey spot is triggered, a model inversion attack is detected.
[0039] In fact, in step S1, when the initial honey spot is generated, the format of the initial honey spot is the same as the training set data. Take the image classification scenario as an example: for a given original model and training set data set, if the format of the training set data in the training set data set is 3*255*255, then when the initial honey spot is generated, the size of the initial honey spot is also 3*255*255, and the content in the initial honey spot, that is, the value of the picture is random. At this time, the generation of the initial honey spot is completed.
[0040] In fact, in step S1, when checking whether the initial honey point meets the requirements, the detection is performed based on the attacker's behavior logic. The attacker's behavior logic is: the attacker iteratively accesses the model and reconstructs the training set data or highly similar data through gradients with the training set data as the target.
[0041] Specifically, take the image classification scenario as an example:
[0042] When a model inversion attacker performs a model inversion attack on a generated model, the target of the attack is the training set data of the generated model: the attacker will try to reconstruct the training set data Or get the data Highly similar data By reconstructing the obtained data, the attacker can analyze and obtain the training set data The training set model contains sensitive information, which may lead to information leakage;
[0043] In addition to the attack target being the training set data, the attacker's attack method is also the logic of his behavior: in the initial stage of the attack, the attacker accesses the generation model and inputs the initial variables for generation. Since the initial variables only contain the most basic generation conditions, the output results generated with the initial variables as input often do not have features with sufficient recognition, or the output results only contain features that are common in the same type of data. For example, when generating a face image, the initial generation result may only be a fuzzy general face, or even only contain the general outline of the face;
[0044] After completing the initial content generation, the attacker enters the next stage. The attacker will iteratively access the generation model based on the initial generation result. During the iterative access process, the attacker will continuously add conditions and details to the input variables, thereby inducing the generation model to generate more specific generation results with increasing recognition. Take the face image as an example: the initial generation result is just a blurry front-facing general face. As the attacker continues to iterate, the details of the image will continue to increase, from the initial general face, to add gender characteristics, facial expressions, facial features, facial features, hair color, facial orientation and many other details;
[0045] Finally, after multiple rounds of iterative access, the attacker successfully guided the model to output images with a similarity of up to 95% with the training set data or with the same key features. At this time, the training set data of the generated model is leaked due to the attacker's model inversion attack. Take the face image as an example: after multiple rounds of iterative access, the attacker's results guide the generated model to generate an image of a human male, and it is highly similar to the image of the male in the training set data. At this time, the information inside the model is leaked.
[0046] In fact, in step S1, when detecting the initial honey point, it includes:
[0047] Taking the initial honey point as the target, the input variables of multiple generative models are iteratively optimized until multiple generative models generate initial honey points. The total number of iterations of all generative models is recorded. When the total number of iterations is less than the preset value, the initial honey point is output as a deep honey point, otherwise the initial honey point is updated.
[0048] Specifically, the generative model used to detect whether the initial honey point is qualified can be any generative model that has been put into practical use on the market, such as stylegan, stylegan2, and wgan. In the present invention, the number of generative models used for the test is three. When checking whether the initial honey point meets the requirements, the following generative models are used in turn: , , Three generative models are used for content generation, where A, B, and C are arbitrary generative models. Generally, the three models are different.
[0049] The goal of using multiple generation models to detect the initial honey point is to check whether the initial honey point can be generated within a specified number of times. , , If the three generative models are generated simultaneously within 100 iterations and a total of 300 iterations, it is proved that the honey spot will be generated with a high probability when the model inversion attacker attacks the model; therefore, during the entire attack process of the model inversion attacker on the model, the deep honey spot will be generated in the process of iterative access, that is, before the model outputs the training set data or the content containing the characteristics of the training set data due to the model inversion attack, thereby ensuring that the protected model can discover that it has received the model inversion attack before the attacker reaches the attack target; therefore, when the initial honey spot can be generated by the generative model within the specified number of times, the honey spot meets the requirements and is output as a deep honey spot, which will be deployed on the critical path of the model inversion attack in the protected model.
[0050] In fact, in step S1, when iteratively optimizing the input variables of the generated model, it includes:
[0051] The generative model iteratively generates content based on input variables. When the generated result is not the same as the initial honey point, the input variables are updated and regenerated until the generated result is the initial honey point.
[0052] When updating the input variables, first calculate the distance of the generated result with respect to the initial honey point, calculate the gradient with respect to the initial honey point based on the distance, and update the input variables based on the gradient.
[0053] Specifically, the purpose of gradient-based updating of input variables is to make the input variables approach the initial honey point, so that the generated content gradually converges to the initial honey point, and finally generates the same generated content as the initial honey point after a certain number of iterative updates.
[0054] Specifically, the generative model is used to generate output based on the input variables, and the distance between the output and the initial honey point is calculated, the gradient of the distance with respect to is solved, and the input variables are updated based on the gradient and regenerated;
[0055] The expression for calculating the gradient between the distance and the initial honey point is:
[0056] ;
[0057] in, is the initial honey point, is the input variable, To generate the model Based on input variables The output, Output and initial honey point The distance is the distance about the initial honey point The gradient of
[0058] The expression for updating the input variables based on the gradient is:
[0059] ;
[0060] in is the learning rate, set to 0.001, is a symbolic function, when the updated input variable The generated result is still different from the initial honey point When the same, continuously iterate and update the input variables to obtain , is the number of iterative updates, For the The input variables obtained after the update.
[0061] In fact, in step S1, when iteratively optimizing the input variables, when the number of iterative updates reaches the preset threshold If the final output is still not consistent with the initial honey point If the initial honey point does not meet the requirements, the gradient between the initial honey point and the distance is calculated, and the initial honey point is updated based on the gradient; the final result is the generated model The input variables generated in the new round of iterations, the updated initial honey point is the generated model The goals of a new round of iterations;
[0062] in The value of is 100. When the input variables are iteratively optimized, if the model still cannot generate the initial honey point after 100 iterations, it indicates that the initial honey point cannot be generated by the model within a sufficient number of times and cannot meet the function of the deep honey point, and needs to be updated.
[0063] The expression for calculating the gradient between the initial honey point and the distance is:
[0064] ;
[0065] in When the number of iterations reaches the preset threshold The output of the model is generated when is the distance between the final output and the initial honey point, is the gradient of the initial honey point with respect to the distance;
[0066] The expression for updating the initial honey point based on the gradient is:
[0067] ;
[0068] in, is the updated initial honey point, which is used as the target for the next round of iteration of the generative model. If it still does not meet the requirements, continue to update .
[0069] Specifically, use , , The three generation models repeat the above detection process in turn until the initial honey point can be detected by the three generation models when the sum of the iteration times is less than the preset value. The initial honey point meets the requirements and is output as a deep honey point.
[0070] In fact, reference Figure 2 In step S2, when deploying the deep honey spots, it includes:
[0071] A small amount of data is randomly sampled from the training set data of the original model to obtain a fine-tuning data set, and the sampled data in the training set is removed to obtain an unprocessed data set; the deep honey spot is combined with all the data in the fine-tuning data set to obtain a honey spot data set, and the original model is fine-tuned based on the honey spot data set and the unprocessed data set to obtain a protected model.
[0072] Among them, the fine-tuning data set accounts for 5% of the total data set, and the remaining 95% of the training set data is an unprocessed data set. When the deep honey spots are combined with all the data in the fine-tuning data set, the deep honey spots are implanted into the data in the fine-tuning data set, so that the data contains deep honey spots or the characteristics of deep honey spots; when all the data in the fine-tuning data set are combined with the deep honey spots, they are marked as protected classes and recombined into a honey spot data set;
[0073] The protected model is obtained by fine-tuning the original model based on the honey spot dataset and the unprocessed dataset. The unprocessed dataset, which accounts for 95%, ensures that the normal performance of the protected model is not significantly affected. The honey spot dataset, which accounts for 5%, is used to deploy the deep honey spots to the protected model. Based on the generalization of the protected model, the deep honey spots will be deployed to the critical path of the protected model.
[0074] The training set data of the protected model contains data of multiple categories. For the training set data class that you want to protect, the protected class and the training set data that you want to protect are marked as the same category.
[0075] In fact, reference Figure 3 In step S3, when detecting whether the depth honey spot is triggered, it includes:
[0076] The intermediate layer features of the depth honey spot in the protected model are recorded. When the protected model generates content based on the input information, the intermediate layer features of the input information in the generation process are extracted, and the intermediate layer features of the input information are compared with the intermediate layer features of the depth honey spot.
[0077] Specifically, in a deep learning model, the model learns the patterns and features of the training set data through training with a large amount of training set data, thereby acquiring the ability to accurately predict or classify the input data. In the field of images, the deep learning model processes the image as a matrix composed of pixel values, and obtains the features of the image by analyzing the numbers in the matrix; in the field of language, the deep learning model learns a large amount of text data, enabling it to understand the semantics of a paragraph or predict subsequent content;
[0078] During the training process of the protected model, after training with the honeypoint dataset containing deep honeypoints, the protected model learns the intermediate layer features of the deep honeypoints in the model training. Taking images as an example: after learning with multiple layers of neural networks, the features learned by the neural network will become more and more refined, from the whole to the structural unit. In the intermediate training process, the neural network learns the intermediate layer features of the deep honeypoints, such as the structural features and gradients of the image;
[0079] When an attacker accesses a protected model, the protected model receives input information, analyzes and understands it, and then generates content based on the features learned by the neural network. During this process, the detection module of the protected model compares the intermediate content generated during the generation process with the intermediate layer features of the deep honey points learned during the training process, and calculates the feature cosine similarity between the two.
[0080] In fact, reference Figure 3 In step S3, when comparing the intermediate layer features of the input layer information with the intermediate layer features of the depth honey point, it includes:
[0081] The feature cosine similarity between the intermediate layer features of the input information and the intermediate layer features of the deep honey spot is calculated. When the feature cosine similarity is greater than the preset threshold, the deep honey spot is triggered and the input information is judged as a model inversion attack; when the feature cosine similarity is less than the preset threshold, the input information is judged as a normal request and content generation proceeds normally.
[0082] Specifically, when the feature cosine similarity between the intermediate layer features of the input information and the intermediate layer features of the deep honey spot is greater than the preset value of 0.8, it indicates that the intermediate layer features of the input information are highly similar to the intermediate layer features of the deep honey spot; if the protected model generates the input information according to the content generation process, the final generated result will be highly similar to the training set data marked as protected. At this time, the model inversion attacker will achieve the purpose of the model inversion attack and obtain data that is highly similar or even consistent with the training set data;
[0083] Therefore, in the process of content generation, when the detection module detects that the feature cosine similarity between the intermediate layer features of the input information and the intermediate layer features of the deep honey spot is higher than 0.8, the detection module determines that the input information is a model inversion attack, terminates the content generation of the protected model, blocks the attacker from obtaining the generated content of the model, and alarms the attack behavior and records it in the attack alarm log.
[0084] Although the embodiments of the present invention are described in detail above, it is obvious to those skilled in the art that various modifications and variations can be made to these embodiments. However, it should be understood that such modifications and variations are within the scope and spirit of the present invention as described in the claims. Moreover, the present invention described herein may have other embodiments and may be implemented or realized in a variety of ways.
Claims
1. A detection method for model inversion attacks, It is characterized in that include: Randomly generate an initial honey point, and detect whether the initial honey point meets the requirements based on the model inversion of the attacker's behavior logic: use multiple generation models to iteratively generate content based on the behavior logic until the outputs of all generation models contain the initial honey point. When the sum of the number of iterative generation times is less than a preset value, the initial honey point meets the requirements and is output as a deep honey point. Otherwise, the initial honey point is updated. A small amount of data is randomly sampled from the training set data of the original model to obtain a fine-tuning data set, and an unprocessed data set is obtained after the sampled data in the training set is removed; the depth honey spot is combined with all the data in the fine-tuning data set to obtain a honey spot data set, and the original model is fine-tuned based on the honey spot data set and the unprocessed data set to obtain a protected model; The intermediate layer features of the depth honey spot in the protected model are recorded. When the protected model generates content based on the input information, the intermediate layer features of the input information in the generation process are extracted, and the feature cosine similarity of the intermediate layer features of the input information and the intermediate layer features of the depth honey spot is calculated. When the feature cosine similarity is higher than a preset value, the depth honey spot is triggered, and the input information is identified as a model inversion attack.
2. The detection method according to claim 1, It is characterized in that The attacker's behavior logic includes: The attacker iteratively accesses the model and reconstructs the training set data or highly similar data through gradients targeting the training set data.
3. The detection method according to claim 1, It is characterized in that When the initial honey spot is detected, it includes: Taking the initial honey point as the target, iteratively optimize the input variables of the multiple generation models until the multiple generation models all generate the initial honey point, and record the total number of iterations of all generation models. When the total number of iterations is less than a preset value, the initial honey point is output as a deep honey point, otherwise the initial honey point is updated.
4. The detection method according to claim 3, It is characterized in that When iterative optimization generates the input variables of the model, it includes: The generation model generates content based on variables. When a generation result is different from the initial honey point, the distance between the generation result and the initial honey point is calculated, a first gradient of the distance with respect to the honey point is calculated, and the input variables are iteratively updated and regenerated based on the first gradient until the generation result is the initial honey point.
5. The detection method according to claim 4, It is characterized in that When iteratively optimizing the input variables, when the number of iterative updates reaches a preset threshold, if the final result is still not the same as the initial honey point, a second gradient of the initial honey point with respect to the final result is calculated, and the initial honey point is updated based on the second gradient; the final result is a new input variable of the generative model, and the updated initial honey point is a new target of the generative model.
