An image general encryption method based on domain gap

By introducing a domain gap-based encryption algorithm module and discriminator into the image encryption method, the problem of poor applicability of image encryption and decryption between multiple fields is solved, and high-quality image encryption and decryption effects are achieved.

CN117793266BActive Publication Date: 2025-06-17TIANJIN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311668169.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-07
Publication Date
2025-06-17
Estimated Expiration
2043-12-07

AI Technical Summary

Technical Problem

The prior art has poor applicability when encrypting and decrypting images between multiple fields, resulting in a degradation of the quality of the encryption results or the inability to meet the decryption requirements of the image, especially the low applicability of the image encryption method due to multi-domain distribution drift and complexity differences.

Method used

Using a universal image encryption method based on domain gap, a multi-domain image is input into an encryption algorithm module composed of three downsampling blocks and three upsampling blocks, combining the self-attention mechanism and latent code constraints, an encrypted image is generated, and the reliability and decryption effect of the encrypted image are continuously optimized through the GAN discriminator and the domain tag discriminator.

Benefits of technology

It effectively alleviates the domain gap problem caused by multi-domain input, improves the applicability and quality of image encryption methods, and ensures the reliability of encrypted images and the accuracy of decrypted images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117793266B_ABST
    Figure CN117793266B_ABST
Patent Text Reader

Abstract

The present invention relates to a general image encryption method based on domain gap, which can solve the problems that the encryption and decryption of images between multiple domains have poor applicability, resulting in a decline in the quality of the encryption result or inability to meet the decryption requirements of the images. The method includes the following steps: First, input the multi-domain image into the encryption algorithm module, and obtain the encrypted image by increasing the receptive field through the self-attention mechanism and constraining the domain gap of the latent code. Then, use the GAN discriminator to judge the authenticity of the encrypted image and predict the label of the encrypted image for the obtained encrypted image and the multi-domain input image. Finally, input the encrypted image with the label into the decryption algorithm module to obtain the decrypted image, solving the problems of low applicability caused by the multi-domain distribution drift phenomenon and the large complexity difference between multiple domains.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to image encryption, and particularly to a general image encryption method based on domain gap. Background Art

[0002] With the popularization of digital image technology, more and more individuals and institutions upload their image information to the network. These image information often involves personal privacy, such as personal photos, identity cards, etc. Digital image encryption technology can effectively protect these privacy information from being illegally obtained and utilized. These technologies have two significant characteristics: image confidentiality and image integrity. Image confidentiality refers to ensuring that the core information is fully hidden during the encryption process of the encrypted image to prevent leakage during transmission. Image integrity emphasizes the importance of accurately maintaining the information consistency (including structure, details, color, etc.) between the image restored after decryption using the decryption key and the original image. The image encryption process usually includes two steps: image encryption and image decryption. Image decryption requires a unique key to restore the image, and other keys cannot complete this process.

[0003] With the development of artificial intelligence, some researchers have proposed several deep learning-based encryption methods by utilizing the randomness and inherent complexity of deep learning, including methods based on chaotic sequences, permutation-based color image encryption methods, optical color image encryption methods, DNA-based color image encryption methods, etc. However, these methods have poor applicability when encrypting and decrypting images between multiple domains, resulting in a decline in the quality of the encryption results or an inability to meet the decryption requirements of the images. Summary of the Invention

[0004] In view of the deficiencies of the prior art, the present invention proposes a general image encryption method based on domain gap to solve the problem of low applicability of image encryption methods caused by the multi-domain distribution drift phenomenon and the large complexity difference between multiple domains, including the following steps:

[0005] First step: First, input the multi-domain image into an encryption algorithm module composed of three downsampling blocks and three upsampling blocks, and obtain the encrypted image by increasing the receptive field through the self-attention mechanism and constraining the domain gap of the latent code.

[0006] Second step: Use the GAN discriminator to determine the authenticity of the generated encrypted image by comparing the encrypted image obtained after encryption by the encryption algorithm module with the multi-domain input image, and continuously enhance the reliability of the generated encrypted image and predict the label of the encrypted image through the adversarial loss.

[0007] Step 3: Input the encrypted image with tags into the decryption algorithm module composed of three downsampling blocks and three upsampling blocks to obtain the decrypted image, and use the domain label discriminator to judge the authenticity of the tags. Use the identity loss and cycle consistency loss to make the tags in the encrypted image domain as blurred as possible, and at the same time, distinguish the tags in the decrypted image domain as much as possible. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 is the structural flowchart of the present invention; DETAILED DESCRIPTION OF THE INVENTION

[0009] To make the technical solutions of the present invention clearer, the present invention will be further described below with reference to the accompanying drawings. As shown in the Figure 1 accompanying drawings, a general image encryption method based on domain gap includes the following steps:

[0010] For the convenience of description, it is hereby declared the symbols used in the present invention. A general image encryption method based on domain gap proposed by the present invention is a multi-domain input algorithm. Sub-domains D1, D2, and D3 respectively represent different domains, and label1, label2, and label3 represent different domain labels. After encrypting the input image using the general image encryption method based on domain gap proposed in this paper, the obtained image has a predicted label, marked as labeli. When i = 0, label0 represents the domain of the encrypted image. When the value of i is 1, 2, or 3, the label represents a specific sub-domain in the image.

[0011] Step 1: First, input the multi-domain image into the encryption algorithm module. The encryption algorithm consists of an autoencoder with skip connections, and the skip encoder consists of three downsampling blocks and three upsampling blocks. Each downsampling block consists of a convolutional layer, a normalization layer, an activation layer, and a self-attention layer. At the same time, each upsampling block consists of bilinear upsampling, a normalization layer, an activation layer, and a self-attention layer. Skip connections are used between the downsampling block and the corresponding upsampling block to achieve weight sharing between the encoder and the decoder.

[0012] The self-attention mechanism is to solve the problem that the convolutional structure itself cannot handle long-range dependencies, enabling the network to process with a larger field of view. The process of the self-attention mechanism is as follows:

[0013] Step 1: Use two 1×1 convolutions to perform linear transformation and channel compression on the feature map. The two obtained tensors are reshaped, transposed, and multiplied in matrix form, and the attention map is obtained through softmax, as shown in Equation (1)

[0014]

[0015] where f = conv 1×1 (Fin ),g = conv 1×1 (F in ). and g reshape are feature maps, conv 1×1 represents a 1×1 convolution, F in represents the input feature, and attention represents the attention map.

[0016] Step 2: Without changing the number of channels of the feature map, perform a linear transformation on the original feature map using a 1×1 convolution, and then multiply it by the attention map to obtain the self-attention feature map, as shown in Equation (2)

[0017] F self = h × attention (2)

[0018] where h = conv 1×1 (F in ), and F self is the self-attention feature map.

[0019] Step 3: Perform a weighted sum of the self-attention feature map and the original feature map to obtain the final output, as shown in Equation (3)

[0020] output = μ self × μ + F in × (1 - μ) (3)

[0021] where μ is a learnable parameter.

[0022] In the encryption algorithm module, to alleviate the domain gap caused by multi-domain input, the present invention proposes a latent code constraint mechanism. The latent code is the output of the encoder in the decryption algorithm. Latent codes are obtained from different domains and are represented by latentD1, latentD2, and latentD3 (for ease of representation, it is assumed that the multi-domain input is three domains). The present invention introduces a distribution metric called the maximum mean discrepancy (MMD), which is based on the theory of reproducing kernel Hilbert space (RKHS).

[0023] Given two distributions (D1 and D2), where D1 = {s1, s2,..., sn1} and D2 = {t1, t2,..., tn2} are sets of random variables representing distributions D1 and D2, according to the definition of MMD, the empirical estimate of the distance between the two distributions is shown in Equation (4):

[0024]

[0025] H is the reproducing kernel Hilbert space. φ is the kernel mapping function, which is a non-linear transformation.

[0026] Using kernel technology, that is The MMD between the two domains in the above formula is as shown in formula (5):

[0027]

[0028] where is defined by the kernel function φ. L is a positive semi - definite matrix, as shown in formula (6)

[0029]

[0030] During the network training process, the above calculation process is regarded as a loss function. Through the optimizer, the network will alleviate the domain gap.

[0031] Step 2: Use the GAN discriminator to judge the authenticity of the encrypted image obtained after being encrypted by the encryption algorithm module and the multi - domain input image. Continuously enhance the reliability of the generated encrypted image through the adversarial loss and predict the label of the encrypted image.

[0032] To enhance the realism of the generated image, the present invention uses adversarial loss. Once the adversarial loss converges to the optimal state, the GAN discriminator can no longer distinguish between the image generated by the generator or the image obtained from the dataset, as shown in formula (7):

[0033]

[0034] Step 3: Input the encrypted image with a label into the decryption algorithm module composed of three down - sampling blocks and three up - sampling blocks to obtain the decrypted image, and use the domain label discriminator to judge the authenticity of the label. Use the identity loss and the cycle - consistency loss to make the label of the encrypted image domain as blurred as possible, and at the same time, also distinguish the label of the decrypted image domain as much as possible.

[0035] To further improve the influence of the domain gap, the present invention designs a domain label discriminator. The structure of the domain label discriminator is similar to that of the GAN discriminator, and its task is to make the label of the encrypted image domain as blurred as possible, and at the same time, also distinguish the label of the decrypted image domain as much as possible.

[0036] First, in the present invention, a domain label feature extractor is constructed. Using the trained GAN generator, samples similar to real data are generated by learning the data distribution, which can capture the domain features in the data and provide useful information for the subsequent domain classifier and label discriminator.

[0037] Next, the present invention introduces ResNet - 18 as the domain classifier. ResNet - 18 is a classic convolutional neural network model with strong classification ability, which is used to predict the category to which the data belongs and provide the category information of the input data for the subsequent label discriminator.

[0038] Furthermore, the present invention constructs a label discriminator module, whose goal is to learn to distinguish feature representations in different domains based on the features and class information of the input data. The class information is connected to the output of the domain label feature extractor to form a conditional input, so that the label discriminator performs conditional discrimination according to the features and class information of the input data.

[0039] Meanwhile, in order to enhance the capabilities of the encryption and decryption algorithms, the present invention incorporates the identity loss into the network training process, that is, when encrypting image domain samples are input into the encryption algorithm, the output of the encryption algorithm is still samples in the encrypted image domain; when the original image is input into the decryption algorithm, the output of the decryption algorithm is the same as the input, as shown in Equation (8):

[0040]

[0041] where L1 is the L1 loss, G en and G de are the encryption algorithm and the decryption algorithm respectively, I input is a sample from the multi-domain input, and I en is a sample from the encrypted domain.

[0042] Meanwhile, in order to ensure the structural consistency between the encrypted image and the decrypted image, the cyclic consistency loss is applied to the algorithm proposed in this paper, as shown in Equation (9):

[0043]

Claims

1. A general image encryption method based on domain gap, characterized in that, The method includes: Step 1: Input the multi-domain image into the encryption algorithm module. Adopt the latent code constraint mechanism to obtain the latent codes latentD1, latentD2, and latentD3 from three domains. Adopt the distribution metric standard. Given two distributions D1 and D2, where and represent the sets of random variables of distributions D1 and D2. The maximum mean difference MMD between the two domains D1 and D2 is shown in Equation (1): where k(s i , s j ), k(t i , t j ), and k(s i , t j ) are kernel functions used to calculate the similarity between two sample points in different distributions; K s,s , K s,t , K t,s , and K t,t are matrices representing the kernel similarities between all pairs of sample points in the corresponding distributions; L is a positive semi - definite matrix as shown in Equation (2): The second step: Use a GAN discriminator to judge the authenticity of the encrypted image obtained after being encrypted by the encryption algorithm module and the multi-domain input image. As shown in Equation (3), continuously enhance the reliability of the generated encrypted image through adversarial loss and predict the label of the encrypted image. where p data (x) represents the probability distribution of real data, and p G (x) represents the probability distribution of generated data; Step 3: Input the encrypted image with tags into the decryption algorithm module composed of three downsampling blocks and three upsampling blocks to obtain the decrypted image. Construct a domain label feature extractor and use the trained GAN generator to extract domain label features; construct a domain classifier to predict the category of the data, and use ResNet-18 as the domain classifier; add a label discriminator, connect the category information with the output of the feature extractor, input the connected features into the label discriminator, and learn to distinguish the feature representations of different domains according to the features and category information of the input data; during the training process, optimize the domain label feature extractor and the label discriminator simultaneously, so as to judge whether the labels in the encrypted image domain are real or forged; use the identity loss and the cycle consistency loss By optimizing and blur the labels in the encrypted image domain and distinguish the labels in the decrypted image domain, as shown in Equations (4) and (5): Among them, is the L1 loss, G en and G de are the encryption algorithm and the decryption algorithm, I input is the sample from the multi-domain input, I en is the sample from the encrypted domain, label i′ is the predicted label of the encrypted image, label i is the predicted label of the decrypted image.

Citation Information

Patent Citations

  • Training target detection system with generated images

    CN115600663A

  • Latent code for unsupervised domain adaptation

    EP3767536A1