Method and application of a level energy analysis convolutional neural network for selecting input
Patent Information
- Application Number
- CN202211014386.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-23
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2042-08-23
AI Technical Summary
[0008]本发明的目的在于提供一种选择输入的水平能量分析卷积神经网络的方法及应用,用以解决现有技术中对神经网络的权重参数进行侧信道分析时由于将所有输入数据均输入到神经网络模型中导致其运算功耗量大、以及权重参数分析准确率低等技术问题
[0050]与现有技术相比,根据本发明实施方式的选择输入的水平能量分析卷积神经网络的方法及应用,采用选择输入数据的方式对卷积神经网络模型的权重参数进行侧信道分析,减少卷积神经网络模型执行所需的功耗曲线量,同时,减少或消除在分析过程中卷积神经网络模型的各个权重参数之间的关联性,从而改善了因参数错误传递导致分析准确低的问题,有效提高了分析准确率。
Smart Images

Figure CN115329327B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method and application of a convolutional neural network for selecting input level energy analysis. Background Technology
[0002] The rapid development of artificial intelligence (AI) technology in recent years has brought profound changes to human society and has gradually become mainstream in many industries. Numerous application examples have proven its effectiveness in secure applications. Inspired by research on the biological processes of the animal visual cortex, convolutional neural networks (CNNs) were proposed. CNNs are a commonly used neural network model, frequently used in image recognition, natural language learning, and motion analysis. From a computational perspective, CNNs are not significantly different from ordinary neural networks; they consist of many layers, each composed of a matrix of neurons. CNNs primarily use three layers: convolutional layers, pooling layers, and fully connected layers.
[0003] The Internet of Things (IoT) has become an important part of today's information technology, with a large number of IoT edge devices using artificial intelligence being deployed. Most of these devices employ cloud data processing methods, where the edge devices upload collected data to the cloud, the data is processed on cloud servers, and the results are then returned to the edge devices. This method is not suitable for devices requiring real-time response. There are application scenarios that necessitate the direct deployment of artificial intelligence applications in embedded devices; therefore, processing machine learning algorithms on microprocessors has become a technical necessity.
[0004] CMSIS-NN is one solution. The CMSIS-NN software library is a high-performance kernel developed for applying machine learning to ARM Cortex-M series processor cores. This library contains many functions, each belonging to a specific category: convolution functions, activation functions, fully connected layer functions, pooling functions, SVDF layer functions, softmax functions, and basic mathematical functions, enabling us to implement high-performance neural network applications with minimal memory footprint on Arm Cortex-M processors.
[0005] Convolutional neural network (CNN) model parameters are extremely valuable. IoT edge devices are deployed in complex environments, often unattended, making them vulnerable to side-channel analysis threats. The security risks of embedded devices implementing artificial intelligence applications are also gradually being exposed. With continued attention focused on the side-channel security issues of embedded neural networks, many side-channel analysis methods for neural networks have emerged. Many works utilize the side-channel information of hardware devices to analyze neural networks. These include traditional side-channel analysis using information such as time, sound, electromagnetic radiation, and power consumption; and software side-channel analysis using information such as cache and memory access. For example, for AlexNet and SqueezeNet deployed on CNN accelerators, side-channel analysis can be performed using the latency information generated by chip memory access during dynamic pruning in the neural network model execution process. This method relies on the special memory access patterns of dynamic pruning techniques during neural network execution. Because CNNs generate a large number of zero values after executing activation functions, and CNN accelerators only read and write non-zero values, the differences in memory access latency caused by the different numbers of zero values generated under different inputs can be used to inversely deduce the structure and parameter information of the neural network.
[0006] Furthermore, for convolutional neural networks implemented as CMSIS-NN, electromagnetic radiation information can be used to perform correlation energy analysis on the neural network. Using the multiplication result of the input data and weight data as intermediate value data, the correlation between the intermediate value data (Hamming weight) and electromagnetic information is calculated, thereby reversing the parameters of the neural network. Besides side-channel analysis of the internal information of the neural network, there are also side-channel analysis methods that target the neural network's input information. Given the internal information of the neural network model, electromagnetic radiation information, combined with the multiplication result of the input data and different weight data, allows for the reversal of the neural network's input dataset through horizontal energy analysis.
[0007] In summary, how to utilize side-channel information to perform side-channel analysis on neural networks and verify the security of internal information in neural network models implemented in embedded devices remains of great significance. Summary of the Invention
[0008] The purpose of this invention is to provide a method and application for selecting input level energy analysis convolutional neural networks, in order to solve the technical problems in the prior art, such as high computational power consumption and low accuracy of weight parameter analysis, when performing side-channel analysis on the weight parameters of neural networks, because all input data is input into the neural network model.
[0009] To achieve the above objectives, embodiments of the present invention provide a method for selecting input horizontal energy analysis convolutional neural networks, the method comprising:
[0010] Based on the positions of multiple target parameters to be analyzed in the convolutional neural network model, multiple input data corresponding to the multiple target parameters to be analyzed are selected and input into the convolutional neural network model;
[0011] A first energy consumption matrix is constructed based on the power consumption generated by the calculation results of the convolutional neural network model on multiple target parameters to be analyzed and multiple input data.
[0012] Set all candidate values for each target parameter to be analyzed, and construct a second energy consumption matrix based on the calculation results of all the candidate values and multiple input data;
[0013] The correlation between the first energy consumption matrix and the second energy consumption matrix is calculated to obtain the correlation coefficient of all candidate values of each target parameter to be analyzed. The candidate value with the largest correlation coefficient is selected as the analysis result of the target parameter to be analyzed.
[0014] In one or more embodiments of the present invention, the step of selecting multiple input data corresponding to the multiple target parameters to be analyzed based on their positions in the convolutional neural network model, and inputting them into the convolutional neural network model, includes:
[0015] The input data that participates in the multiplication operation with multiple target parameters to be analyzed is set to non-zero values, and the remaining data is set to zero.
[0016] In one or more embodiments of the present invention, constructing a first energy consumption matrix based on the power consumption generated by the operation results of the convolutional neural network model on multiple target parameters to be analyzed and multiple input data includes:
[0017] Multiple target parameters to be analyzed are multiplied with multiple input data to obtain multiple first intermediate value data, and the multiple first intermediate value data are input into the convolutional neural network model;
[0018] The power consumption curves generated by the convolutional neural network model executing multiple first intermediate value data are segmented to obtain multiple power consumption curve segments;
[0019] The power consumption curve segments involved in the calculations for all the target parameters to be analyzed are selected, and a first energy consumption matrix is constructed.
[0020] In one or more embodiments of the present invention, the step of segmenting the power consumption curves generated by the convolutional neural network model executing multiple first intermediate value data to obtain multiple power consumption curve segments includes:
[0021] Based on the characteristics of the convolution operation of the convolutional neural network model, the power consumption generated by the convolutional neural network model in executing multiple first intermediate value data is obtained, and multiple power consumption curves of the target parameters to be analyzed participating in the operation are obtained.
[0022] Based on the position of each target parameter to be analyzed in the calculation, determine the range of each target parameter to be analyzed on the power consumption curve;
[0023] According to the range of each target parameter to be analyzed on the power consumption curve, the multiple power consumption curves are divided into multiple power consumption curve segments.
[0024] In one or more embodiments of the present invention, setting all candidate values for each target parameter to be analyzed, and constructing a second energy consumption matrix based on the calculation results of all the candidate values and multiple input data, includes:
[0025] Each candidate value of the target parameter to be analyzed is multiplied with multiple input data to obtain multiple second intermediate value data, and the multiple second intermediate value data are constructed into a simulated intermediate value matrix;
[0026] The second energy consumption matrix is obtained by mapping the simulated intermediate value matrix using the Hamming weight model.
[0027] In one or more embodiments of the present invention, calculating the correlation between the first energy consumption matrix and the second energy consumption matrix to obtain the correlation coefficient of all candidate values of each target parameter to be analyzed includes:
[0028] The correlation between the first energy consumption matrix and the second energy consumption matrix is calculated using the Pearson correlation coefficient formula, thereby obtaining the correlation coefficient of all candidate values of each target parameter to be analyzed.
[0029] In one or more embodiments of the present invention, the convolutional neural network model is a convolutional neural network model based on the CMSIS-NN model deployed on the ARM Cortex-M3 hardware platform, and the convolutional neural network model includes a first convolutional layer, a first pooling layer, a second convolutional layer, a second pooling layer, a third convolutional layer, a third pooling layer, and a fully connected layer connected in sequence.
[0030] And / or, the input data is data from the CIFAR-10 dataset.
[0031] In another aspect of the invention, a horizontal energy analysis convolutional neural network system for selecting inputs is also provided, the system comprising:
[0032] The selection module is used to select multiple input data corresponding to the multiple target parameters to be analyzed based on their positions in the convolutional neural network model, and input them into the convolutional neural network model.
[0033] The first construction module is used to construct a first energy consumption matrix based on the power consumption generated by the operation results of the convolutional neural network model on multiple target parameters to be analyzed and multiple input data.
[0034] The second construction module is used to set all candidate values for each target parameter to be analyzed, and to construct a second energy consumption matrix based on the calculation results of all the candidate values and multiple input data.
[0035] The calculation module is used to calculate the correlation between the first energy consumption matrix and the second energy consumption matrix to obtain the correlation coefficient of all candidate values of each target parameter to be analyzed, and select the candidate value with the largest correlation coefficient as the analysis result of the target parameter to be analyzed.
[0036] In one or more embodiments of the present invention, the selection module is further configured to: set the input data that participates in the multiplication operation with the multiple target parameters to be analyzed to non-zero values, and set the remaining data to zero.
[0037] In one or more embodiments of the present invention, the first construction module is further configured to: perform multiplication operations on multiple target parameters to be analyzed and multiple input data to obtain multiple first intermediate value data, and input the multiple first intermediate value data into the convolutional neural network model;
[0038] The power consumption curves generated by the convolutional neural network model executing multiple first intermediate value data are segmented to obtain multiple power consumption curve segments;
[0039] The power consumption curve segments involved in the calculations for all the target parameters to be analyzed are selected, and a first energy consumption matrix is constructed.
[0040] In one or more embodiments of the present invention, the first building module is further configured to: obtain the power consumption generated by the convolutional neural network model executing multiple first intermediate value data, and obtain multiple power consumption curves of the target parameters to be analyzed participating in the operation;
[0041] Based on the position of each target parameter to be analyzed in the calculation, determine the range of each target parameter to be analyzed on the power consumption curve;
[0042] According to the range of each target parameter to be analyzed on the power consumption curve, the multiple power consumption curves are divided into multiple power consumption curve segments.
[0043] In one or more embodiments of the present invention, the second construction module is further configured to: perform multiplication operations on all candidate values of each target parameter to be analyzed with multiple input data to obtain multiple second intermediate value data, and construct a simulated intermediate value matrix from the multiple second intermediate value data;
[0044] The second energy consumption matrix is obtained by mapping the simulated intermediate value matrix using the Hamming weight model.
[0045] In one or more embodiments of the present invention, the calculation module is further configured to: calculate the correlation between the first energy consumption matrix and the second energy consumption matrix using the Pearson correlation coefficient calculation formula, and obtain the correlation coefficient of all candidate values of each target parameter to be analyzed.
[0046] In another aspect of the invention, an electronic device is also provided, the electronic device comprising:
[0047] At least one processor;
[0048] And a memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the method described above for selecting input level energy analysis convolutional neural networks.
[0049] In another aspect of the invention, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the method for selecting input level energy analysis convolutional neural networks as described above.
[0050] Compared with the prior art, the method and application of selecting input horizontal energy analysis convolutional neural networks according to the embodiments of the present invention perform side-channel analysis on the weight parameters of the convolutional neural network model by selecting input data, thereby reducing the amount of power consumption curve required for the execution of the convolutional neural network model. At the same time, it reduces or eliminates the correlation between the various weight parameters of the convolutional neural network model during the analysis process, thereby improving the problem of low analysis accuracy caused by parameter error propagation and effectively improving the analysis accuracy. Attached Figure Description
[0051] Figure 1 This is a flowchart of a method for selecting input level energy analysis convolutional neural networks according to an embodiment of the present invention;
[0052] Figure 2 This is a block diagram illustrating the principle of a method for selecting input level energy analysis of a convolutional neural network according to an embodiment of the present invention.
[0053] Figure 3 This is a schematic diagram of the structure of a convolutional neural network model for a method of selecting input level energy analysis convolutional neural network according to an embodiment of the present invention;
[0054] Figure 4 This is a diagram illustrating the accumulation and multiplication process of convolution kernels in a convolutional neural network model according to a method for selecting input level energy analysis of a convolutional neural network based on an embodiment of the present invention.
[0055] Figure 5 This is an example diagram of the input data of the first convolutional layer of a convolutional neural network model, which is a method for selecting input level energy analysis of a convolutional neural network according to an embodiment of the present invention.
[0056] Figure 6 This is an example diagram of intermediate value data of the first convolutional layer of a convolutional neural network model, which is a method for selecting input level energy analysis of a convolutional neural network according to an embodiment of the present invention.
[0057] Figure 7 This is an example diagram of the input data of the second convolutional layer of a convolutional neural network model for a method of selecting input level energy analysis of a convolutional neural network according to an embodiment of the present invention;
[0058] Figure 8 This is an example diagram of the input data of the third convolutional layer of a convolutional neural network model according to a method for selecting input level energy analysis of a convolutional neural network according to an embodiment of the present invention;
[0059] Figure 9 This is a schematic diagram of constructing a first energy consumption matrix in a method for selecting inputs for horizontal energy analysis of a convolutional neural network according to an embodiment of the present invention;
[0060] Figure 10 This is a diagram showing the correspondence between the first energy consumption matrix and the simulated intermediate value matrix in the method for selecting input level energy analysis convolutional neural networks according to an embodiment of the present invention.
[0061] Figure 11 This is a schematic diagram illustrating the correlation calculation between the first energy consumption matrix and the second energy consumption matrix in the method for selecting input horizontal energy analysis convolutional neural networks according to an embodiment of the present invention;
[0062] Figure 12 This is a schematic diagram of the system architecture of a horizontal energy analysis convolutional neural network for selecting inputs according to an embodiment of the present invention;
[0063] Figure 13 This is a hardware structure diagram of an electronic device for selecting input level energy analysis convolutional neural networks according to an embodiment of the present invention. Detailed Implementation
[0064] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific embodiments.
[0065] Unless otherwise expressly stated otherwise, throughout the entire specification and claims, the term "comprise" or variations thereof such as "comprises", "comprising", etc. will be understood to include the stated elements or components, but do not exclude other elements or other components.
[0066] Reference Figure 2 , the method for horizontal energy analysis convolutional neural network with selective input proposed by the present invention is a side-channel analysis method for neural networks. The target model may be a convolutional neural network model deployed on an ARM Cortex-M3 hardware platform based on the CMSIS-NN model. The convolutional neural network model comprises a first convolutional layer, a first pooling layer, a second convolutional layer, a second pooling layer, a third convolutional layer, a third pooling layer and a fully connected layer which are connected in sequence, consisting of 7 layers in total, and is mainly used for image classification. The input data of the model may be known data from the CIFAR-10 dataset.
[0067] The technical solutions provided by various embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0068] Reference Figure 1 , one embodiment of the method for horizontal energy analysis convolutional neural network with selective input according to the present invention will be described. In this embodiment, the method comprises the following steps.
[0069] S101, based on the positions of a plurality of target parameters to be analyzed in the convolutional neural network model, selecting a plurality of input data corresponding to the plurality of target parameters to be analyzed, and inputting the plurality of input data into the convolutional neural network model.
[0070] In one or more embodiments of the present invention, the target parameters to be analyzed are weight parameters w of the convolutional neural network model. It is set that the convolutional neural network model initially includes 800 correlated weight parameters w, and these weight parameters w are respectively located in different network layers of the convolutional neural network model. According to the position of each weight parameter w in the convolutional neural network model, the corresponding input data x is selected from the CIFAR-10 dataset and input into the convolutional neural network model.
[0071] In the convolutional neural network model, the convolution kernel of each convolutional layer slides on its input data x according to a corresponding step size. Each sliding performs one convolution operation, and finally an output data is generated. For example Figure 4As shown, in a single convolution operation, the convolution kernel of the convolutional layer performs an accumulation and multiplication operation with multiple input data x input to the convolutional layer. Correspondingly, the weight parameter w in the convolutional layer also performs a multiplication operation with the corresponding input data x, and returns after accumulating the initial value.
[0072] Based on the above operational characteristics, when selecting input data x, the input data that participates in the multiplication operation with multiple target parameters to be analyzed is set to a non-zero value, and the remaining data is set to zero.
[0073] Exemplary, Participants Figure 3 Assume the input data size of the first convolutional layer of this convolutional neural network is 32*32*3, the output data size is 32*32*32, and the kernel size is 5*5*3. The multiplication result obtained by sliding the kernel 5 times over the corresponding input data x is taken as the intermediate value. The first layer's convolutional kernel consists of 32 5*5*3 kernels, each performing the same operation with multiple input data x within its corresponding region. When the target parameter to be analyzed is the first weight parameter w1 in the first convolutional layer, the corresponding input data x is as follows: Figure 5 As shown, within the range of a convolution kernel operation, the input data x1, x2…x at the positions corresponding to the target parameter w1 are processed. n All input data are set to non-zero values, and all other input data are set to zero values. The intermediate values obtained from the calculation are as follows: Figure 6 As shown.
[0074] Similarly, when the target parameter to be analyzed is w2, the input data x at the position corresponding to the target parameter w2 is set to a non-zero value, and the rest of the data is set to zero. This process is repeated for the input data corresponding to the weight parameters in the later stages of the first convolutional layer.
[0075] For the second convolutional layer of a convolutional neural network, assume its input data size is 16*16*32, its output data size is 16*16*16, and its kernel size is 5*5*32*16. There is a correlation between every 32 weight parameters in the second convolutional layer. Similarly, the multiplication result produced by sliding the kernel 5 times over the corresponding input data x is chosen as the intermediate value. Each 5*5*32*16 convolutional kernel is then used to perform the same operation with multiple input data x within the corresponding region. Similarly, when the target parameter to be analyzed is the first weight parameter in the second convolutional layer, the corresponding input data x is as follows: Figure 7 As shown, the input data x corresponding to the position of this weight parameter is set to a non-zero value, and the rest of the data is set to zero. This process is repeated for the input data corresponding to the subsequent weight parameters in the second convolutional layer.
[0076] For the third convolutional layer of a convolutional neural network, assume that the size of both the input data and the output data is 8*8*16, and the size of the convolution kernel is 5*5*16*32. There is correlation between every 16 weight parameters in the third convolutional layer. Similarly, the multiplication results generated by sliding the convolution kernel 5 times on the corresponding input data x are selected as intermediate value data. Each 5*5*16*32 convolution kernel performs the same operation with multiple pieces of input data x in the corresponding region. When the target parameter to be analyzed is the first weight parameter in the third convolutional layer, the corresponding input data x is as Figure 8 shown, all input data x at positions corresponding to the weight parameter are set to non-zero values, and the remaining data are set to zero. By analogy, the input data corresponding to the subsequent weight parameters in the third convolutional layer are obtained.
[0077] S102, constructing a first energy consumption matrix based on the power consumption generated by the operation results of a plurality of target parameters to be analyzed and a plurality of pieces of input data executed based on the convolutional neural network model.
[0078] In one or more embodiments of the present invention, the multiplication operation process between the weight parameter w and a plurality of pieces of input data x is taken as the attack target. In one operation of the convolutional neural network model, one weight parameter w will perform multiplication with a plurality of different pieces of input data x. A plurality of to-be-analyzed weight parameters w are multiplied with a plurality of pieces of input data x to obtain a plurality of first intermediate value data f(x,w), and the plurality of first intermediate value data f(x,w) are input into the convolutional neural network model. The first intermediate value data f(x,w) includes the multiplication results generated by the above convolution kernel sliding 5 times on the corresponding input data x.
[0079] Segmenting the power consumption curves generated by the convolutional neural network model executing the plurality of first intermediate value data f(x,w) to obtain a plurality of power consumption curve segments. Specifically, based on the characteristic that one weight parameter w performs multiplication with a plurality of different pieces of input data x in one operation of the convolutional neural network model, the power consumption generated by the convolutional neural network model executing the plurality of first intermediate value data f(x,e) is obtained, so that corresponding to the plurality of different pieces of input data x, a plurality of power consumption curves are obtained. Each power consumption curve involves the weight parameter w participating in the operation.
[0080] Ref Figure 9 erencing, determining the corresponding range of the weight parameter w on each power consumption curve according to the position where the weight parameter w performs multiplication with the plurality of pieces of input data x, and then segmenting the plurality of power consumption curves into a plurality of power consumption curve segments respectively according to the corresponding ranges. The information contained in each power consumption curve segment is the power consumption information corresponding to one multiplication operation performed by the weight parameter w and one piece of input data x. Finally, all power consumption curve segments in which the weight parameters w participate in the multiplication operation are screened out, and the first energy consumption matrix T is constructed, T = [p1 p2 … p n, wherein p represents a power consumption curve segment corresponding to a single multiplication operation performed by the weight parameter w and the input data x. The first energy consumption matrix T is the actual power consumption generated by the convolutional neural network model when performing multiplication operations of all target parameters to be analyzed and a plurality of input data.
[0081] In actual operation, before the multiplication operation runs, a rising edge voltage is applied to the development board, and a falling edge voltage is applied to the development board when the multiplication operation ends. All power consumption curve segments within the high voltage range are power consumption information corresponding to a single multiplication operation performed by the target parameters and a plurality of input data. The power consumption curve segments corresponding to the multiplication operations participated by all target parameters are arranged sequentially according to the execution order of the multiplication operations. According to the order of multiplication operations performed by non-zero input data and the target parameters, corresponding power consumption curve segments are found among all power consumption curve segments corresponding to the multiplication operations and saved in order. These power consumption curve segments are curve segments determined according to a plurality of input data participating in the operation, and the first energy consumption matrix T is constructed from these power consumption curve segments. The row vectors of the first energy consumption matrix T are the segmented power consumption curve segments, which will participate in subsequent correlation calculation.
[0082] S103, setting all candidate values of each target parameter to be analyzed, and constructing a second energy consumption matrix based on operation results of all the candidate values and a plurality of the input data.
[0083] Specifically, all candidate values of each weight parameter w in the convolutional neural network model are set first, and the input data x is known non-constant data. All candidate values of each weight parameter w are respectively multiplied by a plurality of different input data x to obtain a plurality of second intermediate value data f(x N ,w K ), wherein both N and K are integers greater than zero, N represents the number of input data x, and K represents the number of all candidate values of each weight parameter w.
[0084] as shown in Figure 10 , the above plurality of second intermediate value data f(x N ,w K ) is constructed into a simulated intermediate value matrix V=[α1 α2 … α K , wherein α represents a result obtained by performing one multiplication operation on each candidate value of the weight parameter w and a plurality of input data x. Column vectors of the simulated intermediate value matrix V correspond to row vectors of the first energy consumption matrix T.
[0085] refe Figure 11 rence, a Hamming weight model can be used to map the intermediate value data in the simulated intermediate value matrix V to simulated energy consumption values, so as to map the simulated intermediate value matrix V to obtain a second energy consumption matrix H=[h1 h2 … h K, wherein h represents the simulated power consumption corresponding to a single multiplication operation performed between each candidate value of the weight parameter w and a plurality of input data x. The second energy consumption matrix H is the simulated power consumption generated by the multiplication operation results of all target parameters to be analyzed and a plurality of input data.
[0086] S104, calculating a correlation between the first energy consumption matrix and the second energy consumption matrix to obtain correlation coefficients of all candidate values of each target parameter to be analyzed.
[0087] In this embodiment, the pearson correlation coefficient calculation formula can be used to calculate the correlation between the row vector of the first energy consumption matrix T and the column vector of the second energy consumption matrix H, and the specific calculation formula is as follows:
[0088]
[0089] Substituting both the power consumption p in the first energy consumption matrix T and the Hamming weight h in the second energy consumption matrix H into the above formula, all candidate values w1, w2...w of each weight parameter w are obtained K the corresponding correlation coefficients ρ are respectively: for w1: ρ1(p,h), for w2: ρ2(p,h)...w K : ρ K (p,h).
[0090] Comparing the magnitudes of the correlation coefficients ρ corresponding to w1, w2...w K the correlation coefficient of the correct candidate value of the weight parameter w is much larger than the correlation coefficients of other wrong candidate values, thus it can be obtained that the candidate value with the largest correlation coefficient is the analysis result of the corresponding weight parameter w.
[0091] Refer Figure 12 , the following introduces the selected input horizontal energy analysis convolutional neural network system of the preferred embodiment of the present invention.
[0092] In the embodiment of the present invention, the selected input horizontal energy analysis convolutional neural network system comprises a selection module 201, a first construction module 202, a second construction module 203 and a calculation module 204.
[0093] the selection module 201 is configured to select a plurality of input data corresponding to the plurality of target parameters to be analyzed based on positions of the plurality of target parameters to be analyzed in the convolutional neural network model, and input the plurality of input data into the convolutional neural network model;
[0094] the first construction module 202 is configured to construct a first energy consumption matrix based on power consumption generated by operation results of the plurality of target parameters to be analyzed and the plurality of input data executed by the convolutional neural network model;
[0095] The second construction module 203 is used to set all candidate values for each target parameter to be analyzed, and to construct a second energy consumption matrix based on the calculation results of all the candidate values and multiple input data.
[0096] The calculation module 204 is used to calculate the correlation between the first energy consumption matrix and the second energy consumption matrix to obtain the correlation coefficient of all candidate values of each target parameter to be analyzed, and select the candidate value with the largest correlation coefficient as the analysis result of the target parameter to be analyzed.
[0097] The selection module 201 is further configured to: set the input data that participates in the multiplication operation with multiple target parameters to be analyzed to non-zero values, and set the remaining data to zero.
[0098] The first construction module 202 is further configured to: perform multiplication operations on multiple target parameters to be analyzed and multiple input data to obtain multiple first intermediate value data, and input the multiple first intermediate value data into the convolutional neural network model;
[0099] The power consumption curves generated by the convolutional neural network model executing multiple first intermediate value data are segmented to obtain multiple power consumption curve segments;
[0100] The power consumption curve segments involved in the calculations for all the target parameters to be analyzed are selected, and a first energy consumption matrix is constructed.
[0101] The first construction module 202 is further configured to: obtain the power consumption generated by the convolutional neural network model executing multiple first intermediate value data, and obtain multiple power consumption curves of the target parameters to be analyzed participating in the operation;
[0102] Based on the position of each target parameter to be analyzed in the calculation, determine the range of each target parameter to be analyzed on the power consumption curve;
[0103] According to the range of each target parameter to be analyzed on the power consumption curve, the multiple power consumption curves are divided into multiple power consumption curve segments.
[0104] The second construction module 203 is further configured to: perform multiplication operations on all candidate values of each target parameter to be analyzed with multiple input data to obtain multiple second intermediate value data, and construct a simulated intermediate value matrix from the multiple second intermediate value data;
[0105] The second energy consumption matrix is obtained by mapping the simulated intermediate value matrix using the Hamming weight model.
[0106] The calculation module 204 is also used to: calculate the correlation between the first energy consumption matrix and the second energy consumption matrix using the Pearson correlation coefficient calculation formula, and obtain the correlation coefficient of all candidate values of each target parameter to be analyzed.
[0107] Figure 13 A hardware structure diagram of an electronic device 30 for selecting input level energy analysis convolutional neural networks according to an embodiment of this specification is shown. Figure 13 As shown, the electronic device 30 may include at least one processor 301, a memory 302 (e.g., non-volatile memory), a RAM 303, and a communication interface 304, and the at least one processor 301, memory 302, RAM 303, and communication interface 304 are connected together via a bus 305. At least one processor 301 executes at least one computer-readable instruction stored or encoded in the memory 302.
[0108] It should be understood that the computer-executable instructions stored in memory 302, when executed, cause at least one processor 301 to perform the above-described combinations in the various embodiments of this specification. Figure 1-11 The description includes various operations and functions.
[0109] In the embodiments of this specification, electronic device 30 may include, but is not limited to: personal computer, server computer, workstation, desktop computer, laptop computer, notebook computer, mobile computing device, smartphone, tablet computer, cellular phone, personal digital assistant (PDA), handheld device, messaging device, wearable computing device, consumer electronic device, etc.
[0110] According to one embodiment, a program product, such as a computer-readable storage medium, is provided. The computer-readable storage medium may have instructions (i.e., the elements implemented in software as described above), which, when executed by a computer, cause the computer to perform the above-described combinations of the various embodiments of this specification. Figure 1-11 The various operations and functions described. Specifically, a system or apparatus equipped with a readable storage medium storing software program code that implements the functions of any of the embodiments described above, and enabling the computer or processor of the system or apparatus to read and execute the instructions stored in the readable storage medium.
[0111] The method and application of selecting input horizontal energy analysis of convolutional neural networks according to embodiments of the present invention perform side-channel analysis on the weight parameters of the convolutional neural network model by selecting input data, thereby reducing the amount of power consumption curve required for the execution of the convolutional neural network model. At the same time, it reduces or eliminates the correlation between the various weight parameters of the convolutional neural network model during the analysis process, thereby improving the problem of low analysis accuracy caused by parameter error propagation and effectively improving the analysis accuracy.
[0112] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0113] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0114] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0115] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0116] The foregoing description of specific exemplary embodiments of the invention is for illustrative and explanatory purposes. These descriptions are not intended to limit the invention to the precise forms disclosed, and it will be apparent that many changes and variations can be made in accordance with the foregoing teachings. The exemplary embodiments were chosen and described in order to explain the specific principles of the invention and its practical application, thereby enabling those skilled in the art to implement and utilize various different exemplary embodiments of the invention, as well as various different choices and variations. The scope of the invention is intended to be defined by the claims and their equivalents.
Claims
1. A method for selecting input level energy analysis of a convolutional neural network, characterized in that, The method includes: Based on the positions of multiple target parameters to be analyzed in the convolutional neural network model, multiple input data corresponding to the multiple target parameters to be analyzed are selected and input into the convolutional neural network model; wherein, the target parameters to be analyzed are the weight parameters of the convolutional neural network model; A first energy consumption matrix is constructed based on the power consumption generated by the calculation results of multiple target parameters to be analyzed and multiple input data executed by the convolutional neural network model. Set all candidate values for each target parameter to be analyzed, and construct a second energy consumption matrix based on the calculation results of all the candidate values and multiple input data; Calculate the correlation between the first energy consumption matrix and the second energy consumption matrix to obtain the correlation coefficient of all candidate values of each target parameter to be analyzed, and select the candidate value with the largest correlation coefficient as the analysis result of the target parameter to be analyzed; The step of selecting multiple input data corresponding to the multiple target parameters to be analyzed based on their positions in the convolutional neural network model and inputting them into the convolutional neural network model includes: setting the input data that participates in the multiplication operation with the multiple target parameters to be analyzed to non-zero values, and setting the remaining data to zero. The step of constructing a first energy consumption matrix based on the power consumption generated by the operation results of multiple target parameters to be analyzed and multiple input data based on the convolutional neural network model includes: performing multiplication operations on multiple target parameters to be analyzed and multiple input data to obtain multiple first intermediate value data, and inputting the multiple first intermediate value data into the convolutional neural network model; segmenting the power consumption curve generated by the convolutional neural network model executing the multiple first intermediate value data to obtain multiple power consumption curve segments; selecting all power consumption curve segments in which the target parameters to be analyzed participate in the operation, and constructing the first energy consumption matrix.
2. The method for selecting input level energy analysis of a convolutional neural network as described in claim 1, characterized in that, The step of segmenting the power consumption curves generated by the convolutional neural network model executing multiple first intermediate value data to obtain multiple power consumption curve segments includes: The power consumption generated by the convolutional neural network model executing multiple first intermediate value data is obtained, and multiple power consumption curves of the target parameters to be analyzed participating in the operation are obtained. Based on the position of each target parameter to be analyzed in the calculation, determine the range of each target parameter to be analyzed on the power consumption curve; According to the range of each target parameter to be analyzed on the power consumption curve, the multiple power consumption curves are divided into multiple power consumption curve segments.
3. The method for selecting input level energy analysis convolutional neural networks as described in claim 1, characterized in that, The step of setting all candidate values for each target parameter to be analyzed, and constructing a second energy consumption matrix based on the calculation results of all candidate values and multiple input data, includes: Each candidate value of the target parameter to be analyzed is multiplied with multiple input data to obtain multiple second intermediate value data, and the multiple second intermediate value data are constructed into a simulated intermediate value matrix; The second energy consumption matrix is obtained by mapping the simulated intermediate value matrix using the Hamming weight model.
4. The method for selecting input level energy analysis of a convolutional neural network as described in claim 1, characterized in that, The step of calculating the correlation between the first energy consumption matrix and the second energy consumption matrix to obtain the correlation coefficient of all candidate values of each target parameter to be analyzed includes: use pearson The correlation coefficient calculation formula calculates the correlation between the first energy consumption matrix and the second energy consumption matrix, and obtains the correlation coefficient of all candidate values of each target parameter to be analyzed.
5. The method for selecting input level energy analysis convolutional neural networks as described in claim 1, characterized in that, The convolutional neural network model is based on - Model deployed in - A convolutional neural network model on a hardware platform, wherein the convolutional neural network model comprises a first convolutional layer, a first pooling layer, a second convolutional layer, a second pooling layer, a third convolutional layer, a third pooling layer, and a fully connected layer connected in sequence. And / or, the input data is - The data in the dataset.
6. A horizontal energy analysis convolutional neural network system for selecting inputs, using the method of the horizontal energy analysis convolutional neural network for selecting inputs as described in any one of claims 1-5, characterized in that, The system includes: The selection module is used to select multiple input data corresponding to the multiple target parameters to be analyzed based on their positions in the convolutional neural network model, and input them into the convolutional neural network model. The first construction module is used to construct a first energy consumption matrix based on the power consumption generated by the operation results of the convolutional neural network model on multiple target parameters to be analyzed and multiple input data. The second construction module is used to set all candidate values for each target parameter to be analyzed, and to construct a second energy consumption matrix based on the calculation results of all the candidate values and multiple input data. The calculation module is used to calculate the correlation between the first energy consumption matrix and the second energy consumption matrix to obtain the correlation coefficient of all candidate values of each target parameter to be analyzed, and select the candidate value with the largest correlation coefficient as the analysis result of the target parameter to be analyzed.
7. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform a method for selecting inputs for horizontal energy analysis of a convolutional neural network as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method for selecting inputs for horizontal energy analysis of a convolutional neural network as described in any one of claims 1 to 5.