Image-aware hashing method and system based on improved bidirectional generative adversarial network
Through the improved two-way generative adversarial network, it automatically learns image features, generates robust and accurate hash codes, solves the problem of feature extraction and robustness balance in the existing technology, and realizes a more efficient image hash algorithm.
Patent Information
- Application Number
- CN202210268881.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-18
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2042-03-18
AI Technical Summary
Existing perceptual image hashing algorithms are difficult to achieve a good balance between feature extraction and robustness and sensitivity, and rely on manual design and annotation, which limits their flexibility and accuracy.
Using an improved bidirectional generative adversarial network, through joint training of the encoder, generator and discriminator, it automatically learns the robust features of the image and generates a hash code with both robustness and recognition accuracy, avoiding manual feature extraction and Mark dependencies.
It shows stronger robustness and recognition ability on large test databases, can effectively resist various attacks, does not require pixel-level reconstruction, retains potential semantic information, and achieves the balance between robustness and sensitivity of image hashing. Well balanced.
Smart Images

Figure CN114612988B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image-aware hashing technology, and in particular to an image-aware hashing method and system based on an improved bidirectional generative adversarial network. Background Art
[0002] The statements in this section merely mention background art related to the present invention and do not necessarily constitute prior art.
[0003] With the rapid development of smart mobile terminals and digital image processing technology, the cost of obtaining high-precision images continues to decline, and the number of images on the Internet is growing exponentially. At the same time, the emergence of a large number of image editing software has made image modification simple and easy. Seeing is not necessarily believing, and image authenticity verification has become a research hotspot in the field of digital images.
[0004] In recent years, researchers have proposed a variety of algorithms based on digital watermarks for image copyright authentication. However, watermark embedding inevitably destroys the intrinsic structure of the image and affects the visual effect of the image. In recent years, perceptual image hashing, as an emerging multimedia security technology, has attracted the attention of many scholars. The concept of perceptual image hashing comes from cryptographic hashing, such as MD5 and SHA-1, which can convert input information into a fixed-length sequence. It is very sensitive to changes in image content, so traditional cryptographic hashing is only suitable for bitstream-level authentication. For images, after being modified by specific operations (such as cropping, rotation, etc.), although the content perception has not changed much, its hash function value will change significantly, making it difficult to achieve copyright tracking and source protection of the image. Perceptual image hashing is based on the visual content of the image to generate hash sequences. It should have strong robustness. Even if the original image is slightly modified, it can still generate a similar hash sequence to resist attacks on the original image tampering. On the other hand, the perceptual hashing algorithm is also highly vulnerable. For images from different sources, even if no modification is made, it can generate hash functions that are very different from the original image, thereby achieving source authentication of the original image and monitoring of counterfeit image attacks. Since robustness and vulnerability are mutually constrained, an ideal and high-performance perceptual hashing algorithm should achieve a good balance between the two. The important difference between perceptual image hashing and image retrieval is that the latter focuses on querying images that meet the requirements on large-scale data sets; while the former focuses on studying the consistency verification of image content and distinguishing different images.
[0005] Image-aware hashing was first proposed by Schneider and Chang at the International Conference on Image Processing (ICIP) in 1996. In order to obtain spatial information in the image, this work divides the image into several sub-blocks. The mean of the intensity histogram of each sub-block is extracted, and the means corresponding to all sub-blocks are quantized as the hash value of the image. Since then, a large number of studies on image-aware hashing have emerged. The perceptual image hashing algorithm generally consists of three steps: image normalization; extraction of key feature vectors; quantization of feature vectors. The most challenging part is feature extraction. The classic feature extraction methods can be roughly divided into frequency domain transformation, matrix compression, and manifold learning.
[0006] Frequency domain transform methods include discrete cosine transform (DCT), discrete wavelet transform (DWT) and discrete Fourier transform (DFT). In the early days, Venkatesan et al. constructed a hash function by quantizing the mean and variance of three-level DWT coefficients. The algorithm is robust to common content-preserving operations, but can only cope with low-level attacks. Lin et al. designed an image hash algorithm using the DCT coefficients at the same position between different image sub-blocks. The method is highly robust to any degree of JPEG compression and multiple rounds of JPEG compression. Tang et al. constructed a feature matrix by dividing the image into multiple sub-blocks, extracting the main eigenvalues of the first row / column of the DCT coefficients of each sub-block, and then quantizing the column distance to perform matrix compression to obtain a compact hash code. Huang et al. combined the gray-level co-occurrence matrix with the DCT coefficients to generate a hash sequence, achieving a good balance between robustness and uniqueness. Subsequently, Vadlamudi et al. proposed a robust hash method that combines feature points with DWT. The method first uses the scale-invariant feature transform (SIFT) to calculate the invariant feature points from the L component of the LAB color image, then uses multiple different feature points to extract image features from the L component, and finally applies DWT to the extracted content and normalizes the result into a binary hash code. The algorithm can effectively resist geometric distortion of the image and also has good performance in copy detection. Swaminathan et al. proposed an image hashing method based on Fourier transform. The method first performs Fourier transform on the normalized image and converts it into polar coordinate representation, then uses a randomization method to obtain statistical features, and uses these statistical features to design a hash code. Recently, Qin et al. extracted robust frequency features from the secondary image after DFT, and then selected sampling points from the frequency component as the salient features of the image through non-uniform sampling. This scheme performs well in resisting rotation attacks. In general, most perceptual image hashing techniques based on frequency domain changes have good robustness and excellent performance in copy detection.
[0007] On the other hand, in recent years, there have been many advances in hash code generation schemes based on matrix theory. Common methods are singular value decomposition (SVD), non-negative matrix factorization (NMF) and QR decomposition, etc., which extract eigenvalues or eigenvectors to generate hash codes. Kozat et al. first proposed a scheme to generate hash codes using singular value decomposition (SVD), and used SVD singular values to ensure the robustness of the hash algorithm. The proposal of this scheme provided guidance for subsequent image hashing schemes based on matrix compression. Tang et al. used annular segmentation technology to construct a rotationally invariant secondary image, and applied NMF to the secondary image to obtain the NMF coefficient to generate a hash code, which enables the algorithm to resist large-angle rotation attacks and has good uniqueness. Hosny et al. generated efficient hash codes by extracting the Gauss-Hermite moments and their invariants of grayscale images, which performed well in terms of security and noise attacks. Ouyang et al. used a combination of quaternion Zernike moments and SIFT to extract hash codes. Among them, the global features calculated by the Zernike moments ensure the recognition accuracy of the model, and the SIFT model ensures sensitivity to content operations.
[0008] In addition, the manifold learning method can effectively eliminate the redundant information of high-dimensional features, and then accurately characterize the essence of data, so it can be closely combined with image hashing. The commonly used techniques of manifold learning are: local linear embedding (LLE), principal component analysis (PCA), multidimensional scaling (MDS), linear discriminant analysis (LDA), or locality preserving projection (LPP). Tang et al. applied LLE dimensionality reduction operation to the image matrix representation composed of random sub-blocks, and took the variance of the embedded vector as the hash code. The algorithm has good robustness to operations such as Gaussian filtering and JPEG compression. Subsequently, a method combining DCT and LLE was proposed on this basis to further improve the performance. Zhu et al. proposed a method to generate hash codes in the PCA domain. First, the data set is clustered, and then the probability of each data point is obtained to generate a local domain. The principal component analysis is performed and then the hash code is quantized. However, the algorithm is sensitive to changes in image content. Tang et al. used logarithmic polar coordinates and DFT to extract feature matrices from normalized images, and then used MDS transform to quantize and extract short hash codes. This scheme can resist large-angle rotation attacks, but the uniqueness performance is poor. Zhao et al. used a combination of LDA and LPP to extract hash codes. This scheme retains both local and global information of the original image, making it work well on multiple datasets. In general, image hashing algorithms based on manifold learning generally have better classification performance.
[0009] In addition to the above schemes, researchers have also proposed some other types of perceptual hashing algorithms. Tang et al. first calculated the color vector angle matrix of the image, then extracted the histogram of the inscribed circle of the feature matrix, and finally used the DCT compressed histogram to generate the hash code. This algorithm can resist large-angle rotation attacks, but the time complexity is high. Tang et al. divided the normalized image into different rings, extracted four statistical feature vectors of mean, variance, skewness, and kurtosis from the rings, and finally used the invariant distance between the feature vectors to form a compact image hash. Since the statistics are independent of the position information of the image pixels, this scheme is highly robust to geometric transformation attacks. Lefèbvre et al. designed image hashing using Rodon transform, which can resist geometric transformation attacks, but has poor vulnerability. Lei et al. performed Rodon transform on the input image, then calculated the invariant moment features in the projection transform domain, and finally applied DFT to the moment features to generate hash codes. This algorithm is robust to typical digital attacks such as scaling and filtering.
[0010] The above-mentioned image-aware hashing methods all require manual design and extraction of image features, which makes it difficult to fully describe the perceived image content features. The performance of image-aware hashing algorithms is largely restricted by the image feature information used. In recent years, with the development of graphics card computing power and deep learning theory, many studies have begun to use deep learning network models to implement image retrieval hashing algorithms, find image-aware hashing features through deep learning algorithms, and simultaneously improve the robustness and sensitivity of perceptual hashing algorithms. Li et al. proposed an end-to-end technology that can simultaneously optimize feature extraction and hash code generation, in which the data in the training set are labeled with pairs to indicate the direction of model learning. Experiments show that the scheme achieves a good balance between robustness and vulnerability. Deng et al. proposed a cross-modal retrieval scheme based on deep learning, in which triple labels are used to describe the relative relationship between the three modalities as supervision to extract more representative semantic correlations between different modalities and generate hash codes. Liu et al. proposed a copy detection model based on convolutional neural network (CNN), in which the original image and 43 attack copies are labeled with the same label as a group, and the group is used as input into the V3 model to extract potential features to train the copy detection model, which ultimately enables the model to detect unauthorized images. The above three algorithms require manual labeling. Since labeling often depends on human knowledge and attention, it limits the accuracy of labeling and is time-consuming and labor-intensive, resulting in the network being sensitive to abnormal data and lacking flexibility in practical applications. Unlike supervised hash models, unsupervised hash models are usually used to find hidden structures of data and do not require label marking, so they are more in line with content-based perceptual image hashing algorithms. The neural network designed by Liong et al. can complete the projection of images to binary codes, and output efficient hash codes by quantizing, uniformly distributing, and orthogonalizing the binary vector matrix output by the last layer. In the scheme designed by Lin et al., the original image and the corresponding rotated image are regarded as similar pairs, and the hash codes generated by the similar pairs are used to maintain this similarity. Song et al. proposed a scheme based on BGAN. In the process of adversarial training, adversarial constraints are used to enable the encoder to achieve the function of inverse mapping from the real data distribution to the potential representation. Due to the lack of guidance from semantic labels, most deep hashing algorithms based on unsupervised learning involve pixel-level reconstruction. Natural images usually contain a lot of variable detail information during the reconstruction process, such as size, spots, and shape. Pixel-level reconstruction makes the model more sensitive to these detail information, reducing the robustness of the hash code. Li et al. proposed a perceptual image hashing algorithm based on a deep learning network model. They first used a stacked denoising autoencoder (DAE) to restore the distorted image to its original state, and then fine-tuned the entire network to maximize the balance between the robustness and sensitivity of the perceptual hashing algorithm.Qin et al. used CNN as a feature extractor for perceptual image hashing algorithm and constructed a perceptual image hashing network model. In order to ensure the robustness and sensitivity of the deep hashing network at the same time, this work constructed two pairs of objective functions and dynamically adjusted the network structure according to the change of loss value. In general, there are relatively few studies on perceptual image hashing algorithm using deep learning network models, and the performance of the algorithm still has a lot of room for improvement.
[0011] From the above literature, we can see that the traditional perceptual hashing algorithm is completed by artificially extracting features and then quantizing them. In actual operation, it is often not flexible enough and it is difficult to capture the visual features of the image. Most existing technologies rely on hand-crafted feature extractors and quantizers. However, the manually extracted features often cannot well represent the perceptual content of the image and cannot show satisfactory robustness in the face of complex distortion schemes. Summary of the invention
[0012] In order to address the deficiencies of the prior art, the present invention provides an image-aware hashing method and system based on an improved bidirectional generative adversarial network; the combination of network layers with multiple functions gives the hashing framework the ability to extract invariant visual features and distinguish visual features.
[0013] In a first aspect, the present invention provides an image-aware hashing method based on an improved bidirectional generative adversarial network;
[0014] Image-aware hashing method based on improved bidirectional generative adversarial network, including:
[0015] Get the image to be processed;
[0016] Preprocess the image to be processed;
[0017] Input the preprocessed image into the trained improved bidirectional generative adversarial network to obtain the hash code of the image to be processed;
[0018] The improved bidirectional generative adversarial network includes an encoder network, a generator network and a discriminator network; wherein the encoder network and the generator network are both connected to the discriminator network and the encoder network is also connected to the generator network;
[0019] Among them, in the process of training the improved two-way generative adversarial network, the normalized original image is input into the encoder network, and the encoder network generates an initial hash code; the randomly generated noise with the same dimension as the initial hash code is input into the generator network, and the generator network outputs a reconstructed image of the original image; the discriminator network is used to identify the initial hash code and the noise, and at the same time, the reconstructed image and the original image are identified. By training the three networks together, the improved two-way generative adversarial network after training is obtained.
[0020] In a second aspect, the present invention provides an image-aware hashing system based on an improved bidirectional generative adversarial network;
[0021] Image-aware hashing system based on improved bidirectional generative adversarial network, including:
[0022] An acquisition module is configured to: acquire an image to be processed;
[0023] A preprocessing module is configured to: preprocess the image to be processed;
[0024] A hash code generation module is configured to: input the preprocessed image into the trained improved bidirectional generative adversarial network to obtain a hash code of the image to be processed;
[0025] The improved bidirectional generative adversarial network includes an encoder network, a generator network and a discriminator network; wherein the encoder network and the generator network are both connected to the discriminator network and the encoder network is also connected to the generator network;
[0026] Among them, in the process of training the improved two-way generative adversarial network, the normalized original image is input into the encoder network, and the encoder network generates an initial hash code; the randomly generated noise with the same dimension as the initial hash code is input into the generator network, and the generator network outputs a reconstructed image of the original image; the discriminator network is used to identify the initial hash code and the noise, and at the same time, the reconstructed image and the original image are identified. By training the three networks together, the improved two-way generative adversarial network after training is obtained.
[0027] In a third aspect, the present invention further provides an electronic device, comprising:
[0028] a memory for non-transitory storage of computer-readable instructions; and
[0029] a processor for executing the computer readable instructions,
[0030] When the computer-readable instructions are executed by the processor, the method described in the first aspect is executed.
[0031] In a fourth aspect, the present invention further provides a storage medium that non-temporarily stores computer-readable instructions, wherein when the non-temporary computer-readable instructions are executed by a computer, the instructions of the method described in the first aspect are executed.
[0032] Compared with the prior art, the present invention has the following beneficial effects:
[0033] In order to improve the performance of hash codes, the present invention proposes an unsupervised data-driven generative adversarial framework to extract image hash codes. The framework first normalizes the image and generates a hash code through an encoder network operation; secondly, randomly generates noise with the same dimension as the hash code and inputs it into the generator network to generate a generated image that is as similar to the original image as possible. Finally, the discriminator network is used to distinguish the hash code from the noise-generated hash code, and the source of the generated image and the original image. By jointly training the three networks, the encoder can generate image hash codes with good perceptual robustness and recognition accuracy. Various experiments conducted by the present invention on a large test database show that the proposed perceptual image hashing algorithm has stronger robustness than other schemes in the latest research.
[0034] Based on the ability of neural networks to extract features, the present invention proposes an image hash generation framework based on a bidirectional adversarial network. The combination of multiple functional network layers gives the hash framework the ability to extract invariant visual features and distinguish visual features. The present invention proposes an unsupervised data-driven robust image hashing solution that can automatically learn highly robust and highly recognizable hash codes by training adversarial neural networks.
[0035] The present invention develops a new encoder network and hash decoder combination mode to optimize the robustness and recognition accuracy of image hashing. A jump layer is added between the encoder network and the specific layer of the hash decoder to freely combine features of different dimensions to achieve an organic combination of local features and global features. This ensures that image hashing is still effective in the face of high-intensity content retention attacks while maintaining a high level of recognition rate.
[0036] Experimental results on datasets such as CeleA show that compared with the most advanced perceptual hashing algorithm, the image-perceptual hashing algorithm based on the bidirectional adversarial generative network has better balanced performance under high-intensity attacks.
[0037] The present invention proposes a method for generating perceptual hash codes based on a bidirectional generative adversarial network based on BiGAN, which is used for image source detection under different attack algorithms. On the one hand, the algorithm itself adopts an unsupervised network model that does not require labeling or manual feature extraction, which significantly improves the efficiency of generating hash codes; on the other hand, a shorter hash code is used to replace a huge feature database, reducing physical storage space. Compared with the existing algorithms, the ROC curve and PR curve show that the perceptual hash algorithm proposed in the present invention can ensure a high recognition rate for images from different sources while having strong perceptual robustness for images from the same source, that is, it can achieve a good balance between the two performances. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0039] Figure 1 This is a schematic diagram of the GAN architecture of Example 1;
[0040] Figure 2 Schematic diagram of BiGAN architecture of Example 1;
[0041] Figure 3 This is a schematic diagram of the U-Net network architecture of Example 1;
[0042] Figure 4 This is an architecture diagram of a BiGAN-based perceptual image hashing algorithm according to Embodiment 1;
[0043] Figure 5(a) to Figure 5(d) The test sample of Example 1;
[0044] Figure 6(a) to Figure 6(j) The correlation coefficient results under different content retention operations of Example 1;
[0045] Figure 7 The Unet jump layer performance enhancement test results of Example 1 are as follows;
[0046] Figure 8 Comparison of ROC curves of different algorithms in Example 1;
[0047] Fig. 9 The PR curves of different algorithms in Example 1 are compared. DETAILED DESCRIPTION
[0048] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used in the present invention have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0049] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0050] In this embodiment, all data is obtained in compliance with laws and regulations and based on the user's consent, and is used legally.
[0051] like Figure 1 As shown in Figure 1, Generative Adversarial Network (GAN), as a typical algorithm for adversarial learning, was first proposed by Goodfellow et al. Its wide application in image synthesis, object recognition and other fields has proved that the GAN framework has the ability to generate arbitrarily complex data distributions. The architecture diagram is shown in Figure 1. Figure 1In general, in order to learn the distribution of data space X, the GAN network first defines the prior input noise variable p z (z); then through G(z; θ g ) to map it to the data space. Where G represents the parameters θ contained in the multi-layer convolutional neural network g . Next, define a multi-layer convolutional neural network D(x; θ) that outputs a unique scalar d ). D(x) represents the probability that x comes from the real data space, and its value range is [0,1]. D is trained to maximize the probability of allocating real data and generated data. At the same time, G can be trained by minimizing log(1-D(G(z))), that is, D and G complete a minimax game process through the value function V:
[0052]
[0053] Specifically, the training of the GAN network adopts the method of alternating training of D and G. First, D is trained to make the discriminator reach the local optimal solution. Then the discriminant network parameter θ is fixed. d , the updated gradient of D will guide G to generate a distribution similar to the real data. After several iterations, D and G reach a balance point, at which time the generated data distribution is consistent with the real data distribution, so as to complete the task of learning any data distribution.
[0054] Although GAN can learn arbitrary data distribution, the framework does not include the inverse mapping from data to potential representation. Jeff Donahue et al. proposed a bidirectional adversarial neural network (BiGAN) with an architecture such as Figure 2 BiGAN is very similar to GAN but differs in the following aspects:
[0055] Its generative network consists of two components: the encoder E(x) maps the real data space x to the potential data space z to form a distribution P E (z|x) = δ(zE(x)); the decoder G(z) converts the noise variable p z (z) is mapped to the real data space to form a distribution P G (x|z)=δ(xG(x)).
[0056] The discriminant network makes a joint judgment on G(z) and E(x) not only in the data space x, but also in the data potential representation space z (tuple (x, E(x)), (G(z), z)) to form a distribution P D (R|x,z). When x comes from real data, R=1; when x comes from generated data G(z), R=0.
[0057] The value function of BiGAN is:
[0058]
[0059] Similar to the GAN network training process, BiGAN also uses the method of alternating updates of the discriminant network and the generative network. First, the discriminant network D is updated to maximize the value function V(D, E, G) so that it can more confidently judge the source of the data pair. This guides the decoder to automatically learn the real data distribution on the one hand, and guides the encoder to perceptually learn the key feature information of the real data on the other hand. Secondly, the discriminant network D is fixed, and the generative networks E and G are updated to minimize the value function V(D, E, G). According to the guidance of the updated discriminant network gradient, the generative network is in dual mapping (i.e., the real data space x is mapped to the potential data space z; the noise variable p z (z) to the real data space). When the above process is iterated until the model converges, the encoder of BiGAN has the ability to reverse decode, and the decoder can generate an image distribution consistent with the original image, thereby deceiving the discriminator; that is, in a pair of tuples, the data distribution of G(z) is as close to x as possible, and the data distribution of E(x) is as close to z as possible. In other words, the encoder has the ability to capture the potential characteristics of the input data in the process of learning flipping.
[0060] The potential representation of data is an essential component of perceptual hash codes. The idea based on BiGAN can obtain more representative features of the original image through self-learning based on a multi-layer convolutional neural network algorithm, and this feature can achieve maximum original image restoration. Therefore, using this feature as a perceptual hash code can achieve the unity of robustness and sensitivity of the perceptual hash of the original image. The present invention proposes a bidirectional adversarial generative network that does not require pixel-level reconstruction while retaining latent semantic information to obtain a robust image hash algorithm.
[0061] U-Net is a symmetrical network structure, which includes a downsampling network and an upsampling network (generating network). The overall architecture is as follows: Figure 3 shown. Figure 3 The numbers in the middle indicate the number of convolution kernels. The black arrows represent the pooling layer used to reduce the dimension. The gray arrows indicate upsampling operations using 2x2 convolution kernels to restore the dimension. The compound arrows represent skip layers.
[0062] This key step in UNet does not use the method of adding corresponding pixel positions but uses the method of splicing. The splicing method retains more dimensional information, allowing the receiving layer to freely choose between deep features and shallow features.
[0063] Embodiment 1
[0064] This embodiment provides an image-aware hashing method based on an improved bidirectional generative adversarial network;
[0065] Image-aware hashing method based on improved bidirectional generative adversarial network, including:
[0066] S101: Acquire an image to be processed;
[0067] S102: Preprocessing the image to be processed;
[0068] S103: inputting the preprocessed image into the trained improved bidirectional generative adversarial network to obtain a hash code of the image to be processed;
[0069] The improved bidirectional generative adversarial network includes an encoder network, a generator network and a discriminator network; wherein the encoder network and the generator network are both connected to the discriminator network and the encoder network is also connected to the generator network;
[0070] Among them, in the process of training the improved two-way generative adversarial network, the normalized original image is input into the encoder network, and the encoder network generates an initial hash code; the randomly generated noise with the same dimension as the initial hash code is input into the generator network, and the generator network outputs a reconstructed image of the original image; the discriminator network is used to identify the initial hash code and the noise, and at the same time, the reconstructed image and the original image are identified. By training the three networks together, the improved two-way generative adversarial network after training is obtained.
[0071] Furthermore, the preprocessing specifically refers to normalization processing.
[0072] Furthermore, the encoder network includes: 10 convolutional layers, 9 normalization layers and 9 activation function layers.
[0073] Furthermore, the encoder network comprises:
[0074] Convolution layer a1, batch normalization layer b1, activation function layer c1,
[0075] Convolution layer a2, batch normalization layer b2, activation function layer c2,
[0076] Convolution layer a3, batch normalization layer b3, activation function layer c3,
[0077] Convolution layer a4, batch normalization layer b4, activation function layer c4,
[0078] Convolution layer a5, batch normalization layer b5, activation function layer c5,
[0079] Convolution layer a6, batch normalization layer b6, activation function layer c6,
[0080] Convolution layer a7, batch normalization layer b7, activation function layer c7,
[0081] Convolution layer a8, batch normalization layer b8, activation function layer c8,
[0082] Convolution layer a9, batch normalization layer b9, activation function layer c9 and
[0083] Convolutional layer a10.
[0084] Furthermore, the encoder network works as follows:
[0085] The encoder network is used to realize the mapping from the original image to the latent representation;
[0086] During the training phase, the input value of the encoder network is the normalized training set image, and the output value of the encoder network is the hash code;
[0087] In the actual application stage, the input value of the encoder network is the normalized image to be processed, and the output value of the encoder network is the hash code.
[0088] Furthermore, the generator network includes: 8 deconvolution layers, 7 batch normalization layers and 7 activation function layers.
[0089] Furthermore, the generator network comprises:
[0090] Deconvolution layer d1, batch normalization layer e1, activation function layer f1,
[0091] Deconvolution layer d2, batch normalization layer e2, activation function layer f2,
[0092] Deconvolution layer d3, batch normalization layer e3, activation function layer f3,
[0093] Deconvolution layer d4, batch normalization layer e4, activation function layer f4,
[0094] Deconvolution layer d5, batch normalization layer e5, activation function layer f5,
[0095] Deconvolution layer d6, batch normalization layer e6, activation function layer f6,
[0096] Deconvolution layer d7, batch normalization layer e7, activation function layer f7,
[0097] Deconvolution layer d8 and Tanh function layer.
[0098] Furthermore, the generator network works as follows:
[0099] A randomly generated normally distributed noise with the same dimension as the initial hash code is input into the generator network, and the generator network outputs a reconstructed image of the original image.
[0100] Furthermore, a jump connection is performed between the encoder network and the generator network.
[0101] Exemplarily, the jump connection refers to:
[0102] The activation function layer c5 is connected to the deconvolution layer d4;
[0103] The activation function layer c6 is connected to the deconvolution layer d3;
[0104] The activation function layer c7 is connected to the deconvolution layer d2.
[0105] It should be understood that the working principle of jumper is:
[0106] In the encoding stage of the encoder network, various information of different receptive fields of activation function layer c5, activation function layer c6 and activation function layer c7 obtained by downsampling convolution operation are passed to the hash code generation stage;
[0107] Next, in the hash code generation stage, the deconvolution layer d4, deconvolution layer d3, and deconvolution layer d2 information saved by the splicing generator network is combined with the input information from itself to capture the local and global features of the image;
[0108] Finally, under the guidance of the back propagation of the discriminator network, the hash code generated by the encoder network can represent the image itself and has strong robustness.
[0109] Furthermore, the discriminator network includes: 13 convolutional layers, 13 LeakyRelu activation function layers, 12 Dropout activation function layers and one Sigmoid activation function layer.
[0110] Furthermore, the discriminator network comprises:
[0111] Convolution layer g1, LeakyRelu activation function layer h1, Dropout activation function layer j1,
[0112] Convolution layer g2, LeakyRelu activation function layer h2, Dropout activation function layer j2,
[0113] Convolution layer g3, LeakyRelu activation function layer h3, Dropout activation function layer j3,
[0114] Convolution layer g4, LeakyRelu activation function layer h4, Dropout activation function layer j4,
[0115] Convolution layer g5, LeakyRelu activation function layer h5, Dropout activation function layer j5,
[0116] Convolutional layer g6, LeakyRelu activation function layer h6, Dropout activation function layer j6,
[0117] Convolution layer g7, LeakyRelu activation function layer h7, Dropout activation function layer j7,
[0118] Convolution layer g8, LeakyRelu activation function layer h8, Dropout activation function layer j8,
[0119] Convolution layer g9, LeakyRelu activation function layer h9, Dropout activation function layer j9,
[0120] Convolution layer g10, LeakyRelu activation function layer h10, Dropout activation function layer j10,
[0121] Convolutional layer g11, LeakyRelu activation function layer h11, Dropout activation function layer j11,
[0122] Convolution layer g12, LeakyRelu activation function layer h12, Dropout activation function layer j12,
[0123] Convolutional layer g13, LeakyRelu activation function layer h13, and Sigmoid activation function layer j13.
[0124] Furthermore, the discriminator network works as follows:
[0125] The discriminator network is used to distinguish the initial hash code generated by the encoder network from the randomly generated noise. At the same time, the reconstructed image generated by the generator is distinguished from the normalized original image.
[0126] Furthermore, the discriminator network is divided into three mapping processes, namely: image mapping, semantic mapping, and joint mapping.
[0127] Image mapping is achieved by performing multi-layer convolution operations on the input original image or reconstructed image. Based on the characteristics of multi-layer convolutional networks, as the network goes deeper, the number of image channels increases and the image size gradually decreases. Finally, the original input image is compressed into a 1024-bit feature representation.
[0128] Semantic mapping extracts the original image features by performing multi-layer convolution operations on the input noise or hash code;
[0129] Joint mapping is to combine the output of image mapping and semantic mapping into one piece of data (i.e., joint representation) as input. After multiple layers of convolution operations, sigmoid activation is used to determine the truth or falsity of the joint representation.
[0130] Furthermore, the improved bidirectional generative adversarial network obtained by training the three networks together has a training completion criterion as follows:
[0131] The accuracy of distinguishing the initial hash code from the noise reaches 50%; and the accuracy of distinguishing the reconstructed image from the original image reaches 50%.
[0132] Furthermore, the improved bidirectional generative adversarial network obtained by training the three networks together includes:
[0133] Constructing a training set; the training set is a human face image;
[0134] Input the training set into the improved bidirectional generative adversarial network to train the network;
[0135] First, fix the network parameters of the encoder network and the generator network, and optimize the parameters of the discriminator network; when the loss function of the discriminator network reaches a local optimum, suspend the training of the discriminator network;
[0136] Then fix the parameters of the discriminator network and optimize the parameters of the encoder network and the generator network; when the loss functions of the encoder network and the generator network reach the local optimum, suspend the training of the encoder network and the generator network;
[0137] Alternate the above two steps until the model converges;
[0138] Get the improved bidirectional generative adversarial network after training.
[0139] Furthermore, in the process of training the improved bidirectional generative adversarial network, the loss functions used include:
[0140] Loss D =-Mean[log(D(x,E(x)))+log(1-D(G(z),z))] (3)
[0141] Loss E,G =-Mean[log(D(G(z),z))+log(1-D(x,E(x)))] (4)
[0142] Where x∈X_real,z∈Z_real; E(·) represents the output of the encoder; G(·) represents the output of the generator; D(·) represents the output of the discriminator network; Mean represents the averaging operation on the batch input; Formula (3) is used to optimize the discriminator network. The lower the value of formula (3), the larger the value of D(x,E(x)), the smaller the value of D(G(z),z), that is, the stronger the discriminant ability; Formula (4) is used to optimize the encoder network and the generator network. The smaller the value of formula (4), the larger the value of D(G(z),z), the smaller the value of D(x,E(x)), that is, the stronger the generation ability.
[0143] After training the three networks together through adversarial loss, ideally the encoder and decoder are inverse to each other, that is, G(E(x)) = E(G(z)), that is, the encoder data pair (x, E(x)) and the generator data pair (G(z), z) are matched. In other words, the discriminator cannot distinguish the difference between the data pairs (X, E(X)) and (G(z), z). At this time, the random noise distribution has become a data distribution consistent with the original image encoding after training. Therefore, the trained network model can be used to learn the hash code, and the generated semantic distribution can be trained as the perceptual hash of the original image to achieve consistency judgment of the original image and identification of images from different sources.
[0144] It should be understood that the framework first normalizes the image and generates a hash code through the encoder network operation; secondly, randomly generates noise of the same dimension as the hash code and inputs it into the generator network to generate a generated image that is as similar to the original image as possible. Finally, the discriminator network is used to distinguish the hash code from the noise generated hash code, and the source of the generated image and the original image. By jointly training the three networks, the encoder can generate image hash codes with good perceptual robustness and recognition accuracy.
[0145] The purpose of the perceptual image hashing algorithm is to identify images with the same content as the original image, while also identifying images with different content.
[0146] The BiGAN-based perceptual image hashing algorithm consists of three sub-networks:
[0147] The encoder network is an encoder network E:X_real→z_fake that generates hash codes for original images. The encoder network implements the mapping from original data X to potential representation z. Its input is the normalized training set image and its output is a 1024-bit hash code.
[0148] The generator network is a hash decoder G:Z_real→X_fake that maps random noise to the target data distribution, where Z_real follows a normal distribution;
[0149] The discriminator network is used to distinguish whether the data pair consisting of image and potential representation data comes from the encoder network or the generator network. The discriminator network D: (X, Z) → {0, 1}, (X_fake, X_real∈X and Z_fake, Z_real∈Z).
[0150] Among them, a jump layer is added between the corresponding specific layers of the encoder network and the generator network, which enhances the model's ability to combine local features with global features and improves the quality of generated hash codes.
[0151] The overall process is as follows Figure 4 As shown:
[0152] First, the encoder network learns the preprocessed original image to obtain the corresponding potential representation; then the original image of the encoder input is reconstructed through the generator using random noise. The tuple consisting of the encoder input and output and the tuple consisting of the generator output and input are put into the discriminator to guide the next step of model training until the generated image and the original image, image encoding and random noise distribution are consistent.
[0153] Among them, Conv2d represents the convolution layer, BachNorm represents the batch normalization layer, and LeakyRelu represents the activation function.
[0154] Based on the algorithm principle of BiGAN, the random noise distribution in the BiGAN training process is used as the perceptual hash value of the original image, and the perceptual hash is balanced between the robustness of the same image and the sensitivity of different images according to the image perception requirements. The perceptual hash algorithm based on BiGAN is designed to achieve accurate image classification and consistency verification. Suppose there are N original images X_real = {X_real i |i=1,…,N}, based on the BiGAN training network, the original image is mapped to the trained encoding sequence, based on the BiGAN network mapping function EN:X_real→{d i |i=1,…,k} generates a K-bit hash code of the original image, and the K-bit perceptual hash code is used to realize content-consistent image determination and different content image identification.
[0155] The purpose of the BiGAN-based encoder network is to extract compact hash codes from the original image. This part contains N convolutional layers (Conv2d), N batch normalization layers (BatchNorm), and N activation layers (LeakRelu). The initial input of the encoder is limited to the normalized training set image. At the same time, in order to improve the performance of the hash code, the outputs of the fifth, sixth, and seventh convolutional layers will be passed to the corresponding layers of the generator as part of the input. The number of convolution kernels in the last convolutional layer is set to be equal to the length of the hash code. The detailed parameters of the network architecture are shown in Table 1. The details of each convolutional layer are given by the first two elements in the configuration column. The first element represents the number of filters, and the multiplication method is used here to increase the number of filters. In the entire self-learning encoding process, the number of channels is first expanded to high dimensions, which is convenient for freely selecting an effective 1024 dimension under the guidance of the loss function to form a hash code; the first value of the second element represents the size of the receptive field, the second value represents the convolution step, and the third value represents the number of rows / columns added to each side of the input; the last element of the configuration column represents the slope of the activation function LeakRelu. Except for the last convolutional layer, BatchNorm is applied to each convolution operation in the experiment. The main purpose is to force the adjustment layer output distribution to conform to the standard normal distribution as much as possible, so that the activation input value falls in the area where the nonlinear function is more sensitive to the input, thereby avoiding gradient vanishing and accelerating the convergence of the model.
[0156] Considering that too few convolutional layers will not accurately extract the key information, and too many convolutional layers will blur the key information. Experimental results show that the encoder network uses 10 convolutional layers, 9 batch normalization layers, and 9 activation layers for the best training effect. The location of the specific layer selection will be described in detail in the experimental section.
[0157] Table 1 Detailed parameters of encoder network
[0158]
[0159] The goal of the Hash decoder network is to generate a target image through a preset random noise. This part of the network adopts a fully convolutional neural network architecture. In order to symmetrically flip the process of the encoder network, this part contains 8 deconvolution layers, 7 BatchNorm layers, and 7 activation layers (LeakRelu). The initial input of the generator is limited to random noise that conforms to the Gaussian distribution. The input of the second, third, and fourth deconvolution layers is the superposition of the output of the previous layer and the output from the encoder response layer, thereby enhancing the detailed information of the generated image, making the gradient signal transmitted by the discriminator to the generator and decoder more sensitive, and finally generating a hash code with higher performance. In the experiment, the Tanh function and the sigmoid function were used as activation functions respectively, and the experimental results proved that the performance of the hash code generated by using the Tanh function activation in the last layer is better than that of the sigmoid function activation. The detailed parameters of the network architecture are shown in Table 2. The deconvolution operation is opposite to the convolution operation. It upsamples the feature matrix and increases the matrix dimension. The details of each deconvolution layer are given by the first two elements in the configuration column. The meanings represented refer to the parameter information of the convolution layer in Table 1.
[0160] Table 2 Generator network detailed parameters
[0161]
[0162]
[0163] The discriminator network is used in the model to determine whether the data pair consisting of an image and "noise" comes from the real data distribution or the generated data distribution. In this pair of data, one element must come from the real data distribution and the other element must come from the generated data distribution. Since the input of the network consists of two elements, the present invention first performs convolution operations on them separately and then distinguishes "true" from "false".
[0164] Among them, Table 3 shows the detailed configuration information of the discriminator network, where LeakyRelu and Dropout2d represent the activation function and Dropout layer respectively; from left to right in the configuration column are the number of channels output by the layer, convolution kernel size, step size, padding size, LeakyRelu activation layer slope, and dropout rate.
[0165] As shown in Table 3, after ensuring the effective extraction of key information, we must also consider balancing the training process. By coordinating the number of convolutional layers of the generative network and the joint discriminant network, we can eliminate the situation where one party is too strong or too weak. Therefore, the joint discriminant network uses a 13-layer convolutional neural network. Due to the complexity of the data distribution of natural images, more convolutional layers are allocated to ensure the resolution ability of the discriminator network.
[0166] Table 3 Detailed parameters of the joint discriminant network
[0167]
[0168] About the loss function:
[0169] The core of the BiGAN-based perceptual hashing algorithm is to generate perceptual hash codes with good same-image robustness and different-image sensitivity by training the encoder network, Hash decoder network, and discriminator network based on deep convolution operations. Different from the original image reconstruction algorithm based on the GAN network, the purpose of this algorithm is to generate perceptual hash codes that are representative of the original image features. In order to ensure that the BiGAN deep learning adversarial network generates perceptual hash codes with balanced robustness and sensitivity, and to make the self-learning decoder output image data distribution as consistent as possible with the original image data distribution characteristics, this algorithm designs an encoder network E that can map the original image to a potential representation, a Hash decoder network G that can reconstruct the input image through random distribution, and a bidirectional discriminant network D that guides the encoder and generator to produce consistent potential distributions. In order to ensure the stable conduction of the gradient, loss functions are designed for D and (E, G) respectively.
[0170] Training and Experimental Design:
[0171] In order to verify the performance of the proposed perceptual hashing deep learning model based on BiGAN bidirectional adversarial network, CelebAMask-HQ is selected as the validation dataset for this experiment. CelebAMask-HQ is a dataset selected from the large-scale facial dataset of CelebA. It contains 30,000 color face images with a pixel size of 1024*1024, each with a segmentation mask corresponding to the facial attributes of CelebA. It is a widely used test dataset for perceptual image hashing algorithms. In the experiment, 12,000 images are randomly selected from the dataset as the training set, and another 18,000 images are used as the test set.
[0172] In the data preprocessing stage, the image is first resized to a uniform size of 128*128 by bilinear interpolation, and then grayed out. During the training process, the encoder network, generator network, and discriminator network parameters of the BiGAN bidirectional adversarial network are first initialized. e ,θ g ,θ d Then, m real data samples are extracted from the training set X_real and input into the encoder network to generate the corresponding potential representation:
[0173] E(X_real i )=Z_fake i ,{Z_fake1,…,Z_fake m} (5)
[0174] In the generator network, m noise Z_real that conforms to the Gaussian distribution is randomly generated i ,{Z_real1,..,Z_real m} Input the generator network and generate image distribution:
[0175] G(Z_real i ) = X_fake i ,{X_fake1,..,X_fake m} (6)
[0176] Among them, the original input of the generator network is random noise, but the input of the second, third, and fourth deconvolution layers is the superposition of the output of the previous layer and the output from the encoder response layer.
[0177] Since the purpose of the BiGAN-based bidirectional adversarial network is to maximize V to obtain the potential image semantic representation of the original image and enhance the discriminative ability of the image-aware hash code, the Adam optimizer is used in the experiment to update the discriminator parameter θ d Right now:
[0178]
[0179] The update iterative method of the discriminator parameters is gradient ascent iterative:
[0180]
[0181] Among them, α is the learning rate.
[0182] The trained discriminator network guides the training process of the encoder network and the generator network, so that the original image and its semantic encoding are closer to the generated image and the random sequence, and finally reach consistency.
[0183] In the experiment, it is proposed to use the "inverse" adversarial loss function Λ when optimizing E and G to provide a stronger gradient signal for E and G:
[0184] Λ(D,E,G)=∑ x~pata(x) [log(1-D(x,E(x)))]+∑ x~pz(z) [logD(G(z),z)] (8)
[0185] In fact, when the model is just beginning to be trained, the performance of G is poor, so the value of D(G(z),z) is close to 0, and the gradient generated by log(1-D(G(z),z)) is relatively small, making it difficult to optimize the model. Therefore, we change it to θ e ,θ gIt is updated by moving in the positive gradient direction of the "inverse" adversarial loss function ASD instead of moving in the negative gradient direction of the original loss function V, so as to ensure that the random distribution sequence obtained by iterative training is closer to the semantic distribution of the original image. That is, by maximizing ASD, the Adam optimizer is used to update the encoder network parameters θ e and the generator network parameters θ g :
[0186]
[0187] The iterative method for generating network parameter updates is as follows:
[0188]
[0189] The above process can realize one round of iteration of the BiGAN bidirectional adversarial network. Through multiple rounds of iterations, the encoder and the generator can eventually be inverse processes, that is, G(E(x))=E(G(z)). The hash code extracted by the encoder can effectively represent the input image features, thereby improving the performance of the perceptual hash algorithm based on the BiGAN bidirectional adversarial network.
[0190] Experimental studies
[0191] The method proposed in the present invention is evaluated and verified on the large-scale dataset CelebAMask-HQ, and the experimental results are compared with the current mainstream high-performance image-aware hashing algorithm to verify the advancement of the algorithm.
[0192] Experimental setup details:
[0193] All images in the experiment of the present invention are from the CelebAMask-HQ dataset. The CelebAMask-HQ dataset contains about 30,000 color face images with a pixel size of 1024*1024, each with a segmentation mask corresponding to the facial attributes of CelebA. The present invention randomly selects 12,000 images as the training set and another 18,000 images as the test set.
[0194] In the preprocessing stage, the image is first adjusted to a uniform size of 128*128 by bilinear interpolation, and then grayscaled. In the experiment, the algorithm proposed by the present invention is implemented through the pytroch framework, and the encoder network is built using the full convolution (FCN) architecture. The three network models all use the Adam optimizer to update the parameters. Among them, β1 is .5, β2 is 0.999, the weight decay is 2.5e-5, the minimum batch is 20, and the learning rate is 1e-4. All parameters of the BiGAN bidirectional adversarial network to generate perceptual hashing are learned by random initialization. In addition, the correlation coefficient is used in the experiment to calculate the correlation between two hash codes. Generally speaking, the larger the hash code correlation coefficient, the more similar the image pair is in visual perception.
[0195] The correlation calculation formula adopts the chemical correlation calculation method:
[0196]
[0197] h1(k), h2(k) are the kth elements in the hash codes H1 and H2 respectively. u1, u2 are the means of the hash codes H1 and H2 respectively. Δs is a very small number to prevent the denominator from being 0. From formula (10), it can be seen that the larger the mutual correlation coefficient ρ(H1, H2), the higher the similarity between the perceived hash codes, the stronger the image discrimination ability of the generated hash code, and the more accurate the judgment of the same image and the identification of different images.
[0198] Perceptual robustness analysis:
[0199] In the experiment, four color images are first randomly selected as test samples, such as Figure 5(a)-Figure 5(d) As shown in the figure. The complexity of the four color samples increases from left to right. The original image is modified by attacking it using brightness adjustment, contrast modification, Gaussian filtering, gamma filtering, scaling, salt and pepper noise, Gaussian noise, rotation shear scaling, jpeg compression, and watermark embedding to verify the same source image verification performance of the perceptual hash generation model based on the BiGAN bidirectional adversarial network. The detailed attack parameters are shown in Table 4. In the experiment, 67 visually similar images are first generated for each test image. Then, the perceptual hash generation model based on the BiGAN bidirectional adversarial network is used to calculate the hash sequences of the test image and the reconstructed image respectively, and the correlation coefficient is calculated according to formula (10). According to the definition of cross-correlation, for hash codes between images from the same source, the calculated correlation coefficient should be close to 1, while for hash codes from images from different sources, the calculated result of the cross-correlation coefficient should be close to 0. Therefore, during the experiment, the cross-correlation coefficient distribution diagram can be drawn according to different attack types, and the image source forensics based on perceptual hashing can be realized by setting the threshold.
[0200] Table 4 Correlation coefficients under different content preservation operations (for robust performance testing)
[0201]
[0202]
[0203] The correlation coefficient results under different content retention operations are given by Figure 6(a) to Figure 6(j) Given. The X-axis represents the change of relevant parameters of a specific attack, and the Y-axis represents the correlation coefficient at this time. It can be clearly observed in the figure that the correlation coefficients are almost close to 1, which shows that the model proposed in the present invention has quite good perceptual robustness. It is worth mentioning that Figure 6 (g) shows the correlation coefficient calculated after three mixed attacks of rotation, cropping and scaling. Multiple attack operations will inevitably lead to a decrease in the correlation coefficient. Even so, the correlation coefficient can still reach above 0.90. In all robustness experiments, the correlation coefficient calculated from the fourth test image is lower than that of the first three images. This is mainly because the texture features of the fourth image are different from most of the texture features in the training set, resulting in the encoding extracting a hash code different from the expected target, resulting in a low correlation coefficient.
[0204] It is worth noting that in Figure 6(a) to Figure 6(j) The correlation coefficient curve calculated by a single attack has very small fluctuations, for example, the results produced by Gaussian low-pass filtering and scaling are basically unchanged. That is, a single attack will not seriously affect the value of the correlation coefficient, which also shows that the method proposed in the present invention has strong perceptual robustness.
[0205] In order to further verify the perceptual robustness of the method proposed in the present invention, 500 images were randomly selected from the training set in the experiment, and 33,500 duplicate images were generated after the copy attack shown in Table 4. Based on the algorithm proposed in the present invention, 33,500 pairs of hash codes were extracted and their correlation coefficients were calculated. The statistical information (maximum value, mean value, minimum value) generated by all correlation coefficients is shown in Table 4. From Table 5, it can be seen that the mean values of all correlation coefficients are close to 1. When the threshold value of the correlation coefficient T = 0.95 (the correlation coefficient of two images is considered to be similar versions as long as it is greater than 0.9573), only 703 images have a correlation coefficient lower than the threshold. Among them, 349 of the 703 undetected reconstructed images were generated by a combination of rotation, cropping, and scaling attacks; 274 were generated by Gaussian noise attacks, and 78 were generated by gamma correction attacks. The correct source determination rate of the images after being subjected to the above various types of attacks is as high as 95.3% or more. Experimental results show that the perceptual hash generation network based on BiGAN bidirectional adversarial network can effectively judge similar copies of the original image and has strong robustness in determining the same image.
[0206] Table 5 Statistical characteristics of different content retention operations
[0207]
[0208] Identification ability analysis:
[0209] In order to quantify the ability of the perceptual hashing generation model based on the BiGAN bidirectional adversarial network to discriminate images from different sources, the experiment introduces five indicators: true positive rate (TPR), false positive rate (FPR), maximum value, mean value, and minimum value to jointly evaluate the performance of this algorithm. Among them, TPR represents the probability that an image is actually a reconstructed image and is also judged as a reconstructed image; FPR represents the probability that an image is actually not a reconstructed image but is judged as a reconstructed image. TPR and FPR represent robustness and discrimination ability, respectively.
[0210]
[0211]
[0212] Where ρ represents the correlation coefficient between image pairs, T represents the threshold, n1 represents the number of pairs judged to be similar, N1 represents the total number of reconstructed images, n2 represents the number of different images that are incorrectly judged to be reconstructed images, and N2 represents the number of different images.
[0213] First, 500 images are randomly selected from the test set, and the above 10 attack methods are used to attack and tamper with the images. The image hash codes are extracted based on the perceptual hash generation model of the BiGAN bidirectional adversarial network, and the hash code discrimination ability between different images is verified. First, the hash codes and correlation coefficients of the 500 original images are calculated, and a total of 500×(500-1) / 2=124750 results are obtained. The mean, maximum and minimum values are further calculated, which are 0.1745, 0.9918, and -0.2935, respectively. The mean of 0.1745 is much lower than the mean of 0.9573 of the reconstructed image as shown in Table 5. The experimental results fully demonstrate that the method of the present invention has good recognition performance. The perceptual hash codes of the original image and the image after the attack are also calculated in the experiment, and the discrimination TPR and FPR performance of the algorithm for images from different sources under different threshold conditions are verified. The experimental results are shown in Table 6. It can be seen from Table 6 that when the correlation coefficient threshold is reduced, more reconstructed images are recognized, indicating that the model robustness is better at this time; at the same time, the probability of being misjudged as a reconstructed image is increasing, indicating that the model recognition performance is reduced at this time. In fact, when the correlation coefficient threshold T = 0.90, there is only a 0.7% probability of being misjudged as a reconstructed image, that is, a 99.3% probability of correctly identifying different images. The experimental results show that the perceptual hashing generation model based on the BiGAN bidirectional adversarial network has a good ability to distinguish images from different sources.
[0214] Table 6 TPR and FPR at different thresholds
[0215]
[0216] U-net jump layer impact analysis:
[0217] The receiver operating characteristic curve (ROC curve) is used to analyze the effect of the Unet-based jump layer between the encoder and the generator on the experimental results. The ROC curve consists of a set of point pairs generated by different thresholds, which is used here to find the balance between the robustness and recognition of the hash code. The X-axis represents the false positive rate (P FPR ), the Y axis represents the true positive rate (P TPR ). The ROC curve closer to the upper left corner means a smaller P FPR and a larger P TPR , which means that the hash code that generates the curve has high robustness and high recognition. In the experiment, 2000 images were first selected, and the attack scheme shown in Table 7 was used to calculate the experimental data of 2000*16=32000 pairs of reconstructed image pairs and 2000*(2000-1) / 2=1999000 pairs of different image pairs. By increasing or decreasing the Unet jump layer and according to different thresholds, the final ROC curve can be obtained, as shown in Figure 7. Figure 7 As shown. Figure 7 It can be clearly observed that the curve with the connection layer is closer to the upper left corner, which not only shows that the scheme proposed in the present invention has high perceptual robustness and good discrimination, but also means that after adding the jump layer, the algorithm can obtain better image hashing performance, and the model can achieve good performance in both same image judgment and different image identification.
[0218] Since shallow convolutional neural networks extract edge information, adding a skip layer here allows the hash decoding network to directly generate a realistic data distribution after receiving this information. This causes the discriminator network to fail, and it is impossible to guide the encoder network to accurately and efficiently capture key information. In addition, fewer skip layers are not comprehensive enough when transmitting complex information including textures, edges, and object parts, and it is difficult to ensure that the local and global features of the image are fully captured; more skip layers will affect computational efficiency and may transmit overlapping receptive field information to increase model complexity. After many experiments, it was finally chosen to add 3 skip layers starting from the fifth layer of the encoder network to achieve the best effect.
[0219] Table 7 Correlation coefficients under different content retention operations (for sensitivity performance test)
[0220]
[0221] Comparison of performance between different methods:
[0222] In order to evaluate the performance of perceptual hash codes generated by the bidirectional generative adversarial network based on BiGAN, this method is compared with other hotspot hash code algorithms in the experiment to verify the robustness of the hash code algorithm for the same image and the sensitivity of different images. Other hotspot algorithms respectively choose DCT_GLCM based on frequency domain transformation. This method combines local features with global features, making the hash code have excellent recognition performance and robustness; based on matrix compression This algorithm combines ring segmentation and edge detection technology and is completely immune to rotation attacks; DCT_LLE based on manifold learning, this algorithm combines frequency domain transformation and local linear embedding dimensionality reduction, applies LLE to reduce data complexity, and applies DCT to ensure the robust performance of hash codes; and SDAE based on deep learning, this scheme combines deep learning with copy detection for the first time and performs well under a variety of complex attacks. These algorithms have achieved good results in the field of perceptual hashing algorithms and have good perceptual hashing performance. The experimental parameter settings of the comparison algorithms are consistent with the original text. All experiments were carried out on the same computer equipped with a P4000, where DCT_GLCM, DCT_LLE is implemented by python3.7, and SDAE is implemented by MATLAB2018b. This section will organize three experiments to compare the copy detection capabilities of each algorithm:
[0223] (a) Comparison of ROC curves among different algorithms.
[0224] (b) Comparison of PR curves between different algorithms.
[0225] (c) The number of correctly detected copies by each algorithm.
[0226] In the first experiment, visually similar image pairs and different image pairs are used to compare the balance performance of robustness and discrimination. The test set introduced in the experiment is used, and a total of 8000 test images are generated after random erasure, center cropping, brightness, and Jpeg compression attacks. First, the algorithm is used to generate hash codes, and the correlation between the hash codes of each pair of original images and the attacked images is calculated using the cross-correlation criterion. Then, 20 thresholds are evenly divided from 0% to 100% to calculate 20 TPR, FPR point pairs, and then the ROC curve is generated. Finally, the ROC curve is generated by Figure 8The ROC curves of all compared algorithms are given. It can be seen from the figure that the algorithm of the present invention has a higher ROC value, indicating that the BiGAN-based bidirectional generative adversarial network-based perceptual hash code generation algorithm proposed in the present invention has a stronger perceptual robustness and has a strong judgment ability for images from the same source. Figure 5(a)-Figure 5(d) It also shows that SDAE and DCT_GLCM are closer to the upper left corner than the algorithm of the present invention. This is because the number of similar graphs generated by high-intensity attacks is small, and the high robustness of the scheme of the present invention cannot be fully experienced, which will be proved by Experiment 3. The good performance of the balance between SDAE and the scheme of the present invention shows that the deep learning method can achieve excellent results in the field of copy detection.
[0227] In the second experiment, the precision and recall rate curve (PR curve) is used to further evaluate the total detection performance between different algorithms. The calculation formula of precision and recall rate is as follows:
[0228]
[0229]
[0230] In this experimental part, for each compared algorithm, the similarity between the query image and the test image is calculated using their respective metrics, and a set of points (precision, recall) are further generated to construct the PR curve. Fig. 9 It can be seen that when the recall rate is higher than 0.92, the precision rate of the proposed solution is always higher than that of other solutions. The best recall rate and precision rate show that the method of generating perceptual hash codes based on BiGAN bidirectional generative adversarial network has strong robustness against strong copy attacks and can well distinguish between copied images and similar copied images.
[0231] Experiment 3 further verifies the ability of the BiGAN-based bidirectional generative adversarial network to generate perceptual hash codes for high-intensity copy detection. First, 10 images are randomly selected from the CelebAMask-HQ test set, and 160 reconstructed images are generated after attack modification of the original images using brightness adjustment, contrast modification, Gaussian filtering, random erasure, scaling, rotation shear scaling, JPEG compression, and center cropping. A unified threshold is used to record the percentage of correct detections of different hash generation algorithms for specific attack methods.
[0232] Specifically, for each attack, the present invention adopts a unified threshold to record the number of correctly detected samples, and the final results are given in Table 9. When the threshold value is relatively low, the method of the present invention has stronger robustness and good recognition performance. Therefore, when the threshold is less than 0.95, the recognition accuracy is higher than all the compared methods. When the threshold value is relatively high, the hash code generated by the algorithm proposed in the present invention has better recognition performance compared to the perceptual robustness. When the threshold is higher than 0.95, the method of the present invention is weaker than SDAE and DCT_GLCM. Note that although the ROC curve of the scheme of the present invention is not as close to the upper left corner as SDAE and DCT_GLCM, when the threshold is lower than 0.96, the performance is worse than the SDAE and DCT_GLCM algorithms. This is because the scheme of the present invention has a higher frequency of point pairs appearing within this threshold range, proving that the scheme of the present invention has more application value in practice.
[0233] Table 8 Time required for different algorithms to generate hash codes
[0234] 2016LLE 2016Canny 2018DAE 2020DCT Our Time (in seconds) 7.22 31.55 0.04 2.56 0.88
[0235] Table 9 The accuracy of each algorithm successfully detecting copies under the same threshold
[0236] Threshold 2016LLE 2016Canny 2018DAE 2020DCT Our 0.97 4.37% 37.50% 66.87% 62.50% 75.62% 0.96 17.50% 43.75% 69.37% 62.50% 76.88% 0.95 17.50% 46.25% 70.00% 63.12% 80.00% 0.94 17.50% 48.13% 70.63% 66.25% 81.25% 0.93 31.87% 50.62% 70.63% 68.75% 81.25% 0.92 31.87% 52.50% 71.25% 70.00% 81.87% 0.91 32.50% 55.00% 73.12% 71.88% 82.50% 0.90 41.88% 58.13% 74.38% 73.75% 83.75%
[0237] In addition, the average time for different algorithms to generate hashes was compared in the experiment. The specific method was to use 100 images for each algorithm to conduct experiments, and then calculate the average time required to generate a hash of an image. The results are shown in Table 8. The bidirectional generative adversarial network based on BiGAN generates perceptual hash codes in about 0.88 seconds, which has a higher hash generation efficiency than other algorithms; the DAE algorithm only takes 0.04 seconds, because DAE generates hash code values by manually selecting fixed features. Although this method has a higher hash code generation efficiency, it also reduces the application flexibility of this algorithm due to manual intervention. In the traditional hash code generation process, multi-layer matrix traversal operations are often designed. These traversal operations are much slower than feedforward neural network operations. From Table 8, it can be seen that the average speed of generating hash codes based on deep learning methods is more than 9 times less than that of traditional methods.
[0238] Embodiment 2
[0239] This embodiment provides an image-aware hashing system based on an improved bidirectional generative adversarial network;
[0240] Image-aware hashing system based on improved bidirectional generative adversarial network, including:
[0241] An acquisition module is configured to: acquire an image to be processed;
[0242] A preprocessing module is configured to: preprocess the image to be processed;
[0243] A hash code generation module is configured to: input the preprocessed image into the trained improved bidirectional generative adversarial network to obtain a hash code of the image to be processed;
[0244] The improved bidirectional generative adversarial network includes an encoder network, a generator network and a discriminator network; wherein the encoder network and the generator network are both connected to the discriminator network and the encoder network is also connected to the generator network;
[0245] Among them, in the process of training the improved two-way generative adversarial network, the normalized original image is input into the encoder network, and the encoder network generates an initial hash code; the randomly generated noise with the same dimension as the initial hash code is input into the generator network, and the generator network outputs a reconstructed image of the original image; the discriminator network is used to identify the initial hash code and the noise, and at the same time, the reconstructed image and the original image are identified. By training the three networks together, the improved two-way generative adversarial network after training is obtained.
[0246] It should be noted that the acquisition module, preprocessing module and hash code generation module described above correspond to steps S101 to S103 in Embodiment 1, and the examples and application scenarios implemented by the modules and corresponding steps are the same, but are not limited to the contents disclosed in Embodiment 1 described above. It should be noted that the modules described above as part of the system can be executed in a computer system such as a set of computer executable instructions.
[0247] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An image-aware hashing method based on an improved bidirectional generative adversarial network, characterized by: include: Get the image to be processed; Preprocess the image to be processed; Input the preprocessed image into the trained improved bidirectional generative adversarial network to obtain the hash code of the image to be processed; The improved bidirectional generative adversarial network includes an encoder network, a generator network and a discriminator network; wherein the encoder network and the generator network are both connected to the discriminator network and the encoder network is also connected to the generator network; In the process of training the improved bidirectional generative adversarial network, the normalized original image is input into the encoder network, and the encoder network generates an initial hash code; the randomly generated noise with the same dimension as the initial hash code is input into the generator network, and the generator network outputs a reconstructed image of the original image; the discriminator network is used to identify the initial hash code and the noise, and at the same time, the reconstructed image and the original image are identified, and the improved bidirectional generative adversarial network after training is obtained by training the three networks together; The encoder network has the following working principle: the encoder network is used to realize the mapping from the original image to the potential representation; in the training stage, the input value of the encoder network is the normalized training set image, and the output value of the encoder network is the hash code; in the actual application stage, the input value of the encoder network is the normalized image to be processed, and the output value of the encoder network is the hash code; The generator network works as follows: randomly generated noise with the same dimension as the initial hash code and conforming to the normal distribution is input into the generator network, and the generator network outputs a reconstructed image of the original image; The discriminator network works as follows: the discriminator network is used to discriminate between the initial hash code generated by the encoder network and the randomly generated noise, and at the same time, the reconstructed image generated by the generator and the normalized original image are discriminated; The discriminator network is divided into three mapping processes, namely: image mapping, semantic mapping, and joint mapping; image mapping is to perform multi-layer convolution operations on the input original image or reconstructed image. Based on the characteristics of the multi-layer convolutional network, as the network goes deeper, the number of image channels increases, and the image size gradually decreases. Finally, the original input image is compressed into a 1024-bit feature representation; semantic mapping is to extract the original image features after performing multi-layer convolution operations on the input noise or hash code; Joint mapping is to combine the output of image mapping and semantic mapping into one piece of data as input. After multiple layers of convolution operations, sigmoid activation is used to determine the truth or falsehood of the joint representation.
2. The image-aware hashing method based on an improved bidirectional generative adversarial network as claimed in claim 1, characterized in that: The improved bidirectional generative adversarial network obtained by training the three networks together includes: Constructing a training set; the training set is a human face image; Input the training set into the improved bidirectional generative adversarial network to train the network; First, fix the network parameters of the encoder network and the generator network, and optimize the parameters of the discriminator network; when the loss function of the discriminator network reaches a local optimum, suspend the training of the discriminator network; Then fix the parameters of the discriminator network and optimize the parameters of the encoder network and the generator network; when the loss functions of the encoder network and the generator network reach the local optimum, suspend the training of the encoder network and the generator network; Alternate the above two steps until the model converges; Get the improved bidirectional generative adversarial network after training.
3. The image-aware hashing method based on an improved bidirectional generative adversarial network as claimed in claim 1, characterized in that: In the process of training the improved bidirectional generative adversarial network, the loss functions used include: Loss D =-Mean[log(D(x,E(x)))+log(1-D(G(z),z))] (3) Loss E,G =-Mean[log(D(G(z),z))+log(1-D(x,E(x)))] (4) Where x∈X_real,z∈Z_real; E() represents the output of the encoder; G(·) represents the output of the generator; D(·) represents the output of the discriminator network; Mean represents the averaging operation on the batch input; the discriminator network is optimized using formula (3); the lower the value of formula (3), the larger the value of D(x,E(x)) and the smaller the value of D(G(z),z), which means the stronger the discrimination ability; the encoder network and the generator network are optimized using formula (4); the smaller the value of formula (4), the larger the value of D(G(z),z) and the smaller the value of D(x,E(x)), which means the stronger the generation ability.
4. Image-aware hashing system based on improved bidirectional generative adversarial network, characterized by: include: An acquisition module is configured to: acquire an image to be processed; A preprocessing module is configured to: preprocess the image to be processed; A hash code generation module is configured to: input the preprocessed image into the trained improved bidirectional generative adversarial network to obtain a hash code of the image to be processed; The improved bidirectional generative adversarial network includes an encoder network, a generator network and a discriminator network; wherein the encoder network and the generator network are both connected to the discriminator network and the encoder network is also connected to the generator network; In the process of training the improved bidirectional generative adversarial network, the normalized original image is input into the encoder network, and the encoder network generates an initial hash code; the randomly generated noise with the same dimension as the initial hash code is input into the generator network, and the generator network outputs a reconstructed image of the original image; the discriminator network is used to identify the initial hash code and the noise, and at the same time, the reconstructed image and the original image are identified, and the improved bidirectional generative adversarial network after training is obtained by training the three networks together; The encoder network has the following working principle: the encoder network is used to realize the mapping from the original image to the potential representation; in the training stage, the input value of the encoder network is the normalized training set image, and the output value of the encoder network is the hash code; in the actual application stage, the input value of the encoder network is the normalized image to be processed, and the output value of the encoder network is the hash code; The generator network works as follows: randomly generated noise with the same dimension as the initial hash code and conforming to the normal distribution is input into the generator network, and the generator network outputs a reconstructed image of the original image; The discriminator network works as follows: the discriminator network is used to discriminate between the initial hash code generated by the encoder network and the randomly generated noise, and at the same time, the reconstructed image generated by the generator and the normalized original image are discriminated; The discriminator network is divided into three mapping processes, namely: image mapping, semantic mapping, and joint mapping; image mapping is to perform multi-layer convolution operations on the input original image or reconstructed image. Based on the characteristics of the multi-layer convolutional network, as the network goes deeper, the number of image channels increases, and the image size gradually decreases. Finally, the original input image is compressed into a 1024-bit feature representation; semantic mapping is to extract the original image features after performing multi-layer convolution operations on the input noise or hash code; joint mapping is to combine the output of image mapping and semantic mapping into one piece of data as input, and after multi-layer convolution operations, sigmoid activation is used to determine the truth or falsehood of the joint representation.
5. An electronic device, comprising: a memory for non-transitory storage of computer readable instructions; as well as a processor for executing the computer readable instructions, Wherein, when the computer-readable instructions are executed by the processor, the method described in any one of claims 1 to 3 is executed.
6. A storage medium, characterized in that it non-temporarily stores computer-readable instructions, wherein: When the non-transitory computer-readable instructions are executed by a computer, the instructions of the method according to any one of claims 1 to 3 are executed.
