Key Generation Method Based On Deep Learning Generative Adversarial Network

20210385081 · 2021-12-09

Assignee

Inventors

Cpc classification

International classification

Abstract

A key generation method based on a deep learning generative adversarial network includes: preparing a training set image; construction of a key generation network: constructing the key generation network according to a generator network and a discriminator network, and inputting the training set image to the key generation network; and training of the key generation network: training the key generation network by a deep learning method to generate a key.

Claims

1. A key generation method based on a deep learning generative adversarial network, comprising the following steps: S1: preparing a training set image; S2: construction of a key generation network: constructing the key generation network according to a generator network and a discriminator network, and inputting the training set image to the key generation network; and S3: training of the key generation network: training the key generation network by a deep learning method to generate a key.

2. The key generation method of claim 1, wherein the generator network comprises a down-sampling layer unit, a residual module layer unit, a transposed convolutional layer unit and a convolutional layer, wherein the down-sampling layer unit, the residual module layer unit, the transposed convolutional layer unit and the convolutional layer are sequentially connected; the down-sampling layer unit comprises three down-sampling layers with 64 7×7 convolution kernels, 128 3×3 convolution kernels and 256 3×3 convolution kernels, respectively, and convolution strides of 1, 2 and 2, respectively; the residual module layer unit comprises six residual module layers with identical structures; the transposed convolutional layer unit comprises two transposed convolutional layers with 128 3×3 convolution kernels and 64 3×3 convolution kernels, respectively, and transposed convolution strides of 2 and 2, respectively; and the convolutional layer comprises 3 7×7 convolution kernels, and the convolutional layer has a convolution stride of 1.

3. The key generation method of claim 2, wherein a loss function of the generator network is expressed as:
L.sub.G=min.sub.G(E.sub.x˜pdata(x) log(1−D(G(x)); wherein, L.sub.G denotes the loss function of the generator network, G denotes the generator network, D denotes the discriminator network, G(g) denotes an output result of the generator network, x denotes an input training set image of a source domain, and E.sub.x˜pdata(x) denotes a distribution of a source domain training set.

4. The key generation method of claim 1, wherein the discriminator network comprises a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer and a fifth convolutional layer; the first convolutional layer, the second convolutional layer, the third convolutional layer and the fourth convolutional layer comprise 64, 128, 256 and 512 4×4 convolution kernels, respectively, and each of the first convolutional layer, the second convolutional layer, the third convolutional layer and the fourth convolutional layer has a convolution stride of 2; and the fifth convolutional layer comprises 1 4×4 convolution kernel, and the fifth convolutional layer has a convolution stride of 1.

5. The key generation method based on the deep learning generative adversarial network of claim 4, wherein a loss function of the discriminator network is expressed as: L D = max D ( E y - p d a t a ( y ) log ( D ( y ) ) + E x - p d a t a ( x ) log ( 1 - D ( G ( x ) ) ) ) ; wherein, L.sub.D denotes the loss function of the discriminator network, E.sub.y˜pdata(y) denotes a distribution of a target domain training set, D(y) denotes a classification result of the discriminator network with respect to y, y denotes an input training set image of a target domain, D denotes the discriminator network, G(g) denotes an output result of the generator network, x denotes an input training set image of a source domain, and E.sub.x˜pdata(x) denotes a distribution of a source domain training set.

6. The key generation method of claim 1, wherein a loss function of the key generation network in step S2 is expressed as:
L=L.sub.G+L.sub.D; wherein L denotes the loss function of the key generation network, L.sub.D denotes a loss function of the discriminator network, and L.sub.G denotes a loss function of the generator network.

7. The key generation method of claim 1, wherein step S3 comprises the following steps: S301: randomly initializing a parameter of each convolutional layer in the key generation network; and S302: updating the parameter of the key generation network by a gradient descent method to obtain an updated key generation network, and generating the key according to the updated key generation network.

8. The key generation method of claim 7, wherein an expression of randomly initializing the parameter W.sub.n of the each convolutional layer of the key generation network in step S301 is as follows:
W.sub.n=random[w.sub.n,1,w.sub.n,2, . . . ,w.sub.n,i]; wherein w.sub.n,i denotes an i.sup.th parameter of an n.sup.th convolutional layer of the key generation network.

9. The key generation method of claim 7, wherein an expression of updating the parameter of the key generation network by the gradient descent method in step S302 is as follows:
W.sub.n,i.sup.j=W.sub.n,i.sup.j-1−αg∇J(W.sub.n.sup.j); wherein W.sub.n,i.sup.j denotes a value of a parameter w.sub.n,i in a j.sup.th training epoch, α denotes a learning rate, ∇J(W.sub.n.sup.j) denotes a gradient loss backpropagated to an n.sup.th convolutional layer in the j.sup.th training epoch, W.sub.n.sup.j denotes all parameters of the n.sup.th convolutional layer in the j.sup.th training epoch, and J denotes a total number of training epochs.

10. The key generation method of claim 7, wherein an expression of generating the key in step S302 is as follows:
KEY=G(W;x); wherein, G(g) denotes an output result of the generator network, W contains parameters of the key generation network, x denotes an input training set image of a source domain, and KEY denotes the key generated by the generator network.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

[0044] FIG. 1 is a flow chart of the method of the present invention.

[0045] FIG. 2 is a schematic diagram of the overall architecture of a key generation network of the present invention.

[0046] FIG. 3 is a structural diagram of a generator of the key generation network of the present invention.

[0047] FIG. 4 is a structural diagram of a discriminator of the key generation network of the present invention.

DETAILED DESCRIPTION OF THE EMBODIMENTS

[0048] Exemplary embodiments of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the exemplary embodiments. For those ordinarily skilled in the art, as long as various changes are within the spirit and scope of the present invention defined and determined by the appended claims, these changes are obvious, and all inventions using the concept of the present invention shall fall within the scope of the present invention.

[0049] Deep learning algorithms have now been widely used in the security field, but there is a lack of research on using deep learning algorithms to implement key generation. In the present invention, the generative adversarial network, as the current research focus in deep learning, is employed to implement key generation. Drawing upon the idea of image-to-image translation in deep learning in conjunction with the key generation method, the present invention proposes a key generation network based on a deep learning generative adversarial network. The key generation network has two domains: a source domain and a target domain. The source domain denotes an input image, and the input image is used as “an initial seed” to generate a private key. The target domain denotes an encryption performance to be achieved and guides a learning network to implement a private key generation process. During the training of the key generation network, a generator transmits the input image from the source domain to the target domain, the output of the generator is regarded as a key, and a discriminator is used to discriminate between the key generated by the generator and data from the target domain. The key generated by means of the present invention has characteristics such as a larger key space, pseudo-randomness, one-time pad and high sensitivity. The present invention is known as one of the earliest studies that attempted to adopt deep learning methods in the field of key generation. Moreover, plaintext medical images encrypted using the generated key have higher security. Specifically, in the present invention, the generative adversarial network is used as a key generation system. The source domain of the network can be any image. The target domain of the network is the desired key type, called the target domain herein, such as a chaotic image. The trained key generation network is capable of outputting an image that has learned the mapping from the source domain to the target domain and has the characteristics of the desired key type, that is, the key. As shown in FIG. 1, a key generation method based on a deep learning generative adversarial network includes the following steps:

[0050] S1: a training set image is prepared.

[0051] In the present embodiment, source data is acquired from 138 chest X-ray images selected from the Montgomery County X-ray dataset, and target key domain data is 138 chaotic images. The resolution of each of the training images is set as 256×256.

[0052] S2: construction of a key generation network: the key generation network is constructed according to a generator network and a discriminator network, and the training set image is input to the key generation network;

[0053] In the present embodiment, the key generation network is composed of the generator G and the discriminator D, as shown in FIG. 2. The generator network G starts to generate a key from the source domain data and transmits the key to the discriminator. The discriminator network D is used to discriminate whether the data is from the real target domain or is fake data generated by the generator. The source data is any type of image. The target domain is a key type desired to be generated, such as a chaotic image. The trained network learns the mapping from the source domain image to the chaotic image to generate a key containing target domain attributes. In the present invention, the key generation network is trained by using a loss function, and the total loss function L is expressed as:


L=L.sub.G+L.sub.D;

[0054] wherein L denotes the loss function of the key generation network, L.sub.D denotes the loss function of the discriminator network, and L.sub.G denotes the loss function of the generator network.

[0055] The generator network G is mainly used to convert the input image from the source domain dataset into the style of the target domain image, and the output result is a key containing the target domain attributes, as shown in FIG. 3. The generator network G includes three down-sampling layers, six residual module layers, two transposed convolutional layers and one ordinary convolutional layer. The input image first passes through the three down-sampling layers with 64 7×7 convolution kernels, 128 3×3 convolution kernels and 256 3×3 convolution kernels, respectively, and convolution strides of 1, 2 and 2, respectively. This stage aims to extract image features to prepare for subsequent conversion. Then, the six identical residual modules are used to construct the content and diverse features. Subsequently, feature vectors of the image pass through the two transposed convolutional layers with 128 3×3 convolution kernels and 64 3×3 convolution kernels, respectively, and transposed convolution strides of 2 and 2, respectively, so as to restore to low-level features. Finally, the low-level features are converted into an image by the ordinary convolutional layer with 3 7×7 convolution kernels, and a convolution stride of 1. Each convolutional layer is followed by instance regularization to replace batch regularization so as to normalize a single image, thereby improving the quality of the generated image while accelerating model convergence and preventing gradient explosion. The loss function of the generator network G is:


L.sub.G=min.sub.G(E.sub.x˜pdata(x) log(1−D(G(x));

[0056] wherein, L.sub.G denotes the loss function of the generator network, G denotes the generator network, D denotes the discriminator network, G(g) denotes the output result of the generator network, x denotes the input training set image of the source domain, and E.sub.x˜pdata(x) denotes the distribution of the source domain training set. The loss function can be understood as that the key generated by the generator maximally “misleads” the output result of the discriminator, fooling the discriminator to misjudge that the key generated by the generator comes from the target domain.

[0057] The discriminator network D is mainly used to determine whether the output image of the generator network belongs to the target domain. As shown in FIG. 4, the discriminator network is a fully convolutional network composed of five convolutional layers. The image passes through 4 convolutional layers with 64, 128, 256 and 512 4×4 convolution kernels, respectively, and a convolution stride of 2 to extract features, and then passes through the last convolutional layer with 1 4×4 convolution kernel, and a convolution stride of 1 to generate a one-dimensional output to implement a judgment function. Excluding the last layer, the normalization is implemented by instance regularization. The loss function of the discriminator network D is expressed as:

[00002] L D = max D ( E y - p d a t a ( y ) log ( D ( y ) ) + E x - p d a t a ( x ) log ( 1 - D ( G ( x ) ) ) ) ;

[0058] wherein, L.sub.D denotes the loss function of the discriminator network, E.sub.y˜pdata(y) denotes the distribution of the target domain training set, D(y) denotes the classification result of the discriminator network with respect to y, y denotes the input training set image of the target domain, D denotes the discriminator network, G(g) denotes the output result of the generator network, and x denotes the input training set image of the source domain.

[0059] The generative adversarial network combines the loss function of the discriminator network and the loss function of the generator network to establish an adversarial relationship. When the two networks achieve a balanced state, the probability that the discriminator network D correctly classifies the key generated by the generator network G and the chaotic image should be close to 50%. Namely, the key generated by means of the present invention is very similar to the chaotic image, so that the discriminator network D cannot discriminate between them.

[0060] S3: training of the key generation network: the key generation network is trained by a deep learning method to generate the key.

[0061] In the present embodiment, since the key generation network is a deep learning-based method, key generation in the present invention is a process of training the deep learning network. Firstly, the parameter of each convolutional layer of the key generation network is randomly initialized:


W.sub.n=random[w.sub.n,1,w.sub.n,2, . . . ,w.sub.n,i];

[0062] wherein w denotes an i.sup.th parameter of an n.sup.th convolutional layer of the key generation network. Thus, all the parameters W of the key generation network actually consist of all the parameters of each convolutional layer, which is defined as follows:


W=consist[W.sub.1,W.sub.2, . . . ,W.sub.n]

[0063] Since the key generation network of the present invention is composed of the key generator and the key discriminator, wherein the key generator is used to generate a key, and the key generation can be expressed as:


KEY=G(W;x);

[0064] wherein, G(g) denotes a convolutional neural network of the key generator, W contains all the parameters of the key generation network, x denotes the input training set image, and KEY denotes the key generated by the key generator.

[0065] The goal of training is to make the key generated by the key generation network close to the distribution of the target domain. At the beginning of the training, the training set image is converted into feature vectors to pass through the network. This is a process of forward propagation, and this process will generate a key. In the present invention, the total loss L is calculated by using the generated key to measure the difference between the currently generated key and the target domain so as to guide the training of the network. In addition to the forward propagation, a backpropagation algorithm is also used to backpropagate the total loss to each convolutional layer, which is actually a gradient descent method. The gradient descent can be expressed as:


W.sub.n,i.sup.j=W.sub.n,i.sup.j-1−αg∇J(W.sub.n.sup.j);

[0066] wherein W.sub.n,i.sup.j denotes the value of the parameter w.sub.n,i in the j.sup.th training epoch, α denotes a learning rate, and ∇J(W.sub.n.sup.j) denotes the gradient loss backpropagated to the n.sup.th convolutional layer in the j.sup.th training epoch.

[0067] The gradient descent further updates and improves the parameters of the network, namely continuously updates and generates the key to make the key closer to the target domain. After the loss stabilizes, the key that conforms to and is close to the distribution of the target domain will be generated.

[0068] In the present embodiment, the key generation network provides the key that needs to be used by the encryption and decryption algorithms. In terms of the selection of the encryption and decryption algorithms, bitwise XOR is selected herein as the encryption and decryption methods in the experiment of the present invention. The XOR encryption and decryption algorithm is simple and easy to implement, and has a fast encryption and decryption speed. Moreover, it is proved that even with the simplest XOR encryption, the key generated by means of the present invention can provide the plaintext with higher security.