Deep Learning Neural Network Storage and Inference Methods

By setting up virtual nodes in the deep learning neural network and storing model parameters separately, the security problem of the deep learning neural network in the storage and inference process is solved, and the encryption and security of the model parameters are realized to prevent unauthorized use.

CN113554167BActive Publication Date: 2024-09-24AISILEX TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110673578.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-05-31
Filing Date
2021-06-17
Publication Date
2024-09-24
Estimated Expiration
2041-06-17

AI Technical Summary

Technical Problem

Existing deep learning neural networks have security issues during the storage and inference process, and model parameters are easily stolen, leading to data leakage and unauthorized use.

Method used

By setting up virtual nodes in the neural network, storing the model parameters and the parameters of the virtual nodes separately, and deleting or setting the interconnections of the virtual nodes to zero during inference, the encryption and security of the model parameters are ensured.

Benefits of technology

It effectively prevents hackers from obtaining some model parameters for inference, ensures the security and data privacy of the neural network, avoids unauthorized use, and improves the model's protection mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113554167B_ABST
    Figure CN113554167B_ABST
Patent Text Reader

Abstract

The present invention discloses a deep learning neural network storage and inference method, wherein a plurality of virtual nodes are set in a first neural network to form a second neural network; the model parameters of the second neural network are stored in a first storage area, and the parameters of the virtual nodes are stored in a second storage area; when inference is made, the model parameters of the second neural network and the parameters of the virtual nodes are taken out from the first storage area and the second storage area respectively, and the interconnection of the virtual nodes in the second neural network is deleted or set to zero according to the parameters of the virtual nodes, and then inference is made. By storing the model parameters and the parameters of the virtual nodes in different places through the method of the present invention, the neural network can be prevented from being cracked.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a neural network technology, and more particularly to a deep learning neural network storage and inference method. Background Art

[0002] Artificial Neural Network (ANN), referred to as neural network or quasi-neural network, is a mathematical model or computational model that imitates the structure and function of the central nervous system of organisms in the field of machine learning and cognitive science. It is used to estimate or approximate functions.

[0003] One branch of machine learning is deep learning. A neural network contains three layers of neurons, such as Figure 1 As shown, the neural network 50 includes an input layer 502, a hidden layer 504 and an output layer 506. The hidden layer 504 is between the input layer 502 and the output layer 506, does not participate in input or output, and is dedicated to transmitting and processing data. When the number of hidden layers 504 is more than one layer, this neural network 50 is usually called a deep neural network. Each layer includes multiple nodes 52, and the connection between nodes 52 and nodes 52 is called an interconnection 54. Each interconnection 54 has a weight. A neural network 50 can be defined by the interconnections 54 between nodes 52 and nodes 52 and the weight of each interconnection 54. Usually, the interconnection 54 is fixed, and the value of the weight can be obtained by training the neural network 50 with a large amount of data, but this weight value can also be random. The trained deep learning neural network 50 can store model parameters such as weights and interconnections 54, but for security reasons, the deep learning neural network 50 needs to be encrypted, and when the deep learning neural network 50 needs to be used for inference, it needs to be decrypted before inference.

[0004] Therefore, the present invention proposes a deep learning neural network storage and inference method, which uses a special method to store model parameters to achieve encryption, so as to effectively solve the above-mentioned problems. The specific architecture and implementation method will be described in detail later. Summary of the invention

[0005] The main purpose of the present invention is to provide a deep learning neural network storage and inference method, which stores the model parameters of the neural network separately in different storage areas. Even if a hacker obtains one of the model parameters, the neural network cannot be used for inference with only one model parameter.

[0006] Another object of the present invention is to provide a deep learning neural network storage and inference method, which sets multiple virtual nodes in the neural network, changes the model parameters of the neural network, and stores the new model parameters and the parameters of the virtual nodes separately.

[0007] Another object of the present invention is to provide a deep learning neural network storage and inference method, which does not delete virtual nodes during inference, but deletes or sets the interconnection between virtual nodes to zero so as not to change the architecture of the neural network again.

[0008] To achieve the above-mentioned purpose, the present invention provides a deep learning neural network storage and inference method, comprising the following steps: setting a plurality of dummy nodes in a first neural network to form a second neural network; storing the model parameters of the second neural network in a first storage area, and storing the parameters of the dummy nodes in a second storage area; and during inference, simultaneously taking out the model parameters of the second neural network and the parameters of the dummy nodes from the first storage area and the second storage area respectively, deleting or setting the interconnections of the dummy nodes in the second neural network to zero according to the parameters of the dummy nodes, and then performing inference.

[0009] According to an embodiment of the present invention, a method for setting a virtual node includes: inserting a virtual node into a first neural network to change the architecture of the first neural network; and generating multiple interconnections on the virtual node and randomly assigning weights to the interconnections to form a second neural network.

[0010] According to an embodiment of the present invention, a method for setting a virtual node includes: finding a plurality of empty nodes or nodes with extremely low usage rates from a plurality of nodes of a first neural network, and setting them as virtual nodes; and setting a plurality of weights on the interconnection of the virtual nodes to zero to form a second neural network.

[0011] According to an embodiment of the present invention, when the second neural network is trained, the weights on the interconnections of the virtual nodes are assigned random values.

[0012] According to an embodiment of the present invention, a method for setting virtual nodes includes: when training a first neural network, setting a dropout ratio to a number greater than 0 and less than or equal to 1; after setting the ratio of all nodes of the first neural network to 0, recording the training process of the first neural network, and randomly deleting multiple nodes during the training process; selecting an optimal configuration from the recorded training process of the first neural network, and returning the deleted nodes in the optimal configuration to their original positions, setting the restored nodes as virtual nodes; and randomly allocating multiple weights on the interconnection of the virtual nodes to form a second neural network.

[0013] According to an embodiment of the present invention, the optimal configuration includes one of the lowest mean square loss, the lowest cross entropy loss, the highest similarity or the highest accuracy, or a combination of at least two of them.

[0014] According to an embodiment of the present invention, the first storage area and the second storage area are set in different databases.

[0015] According to an embodiment of the present invention, the first storage area and the second storage area are connected to a host for inference.

[0016] According to an embodiment of the present invention, the first storage area or the second storage area is disposed in a host, and the host is used for performing inference. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is the architecture diagram of a deep learning neural network.

[0018] Figure 2A and Figure 2B They are schematic diagrams of embodiments of setting virtual nodes in the deep learning neural network storage and inference method of the present invention.

[0019] Figure 3 Flow chart of the deep learning neural network storage and inference method of the present invention.

[0020] Figure 4 FIG. 1 is a block diagram of a first embodiment of the present invention in which model parameters and virtual node parameters are stored separately.

[0021] Figure 5 FIG. 4 is a block diagram of a second embodiment of the present invention in which model parameters and virtual node parameters are stored separately.

[0022] Explanation of the reference numerals: 10 - second neural network; 102 - input layer; 104 - hidden layer; 106 - output layer; 12 - node; 14 - interconnection; 16 - virtual node; 20 - first storage area; 202 - model parameters; 22 - second storage area; 222 - parameters of virtual nodes; 24 - host; 50 - neural network, first neural network; 502 - input layer; 504 - hidden layer; 506 - output layer; 52 - node; 54 - interconnection. DETAILED DESCRIPTION

[0023] The present invention provides a deep learning neural network storage and inference method, which forms a second neural network by setting a plurality of virtual nodes (dummy nodes) in a first neural network in the original architecture of the neural network; storing the model parameters of the second neural network in a first storage area, and storing the parameters of the virtual nodes in a second storage area; and when inferring, taking out the model parameters of the second neural network and the parameters of the virtual nodes from the first storage area and the second storage area respectively, deleting or setting the interconnection of the virtual nodes in the second neural network to zero according to the parameters of the virtual nodes, and then inferring, and storing the parameters of the virtual nodes separately from the overall model parameters of the neural network to ensure that even if someone else obtains the model parameters, the real neural network model cannot be obtained without the parameters of the virtual nodes, and inference cannot be performed. By setting virtual nodes, the neural network is encrypted and protected in disguise, and the operation and storage of virtual nodes are used to exchange the time of encryption and decryption.

[0024] Please also refer to Figure 2B and Figure 3 , which are respectively a schematic diagram and a flow chart of an embodiment of setting virtual nodes in the deep learning neural network storage and inference method of the present invention. Figure 2B The neural network 10 in the embodiment has an input layer 102, two hidden layers 104 and an output layer 106. Since the number of hidden layers 104 is greater than one, the neural network 10 is a deep neural network. Each layer of the neural network 10 includes a plurality of nodes 12. The connection between the nodes 12 is called an interconnection 14. Each interconnection 14 has a weight. The neural network 10 can be defined by the interconnections 14 between the nodes 12 and the weight of each interconnection 14. The present invention sets a plurality of virtual nodes 16 in the neural network 10. Figure 2B The figure is only one embodiment of setting the virtual node 16.

[0025] The deep learning neural network storage and inference method of the present invention includes the following steps: in step S10, a plurality of meaningless virtual nodes 16 are set in a first neural network to form a second neural network, and the virtual nodes 16 do not need to be set in each layer; in step S12, the model parameters of the second neural network are stored in a first storage area, and the parameters of the virtual nodes 16 are stored in a second storage area. In this embodiment, the model parameters include the parameters of the nodes 12 and the parameters of the virtual nodes 16. Then, when inference is to be performed, as described in step S14, the model parameters of the second neural network and the parameters of the virtual nodes 16 are taken out from the first storage area and the second storage area respectively, and according to the parameters of the virtual nodes 16, the interconnection of the virtual nodes 16 in the second neural network is deleted or set to zero, and finally the second neural network can be used for inference, as described in step S16.

[0026] In the above step S10, there are many methods for setting the virtual node 16 in the first neural network. Assuming that the architecture of the first neural network is as follows Figure 1 The following are three methods of neural network 50:

[0027] The first method of setting the virtual node 16 is as follows: Figure 2A As shown, a virtual node 16 is inserted into the first neural network 50, so that the total number of nodes of the first neural network 50 increases and the architecture of the first neural network 50 is changed. Figure 2A For example, a virtual node 16 is inserted into each layer. Then, multiple interconnections 14 are generated on the virtual node 16, including the interconnection 14 between the node 12 and the virtual node 16 and the interconnection 14 between the virtual node 16 and the virtual node 16. In order to make the neural network look normal, weights are randomly assigned to the interconnections 14 of these virtual nodes 16 to form a second neural network.

[0028] The second method of setting the virtual node 16 is as follows: Figure 2B As shown, multiple empty nodes or nodes with extremely low usage rates are found from multiple nodes 12 of the first neural network, and are set as virtual nodes 16. Since the node itself has no content or has extremely low usage rates, replacing it with a virtual node 16 does not affect the operation of the first neural network. Then, the weights on the interconnections 14 of the virtual node 16 are set to zero to form a second neural network 10. In this way, after the second neural network 10 is trained, random values ​​can be assigned to the weights on the interconnections 14 of the virtual nodes 16, so that the second neural network 10 looks like a normal neural network. Because the virtual node 16 does not exist conceptually, and the interconnections 14 on the virtual node 16 will be deleted or the weights on the interconnections 14 will be set to 0 during the inference, the random values ​​assigned to the interconnections 14 of the virtual node 16 during the training phase of the second neural network 10 will not affect the subsequent inference.

[0029] A third method for setting the virtual nodes 16 is to use a dropout technique when training the first neural network, and randomly delete some nodes or interconnections during iterations during the training process. First, the dropout ratio is set to a number between (0,1], that is, 0<dropout ratio≤1. Then, after the ratio of all nodes 12 of the first neural network is set to 0, the training process of the first neural network is recorded, and multiple nodes are randomly deleted during this training process. Then, an optimal configuration is selected during the recorded training process of the first neural network, such as the lowest mean square loss, the lowest cross entropy loss, the highest similarity or the highest accuracy, etc., and one or more combinations can be selected from them. Then the deleted nodes in the optimal configuration are put back to their original positions, and the multiple restored nodes are set as virtual nodes. Finally, multiple weights on the interconnection of the virtual nodes are randomly assigned so that the virtual nodes look like normal nodes, forming a second neural network. Assuming that 20 iterations are performed during the training process, 50% of the nodes will be deleted in each iteration. The configurations of these 20 iterations will be recorded, and the optimal configuration, such as the one with the highest accuracy, can be selected from them as the second neural network. The deleted 50% nodes are stored as virtual parameters in the second storage area, and the model parameters of the original neural network before 50% of the nodes are deleted are stored in the first storage area. Figure 2B For example, the virtual node is a node that is deleted during the iteration process and then restored as a virtual node.

[0030] Step S12 stores the model parameters of the second neural network and the parameters of the virtual node 16 in the first storage area and the second storage area respectively. Figure 4 and Figure 5 . Figure 4 In the first embodiment, the model parameters 202 of the second neural network are stored in the first storage area 20, and the parameters 222 of the virtual nodes are stored in the second storage area 22, and the host 24 used for inference is independently set. When inference is to be performed, the host 24 needs to take out the model parameters 202 of the second neural network and the parameters 222 of the virtual nodes from the first storage area 20 and the second storage area 22 respectively. Figure 5 In the second embodiment, the second storage area 22 is set in the host 24 for inference, so the host 24 itself already has the parameters 222 of the virtual node. As long as the model parameters 202 of the second neural network are taken out from the first storage area 20, inference can be performed. The parameters of the virtual node can be stored in a virtual parameter table. Figure 2B For example, the virtual parameter table is shown in Table 1 below:

[0031] Number of layers Position of dummy parameters First floor (3) Second floor (2,4) Third floor (1,3) Fourth floor (2)

[0032] The third node representing the first layer (i.e., input layer 102) is virtual node 16, the second and fourth nodes of the second layer (i.e., hidden layer 104) are virtual nodes 16, the first and third nodes of the third layer (i.e., hidden layer 104) are virtual nodes 16, and the second node of the fourth layer (i.e., output layer 106) is virtual node 16.

[0033] In particular, the first storage area 20 and the second storage area 22 are respectively set in different databases, but may be in the same computer. Therefore, even if someone obtains the model parameters of the second neural network 10, without the parameters of the virtual nodes for comparison, it is unknown which nodes in the second neural network 10 are virtual nodes. In this way, if the interconnection of the virtual nodes cannot be deleted or the weight of the interconnection cannot be set to 0, it is still impossible to use the second neural network 10 for inference.

[0034] Through the method of the present invention, it is assumed that Company A uses a deep learning neural network to produce a program, and uploads the program to the cloud platform of Company B, and provides the program to Company B for use. However, in order to protect the deep learning neural network in the program from being used solely by Company B, Company A can store the parameters of the virtual node on Company A's own platform. When Company B wants to execute the program, it must first connect to Company A's platform to obtain the parameters of the virtual model, and then obtain the model parameters from its own cloud platform before using the program to execute the deep learning neural network for inference, but Company B will not know the parameters of the virtual model. Company A can also store the parameters of the virtual node on a third-party platform.

[0035] The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of the present invention. Therefore, all equivalent changes or modifications based on the characteristics and spirit of the present invention should be included in the scope of the present invention.

Claims

1. A deep learning neural network storage and inference method, characterized in that: The following steps are involved: Setting a plurality of virtual nodes in a first neural network to form a second neural network; Storing the model parameters of the second neural network in a first storage area, and storing the parameters of the plurality of virtual nodes in a second storage area; as well as During inference, the model parameters of the second neural network and the parameters of the plurality of virtual nodes are taken out from the first storage area and the second storage area respectively, and the interconnections of the plurality of virtual nodes in the second neural network are deleted or set to zero according to the parameters of the plurality of virtual nodes, and then inference is performed; The method for setting the multiple virtual nodes includes: Find a plurality of empty nodes or nodes with extremely low usage rates from the plurality of nodes of the first neural network, and set them as the plurality of virtual nodes; Setting a plurality of weights on interconnections of the plurality of virtual nodes to zero to form the second neural network; and After the second neural network is trained, random values ​​are assigned to the weights on the interconnections of the plurality of virtual nodes.

2. The deep learning neural network storage and inference method according to claim 1, characterized in that: The first storage area and the second storage area are set in different databases.

3. The deep learning neural network storage and inference method according to claim 1, characterized in that: The first storage area and the second storage area are connected to a host for inference.

4. The deep learning neural network storage and inference method according to claim 1, characterized in that: The first storage area or the second storage area is set in a host, and the host is used for inference.