An Image-Aware Hashing Method and System Based on Residual Networks

By adopting a two-stage training method based on residual networks, the problem that existing image-aware hashing algorithms cannot distinguish between original and approximate images is solved. This method achieves robustness and discriminability of images under different noise levels, making it suitable for image copyright authentication.

CN115861661BActive Publication Date: 2026-05-26NANJING UNIV OF INFORMATION SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING UNIV OF INFORMATION SCI & TECH
Filing Date
2022-12-28
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing image-aware hashing algorithms cannot effectively distinguish between the original image and the approximate image, and digital watermarking technology distorts the image.

Method used

A two-stage training method based on residual networks is adopted. In the first stage, a hash sequence is generated and the network is adjusted to increase the distance between the original image and the approximate image. In the second stage, the network is fine-tuned to enhance the discrimination ability. The hash distance is optimized using mean squared error and the sigmoid function.

Benefits of technology

It achieves robustness and discriminability of images under different noise attacks, effectively distinguishing the original image from similar images, and is suitable for image copyright authentication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115861661B_ABST
    Figure CN115861661B_ABST
Patent Text Reader

Abstract

This invention discloses an image-aware hashing method and system based on residual networks, belonging to the field of information security; it includes S1, using a residual network to perform a first-stage training on an image group to obtain a hash sequence; S2, reading the weights after the completion of the first-stage training, using these weights to perform a second-stage training, and applying a loss function L... f2 By adjusting the network to increase the distance between the original image and the approximate image, the network is ultimately able to distinguish between the original image and the approximate image, thus overcoming the shortcomings of existing technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of information security, specifically relating to an image-aware hashing method and system based on residual networks. Background Technology

[0002] With the continuous development of the internet and multimedia technologies, more and more information is presented in the form of images, making image acquisition and dissemination extremely easy. At the same time, image editing tools have become widespread, allowing images to be easily tampered with. Attackers can easily obtain copies of images and modify them, making image piracy very easy. Therefore, image copyright authentication is becoming an increasingly important issue.

[0003] Currently, the most common image authentication technology is digital watermarking. However, a drawback of digital watermarking is that it causes a certain degree of image distortion. Therefore, many researchers are using perceptual hashing technology to achieve image authentication. Perceptual hashing extracts information from the image data itself using a certain algorithm for copyright authentication without affecting the image itself. However, current perceptual hashing algorithms do not take into account the distinction between the original image and approximate images. Summary of the Invention

[0004] To address the shortcomings of existing technologies, the present invention aims to provide an image-aware hashing method and system based on residual networks.

[0005] The objective of this invention can be achieved through the following technical solutions:

[0006] An image-aware hashing method based on residual networks, characterized by the following steps:

[0007] S1, Use a residual network to perform the first stage of training on the image group to obtain a hash sequence;

[0008] S2, read the weights from the end of the first stage of training, use these weights for the second stage of training, and apply the loss function L. f2 The network was adjusted to increase the distance between the original image and the approximate image, ultimately enabling the network to distinguish between the original image and the approximate image.

[0009] Furthermore, each image group comprises one original image, n perceptually similar images, and n perceptually dissimilar images; the perceptually similar images are generated from the original image by performing a process such as... Figure 1 The n noise attacks shown represent images that are perceptibly dissimilar to the original image; the images in the image group are input into our network in chronological order, ultimately generating 2n+1 hash sequences, as follows:

[0010] H(ω),H(ζ1),...,H(ζ n),H(γ1),...,H(γ n ),

[0011] Furthermore, the first stage of training in S1 is as follows:

[0012] S11: First, the image goes through a 7*7 convolutional layer and a max pooling layer; at this point, the key features of the image have been extracted, and some irrelevant details have been discarded.

[0013] S12, Next, the image passes through two small residual blocks, each containing two 3*3 convolutional layers, two BN layers, and two ReLU activation layers;

[0014] S13, then the image passes through 3 residual blocks containing 1*1 convolutional layers, each residual block containing 2 3*3 convolutional layers, 2 BN layers and 2 ReLU activation layers;

[0015] S14, after which the image passes through 3 residual blocks, each residual block containing 2 3*3 convolutional layers, 2 BN layers and 2 ReLU activation layers;

[0016] S15, at the end of the network, uses an average pooling layer to remove redundant information, compress the extracted features, generate a feature, and convert the feature into a column vector. Finally, a linear layer is used to convert the column vector into a perceptual hash sequence.

[0017] Furthermore, to compare the distances between perceptual hashes generated by different images, the mean squared error (MSE) is used as a metric, as shown in the following formula:

[0018]

[0019]

[0020] in, Represents the original image ω and the perceived similarity image ζ i The hash distance between them, H(·) represents the proposed perceptual hash network, and l represents the length of the final generated perceptual hash sequence. Represents Euclidean distance; similarly, Represents the original image ω and the perceived similar image γ i The hash distance between them.

[0021] Furthermore, the loss function for the first stage is as follows:

[0022]

[0023] in, This represents the distance between the original image and perceived similar images. ε represents the distance between the original image and the perceived dissimilar image, ε is a hyperparameter, and S(·) represents the Sigmoid function.

[0024] Furthermore, the formula for the Sigmoid function is as follows:

[0025]

[0026] Furthermore, the network structure for the second stage of training is the same as that for the first stage of training.

[0027] Furthermore, the training for perceiving similar images is the same as in the first stage, while the training for perceiving dissimilar images consists entirely of images that are similar to the original image. Finally, the loss function for the second stage is as follows:

[0028]

[0029] in, This represents the distance between the original image and perceived similar images. λ represents the distance between the original image and the perceived dissimilar image, ε is a hyperparameter, and S(·) represents the Sigmoid function.

[0030] An image-aware hashing system based on residual networks, including

[0031] First-stage training module: The image group is trained using a residual network to obtain a hash sequence;

[0032] The second-stage training module reads the weights from the first-stage training, uses these weights for the second-stage training, and applies the loss function L. f2 The network was adjusted to increase the distance between the original image and the approximate image, ultimately enabling the network to distinguish between the original image and the approximate image.

[0033] A computer storage medium storing a readable program that executes the above method when the program is run.

[0034] The beneficial effects of this invention are:

[0035] 1. This invention proposes a perceptual hashing scheme based on deep residual networks, which has strong perceptual robustness. Under different noise attacks, the distance between the final generated perceptual hash sequence and the perceptual hash of the original image is very close.

[0036] 2. In addition, the perceptual hashing scheme of the present invention also has good distinguishability. Under different threshold settings, the hash distance between perceptually dissimilar images is large, which proves that it has excellent anti-collision capability.

[0037] 3. The perceptual hash of the present invention also has the ability to distinguish between the original image and similar images. Even when similar images are included, it still shows good distinguishability. Therefore, the perceptual hash scheme proposed in this invention can effectively realize image authentication, make up for the shortcomings of the current scheme, and excellently complete the copyright task of images. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 This is a schematic diagram of the network training structure of the present invention;

[0040] Figure 2 This refers to the hash distance between the original image and the image under different noise levels.

[0041] Figure 3 This represents the probability of hash collisions under different thresholds in this invention. Detailed Implementation

[0042] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0043] like Figure 1 As shown, an image-aware hashing method based on residual networks includes the following steps:

[0044] S1, Use a residual network to perform the first stage of training on the image group to obtain a hash sequence;

[0045] Each image group contains one original image, n perceptually similar images, and n perceptually dissimilar images; the perceptually similar images are generated from the original image as follows: Figure 1 The n noise attacks shown are used to generate images that are perceived as dissimilar to the original image. The images in the image group are input into our network in sequence, and will eventually generate 2n+1 hash sequences.

[0046] The specific steps for the first phase of training are as follows:

[0047] S11: First, the image goes through a 7*7 convolutional layer and a max pooling layer; at this point, the key features of the image have been extracted, and some irrelevant details have been discarded.

[0048] S12, Next, the image passes through two small residual blocks, each containing two 3*3 convolutional layers, two BN layers, and two ReLU activation layers;

[0049] S13, then the image passes through 3 residual blocks containing 1*1 convolutional layers, each residual block containing 2 3*3 convolutional layers, 2 BN layers and 2 ReLU activation layers;

[0050] After S14, the image passes through 3 residual blocks. Each residual block contains 2 3*3 convolutional layers, 2 BN layers, and 2 ReLU activation layers. The above 8 residual blocks (8 residual blocks in S12-S14) are used to extract more delicate features of the image, thereby ensuring that the network can learn features that are more conducive to improving the robustness of perceptual hashing.

[0051] S15, at the end of the network, uses an average pooling layer to remove redundant information, compress the extracted features, generate a feature, and convert the feature into a column vector. Finally, a linear layer is used to convert the column vector into a perceptual hash sequence; the generated 2n+1 hash sequences are as follows:

[0052] H(ω),H(ζ1),...,H(ζ n ),H(γ1),...,H(γ n ),

[0053] To compare the distances between perceptual hashes generated by different images, the mean squared error (MSE) is used as a metric, as shown in the following formula:

[0054]

[0055]

[0056] in, Represents the original image ω and the perceived similarity image ζ i The hash distance between them, H(·) represents the proposed perceptual hash network, and l represents the length of the final generated perceptual hash sequence. This represents Euclidean distance. Similarly, Represents the original image ω and the perceived similar image γ i The hash distance between them.

[0057] During network training, the Sigmoid function is used to normalize the values ​​generated by the perceptual hash distance (MSE). This helps to compress the perceptual hash distance to a more uniform scale, ultimately leading to more stable network convergence. The formula for the Sigmoid function is as follows:

[0058]

[0059] The loss function for the first stage is as follows:

[0060]

[0061] in, This represents the distance between the original image and perceived similar images. ε represents the distance between the original image and the perceived dissimilar image, ε is a hyperparameter, and S(·) represents the Sigmoid function.

[0062] During the first phase of training, the loss function L in the first phase is used. f1 By continuously reducing the distance between perceived similar images and the original image, and continuously increasing the distance between perceived dissimilar images and the original image, the proposed perceptual hash algorithm ultimately achieves good perceptual robustness and discriminability.

[0063] S2, read the weights from the end of the first stage of training, use these weights for the second stage of training, and apply the loss function L. f2 Fine-tuning the network to increase the distance between the original image and the approximate image ultimately enables the network to distinguish between the original image and the approximate image.

[0064] After the first stage of training, the network has developed good perceptual robustness and discriminative ability; therefore, the weights from the first stage of training are directly retrieved and used for the second stage of training. In the second stage of training, only the weights of the last linear layer are retained, while the weights of the remaining layers are frozen and do not participate in the second stage of training; the network structure in the second stage is the same as that in the first stage.

[0065] In the second stage of training, the process of perceiving similar images is the same as in the first stage, and the process of perceiving dissimilar images consists entirely of images that are similar to the original image. Finally, the loss function for the second stage is as follows:

[0066]

[0067] in, This represents the distance between the original image and perceived similar images. λ represents the distance between the original image and the perceived dissimilar image, ε is a hyperparameter, and S(·) represents the sigmoid function. The loss function L... f2 By fine-tuning the network to increase the distance between the original image and the approximate image, the network eventually gains the ability to distinguish between the original image and the approximate image.

[0068] like Figure 2 As shown, the perceptual hash distance of 3000 images under different noise attacks was tested, and the perceptual hash distance of the original image was compared with that of the original image. It can be seen that no matter what noise attack, the mean hash distance is less than 0.4.

[0069] like Figure 3 As shown, the probability of hash collisions among 3000 completely different images was tested under different thresholds. The probability of hash collisions is very low when the threshold is 0.4. Therefore, the threshold of this invention is ultimately set to 0.4. That is, when the perceptual hash distance between two images is less than or equal to 0.4, they are perceptually similar; otherwise, they are perceptually dissimilar.

[0070] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0071] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention.

Claims

1. A residual network-based image perceptual hashing method, characterized in that, Includes the following steps: S1, Use a residual network to perform the first stage of training on the image group to obtain a hash sequence; S2, read the weights of the end of the first stage training, use these weights for the second stage training, and pass the second stage loss function Adjust the network, enlarge the distance between the original image and the approximate image, and finally make the network have the ability to distinguish the original image and the approximate image; The first phase of training in S1 is as follows: S11, first image through a 7 7 convolutional layers and a max-pooling layer; at this time, the key features of the image have been extracted, and some insignificant details have been discarded; S12, then the image passes through 2 small residual blocks, each residual block contains 2 3 3 convolutional layers, 2 BN layers and 2 ReLu activation layers; S13, then, the image passes through 3 layers containing 1 The residual blocks of a convolutional layer contain two 3-bit cells. It has 3 convolutional layers, 2 batch normalization (BN) layers, and 2 ReLU activation layers; S14, after which the image passes through 3 residual blocks, each residual block containing 2 3 It has 3 convolutional layers, 2 batch normalization (BN) layers, and 2 ReLU activation layers; S15, at the end of the network, uses an average pooling layer to remove redundant information, compress the extracted features, generate a feature, and convert the feature into a column vector. Finally, a linear layer is used to convert the column vector into a perceptual hash sequence. The network structure for the second stage of training is the same as that for the first stage of training. The loss function for the first stage is as follows: in, This represents the distance between the original image and perceived similar images. This represents the distance between the original image and the perceived dissimilar image. It's a hyperparameter. Represents the Sigmoid function; The process of perceiving similar images is the same as in the first stage of training. The process of perceiving dissimilar images consists entirely of images that are similar to the original image. Finally, the loss function for the second stage is as follows: in, It is a hyperparameter, where n is the number of similar images perceived and the number of dissimilar images perceived.

2. The image perceptual hashing method based on residual networks according to claim 1, characterized in that, Each image group contains one original image, n perceptually similar images, and n perceptually dissimilar images. The perceptually similar images are generated by applying n different noise attacks to the original image, while the perceptually dissimilar images are completely unrelated to the original image. The images in the image group are input into our network in sequential order, ultimately generating 2n+1 hash sequences, as follows: 。 3. The image perceptual hashing method based on residual networks according to claim 2, characterized in that, To compare the distances between perceptual hashes generated by different images, the mean squared error (MSE) is used as a metric, as shown in the following formula: in, Original image and perceiving similar images The hash distance between them Represents the proposed perceptual hashing network, This represents the length of the final generated perceptual hash sequence. Represents Euclidean distance; similarly, Original image and perceiving similar images The hash distance between them.

4. The image perceptual hashing method based on residual networks according to claim 3, characterized in that, The formula for the Sigmoid function is as follows: 。 5. An image-aware hashing system based on residual networks, comprising the method described in any one of claims 1-4, characterized in that, include First-stage training module: The image group is trained using a residual network to obtain a hash sequence; The second-stage training module reads the weights from the first-stage training, uses these weights for the second-stage training, and applies a loss function. The network was adjusted to increase the distance between the original image and the approximate image, ultimately enabling the network to distinguish between the original image and the approximate image.

6. A computer storage medium storing a readable program, characterized in that, When the program runs, it executes the method described in any one of claims 1-4.