Extraction attack risk detection method with nonlinear activation function model
By adding offsets to the machine learning model and cyclically testing the output offsets to detect the boundary points and parameter information of the activation function, the problem that existing technology cannot detect the risk of nonlinear activation function model extraction attack is solved, significantly improving system security. sex.
Patent Information
- Application Number
- CN202410875704.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-10-01
AI Technical Summary
Existing technology cannot effectively detect the risk of extraction attacks on neural network models that use nonlinear activation functions such as Leaky ReLU and Sigmoid. It can only detect neural networks composed of linear layers and ReLU functions.
By adding offsets to the machine learning model, cyclically testing the output offset, and determining the boundary points of the activation function and model parameter information, risk detection is carried out. The attack-driven method is used to test the model, and the risk is determined when information leakage is detected.
It significantly improves system security, can detect attack risks of nonlinear activation function models such as Leaky ReLU and Sigmoid, and expands the scope of existing activation function detection methods.
Smart Images

Figure CN118734309A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a technology in the field of information security, in particular to an extraction attack risk detection method with a nonlinear activation function model. Background Art
[0002] A model extraction attack is an attack method in which an attacker infers the parameters or functions of a machine learning model by sending data in a loop and viewing the corresponding response results, thereby replicating a machine learning model with similar or even identical functions. The attack aims to retrieve information about the model in order to replicate model parameters, simulate the model's functions, or infer information about its training data. Summary of the invention
[0003] In view of the fact that the prior art can only defend against attack risks when the parameter information of the model is known, the present invention mainly focuses on attack detection for linear layers (i.e., fully connected layers and convolutional layers) and ReLU functions, and can only complete risk detection of neural networks composed of linear layers and nonlinear ReLU layers. For the deficiency that nonlinear functions such as Leaky ReLU and Sigmoid cannot be detected, an extraction attack risk detection method with a nonlinear activation function model is proposed.
[0004] The present invention is achieved through the following technical solutions:
[0005] The present invention relates to an extraction attack risk detection method with a nonlinear activation function model, in which a model to be tested is input in a manner of adding an offset to a reference input to obtain result data with an output offset from a reference output, and the boundary points of the activation function of the model to be tested and the parameter information of the model are tested according to the positive and negative cycle of the output offset, thereby performing risk detection.
[0006] The parameter information of the model includes: critical conditions of nonlinear activation functions, that is, input values of nonlinear activation functions or neural network parameters of linear functions in the model.
[0007] The risk detection refers to: using an attack-driven method to attack the model. When information leakage occurs, it means that the security reasoning model to be tested has risks, otherwise it passes the detection.
[0008] The method specifically comprises:
[0009] S1. Perform secure machine learning prediction with the machine learning model owner: obtain an interaction request for machine learning prediction with the target participant, perform secure machine learning prediction with the target participant according to the current model input, and obtain the prediction result, i.e., the initial output value.
[0010] The machine learning model includes an activation function Leaky ReLU or Sigmoid.
[0011] S2. Input offset. Use a layer in the machine learning model as the layer to be tested for malicious input. That is, add an offset to the original input value and interact with the target party. That is, calculate the output of the layer to be tested in a secure way as the output value under malicious behavior.
[0012] S3. Select an initial interval of the offset, and use the binary search method to loop through the complete step S2 within the initial interval with the offset as input until the output value obtained is the same as the critical point of the initial output value in S1. The specific operation is as follows: given an initial interval of the offset, use the midpoint of the initial interval as the offset as the input of S2, execute the complete S2 to obtain the output value under malicious behavior, and determine whether the output value is equal to the initial output value in S1. If yes or no, perform a binary search on the left interval or the right interval, and repeat this behavior until the interval size meets the preset accuracy requirements. The middle value of the final interval is the final offset.
[0013] S4. According to the final offset obtained in step S3, the predicted value of the layer to be tested is further obtained. When the linear layer parameters of the model to be tested, namely the weight w and the offset b, are finally obtained through steps S2-S3, it indicates that the security model to be tested is at risk of being attacked. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 Schematic diagram of input extraction for the Leaky ReLU layer;
[0015] Figure 2 Extraction flow chart for Leaky ReLU layer input;
[0016] Figure 3 Flowchart for extracting input to the final Sigmoid layer. DETAILED DESCRIPTION Example 1
[0017] like Figure 2 As shown, an extraction attack risk detection method with a nonlinear activation function Leaky ReLU involved in this embodiment includes:
[0018] S1. Perform secure machine learning prediction with the machine learning model owner, select any Leaky ReLU layer as the layer to be tested, use its input as the initial input value y, and use the output of the machine learning model as the initial output value z.
[0019] S2. Use the offset δy as the input of S2, add the offset δy to the initial input value y, that is, use y+δy as the malicious input of the Leaky ReLU layer, calculate with the target party to obtain the calculation result of the Leaky ReLU layer LeakyReLU(y+δy), then subtract the offset δy from the calculation result, that is, use Leaky ReLU(y+δy)-δy as the input of the next layer of the Leaky ReLU layer, continue to complete the security reasoning process, and obtain the output value z' of the machine learning model.
[0020] S3. Take the possible minimum and maximum input values of the machine learning model as the value range of the offset δy, and use the binary search method to loop through step S2 until the offset δy0, i.e., the critical point, is found where the output value z' of the machine learning model is the same as the initial output value z obtained in step S1. Specifically, take the middle value of the initial interval as the offset, and determine whether the output value z' of the machine learning model in step S2 with the offset is equal to the initial output value z. If yes or no, search the left interval or the right interval until the required accuracy value is met. The middle value of the interval is the final offset δy'.
[0021] S4. According to the final offset value δy', after inversion processing, the Leaky ReLU layer input value is obtained. When the relative error between the input value and the initial input value y in step S1 is less than the preset threshold, it means that the security reasoning may leak the parameter information of the model, and there is a risk.
[0022] In this embodiment, the preset threshold is 10%. Example 2
[0023] like Figure 3 As shown, the present embodiment involves an extraction attack risk detection method with a nonlinear activation function Sigmoid, including:
[0024] S1. Conduct secure machine learning prediction with the machine learning model owner, select any Sigmoid layer as the layer to be tested, use its input as the initial input value y, and use the output of the machine learning model as the initial output value z.
[0025] S2, using the offset δy as the input of S2, adding the offset δy to the initial input value y, that is, using y+δy as the malicious input of the Sigmoid layer, and calculating with the target participant to obtain the calculation result of the Sigmoid layer Sigmoid(y+δy), continue to complete the security reasoning process and obtain the output value z' of the machine learning model.
[0026] S3. Take the possible minimum and maximum input values of the machine learning model as the value range of the offset δy, and use the binary search method to loop through step S2 until the offset δy0, i.e., the critical point, is found where the output value z' of the machine learning model is the same as the initial output value z obtained in step S1. Specifically, take the middle value of the initial interval as the offset, and determine whether the output value z' of the machine learning model in step S2 with the offset is equal to the initial output value z. If yes or no, search the left interval or the right interval until the required accuracy value is met. The middle value of the interval is the final offset δy'.
[0027] S4. According to the final offset value δy', after inversion processing, the Sigmoid layer input value is obtained, and when the relative error with the initial input value y of step S1 is less than the preset threshold, it means that the security reasoning may leak the parameter information of the model and there is a risk.
[0028] In this embodiment, the preset threshold is 10%.
[0029] After specific practical experiments, the above method is run under a binary classification neural network with a 20*20 linear layer, a LeakyRelu layer as the activation function, a 20*1 linear layer and a sigmoid function as the activation function. The experimental data that can be obtained are: the w and b neural network parameters detected by the 20*20 linear layer and the 20*1 linear layer are shown in Table 1 below, and the relative error is within 1%. Neural Network Layers Relative error (%) 20*20 linear layer: w 0.79 20*20 linear layer: b 0.87 20*1 linear layer: w 0.015 20*1 linear layer: b 0.0
[0030] In summary, this method expands the existing detection method of activation functions and significantly improves system security.
[0031] The above-mentioned specific implementation can be partially adjusted in different ways by those skilled in the art without departing from the principle and purpose of the present invention. The protection scope of the present invention shall be based on the claims and shall not be limited by the above-mentioned specific implementation. Each implementation scheme within its scope shall be subject to the constraints of the present invention.
Claims
1. An extraction attack risk detection method with a nonlinear activation function model, It is characterized in that The model to be tested is input by adding an offset to the reference input, and the result data with an output offset compared to the reference output is obtained. The boundary points of the activation function of the model to be tested and the parameter information of the model are tested according to the positive and negative cycle of the output offset, so as to perform risk detection.
2. The extraction attack risk detection method with a nonlinear activation function model according to claim 1, Its characteristics are: The parameter information of the model includes: critical conditions of nonlinear activation functions, that is, input values of nonlinear activation functions or neural network parameters of linear functions in the model.
3. The extraction attack risk detection method with a nonlinear activation function model according to claim 1, Its characteristics are: The risk detection refers to: using an attack-driven method to attack the model. When information leakage occurs, it means that the security reasoning model to be tested has risks, otherwise it passes the detection.
4. The method for detecting the risk of an extraction attack using a nonlinear activation function model according to any one of claims 1 to 3, Its characteristics are that include: S1. Conduct secure machine learning prediction with the machine learning model owner: obtain an interactive request for machine learning prediction with the target participant, conduct secure machine learning prediction with the target participant according to the current model input, and obtain the prediction result, i.e., the initial output value; S2. Input offset, using a layer in the machine learning model as the layer to be tested for malicious input, that is, adding an offset to the original input value and interacting with the target participant, that is, calculating the output of the layer to be tested in a secure way as the output value under malicious behavior; S3, select the initial interval of the offset, use the binary search method to loop through the complete step S2 in the initial interval with the offset as input, until the output value obtained is the same as the critical point of the initial output value in S1, the specific operation is: given the initial interval of the offset, use the midpoint of the initial interval as the offset as the input of S2, execute the complete S2 to obtain the output value under malicious behavior, and determine whether the output value is equal to the initial output value in S1, and perform a binary search on the left interval or the right interval if it is yes or no, repeat this behavior until the interval size meets the preset accuracy requirements, and the middle value of the final interval is the final offset; S4. According to the final offset obtained in step S3, the predicted value of the layer to be tested is further obtained. When the linear layer parameters of the model to be tested, namely the weight w and the offset b, are finally obtained through steps S2-S3, it indicates that the security model to be tested is at risk of being attacked.
5. The extraction attack risk detection method with a nonlinear activation function model according to claim 4, Its characteristics are: When the machine learning model includes Leaky ReLU, the detection method specifically includes: S1. Perform secure machine learning prediction with the machine learning model owner, select any Leaky ReLU layer as the layer to be tested, use its input as the initial input value y, and use the output of the machine learning model as the initial output value z; S2, using the offset δy as the input of S2, adding the offset δy to the initial input value y, that is, using y+δy as the malicious input of the LeakyReLU layer, and calculating with the target participant to obtain the calculation result of the Leaky ReLU layer Leaky ReLU(y+δy), then subtracting the offset δy from the calculation result, that is, using Leaky ReLU(y+δy)-δy as the input of the next layer of the Leaky ReLU layer, and continuing to complete the security reasoning process to obtain the output value z' of the machine learning model; S3, take the possible minimum and maximum input values of the machine learning model as the value range of the offset δy, and use the binary search method to loop through step S2 until the offset δy whose output value z' of the machine learning model is the same as the initial output value z obtained in step S1 is found 0 , i.e. the critical point, specifically: take the middle value of the initial interval as the offset, determine whether the output value z' of the machine learning model in step S2 with the offset is equal to the initial output value z, and search the left interval or the right interval for yes or no until the required accuracy value is met. The middle value of the interval is the final offset δy'; S4. According to the final offset value δy', after inversion processing, the Leaky ReLU layer input value is obtained. When the relative error between the input value and the initial input value y in step S1 is less than the preset threshold, it means that the security reasoning may leak the parameter information of the model, and there is a risk.
6. The extraction attack risk detection method with a nonlinear activation function model according to claim 4, Its characteristics are: When the machine learning model includes Sigmoid, the detection method specifically includes: S1. Conduct secure machine learning prediction with the machine learning model owner, select any Sigmoid layer as the layer to be tested, use its input as the initial input value y, and use the output of the machine learning model as the initial output value z; S2, using the offset δy as the input of S2, adding the offset δy to the initial input value y, that is, using y+δy as the malicious input of the Sigmoid layer, and calculating with the target participant to obtain the calculation result of the Sigmoid layer Sigmoid(y+δy), continue to complete the security reasoning process and obtain the output value z' of the machine learning model; S3, take the possible minimum and maximum input values of the machine learning model as the value range of the offset δy, and use the binary search method to loop through step S2 until the offset δy whose output value z' of the machine learning model is the same as the initial output value z obtained in step S1 is found 0 , i.e. the critical point, specifically: take the middle value of the initial interval as the offset, determine whether the output value z' of the machine learning model in step S2 with the offset is equal to the initial output value z, and search the left interval or the right interval for yes or no until the required accuracy value is met. The middle value of the interval is the final offset δy'; S4. According to the final offset value δy', after inversion processing, the Sigmoid layer input value is obtained, and when the relative error with the initial input value y of step S1 is less than the preset threshold, it means that the security reasoning may leak the parameter information of the model and there is a risk.
