A perceptual hashing-based image local copy detection method

By combining a two-stage detection method of feature point matching and ring partition hashing, the problem of insufficient detection accuracy and efficiency in image local copy detection is solved, and efficient and accurate identification of image local copies is achieved, which is suitable for real-time application scenarios.

CN122391148APending Publication Date: 2026-07-14UNIV OF SHANGHAI FOR SCI & TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
UNIV OF SHANGHAI FOR SCI & TECH
Filing Date
2026-04-20
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing image local copy detection methods are difficult to resist various geometric and signal processing attacks, and their detection accuracy and efficiency are insufficient.

Method used

A two-stage detection method based on perceptual hashing is adopted, which combines feature point matching and circular partition hashing. By using SIFT feature point coarse localization and improved circular hashing fine screening, efficient and accurate identification of local copying of images is achieved.

Benefits of technology

It significantly reduces computational resources and time overhead, achieves efficient and accurate identification of local image copies, improves detection accuracy and robustness, and is suitable for real-time application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122391148A_ABST
    Figure CN122391148A_ABST
Patent Text Reader

Abstract

The application provides a local copy detection method of an image based on a perceptual hash, and relates to the technical fields of computer vision, digital image processing and multimedia security technology, and the method comprises a two-stage detection mechanism: firstly, a SIFT method is used to perform coarse positioning on an input image, and a candidate position of a suspicious image in an original image is determined; then, an improved ring partition hash method is used to perform fine screening in a positioning point neighborhood, a hash distance is calculated, and it is judged whether a local copy is formed or not, and a judgment rule is that: only when the SIFT positioning is successful and the minimum hash distance is smaller than a threshold value, the similar image (the local copy) is judged; otherwise, the dissimilar image is judged. Through the combination of the geometric invariance of the feature point matching and the texture representation capability of the ring hash, the application effectively copes with multiple copy attacks such as scaling, rotation and local modification, and has the characteristics of high robustness, high precision and high efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision, digital image processing and multimedia security technology, and in particular to a method for detecting local copying of images based on perceptual hashing. Background Technology

[0002] With the rapid development of digital multimedia technology and the Internet, digital images have become an important carrier of information dissemination. However, the widespread use of image editing tools has made it exceptionally easy to tamper with, copy, and recreate image content. Among these methods, partial image copying (i.e., copying a portion of an original image and using it in other images or scenes) is one of the main means of infringing on image intellectual property rights and spreading false information. Attackers use methods such as cropping, scaling, rotating, adjusting brightness, and adding noise to partially copy and modify the original image, making traditional detection methods based on pixel comparison or global features difficult to effectively identify.

[0003] Therefore, how to provide an image local copy detection method that can effectively resist various geometric and signal processing attacks and has high detection accuracy and high computational efficiency has become an urgent technical problem to be solved in this field. Summary of the Invention

[0004] The purpose of this invention is to overcome the above-mentioned defects and provide a two-stage detection method that combines feature point matching and ring partition hashing. This method maintains the geometric invariance of the feature point method and has the high efficiency of the hashing method, achieving a good balance between robustness and efficiency.

[0005] To achieve the above objectives, this invention proposes an image local copy detection method based on perceptual hashing, comprising: S1: Preprocess the original image and the suspected image to be detected. The preprocessing includes at least image format unification and grayscale conversion. S2: Use the scale-invariant feature transformation method to extract feature points from the original image and the suspected image respectively, and perform feature matching and geometric transformation estimation on the extracted feature points to determine the candidate location region of the suspected image in the original image; S3: Based on the candidate location region, in the corresponding regions of the suspicious image and the original image, the circular partition hashing method is applied to extract image features, generating their respective first hash feature vectors and second hash feature vectors; S4: Calculate the similarity distance between the first hash feature vector and the second hash feature vector; S5: Based on whether the geometric transformation estimation successfully locates the candidate location region and whether the similarity distance is less than a preset threshold, determine whether the suspicious image constitutes a local copy of the original image and output the judgment result.

[0006] Furthermore, step S2 specifically includes: S2.1: Extract scale-invariant feature transformation feature points from the original image and the suspected image respectively; S2.2: Use the nearest neighbor matching method to match feature points of the two images to obtain initial matching point pairs; S2.3: Apply the random sampling consensus method to filter the initial matching point pairs and estimate the geometric transformation relationship between the two images to obtain the geometric transformation matrix; S2.4: Based on the geometric transformation matrix, calculate the center position coordinates and scaling factor of the suspected image in the original image to determine the candidate location region.

[0007] Furthermore, in step S2.4, the formula for calculating the scaling factor is: ; Where T is the geometric transformation matrix.

[0008] Furthermore, in step S3, the ring partition hashing method specifically includes the following steps: S3.1: The images to be processed are uniformly scaled to a fixed size of m×m pixels; S3.2: Convert the scaled image to the CIE L* color space; S3.3: Divide the image into n concentric ring regions with the image center as the origin; S3.4: For the pixel values ​​in each concentric ring region, extract statistical features including mean, standard deviation, skewness and kurtosis to form a feature vector; S3.5: Standardize the feature vector to generate hash features.

[0009] Furthermore, in step S3.3, the radius r of the k-th concentric annular region k Calculated using the following formula: ; Where n is the total number of partitions in the annular region, k ranges from 1 to n, m is the image size, π is pi, r0=0, r n =m / 2.

[0010] Furthermore, in step S3.4, the statistical characteristics of each concentric annular region are calculated using the following formula: Mean: ; Standard deviation: ; Skewness: ; Kuroshi: ; Among them, L i Let N be the CIE L* value of the i-th pixel within the annular region. k This represents the total number of pixels within the annular region.

[0011] Furthermore, in step S3.5, the hash feature is generated using the following formula: ; Where q(i,j) is the standardized feature vector, and j=1,2,3,4 correspond to the four statistics of mean, standard deviation, skewness and kurtosis, respectively.

[0012] Furthermore, in step S4, the formula for calculating the similarity distance is: ; Among them, h 1,i and h 2,i These are the i-th components of the hash feature vectors of the suspicious image and the original image, respectively.

[0013] Furthermore, in step S5, the similarity judgment rule is as follows: A suspicious image is considered a similar image constituting a local copy if and only if both of the following conditions are met: Condition 1: The geometric transformation estimation successfully locates the candidate location region; Condition 2: The calculated minimum similarity distance is less than a preset threshold; Otherwise, the suspicious image is determined to be a dissimilar image.

[0014] Furthermore, the fixed size m is 512 pixels, and the number n of the concentric annular regions is 40.

[0015] Compared with the prior art, the advantages of the present invention are: This invention employs a two-stage collaborative detection architecture based on the principle of feature point matching and region hashing fusion, utilizing SIFT coarse localization and improved ring hashing for fine screening. The first stage leverages the geometric invariance of SIFT features to solve the image spatial alignment problem before subsequent hash comparison, enabling hash comparison to be performed within a precise local region after geometric correction. The second stage utilizes improved high-order ring partition hashing to achieve high-precision verification of local texture details with minimal computational overhead. These two stages complement each other, significantly reducing the computational resources and time required in complex image processing compared to traditional single detection methods. Furthermore, it allows for real-time, rapid detection and judgment based on input image pairs, achieving efficient and accurate identification of local image copies, simultaneously improving detection accuracy, robustness, and efficiency.

[0016] This invention makes the following targeted improvements to traditional ring hashing: First, it processes the data in the CIE L* color space, which better matches the characteristics of human visual perception, making the hash features more robust to changes in illumination and contrast. Second, it employs a ring partitioning formula based on the square root of the radius, resulting in denser partitioning near the image center and more precisely capturing detailed changes in the main image area. Third, in addition to extracting the mean and standard deviation, it introduces two higher-order statistical features, skewness and kurtosis, which can more comprehensively and accurately describe the shape characteristics of pixel value distribution within the ring region, significantly improving the discriminative power and anti-interference ability of the hash features.

[0017] The method of this invention employs a dual-condition judgment for local copy similarity assessment: it is only determined to be a copy if SIFT location is successful and the hash distance is sufficiently small. This mechanism effectively eliminates false alarms that may be caused by SIFT mismatches or accidental hash collisions, further enhancing the reliability of the detection results.

[0018] In this invention, the computationally intensive SIFT algorithm is used only for a single coarse localization operation, while the subsequent fine-tuning process employs a fast hash algorithm. The overall computational complexity is far lower than pure feature point matching methods and also lower than deep learning methods requiring complex training. This makes it highly suitable for real-time applications, facilitating practical deployment and providing strong technical support for image copyright protection, content moderation, and digital forensics, demonstrating broad prospects for industrial application. Attached Figure Description

[0019] Figure 1 The overall flowchart of the image local copy detection method based on perceptual hashing provided in the embodiments of the present invention is shown.

[0020] Figure 2 This is a representative case image of SIFT feature matching in an embodiment of the present invention (a local area of ​​a dog, scaled and rotated).

[0021] Figure 3 This is a second representative case image of SIFT feature matching in an embodiment of the present invention (a local area of ​​a graduated cylinder, scaled and JPEG compressed).

[0022] Figure 4 This is the third representative case image of SIFT feature matching in the embodiments of the present invention (a local area of ​​the poster, after scaling and adding Gaussian noise). Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present invention will be further described below.

[0024] This embodiment proposes an image local copy detection method based on perceptual hashing, such as... Figure 1 As shown, the method includes the following steps: S1. Image Preprocessing Input the original image and the suspected image, and perform preprocessing operations on the input original image and the suspected image to be detected. The preprocessing operations specifically include: 1) Image format consistency: Check the number of channels and color format of the input image. If the input image is a single-channel grayscale image, convert it to a three-channel RGB format by copying the channels to ensure consistency in subsequent processing.

[0025] 2) Grayscale conversion; converting a three-channel RGB image into a single-channel grayscale image, which is convenient for SIFT feature extraction; 3) Size adjustment: Scale the images to an appropriate size to improve processing efficiency.

[0026] In this embodiment, the original image size is 1024×768 pixels, and the suspected image size is 512×384 pixels. Both images are converted to grayscale, and the longest side is scaled to 800 pixels while maintaining the aspect ratio. The preprocessed original image size is 800×600 pixels, and the suspected image size is also 800×600 pixels. After completing the above operations, the preprocessed original image and suspected image are obtained.

[0027] S2. SIFT feature coarse localization Feature points are extracted from both the original image and the suspected image using the Scale Invariant Feature Transform (SIFT) method. Feature matching and geometric transformation estimation are then performed on the extracted feature points to determine the candidate location region of the suspected image within the original image. The purpose of this step is to leverage the geometric invariance of SIFT feature points to quickly estimate the approximate location and scale variation of the suspected image within the original image, thus defining the search range for subsequent fine-tuning. This step specifically includes: S2.1. SIFT Feature Point Extraction: Extract scale-invariant feature points from the preprocessed original image and the suspected image respectively; for example, the contrast threshold can be set to 0.005 and the edge threshold to 100 to control the number of feature points while ensuring the quality of the feature points; 124 feature points were extracted from the original image and 68 feature points were extracted from the suspected image.

[0028] S2.2. Feature point matching: The feature points of the two images are matched using the nearest neighbor matching method based on Euclidean distance to obtain initial matching point pairs; for example, the matching threshold can be set to 1.0 and the maximum ratio can be 0.7 to obtain 42 pairs of matching points.

[0029] S2.3. Geometric Transformation Estimation: The Random Sampling Consensus (RANSAC) method is applied to filter the initial matching point pairs and estimate the geometric transformation relationship between the two images to obtain the geometric transformation matrix. In this embodiment, it can be assumed that the suspicious image is obtained by transforming a certain region in the original image through similarity transformation (including translation, rotation, and uniform scaling). Therefore, the RANSAC model is set as a similarity transformation model, and the maximum distance threshold is set to 12 pixels to estimate the similarity transformation relationship between the two images. After the RANSAC algorithm iteration is completed, a geometric similarity transformation matrix T and a set of interior points that conform to the transformation model will be output. For example, 38 pairs of interior points can be obtained, with a matching accuracy of 90.5%.

[0030] S2.4. Calculation of Candidate Positions and Scaling Factors Based on the geometric similarity transformation matrix T, the center coordinates and scaling factor of the suspected image in the original image are calculated to determine the candidate location region.

[0031] The scaling factor is calculated using the following formula: ; Where T is the geometric transformation matrix.

[0032] By transforming the center point using the transformation matrix T, the estimated center position of the suspicious image in the original image can be obtained (the center position is obtained by taking the average of the four corner points of the suspicious image after transformation). This position is the candidate center point for coarse localization.

[0033] For example, the similarity transformation matrix T is: T = [0.85, -0.05, 120; 0.05, 0.85, -80; [0, 0, 1]; The scaling factor is calculated as: scale_factor = sqrt(0.85^2 + 0.05^2) = 0.852; The center position is calculated as (320, 240).

[0034] S3. Hash Feature Fine Screening Based on the obtained candidate center locations and scaling factors, the circular partition hashing method is applied to extract image features in the corresponding regions of the suspicious image and the original image, respectively, to generate their respective first hash feature vectors and second hash feature vectors. This step specifically includes: S3.1. Image standardization and size uniformity: The suspicious image is adjusted to a scale similar to the candidate region in the original image based on a scaling factor. Then, the adjusted suspicious image and the corresponding region image block in the original image, centered on the candidate center point and the same size as the adjusted suspicious image, are uniformly scaled to a fixed size of m×m pixels. In this embodiment, m is preferably 512 pixels, meaning the image is uniformly scaled to a size of 512×512.

[0035] S3.2. Color Space Conversion: Convert the scaled image to the CIE L* color space; S3.3. Circular region division: Using the center of the m×m pixel image as the origin, the image is divided into n (in this embodiment, n=40) concentric annular regions; the radius r of the kth (k=1,2,...,n) annular region is... k Calculated using the following formula: ; Where n is the total number of partitions in the annular region; k ranges from 1 to n; m is the image size, with a value of 512; π is pi; r0 = 0; r n =m / 2.

[0036] S3.4. Feature Extraction: For each concentric annular region, calculate the CIE L* value of all pixels falling within that region. Assume there are N pixels within that region. k 1 pixel, pixel value L i (i=1,2,...,N) k The following four statistical features, including mean, standard deviation, skewness, and kurtosis, are calculated and extracted to form a feature vector; Mean: ; Standard deviation: ; Skewness: ; Kuroshi: ; Among them, L i Let N be the CIE L* value of the i-th pixel within the annular region. k This represents the total number of pixels within the annular region.

[0037] Statistical feature calculations are performed on all n annular regions, resulting in a total of n×4=4n feature values. These feature values ​​are then arranged in order to form an initial feature vector.

[0038] S3.5. Hash Feature Generation: The feature vector is standardized, and the hash feature is generated using the following formula.

[0039] ; Where q(i,j) is the standardized feature vector, and j=1,2,3,4 correspond to the four statistics of mean, standard deviation, skewness and kurtosis, respectively.

[0040] For example, a suspicious image is resized to 436×327 pixels using a scaling factor of 0.852, and then scaled to 512×512 pixels. After conversion to the CIE L* color space, it is divided into 40 concentric annular regions. Four statistical features are extracted from each annular region to generate a 40-dimensional hash vector.

[0041] S4. Hash similarity distance calculation: The similarity distance between the first hash feature vector and the second hash feature vector is calculated using the following formula: ; Among them, h 1,i and h 2,i These are the i-th components of the hash feature vectors of the suspicious image and the original image, respectively.

[0042] For example, the best matching position is searched within the neighborhood (radius r=2) around the location (320,240), and the minimum hash distance is calculated. The minimum hash distance d=6.34 is finally obtained at the location (322,239).

[0043] S5. Local Copy Detection and Result Output: The detection results are judged according to the preset judgment rules. The judgment rules are as follows: A suspicious image is considered a similar image constituting a local copy if and only if both of the following conditions are met: Condition 1: The RANSAC algorithm in step S2 successfully estimates the geometric transformation matrix, i.e., SIFT coarse localization is successful. This usually means that the number of matching pairs in the inlier set is greater than a preset threshold (e.g., 10 pairs).

[0044] Condition 2: The minimum hash distance d calculated in step S4 min The hash distance is less than a preset threshold. In this embodiment, the threshold is preferably set to 10.

[0045] If both of the above conditions cannot be met at the same time, the suspicious image is determined to be a dissimilar image, that is, there is no local copy relationship.

[0046] Finally, the system outputs the detection results. If it is determined to be a copy, it can also output the specific coordinate range of the copied area in the original image based on the transformation matrix T and the best matching position.

[0047] For example, based on the judgment rules: SIFT localization was successful, and the minimum hash distance 6.34 < 10, therefore it is judged as a similar image (local copy exists). The system outputs the detection result: Detection conclusion: Local copy exists; Copy region location: Region (104,76) to (539,402) in the original image.

[0048] Example Effect Verification To verify the technical effectiveness of the method in this embodiment, a large number of experimental tests were conducted, and some representative cases are attached. Figures 2 to 4 As shown.

[0049] like Figure 2 As shown, this is a representative case 1 of SIFT feature matching. In this case, the suspicious image is a region of a dog cropped from the original image, which has been scaled by 0.753 times and rotated by 119.8°. Using the method of this embodiment, the copied region is detected at coordinates (184, 105) in the original image, with a region size of 142×142 pixels. SIFT feature matching was successful in the first stage, and 73 pairs of matching inliers were extracted, achieving accurate localization. In the second stage, the minimum hash distance was calculated to be 1.19, which is much less than the threshold of 10. The system correctly judged it as a similar image (local copy).

[0050] like Figure 3 As shown, this is a representative case 2 of SIFT feature matching. In this case, the suspicious image is a cylinder region cropped from the original image, which has been scaled by 0.729 times and subjected to JPEG compression. Using the method of this embodiment, the detected copied region is located at coordinates (36, 174) in the original image, with a region size of 231×164 pixels. SIFT feature matching was successful in the first stage, extracting 82 pairs of matching inliers, achieving accurate localization. At the same time, the minimum hash distance calculated in the second stage is 4.25, which is less than the threshold of 10. This detection result is highly consistent with the actual copied region, and the system correctly judges it as a similar image (local copy).

[0051] like Figure 4 As shown, this is a representative case 3 of SIFT feature matching. In this case, the suspicious image is a poster area cropped from the original image, and then scaled by 1.482 times and subjected to Gaussian noise. Using the method of this embodiment, the detected copy area is located at coordinates (117, 96) in the original image, with a region size of 217×249 pixels. SIFT feature matching was successful in the first stage, extracting 55 pairs of matching inliers. Meanwhile, in the second stage, the minimum hash distance was calculated to be 2.33, which is less than the threshold of 10. The system correctly judged it as a similar image (local copy).

[0052] The experimental results above demonstrate that the method provided by this invention can maintain extremely high detection accuracy when facing various common attacks such as scaling, rotation, compression, and noise addition, fully proving its superior robustness, accuracy, and wide applicability.

[0053] The above are merely preferred embodiments of the present invention and do not constitute any limitation on the present invention. Any equivalent substitutions or modifications made by those skilled in the art to the technical solutions and content disclosed in the present invention without departing from the scope of the present invention shall be deemed to have remained within the protection scope of the present invention.

Claims

1. A method for detecting local copying of images based on perceptual hashing, characterized in that, include: S1: Preprocess the original image and the suspected image to be detected. The preprocessing includes at least image format unification and grayscale conversion. S2: Use the scale-invariant feature transformation method to extract feature points from the original image and the suspected image respectively, and perform feature matching and geometric transformation estimation on the extracted feature points to determine the candidate location region of the suspected image in the original image; S3: Based on the candidate location region, in the corresponding regions of the suspicious image and the original image, the circular partition hashing method is applied to extract image features, generating their respective first hash feature vectors and second hash feature vectors; S4: Calculate the similarity distance between the first hash feature vector and the second hash feature vector; S5: Based on whether the geometric transformation estimation successfully locates the candidate location region and whether the similarity distance is less than a preset threshold, determine whether the suspicious image constitutes a local copy of the original image and output the judgment result.

2. The image local copy detection method based on perceptual hashing according to claim 1, characterized in that, Step S2 specifically includes: S2.1: Extract scale-invariant feature transformation feature points from the original image and the suspected image respectively; S2.2: Use the nearest neighbor matching method to match feature points of the two images to obtain initial matching point pairs; S2.3: Apply the random sampling consensus method to filter the initial matching point pairs and estimate the geometric transformation relationship between the two images to obtain the geometric transformation matrix; S2.4: Based on the geometric transformation matrix, calculate the center position coordinates and scaling factor of the suspected image in the original image to determine the candidate location region.

3. The image local copy detection method based on perceptual hashing according to claim 2, characterized in that, In step S2.4, the scaling factor is calculated using the following formula: ; Where T is the geometric transformation matrix.

4. The image local copy detection method based on perceptual hashing according to claim 1, characterized in that, In step S3, the ring partition hashing method specifically includes the following steps: S3.1: The images to be processed are uniformly scaled to a fixed size of m×m pixels; S3.2: Convert the scaled image to the CIE L* color space; S3.3: Divide the image into n concentric ring regions with the image center as the origin; S3.4: For the pixel values ​​in each concentric ring region, extract statistical features including mean, standard deviation, skewness and kurtosis to form a feature vector; S3.5: Standardize the feature vector to generate hash features.

5. The image local copy detection method based on perceptual hashing according to claim 4, characterized in that, In step S3.3, the radius r of the k-th concentric annular region k Calculated using the following formula: ; Where n is the total number of partitions in the annular region, k ranges from 1 to n, m is the image size, and π is pi.

6. The image local copy detection method based on perceptual hashing according to claim 4, characterized in that, In step S3.4, the statistical characteristics of each concentric annular region are calculated using the following formula: Mean: ; Standard deviation: ; Skewness: ; Kuroshi: ; Among them, L i Let N be the CIE L* value of the i-th pixel within the annular region. k This represents the total number of pixels within the annular region.

7. The image local copy detection method based on perceptual hashing according to claim 4, characterized in that, In step S3.5, the hash feature is generated using the following formula: ; Where q(i,j) is the standardized feature vector, and j=1,2,3,4 correspond to the four statistics of mean, standard deviation, skewness and kurtosis, respectively.

8. The image local copy detection method based on perceptual hashing according to claim 1, characterized in that, In step S4, the formula for calculating the similarity distance is: ; Among them, h 1,i and h 2,i These are the i-th components of the hash feature vectors of the suspicious image and the original image, respectively.

9. The image local copy detection method based on perceptual hashing according to claim 1, characterized in that, In step S5, the similarity judgment rule is as follows: A suspicious image is considered a similar image constituting a local copy if and only if both of the following conditions are met: Condition 1: The geometric transformation estimation successfully locates the candidate location region; Condition 2: The calculated minimum similarity distance is less than a preset threshold; Otherwise, the suspicious image is determined to be a dissimilar image.

10. The image local copy detection method based on perceptual hashing according to claim 4, characterized in that, The fixed size m is 512 pixels, and the number of concentric annular regions n is 40.