Dynamic data encryption method based on deep learning
Through the dynamic data encryption method based on deep learning, the data is processed and analyzed in the encryption state, and the problem of how to perform data analysis in the privacy sensitive scenario is solved, and the high privacy and integrity protection of the data is realized.
Patent Information
- Application Number
- CN202410010539.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-04
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-01-04
AI Technical Summary
In privacy-sensitive scenarios, how to perform data analysis without exposing the original data is to ensure the privacy of the data and maintain the integrity of the data.
A dynamic data encryption method based on deep learning is adopted, the data is represented as a multi-dimensional tensor through the dynamic key generation part, and a deep convolutional neural network is used to extract features and generate a dynamic key. This key is then used to encrypt the data in the dynamic data encryption part, and data processing and analysis are performed in the encrypted state.
Data processing and analysis is performed without decomposing data, ensuring the privacy and integrity of the data, avoiding the risk of data leakage, and suitable for scenes such as cloud computing, outsourcing computing and cross -organization collaboration.
Smart Images

Figure CN117792637B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data encryption, and in particular relates to a dynamic data encryption method based on deep learning. Background Art
[0002] In the field of privacy protection and machine learning, homomorphic encryption is a key technology used to process and analyze data without exposing the original data. At the same time, machine learning, as a powerful data analysis tool, is widely used in model training and prediction tasks. Combining homomorphic encryption with machine learning can achieve meaningful data analysis while protecting data privacy.
[0003] Homomorphic encryption is a special encryption technology that allows data operations to be performed in an encrypted state without decryption. The core idea is that after performing mathematical operations on encrypted data, the result is still encrypted and can be consistent with the result of the operation on the original data after decryption. This means that data can be calculated in an encrypted state without leaking sensitive information.
[0004] The main function of homomorphic encryption is to protect the privacy of data. In many scenarios, data contains sensitive information such as personal identity, financial information or medical records. With homomorphic encryption, data can remain encrypted during transmission, storage and processing, and only those with the correct key can decrypt the data, thus ensuring the privacy of the data. Homomorphic encryption makes secure computing possible. Data owners can send encrypted data to other participants, who can perform calculations without knowing the original data. This is very useful for scenarios such as cross-organizational collaboration and cloud computing, because the data does not need to leave the control of the data owner. Homomorphic encryption also allows data owners to collaborate with researchers, analysts, etc. to share data for analysis without providing the data to them. This is of great significance in fields such as medical research, financial analysis and social science research. Homomorphic encryption can prevent the risk of data leakage. Even if data leakage occurs during data transmission or storage, attackers cannot obtain useful information because they do not have the correct key to decrypt it.
[0005] Combining homomorphic encryption with machine learning can overcome the challenges of data analysis in privacy-sensitive scenarios. In this case, the original data is encrypted, and the machine learning model is trained and reasoned on the ciphertext data. The main advantages of this combination include: Homomorphic encryption allows model training and prediction without exposing the original data. This is very important for processing sensitive data, such as medical records or financial transactions. The model can only access encrypted data, not the original data, thus ensuring privacy. Data owners can share encrypted data with researchers or partners without worrying about data leakage. This approach can promote data sharing and cooperation, and promote scientific research and business innovation. Summary of the invention
[0006] The main purpose of the present invention is to provide a dynamic data encryption method based on deep learning. The present invention significantly improves the privacy of data while maintaining the integrity of the data.
[0007] In order to solve the above problems, the technical solution of the present invention is achieved as follows:
[0008] A dynamic data encryption method based on deep learning, the method comprising: a dynamic key generation part and a dynamic data encryption part; the dynamic key generation part is used to copy target data at any time point other than the current time point, and represent the copied target data as a multidimensional tensor; a deep convolutional neural network model is constructed, including multiple convolutional layers, pooling layers and fully connected layers, in which convolution operations are used to process multidimensional tensors, extract features, and obtain multidimensional tensor features; in the pooling layer, pooling operations are used to reduce the dimensions of multidimensional tensor features to obtain low-dimensional tensor features; in the fully connected layer, low-dimensional tensor features are input to generate dynamic keys; The dynamic data encryption part is used to encrypt the target data at the current time point using the generated dynamic key to obtain the encrypted current target data, encrypt the copied target data using the generated dynamic key to obtain the encrypted target data, perform feature extraction on the encrypted target data to obtain feature representation, and delete the copied target data; use the improved support vector machine to train the feature representation to obtain a classifier; update the decision boundary of the improved support vector machine to adapt to the target data at the current time point to obtain an updated classifier; apply the updated classifier to the encrypted current target data to obtain the decrypted target data at the current time point.
[0009] Furthermore, the dynamic key generation part represents the copied target data as a multi-dimensional tensor , where the multidimensional tensor Include samples, each of which consists of channels, Line and Column composition; build a multi-layer convolutional neural network model and define the output of the convolutional layer as a multi-dimensional tensor feature ,in is a multidimensional tensor containing samples, each of which consists of channels, Line and Column composition.
[0010] Furthermore, convolution operations are used to process multidimensional tensors, extract features, and obtain multidimensional tensor features. The formula is:
[0011] ;
[0012] in, is the output tensor, which is a multidimensional tensor feature A component of is the output channel index of the convolutional layer, and are the row and column indices of the output tensor, respectively. is the convolution kernel size, is the convolution stride, is a multidimensional tensor A component of is the weight of the convolution kernel, It is a channel Deviation; is the input channel index of the convolutional layer; and All are subscript indexes.
[0013] Furthermore, in the pooling layer, the pooling operation is used to reduce the dimension of the multi-dimensional tensor feature to obtain a low-dimensional tensor feature. The formula is:
[0014] ;
[0015] in, and is the subscript index; is a low-dimensional tensor feature A component of .
[0016] Furthermore, the fully connected layer has a total of three layers; the first two layers of the fully connected layer are regarded as hidden layers, namely the first hidden layer and the second hidden layer; the output of the first hidden layer is defined as , define the output of the second hidden layer as ;in:
[0017] ;
[0018] in, is the weight matrix of the first hidden layer; is the weight matrix of the second hidden layer, is the bias of the first hidden layer; is the bias of the second hidden layer, Represents the activation function.
[0019] Furthermore, the last layer of the fully connected layer calculates the dynamic key through the following formula:
[0020] ;
[0021] in, is a dimensionality reduction function, which is used to reduce the multi-dimensional tensor to one dimension; is the weight matrix of the last layer.
[0022] Furthermore, in the dynamic data encryption part, after encrypting the target data at the current time point using the generated dynamic key, the method for obtaining the encrypted current target data includes: converting the target data at the current time point into a binary sequence data ,in, is the number of elements in the data sequence; using a known key , for binary sequence data Encrypt and obtain the encrypted current target data:
[0023] :
[0024] ;
[0025] in, is a homomorphic encryption function; the same method is applied to encrypt the copied target data using the generated dynamic key to obtain the encrypted target data .
[0026] Furthermore, the encrypted target data Perform feature extraction and obtain the feature representation as follows:
[0027] ;
[0028] The dynamic data encryption part uses an improved support vector machine to train the feature representation. Train and get the classifier The objective function of the improved support vector machine is expressed using the following formula:
[0029] ;
[0030] in, is the weight vector of the improved support vector machine, which is used to define the decision boundary of the data; one of the goals of the objective function is to minimize , to ensure that the decision boundary has enough margin; represents the first-order L1 norm; is the bias of the improved support vector machine, which affects the location of the decision boundary; This is the slack variable of the improved support vector machine, which is the set of slack variables No. elements; It is the regularization parameter of the improved support vector machine, which is used to control the complexity of the model and the degree of tolerance of slack variables; is the error correction parameter used for decryption; is the homomorphic encryption function The corresponding decryption function.
[0031] Furthermore, the dynamic data encryption part updates the decision boundary of the improved support vector machine to adapt to the target data at the current time point. When the updated classifier is obtained, the objective function of the improved support vector machine used is expressed using the following formula:
[0032] ;
[0033] in, is the weight vector of the updated improved support vector machine; is the bias of the updated improved support vector machine; is the set of slack variables of the updated improved support vector machine.
[0034] The dynamic data encryption method based on deep learning of the present invention has the following beneficial effects: the present invention adopts homomorphic encryption technology to encrypt the original data for processing. The dynamic key generation part represents the data as a multidimensional tensor, and then extracts features through a deep convolutional neural network, and all these operations are performed in an encrypted state. This protects the privacy of the data so that only users who have the correct key can decrypt and access the data. Whether in the process of data transmission, storage or processing, the sensitive information of the data is highly protected, which helps to comply with privacy laws and regulations. The method of the present invention allows various data processing operations to be performed on encrypted data, including the construction of convolutional neural network models, feature extraction and calculation of fully connected layers, without decrypting the data. This ensures the security of the data and avoids potential risks caused by decrypting the data. Model training is also performed on encrypted data, and there is no need to expose the original data to the model, thereby effectively preventing the risk of data leakage. This is of great significance for scenarios such as cloud computing, outsourced computing and cross-organizational collaboration, and provides a secure way to process data and execute machine learning tasks. Traditional methods usually require machine learning to be performed after decrypting the data, which may lead to the risk of data privacy leakage. The method of the present invention achieves a high degree of privacy protection for machine learning tasks by operating on encrypted data while ensuring the integrity and quality of the data. This innovative method has broad application prospects and can be applied to healthcare, financial services, social science research and more fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A schematic diagram of the system structure of a deep learning-based dynamic data encryption method provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0036] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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 should fall within the scope of protection of the present invention.
[0037] Example 1: Reference Figure 1, a dynamic data encryption method based on deep learning, the method comprising: a dynamic key generation part and a dynamic data encryption part; the dynamic key generation part is used to copy the target data at any time point other than the current time point, and represent the copied target data as a multidimensional tensor; a deep convolutional neural network model is constructed, including multiple convolutional layers, pooling layers and fully connected layers, in which the convolution operation is used to process the multidimensional tensor, extract features, and obtain multidimensional tensor features; in the pooling layer, the pooling operation is used to reduce the dimension of the multidimensional tensor features to obtain low-dimensional tensor features; in the fully connected layer, the low-dimensional tensor features are input to generate dynamic keys; the The dynamic data encryption part is used to encrypt the target data at the current time point using the generated dynamic key to obtain the encrypted current target data, encrypt the copied target data using the generated dynamic key to obtain the encrypted target data, perform feature extraction on the encrypted target data to obtain feature representation, and delete the copied target data; use the improved support vector machine to train the feature representation to obtain a classifier; update the decision boundary of the improved support vector machine to adapt to the target data at the current time point to obtain an updated classifier; apply the updated classifier to the encrypted current target data to obtain the decrypted target data at the current time point.
[0038] Specifically, the dynamic key generation part is a key component in the dynamic data encryption method based on deep learning, which is responsible for generating dynamic keys for subsequent data encryption and decryption. First, the dynamic key generation part copies the target data at a certain time point other than the current time point. These target data are represented as a multidimensional tensor. A multidimensional tensor is a data structure that can be regarded as a multidimensional array, and each dimension corresponds to a feature or attribute of the data. This representation process converts the original data into a form that can be processed by the deep learning model. Next, a deep convolutional neural network model is constructed, including convolutional layers, pooling layers, and fully connected layers. The design of this model is based on the principle of convolutional neural networks. In the convolutional layer, the multidimensional tensor is processed using a convolution operation, which is a core operation in deep learning. The convolution operation involves a sliding convolution kernel (also called a filter) that slides on the input data and gradually extracts features at different positions. These feature maps form the output of the convolutional layer, and they capture the local features of the input data. The principle of the convolution operation is to detect patterns and features in the input data through weight sharing. In the pooling layer, the pooling operation is used to reduce the dimension of the feature map. The pooling operation usually uses maximum pooling or average pooling to reduce the size of the data, reduce computational complexity, and retain important information. This helps to improve the robustness of the model and reduce the risk of overfitting. Finally, in the fully connected layer, the low-dimensional tensor features are input to generate dynamic keys. The neurons in the fully connected layer are connected to all neurons in the previous layer, and the weights of the connection are used to combine low-dimensional features and generate keys. This is a typical feedforward neural network structure.
[0039] The main function of the dynamic key generation part is to generate a dynamic key, which will be used to encrypt and decrypt data. Unlike the traditional fixed key encryption method, this part can dynamically generate keys according to different time points of the input data, which increases the security of the data. Different keys can be generated at each time point, which greatly increases the difficulty of cracking the key. In addition to generating keys, the dynamic key generation part also extracts the features of the target data in the process. These features represent the key information of the input data, and they can be used for subsequent classification or other tasks. Through the processing of the deep learning model, the extraction of features is done automatically, and they may capture the high-level abstract features of the data, which helps to better understand and process the data. The initial target data is represented in the form of a multi-dimensional tensor, which is more suitable for the processing of the deep learning model. The dynamic key generation part plays the role of data preprocessing here, converting the original data into a form suitable for model input.
[0040] The main task of the dynamic data encryption part is to encrypt the target data at the current point in time using the generated dynamic key. Encryption is a process of converting original data into an unreadable form to protect the confidentiality of the data. Usually, the encryption process is carried out using a key and an encryption algorithm. Here, the key is generated in the dynamic key generation part. The encryption process usually uses an encryption algorithm to process the data. An encryption algorithm is a mathematical function that takes the original data and the key as input and generates encrypted data (ciphertext). Common encryption algorithms include symmetric encryption and asymmetric encryption. Symmetric encryption uses the same key for encryption and decryption, while asymmetric encryption uses a pair of public and private keys for encryption and decryption. In this part, the generated dynamic key is used to encrypt the target data at the current point in time. This usually involves performing some kind of mathematical operation on the original data with the key to generate the ciphertext. Only those who have the correct key can decrypt the ciphertext and restore the original data. In addition, the generated dynamic key is also used to encrypt the target data that was copied previously. This is to ensure that the copied data is also protected to prevent the leakage of sensitive information.
[0041] The main function of the dynamic data encryption part is to ensure the security of data. By encrypting data with dynamically generated keys, even if attackers obtain the encrypted data, they cannot easily decrypt it because they do not know the correct key. This method increases the confidentiality of data and helps prevent unauthorized access and data leakage.
[0042] By encrypting the target data, users can protect the privacy of their data. Even if the data is leaked during storage or transmission, unauthorized users still cannot access its content. Before encrypting the data, the dynamic data encryption part usually extracts features from the data. These features can capture the key information of the data and help with subsequent analysis, classification, or other machine learning tasks. This provides a way to combine data protection and analysis. Due to the generation of dynamic keys, different keys can be used to encrypt data at each point in time, which increases the dynamic nature of the data. This means that at different points in time, even the same data will be encrypted in different ways, improving security. After encryption, the target data is processed to extract feature representations. This helps convert the data into a more abstract and compact form for subsequent tasks. At the same time, the copied target data is deleted to ensure that the original plaintext data no longer exists.
[0043] Embodiment 2: The dynamic key generation part represents the copied target data as a multi-dimensional tensor , where the multidimensional tensor Include samples, each of which consists of channels, Line and Column composition; build a multi-layer convolutional neural network model and define the output of the convolutional layer as a multi-dimensional tensor feature ,in is a multidimensional tensor containing samples, each of which consists of channels, Line and Column composition.
[0044] Specifically, the present invention uses a multi-dimensional tensor to represent the target data and uses a convolutional neural network to extract the features of the data. In this way, it can capture the spatial and structural information in the target data and map it to a higher-dimensional feature representation. This feature representation can be used in subsequent steps to generate dynamic keys or perform other data processing operations, thereby improving the security and effectiveness of the data. This method has great potential for processing data with complex structures, such as image or video data, because it can extract richer and more meaningful features.
[0045] First, the copied target data is represented as a multi-dimensional tensor . This tensor has four dimensions: samples, channels, Line and This means It can be regarded as a A dataset consisting of samples, each of which has channels, each containing Line and This representation allows the spatial and structural information of the data to be preserved between samples and channels. Next, a multi-layer CNN model is built to process multi-dimensional tensors. And extract features. This model usually includes convolutional layers, pooling layers, and fully connected layers, the combination of which allows the model to learn abstract features of the data. Define the output of the convolutional layer as a multi-dimensional tensor feature ,in It also has four dimensions: samples, channels, Line and Column. Here , and is the number of channels, rows, and columns of the convolutional layer output. Contains the feature information extracted after the data is convolved.
[0046] Example 3: Using convolution operations to process multidimensional tensors, extract features, and obtain multidimensional tensor features The formula is:
[0047] ;
[0048] in, is the output tensor, which is a multidimensional tensor feature A component of is the output channel index of the convolutional layer, and are the row and column indices of the output tensor, respectively. is the convolution kernel size, is the convolution stride, is a multidimensional tensor A component of is the weight of the convolution kernel, It is a channel Deviation; is the input channel index of the convolutional layer; and All are subscript indexes.
[0049] Specifically, convolution is a mathematical operation that is commonly used in signal processing and image processing. In deep learning, the convolution operation is used to extract features of input data. The basic idea of the convolution operation is to slide a small filter (convolution kernel) over the input data, then multiply the elements in the convolution kernel with the elements at the corresponding positions of the input data, and add the results to get the output.
[0050] This part represents the input data An element in . Among them, represents the input channel index, and Represents the row and column indices of the input data. To adjust the sliding of the convolution kernel on the input data. is the weight of the convolution kernel, which is used to calculate the weighted sum of the input data. The size of the convolution kernel is , and there are input channels To output channel The goal of the convolution operation is to capture the characteristics of the input data by learning these weights. It is the output of the convolution operation and a multi-dimensional tensor feature It is obtained by sliding the convolution kernel over the input data and performing a weighted sum calculation. The specific calculation process is as follows: For the output tensor Each position in , traverse the input channel , the size of the convolution kernel The elements in the , and then the input data at the corresponding position and convolution kernel weights Multiply and accumulate the results. Finally, add the channel Deviation This process is performed on each output channel , each location Will be executed to generate output features The key point of the convolution operation is that it can capture local features in the input data without considering the entire dataset. The weights of the convolution kernel are learned by training the neural network, so the model can automatically learn useful features in the input data. The convolution operation is translation invariant, which means it can recognize the same features at different locations, thereby improving the generalization ability of the model.
[0051] Example 4: In the pooling layer, pooling operations are used to reduce the dimensions of multi-dimensional tensor features to obtain low-dimensional tensor features The formula is:
[0052] ;
[0053] in, and is the subscript index; is a low-dimensional tensor feature A component of .
[0054] Specifically, the core idea of this pooling operation is to select the maximum or minimum value by calculating the exponent of the activation value and the ratio of the relative activation value. For the max pooling operation: it selects the maximum value of the activation value within a region in the input tensor and uses it as the value of the corresponding position in the output tensor. This helps to retain the most significant features within the region. For the max pooling operation: it selects the maximum value of the activation value within a region in the input tensor and uses it as the value of the corresponding position in the output tensor. This helps to retain the most significant features within the region.
[0055] For the max pooling operation, : This is the output tensor of the max pooling operation A component in represents the low-dimensional tensor feature An element in . represents the channel index, and Represents the row and column indices of the output tensor. : This part represents the multidimensional tensor feature Specifically, for each position , considering all the local regions of the multidimensional tensor features and select the largest one.
[0056] : This part calculates the multidimensional tensor features The exponent of the activation value in . This calculation may be used to weight different activation values to more prominently select the largest activation value.
[0057] :This part is for multidimensional tensor features The exponential sum of all activation values in the local region of . This sum may be used for normalization to ensure that the output is a probability distribution.
[0058] : This is the output tensor of the min-pooling operation A component in represents the low-dimensional tensor feature An element in . : This part represents the multidimensional tensor feature Select the minimum value in the local area of . Similar to the maximum pooling, for each position , considering all the local regions of the multidimensional tensor features and select the smallest one. and : These two parts are the same as the corresponding parts in the maximum pooling operation, which are used to calculate the exponent and normalization.
[0059] Embodiment 5: The fully connected layer has three layers in total; the first two layers of the fully connected layer are regarded as hidden layers, namely the first hidden layer and the second hidden layer; the output of the first hidden layer is defined as , define the output of the second hidden layer as ;in:
[0060] ;
[0061] in, is the weight matrix of the first hidden layer; is the weight matrix of the second hidden layer, is the bias of the first hidden layer; is the bias of the second hidden layer, Represents the activation function.
[0062] Specifically, for the first hidden layer, in the neural network, the activation function Usually used to introduce nonlinearity. Common activation functions include Sigmoid, ReLU, Tanh, etc. Their function is to transform the input signal nonlinearly, so that the neural network can learn complex nonlinear relationships.
[0063] :This step will input low-dimensional tensor features Flatten into a one-dimensional vector. This is to convert multi-dimensional data into a form suitable for entering the fully connected layer. : This is the weight matrix of the first hidden layer, which contains the connection weights between neurons. Map the flattened feature vector to the output space of the first hidden layer. : This is the bias term of the first hidden layer. The bias term is a constant that adjusts the activation threshold of the neuron. : This step is the application of the activation function. Usually, It can be a Sigmoid function, whose formula is:
[0064] .
[0065] The activation function transforms the input of the linear combination into a nonlinear activation value. In summary, the calculation process of the first hidden layer is to multiply the flattened feature vector by the weight matrix, then add the bias term, and finally pass it through the activation function. Perform nonlinear transformation. The purpose of this step is to map the input data to a higher dimensional space so that the network can capture more complex features.
[0066] The second hidden layer ( ): : This is the weight matrix of the second hidden layer, which converts the output of the first hidden layer Mapped to the output space of the second hidden layer. : This is the bias term for the second hidden layer. : Again, this step is the application of the activation function, which transforms the linear combination of the first hidden layer into a nonlinear transformation. The calculation process of the second hidden layer is similar to the first hidden layer, but it accepts the output of the first hidden layer As input, the neural network can construct more complex feature representations through multiple levels of nonlinear transformations.
[0067] Embodiment 6: The last layer of the fully connected layer calculates the dynamic key by the following formula:
[0068] ;
[0069] in, is a dimensionality reduction function, which is used to reduce the multi-dimensional tensor to one dimension; is the weight matrix of the last layer.
[0070] Specifically, the dimension reduction function : The input multidimensional tensor features Flatten into a one-dimensional vector so that it can be input into the fully connected layer. This step is to convert the multi-dimensional data into a form suitable for entering the fully connected layer. : This is the weight matrix of the first fully connected layer, which maps the flattened feature vector to the output space of the first fully connected layer. : This is the bias term of the first fully connected layer. The bias term is a constant that adjusts the activation threshold of the neuron. : This is the activation function, usually the RectifiedLinearUnit (ReLU) function, whose formula is:
[0071] .
[0072] It introduces nonlinear properties and sets negative values to zero while retaining positive values. The calculation process of the first fully connected layer is to multiply the flattened feature vector by the weight matrix, then add the bias term, and finally perform a nonlinear transformation through the ReLU activation function. The second fully connected layer ( ): : This is the weight matrix of the second fully connected layer, which maps the output of the first fully connected layer to the output space of the second fully connected layer. Calculate the dynamic key : :This step is the application of the activation function, usually the Sigmoid function, which is used to transform the linear combination of the second fully connected layer nonlinearly. Finally, through this calculation process, the dynamic key is obtained The key is generated through a multi-layer fully connected neural network, which includes flattening operations, linear transformations, nonlinear activation functions, and finally Sigmoid activation functions. This dynamic key This may be used for further data encryption or other applications, depending on the specific purpose of the network. In summary, this formula describes the last fully connected layer in a neural network, which is used to generate a dynamic key The key generation process is performed through multiple fully connected layers, which include multiple linear and nonlinear transformations to generate a dynamic key value based on the input data. This method can be used to enhance the security and privacy of data.
[0073] Embodiment 7: Dynamic data encryption part, after encrypting the target data at the current time point using the generated dynamic key, the method for obtaining the encrypted current target data includes: converting the target data at the current time point into a binary sequence data:
[0074] ,
[0075] in, is the number of elements in the data sequence; using a known key , for binary sequence data Encrypt and obtain the encrypted current target data:
[0076] :
[0077] ;
[0078] in, is a homomorphic encryption function; the same method is applied to encrypt the copied target data using the generated dynamic key to obtain the encrypted target data .
[0079] Specifically, each element in the target data is encrypted using a homomorphic encryption function to protect the privacy of the data. Homomorphic encryption allows calculations to be performed in a ciphertext state, so data can be processed in an encrypted state without decryption. In this way, data is protected even during data transmission or storage. The encryption process uses a generated dynamic key , which means that different keys can be used for encryption at different time points, enhancing the security and privacy of the data.
[0080] Example 8: Encrypted target data Perform feature extraction and obtain the feature representation as follows:
[0081] ;
[0082] The dynamic data encryption part uses an improved support vector machine to train the feature representation. Train and get the classifier The objective function of the improved support vector machine is expressed using the following formula:
[0083] ;
[0084] in, is the weight vector of the improved support vector machine, which is used to define the decision boundary of the data; one of the goals of the objective function is to minimize , to ensure that the decision boundary has enough margin; represents the first-order L1 norm; is the bias of the improved support vector machine, which affects the location of the decision boundary; This is the slack variable of the improved support vector machine, which is the set of slack variables No. elements; It is the regularization parameter of the improved support vector machine, which is used to control the complexity of the model and the degree of tolerance of slack variables; is the error correction parameter used for decryption; is the homomorphic encryption function The corresponding decryption function.
[0085] Embodiment 9: Dynamic data encryption partially updates the decision boundary of the improved support vector machine to adapt to the target data at the current time point. When the updated classifier is obtained, the objective function of the improved support vector machine used is expressed using the following formula:
[0086] ;
[0087] in, is the weight vector of the updated improved support vector machine; is the bias of the updated improved support vector machine; is the set of slack variables of the updated improved support vector machine.
[0088] Specifically, : This is the regularization term, which aims to minimize the weight vector The role of regularization is to ensure that the decision boundary has enough margin to improve the generalization performance of the model. This term helps prevent overfitting.
[0089] : This is the penalty term for the slack variable, where is a regularization parameter that controls the complexity of the model and the degree of tolerance to slack variables. Indicates the degree of misclassification of each data point. This term encourages the model to have a certain tolerance in the case of misclassification.
[0090] :This is a correction term for decryption error. Its goal is to compare the decrypted feature representation The difference between the original target data and the decision boundary of the classifier is adjusted. This term is used to correct the error introduced by homomorphic encryption to ensure that the model can correctly classify the decrypted data. This part ensures that the edge of the decision boundary is large enough to improve the generalization performance of the model and prevent overfitting. This part is achieved by regularizing the parameter Controlling the complexity and tolerance of the model affects the robustness of the model. This part corrects the error introduced by homomorphic encryption by comparing the difference between the decrypted feature representation and the original target data. This is to ensure that the model can correctly classify the decrypted data after training in the ciphertext state.
[0091] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some 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 spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A dynamic data encryption method based on deep learning, characterized in that: The method comprises: a dynamic key generation part and a dynamic data encryption part; the dynamic key generation part is used to copy the target data at any time point other than the current time point, and represent the copied target data as a multidimensional tensor; a deep convolutional neural network model is constructed, including multiple convolutional layers, pooling layers and fully connected layers, in which the multidimensional tensor is processed by convolution operation, features are extracted, and multidimensional tensor features are obtained; in the pooling layer, the pooling operation is used to reduce the dimension of the multidimensional tensor features to obtain low-dimensional tensor features; in the fully connected layer, the low-dimensional tensor features are input to generate a dynamic key; the dynamic data encryption part The method comprises the following steps: encrypting the target data at the current time point with the generated dynamic key to obtain the encrypted current target data; encrypting the copied target data with the generated dynamic key to obtain the encrypted target data; extracting features from the encrypted target data to obtain feature representation; and deleting the copied target data; training the feature representation with the improved support vector machine to obtain a classifier; updating the decision boundary of the improved support vector machine to adapt to the target data at the current time point to obtain an updated classifier; applying the updated classifier to the encrypted current target data to obtain the decrypted target data at the current time point; The dynamic key generation part represents the copied target data as a multi-dimensional tensor , where the multidimensional tensor Include samples, each of which consists of channels, Line and Column composition; build a multi-layer convolutional neural network model and define the output of the convolutional layer as a multi-dimensional tensor feature ,in is a multidimensional tensor containing samples, each of which consists of channels, Line and Column composition; Use convolution operations to process multidimensional tensors, extract features, and obtain multidimensional tensor features The formula is: ; in, is the output tensor, which is a multidimensional tensor feature A component of is the output channel index of the convolutional layer, and are the row and column indices of the output tensor, respectively. is the convolution kernel size, is the convolution stride, is a multidimensional tensor A component of is the weight of the convolution kernel, It is a channel Deviation; is the input channel index of the convolutional layer; and All are subscript indexes; In the pooling layer, pooling operations are used to reduce the dimensions of multi-dimensional tensor features to obtain low-dimensional tensor features. The formula is: ; in, and is the subscript index; is a low-dimensional tensor feature a component of; The fully connected layer has a total of three layers; the first two layers of the fully connected layer are regarded as hidden layers, namely the first hidden layer and the second hidden layer; the output of the first hidden layer is defined as , define the output of the second hidden layer as ;in: ; in, is the weight matrix of the first hidden layer; is the weight matrix of the second hidden layer, is the bias of the first hidden layer; is the bias of the second hidden layer, represents the activation function; The last layer of the fully connected layer calculates the dynamic key using the following formula: ; in, is a dimensionality reduction function used to reduce a multi-dimensional tensor to one dimension; is the weight matrix of the last layer; In the dynamic data encryption part, after the target data at the current time point is encrypted using the generated dynamic key, the method for obtaining the encrypted current target data includes: converting the target data at the current time point into a binary sequence data ,in, is the number of elements in the data sequence; using a known key , for binary sequence data Encrypt and obtain the encrypted current target data: : ; in, is a homomorphic encryption function; the same method is applied to encrypt the copied target data using the generated dynamic key to obtain the encrypted target data ; The encrypted target data Perform feature extraction and obtain the feature representation as follows: ; The dynamic data encryption part uses an improved support vector machine to train the feature representation. Train and get the classifier ; The objective function of the improved support vector machine is expressed using the following formula: ; in, is the weight vector of the improved support vector machine, which is used to define the decision boundary of the data; one of the goals of the objective function is to minimize , to ensure that the decision boundary has enough margin; represents the first-order L1 norm; is the bias of the improved support vector machine, which affects the location of the decision boundary; This is the slack variable of the improved support vector machine, which is the set of slack variables No. elements; It is the regularization parameter of the improved support vector machine, which is used to control the complexity of the model and the degree of tolerance of slack variables; is the error correction parameter used for decryption; is the homomorphic encryption function The corresponding decryption function; The dynamic data encryption part updates the decision boundary of the improved support vector machine to adapt to the target data at the current time point. When the updated classifier is obtained, the objective function of the improved support vector machine used is expressed by the following formula: ; in, is the weight vector of the updated improved support vector machine; is the bias of the updated improved support vector machine; is the set of slack variables of the updated improved support vector machine.
Citation Information
Patent Citations
Multi-user privacy protection machine learning method and device based on multi-key fully homomorphic encryption
CN114844621A
Data transmission method and system based on dynamic key
CN116886276A