Method for predicting number of hidden layers based on side channel recovery neural network

Automatically analyze power consumption trajectory signals through image recognition models, solving the problems of low efficiency and insufficient accuracy of power consumption waveform pattern recognition in the existing technology, achieving efficient and automated number of hidden layers prediction, and enhancing system security and information security research the value of the tool.

CN119293577APending Publication Date: 2025-01-10XIDIAN UNIV
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art is less efficient, has limited accuracy when identifying specific modes in power consumption waveforms, relies on manual discrimination and is susceptible to subjective factors, resulting in limited accuracy of analysis results.

Method used

By introducing an image recognition model, the power consumption trajectory signal is preprocessed and converted into an image, and the trained image recognition model is used to automatically analyze the number of hidden layers of the multi-layer perceptron model, reducing labor costs and improving analysis efficiency and accuracy.

Benefits of technology

Automated analysis is realized, significantly improving analysis efficiency and accuracy, reducing dependence on experts and technicians, reducing human resources costs, and providing innovative tools and methods for side channel attack research and information security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293577A_ABST
    Figure CN119293577A_ABST
Patent Text Reader

Abstract

The invention discloses a method for predicting the number of hidden layers based on a side channel recovery neural network, relates to the technical field of artificial intelligence and side channels, and solves the problems of low efficiency and limited precision when a specific mode in a power consumption waveform is identified in the prior art. Converting the side channel power consumption information into a power consumption track signal; wherein a multi-layer perceptron model is loaded on the target equipment; preprocessing the power consumption track signal to obtain a processed power consumption track signal, and converting the processed power consumption track signal into a power consumption track image; inputting the power consumption track image into the trained image recognition model to obtain the number of hidden layers of the multi-layer perceptron model; through introduction of the image recognition model and analysis of the automatic power consumption track image, the analysis efficiency and precision are remarkably improved, the labor cost is reduced, and the system safety is enhanced.
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 side channel technology, and in particular to a method for predicting the number of hidden layers of a neural network based on side channel recovery. Background Art

[0002] In recent years, the rapid progress of artificial intelligence and deep learning technologies has completely transformed the way multiple industries operate, greatly enhancing the automation and intelligent processing capabilities of systems. These technologies have achieved remarkable results in traditional fields such as image and speech recognition, and have shown great potential in complex decision support and prediction models. As these technologies are increasingly adopted by enterprises and scientific research institutions, the demand for understanding and mastering the intelligent models running in devices continues to rise. However, many devices protect their data through strict encryption and access control measures, which makes it difficult to directly obtain the structure and operation data of the model. In this context, the use of side channel information to analyze the structure of the model shows great promise. This method does not rely on traditional direct access methods, but reveals the operating details and structure of the intelligent model by analyzing the physical information inadvertently leaked by these devices during operation. This provides a new strategy for enhancing the security protection of devices and preventing potential threats, which is crucial for understanding and protecting the intellectual property rights of intelligent systems.

[0003] Currently, the number of hidden layers of the MLP model deployed on the ARM architecture embedded microprocessor is restored through SPA (Simple Power Analysis). First, a high-precision current probe and oscilloscope are used to measure the power consumption of the target device. Then the oscilloscope is controlled to collect data, and the power consumption waveform is recorded while processing and analyzing the collected data. The collected power consumption waveform is then preprocessed, such as denoising, filtering, smoothing, etc. Finally, the specific patterns in the power consumption waveform are identified by the human eye (i.e., SPA), which may correspond to different operations performed by the target device.

[0004] Although the existing manual identification scheme has been implemented, there are still some shortcomings. The existing technology is highly subjective: SPA analysis usually requires manual observation and identification of the characteristics of the power consumption waveform. This method relies on the analyst's experience and intuition and is easily affected by subjective factors. Low efficiency: The manual identification process is time-consuming and cumbersome, especially when faced with a large amount of data, and the efficiency is low; Limited accuracy Manual analysis may not be able to identify subtle changes in power consumption, resulting in limited precision and accuracy of the analysis results. Summary of the invention

[0005] The present invention solves the problems of low efficiency and limited accuracy in identifying specific patterns in power consumption waveforms in the prior art by providing a prediction method for the number of hidden layers of a side channel recovery neural network. It realizes automated analysis of power consumption trajectory images by introducing an image recognition model, significantly improves analysis efficiency and accuracy, reduces labor costs, and enhances system security. At the same time, it provides innovative tools and methods for side channel attack research and information security, and has broad application prospects and promotion value.

[0006] The present invention provides a method for predicting the number of hidden layers of a neural network based on a side channel recovery method, the method comprising:

[0007] Collecting side channel power consumption information of a target device when it is running, and converting the side channel power consumption information into a power consumption trajectory signal; wherein a multi-layer perceptron model is loaded on the target device;

[0008] Preprocessing the power consumption trajectory signal to obtain a processed power consumption trajectory signal, and converting the processed power consumption trajectory signal into a power consumption trajectory image;

[0009] The power consumption trajectory image is input into a trained image recognition model, so that the image recognition model predicts the number of hidden layers of the multi-layer perceptron model according to the power consumption trajectory image.

[0010] In a possible implementation, the multi-layer perceptron model is deployed on an embedded platform of ARM architecture; the specific deployment method includes:

[0011] S1011, based on the TensorFlow framework, convert the initial multi-layer perceptron model into the first format model on the PC platform;

[0012] S1012, using a quantization model to perform quantization processing on the first format model to obtain a quantization model generated code;

[0013] S1013, integrating the quantization model generation code with the microcontroller software interface standard library, adding the control code to the integrated model to obtain a multi-layer perceptron model, and deploying the multi-layer perceptron model on an ARM architecture embedded platform;

[0014] S1014, perform a functional test on the multilayer perceptron model, and determine whether the multilayer perceptron model can meet the standards based on the judgment result. If so, complete the deployment of the multilayer perceptron model. If not, loop steps S1012 to S1014 until it is determined that the multilayer perceptron model can meet the standards.

[0015] In a possible implementation, collecting the side channel power consumption information of the target device when it is running includes:

[0016] A high-precision near-field probe is used to locate the electromagnetic leakage position of the target device, and the electromagnetic probe is used to receive electromagnetic radiation at the position to obtain side channel power consumption information.

[0017] In a possible implementation, preprocessing the power consumption trajectory signal to obtain a processed power consumption trajectory signal includes:

[0018] Screening multiple power consumption trace signals corresponding to multiple identical inputs, and averaging the values ​​at the same time in the power consumption trace signals;

[0019] The average value is normalized by Z-score normalization to obtain normalized data, and waveform noise reduction is performed on the normalized data to obtain noise-reduced data;

[0020] Envelope extraction is performed on the noise-reduced data to obtain an envelope extraction signal, and Gaussian smoothing filtering is performed on the envelope extraction signal to obtain a processed power consumption trajectory signal.

[0021] In a possible implementation, the training process of the image recognition model includes:

[0022] Constructing a training data set, and inputting each data in the training data set into a multi-layer perceptron model with different numbers of layers to obtain corresponding power consumption data; wherein the training data set is the initial power consumption data of the device during operation collected using a high-precision power consumption measurement device;

[0023] Preprocessing the power consumption data to obtain a training power consumption trajectory image;

[0024] The image recognition model is trained using the training power consumption trajectory image and a preset learning rate to obtain a trained image recognition model.

[0025] In a possible implementation, after the image recognition model training is completed, the method further includes: evaluating the image recognition model according to the accuracy rate.

[0026] In a possible implementation, the image recognition model includes an input layer, an initial convolution layer, a staggered block group layer, a residual connection layer, a global pooling layer and a fully connected layer, which are connected in sequence.

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

[0028] (1) The present invention can realize automatic processing of power consumption trajectory image analysis by introducing an image recognition model, greatly improving the analysis efficiency. In addition, through the real-time prediction capability of the image recognition model, a large number of power consumption trajectory images can be analyzed in a short time, which is suitable for high-frequency and fast-response application scenarios.

[0029] (2) The present invention analyzes the power consumption trajectory image through an image recognition model, which significantly reduces the dependence on experts and technicians and reduces human resource costs. In addition, the training and use of the image recognition model do not require professional side channel analysis skills, which reduces the cost of training and manpower investment. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A flowchart of the steps of a method for predicting the number of hidden layers of a neural network based on side channel recovery provided by an embodiment of the present invention;

[0031] Figure 2 A schematic diagram of electromagnetic leakage information collection provided by an embodiment of the present invention;

[0032] Figure 3 A leak repair information waveform diagram of multiple curves superimposed under the same input automatically collected provided by an embodiment of the present invention;

[0033] Figure 4 A specific flow chart of the Gaussian smoothing filter operation provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0034] 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.

[0035] The present invention provides a method for predicting the number of hidden layers of a neural network based on side channel recovery, such as Figure 1 As shown, the method includes the following steps S101 to S103.

[0036] S101, collecting side channel power consumption information of the target device during operation, and converting the side channel power consumption information into a power consumption trajectory signal; wherein a multi-layer perceptron model is loaded on the target device. Specifically, in step S101, the multi-layer perceptron model is deployed on an embedded platform of ARM architecture; the specific deployment method includes:

[0037] S1011, based on the TensorFlow framework, convert the initial multi-layer perceptron model into the first format model on the PC platform;

[0038] S1012, using a quantization model to perform quantization processing on the first format model to obtain a quantization model generated code;

[0039] S1013, integrating the quantization model generation code with the microcontroller software interface standard library, adding the control code to the integrated model to obtain a multi-layer perceptron model, and deploying the multi-layer perceptron model on an ARM architecture embedded platform;

[0040] S1014, perform functional testing on the multilayer perceptron model, and determine whether the multilayer perceptron model can meet the standards based on the judgment result. If so, complete the deployment of the multilayer perceptron model. If not, loop steps S1012 to S1014 until it is determined that the multilayer perceptron model can meet the standards.

[0041] Exemplarily, a multi-layer perceptron (MLP) model is deployed on an embedded platform of ARM architecture. The present invention selects a quantized model reasoning framework and a microcontroller software interface standard tool library. These two technologies together support efficient and lightweight neural network reasoning in a resource-constrained environment.

[0042] The quantization model provides an efficient model quantization technology that can significantly reduce the model's demand for computing and storage resources while maintaining a certain level of inference accuracy. The deployment process begins by converting the trained MLP model into a format supported by the quantization model. After conversion, the model is optimized and quantized to accommodate the performance limitations of embedded devices. As mentioned above, quantization mainly involves reducing the bit width of the data, thereby reducing the required memory and accelerating the calculation process.

[0043] Using the microcontroller software interface standard library, especially the interface standard for the ARM Cortex-M series processors, simplifies the interaction with the hardware and optimizes performance. During the model deployment process, the microcontroller software interface standard DSP library is used to accelerate the computing tasks of the neural network, providing efficient mathematical operation support such as fast Fourier transform (FFT) and matrix operations, which is particularly important for executing multi-layer feedforward network calculations in the MLP model.

[0044] The specific hardware includes a microcontroller based on the ARM Cortex-M series. The software environment configuration involves installing and configuring the quantization model and its dependent libraries, as well as ensuring the compatibility and correctness of the microcontroller software interface standard library. The specific process is: first, the pre-trained MLP model is converted into a format suitable for quantization model processing using the TensorFlow (mathematical symbol system) framework on the PC side; second, quantization processing, using the quantization model to quantize the model, reduce the model complexity, and adapt to the resource limitations of embedded hardware; then, the code generated by the quantization model is integrated with the microcontroller software interface standard library, and the necessary control code is written to manage the loading and execution of the model; finally, the integrated software is deployed to the target embedded device for preliminary functional testing. If the test meets the standard, the deployment is completed, otherwise it returns to the model quantization step for processing.

[0045] Specifically, in step S101, the side channel power consumption information of the target device during operation is collected, including: using a high-precision near-field probe to locate the electromagnetic leakage position of the target device, using the electromagnetic probe to receive electromagnetic radiation at the position, and obtaining the side channel power consumption information.

[0046] For example, the collection of power consumption trajectory images usually includes the use of an electromagnetic probe to measure electromagnetic leakage information, the use of a near-field probe to locate the local position of electromagnetic leakage, and the connection of the electromagnetic probe to an oscilloscope to monitor the power consumption changes of the development board in real time. This method mainly uses the principle of electromagnetic radiation to reflect the power consumption information of the development board, and can fully understand the power consumption characteristics and electromagnetic radiation of the system, providing more accurate and comprehensive data support for side channel analysis. At the same time, this method does not require physical changes to the system, is easy to operate, and is suitable for various types of embedded systems and development boards.

[0047] Principle of electromagnetic probe:

[0048] 1. Receiving electromagnetic radiation: The sensing element of the near-field probe receives energy from the surrounding electromagnetic radiation field and converts it into electrical signals.

[0049] 2. Transmitting electrical signals: The sensing element transmits the received electrical signals to the measuring instrument or display device for further processing and analysis.

[0050] 3. Detection of electromagnetic field changes: The near-field probe detects changes in the electromagnetic field by moving or rotating near the object to be tested. When the probe is close to the electromagnetic radiation source (such as an antenna, signal source, circuit board, etc.), the electromagnetic field strength will change, and the electrical signal sensed by the probe will also change accordingly.

[0051] 4. Analyze and display results: The measuring instrument or display device will analyze and process the electrical signals transmitted back and convert them into visual results.

[0052] like Figure 2 As shown in the figure, it is the principle diagram of electromagnetic leakage information collection. The difference between the electromagnetic energy trace collection method and the power consumption energy trace collection method is that there is no need to connect a series resistor in the power supply circuit of the development board. The electromagnetic energy trace collection method adopts a non-contact method. After determining the CPU operation position, the electromagnetic probe is placed near its surface to collect electromagnetic signals. These electromagnetic signals are then transmitted to the computer for processing and analysis.

[0053] In the relevant power consumption analysis, when the number of power consumption curves reaches a certain amount, the Hamming weight and the Hamming distance may show an ideal correlation with the actual power consumption. However, collecting power consumption curves is extremely time-consuming and labor-intensive, so it is necessary to realize automatic data collection, transmission and storage in the host computer.

[0054] The acquisition platform uses the network port to realize data communication between the PC and the oscilloscope, and uses the serial port to realize data communication between the PC platform and the embedded platform, such as image vector input and return result reading. Figure 3 The figure shows the leak repair information waveform diagram of multiple curves superimposed under the same input under automatic collection.

[0055] S102 , preprocessing the power consumption trajectory signal to obtain a processed power consumption trajectory signal, and converting the processed power consumption trajectory signal into a power consumption trajectory image.

[0056] Specifically, in step S102, the power consumption trajectory signal is preprocessed to obtain a processed power consumption trajectory signal, including:

[0057] (1) Filter multiple power consumption trajectory signals corresponding to multiple identical inputs, and average the values ​​at the same time in the power consumption trajectory signals.

[0058] (2) The average value is normalized by Z-score normalization to obtain standardized data, and the standardized data is subjected to waveform denoising to obtain denoised data.

[0059] (3) Envelope extraction is performed on the denoised data to obtain an envelope extracted signal, and Gaussian smoothing filtering is performed on the envelope extracted signal to obtain a processed power consumption trajectory signal.

[0060] For example, first, the data preprocessing stage includes operations such as removing outliers, smoothing data, and filling missing values, which can effectively reduce noise and interference in the data, improve the quality and stability of the data, and eliminate the calculation deviation caused by different magnitudes between different data to ensure that the inversion model can accurately capture the true characteristics of the data in subsequent calculations. Data preprocessing can also correct systematic errors, including errors caused by factors such as sensor drift and instrument response, to ensure the accuracy and reliability of the data. By calibrating and correcting the data, the true state of the observed object can be more accurately reflected, and the credibility of the inversion results can be improved.

[0061] In general, data preprocessing is an essential step before formal model inversion. It can effectively improve data quality, reduce noise interference, correct systematic errors, and ensure data consistency and stability, thereby providing a reliable data foundation for subsequent model inversion and ensuring the stability and reliability of model inversion.

[0062] 1) Cumulative average

[0063] The leakage data generated by the same input is measured 100 times and averaged. Accumulation will cause the power consumption information to partially overlap and the effect of random noise will be averaged, thereby improving the signal-to-noise ratio.

[0064] The signal-to-noise ratio (SNR) is an indicator used to measure the relative strength between signal and noise. It is one of the commonly used performance evaluation indicators in the field of signal processing and communication. The signal-to-noise ratio of the signal can be evaluated according to the following steps.

[0065] ① Signal and noise separation: In practical applications, it may be difficult to completely separate the signal and noise. Generally speaking, it is necessary to first process the original waveform data, such as removing the DC component, filtering, etc., and then compare and analyze the changes in the waveform data before and after processing to obtain the signal and noise. The separated signal and noise are recorded as s[n] and n[n] respectively.

[0066] ② Calculate the energy of signal and noise: The energy calculation formula of discrete signal s[n] and discrete noise n[n] is as follows:

[0067]

[0068] Where N corresponds to the total number of signal samples and the number of noise samples respectively.

[0069] ③ Calculate the signal-to-noise ratio: The signal-to-noise ratio (SNR) can be defined as the ratio of signal energy to noise energy. The calculation formula for the signal-to-noise ratio is:

[0070]

[0071] 2) Standardization

[0072] In order to conduct a more accurate comprehensive analysis and comparison of all the collected data during data processing, the data is standardized through Z-score standardization:

[0073]

[0074] In the formula, x is the original data, Mean is the mean of the data, and StedDev is the standard deviation of the data.

[0075] After standardization, the data is scaled to a distribution with a mean of 0 and a standard deviation of 1, eliminating the influence of instrument deviation or other irrelevant factors that affect the power consumption amplitude during the acquisition process, thereby unifying the analysis standards and ensuring the reliability of the power consumption analysis results.

[0076] 3) Waveform noise reduction

[0077] The Butterworth low-pass filter is used to filter out the high-frequency noise in the energy trace. The Butterworth low-pass filter algorithm is usually used to represent the spectral characteristics of data in the frequency domain. Usually, the amplitude-frequency characteristics in the frequency band are relatively smoother than other filtering algorithms. The noise in the power signal collected in the experiment mainly exists in the high-frequency component, and the power information mainly exists in the low-frequency component. The Butterworth low-pass filter directly filters out the signal above the cutoff frequency, and its amplitude square function is expressed as shown in the formula:

[0078]

[0079] Among them, w c represents the cutoff frequency and n represents the order of the filter.

[0080] The power consumption curve after filtering improves the data signal-to-noise ratio by removing some noise information, thus reducing the process of related power consumption analysis and improving the success rate of the analysis.

[0081] 4) Envelope extraction

[0082] Extracting the envelope of a signal can reveal the amplitude variation trend of the signal, simplify the analysis of complex signals, and effectively reduce noise, making signal processing and feature extraction more intuitive and efficient. In addition, through envelope extraction, signal features can be detected more sensitively, and the visualization of the signal can be enhanced, thereby improving the accuracy and reliability of signal analysis. This project adopts an envelope extraction method based on Hilbert change. Calculating the signal envelope based on Hilbert transform is a commonly used method. In the field of signal processing, Hilbert transform can be used to analyze the instantaneous amplitude and phase of the signal, thereby extracting the envelope of the signal.

[0083] The Hilbert transform is a linear operator that converts a real signal into the imaginary part of a complex signal. For a real signal x(t), its Hilbert transform Defined as:

[0084]

[0085] In the formula, PV represents Cauchy principal value integral. Combining the original signal x(t) and Hilbert transform A complex signal can be constructed:

[0086]

[0087] The modulus of the complex signal z(t) is the envelope of the signal x(t):

[0088]

[0089] After envelope extraction, the hierarchical structure of the model can be more intuitively seen from the waveform.

[0090] 5) Gaussian smoothing filter

[0091] Gaussian smoothing filtering can reduce the noise in the waveform through fuzzy processing, smooth the changes in the waveform, and make the overall trend clearer while maintaining most of the details. It is suitable for signal processing, data preprocessing, feature extraction and other fields, and improves the accuracy and reliability of subsequent analysis.

[0092] Gaussian filtering can eliminate Gaussian noise of normal distribution. It belongs to linear filtering. Gaussian filtering uses Gaussian function, which is the probability density function of the familiar normal distribution. The formula is as follows:

[0093]

[0094] Where x is the distance from the origin and σ is the standard deviation, which determines the width of the Gaussian curve.

[0095] like Figure 4 As shown, it is a specific flow chart of Gaussian smoothing filter operation.

[0096] First, a Gaussian kernel is generated according to the required degree of smoothness (standard deviation σ). The kernel size is usually selected to be 6σ+1 to ensure that the kernel can cover most of the Gaussian distribution. Then a convolution operation is performed to convolve the generated Gaussian kernel with the original signal. The result of the convolution is the smoothed signal.

[0097] Assume the original signal is f(t), Gaussian kernel G(t), and the convolution operation is expressed as:

[0098]

[0099] In the discrete case, convolution can be expressed as:

[0100]

[0101] Gaussian smoothing filter has good smoothing effect, can effectively remove noise, and retain the overall trend of the signal. Compared with other filters (such as mean filter), Gaussian smoothing does not produce ringing effect, so it can process signal edges more smoothly.

[0102] S103, inputting the power consumption trajectory image into a trained image recognition model, so that the image recognition model predicts the number of hidden layers of the multi-layer perceptron model according to the power consumption trajectory image.

[0103] Specifically, in step S103, the training process of the image recognition model includes:

[0104] S1031, construct a training data set, and input each data in the training data set into a multi-layer perceptron model with different numbers of layers to obtain corresponding power consumption data, wherein the training data set is the initial power consumption data of the device during operation collected using a high-precision power consumption measurement device. Here, first run the MLP model with different numbers of layers in a fixed environment, such as 3 layers, 4 layers, 5 layers, etc. Use a high-precision power consumption measurement device to collect the power consumption data during its operation. At the same time, record the power consumption data of the device during different operations to generate original power consumption trace data. Then use the data preprocessing technology in 2.2 to preprocess the data and draw it into a two-dimensional image to form a series of power consumption trajectory images representing different numbers of MLP layers. In the early stage, each power consumption trajectory image is manually annotated to record the corresponding number of MLP model layers, and then the initially trained model is used for automatic annotation, and the annotation results are manually verified and corrected. After completion, the annotated data set is divided into 70% training set, 15% validation set, and 15% test set ratios to ensure that each subset contains MLP model samples with different numbers of layers.

[0105] S1032, pre-processing the power consumption data to obtain a training power consumption trajectory image.

[0106] S1033, train the image recognition model using the training power consumption trajectory image and the preset learning rate to obtain a trained image recognition model. Here, ResNet50 is selected as the basic image recognition model, and it is fine-tuned to adapt to specific tasks. The input layer is the power consumption trajectory image, and the output layer is the classification result of the MLP model layer. The appropriate preset learning rate, batch size, and number of training rounds are set through testing to ensure the stability of model training. Perform data enhancement (such as random cropping, rotation, scaling, etc.) on the training data to increase data diversity and prevent model overfitting. Use the training set to train the model, and use the validation set to evaluate the model performance in real time, and adjust the model parameters and structure to optimize performance.

[0107] Specifically, after the image recognition model training is completed, the following step further includes: evaluating the image recognition model according to the accuracy rate.

[0108] Here, the accuracy is expressed as:

[0109]

[0110] Among them, TP represents the true positive class, TN represents the true negative class, FP represents the false positive class, and FN represents the false negative class.

[0111] After training is complete, the model is evaluated to determine its performance. Commonly used metrics in the evaluation process include accuracy, precision, recall, and F1 score. The specific steps are as follows:

[0112] ①Prepare test data

[0113] Use a pre-divided test set for evaluation to ensure that the test data has not been used in training to ensure the objectivity and fairness of the evaluation.

[0114] ②Prediction test set

[0115] Input the test set into the model and obtain the model's prediction results.

[0116] ③Calculate evaluation indicators

[0117] Accuracy: The ratio of the number of samples correctly predicted by the model to the total number of samples. The formula is:

[0118]

[0119] Among them, TP is the true positive class, TN is the true negative class, FP is the false positive class, and FN is the false negative class.

[0120] Precision: The ratio of the number of samples correctly predicted as positive to the number of samples predicted as positive. The formula is:

[0121]

[0122] Recall: The ratio of the number of positive samples correctly identified by the model to the number of positive samples actually identified. The formula is:

[0123]

[0124] F1 Score: The harmonic mean of precision and recall, which comprehensively measures the performance of the model. The formula is:

[0125]

[0126] Specifically, in step S103, the image recognition model includes an input layer, an initial convolution layer, a staggered block group layer, a residual connection layer, a global pooling layer and a fully connected layer which are connected in sequence.

[0127] Input layer, the input data is a picture, the format is (batch_size, channels, height, width).

[0128] The initial convolutional layer consists of a 2D convolutional layer: a 7×7 convolution kernel with a stride of 2 is used.

[0129] Max Pooling Layer: Use a 3×3 max pooling layer with a stride of 2.

[0130] Residual block groups: The model contains 4 residual block groups, each responsible for extracting features at a different level. Each residual block consists of multiple convolutional layers and residual connections. The first group of residual blocks (3 residual units): This group receives input from the initial convolutional layer and mainly extracts shallow features. The second group of residual blocks (4 residual units): Uses convolution with a stride of 2 to reduce the resolution and extract deeper features. The third group of residual blocks (6 residual units): This layer continues to extract complex features of the image. The fourth group of residual blocks (3 residual units): The last group of residual blocks is responsible for extracting the deepest features and outputs a higher dimensional feature map.

[0131] Residual connection: Each residual unit contains two convolution operations, and the input and output are directly added through the residual connection to prevent the gradient from disappearing.

[0132] Global pooling layer: Aggregates the spatial dimensions of the feature map into a single value, reducing the number of parameters and simplifying the model structure.

[0133] Fully connected layer: The pooled output is processed by a fully connected layer and finally outputs the predicted category distribution through the Softmax layer.

[0134] In the prior art, the multilayer perceptron (MLP) is the most basic neural network, namely the artificial neural network (Artificial Neural Network), and its basic structure is composed of several interconnected nodes called neurons. Usually, the signal transmitted between neurons is a real number, and the output of a neuron is obtained by the sum of all its inputs through a nonlinear transformation. The connection between neurons is weighted, and these weights are continuously optimized during the model training process to represent the intensity coefficient of signal transmission between neurons. The most typical MLP includes three layers: input layer, hidden layer and output layer, and each layer is composed of several nonlinear mapping nodes. In order to overcome the limitations of linear models, MLP usually contains multiple hidden layers, and the layers are directly fully connected. The tasks of these layers are also different. Generally, the first n-1 hidden layers are used to extract features from the input, usually called the representation layer, and the nth layer, that is, the last layer, is for classification, called the decision layer.

[0135] It is relatively difficult to distinguish different numbers of layers because the leakage pattern depends only on multiplication and addition operations and activation functions, which are usually present in most layers. Therefore, there is no clear power leakage information available at the boundaries between layers. The structure inferred by the intelligent model structure parameters based on SPA has certain errors. This experiment intends to use CPA and hypothesis testing methods to correct it. Simple power analysis (CPA, Correlation Power Analysis) is a commonly used side channel attack technology that cracks the key by analyzing the power consumption data of the encryption device when performing encryption operations. This method is based on the fact that during the encryption operation, the power consumption of the device will be affected by the internal data processing, and these power consumption patterns can be captured and used to infer the internal key information.

[0136] For a neuron, we first assume that it is a neuron in the L(i) layer, and use the output of all neurons in the L(i-1) layer as the input of the neuron. Using the weight recovery technique, we find all the weight guesses when the correlation coefficient is the largest, and record the corresponding correlation coefficient value. Then, we assume that the neuron is a neuron in the L(i+1) layer, and use the output of all neurons in the L(i) layer as its input, find all the weight guesses when the correlation coefficient is the largest, and record the corresponding correlation coefficient value. Finally, compare the correlation coefficient values ​​of the two assumptions. The assumption with the larger correlation coefficient is taken as the final inference result.

[0137] This experiment makes an overall observation and analysis of the collected waveforms, and it can be clearly observed that the waveform as a whole has a clear hierarchical structure. After analyzing the MLP code, it is known that after the multiplication and addition of each layer are completed, an activation function is output and used as the input of the next layer. Local analysis of the waveform layering, using pattern matching, it can be known that the layering part is the activation function, so the combination of these two methods can analyze the overall layer structure of the model. The following figure shows the local situation of the structural layering. From the above activation function inversion method, it can be known that the boundary of the three hidden layers is the relu function, and the final output layer is the softmax function.

[0138] Through the above analysis, we can get the number of hidden layers of the model. Now we will analyze each hidden layer in detail. Observing the overall waveform, we can see that each hidden layer also has a layered structure, and each layer is a complete neuron. The waveform is analyzed in detail. The boundary of the hidden layer is the relu function. The comprehensive waveform analysis shows that the number of bias functions of the three hidden layers is 8, 8, and 8 respectively, that is, the number of neurons in each hidden layer is 8.

[0139] After completing the above steps, you already have the required data. The next step is to collect data, preprocess, build a data set and train the model.

[0140] The present invention uses an image recognition model (CNN) to perform automated power consumption trace analysis, which not only improves the efficiency and accuracy of SPA, but also reduces the dependence on manual judgment, improves the degree of automation of the overall analysis process, and provides an innovative tool and method for side-channel attack research and information security.

[0141] Traditional power trace analysis relies on manual operation, which is inefficient and prone to errors. After the introduction of the image recognition model, power trace analysis can be automated, greatly improving analysis efficiency. Through the real-time prediction capability of the model, a large number of power trace images can be analyzed in a short time, which is suitable for high-frequency, fast-response application scenarios.

[0142] Using image recognition models for power trace analysis significantly reduces reliance on experts and technicians, and reduces human resource costs. Model training and use do not require professional side channel analysis skills, reducing the cost of training and manpower investment.

[0143] The present invention provides a new tool and method to promote the research and development in the field of side channel attack analysis. Through the automated processing and analysis of large amounts of data, it provides rich basic data for subsequent research and promotes the further optimization of algorithms and technologies.

[0144] The present invention introduces an image recognition model and automates power consumption trace analysis, which significantly improves analysis efficiency and accuracy, reduces labor costs, and enhances system security. At the same time, it provides innovative tools and methods for side-channel attack research and information security, and has broad application prospects and promotion value.

[0145] The image recognition model (CNN) provided by the present invention has efficient feature extraction capabilities and can automatically extract useful information from input data without manually designing features. For power consumption waveform data, CNN can automatically capture the features of different hierarchical structures in power consumption. At the same time, it can process features at different positions through convolution operations and has spatial invariance, which is very important for capturing patterns in power consumption waveforms. Different hidden layer structures may have different feature positions in the power consumption waveform, and CNN can effectively cope with such changes. Finally, compared with other complex models, CNN has advantages in computational efficiency, which is more obvious when processing large-scale data. This enables it to quickly process and analyze large amounts of power consumption data in practical applications.

[0146] The point where CNN fits this problem is automatic feature learning: Traditional power consumption analysis methods require manual feature extraction, while CNN can automatically learn and extract complex features in power consumption waveforms through convolutional layers and pooling layers. This automatic feature learning capability enables it to more accurately reflect the impact of different hidden layer structures on power consumption.

[0147] Ability to process large-scale data: Power consumption data is large and complex. CNN can efficiently process and analyze large-scale data through its hierarchical structure, extract key feature information, and thus achieve higher inversion accuracy.

[0148] Robustness and generalization ability: CNN has good robustness and generalization ability in processing noisy and deformed data, which provides a solution to the inevitable noise and data deformation problems in practical applications.

[0149] Solutions adapted to inversion requirements: Data preprocessing: The collected power consumption waveform data is preprocessed, including denoising, standardization, and smoothing, and converted into a two-dimensional image to improve data quality and CNN training effect.

[0150] Model structure design: Design a CNN structure suitable for power consumption waveform characteristics, including multiple convolutional layers and pooling layers to extract feature information at different levels. At the same time, add a fully connected layer to integrate the extracted features and perform classification judgment.

[0151] Training and optimization: Use a large amount of power consumption waveform data to train the CNN, and use optimization algorithms (such as the Adam optimizer) to adjust the model parameters to improve the accuracy and generalization ability of the model.

[0152] Improvements over traditional CNNs: Customized convolutional layers for power waveform data features: Traditional CNNs usually use general convolution kernels, but we design customized convolution kernels that adapt to the specific features of power waveforms. These convolution kernels can better capture specific patterns in waveform data, such as spikes, flat areas, and periodic changes.

[0153] Processing of timing features: In order to better process the timing information in the power consumption waveform data, the temporal convolutional layer is introduced. Different from the traditional convolutional layer, the temporal convolutional layer can retain the timing structure of the input data and capture the timing correlation more effectively.

[0154] Combining time domain and frequency domain features: Traditional CNN mainly processes time domain features. In order to analyze power consumption waveform data more comprehensively, we introduce frequency domain feature analysis. The power consumption waveform data is converted to the frequency domain through Fourier transform, and then combined with time domain features for comprehensive analysis.

[0155] Add data enhancement technology: Improve the robustness of the model through data enhancement (such as random noise addition, translation, etc.) and enhance the model's adaptability in different data environments.

[0156] Integrate multiple feature fusion methods: Integrate multiple feature fusion methods into the model structure, including the combination of global features and local features, to improve the classification performance of the model.

[0157] 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 method for predicting the number of hidden layers of a neural network based on side channel recovery, characterized in that: include: Collecting side channel power consumption information of a target device when it is running, and converting the side channel power consumption information into a power consumption trajectory signal; wherein a multi-layer perceptron model is loaded on the target device; Preprocessing the power consumption trajectory signal to obtain a processed power consumption trajectory signal, and converting the processed power consumption trajectory signal into a power consumption trajectory image; The power consumption trajectory image is input into a trained image recognition model, so that the image recognition model predicts the number of hidden layers of the multi-layer perceptron model according to the power consumption trajectory image.

2. The method for predicting the number of hidden layers of a neural network based on side channel recovery according to claim 1, characterized in that: The multi-layer perceptron model is deployed on an embedded platform of ARM architecture; the specific deployment method includes: S1011, based on the TensorFlow framework, convert the initial multi-layer perceptron model into the first format model on the PC platform; S1012, using a quantization model to perform quantization processing on the first format model to obtain a quantization model generated code; S1013, integrating the quantization model generation code with the microcontroller software interface standard library, adding the control code to the integrated model to obtain a multi-layer perceptron model, and deploying the multi-layer perceptron model on an ARM architecture embedded platform; S1014, perform a functional test on the multilayer perceptron model, and determine whether the multilayer perceptron model can meet the standards based on the judgment result. If so, complete the deployment of the multilayer perceptron model. If not, loop steps S1012 to S1014 until it is determined that the multilayer perceptron model can meet the standards.

3. The method for predicting the number of hidden layers of a neural network based on side channel recovery according to claim 1, characterized in that: The collecting of side channel power consumption information when the target device is running includes: A high-precision near-field probe is used to locate the electromagnetic leakage position of the target device, and the electromagnetic probe is used to receive electromagnetic radiation at the position to obtain side channel power consumption information.

4. The method for predicting the number of hidden layers of a neural network based on side channel recovery according to claim 1, characterized in that: The preprocessing of the power consumption trajectory signal to obtain a processed power consumption trajectory signal includes: Screening multiple power consumption trace signals corresponding to multiple identical inputs, and averaging the values ​​at the same time in the power consumption trace signals; The average value is normalized by Z-score normalization to obtain normalized data, and waveform noise reduction is performed on the normalized data to obtain noise-reduced data; Envelope extraction is performed on the noise-reduced data to obtain an envelope extraction signal, and Gaussian smoothing filtering is performed on the envelope extraction signal to obtain a processed power consumption trajectory signal.

5. The method for predicting the number of hidden layers of a neural network based on side channel recovery according to claim 1, characterized in that: The training process of the image recognition model includes: Constructing a training data set, and inputting each data in the training data set into a multi-layer perceptron model with different numbers of layers to obtain corresponding power consumption data; wherein the training data set is the initial power consumption data of the device during operation collected using a high-precision power consumption measurement device; Preprocessing the power consumption data to obtain a training power consumption trajectory image; The image recognition model is trained using the training power consumption trajectory image and a preset learning rate to obtain a trained image recognition model.

6. The method for predicting the number of hidden layers of a neural network based on side channel recovery according to claim 1, characterized in that: After the image recognition model training is completed, the method further includes: evaluating the image recognition model according to the accuracy rate.

7. The method for predicting the number of hidden layers of a neural network based on side channel recovery according to claim 1, characterized in that: The image recognition model includes an input layer, an initial convolution layer, a staggered block group layer, a residual connection layer, a global pooling layer and a fully connected layer which are connected in sequence.

Citation Information

Patent Citations

  • Method for identifying deep learning model on local server based on GPU space-time resource consumption

    CN112463387A

  • Method and system for obtaining deep learning model structure based on side channel information

    CN113676311A

  • Neural network model security assessment method and device and computer equipment

    CN118069505A

  • PUF (Physical Unclonable Function) security test method based on multi-modal learning

    CN118316624A

  • Deep convolutional neural network-based submerged oil sonar detection image recognition method

    WO2021243743A1