Neural network weight side channel recovery method based on deep learning

Through deep learning methods, convolutional neural networks are used to analyze power consumption traces, and the problems of the accuracy and complexity of weight recovery in side channel analysis of embedded neural networks are solved, achieving efficient neural network weight recovery and security evaluation.

CN119299125AActive Publication Date: 2025-01-10XIDIAN UNIV

Patent Information

Application Number
CN202411207960.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2025-01-10
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

In the prior art, in the side channel analysis, the power consumption traces are difficult to perfectly synchronize with the data processing process, resulting in reduced weight recovery accuracy, and traditional methods require a large number of power consumption traces, which increases the analysis complexity and error.

Method used

Using the neural network weight-side channel recovery method based on deep learning, the power consumption traces are analyzed through convolutional neural networks, and the fine mapping relationship between waveform data and neural network weights is established, and the neural network weights are used to infer the nerves in multi-layer perception machines using a small number of power consumption traces. Metaweighting, simplifying the analysis process and improving accuracy.

Benefits of technology

High-accuracy neural network weight recovery is achieved, reducing analysis complexity and technical thresholds, improving the efficiency of side channel analysis, and enabling the security evaluation of large-scale neural networks to be completed in a shorter time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299125A_ABST
    Figure CN119299125A_ABST
Patent Text Reader

Abstract

The invention discloses a neural network weight side channel recovery method based on deep learning, relates to the technical field of artificial intelligence and security, and solves the problems that in the prior art, power consumption traces cannot be perfectly synchronized with a data processing process, and errors may be introduced in acquisition and processing of each power consumption trace. The method comprises the steps of collecting power consumption traces and constructing a data set, and then determining a leakage interval to perform dimension reduction on the power consumption traces in the data set; then selecting a classifier, constructing the capability from side channel information to a correct weight model, and finally recovering the weight of a corresponding neuron in the MLP according to the trained model; the weight of each neuron in the MLP is deduced through a small number of power consumption traces while the high accuracy is kept, and the side channel analysis efficiency is greatly improved.
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 and security technology, and in particular to a neural network weight side channel recovery method based on deep learning. Background Art

[0002] Side channel analysis (SCA) attacks are an attack method that obtains secret information inside an encrypted device by analyzing information leakage in physical implementation, such as power consumption, electromagnetic radiation, execution time, etc. With the advent of the big data era, artificial intelligence technology has developed rapidly, and neural networks have gradually been deployed on various types of platforms, such as some edge devices, embedded systems, and some low-power processors. However, embedded neural networks have some underlying hardware security issues. In particular, embedded neural networks are susceptible to SCA, and attackers can infer the privacy information of the model through physical access to the target device. Therefore, in order to ensure the security and reliability of deep learning models in commercial applications, prevent intellectual property leakage and potential security threats, it is crucial to perform security testing and evaluation through side channel analysis technology.

[0003] When exploring methods to recover neural network weights, Batina et al. introduced an attack strategy based on correlated power analysis (CPA). The core goal of this strategy is to parse the multiplication operation between the unknown weight weight and the known input input, that is, m = weight*input. They adopted the Hamming Weight (HW) model, which allows the attacker to correlate the activity changes of the predicted output m with a series of weight assumptions. Specifically, the attacker calculates the Pearson correlation coefficient r(t,w) between each weight assumption w and the measurement t obtained through the side channel. As the number of measurements gradually increases, the correct weight value w will gradually emerge due to its higher correlation with the measured data, and eventually stand out from the many incorrect weight assumptions w* and become the most realistic weight value.

[0004] Although the CPA method has a good accuracy in weight recovery, it still has some shortcomings. On the one hand, the CPA method mainly relies on the correlation between the power trace and the Hamming weight in the data processing process. Aligning the power trace is an essential step of CPA, which aims to synchronize operation records, eliminate timing deviations, improve signal-to-noise ratio, simplify the analysis process, reduce error correlation, and adapt to different hardware and software environments, so as to ensure the consistency and reliability of the analysis results. However, in actual operation, due to factors such as noise and device differences, the power trace is often unable to perfectly synchronize with the data processing process, and it is difficult to achieve strict alignment, resulting in a weakened correlation between the extracted features and the actual weights. This has a direct impact on the accuracy of CPA, thereby increasing the difficulty of weight recovery. On the other hand, CPA attacks require a large number of power traces for analysis, which undoubtedly increases the complexity of the attack and the amount of data required. The acquisition and processing of each power trace may introduce errors, and the cumulative effect of multiple power traces may amplify these errors, further affecting the final recovery results. Summary of the invention

[0005] The present invention provides a neural network weight side channel recovery method based on deep learning, which solves the problem in the prior art that power consumption traces are often unable to be perfectly synchronized with the data processing process, and the collection and processing of each power consumption trace may introduce errors. The present invention achieves the inference of the weights of each neuron in a multilayer perceptron (MLP) through a small amount of power consumption traces while maintaining high accuracy, thereby greatly improving the efficiency of side channel analysis.

[0006] The present invention provides a neural network weight side channel recovery method based on deep learning, the method comprising:

[0007] Collect the total power consumption trace T of the target device under different input signals for multiple times, determine the corresponding power consumption trace t at a peak according to the total power consumption trace T, and construct multiple first subsets set according to the power consumption trace t i ; Among them, each first subset set i The weights are different, and the weights are related to the input signals;

[0008] Each of the first subsets set i Divide into the second subset set ij ; Wherein, the peak of the power consumption trace t of the target device corresponds to the neuron loaded on the MLP of the target device;

[0009] The plurality of first subsets set are evaluated by a test vector leakage evaluation method. iThe power consumption trace t in the embodiment is reduced in dimension to obtain the leakage interval step length, and the data on each power consumption trace t is determined to correspond to a plurality of leakage intervals according to the leakage interval step length;

[0010] Determine a starting position, and process the multiple leakage intervals according to the starting position and the leakage interval step to obtain a second leakage interval set;

[0011] Screening the multiple leakage intervals to obtain a second leakage interval set, constructing a first data set using the second leakage interval set and the power consumption trace t corresponding to each data in the second leakage interval set, determining a label of each data in the first data set, and training a convolutional neural network using the first data set and the label to obtain a first analysis model of all Hamming weights;

[0012] Classifying the data in the first data set according to the Hamming weight to obtain a plurality of third subsets, and respectively using the plurality of third subsets to train the convolutional neural network to obtain a second analysis model corresponding to each Hamming weight;

[0013] According to the second subset set ij , using the first analysis model and the second analysis model, calculate the weights of the corresponding neurons in the MLP in the target device.

[0014] In a possible implementation, the power consumption trace t of the target device is collected, and a plurality of first subsets set are constructed according to the power consumption trace t. i ,include:

[0015] Set multiple weights w and input data sets x;

[0016] Using the multiple weights w to weight each input data in the input data set x, to obtain multiple input signals of the target device;

[0017] Collect multiple power consumption traces t corresponding to the multiple input signals, and classify the power consumption traces t according to different weights to obtain multiple first subsets set i .

[0018] In a possible implementation, each of the first subsets set i Divide into the second subset set ij ,include:

[0019] Determine each first subset set i The input data set x is inputted into the target device repeatedly for multiple times to obtain multiple corresponding power consumption traces t, and the power consumption traces t corresponding to the same input data are added to the first subset seti In, get the preprocessed subset;

[0020] The preprocessed subset is divided according to the principle of the same input data to obtain the second subset set ij .

[0021] In a possible implementation manner, screening the multiple leakage intervals to obtain a second leakage interval set includes:

[0022] A starting position is determined, and the plurality of leakage intervals are processed according to the starting position and the leakage interval step to obtain a second leakage interval set.

[0023] In a possible implementation, each of the first subsets set i Divide into the second subset set ij ; Wherein, the peak of the power consumption trace t corresponds to the neuron loaded on the MLP of the target device, including:

[0024] The second subset set ij are respectively input into the first analysis model to obtain the second subset set ij Corresponding multiple one-dimensional arrays aw i ; Wherein, the one-dimensional array aw i The elements in represent the probability of occurrence of each Hamming weight;

[0025] According to the one-dimensional array aw i Determine a first Hamming weight, and determine a corresponding second analysis model according to the first Hamming weight, and set the second subset ij Input into the second analysis model, and obtain the second subset set ij Corresponding multiple one-dimensional arrays aw j , where the one-dimensional array aw j The elements in represent the probability of occurrence of different weights;

[0026] Determine the one-dimensional array aw j The weight corresponding to the maximum value is used as the weight of the corresponding neuron in the MLP in the target device.

[0027] In a possible implementation, the one-dimensional array aw i Determine the first Hamming weight, including:

[0028] For the multiple one-dimensional arrays aw i Perform a logarithm operation to obtain a first array set;

[0029] Summing the array elements corresponding to the same index in the first array set to obtain a second array;

[0030] Perform an exponential transformation on the second array set to obtain a predicted probability distribution array, and determine a value with the highest probability in the predicted probability distribution array as a first Hamming weight.

[0031] In a possible implementation, the calculation formula of the Hamming weight is expressed as:

[0032] LabelHW = HW(m);

[0033] Among them, HW(·) represents the Hamming function, m represents the sensitive value, m=c(x,w), c represents a constant; x represents input data; w represents weight, and LabelHW represents the Hamming weight.

[0034] One or more technical solutions provided in the present invention have at least the following technical effects or advantages:

[0035] (1) The present invention introduces a convolutional neural network to analyze the power consumption trace, thereby solving the problem of aligning the power consumption trace in the prior art and directly realizing the ability to extract the neural network weight information from the power consumption trace, greatly simplifying the side channel analysis process and reducing the complexity and technical threshold of the analysis;

[0036] (2) The present invention uses the powerful learning ability of deep learning. The model can establish a more refined and accurate mapping relationship between waveform data and neural network weights through training with a large amount of data. This refined mapping relationship effectively improves the accuracy of weight recovery.

[0037] (3) The powerful generalization ability of the analysis model trained by the present invention enables the weights of the neural network to be inferred with only a small amount of power consumption traces, which significantly improves the efficiency of side channel analysis compared to traditional methods. The efficient analysis process makes it possible to complete the security assessment of large-scale neural networks in a shorter time. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A flowchart of the steps of a neural network weight side channel recovery method based on deep learning provided by an embodiment of the present invention;

[0039] Figure 2 A schematic diagram of power consumption trace collection provided by an embodiment of the present invention;

[0040] Figure 3 A schematic diagram of the overall process of restoring weights provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0041] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments 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.

[0042] The present invention provides a neural network weight side channel recovery method based on deep learning, such as Figure 1 As shown, the method includes the following steps S101 to S106.

[0043] S101, collecting the total power consumption trace T of the target device under different input signals for multiple times, determining a power consumption trace t corresponding to a peak according to the total power consumption trace T, and constructing multiple first subsets set according to the power consumption trace t i ; Among them, each first subset set i The weights are different, and the weights are related to the input signal.

[0044] Specifically, in step S101, a plurality of first subsets set are constructed according to the power consumption trace t i ,include:

[0045] S1011, set multiple weights w and input data set x; here, the weight is an 8-bit binary code.

[0046] S1012, using multiple weights w to weight each input data in the input data set x, to obtain multiple input signals of the target device.

[0047] S1013, collecting multiple power consumption traces t corresponding to multiple input signals, and classifying the power consumption traces t according to different weights to obtain multiple first subsets set i .

[0048] Exemplarily, the present invention uses an electromagnetic probe to collect power consumption traces, such as Figure 2 As shown in the figure, electromagnetic leakage information is accurately measured in a non-invasive way. By deploying a near-field probe to locate the local position of electromagnetic leakage and connecting the electromagnetic probe to an oscilloscope, the power consumption changes of the development board can be monitored in real time and dynamically.

[0049] This method is deeply based on the basic principles of electromagnetic radiation, and displays the power consumption status of the development board in the form of intuitive electromagnetic signals, which comprehensively and profoundly reveals the power consumption characteristics and electromagnetic radiation spectrum of the system. This feature not only enriches the dimension of side channel analysis, but also greatly improves the accuracy and comprehensiveness of data collection. At the same time, the solution completely avoids the physical transformation of the target system, ensuring the non-destructiveness of the test. Therefore, it is widely applicable to various embedded systems and development boards, showing strong versatility and practicality.

[0050] The weight and input values ​​are controlled to balance the distribution of Hamming weights, each Hamming weight collects L power consumption traces, a total of 16*L power consumption traces are collected, and the power consumption trace t, input x, weight w and label LabelHW are organized together. The present invention is designed with 16 Hamming weights.

[0051] Divide into 256 first subsets according to different weights i i={1,2,…,256}. For each subset, there are 256 different input data x={0,1,2,…,255}.

[0052] S102, each first subset set i Divide into the second subset set ij ; Among them, the peak of the power consumption trace t of the target device corresponds to the neuron loaded on the MLP of the target device.

[0053] Specifically, in step S102, each first subset set i Divide into the second subset set ij , including the following steps S1021 to S1022.

[0054] S1021, determine each first subset set i The input data set x is input into the target device repeatedly to obtain multiple corresponding power consumption traces t, and the power consumption traces t corresponding to the same input data are added to the first subset set i , and obtain the preprocessed subset.

[0055] S1022, dividing the preprocessing subset according to the principle of the same input data to obtain the second subset set ij .

[0056] Exemplarily, a second subset set is formed based on different inputs ij i,j={1,2,…,256}. Contains the second subset set ij Contains 10 power consumption traces.

[0057] S103, using a test vector leakage assessment method to evaluate the first subsets set i The power consumption trace t in is reduced in dimension to obtain the leakage interval step length, and the data on each power consumption trace t is determined to correspond to multiple leakage intervals according to the leakage interval step length.

[0058] Exemplarily, the Test Vector Leakage Assessment (TVLA) uses Welch's t-test to determine whether there is a dependency between the number of operations and the energy consumption. The present invention determines the interval of the leakage point through TVLA analysis and divides the power consumption trace within the corresponding interval.

[0059] Specifically, when implementing TVLA, each first subset set is set according to the preset Hamming value. i Divide into two groups, and determine whether there is leakage by testing the mean difference between the data on the two groups of power consumption traces. The null hypothesis of the test is that the means of the data on the two groups of power consumption traces are the same, that is, there is no leakage, and the alternative hypothesis is that the means of the data on the two groups of power consumption traces are different, that is, there is leakage. The calculation formula of the test statistic t value of TVLA is as follows:

[0060]

[0061] Among them, (n0,μ0,S0 2 ) and (n1,μ1,S1 2 ) are the sample size, sample mean, and sample variance of the two sets of energy consumption data, respectively. In the process of analyzing the energy trace, the TVLA method requires that each sampling point be experimentally tested one by one. In order to verify whether the data collected on the power consumption trace is sufficient to support the conclusion of rejecting the null hypothesis, Welch's t-test is used as an evaluation method. When the test statistic t shows significantly high positive and negative values, it indicates a high degree of distrust in the null hypothesis (i.e., no leakage). Specifically, if the t-value at any sampling point exceeds the preset threshold limit, it can be considered that there is a potential leakage phenomenon at that point.

[0062] The setting of the threshold is directly related to the confidence level of rejecting the null hypothesis. Although a higher threshold can reduce the risk of misjudgment, it may also cause real leaks to be ignored; on the contrary, a threshold that is too low may falsely report leaks. Therefore, a balance needs to be considered when setting the threshold to ensure that it is neither too strict nor too lenient.

[0063] To enhance the accuracy of judgment, the TVLA process can introduce a double independent experiment design. This strategy requires that only when the test statistic Q exceeds the set threshold in the same direction (positive or negative) in two independent experiments can the leakage be finally confirmed. Such a double confirmation mechanism helps to improve the reliability and stability of the detection results.

[0064] According to the results of TVLA analysis, the leakage intervals of the same length are divided. 00 For example, consider the first neuron, there are four multiplication operations: m i0 =w i0 * x0 ,i∈{0,1,2,3}, so the corresponding power consumption trace analysis result will have four peaks, the first peak corresponds to m 00 The leakage situation is detected, the first peak is magnified and the location of the leakage point is observed. After multiple measurements, the leakage interval size d is finally determined.

[0065] After partitioning, the size of the data set is greatly reduced, which not only improves the accuracy of the analysis results but also reduces the requirements for computing resources.

[0066] S104, screening multiple leakage intervals to obtain a second leakage interval set, constructing a first data set using the second leakage interval set and the power consumption trace t corresponding to each data in the second leakage interval set, and determining the label of each data in the first data set, training a convolutional neural network using the first data set and the label to obtain a first analysis model f of all Hamming weights c (t).

[0067] Exemplarily, due to the influence of realistic factors, the side channel information used by the side channel attack will be accompanied by a certain amount of noise. However, since the design of the neural network depends on the data and not on the probability distribution of the noise, it has a certain robustness to noises of different intensities and types. Convolutional neural networks (CNNs) have efficient feature extraction capabilities and can automatically extract useful information from input data. For large-scale power consumption data, convolutional neural networks can also effectively remove noise and redundant information in the data through pooling operations. Therefore, the present invention selects convolutional neural networks as classifiers.

[0068] Note that there are N power consumption traces, the starting value of the leakage interval of each power consumption trace is s, and the power consumption trace in the interval from s to s+d is taken as m 00 The power consumption of N power consumption traces is taken in this interval, and the power consumption trace t with dimension (N, d) is obtained, which is recorded as trace. Then D train ={t i [s,s+d]|t∈trace}.

[0069] For example, based on a convolutional neural network, with a training set D train As model input, LabelHW 00 As labels, train the model and obtain the analytical model f of all Hamming weights c (t).

[0070] S105, classifying the data in the first data set according to the Hamming weight to obtain a plurality of third subsets, and respectively using the plurality of third subsets to train the convolutional neural network to obtain a second analysis model f corresponding to each Hamming weight. k (t)(k=1,2,…,14).

[0071] For example, the first data set needs to be grouped into 14 groups (LabelHW 00 =1,2,…,14), each set of power consumption traces has the same Hamming weight, and 14 models f are trained using these 14 data sets. k (t)(k=1,2,…,14),f k (t) is used to distinguish between labels that meet LabelHW 00 = all weights of k.

[0072] S106, according to the second subset set ij , using the first analysis model and the second analysis model, the weights of the corresponding neurons in the MLP in the target device are calculated.

[0073] Specifically, in step S106, using the second subset set ij Through the first analytical model f c (t) and the second analytical model f k (t)(k=1,2,…,14), calculate and obtain the weights of the corresponding neurons in the MLP in the target device, including the following steps S1061 to S1063.

[0074] S1061, set the second subset ij Input into the first analysis model f c (t), we get the same as the second subset set ij Corresponding multiple one-dimensional arrays aw i ; Among them, the one-dimensional array aw i The elements in represent the probability of occurrence of each Hamming weight;

[0075] S1062, according to the one-dimensional array aw i Determine the first Hamming weight, and determine the corresponding second analysis model f according to the first Hamming weight k (t)(k=1,2,…,14), the second subset set ij Input to the second analysis model f k (t)(k=1,2,…,14), we get the same as the second subset set ij Corresponding multiple one-dimensional arrays aw j , where the one-dimensional array aw jThe elements in represent the probability of occurrence of different weights. Here, according to the one-dimensional array aw i Determine the first Hamming weight, including:

[0076] (1) For multiple one-dimensional arrays aw i Perform a logarithm operation to obtain a first array set.

[0077] (2) Sum the array elements corresponding to the same index in the first array set to obtain a second array.

[0078] (3) Performing an exponential transformation on the second array set to obtain a predicted probability distribution array, and determining the value with the largest probability in the predicted probability distribution array as the first Hamming weight.

[0079] S1063, determine the one-dimensional array aw j The weight corresponding to the maximum value.

[0080] In the present invention, the calculation formula of the Hamming weight is expressed as:

[0081] LabelHW = HW(m);

[0082] Among them, HW(·) represents the Hamming function; m represents the sensitive value, m=c(x,w), c represents a constant; x represents the input data; w represents the weight, and LabelHW represents the Hamming weight.

[0083] For example, for set ij The power consumption trace in t is then used as f c The input and output of (t) are both one-dimensional arrays of length 16. i i={0,1,..,15}, corresponding to the probability of different Hamming weights. Specifically, to get the set ij The corresponding Hamming weight, the steps are as follows:

[0084] (1) For each aw i Array[p i,0 ,p i,1 ,…,p i,15 ], the logarithm of the probability in the first array is expressed as:

[0085] log(aw i )=[log(p i,0 ),log(p i,2 ),…,log(p i,15 )], i = {0, 1, 2, ..., 15};

[0086] (2) For all log(aw i) The results corresponding to the same index of the array are summed to obtain the second array, which is specifically expressed as:

[0087] (3) Then, new The array is exponentially transformed to obtain the final predicted probability distribution array, which is expressed as:

[0088] After obtaining the Hamming weight h∈{0,1,…,15}, we can get multiple weight candidate values ​​that meet the requirements (except when h=0 and h=15). To get the only correct weight value, we need to set ij The power consumption traces in the classifier f h The input and output of (t) are both one-dimensional arrays of length 256. j ,j={0,1,..,255}, corresponding to the probabilities of different weights. ij The final weight value is obtained by following the same steps as above. Figure 3 The figure shows the overall process of restoring weights. Figure 3 In the figure, Target Devlce represents the target device; Capture represents acquisition; Input represents input; Trained DL model represents the first analysis model obtained by training the model; LabelHWk represents the Hamming weight equals k; Trace represents the power consumption trace; and Weight represents the weight.

[0089] In a specific embodiment provided by the present invention, let the input be x, the weight be w, the power consumption trace be t, define a sensitive intermediate value operation as c, then the sensitive value is m=c(x,w). The Hamming weight (HW) is the number of non-zero bits in a binary string, which can quantify the leakage of power consumption, let LabelHW=HW(m).

[0090] By providing a series of random inputs and collecting power consumption data, each input x, weight w, power consumption trace t and corresponding label are organized together to form a training data set and a validation set. The data set is represented as:

[0091] D train 0 ={(x,w,t,LabelHW) k |k=1,2,…,N t};

[0092] The validation set is represented as:

[0093] D verify ={(x,w,t,LabelHW) k|k=1,2,…,N v};

[0094] Among them, N t and N v Indicates the number of samples.

[0095] Provide known random inputs to the target neural network, collect the power consumption traces formed during each input operation, and form a test set D attack ={(x,t) k |k=1,2,…,N a}, where N a Indicates the number of samples. Input x i and weight w ij are all 8-bit integers ∈[0,255]∩N, attack point m ij ∈[0,65025]∩N.

[0096] The present invention focuses on the multiplication of the first input and weight in the first neuron, i.e., the attack point m 00 Since each power consumption trace has too many sampling points, some preprocessing operations are needed to reduce the dimension of the data. First, determine the location of the leakage point, and then split the corresponding leakage interval to achieve the purpose of dimensionality reduction. 00 For example, we first obtain different power consumption traces by providing different known non-zero inputs x0, and then separate the leakage interval of each power consumption trace. Finally, the classifier is used in LabelHW 00 The classification model is trained on the labeled power consumption trace, where LabelHW 00 ∈[0,15]∩N. During the attack, for a given power consumption trace, the classifier will output an array of size 16×1, representing the probabilities of 16 different labels. However, only through the known non-zero input x0 and the intermediate value m 00 The Hamming weight cannot uniquely determine the weight w 00 (Except 0 and 255), because there are cases where different weight assumptions produce the same Hamming weight. Therefore, it is necessary to train 14 more classifiers f k (t)(k=1,2,…,14),f k (t) is used to distinguish between labels that meet LabelHW 00 = all weights of k.

[0097] The present invention provides a neural network weight side channel recovery method based on deep learning, which can simplify the analysis process: by introducing a convolutional neural network to analyze the power consumption trace, the present invention successfully bypasses the shortcomings of the CPA (side channel analysis) method in dealing with the power consumption trace alignment problem, and directly realizes the ability to extract neural network weight information from waveform data, greatly simplifying the side channel analysis process and reducing the complexity and technical threshold of the analysis.

[0098] The present invention provides a neural network weight side channel recovery method based on deep learning, which can improve the accuracy of weight recovery: using the powerful learning ability of deep learning, the model can establish a more refined and accurate mapping relationship between waveform data and neural network weights through training with a large amount of data. This refined mapping relationship effectively improves the accuracy of weight recovery.

[0099] The present invention provides a neural network weight side channel recovery method based on deep learning, which can improve the analysis efficiency: once the model is trained, its powerful generalization ability allows the weights of the neural network to be inferred with only a small amount of power consumption traces, which significantly improves the efficiency of side channel analysis compared to traditional methods. The efficient analysis process makes it possible to complete the security assessment of large-scale neural networks in a shorter time.

[0100] The present invention provides a neural network weight side channel recovery method based on deep learning that can enhance security assessment tools: As an innovative side channel analysis method, the successful application of the present invention will inject new vitality into the field of neural network security assessment, provide more powerful tool support, help discover potential security vulnerabilities, and enhance the protection capabilities of neural network models.

[0101] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. All or part of the present invention can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, mobile communication terminals, multi-processor systems, microprocessor-based systems, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.

[0102] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the present invention.

Claims

1. A neural network weight side channel recovery method based on deep learning, characterized in that: include: Collect the total power consumption trace T of the target device under different input signals for multiple times, determine the power consumption trace t corresponding to a peak according to the total power consumption trace T, and construct multiple first subsets set according to the power consumption trace t i ; Among them, each first subset set i The weights are different, and the weights are related to the input signals; Each of the first subsets set i Divide into the second subset set ij ; Wherein, the peak of the power consumption trace t corresponds to the neuron loaded on the MLP of the target device; The plurality of first subsets set are evaluated by a test vector leakage evaluation method. i The power consumption trace t in the embodiment is reduced in dimension to obtain the leakage interval step length, and the data on each power consumption trace t is determined to correspond to a plurality of leakage intervals according to the leakage interval step length; Screening the multiple leakage intervals to obtain a second leakage interval set, constructing a first data set using the second leakage interval set and the power consumption trace t corresponding to each data in the second leakage interval set, determining a label of each data in the first data set, and training a convolutional neural network using the first data set and the label to obtain a first analysis model of all Hamming weights; Classifying the data in the first data set according to the Hamming weight to obtain a plurality of third subsets, and respectively using the plurality of third subsets to train the convolutional neural network to obtain a second analysis model corresponding to each Hamming weight; According to the second subset set ij , using the first analysis model and the second analysis model, calculate the weights of the corresponding neurons in the MLP in the target device.

2. The neural network weight side channel recovery method based on deep learning according to claim 1, characterized in that: The first subsets set are constructed according to the power consumption trace t. i ,include: Set multiple weights w and input data sets x; Using the multiple weights w to weight each input data in the input data set x, to obtain multiple input signals of the target device; Collect multiple power consumption traces t corresponding to the multiple input signals, and classify the power consumption traces t according to different weights to obtain multiple first subsets set i .

3. The neural network weight side channel recovery method based on deep learning according to claim 1, characterized in that: The first subset set i Divide into the second subset set ij ,include: Determine each first subset set i The input data set x is inputted into the target device repeatedly for multiple times to obtain multiple corresponding power consumption traces t, and the power consumption traces t corresponding to the same input data are added to the first subset set i In, get the preprocessed subset; The preprocessed subset is divided according to the principle of the same input data to obtain the second subset set ij .

4. The method for recovering a neural network weight side channel based on deep learning according to claim 1, characterized in that: The screening of the multiple leakage intervals to obtain a second leakage interval set includes: A starting position is determined, and the plurality of leakage intervals are processed according to the starting position and the leakage interval step to obtain a second leakage interval set.

5. The neural network weight side channel recovery method based on deep learning according to claim 1, characterized in that: The first subset set i Divide into the second subset set ij ; Wherein, the peak of the power consumption trace t corresponds to the neuron loaded on the MLP of the target device, including: The second subset set ij are respectively input into the first analysis model to obtain the second subset set ij Corresponding multiple one-dimensional arrays aw i ; Wherein, the one-dimensional array aw i The elements in represent the probability of occurrence of each Hamming weight; According to the one-dimensional array aw i Determine a first Hamming weight, and determine a corresponding second analysis model according to the first Hamming weight, and set the second subset ij Input into the second analysis model, and obtain the second subset set ij Corresponding multiple one-dimensional arrays aw j , where the one-dimensional array aw j The elements in represent the probability of occurrence of different weights; Determine the one-dimensional array aw j The weight corresponding to the maximum value is used as the weight of the corresponding neuron in the MLP in the target device.

6. The neural network weight side channel recovery method based on deep learning according to claim 5, characterized in that: According to the one-dimensional array aw i Determine the first Hamming weight, including: For the multiple one-dimensional arrays aw i Perform a logarithm operation to obtain a first array set; Summing the array elements corresponding to the same index in the first array set to obtain a second array; Perform an exponential transformation on the second array set to obtain a predicted probability distribution array, and determine a value with the highest probability in the predicted probability distribution array as a first Hamming weight.

7. The method for recovering side channel of neural network weights based on deep learning according to claim 1, characterized in that: The calculation formula of the Hamming weight is expressed as: LabelHW = HW(m); Among them, HW(·) represents the Hamming function, m represents the sensitive value, m=c(x,w), c represents a constant; x represents input data; w represents weight, and LabelHW represents the Hamming weight.

Citation Information

Patent Citations

  • Kohonen-SVM based complex equipment degeneration state identification method

    CN107563414A

  • Side channel attack protection method for deep learning algorithm

    CN111597551A

  • Method for analyzing convolutional neural network by selecting input horizontal energy and application

    CN115329327A

  • Side channel analysis method based on deep learning

    CN116388956A

  • Unmanned aerial vehicle physical attack detection and recovery method and device based on machine learning

    CN117349628A

Cited By

  • CKKS embedded implementation-oriented side channel analysis method and system

    CN120342520A