Image copy-move forgery detection method based on keypoint filtering
By employing a keypoint-based image copying and moving forgery detection method, and utilizing improved AdaLAM and SIFT algorithms to extract and aggregate key points, the method solves the problem of image copying and moving forgery detection, achieving more efficient forgery region localization and detection.
Patent Information
- Application Number
- CN202310749649.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-25
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2043-06-25
AI Technical Summary
Existing technologies struggle to effectively detect image copying and moving forgery, especially due to the variable location and shape of cloned regions, which makes detection difficult. Furthermore, existing methods exhibit poor generalization across different image styles.
A keypoint-based image copying and moving forgery detection method is adopted. By extracting keypoint features and descriptor information from the original image and magnifying them by one or two times, the improved AdaLAM algorithm is used for matching and filtering. Combined with Gaussian smoothing and SIFT algorithms, the extraction and aggregation of keypoints are enhanced to locate the forged area.
It improves the accuracy and clustering of keypoint filtering, effectively detects image copying and moving forgery areas, reduces noise interference, and improves detection accuracy and recall.
Smart Images

Figure CN116778305B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image detection technology, and in particular relates to a key point filtering method for detecting image copying and moving forgery. Background Technology
[0002] Digital media tampering and information forgery have become a serious problem in modern information systems. The advent of easy-to-use photo editing software has greatly reduced the difficulty of tampering with digital photos. Consequently, various digital image forgery incidents occur frequently, leading to serious doubts about the authenticity of digital images. In daily life, people modify images only with standard and widely accepted modifications, such as cropping, rotating, or leveling. Such image correction techniques are often for aesthetic or entertainment purposes, do not affect the authenticity of the image, and do not fall under the category of image forgery. Therefore, the analysis of forged images involves determining whether the modifications alter the original meaningful content of the image. For example, analysis may reveal that modifications to some key, original pixels or content have deviated from the original meaning of the image. In such cases, image forgery could have potentially serious consequences for daily life. Therefore, image forgery detection, including splicing, retouching, and copy-and-move, has received widespread attention in important digital image application areas. Among these, image copy-and-move forgery is one of the most common and difficult-to-detect image forgery methods. It means that one or more areas are copied and pasted into the same image. Typical motivations for such forgeries include hiding elements in an image or emphasizing a specific object.
[0003] In existing technologies, because cloned regions can be located anywhere or have any shape, searching for all possible image portions of different sizes and locations is computationally difficult. Furthermore, since copied and pasted regions come from the same image, their features (e.g., color and noise) are compatible with that image, making detection by finding feature differences between the forged region and other regions difficult. Image copying-movement forgery is more difficult to detect than other types (e.g., splicing and retouching). Therefore, designing a reliable and effective method for detecting image copying-movement forgery is a challenging task with significant practical implications for image content identification and forensic evidence collection. Summary of the Invention
[0004] The purpose of this invention is to provide an image copying-movement forgery detection method based on key point filtering, so as to enhance the method's ability to extract key points and solve the problem that the existing technology lacks adaptability when filtering key points to determine whether the description meets the conditions, resulting in poor generalization of the method for images of different styles.
[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is an image duplication-movement forgery detection method based on key point filtering, comprising the following steps:
[0006] S1. Extract the original image and the key point features and descriptor information magnified by one or two times;
[0007] S2, Key Point Feature Formatting;
[0008] S3. Key point matching and filtering of the original image;
[0009] S4. Add the filtered result to the key points after magnification by one time and match the filter.
[0010] S5. Add the filtered result to the key points after magnification by 2x and match the filter.
[0011] S6. Integration and deduplication of key point filtering results;
[0012] S7, Image forgery location.
[0013] Furthermore, the specific steps of S1 in extracting the original image and the key point features and descriptor information magnified by one or two times are as follows:
[0014] S11. Image preprocessing: First, Gaussian smoothing is performed on the original image and the images magnified by one time and two times, and the gradient magnitude and direction of each pixel are calculated.
[0015] S12. Keypoint Detection and Descriptor Extraction: Find keypoints with prominent visual features in the original image and images magnified by 1x and 2x, and extract descriptors based on information such as the gradient, direction, and pixel color value of the pixels where the keypoints are located.
[0016] Furthermore, the S2 key point feature formatting is as follows:
[0017] For each keypoint P extracted from the keypoint set KP j Local binary features are extracted to form a 132-dimensional keypoint feature descriptor:
[0018] KP = {P1, P2, P3, ..., P} s} (1)
[0019] P j ={PT j A j ,S j D j} (2)
[0020] Where s is the number of keypoints; j represents the j-th keypoint, j∈{1,2,…,s}; PT jIt is a 1×2 matrix representing the two-dimensional coordinates of the current keypoint; A j S represents the gradient direction near the keypoint and is a 1×1 matrix; j It is a 1×1 matrix representing the importance of the current key point; D j This represents a 1×128 dimensional feature vector.
[0021] Furthermore, the key point matching and filtering of the original S3 image is as follows:
[0022] S31. Copy the keypoint set KP obtained in S2, and then add the current image length to the ordinate to get the keypoint set KP. R Then, the original key point set KP is marked as KP. L ;
[0023] S32. Select a limited number of key points that are highly representative and well-distributed;
[0024] S33. Use the sample adaptive in-threshold to execute a highly parallel random sampling consensus algorithm to verify the local affine consistency in the neighborhood of each key point.
[0025] S34. Output the union of all inner layers of the keypoints, i.e., the keypoint set. and
[0026] Furthermore, the method for selecting key points that are highly representative and well-distributed is as follows:
[0027] For each keypoint in a set, firstly, using a 132-dimensional descriptor as the standard, the distance vector D = {d1, d2, ..., dn} is obtained according to the Euclidean distance. s-1}, where s is the number of keypoints; calculate the ratio M of adjacent distance vectors sequentially. i =d i / d i+1 Where i∈{1,2,…,s-2}, if there exists 1≤i≤s-2 such that M i <τ and M i+1 If ≥τ, where τ represents the threshold and i represents the intermediate parameter, then the point to be detected matches all s feature points, meaning the point to be detected is a key point that is highly representative and well-distributed.
[0028] Furthermore, the S4 filtering result is added to the key points after magnification and then matched for filtering. Specifically, this involves adding the filtered key point set to the set of key points. and The keypoint information is added to the magnified keypoint information, and then the result is subjected to process S32-S34 again to enhance the number and cluster the positions of keypoints during filtering, thereby obtaining the keypoint set. and
[0029] Furthermore, the S5 filtering result is added to the key points after being magnified twice and then matched for filtering, specifically as follows:
[0030] Filtered key point set and The result is added to the keypoint information after being magnified by two times, and then the S32-S34 process is repeated to enhance the number and cluster the positions of keypoints during the re-filtering, thus obtaining the keypoint set. and
[0031] Furthermore, the integration and deduplication of the S6 key point filtering results specifically involves:
[0032] The two point sets obtained by superimposing the two filters and The x-coordinates of all points are changed to the mean of the x-coordinates of the corresponding points. Then, duplicate point coordinates are removed, and the union of the two sets is taken to obtain the final key point set DP.
[0033] DP x ={(X0,Y0),(X1,Y1)…(X M ,Y M )} (3)
[0034] Here, x refers to two key point sets KP R or KP L X and Y represent the x and y coordinates of the point set; M is the number of points in the current point set.
[0035] Furthermore, the S7 image forgery localization specifically involves mapping each point on the keypoint set DP onto the original image. If the total number of keypoints in the filtered DP is less than 10, the current image is determined to be real, and no mark is made on the original image. If the total number is greater than or equal to 10, the keypoint coordinate pixels are filled in to mark the specific image. The more keypoints are marked and the denser the markings are, the greater the probability that the current area will be copied and forged.
[0036] The beneficial effects of this invention are:
[0037] (1) The present invention uses an improved AdaLAM algorithm to match and filter SIFT key points, achieving a better key point filtering effect.
[0038] (2) In terms of process, the present invention performs three operations of amplification and extraction of SIFT key points, matching and filtering through iteration, which not only enriches the number of key points extracted, but also makes the key points more concentrated in the copy-move forgery area.
[0039] (3) Compared with existing methods, the present invention can locate the feature differences between the forged area and other areas by mapping; thereby achieving detection and avoiding detection errors caused by noise and image confusion. Attached Figure Description
[0040] 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, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a structural diagram illustrating a specific implementation of the image duplication-movement forgery detection method based on key point filtering according to the present invention.
[0042] Figure 2 This is a flowchart of the keypoint extraction process based on keypoint filtering;
[0043] Figure 3 This is a flowchart of the keypoint matching and filtering process based on keypoint filtering.
[0044] Figure 4 This is a comparison chart of the effects of different keypoint-based detection methods. Detailed Implementation
[0045] 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.
[0046] Figure 1 This is a structural diagram illustrating a specific implementation of the image duplication-movement forgery detection method based on key point filtering according to the present invention. Figure 1 The diagram illustrates the specific steps of an image duplication-movement forgery detection method based on keypoint filtering according to the present invention, including:
[0047] S1: Extract SIFT keypoint features and descriptor information from the original image, magnified by one or two times:
[0048] Figure 2 This is a flowchart of the keypoint extraction process based on keypoint filtering. As can be seen from the diagram, this invention extracts and combines SIFT keypoint sets from the original image, the image magnified by 1x, and the image magnified by 2x, respectively, thereby obtaining a sufficient number of keypoints.
[0049] SIFT (Scale-Invariant Feature Transform) is an algorithm for image processing. Its main function is to describe and detect features in an image. This algorithm is highly robust, functioning correctly even with image rotation, scaling, and scale changes. Furthermore, SIFT has the ability to detect subtle features in images, making it crucial for visual object detection and image retrieval. The SIFT algorithm's processing flow can be briefly described as follows:
[0050] S11. Image preprocessing: First, Gaussian smooth the image and calculate the gradient copy and direction of each pixel.
[0051] S12. Keypoint Detection: Find keypoints in an image that have prominent visual features, such as edges and corners.
[0052] S13. Feature Description: Based on the gradient, direction, and pixel color value of the pixel where the key point is located, a descriptor is extracted for each key point. This descriptor can represent the statistical information of the pixels around the key point.
[0053] S14. Feature Matching: Match the descriptors of key points in two images to find the best match.
[0054] S2: Key Point Feature Formatting:
[0055] For each keypoint P extracted from the keypoint set KP j Local binary pattern features are extracted to form a 132-dimensional keypoint feature descriptor. Details are shown in formulas (1) and (2):
[0056] KP = {P1, P2, P3, ..., P} s} (1)
[0057] P j ={PT j A j ,S j D j} (2)
[0058] In formula (1), s is the number of keypoints; j represents the j-th keypoint, j∈{1,2,…,s}; in formula (2), PT j It is a 1×2 matrix representing the two-dimensional coordinates of the current keypoint; A j This represents the gradient directions near the keypoints calculated using the SIFT algorithm, and is a 1×1 matrix; S j It is a 1×1 matrix representing the importance of the current key point. Finally, D jIt is a 1×128-dimensional feature vector calculated by the SIFT algorithm.
[0059] S3: Keypoint Matching and Filtering of Original Image:
[0060] like Figure 3 For keypoint matching and input filtering, this invention uses the AdaLAM algorithm. It is an image matching algorithm for finding similar parts between two images. First, it requires two images as input and extracts SIFT keypoint feature information from each image. Then, based on the adjacent compatibility correspondence, it selects a limited number of representative and well-distributed keypoints, i.e., using the G2NN algorithm: for each keypoint in a set, first, using a 132-dimensional descriptor as the standard, it obtains a distance vector D = {d1, d2…d...} based on Euclidean distance. s-1}, where s is the number of key points; then the cyclic nearest neighbor criterion is used for searching, that is, M is calculated sequentially. i =d i / d i+1 Where i∈{1,2,…,s-2}, if there exists 1≤i≤s-2 such that M i <τ and M i+1 If ≥τ, where τ represents the threshold (τ is 0.64 in the AdaLAM algorithm), then the point to be detected matches all s feature points. Next, highly parallel RANSAC is performed using sample adaptive inner thresholds to verify the local affine consistency in the neighborhood of each keypoint. Finally, the union of all inner layers of the keypoint is output, where each keypoint set can provide sufficiently strong quantity support within a specific inner layer threshold.
[0061] In terms of input, this invention copies the previously obtained KP, and then adds the current image length to the ordinate, which is called KP. R The original copy is called KP. L After copying, the actual effect is to input two vertically placed images with identical information into the AdaLAM algorithm; in the information matching stage, for a point in a certain KP set that is located in the copied region... Because the point in another set corresponds to the copied area in the right figure The point descriptor information is identical to that of the current set except for the coordinates, therefore and In the case of copy-and-move forgery detection, points cannot be matched. However, in copy-and-move forgery, points on the forged region are actually the second match from another set. To ensure that points in a copied or forged region of one set correctly match points in a copied or forged region of another set, this invention chooses to match them with the second suitable point, thus achieving the desired matching effect. The remaining steps still follow the AdaLAM process.
[0062] S4. Add the filtered result to the key points after magnification by one time and match the filter:
[0063] First, the filtered keypoint set... and The data is added to the keypoint information after being magnified by a factor of two, and then the result is fed back into the algorithm to enhance the number and cluster the keypoints during filtering, thereby obtaining a point set. and
[0064]
[0065] S5. Add the filtered result to the key points after magnification by 2x and match the filter:
[0066] Filtered key point set and The keypoint information is added to the magnified keypoint information (which has been magnified by two times), and then the result is fed back into the algorithm to enhance the number and cluster the keypoints during the re-filtering process, resulting in a keypoint set. and
[0067] S6. Integration and deduplication of key point filtering results:
[0068] Get only and After obtaining the coordinate information of the two key point sets, the DP is obtained. L and DP R Each of these sets contains points located within the copy-and-move forgery region. Each set of points is represented as follows:
[0069] DP x ={(X0,Y0),(X1,Y1)…(X M ,Y M )} (3)
[0070] Here, x refers to two key point sets KP R or KP R X and Y represent the x-coordinate and y-coordinate of the point set. M is the number of points in the current point set.
[0071] As mentioned earlier, the matching and filtering process in this invention is essentially a matching of points within two images. The points are identical except for their x-coordinates, and since only one set of points is ultimately obtained, this step requires merging the two sets. First, the x-coordinates of all points in both sets are changed to the average of the corresponding x-coordinates. After averaging, some duplicate point coordinates are found, so deduplication is performed by taking the union of the two sets. This results in the final keypoint set DP.
[0072] S7. Image forgery location:
[0073] Mapping each point in the keypoint set DP onto the original image allows us to determine if the current image has been forged and identify forged regions. Specifically, if the total number of keypoints in the filtered DP set is less than 10, the current image is considered genuine, and no marking is made on the original image; otherwise, it is marked on the image by filling in the keypoint coordinates pixels. The more keypoints marked and the denser the markings, the greater the likelihood that the current region has been copied and forged.
[0074] Table 1 presents a comparison of the image-level detection performance of this invention and other methods, including precision, recall, and F1 score. Precision measures the percentage of samples predicted as positive that are actually positive; recall measures the proportion of samples predicted as positive out of all predicted positive samples. These two metrics evaluate the current algorithm's detection capability from two mutually exclusive perspectives, one for the predicted samples and the other for the original samples before prediction. Therefore, it is practically impossible for both metrics to achieve high values simultaneously; they are inversely related. To evaluate the overall performance of the algorithm, this paper uses the F1 score, which, through a harmonic average of precision and recall, can simultaneously consider both precision and recall.
[0075] Table 1 Comparison of image-level detection effects of the present invention and other methods
[0076] method accuracy Recall rate <![CDATA[F1 score]]> BusterNet 0.554 0.453 0.498 HFPM 0.529 0.474 0.500 DOA-GAN 0.585 0.630 0.607 AdaLAM 0.775 0.609 0.682 This invention 0.807 0.640 0.714
[0077] Table 1 shows that BusterNet performs the worst at the image level. DOA-GAN performs similarly on the CASIA-CMFD dataset, with F1 scores of 0.629 and 0.682 respectively. AdaLAM, overall, outperforms the other three methods. The method presented in this invention comprehensively surpasses the others in accuracy, recall, and F1 score.
[0078] In addition, this embodiment also compares the display effects of copying and moving the fake area. Figure 4 This is a comparison chart of the effects of different keypoint-based detection methods. Among them, the SIFT+RANSAC method is the most commonly used keypoint filtering method in engineering. As can be seen, this method not only concentrates the filtered keypoints more on the copy-and-move forgery area, but also effectively filters out some false positives, thus making the detection results clearer.
[0079] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0080] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A method for detecting image duplication and motion forgery based on key point filtering, characterized in that, Includes the following steps: S1. Extract the original image and the key point features and descriptor information magnified by one or two times; S2, Key Point Feature Formatting; S3. Key point matching and filtering of the original image; S4. Add the filtered result to the key points after magnification by one time and match the filter. S5. Add the filtered result to the key points after magnification by 2x and match the filter. S6. Integration and deduplication of key point filtering results; S7. Image forgery location; The key point matching and filtering of the S3 original image are as follows: S31. Copy the key point set obtained from S2. Then add the current image length to the ordinate to obtain the keypoint set. Then, the original key point set Marked as ; S32. Select a limited number of key points that are highly representative and well-distributed; S33. Use the sample adaptive in-threshold to execute a highly parallel random sampling consensus algorithm to verify the local affine consistency in the neighborhood of each key point. S34. Output the union of all inner layers of the keypoints, i.e., the keypoint set. and ; The method for selecting key points that are highly representative and well-distributed is as follows: For each keypoint in a set, firstly, using a 132-dimensional descriptor as the standard, the distance vector is obtained according to the Euclidean distance. in It is the number of key points; calculate the ratio of adjacent distance vectors in turn. ,in If it exists , making ,here Represents the threshold. Indicates intermediate parameters, then the point to be detected and All feature points are matched, meaning that the point to be detected is a key point that is highly representative and well-distributed. The S4 filtering result is added to the key points after magnification and then matched for filtering. Specifically, the filtered key point set is... and Add the keypoint information that has been magnified by one time, and then repeat the S32-S34 process on the result to enhance the number and cluster the keypoints during the re-filtering, thereby obtaining the keypoint set. and ; The S5 filtering result is added to the key points after being magnified twice and then matched for filtering as follows: Filtered key point set and The result is added to the keypoint information after being magnified by two times, and then the S32-S34 process is repeated to enhance the number and cluster the positions of keypoints during the re-filtering, thus obtaining the keypoint set. and .
2. The image duplication-movement forgery detection method based on key point filtering according to claim 1, characterized in that, The specific steps of S1 in extracting the original image and the key point features and descriptor information magnified by one or two times are as follows: S11. Image preprocessing: First, Gaussian smoothing is performed on the original image, the image magnified by one time, and the image magnified by two times, and the gradient magnitude and direction of each pixel are calculated. S12. Keypoint Detection and Descriptor Extraction: Find keypoints with prominent visual features in the original image, images magnified by 1x and 2x, and extract descriptors based on the gradient, direction, and pixel color value information of the pixels where the keypoints are located.
3. The image duplication-movement forgery detection method based on key point filtering according to claim 1, characterized in that, The S2 key point feature formatting is as follows: For extracting the key point set Each key point in Local binary features are extracted to form a 132-dimensional keypoint feature descriptor: in It refers to the number of key points; Indicates the first One key point, It is a 1×2 matrix representing the two-dimensional coordinates of the current key point; It represents the gradient direction near the key point and is a 1×1 matrix; It is a 1×1 matrix representing the importance of the current key point; This represents a 1×128 dimensional feature vector.
4. The image duplication-movement forgery detection method based on key point filtering according to claim 1, characterized in that, The integration and deduplication of the S6 key point filtering results are specifically as follows: The two point sets obtained by superimposing the two filters and The x-coordinates of all points are changed to the mean of the x-coordinates of the corresponding points. Then, duplicate point coordinates are removed, and the union of the two sets is taken to obtain the final set of key points. in, Refers to two key point sets or Represents the x and y coordinates of a point set; It is the number of points in the current point set.
5. The image duplication-movement forgery detection method based on key point filtering according to claim 1, characterized in that, The S7 image forgery localization specifically involves: setting a key point set... Each point on the image is mapped onto the original image, and after filtering... If the total number of key points is less than 10, the current image is determined to be real, and no marking is made on the original image; if the total number is greater than or equal to 10, the key points are marked on the specific image by filling the key point coordinate pixels; the more key points are marked and the denser the markings are, the greater the probability that the current area is copied or forged.