A tamper detection method, device, equipment, storage medium and product
By acquiring the visual and frequency characteristics of the image, performing multi-scale feature fusion and wavelet transformation, and generating multiple frequency component features, the problem of low image tamper detection accuracy in the prior art is solved, and higher detection accuracy and reliability are achieved .
Patent Information
- Application Number
- CN202411069959.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-08-06
AI Technical Summary
In the prior art, in image tamper detection, the detection accuracy is low, which affects the authenticity and reliability of the image.
By obtaining the visual characteristics and frequency characteristics of the image to be detected, combining multi-scale color and frequency information, enhancing feature fusion and wavelet transformation technology are used to generate component features of multiple frequencies, perform feature enhancement processing, and finally use the splitting head to perform pixel level tamper detection.
It improves the accuracy of image tamper detection, can more accurately identify subtle tamper traces of images, and enhances the reliability of detection results.
Smart Images

Figure CN118587462B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a tampering detection method, a tampering detection device, a computer device, a computer-readable storage medium, and a tampering detection product. Background Art
[0002] With the advancement of scientific and technological research, more and more data is transferred from offline to online. With the widespread use of online data (such as digital documents, document images, etc.) in daily life and business activities, the risk of online data being tampered with is increasing, which poses a serious threat to the authenticity of online data. Studies have found that when detecting image tampering, the accuracy of image tampering detection results is low due to factors such as detection methods and detection accuracy. Summary of the invention
[0003] The embodiments of the present application provide a tampering detection method, apparatus, device, computer-readable storage medium and product, which can improve the accuracy of image tampering detection results.
[0004] On the one hand, an embodiment of the present application provides a tampering detection method, including:
[0005] Acquire visual features and frequency features of the image to be detected, where the visual features include color features of the image to be detected at a first scale and color features of the image to be detected at a second scale;
[0006] Based on the visual features and the frequency features, a feature set of the image to be detected is obtained, the feature set includes the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at N scales, the enhanced features of the image to be detected at any scale are obtained based on the color features and the frequency features of the image to be detected at the second scale, and N is a positive integer;
[0007] Based on the feature set, tampering detection is performed on the image to be detected to obtain a tampering detection result of the image to be detected.
[0008] On the one hand, an embodiment of the present application provides a tampering detection device, the tampering detection device comprising:
[0009] An acquisition unit, used to acquire visual features and frequency features of the image to be detected, wherein the visual features include color features of the image to be detected at a first scale and color features of the image to be detected at a second scale;
[0010] A processing unit, used for obtaining a feature set of the image to be detected based on visual features and frequency features, wherein the feature set includes color features of the image to be detected at a first scale and enhanced features of the image to be detected at N scales, wherein the enhanced features of the image to be detected at any scale are obtained based on the color features and frequency features of the image to be detected at a second scale, and N is a positive integer;
[0011] And it is used to perform tampering detection on the image to be detected based on the feature set to obtain the tampering detection result of the image to be detected.
[0012] In one embodiment, the processing unit is used to obtain a feature set of the image to be detected based on the visual features and the frequency features, specifically for:
[0013] The color feature and the frequency feature of the image to be detected at the second scale are fused to obtain an enhanced frequency feature;
[0014] The color feature of the image to be detected at the second scale is combined with the enhanced frequency feature to obtain the enhanced feature of the image to be detected at the second scale;
[0015] Based on the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at the second scale, a feature set of the image to be detected is obtained.
[0016] In one embodiment, the processing unit is further configured to:
[0017] M encoders are used to iteratively encode the enhanced features of the image to be detected at the second scale to obtain enhanced features of the image to be detected at M scales, where M is a positive integer;
[0018] The processing unit is used to obtain a feature set of the image to be detected based on the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at the second scale, specifically for:
[0019] The color features of the image to be detected at the first scale, the enhanced features of the image to be detected at the second scale, and the enhanced features of the image to be detected at M scales are added to the set to obtain a feature set of the image to be detected.
[0020] In one implementation, the processing unit is used to fuse the color feature and the frequency feature of the image to be detected at the second scale to obtain an enhanced frequency feature, specifically for:
[0021] The color features and frequency features of the image to be detected at the second scale are processed by a spatial attention mechanism to obtain a first processing result;
[0022] The color features and frequency features of the image to be detected at the second scale are processed by a channel attention mechanism to obtain a second processing result;
[0023] A convolution module is used to process the superposition result of the first processing result and the second processing result to obtain an enhanced frequency feature.
[0024] In one implementation, the processing unit is used to combine the color feature of the image to be detected at the second scale with the enhanced frequency feature to obtain the enhanced feature of the image to be detected at the second scale, specifically for:
[0025] The enhanced frequency feature is convolved through the target convolution layer to obtain the convolution result of the enhanced frequency feature;
[0026] The convolution result of the enhanced frequency feature is element-wise added to the color feature of the image to be detected at the second scale to obtain the enhanced feature of the image to be detected at the second scale.
[0027] In one embodiment, the processing unit is further configured to:
[0028] Decompose the features in the feature set into component features of multiple frequencies;
[0029] The features in the feature set are enhanced using component features of multiple frequencies to obtain an updated feature set.
[0030] In one embodiment, the processing unit is used to decompose the features in the feature set into component features of multiple frequencies, specifically to:
[0031] The color features of the image to be detected at the first scale and the enhanced features of the image to be detected at N scales are respectively subjected to wavelet transformation to obtain N+1 high-frequency component features and N+1 low-frequency component features;
[0032] The adaptive attention module is used to perform feature enhancement processing on N+1 high-frequency component features and N+1 low-frequency component features, respectively, to obtain N+1 enhanced high-frequency component features and N+1 enhanced low-frequency component features.
[0033] In one embodiment, the processing unit performs wavelet transform on the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at N scales to obtain N+1 high-frequency component features and N+1 low-frequency component features, including:
[0034] Performing a convolution operation on the color features of the image to be detected at the first scale through the first matrix and the second matrix respectively, to obtain a high-frequency convolution and a low-frequency convolution of the image to be detected at the first scale;
[0035] The high-frequency convolution and low-frequency convolution of the image to be detected at the first scale are down-sampled respectively to obtain the first high-frequency component feature and the first low-frequency component feature;
[0036] Performing convolution operations on the enhanced features of the image to be detected at the i+1th scale through the first matrix and the second matrix respectively, to obtain high-frequency convolution and low-frequency convolution of the image to be detected at the i+1th scale, where i is a positive integer less than or equal to N;
[0037] The high-frequency convolution and low-frequency convolution of the image to be detected at the i+1th scale are down-sampled respectively to obtain the i+1th high-frequency component feature and the i+1th low-frequency component feature.
[0038] In one embodiment, the adaptive attention module includes a convolution submodule, a spatial attention layer, and a channel attention layer; the processing unit performs feature enhancement processing on N+1 high-frequency component features and N+1 low-frequency component features through the adaptive attention module, and the process of obtaining N+1 enhanced high-frequency component features and N+1 enhanced low-frequency component features includes:
[0039] The convolution submodule is used to process the j-th high-frequency component feature and the j-th low-frequency component feature, respectively, to obtain the processing result of the j-th high-frequency component feature and the processing result of the j-th low-frequency component feature, where j is a positive integer less than or equal to N+1;
[0040] The processing results of the j-th high-frequency component feature and the j-th low-frequency component feature are processed by the channel attention layer, and the channel dimension enhancement processing is performed respectively to obtain the j-th high-frequency intermediate parameter and the j-th low-frequency intermediate parameter;
[0041] The j-th high-frequency intermediate parameter and the j-th low-frequency intermediate parameter are spatially enhanced through the spatial attention layer to obtain the j-th enhanced high-frequency component feature and the j-th enhanced low-frequency component feature.
[0042] In one embodiment, the component features of multiple frequencies include N+1 enhanced high-frequency component features and N+1 enhanced low-frequency component features; the processing unit uses the component features of multiple frequencies to enhance the features in the feature set, and the process of obtaining the updated feature set includes:
[0043] Aggregate N+1 enhanced high-frequency component features to obtain a high-frequency enhanced feature map, and aggregate N+1 enhanced low-frequency component features to obtain a low-frequency enhanced feature map;
[0044] The high-frequency enhanced feature map is fused with the color feature of the image to be detected at the first scale through a convolution layer to obtain a first fusion result;
[0045] The convolutional layer fuses the low-frequency enhanced feature map and the enhanced features of the image to be detected at the Nth scale to obtain a second fusion result.
[0046] In one implementation, the process by which the processing unit aggregates N + 1 enhanced high-frequency component features to obtain a high-frequency enhanced feature map includes:
[0047] The feature aggregation sub-module aggregates the kth input data and the (N - k + 1)th enhanced high-frequency component feature to obtain the kth aggregation result;
[0048] where k is a positive integer less than or equal to N; when k = 1, the kth input data is the (N + 1)th enhanced high-frequency component feature; when 1 < k < N + 1, the kth input data is the (k - 1)th aggregation result.
[0049] In one implementation, the feature aggregation sub-module includes a window-based linear model; the processing unit is configured to aggregate the kth input data and the (N - k + 1)th enhanced high-frequency component feature through the feature aggregation sub-module to obtain the kth aggregation result, specifically:
[0050] Align the kth input data with the downsampling result through the window-based linear model to obtain an alignment result; the downsampling result is obtained by downsampling the (N - k + 1)th enhanced high-frequency component feature;
[0051] Optimize the translation parameter and the scaling parameter based on the alignment result to obtain an optimized translation parameter and an optimized scaling parameter;
[0052] Calculate the Hadamard product of the (N - k + 1)th enhanced high-frequency component feature and the first upsampling result to obtain an intermediate calculation result; the first upsampling result is obtained by upsampling the optimized scaling parameter;
[0053] Add the intermediate calculation result and the second upsampling result element-wise to obtain the kth aggregation result; the second upsampling result is obtained by upsampling the optimized translation parameter.
[0054] In one implementation, the processing unit is configured to perform forgery detection on the image to be detected based on a feature set to obtain a forgery detection result of the image to be detected, specifically:
[0055] Use a segmentation head to perform classification prediction on the feature set to obtain a forgery detection result of the image to be detected;
[0056] where the forgery detection result includes the forgery detection result of each pixel point in the image to be detected.
[0057] In one embodiment, the processing unit is used to obtain visual features and frequency features of the image to be detected, specifically for:
[0058] The first encoder is used to encode the image to be detected to obtain the color feature of the image to be detected at a first scale;
[0059] Using a second encoder to encode the color features of the image to be detected at the first scale to obtain the color features of the image to be detected at the second scale;
[0060] The color features of the image to be detected at the first scale and the color features of the image to be detected at the second scale are used as visual features of the image to be detected;
[0061] Performing discrete cosine transform on the image to be detected through the brightness channel to obtain a discrete cosine transform result of the image to be detected;
[0062] The discrete cosine transform result of the image to be detected is quantized based on the quantization table to obtain the frequency characteristics of the image to be detected.
[0063] Accordingly, the present application provides a computer device, the computer device comprising:
[0064] a memory, wherein a computer program is stored in the memory;
[0065] The processor is used to load a computer program to implement the above tampering detection method.
[0066] Accordingly, the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for being loaded by a processor and executing the above-mentioned tampering detection method.
[0067] Accordingly, the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned tampering detection method.
[0068] In the embodiment of the present application, the visual features and frequency features of the image to be detected are obtained, and based on the visual features and frequency features, a feature set of the image to be detected is obtained, the feature set includes enhanced features of the image to be detected at at least one scale, and the enhanced features are obtained based on the color features contained in the frequency features and visual features, and tampering detection is performed on the image to be detected based on the feature set to obtain a tampering detection result of the image to be detected. It can be seen that by enhancing the color features of the image to be detected through the frequency features of the image to be detected, the detailed features of the image to be detected can be amplified, thereby improving the accuracy of the image tampering detection result. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0070] Figure 1 A tamper detection scene diagram provided in an embodiment of the present application;
[0071] Figure 2 A flowchart of a tampering detection method provided in an embodiment of the present application;
[0072] Figure 3 A flowchart of another tampering detection method provided in an embodiment of the present application;
[0073] Figure 4 A wavelet-like frequency enhancement architecture diagram provided in an embodiment of the present application;
[0074] Figure 5 A tamper detection architecture diagram provided for an embodiment of the present application;
[0075] Figure 6 A schematic diagram of the structure of a tamper detection device provided in an embodiment of the present application;
[0076] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0077] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0078] The embodiment of the present application provides a tampering detection solution, which can improve the accuracy of image tampering detection results. Figure 1 A tamper detection scene diagram provided in an embodiment of the present application, such as Figure 1 As shown, the tampering detection scenario provided by the present application includes a terminal device 101 and a server 102. The tampering detection solution provided by the present application can be executed by the terminal device 101 or the server 102; when the tampering detection solutions provided by the present application are all executed by the terminal device 101, the server 102 may not be included in the tampering detection scenario. Among them, the terminal device may include but is not limited to: smart phones (such as Android phones, IOS phones, etc.), tablet computers, portable personal computers, mobile Internet devices (Mobile Internet Devices, referred to as MID), intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, wearable devices, etc., and the present application embodiment does not limit this; the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms, and the present application embodiment does not limit this.
[0079] It should be noted that Figure 1 The number of computer devices is only used as an example and does not constitute an actual limitation of the present application. The terminal device 101 and the server 102 may be connected via a wired or wireless connection, and the present application does not impose any limitation on this.
[0080] The general process of the tampering detection solution provided by this application is as follows:
[0081] (1) The server 102 obtains the image to be detected sent by the terminal device 101. On the one hand, the server 102 extracts visual features of the image to be detected through the visual perception head to obtain the visual features of the image to be detected; the visual features include the color (RGB) features of the image to be detected at a first scale and the color features of the image to be detected at a second scale, and the first scale and the second scale are different. On the other hand, the server 102 extracts frequency features of the image to be detected through the frequency perception head to obtain the frequency features of the image to be detected.
[0082] (2) The server 102 obtains a feature set of the image to be detected based on the visual features and the frequency features; wherein the feature set includes the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at N scales, and the enhanced features of the image to be detected at any scale are obtained based on the color features and the frequency features of the image to be detected at the second scale. In one embodiment, the server 102 first fuses the color features of the image to be detected at the second scale and the frequency features of the image to be detected to obtain the enhanced frequency features. Then, the color features of the image to be detected at the second scale are merged with the enhanced frequency features to obtain the enhanced features of the image to be detected at the second scale. After obtaining the enhanced features of the image to be detected at the second scale, the server 102 obtains a feature set of the image to be detected based on the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at the second scale. In another embodiment, after obtaining the enhanced features of the image to be detected at the second scale, the server 102 may also use M encoders to iteratively encode the enhanced features of the image to be detected at the second scale (such as downsampling) to obtain the enhanced features of the image to be detected at M scales, where M is a positive integer. Then the server 102 can add the color features of the image to be detected at the first scale, the enhanced features of the image to be detected at the second scale, and the enhanced features of the image to be detected at M scales to a set to obtain a feature set of the image to be detected; wherein the M scales are different from the first scale and the second scale, and the M scales are different from each other.
[0083] (3) The server 102 performs tampering detection on the image to be detected based on the feature set to obtain a tampering detection result of the image to be detected. In one embodiment, the server 102 may call a trained model or network (such as a feature pyramid network) to perform classification prediction on the feature set through a (segmentation head) to obtain a tampering detection result of the image to be detected; wherein the tampering detection result includes a tampering detection result of each pixel in the image to be detected, and the tampering detection result of any pixel is used to indicate whether the pixel has been tampered with.
[0084] In another embodiment, the server 102 performs detail enhancement processing on the feature set to obtain an updated feature set. Detail enhancement processing is used to amplify the high-frequency details and low-frequency details of the image to be detected; for example, the high-frequency details and low-frequency details of the image to be detected can be amplified by increasing the weights of the high-frequency details and the low-frequency details; for another example, the updated feature set is obtained by performing wavelet-like frequency enhancement processing on the feature set. In one embodiment, the server 102 decomposes the features in the feature set into component features of multiple frequencies; wherein features of different frequencies are used to reflect different image information; for example, high-frequency component features are used to reflect details in the image (such as texture, edges, etc.), and low-frequency component features are used to reflect contours in the image (such as the approximate shape of the target object, color distribution, etc.). After obtaining component features of multiple frequencies, the server 102 uses the component features of multiple frequencies to enhance the features in the feature set to obtain an updated feature set. Further, based on the updated feature set, the server 102 performs tampering detection on the image to be detected to obtain a tampering detection result of the image to be detected.
[0085] In the embodiment of the present application, the visual features and frequency features of the image to be detected are obtained, and based on the visual features and frequency features, a feature set of the image to be detected is obtained, the feature set includes enhanced features of the image to be detected at at least one scale, and the enhanced features are obtained based on the color features contained in the frequency features and visual features, and tampering detection is performed on the image to be detected based on the feature set to obtain a tampering detection result of the image to be detected. It can be seen that by enhancing the color features of the image to be detected through the frequency features of the image to be detected, the detailed features of the image to be detected can be amplified, thereby improving the accuracy of the image tampering detection result.
[0086] Based on the above tampering detection scheme, the embodiment of the present application proposes a more detailed tampering detection method, which will be described in detail below in conjunction with the accompanying drawings.
[0087] See also Figure 2 , Figure 2 A flowchart of a tampering detection method provided in an embodiment of the present application, the tampering detection method can be executed by a computer device; for example, Figure 1 The terminal device 101 or the server 102 shown in FIG. Figure 2 As shown, the tampering detection method may include the following steps S201-S203:
[0088] S201, obtaining visual features and frequency features of an image to be detected.
[0089] The image to be detected can be an independent image, such as a drawn image, an image generated based on at least one of a table, a document, a picture, and text, a cropped image, etc.; the image to be detected can also be an image in a video, which is not limited in this application. The visual features are obtained by extracting the visual features of the image to be detected by a visual perception head, and the visual features include the color features of the image to be detected at a first scale and the color features of the image to be detected at a second scale, and the first scale and the second scale are different. The frequency features are obtained by extracting the frequency features of the image to be detected by a frequency perception head.
[0090] In one embodiment, the visual perception head includes a first encoder and a second encoder; the frequency perception head includes a brightness channel and a quantization table. On the one hand, the computer device uses the first encoder to encode the image to be detected to obtain the color features of the image to be detected at the first scale. Then, the second encoder is used to encode the color features of the image to be detected at the first scale (such as downsampling) to obtain the color features of the image to be detected at the second scale, and the color features of the image to be detected at the first scale and the color features of the image to be detected at the second scale are used as the visual features of the image to be detected. On the other hand, the computer device performs a discrete cosine transform on the image to be detected through the brightness channel to obtain a discrete cosine transform result of the image to be detected. Then, the discrete cosine transform result of the image to be detected is quantized based on the quantization table to obtain the frequency features of the image to be detected.
[0091] S202: Obtain a feature set of the image to be detected based on visual features and frequency features.
[0092] The feature set includes the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at the N scales. The enhanced features of the image to be detected at any scale are obtained based on the color features and frequency features of the image to be detected at the second scale. For example, the color features of the image to be detected at the second scale are enhanced by the frequency features to obtain the enhanced features of the image to be detected at the second scale. The enhanced features of the image to be detected at the second scale are further upsampled or downsampled to obtain the enhanced features of the image to be detected at other scales except the second scale. Feature enhancement can be understood as selectively fusing the frequency feature part into the color feature according to the detection requirements; for example, the high-frequency component features and low-frequency component features in the feature frequency are fused into the color feature to obtain the enhanced features of the detection image. By fusing the frequency feature part into the color feature, the accuracy of the tampering detection result of the image to be detected can be improved (by improving the recognition ability of subtle tampering), while ensuring that the integrity of the tampering detection based on the color feature is not damaged.
[0093] In one embodiment, the visual features include color features of the image to be detected at a first scale and color features of the image to be detected at a second scale. The computer device first fuses the color features of the image to be detected at the second scale and the frequency features of the image to be detected to obtain enhanced frequency features. Then, the color features of the image to be detected at the second scale are merged with the enhanced frequency features to obtain enhanced features of the image to be detected at the second scale. After obtaining the enhanced features of the image to be detected at the second scale, the computer device can obtain a feature set of the image to be detected based on the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at the second scale; for example, the computer device adds the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at the second scale to the same set to obtain a feature set of the image to be detected.
[0094] In another embodiment, after obtaining the enhanced features of the image to be detected at the second scale, the computer device may use M encoders to iteratively encode the enhanced features of the image to be detected at the second scale (such as downsampling) to obtain the enhanced features of the image to be detected at M scales, where M is a positive integer. Then the computer device may add the color features of the image to be detected at the first scale, the enhanced features of the image to be detected at the second scale, and the enhanced features of the image to be detected at M scales to the same set to obtain a feature set of the image to be detected; wherein the M scales are different from the first scale and the second scale, and the M scales are different from each other.
[0095] In another embodiment, the visual features include color features of the image to be detected at P scales, where P is an integer greater than 2. The computer device first fuses the color features of the image to be detected at the P scale and the frequency features of the image to be detected to obtain enhanced frequency features. Then, the color features of the image to be detected at the P scale are merged with the enhanced frequency features to obtain enhanced features of the image to be detected at the P scale. After obtaining the enhanced features of the image to be detected at the P scale, the computer device can use M encoders to iteratively encode the enhanced features of the image to be detected at the P scale (such as sampling), and obtain enhanced features of the image to be detected at M scales, where M is a positive integer. Then the computer device can add the color features of the image to be detected at P-1 scales, the enhanced features of the image to be detected at the P scale, and the enhanced features of the image to be detected at the M scale to a set to obtain a feature set of the image to be detected; wherein the M scales are different from the P scales.
[0096] S203 : Based on the feature set, perform tampering detection on the image to be detected to obtain a tampering detection result of the image to be detected.
[0097] The tampering detection result of the image to be detected is used to indicate whether the image to be detected has been tampered with. When the tampering detection result of the image to be detected indicates that the image to be detected has been tampered with, it may also include tampering indication information, and the tampering indication information is used to indicate the tampered pixels in the image to be detected.
[0098] In one embodiment, a computer device uses a segmentation head to classify and predict a feature set to obtain a tampering detection result of the image to be detected; wherein the tampering detection result includes a tampering detection result of each pixel in the image to be detected, and the tampering detection result of any pixel is used to indicate whether the pixel has been tampered with. The segmentation head may include a trained classification model or network (such as a feature pyramid network), which may be dynamically adjusted according to the detection requirements, and this application does not impose any restrictions on this.
[0099] In another embodiment, the computer device performs detail enhancement processing on the feature set to obtain an updated feature set. In one embodiment, the computer device decomposes the features in the feature set into component features of multiple frequencies; wherein features of different frequencies are used to reflect different image information; for example, high-frequency component features are used to reflect details in the image (such as texture, edges, etc.), and low-frequency component features are used to reflect contours in the image (such as the general shape of the target object, color distribution, etc.). The computer device can then use the component features of multiple frequencies to enhance the features in the feature set to obtain an updated feature set.
[0100] Furthermore, the computer device uses the segmentation head to classify and predict the updated feature set to obtain the tampering detection result of the image to be detected. In one embodiment, the computer device uses the segmentation head to classify and predict the updated feature set to obtain the tampering detection result of the image to be detected, which can be expressed as:
[0101]
[0102] in, is the tampering detection result (segmentation map) of the image to be detected, is the updated feature set, It is obtained by fusing the low-frequency enhanced feature map with the color features of the image to be detected at the first scale. It is obtained by fusing the high-frequency enhanced feature map with the enhanced features of the image to be detected at the N+1th (N=3) scale. and They are the enhanced features of the image to be detected at the second scale and the enhanced features of the image to be detected at the third scale. SegHead(y) indicates the use of the segmentation head to perform classification prediction on y.
[0103] Optionally, after obtaining the tampering detection result for each pixel, the computer device can generate a reliability detection result of the image to be detected based on the judgment conditions (such as the threshold of the number of tampered pixels, the threshold of the proportion of tampered pixels, etc.) and the tampering detection result. The reliability detection result is used to indicate whether the content of the image to be detected is reliable.
[0104] In the embodiment of the present application, the visual features and frequency features of the image to be detected are obtained, and based on the visual features and frequency features, a feature set of the image to be detected is obtained, the feature set includes enhanced features of the image to be detected at at least one scale, and the enhanced features are obtained based on the color features contained in the frequency features and visual features, and tampering detection is performed on the image to be detected based on the feature set to obtain a tampering detection result of the image to be detected. It can be seen that by enhancing the color features of the image to be detected through the frequency features of the image to be detected, the detailed features of the image to be detected can be amplified, thereby improving the accuracy of the image tampering detection result.
[0105] See also Figure 3 , Figure 3 A flowchart of another tampering detection method provided in an embodiment of the present application, the tampering detection method can be executed by a computer device; for example, Figure 1 The terminal device 101 or the server 102 shown in FIG. Figure 3 As shown, the tampering detection method may include the following steps S301-S309:
[0106] S301, obtaining visual features and frequency features of an image to be detected.
[0107] The specific implementation of step S301 can be found in Figure 2 The implementation of step S201 will not be repeated here.
[0108] S302 , fusing the color features and frequency features of the image to be detected at the second scale to obtain enhanced frequency features.
[0109] In one embodiment, the visual features include color features of the image to be detected at a first scale and color features of the image to be detected at a second scale, and the second scale is smaller than the first scale, specifically, the width of the second scale is smaller than the width of the first scale, and the height of the second scale is less than or equal to the height of the first scale; or, the width of the second scale is less than or equal to the width of the first scale, and the height of the second scale is less than the height of the first scale. On the one hand, the computer device processes the color features and frequency features of the image to be detected at the second scale through a spatial attention mechanism to obtain a first processing result. On the other hand, the computer device processes the color features and frequency features of the image to be detected at the second scale through a channel attention mechanism to obtain a second processing result. After obtaining the first processing result and the second processing result, the computer device uses a convolution module to process the superposition result of the first processing result and the second processing result to obtain an enhanced frequency feature. In one embodiment, the convolution module includes 1 1 convolution, batch normalization layer, and activation function (such as ReLU activation function).
[0110] The computer device fuses the color features and frequency features of the image to be detected at the second scale to obtain enhanced frequency features, which can be specifically expressed as:
[0111]
[0112] in, To enhance the frequency characteristics, is the color feature of the image to be detected at the second scale, is the frequency characteristic, is the first processing result, is the second processing result, and ConvBlock (A +B) indicates that the superposition result of A and B is processed by using a convolution module.
[0113] S303: Merge the color feature of the image to be detected at the second scale with the enhanced frequency feature to obtain the enhanced feature of the image to be detected at the second scale.
[0114] In one embodiment, the computer device performs a convolution operation on the enhanced frequency feature through a target convolution layer to obtain a convolution result of the enhanced frequency feature; wherein the convolution of the target convolution layer is initialized to zero. After obtaining the convolution result of the enhanced frequency feature, the computer device adds the convolution result of the enhanced frequency feature to the color feature of the image to be detected at the second scale element by element to obtain the enhanced feature of the image to be detected at the second scale. The above process can be specifically expressed as:
[0115]
[0116] in, is the enhanced feature of the image to be detected at the second scale, To enhance the frequency characteristics, Indicates that the enhanced frequency features are convolved through the target convolution layer. is the color feature of the image to be detected at the second scale.
[0117] It should be noted that before the enhanced frequency features are combined with the color features of the image to be detected at the second scale, the enhanced frequency features are convolved through a convolution layer initialized to zero, which can ensure that the color features of the image to be detected at the second scale are given priority during the feature merging process (that is, the color features of the image to be detected at the second scale are dominant). Without compromising the integrity of tampering detection based on color features, the purpose of amplifying detail features is achieved by integrating the enhanced frequency features after the convolution operation into the color features of the image to be detected at the second scale, thereby providing useful assistance to the subsequent tampering detection process and improving the accuracy of the image tampering detection results.
[0118] Optionally, the color features and enhanced frequency features of the image to be detected at the second scale are directly merged to obtain the enhanced features of the image to be detected at the second scale.
[0119] S304 , using M encoders to iteratively encode the enhanced features of the image to be detected at the second scale, to obtain enhanced features of the image to be detected at M scales.
[0120] In one embodiment, a computer device uses M encoders to iteratively encode enhanced features of an image to be detected at a second scale to obtain enhanced features of the image to be detected at M scales, including: the computer device uses the first encoder to encode the enhanced features of the image to be detected at the second scale (such as downsampling), and obtains the output result of the first encoder (enhanced features of the image to be detected at a third scale); and the computer device uses the sth encoder to encode the output result of the s-1th encoder (enhanced features of the image to be detected at the s+1th scale) (such as downsampling), and obtains the output result of the sth encoder (enhanced features of the image to be detected at the s+2th scale); wherein s is an integer greater than 1 and less than or equal to M.
[0121] S305 , adding the color features of the image to be detected at the first scale, the enhanced features at the second scale, and the enhanced features at M scales to a set to obtain a feature set of the image to be detected.
[0122] For example, the color feature of the image to be detected at the first scale is expressed as , the enhanced feature of the image to be detected at the second scale is expressed as ; Assuming M=2, enhanced feature representation at M scales and , then the feature set of the image to be detected can be expressed as In practical applications, depending on the scale of the image to be detected, the feature set can also include etc, Specifically, it may be the color feature of the image to be detected at the second scale, or it may be the enhanced feature of the image to be detected at the M+1th scale, and this application does not impose any limitation on this.
[0123] S306: Decompose the features in the feature set into component features of multiple frequencies.
[0124] In one embodiment, a computer device performs wavelet transform on the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at N scales, respectively, to obtain N+1 high-frequency component features and N+1 low-frequency component features. Wavelet transform is used to decompose the color features of the image to be detected at the first scale, or the enhanced features of the image to be detected at N scales, to obtain corresponding high-frequency component features and low-frequency component features. Wavelet transform may include but is not limited to Haar wavelet transform. In practical applications, Haar wavelet transform is faster and more efficient than other wavelet transforms. In one implementation, feature h can be decomposed into four components by Haar wavelet transform, which can be specifically expressed as: , , and ;in, is the low-frequency component feature of feature h, is the high-frequency component feature of feature h. Feature h may be the color feature of the image to be detected at the first scale, or may be the enhanced feature of the image to be detected at any scale.
[0125] In one embodiment, the computer device performs wavelet transform on the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at N scales, respectively, to obtain N+1 high-frequency component features and N+1 low-frequency component features. The process includes: performing convolution operations on the color features of the image to be detected at the first scale through the first matrix and the second matrix, respectively, to obtain the high-frequency convolution and low-frequency convolution of the image to be detected at the first scale. Then the computer device performs downsampling processing on the high-frequency convolution and low-frequency convolution of the image to be detected at the first scale, respectively, to obtain the first high-frequency component feature and the first low-frequency component feature. Similarly, the computer device performs convolution operations on the enhanced features of the image to be detected at the i+1 scale through the first matrix and the second matrix, respectively, to obtain the high-frequency convolution and low-frequency convolution of the image to be detected at the i+1 scale, where i is a positive integer less than or equal to N. Then the computer device performs downsampling processing on the high-frequency convolution and low-frequency convolution of the image to be detected at the i+1 scale, respectively, to obtain the i+1th high-frequency component feature and the i+1th low-frequency component feature. It can be specifically expressed as:
[0126]
[0127]
[0128] in, is the i+1th low-frequency component feature, is the i+1th high frequency component feature, is the enhanced feature of the image to be detected at the i+1th scale, represents the convolution operation, ↓ represents the downsampling process, is the sampling ratio (e.g. ), and It should be noted that in practical applications, when the feature dimension changes, the first matrix and the second matrix can be adaptively adjusted, and this application does not impose any limitation on this.
[0129] After obtaining N+1 high-frequency component features and N+1 low-frequency component features, the computer device performs feature enhancement processing on the N+1 high-frequency component features and the N+1 low-frequency component features respectively through an adaptive attention module to obtain N+1 enhanced high-frequency component features and N+1 enhanced low-frequency component features.
[0130] In one embodiment, the adaptive attention module includes a convolution submodule, a spatial attention layer and a channel attention layer, and the convolution submodule includes a batch normalization layer, an activation function (such as a ReLU activation function) and 3 3 convolution layer. The computer device performs feature enhancement processing on N+1 high-frequency component features and N+1 low-frequency component features through the adaptive attention module to obtain N+1 enhanced high-frequency component features and N+1 enhanced low-frequency component features. The process includes: the computer device first uses the convolution submodule to process the j-th high-frequency component feature and the j-th low-frequency component feature, respectively, to obtain the processing result of the j-th high-frequency component feature and the processing result of the j-th low-frequency component feature, where j is a positive integer less than or equal to N+1. Then, the processing result of the j-th high-frequency component feature and the processing result of the j-th low-frequency component feature are respectively enhanced in the channel dimension through the channel attention layer to obtain the j-th high-frequency intermediate parameter (i.e., the high-frequency component feature after the j-th channel dimension is enhanced) and the j-th low-frequency intermediate parameter (i.e., the low-frequency component feature after the j-th channel dimension is enhanced). Then, the spatial attention layer performs spatial dimension enhancement processing on the j-th high-frequency intermediate parameter and the j-th low-frequency intermediate parameter, respectively, to obtain the j-th enhanced high-frequency component feature and the j-th enhanced low-frequency component feature. Specifically, it can be expressed as:
[0131]
[0132]
[0133] in, is the j-th enhanced low-frequency component feature, is the j-th enhanced high-frequency component feature, is the jth low-frequency component feature, is the j-th high-frequency component feature, ConvBlock(y) means the convolution submodule is used to extract the features of y, CA(y) means the channel dimension enhancement processing of y is performed through the channel attention layer, and SA(y) means the channel dimension enhancement processing of y is performed through the spatial attention layer.
[0134] S307 , using component features of multiple frequencies to enhance features in the feature set, to obtain an updated feature set.
[0135] The component features of multiple frequencies include N+1 enhanced high-frequency component features and N+1 enhanced low-frequency component features.
[0136] On the one hand, the computer device aggregates N+1 enhanced high-frequency component features to obtain a high-frequency enhanced feature map; on the other hand, the computer device aggregates N+1 enhanced low-frequency component features to obtain a low-frequency enhanced feature map.
[0137] In one embodiment, the process of the computer device aggregating N + 1 enhanced high-frequency component features includes: aggregating the k-th input data and the (N - k + 1)-th enhanced high-frequency component feature through the feature aggregation sub-module (in the frequency fusion module) to obtain the k-th aggregation result; where k is a positive integer less than or equal to N; when k = 1, the k-th input data is the (N + 1)-th enhanced high-frequency component feature; when 1 < k < N + 1, the k-th input data is the (k - 1)-th aggregation result.
[0138] In one embodiment, the feature aggregation sub-module includes a Window-based Linear Model (WLM); the computing device aligns the k-th input data with the downsampling result through the Window-based Linear Model to obtain an alignment result; where the downsampling result is obtained by downsampling the (N - k + 1)-th enhanced high-frequency component feature. After obtaining the alignment result, the computer device optimizes the translation parameter and the scaling parameter based on the alignment result to obtain the optimized translation parameter and the optimized scaling parameter. The optimized translation parameter and the optimized scaling parameter are used for fusing with the (N - k + 1)-th enhanced high-frequency component feature. Specifically, the computer device calculates the Hadamard Product of the (N - k + 1)-th enhanced high-frequency component feature and the first upsampling result to obtain an intermediate calculation result; where the first upsampling result is obtained by upsampling the optimized scaling parameter. Further, the computer device adds the intermediate calculation result and the second upsampling result element-wise to obtain the k-th aggregation result; where the second upsampling result is obtained by upsampling the optimized translation parameter.
[0139] The process of the computer device aggregating N + 1 enhanced low-frequency component features to obtain a low-frequency enhanced feature map can refer to the above process of the computer device aggregating N + 1 enhanced high-frequency component features to obtain a high-frequency enhanced feature map, which will not be elaborated here.
[0140] Further, the computer device fuses the high-frequency enhanced feature map and the color features of the image to be detected at the first scale through a convolutional layer to obtain a first fusion result. And fuses the low-frequency enhanced feature map and the enhanced features of the image to be detected at the N-th scale through a convolutional layer to obtain a second fusion result. Specifically, it can be expressed as:
[0141]
[0142]
[0143] Among them, is the high-frequency enhanced feature map, is the low-frequency enhancement feature map, is the color feature of the image to be detected at the first scale, is the enhanced feature of the image to be detected at the Nth scale. Conv is 1 1 convolutional layer.
[0144] Furthermore, the computer device uses the first fusion result, the second fusion result and the enhanced features of the image to be detected at N-1 scales except the enhanced features at the Nth scale as an updated feature set.
[0145] Figure 4 This is a wavelet-like frequency enhancement architecture diagram provided in an embodiment of the present application. Figure 4 As shown, the feature set of the image to be detected is , first perform a (learnable) wavelet-like decomposition on each feature (color feature or enhancement feature) in the feature set to obtain the enhanced high-frequency component feature corresponding to each feature ( ), the enhanced low-frequency component features ( The specific process can be referred to step S306, which will not be described in detail here. Then, the frequency fusion module is used to perform frequency fusion on the four enhanced high-frequency component features to obtain a high-frequency enhanced feature map ( In one embodiment, the frequency fusion module includes three (guided) feature aggregation submodules, which are used to promote the interaction (aggregation) of enhanced high-frequency component features at different scales to obtain corresponding optimized feature representations (i.e., aggregation results). Specifically, the feature aggregation submodule (Guided Feature Aggregation, GFA) uses a window-based linear model (WLM) to align the enhanced high-frequency component features at two different (minimum) scales ( and ), and optimize the scaling parameters based on the alignment results (which can be expressed as ) and the translation parameter (which can be expressed as ), and obtain the optimized scaling parameters and optimized translation parameters. Further, calculate The Hadamard product between the up-sampling result of the optimized scaling parameter and the up-sampling result of the optimized translation parameter is then added element by element to obtain and The aggregation result is recursively applied to the next feature aggregation submodule to finally obtain the high-frequency enhanced feature map ( ). The frequency fusion module is used to perform frequency fusion on the four enhanced low-frequency component features to obtain a low-frequency enhanced feature map ( ) and the frequency fusion module is used to perform frequency fusion on the four enhanced high-frequency component features to obtain the high-frequency enhanced feature map ( ) is similar to the process of , which will not be repeated here. After obtaining the low-frequency enhancement feature map and the high-frequency enhancement feature map, on the one hand, (The color features of the image to be detected at the first scale) are fused (concat) with the high-frequency enhanced feature map to obtain the first fusion result ( ); On the other hand, (The enhanced features of the image to be detected at the Nth scale) are fused (concat) with the low-frequency enhanced feature map to obtain the second fusion result ( ), and combined with and Get the updated feature set ( ). Furthermore, the updated feature set is classified and predicted by the segmentation head to obtain a segmentation map (i.e., the tampering detection result of the image to be detected).
[0146] Optionally, the computer device obtains a first scale threshold and a second scale threshold, the first scale threshold is less than or equal to the second scale threshold; each feature (color feature or enhancement feature) in the feature set is associated with a scale. The computer device fuses the high-frequency enhancement feature map and the low-frequency enhancement feature map with the feature set to obtain an updated feature set, including: fusing the features (assuming that there are R) whose associated scales are greater than the second scale threshold with the low-frequency enhancement feature map to obtain R first fusion results, where R is a positive integer; and fusing the features (assuming that there are S) whose associated scales are less than the first scale threshold with the high-frequency enhancement feature map to obtain S second fusion results, where S is a positive integer.
[0147] From the above, it can be seen that the high-frequency enhanced feature map and the low-frequency enhanced feature map can be fused with one or more features in the feature set respectively to obtain an updated feature set.
[0148] S308 . Based on the feature set, perform tampering detection on the image to be detected to obtain a tampering detection result of the image to be detected.
[0149] The specific implementation of step S308 can be found in Figure 2 The implementation of step S203 is not described in detail here.
[0150] Figure 5 This is a tamper detection architecture diagram provided in an embodiment of the present application. Figure 5As shown, overall, the tampering detection method provided by the present application consists of four key components. The process starts with a visual perception head and a frequency perception head, which extract visual features and frequency features from the image and discrete cosine transform coefficients, respectively. Subsequently, this information is integrated by the visual enhancement module, which incorporates the frequency features into the visual feature space and ensures that the color features are the main guide (detection basis). Then, the wavelet-like frequency enhancement module separates each feature in the feature set into high-frequency details and low-frequency details in detail (reaching the effect of retaining tiny traces of tampering), and finally obtains the updated feature set. Finally, the segmentation head enables pixel-level tampering detection to obtain the tampering detection result of the image to be detected.
[0151] The tampering detection method provided in this application adopts a dual-branch structure and analyzes visual and frequency features at the same time. RGB image , DCT coefficients of the Y channel and a quantization table for the Y channel, where H and W represent the height and width of the image to be detected, respectively. The visual branch is mainly used to detect obvious tampering indicators, such as color and font inconsistencies, while the frequency branch inherits the DTD method for more subtle anomaly detection, such as block distortion grids. The resulting visual features include (color features of the image to be detected at the first scale) and (Color features of the image to be detected at the second scale); frequency features include The processing of the visual enhancement module can refer to step S302 and step S303; the processing of the wavelet-like frequency enhancement module can refer to Figure 4 The processing process of the segmentation header can refer to step S204 and will not be repeated here.
[0152] It is understandable that the tampering detection method provided by this application can be widely used in multiple fields such as digital forensics, content review, and legal compliance, and plays a key role in protecting the authenticity of information and preventing the spread of misleading information. For example, in the field of e-commerce, the tampering detection method provided by this application can be used to verify the authenticity of contracts and transaction records, and ensure the transparency and fairness of transactions. On social media platforms, the tampering detection method provided by this application can monitor and curb the spread of false information and maintain the health of the network environment. In addition, the tampering detection method provided by this application can be used as an important tool for corporate organizations to prevent and respond to document-based security threats, helping to ensure the integrity and credibility of key documents.
[0153] exist Figure 2On the basis of the embodiment, before the enhanced frequency features are merged with the color features of the image to be detected at the second scale, the enhanced frequency features are convolved through a convolution layer initialized to zero, which can ensure that the color features of the image to be detected at the second scale are given priority during the feature merging process (that is, the color features of the image to be detected at the second scale are dominant). Without compromising the integrity of tampering detection based on color features, the purpose of amplifying detail features is achieved by integrating the enhanced frequency features after the convolution operation into the color features of the image to be detected at the second scale, thereby providing useful assistance to the subsequent tampering detection process and improving the accuracy of the image tampering detection results. By fusing the high-frequency enhanced feature map and the low-frequency enhanced feature map with the feature set, more accurate and effective detection of subtle tampering traces is ensured.
[0154] The method of the embodiment of the present application is described in detail above. In order to facilitate better implementation of the above scheme of the embodiment of the present application, the device of the embodiment of the present application is provided below accordingly.
[0155] See also Figure 6 , Figure 6 A schematic diagram of the structure of a tamper detection device provided in an embodiment of the present application is shown in FIG. Figure 6 The tamper detection apparatus shown may be mounted in a computer device, which may specifically be a terminal device or a server. Figure 6 The tamper detection device shown can be used to perform the above Figure 2 and Figure 3 Some or all of the functions of the described method embodiments. Figure 6 , the tamper detection device comprises:
[0156] An acquisition unit 601 is used to acquire visual features and frequency features of the image to be detected, where the visual features include color features of the image to be detected at a first scale and color features of the image to be detected at a second scale;
[0157] The processing unit 602 is used to obtain a feature set of the image to be detected based on the visual features and the frequency features; the feature set includes the color features of the image to be detected at a first scale and the enhanced features of the image to be detected at N scales, and the enhanced features of the image to be detected at any scale are obtained based on the color features and the frequency features of the image to be detected at a second scale, where N is a positive integer;
[0158] And it is used to perform tampering detection on the image to be detected based on the feature set to obtain the tampering detection result of the image to be detected.
[0159] In one implementation, the processing unit 602 is used to obtain a feature set of the image to be detected based on the visual features and the frequency features, specifically to:
[0160] The color feature and the frequency feature of the image to be detected at the second scale are fused to obtain an enhanced frequency feature;
[0161] The color feature of the image to be detected at the second scale is combined with the enhanced frequency feature to obtain the enhanced feature of the image to be detected at the second scale;
[0162] Based on the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at the second scale, a feature set of the image to be detected is obtained.
[0163] In one implementation, the processing unit 602 is further configured to:
[0164] M encoders are used to iteratively encode the enhanced features of the image to be detected at the second scale to obtain enhanced features of the image to be detected at M scales, where M is a positive integer;
[0165] The processing unit 602 is used to obtain a feature set of the image to be detected based on the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at the second scale, specifically for:
[0166] The color features of the image to be detected at the first scale, the enhanced features of the image to be detected at the second scale, and the enhanced features of the image to be detected at M scales are added to the set to obtain a feature set of the image to be detected.
[0167] In one implementation, the processing unit 602 is used to fuse the color feature and the frequency feature of the image to be detected at the second scale to obtain an enhanced frequency feature, specifically for:
[0168] The color features and frequency features of the image to be detected at the second scale are processed by a spatial attention mechanism to obtain a first processing result;
[0169] The color features and frequency features of the image to be detected at the second scale are processed by a channel attention mechanism to obtain a second processing result;
[0170] A convolution module is used to process the superposition result of the first processing result and the second processing result to obtain an enhanced frequency feature.
[0171] In one implementation, the processing unit 602 is used to merge the color feature of the image to be detected at the second scale with the enhanced frequency feature to obtain the enhanced feature of the image to be detected at the second scale, specifically for:
[0172] The enhanced frequency feature is convolved through the target convolution layer to obtain the convolution result of the enhanced frequency feature;
[0173] The convolution result of the enhanced frequency feature is element-wise added to the color feature of the image to be detected at the second scale to obtain the enhanced feature of the image to be detected at the second scale.
[0174] In one implementation, the processing unit 602 is further configured to:
[0175] Decompose the features in the feature set into component features of multiple frequencies;
[0176] The features in the feature set are enhanced using component features of multiple frequencies to obtain an updated feature set.
[0177] In one implementation, the processing unit 602 is used to decompose the features in the feature set into component features of multiple frequencies, specifically to:
[0178] The color features of the image to be detected at the first scale and the enhanced features of the image to be detected at N scales are respectively subjected to wavelet transformation to obtain N+1 high-frequency component features and N+1 low-frequency component features;
[0179] The adaptive attention module is used to perform feature enhancement processing on N+1 high-frequency component features and N+1 low-frequency component features, respectively, to obtain N+1 enhanced high-frequency component features and N+1 enhanced low-frequency component features.
[0180] In one implementation, the processing unit 602 performs wavelet transform on the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at N scales to obtain N+1 high-frequency component features and N+1 low-frequency component features, including:
[0181] Performing a convolution operation on the color features of the image to be detected at the first scale through the first matrix and the second matrix respectively, to obtain a high-frequency convolution and a low-frequency convolution of the image to be detected at the first scale;
[0182] The high-frequency convolution and low-frequency convolution of the image to be detected at the first scale are down-sampled respectively to obtain the first high-frequency component feature and the first low-frequency component feature;
[0183] Performing convolution operations on the enhanced features of the image to be detected at the i+1th scale through the first matrix and the second matrix respectively, to obtain high-frequency convolution and low-frequency convolution of the image to be detected at the i+1th scale, where i is a positive integer less than or equal to N;
[0184] The high-frequency convolution and low-frequency convolution of the image to be detected at the i+1th scale are down-sampled respectively to obtain the i+1th high-frequency component feature and the i+1th low-frequency component feature.
[0185] In one embodiment, the adaptive attention module includes a convolution submodule, a spatial attention layer, and a channel attention layer; the processing unit 602 performs feature enhancement processing on N+1 high-frequency component features and N+1 low-frequency component features through the adaptive attention module, and the process of obtaining N+1 enhanced high-frequency component features and N+1 enhanced low-frequency component features includes:
[0186] The convolution submodule is used to process the j-th high-frequency component feature and the j-th low-frequency component feature, respectively, to obtain the processing result of the j-th high-frequency component feature and the processing result of the j-th low-frequency component feature, where j is a positive integer less than or equal to N+1;
[0187] The processing results of the j-th high-frequency component feature and the j-th low-frequency component feature are processed by the channel attention layer, and the channel dimension enhancement processing is performed respectively to obtain the j-th high-frequency intermediate parameter and the j-th low-frequency intermediate parameter;
[0188] The j-th high-frequency intermediate parameter and the j-th low-frequency intermediate parameter are spatially enhanced through the spatial attention layer to obtain the j-th enhanced high-frequency component feature and the j-th enhanced low-frequency component feature.
[0189] In one implementation, the component features of multiple frequencies include N+1 enhanced high-frequency component features and N+1 enhanced low-frequency component features; the processing unit 602 uses the component features of multiple frequencies to enhance the features in the feature set, and the process of obtaining the updated feature set includes:
[0190] Aggregate N+1 enhanced high-frequency component features to obtain a high-frequency enhanced feature map, and aggregate N+1 enhanced low-frequency component features to obtain a low-frequency enhanced feature map;
[0191] The high-frequency enhanced feature map is fused with the color feature of the image to be detected at the first scale through a convolution layer to obtain a first fusion result;
[0192] The low-frequency enhanced feature map is fused with the enhanced features of the image to be detected at the Nth scale through a convolutional layer to obtain a second fusion result.
[0193] In one implementation, the process of the processing unit 602 aggregating N+1 enhanced high-frequency component features to obtain a high-frequency enhanced feature map includes:
[0194] The k-th input data and the N-k+1-th enhanced high-frequency component features are aggregated through the feature aggregation submodule to obtain the k-th aggregation result;
[0195] Wherein, k is a positive integer less than or equal to N; when k = 1, the k-th input data is the (N + 1)-th enhanced high-frequency component feature; when 1 < k < N + 1, the k-th input data is the (k - 1)-th aggregation result.
[0196] In one implementation, the feature aggregation sub-module includes a window-based linear model; the processing unit 602 is configured to aggregate the k-th input data and the (N - k + 1)-th enhanced high-frequency component feature through the feature aggregation sub-module to obtain the k-th aggregation result, specifically:
[0197] Align the k-th input data with the downsampling result through the window-based linear model to obtain an alignment result; the downsampling result is obtained by performing downsampling processing on the (N - k + 1)-th enhanced high-frequency component feature;
[0198] Optimize the translation parameter and the scaling parameter based on the alignment result to obtain an optimized translation parameter and an optimized scaling parameter;
[0199] Calculate the Hadamard product of the (N - k + 1)-th enhanced high-frequency component feature and the first upsampling result to obtain an intermediate calculation result; the first upsampling result is obtained by performing upsampling processing on the optimized scaling parameter;
[0200] Add the intermediate calculation result and the second upsampling result element-wise to obtain the k-th aggregation result; the second upsampling result is obtained by performing upsampling processing on the optimized translation parameter.
[0201] In one implementation, the processing unit 602 is configured to perform tampering detection on the image to be detected based on the feature set to obtain a tampering detection result of the image to be detected, specifically:
[0202] Use the segmentation head to perform classification prediction on the feature set to obtain a tampering detection result of the image to be detected;
[0203] Wherein, the tampering detection result includes the tampering detection result of each pixel point in the image to be detected.
[0204] In one implementation, the processing unit 602 is configured to obtain the visual feature and the frequency feature of the image to be detected, specifically:
[0205] Use the first encoder to encode the image to be detected to obtain the color feature of the image to be detected at the first scale;
[0206] Use the second encoder to encode the color feature of the image to be detected at the first scale to obtain the color feature of the image to be detected at the second scale;
[0207] The color features of the image to be detected at the first scale and the color features of the image to be detected at the second scale are used as visual features of the image to be detected;
[0208] Performing discrete cosine transform on the image to be detected through the brightness channel to obtain a discrete cosine transform result of the image to be detected;
[0209] The discrete cosine transform result of the image to be detected is quantized based on the quantization table to obtain the frequency characteristics of the image to be detected.
[0210] According to one embodiment of the present application, Figure 2 and Figure 3 Some of the steps involved in the tamper detection method shown can be represented by Figure 6 The tamper detection device shown in the figure is executed by each unit. Figure 2 The step S201 shown in FIG. 1 can be performed by Figure 6 The acquisition unit 601 shown in FIG. 6 is executed, and step S202 and step S203 can be performed by Figure 6 The processing unit 602 shown executes; Figure 3 The step S301 shown in FIG. Figure 6 The acquisition unit 601 shown in FIG. 6 is executed, and steps S302 to S309 can be performed by Figure 6 Processing unit 602 is shown executing. Figure 6 The various units in the tamper detection device shown can be individually or completely combined into one or several other units to constitute, or one (some) of the units can be further divided into multiple functionally smaller units to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, the tamper detection device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0211] According to another embodiment of the present application, the program can be executed by running a program on a general computing device such as a computer device including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 and Figure 3 A computer program (including program code) for each step involved in the corresponding method shown in Figure 6 The tamper detection device shown in the embodiment of the present application is implemented by the tamper detection method. The computer program can be recorded on a computer-readable recording medium, for example, and loaded into the above-mentioned computing device through the computer-readable recording medium and run therein.
[0212] Based on the same inventive concept, the principles and beneficial effects of solving the problems by the tampering detection device provided in the embodiment of the present application are similar to the principles and beneficial effects of solving the problems by the tampering detection method in the method embodiment of the present application. Please refer to the principles and beneficial effects of the implementation of the method. For the sake of concise description, they will not be repeated here.
[0213] See also Figure 7 , Figure 7 The following is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device may be a terminal device or a server. Figure 7 As shown, the computer device at least includes a processor 701, a communication interface 702 and a memory 703. The processor 701, the communication interface 702 and the memory 703 can be connected via a bus or other means. The processor 701 (or central processing unit (CPU)) is the computing core and control core of the computer device, which can parse various instructions in the computer device and process various data of the computer device. For example, the CPU can be used to parse the power on and off instructions issued by the object to the computer device, and control the computer device to perform power on and off operations; for example, the CPU can transmit various interactive data between the internal structures of the computer device, and so on. The communication interface 702 can optionally include a standard wired interface, a wireless interface (such as WI-FI, a mobile communication interface, etc.), which can be used to send and receive data under the control of the processor 701; the communication interface 702 can also be used for the transmission and interaction of data within the computer device. The memory 703 (Memory) is a memory device in the computer device, which is used to store programs and data. It can be understood that the memory 703 here can include both the built-in memory of the computer device and the extended memory supported by the computer device. The memory 703 provides a storage space, which stores the operating system of the computer device, including but not limited to: Android system, iOS system, Windows Phone system, etc., which is not limited in this application.
[0214] The embodiment of the present application also provides a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space that stores the processing system of the computer device. In addition, a computer program suitable for being loaded and executed by the processor 701 is also stored in the storage space. It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage; optionally, it can also be at least one computer-readable storage medium located away from the aforementioned processor.
[0215] In one embodiment, the processor 701 performs the following operations by running the computer program in the memory 703:
[0216] Acquire visual features and frequency features of the image to be detected, where the visual features include color features of the image to be detected at a first scale and color features of the image to be detected at a second scale;
[0217] Based on the visual features and the frequency features, a feature set of the image to be detected is obtained; the feature set includes the color features of the image to be detected at a first scale and the enhanced features of the image to be detected at N scales, and the enhanced features of the image to be detected at any scale are obtained based on the color features and the frequency features of the image to be detected at a second scale, and N is a positive integer;
[0218] Based on the feature set, tampering detection is performed on the image to be detected to obtain a tampering detection result of the image to be detected.
[0219] As an optional embodiment, the processor 701 obtains a feature set of the image to be detected based on the visual features and the frequency features in a specific embodiment as follows:
[0220] The color feature and the frequency feature of the image to be detected at the second scale are fused to obtain an enhanced frequency feature;
[0221] The color feature of the image to be detected at the second scale is combined with the enhanced frequency feature to obtain the enhanced feature of the image to be detected at the second scale;
[0222] Based on the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at the second scale, a feature set of the image to be detected is obtained.
[0223] As an optional embodiment, the processor 701 further performs the following operations by running the computer program in the memory 703:
[0224] M encoders are used to iteratively encode the enhanced features of the image to be detected at the second scale to obtain enhanced features of the image to be detected at M scales, where M is a positive integer;
[0225] A specific embodiment of the processor 701 obtaining a feature set of the image to be detected based on the color feature of the image to be detected at the first scale and the enhanced feature of the image to be detected at the second scale is:
[0226] The color features of the image to be detected at the first scale, the enhanced features of the image to be detected at the second scale, and the enhanced features of the image to be detected at M scales are added to the set to obtain a feature set of the image to be detected.
[0227] As an optional embodiment, the processor 701 fuses the color feature and the frequency feature of the image to be detected at the second scale to obtain the enhanced frequency feature. The specific embodiment is:
[0228] The color features and frequency features of the image to be detected at the second scale are processed by a spatial attention mechanism to obtain a first processing result;
[0229] The color features and frequency features of the image to be detected at the second scale are processed by a channel attention mechanism to obtain a second processing result;
[0230] A convolution module is used to process the superposition result of the first processing result and the second processing result to obtain an enhanced frequency feature.
[0231] As an optional embodiment, the processor 701 combines the color feature of the image to be detected at the second scale with the enhanced frequency feature to obtain the enhanced feature of the image to be detected at the second scale. A specific embodiment is as follows:
[0232] The enhanced frequency feature is convolved through the target convolution layer to obtain the convolution result of the enhanced frequency feature;
[0233] The convolution result of the enhanced frequency feature is element-wise added to the color feature of the image to be detected at the second scale to obtain the enhanced feature of the image to be detected at the second scale.
[0234] As an optional embodiment, the processor 701 further performs the following operations by running the computer program in the memory 703:
[0235] Decompose the features in the feature set into component features of multiple frequencies;
[0236] The features in the feature set are enhanced using component features of multiple frequencies to obtain an updated feature set.
[0237] As an optional embodiment, a specific embodiment in which the processor 701 decomposes the features in the feature set into component features of multiple frequencies is as follows:
[0238] The color features of the image to be detected at the first scale and the enhanced features of the image to be detected at N scales are respectively subjected to wavelet transformation to obtain N+1 high-frequency component features and N+1 low-frequency component features;
[0239] The adaptive attention module is used to perform feature enhancement processing on N+1 high-frequency component features and N+1 low-frequency component features, respectively, to obtain N+1 enhanced high-frequency component features and N+1 enhanced low-frequency component features.
[0240] As an optional embodiment, the processor 701 performs wavelet transform on the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at N scales, respectively, to obtain N+1 high-frequency component features and N+1 low-frequency component features, including:
[0241] Performing a convolution operation on the color features of the image to be detected at the first scale through the first matrix and the second matrix respectively, to obtain a high-frequency convolution and a low-frequency convolution of the image to be detected at the first scale;
[0242] The high-frequency convolution and low-frequency convolution of the image to be detected at the first scale are down-sampled respectively to obtain the first high-frequency component feature and the first low-frequency component feature;
[0243] Performing convolution operations on the enhanced features of the image to be detected at the i+1th scale through the first matrix and the second matrix respectively, to obtain high-frequency convolution and low-frequency convolution of the image to be detected at the i+1th scale, where i is a positive integer less than or equal to N;
[0244] The high-frequency convolution and low-frequency convolution of the image to be detected at the i+1th scale are down-sampled respectively to obtain the i+1th high-frequency component feature and the i+1th low-frequency component feature.
[0245] As an optional embodiment, the adaptive attention module includes a convolution submodule, a spatial attention layer and a channel attention layer; the processor 701 performs feature enhancement processing on N+1 high-frequency component features and N+1 low-frequency component features through the adaptive attention module, and the process of obtaining N+1 enhanced high-frequency component features and N+1 enhanced low-frequency component features includes:
[0246] The convolutional sub-module processes the j-th high-frequency component feature and the j-th low-frequency component feature respectively to obtain the processing result of the j-th high-frequency component feature and the processing result of the j-th low-frequency component feature, where j is a positive integer less than or equal to N + 1;
[0247] The channel attention layer performs channel dimension enhancement processing on the processing result of the j-th high-frequency component feature and the processing result of the j-th low-frequency component feature respectively to obtain the j-th high-frequency intermediate parameter and the j-th low-frequency intermediate parameter;
[0248] The spatial attention layer performs spatial dimension enhancement processing on the j-th high-frequency intermediate parameter and the j-th low-frequency intermediate parameter respectively to obtain the j-th enhanced high-frequency component feature and the j-th enhanced low-frequency component feature.
[0249] As an optional embodiment, the component features of multiple frequencies include N + 1 enhanced high-frequency component features and N + 1 enhanced low-frequency component features; the process by which the processor 701 uses the component features of multiple frequencies to enhance the features in the feature set includes:
[0250] Aggregate the N + 1 enhanced high-frequency component features to obtain a high-frequency enhanced feature map, and aggregate the N + 1 enhanced low-frequency component features to obtain a low-frequency enhanced feature map;
[0251] The convolutional layer fuses the high-frequency enhanced feature map with the color feature of the image to be detected at the first scale to obtain a first fusion result;
[0252] The convolutional layer fuses the low-frequency enhanced feature map with the enhanced feature of the image to be detected at the N-th scale to obtain a second fusion result.
[0253] As an optional embodiment, the process by which the processor 701 aggregates the N + 1 enhanced high-frequency component features to obtain a high-frequency enhanced feature map includes:
[0254] The feature aggregation sub-module aggregates the k-th input data and the N - k + 1 enhanced high-frequency component features to obtain the k-th aggregation result;
[0255] where k is a positive integer less than or equal to N; when k = 1, the k-th input data is the N + 1 enhanced high-frequency component feature; when 1 < k < N + 1, the k-th input data is the k - 1 aggregation result.
[0256] As an optional embodiment, the feature aggregation sub-module includes a window-based linear model; the specific embodiment by which the processor 701 aggregates the k-th input data and the N - k + 1 enhanced high-frequency component features through the feature aggregation sub-module to obtain the k-th aggregation result is:
[0257] The k-th input data is aligned with the down-sampling result through a window-based linear model to obtain an alignment result; the down-sampling result is obtained by down-sampling the N-k+1-th enhanced high-frequency component feature;
[0258] The translation parameters and the scaling parameters are optimized based on the alignment results to obtain optimized translation parameters and optimized scaling parameters;
[0259] Calculate the Hadamard product of the N-k+1th enhanced high-frequency component feature and the first upsampling result to obtain an intermediate calculation result; the first upsampling result is obtained by upsampling the optimized scaling parameter;
[0260] The intermediate calculation result and the second upsampling result are added element by element to obtain the kth aggregation result; the second upsampling result is obtained by upsampling the optimized translation parameters.
[0261] As an optional embodiment, the processor 701 performs tampering detection on the image to be detected based on the feature set, and a specific embodiment of obtaining the tampering detection result of the image to be detected is:
[0262] The segmentation head is used to classify and predict the feature set to obtain the tampering detection result of the image to be detected;
[0263] The tampering detection result includes the tampering detection result of each pixel in the image to be detected.
[0264] As an optional embodiment, the specific embodiment of the processor 701 acquiring the visual features and frequency features of the image to be detected is:
[0265] The first encoder is used to encode the image to be detected to obtain the color feature of the image to be detected at a first scale;
[0266] Using a second encoder to encode the color features of the image to be detected at the first scale to obtain the color features of the image to be detected at the second scale;
[0267] The color features of the image to be detected at the first scale and the color features of the image to be detected at the second scale are used as visual features of the image to be detected;
[0268] Performing discrete cosine transform on the image to be detected through the brightness channel to obtain a discrete cosine transform result of the image to be detected;
[0269] The discrete cosine transform result of the image to be detected is quantized based on the quantization table to obtain the frequency characteristics of the image to be detected.
[0270] Based on the same inventive concept, the principles and beneficial effects of solving the problems by the computer device provided in the embodiment of the present application are similar to the principles and beneficial effects of solving the problems by the tampering detection method in the method embodiment of the present application. Please refer to the principles and beneficial effects of the implementation of the method. For the sake of concise description, they will not be repeated here.
[0271] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. The computer program is suitable for being loaded by a processor and executing the tampering detection method of the above method embodiment.
[0272] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device performs the above-mentioned tampering detection method.
[0273] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.
[0274] The modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.
[0275] In the embodiments of the present application, the "module" or "unit" referred to refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0276] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the readable storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0277] What is disclosed above is only a preferred embodiment of the present application, and it certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of implementing the above embodiment and equivalent changes made according to the claims of the present application are still within the scope covered by the application.
Claims
1. A tampering detection method, characterized in that: The method comprises: Acquire visual features and frequency features of the image to be detected; the visual features include color features of the image to be detected at a first scale and color features of the image to be detected at a second scale; Based on the visual features and the frequency features, a feature set of the image to be detected is obtained; the feature set includes a color feature of the image to be detected at a first scale and enhanced features of the image to be detected at N scales, and the enhanced features of the image to be detected at any scale are obtained based on the color feature of the image to be detected at a second scale and the frequency feature, where N is a positive integer; Decomposing the features in the feature set into component features of multiple frequencies; Using the component features of the multiple frequencies to enhance the features in the feature set, to obtain an updated feature set; Based on the updated feature set, tampering detection is performed on the image to be detected to obtain a tampering detection result of the image to be detected.
2. The method according to claim 1, characterized in that The step of obtaining a feature set of the image to be detected based on the visual feature and the frequency feature includes: Fusing the color feature of the image to be detected at a second scale with the frequency feature to obtain an enhanced frequency feature; Combining the color feature of the image to be detected at the second scale with the enhanced frequency feature to obtain the enhanced feature of the image to be detected at the second scale; Based on the color features of the image to be detected at a first scale and the enhanced features of the image to be detected at a second scale, a feature set of the image to be detected is obtained.
3. The method according to claim 2, characterized in that The method further comprises: Iteratively encode the enhanced features of the image to be detected at the second scale using M encoders to obtain enhanced features of the image to be detected at M scales, where M is a positive integer; The step of obtaining a feature set of the image to be detected based on the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at the second scale includes: The color features of the image to be detected at a first scale, the enhanced features of the image to be detected at a second scale, and the enhanced features of the image to be detected at M scales are added to a set to obtain a feature set of the image to be detected.
4. The method according to claim 2, characterized in that The step of fusing the color feature of the image to be detected at the second scale with the frequency feature to obtain an enhanced frequency feature includes: Processing the color features and the frequency features of the image to be detected at the second scale through a spatial attention mechanism to obtain a first processing result; Processing the color features and the frequency features of the image to be detected at a second scale through a channel attention mechanism to obtain a second processing result; A convolution module is used to process the superposition result of the first processing result and the second processing result to obtain an enhanced frequency feature.
5. The method according to claim 2, characterized in that The step of combining the color feature of the image to be detected at the second scale with the enhanced frequency feature to obtain the enhanced feature of the image to be detected at the second scale includes: Performing a convolution operation on the enhanced frequency feature through a target convolution layer to obtain a convolution result of the enhanced frequency feature; The convolution result of the enhanced frequency feature is element-wise added to the color feature of the image to be detected at the second scale to obtain the enhanced feature of the image to be detected at the second scale.
6. The method according to claim 1, characterized in that The step of decomposing the features in the feature set into component features of multiple frequencies comprises: Performing wavelet transform on the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at N scales respectively to obtain N+1 high-frequency component features and N+1 low-frequency component features; The N+1 high-frequency component features and the N+1 low-frequency component features are respectively enhanced by the adaptive attention module to obtain N+1 enhanced high-frequency component features and N+1 enhanced low-frequency component features.
7. The method according to claim 6, characterized in that The process of performing wavelet transform on the color features of the image to be detected at the first scale and the enhanced features of the image to be detected at N scales to obtain N+1 high-frequency component features and N+1 low-frequency component features includes: Performing a convolution operation on the color features of the image to be detected at a first scale through the first matrix and the second matrix respectively, to obtain a high-frequency convolution and a low-frequency convolution of the image to be detected at the first scale; Downsampling the high-frequency convolution and the low-frequency convolution of the image to be detected at the first scale respectively to obtain a first high-frequency component feature and a first low-frequency component feature; Performing a convolution operation on the enhanced features of the image to be detected at the i+1th scale by using the first matrix and the second matrix respectively, to obtain a high-frequency convolution and a low-frequency convolution of the image to be detected at the i+1th scale, where i is a positive integer less than or equal to N; The high-frequency convolution and the low-frequency convolution of the image to be detected at the i+1th scale are down-sampled respectively to obtain the i+1th high-frequency component feature and the i+1th low-frequency component feature.
8. The method according to claim 6, characterized in that The adaptive attention module includes a convolution submodule, a spatial attention layer, and a channel attention layer; the process of performing feature enhancement processing on the N+1 high-frequency component features and the N+1 low-frequency component features respectively through the adaptive attention module to obtain N+1 enhanced high-frequency component features and N+1 enhanced low-frequency component features includes: The convolution submodule is used to process the j-th high-frequency component feature and the j-th low-frequency component feature, respectively, to obtain a processing result of the j-th high-frequency component feature and a processing result of the j-th low-frequency component feature, where j is a positive integer less than or equal to N+1; The processing result of the j-th high-frequency component feature and the processing result of the j-th low-frequency component feature are respectively subjected to channel dimension enhancement processing by the channel attention layer to obtain the j-th high-frequency intermediate parameter and the j-th low-frequency intermediate parameter; The spatial attention layer performs spatial dimension enhancement processing on the j-th high-frequency intermediate parameter and the j-th low-frequency intermediate parameter, respectively, to obtain the j-th enhanced high-frequency component feature and the j-th enhanced low-frequency component feature.
9. The method according to claim 1, characterized in that The component features of multiple frequencies include N + 1 enhanced high-frequency component features and N + 1 enhanced low-frequency component features; the process of enhancing the features in the feature set by using the component features of multiple frequencies to obtain an updated feature set includes: Aggregate the N + 1 enhanced high-frequency component features to obtain a high-frequency enhanced feature map, and aggregate the N + 1 enhanced low-frequency component features to obtain a low-frequency enhanced feature map; Fuse the high-frequency enhanced feature map and the color features of the image to be detected at the first scale through a convolutional layer to obtain a first fusion result; Fuse the low-frequency enhanced feature map and the enhanced features of the image to be detected at the Nth scale through the convolutional layer to obtain a second fusion result.
10. The method according to claim 9, characterized in that The process of aggregating the N + 1 enhanced high-frequency component features to obtain a high-frequency enhanced feature map includes: Aggregate the kth input data and the (N - k + 1)th enhanced high-frequency component feature through a feature aggregation sub-module to obtain the kth aggregation result; Where k is a positive integer less than or equal to N; when k = 1, the kth input data is the (N + 1)th enhanced high-frequency component feature; when 1 < k < N + 1, the kth input data is the (k - 1)th aggregation result.
11. The method according to claim 10, characterized in that The feature aggregation sub-module includes a window-based linear model; the process of aggregating the kth input data and the (N - k + 1)th enhanced high-frequency component feature through the feature aggregation sub-module to obtain the kth aggregation result includes: Align the kth input data with the downsampling result through the window-based linear model to obtain an alignment result; the downsampling result is obtained by downsampling the (N - k + 1)th enhanced high-frequency feature; Optimize the translation parameter and the scaling parameter based on the alignment result to obtain an optimized translation parameter and an optimized scaling parameter; Calculate the Hadamard product of the (N - k + 1)th enhanced high-frequency feature and the first upsampling result to obtain an intermediate calculation result; the first upsampling result is obtained by upsampling the optimized scaling parameter; Add the intermediate calculation result and the second upsampling result element-wise to obtain the kth aggregation result; the second upsampling result is obtained by upsampling the optimized translation parameter.
12. The method according to claim 1, characterized in that Based on the feature set, performing tampering detection on the image to be detected to obtain a tampering detection result of the image to be detected includes: Using a segmentation head to perform classification prediction on the feature set to obtain a tampering detection result of the image to be detected; Wherein, the tampering detection result includes the tampering detection result of each pixel point in the image to be detected.
13. The method according to claim 1, characterized in that Obtaining the visual features and frequency features of the image to be detected includes: Encoding the image to be detected by using a first encoder to obtain the color features of the image to be detected at the first scale; Encoding the color features of the image to be detected at the first scale by using a second encoder to obtain the color features of the image to be detected at the second scale; Using the color features of the image to be detected at the first scale and the color features of the image to be detected at the second scale as visual features of the image to be detected; Performing discrete cosine transform on the image to be detected through a brightness channel to obtain a discrete cosine transform result of the image to be detected; The discrete cosine transform result of the image to be detected is quantized based on the quantization table to obtain the frequency characteristics of the image to be detected.
14. A tamper detection device, characterized in that: The tamper detection device comprises: An acquisition unit, used for acquiring visual features and frequency features of the image to be detected; the visual features include color features of the image to be detected at a first scale and color features of the image to be detected at a second scale; a processing unit, configured to obtain a feature set of the image to be detected based on the visual feature and the frequency feature, wherein the feature set includes a color feature of the image to be detected at a first scale and enhanced features of the image to be detected at N scales, wherein the enhanced features of the image to be detected at any scale are obtained based on the color feature of the image to be detected at a second scale and the frequency feature, and N is a positive integer; and for decomposing features in the feature set into component features of multiple frequencies; and enhancing the features in the feature set using the component features of the multiple frequencies to obtain an updated feature set; And it is used to perform tampering detection on the image to be detected based on the updated feature set to obtain the tampering detection result of the image to be detected.
15. A computer device, characterized in that: include: a memory, wherein a computer program is stored in the memory; A processor, used to load the computer program to implement the tampering detection method as described in any one of claims 1-13.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the tampering detection method according to any one of claims 1 to 13.
17. A computer program product, characterized in that The computer program product comprises a computer program, and the computer program is suitable for being loaded by a processor and executing the tampering detection method according to any one of claims 1-13.
