Neural network encryption method

By splitting the neural network into multiple parts and deploying it in multiple devices, irreversible encrypted transmission is achieved, solving the problem that existing neural network encryption methods are easily cracked, significantly improving data security and transmission efficiency, and is applicable In a variety of cloud collaborative application scenarios.

CN118590260APending Publication Date: 2024-09-03BEIJING PINGXIN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410554478.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-07
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

Existing neural network encryption methods are easily cracked, especially in advanced computing environments such as quantum computing. One-sided data leakage on the device side and the cloud side will affect the data security on the other side, causing damage to user privacy rights.

Method used

Split the neural network into input, output and other parts, determine the weight data through collaborative training, and divide the weight data into multiple parts and deploy them on multiple devices to achieve irreversible encrypted transmission. Specific methods include dividing the multi-layer structure, determining the demarcation point based on computing power requirements and data size, and performing multiple sets of calculations on multiple devices. The weight of each part is only used once, and the encoding and decoding parts are deployed in different devices. Deployment order is free.

Benefits of technology

Through the irreversible calculation process, the original data is protected, the security of the neural network is improved, data leakage and reverse engineering are prevented, and the security of user information is ensured. It is suitable for training and generation tasks of large models, especially in cloud collaborative applications. in the scene.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118590260A
    Figure CN118590260A
Patent Text Reader

Abstract

The invention discloses an encryption method of a neural network, which comprises the following steps of: splitting the neural network into a plurality of parts, independently completing calculation on each part, performing cooperative training on each part to determine weight data of the neural network, dividing the weight data into a plurality of parts, deploying the parts in a plurality of devices, and after calculation on a single part is completed, determining the weight data of the neural network. And obtaining a potential spatial expression of the data to realize encryption. Encrypted transmission of information can be realized through weight separation, and the risk of original data leakage is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of neural network security technology, and in particular to an encryption method for a neural network. Background Art

[0002] In recent years, artificial intelligence technology has developed rapidly and has been widely used in many fields such as speech recognition, image recognition, and natural language processing. The application effect of artificial intelligence technology is highly dependent on deep learning, which is achieved through neural networks. Neural networks are the basic building blocks of deep learning algorithms, which are machine learning algorithms that aim to simulate the behavior of the human brain. Neural networks consist of interconnected nodes, also known as artificial neurons, which are organized into a hierarchical structure. In addition to the input nodes, each node of a neural network represents a specific output function, called an activation function, which can also be regarded as an operation. The connection between each two nodes represents the proportion of the signal in the transmission, that is, the proportion of the "memory value" of the node being passed on, which is called the weight.

[0003] With the continuous evolution and optimization of neural networks, their application fields are becoming more and more extensive. In the process of collecting and storing massive data, the demand for the security of neural networks has also emerged. In the actual application process, as the accuracy of the output results of neural networks continues to improve, it is possible to restore the original data based on the output of the neural network. Specifically, by analyzing the output of the model, the characteristics and distribution of the training data can be inferred, and then similar data sets can be constructed, and even part of the original data can be restored. In some specific application scenarios, the original data includes, for example, customer information, search records, transaction data, etc. This situation will seriously damage the privacy rights and interests of the user group.

[0004] In order to solve this problem and improve the security of neural networks, mainstream encryption algorithms are currently used to achieve end-to-end encryption by exchanging keys. However, this traditional encryption method has the risk of being easily cracked, the most typical of which is the reversibility of encryption. Although reversibility is conducive to maintaining the integrity of information, with the continuous development of advanced computing such as quantum computing, once data leakage occurs on one side of the end side and the cloud side, it will affect the data security of the other side. Summary of the invention

[0005] In view of some or all of the problems in the prior art, the present invention provides an encryption method for a neural network, comprising:

[0006] Splitting a neural network into input, output, and other parts, each of which can perform computations independently; and

[0007] Co-training the input, output and other parts to determine weight data of the neural network; and

[0008] The weight data is divided into multiple parts and deployed in multiple devices. After the calculation of a single part is completed, the latent space expression of the data is obtained to achieve encryption.

[0009] Furthermore, the decomposition of the neural network includes:

[0010] A dividing point is determined to divide the multi-layer structure of the neural network into multiple parts.

[0011] Furthermore, the demarcation point is determined based on the requirements for computing power on both sides of the demarcation point and / or the size of data on the demarcation point profile.

[0012] Furthermore, the neural network includes multiple groups of calculations, which are implemented in multiple devices, wherein each device completes one or more groups of calculations based on all or part of the weight data deployed thereon, and each part of the weight data is not reused, that is, each group of calculations will use several parts of the weights, and each part of the weight data is only used once.

[0013] Furthermore, the encryption method further comprises:

[0014] The neural network is split into an encoding part and a decoding part, and the encoding part and the decoding part are split into several parts respectively, and then deployed in several devices, including:

[0015] Setting part or all of the weights separated from the coding part in the input device, and setting the rest in the output or other devices; and

[0016] Part or all of the weights separated from the decoding part are set in the output end device, and the rest are set in the input end or other devices.

[0017] Furthermore, the neural network is divided into multiple encoder parts and decoding parts, and the deployment order of the encoding parts and decoding parts is not fixed, that is, the deployment order of each encoding part and decoding part can be freely adjusted.

[0018] Furthermore, the neural network only includes a coding part, and the coding part performs n weight separations, and sets the separated weights in m devices, each of which can be assigned one or more weights, wherein n and m are natural numbers, and m <n。

[0019] Furthermore, the neural network only includes a decoding part, and the decoding part performs n weight separations, and sets the separated weights in m devices, each of which can be assigned one or more weights, wherein n and m are natural numbers, and m <n。

[0020] Furthermore, the encryption method further comprises:

[0021] Convert the input sequence into a latent space representation.

[0022] The present invention provides a neural network encryption method, which splits the data weights of the neural network reasoning process into multiple parts and deploys them in multiple devices, thereby effectively realizing information security encryption. After the weights are split, the input and output of the neural network can be calculated independently, and the calculation process is irreversible, which can effectively protect the original data and further improve the security of the neural network. The neural network weight splitting method can be applied to large models, especially the training and generation of large models. The encryption method can be applied to natural language understanding, translation, text generation and other tasks in many cloud-coordinated neural network intelligent application scenarios such as public clouds, data centers, intelligent computing centers, intelligent security, face recognition, smart wearables, and vehicle-road collaboration. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] To further illustrate the above and other advantages and features of various embodiments of the present invention, a more specific description of various embodiments of the present invention will be presented with reference to the accompanying drawings. It will be understood that these drawings only depict typical embodiments of the present invention and are therefore not to be considered as limiting the scope thereof. In the accompanying drawings, for clarity, identical or corresponding parts will be represented by identical or similar reference numerals.

[0024] Figure 1 A process schematic diagram showing a neural network encryption method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In the following description, the present invention is described with reference to various embodiments. However, those skilled in the art will recognize that various embodiments may be implemented without one or more specific details or with other replacement and / or additional methods or components. In other cases, well-known structures or operations are not shown or described in detail to avoid obscuring the inventive point of the present invention. Similarly, for the purpose of explanation, specific numbers and configurations are set forth to provide a comprehensive understanding of embodiments of the present invention. However, the present invention is not limited to these specific details.

[0026] In this specification, reference to "one embodiment" or "the embodiment" means that a particular feature, structure, or characteristic described in conjunction with the embodiment is included in at least one embodiment of the present invention. The phrase "in one embodiment" appearing in various places in this specification does not necessarily all refer to the same embodiment.

[0027] It should be noted that the embodiments of the present invention describe the method steps in a specific order, but this is only for the purpose of illustrating the specific embodiment, rather than limiting the order of the steps. On the contrary, in different embodiments of the present invention, the order of the steps can be adjusted according to actual needs.

[0028] The inventor has found through research that the neural network includes an input end and an output end. In the process of neural network reasoning and calculation, in order to complete encrypted transmission, if the overall structure of the neural network is divided into at least multiple parts including input and output, so that the encryption and decryption algorithms of each part together constitute a neural network, the various parts of the neural network can complete the calculation independently, and such a calculation process is irreversible. Specifically, the input end will generate an intermediate value after the calculation of the input part and / or other parts of the neural network. The input data is hidden in the intermediate value. This part of the input data cannot be directly recognized and can only be calculated through the output part and / or other parts of the neural network to obtain information. After the intermediate value passes through the weight of the output part, it is converted into an output value. The output value contains information with a high correlation with the input value, but its expression is not exactly the same as the input value. The inventor further found that in the process of using a neural network for data processing, as long as it is ensured that any end cannot obtain all the weights, the data and model security can be guaranteed; at the same time, due to the irreversible characteristics of the neural network and the unexplainability of the large model, even if all the weights are obtained, the original data cannot be derived from the final data or intermediate data, which can effectively protect the security of user information and solve the security and credibility issues of the neural network. Based on this, the present invention provides a solution for splitting the neural network reasoning process and the overall weight, which adopts a split weight encryption and decryption algorithm with an irreversible characteristic, so that even if the output data and the complete encryption and decryption weight data are known at the same time, the input data cannot be completely restored. This is of vital importance for solving public safety problems and establishing a trust mechanism.

[0029] The technical solution of the present invention is further described below in conjunction with the accompanying drawings of the embodiments.

[0030] Figure 1 A schematic diagram of a neural network encryption method according to an embodiment of the present invention is shown. Figure 1 As shown, an encryption process of neural network weight separation includes two parts: training phase and reasoning phase. The training phase includes determining the weight data of the neural network through collaborative training, and the reasoning phase includes the separation deployment of the weights to achieve encrypted communication.

[0031] In one embodiment of the present invention, during the training phase, the weights are trained to minimize the loss function through an error propagation algorithm. During the error propagation process, all weights are trained collaboratively and influence each other, that is, the weights of the neural network are a set of overall values. In one embodiment of the present invention, the training process can be deployed in one or more computing devices such as GPUs.

[0032] In one embodiment of the present invention, weight separation in the inference stage includes dividing the neural network into multiple parts, including at least an input part and an output part. In one embodiment of the present invention, the neural network is divided into multiple parts based on its structure. Specifically, for a neural network, after the data is input, it needs to pass through many layers of structure to divide the neural network, and the dividing point between each part is determined based on the multi-layer structure to separate the neural network. In one embodiment of the present invention, the division is based on the requirements for computing power at both ends of the dividing point and / or the size of the data on the dividing point profile. In one embodiment of the present invention, part of the neural network with a computing power requirement lower than a preset value is deployed on a device that is sensitive to power consumption, and the rest of the neural network is deployed on other devices. In another embodiment of the present invention, when the amount of transmitted data is more sensitive, the size of the data at the dividing point is further considered so that the data size at the dividing point is not greater than the preset value.

[0033] After the neural network is divided, each part obtained by the division is deployed to the corresponding device respectively, which is equivalent to separating the weights of the neural network. After the calculation of a single part is completed, the potential space expression of the data is obtained, and then the encrypted transmission of information can be realized by separating the weights to avoid the leakage of the original data. In other words, the neural network can be understood as including multiple groups of calculations. Dividing the neural network and deploying them separately is equivalent to implementing these calculations in multiple devices, where each device completes one or more groups of calculations, and each group of calculations will use several parts of the weights, and each part of the weight data is only used once. It should be understood that the input end, output end and other parts can be deployed on multiple devices. After the deployment is completed, the data on all input devices is the same, and the data on all output devices is also the same. The sum of the data of each part is the entire neural network.

[0034] The encryption method described above can be applied to neural networks of various architectures, such as an encoder-decoder architecture, an encoder-only architecture, and a decoder-only architecture.

[0035] The Encoder-Decoder architecture is mostly used in scenarios such as machine translation and dialogue generation. When the encryption method is applied to the Encoder-Decoder architecture, the input end of the neural network completes the input of the input sequence. Combined with the embedding layer and the position encoding component, the Encoder converts the input sequence into a latent space representation and completes the separation of weights. In one embodiment of the present invention, in order to obtain a better model, the above steps can be repeated many times until the model captures the global context of the input sequence with the best possibility, resulting in better task generalization. Based on the encryption method as described above, all or part of the weights of the Encoder are placed on the input device. The data processed by the Encoder is sent to the output device, that is, the Decoder. After the Decoder receives the data, it repeats the above steps, that is, converts the data into a latent space representation, and completes the separation of weights. In an embodiment of the present invention, the Decoder needs to maintain the same number of repetitions as the Encoder to fuse the Encoder output with the target sequence. Similarly, the weights separated by the decoder can be partially or completely set in the output device. This means that the input device may only be set with the weights separated by the encoder, or it may also include the weights separated by the encoder and the decoder. Similarly, the output device may only be set with the weights separated by the decoder, or it may also include the weights separated by the encoder and the decoder. At the same time, the encoder-separated weights contained in the input device may be complete or only partially. Similarly, the decoder-separated weights contained in the output device may be complete or only partially. Finally, based on the weight separation deployment as described above, during the entire execution of the neural network task, the sequence processing process is irreversible, and the input device cannot obtain the weights of the output device. Similarly, the output device cannot obtain the weights of the input device. Therefore, even through reverse engineering technology, the architecture, weights and training data of the deployed model cannot be restored, and the content of the output end can also be protected, which greatly protects the security of data in various application scenarios.

[0036] The Encoder-Only architecture only includes the encoder part, and this type of architecture is usually used to complete one-way task scenarios. For example, text classification, sentiment analysis, etc. When the encryption method is applied to the Encoder-on ly architecture, first, similar to the Encoder-Decoder architecture, the input end completes the input of the input sequence, and combined with the Embedding layer and the Position Encoding component, the Encoder converts the input sequence into a latent space vector representation. In the weight separation part, the Encoder-Only architecture is different from the Encoder-Decoder architecture. Specifically, in the Encoder-Only architecture, assuming that the Encoder completes the separation of weights n times, then the weights extracted m times are placed on the input end device at random, and the remaining (nm) times of weights are set on the output end device, thereby combining multiple devices to complete the NLP discrimination task. For the Encoder-Only architecture, the sequence processing process is also irreversible during the entire execution of the neural network model task. Therefore, even through reverse engineering technology, the weights and training data of the Encoder-on ly architecture cannot be restored, while the content of the output end can also be protected.

[0037] The Decoder-on ly architecture only includes the decoder part, so it is mostly used to complete one-way task scenarios that require sequence generation, such as text generation, machine translation, etc. Since the architecture does not include the Encoder part, there are certain differences between the encryption method applied to the Decoder-on ly architecture and other architectures. Specifically, when the encryption method is applied to the Decoder-on ly architecture, the input end first completes the input of the input sequence, and combined with the Embedding layer and the Position Encoding component, the Decoder converts the input sequence into a latent space vector representation and performs weight separation. It is assumed that the Decoder completes the separation of weights n times in total, and arbitrarily extracts m times of weights and places them on the input end device, and the remaining (nm) times of weights are placed on the output end device, and the task of generating a sequence is completed by combining multiple devices. During the entire execution period of the neural network model task, the process of sequence processing is irreversible, and even through reverse engineering technology, the weights and training data of the Decoder-on ly architecture cannot be restored, and the content of the output end can also be protected at the same time.

[0038] It should be understood that in the aforementioned various architectures, the order of encoders and decoders can be freely adjusted, and the neural network can include multiple encoders and / or decoders.

[0039] By splitting the overall weight of the neural network reasoning process, the problem of model data information leakage caused by reverse reasoning analysis is solved. At the same time, after completing multiple weight splits, data transmission between multiple devices does not need to use original data with large memory, which greatly reduces the amount of data transmission.

[0040] It should be understood that in addition to being applied to encryption and decryption scenarios, the various neural network architectures described above can also be applied to other different scenarios, for example, they can also be used for data compression and encoding. Specifically, after the original data passes through the complete neural network, it will be compressed to obtain a compression result. In terms of the amount of data, the original parameters can be enlarged or reduced to formatted or unformatted data of any size by adjusting the neural network structure. Therefore, the encryption method described above can also be used to achieve data compression of any size, and the valid data in the original data is saved in the output data as much as possible, but it should be understood that the data compression performed in this way is lossy compression. As for encoding, the process of the original data passing through the neural network architecture described above is also the encoding process. The original data is mapped to the new data space through this encoding process.

[0041] In order to better illustrate the technical solution of the present invention, a specific implementation method is described by taking a certain practical application as an example. In some scenarios, users are required to upload facial images from their mobile phones to the server for comparison and verification by the service provider. If data leakage occurs in any of the communication channels and the cloud at this time, the user's facial data will be leaked, causing losses to the user. When the neural network architecture as described above is applied to such scenarios, the neural network includes a face comparison and verification model, which is divided into two parts, one part is deployed on a client close to the user, and the other part is deployed on the cloud. At this time, the client is the input device and the cloud is the output device. The encryption method as described above is adopted. First, the two parts of the model are trained collaboratively during training, and then deployed to the two end devices according to demand. Since the two parts of the model are trained collaboratively, the reasoning results of the separate deployment are the same as the reasoning results of the combined deployment, which will not affect the accuracy of the results. After the deployment is completed, when the user needs to upload a face image to the cloud, the image is first sent to the client side part of the model, and this part of the model is executed, and the data after the model is executed is transmitted to the cloud. After the cloud receives this part of the data, it puts this part of the data into the cloud side model for further execution. After the model is executed, the face comparison and verification related results are obtained. During the entire process, even if data leakage occurs during data transmission or in the cloud, the data obtained by the attacker is only the intermediate data obtained by the original data through the client side model. Due to the unexplainable nature of the large model, the original information of the customer cannot be restored through this part of the data, thereby realizing data encryption and protecting the customer's information security.

[0042] The present invention realizes encryption of the data reasoning training process by splitting the weights of the neural network, solves the problem of data desensitization, greatly improves data security, and significantly improves data transmission efficiency. The encryption method can be widely used in the financial industry, medical industry, scientific research and other fields, covering natural language processing application scenarios in neural network data training, fine-tuning, reasoning and operation.

[0043] Although various embodiments of the present invention are described above, it should be understood that they are presented as examples only and not as limitations. It is obvious to those skilled in the relevant art that various combinations, modifications and changes can be made thereto without departing from the spirit and scope of the present invention. Therefore, the breadth and scope of the present invention disclosed herein should not be limited by the exemplary embodiments disclosed above, but should only be defined according to the attached claims and their equivalents.

Claims

1. A neural network encryption method, characterized in that: Includes steps: Splitting the neural network into multiple parts, including at least input and output, and each part can independently complete calculations; collaboratively training the multiple parts to determine weight data of the neural network; as well as The weight data is divided into multiple parts and deployed in multiple devices. After the calculation of a single part is completed, the latent space expression of the data is obtained to achieve encryption.

2. The encryption method according to claim 1, wherein: Splitting a neural network into parts involves the following steps: A dividing point between each part is determined to divide the multi-layer structure of the neural network into a plurality of parts.

3. The encryption method according to claim 2, characterized in that: The demarcation point is determined based on the requirements for computing power on both sides of the demarcation point and / or the data size on the demarcation point profile.

4. The encryption method according to claim 1, wherein: The neural network includes multiple groups of calculations, which are implemented in multiple devices, wherein each device completes one or more groups of calculations based on all or part of the weight data deployed thereon, and each part of the weight data is not reused.

5. The encryption method according to claim 1, wherein: Also includes the steps: The neural network is split into an encoding part and a decoding part, and the encoding part and the decoding part are respectively split into several parts and deployed in several devices.

6. The encryption method according to claim 5, characterized in that: The neural network is divided into multiple encoding parts and decoding parts, and the deployment order of the encoding parts and the decoding parts is not fixed.

7. The encryption method according to claim 1, characterized in that: The neural network only includes an encoding part, and the encoding part performs n weight separations, and sets the separated weights in m devices, wherein each device sets one or more weights, wherein n and m are natural numbers, and m <n。 8. The encryption method according to claim 1, wherein: The neural network only includes a decoding part, which performs n weight separations and sets the separated weights in m devices, wherein each device sets one or more weights, wherein n and m are natural numbers, and m <n。 9. The encryption method according to claim 1, wherein: Also includes the steps: Convert the input sequence into a latent space representation.