Image forgery detection method and device, server and storage medium
Through multi-level residual quantization and dynamic fusion technology, the calculation efficiency and generalization ability of convolutional neural networks in image forgery detection are improved, and the problem of low accuracy of the model in new scenarios is solved, and high efficiency in complex scenarios is achieved Forged detection.
Patent Information
- Application Number
- CN202411524515.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-10-30
AI Technical Summary
The image forgery detection method based on convolutional neural networks is incomputed and fails to understand the relationship between the features of different network structure layers, resulting in low accuracy of model output when facing new scenarios.
By extracting the input images, multi-level residual quantization is performed to capture the quantized particle size distribution features, combining domain feature extraction and dynamic fusion, shared and unique features are generated, and feature weighting is performed through gated weights to improve the generalization ability of the model and detection accuracy.
Effectively respond to the diverse background and cross-domain feature distribution in the image, improve the robustness and accuracy of the model in complex scenarios, avoid the need to deepen the model network structure, and provide a more reliable forgery detection solution.
Smart Images

Figure CN119048846A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an image forgery detection method, device, server and storage medium. Background Art
[0002] Image forgery detection is a key research topic in the field of computer vision and image processing. There are many types of forged images, including tampering, splicing, ghosting, face-changing, etc. These forgery techniques can be used to create misleading information, which has a profound impact on fields such as news, law, medicine, and social media. In image forgery detection, multi-background and cross-domain scenes refer to situations where the background information and feature distribution in the image are complex and diverse. This makes it difficult for traditional detection methods based on manual features to cope with it. For example, when dealing with multi-background images, the forgery detection task needs to distinguish the subtle differences between complex backgrounds and foreground objects to prevent background interference detection. When dealing with cross-domain scene images, different regions in the image may use different editing techniques (such as splicing, tampering, deep forgery, etc.), and the differences in feature distribution between these regions make the detection task more complicated. In related technologies, forgery detection methods based on convolutional neural networks have made significant progress in overcoming detection tasks in multi-background and cross-domain scenes by automatically learning image features. Compared with traditional methods, forgery detection methods based on convolutional neural networks can handle more complex scenes and forgery forms. However, when faced with images with multiple backgrounds and distribution domains, the model often requires a deeper network structure, which brings about problems with computational efficiency. In addition, when extracting features from different layers in the network structure, the model's generalization ability is insufficient due to the failure to understand the relationship between the features, resulting in low model output accuracy when faced with new scenarios. Summary of the invention
[0003] The present invention provides an image forgery detection method, device, server and storage medium, which are used to solve the defects of low computational efficiency of forgery detection methods based on convolutional neural networks and failure to understand the relationship between features of different network structure layers, resulting in insufficient model generalization ability and low model output accuracy when facing new scenarios.
[0004] The present invention provides an image forgery detection method, comprising: Extract features from the input image to obtain initial image features; Performing multi-level residual quantization on the initial image features to capture the quantized particle size distribution features in the input image and obtain a quantized particle size distribution feature image; Performing domain feature extraction on the quantitative particle size distribution feature image to obtain shared features and unique features, wherein the shared features are features included in at least two domains in the quantitative particle size distribution feature image, and the unique features are features included in each domain in the quantitative particle size distribution feature image; The shared features and the unique features are dynamically fused, the dynamically fused features are classified, and a forgery detection result is output according to the classification result.
[0005] According to the image forgery detection method provided by the present invention, the multi-level residual quantization of the initial image features is performed to capture the quantized particle size distribution features in the input image, including: Inputting the input image into a convolutional neural network to obtain an initial feature representation, and creating a multi-layer residual codebook, wherein the residual codebook includes multiple center vectors; Calculate the distance between each feature vector of the current layer and all the center vectors in the residual codebook, and take each feature vector as a sample of the nearest center vector; After all samples in each center vector are assigned, the position of the center vector is updated according to the average value of all samples belonging to the same center vector; The residual value between each feature vector and the nearest center vector is calculated, and the residual value is used as the input of the next layer of iterative calculation until the convergence condition is met, and the center vector in the residual codebook is used as the quantized granularity distribution feature of the input image.
[0006] According to the image forgery detection method provided by the present invention, the convergence condition includes: The update amplitude of each center vector in each residual codebook is less than a preset threshold; or,
[0007] The number of iterative calculations reaches a preset maximum number.
[0008] According to the image forgery detection method provided by the present invention, the multi-level residual quantization is performed on the initial image features to capture the quantized particle size distribution features in the input image, and further includes: The sensitivity index is obtained based on the difference between the residual value at a certain position in the current layer and the residual value at the same position in the next layer; In the residual codebook updating process, the sensitivity index is used to distinguish the sensitivity of each layer of residual values when calculating the residual value between each feature vector and the nearest center vector.
[0009] According to the image forgery detection method provided by the present invention, the cross-domain feature extraction of the quantitative particle size distribution feature to obtain the shared feature includes: Inputting the quantized particle size distribution feature into a deep neural network, wherein the deep neural network is a multi-layer perceptron, and the multi-layer perceptron includes multiple hidden layers, an activation function, and an output layer; The multiple hidden layers are used to fuse the quantitative granularity distribution features at different levels by connection or weighted summation to generate a comprehensive feature representation; The activation function is used to capture the nonlinear relationship between the quantitative particle size distribution features according to the comprehensive feature representation to obtain a final feature representation; The output layer is used to compress the final feature representation to between 0 and 1 to obtain shared features.
[0010] According to the image forgery detection method provided by the present invention, the method for calculating the shared features includes: Performing feature fusion on the quantized particle size distribution feature and the weight matrix of the deep neural network, and accumulating the fusion result and the bias term; An activation function is performed on the result of accumulating the fusion result and the bias term to obtain a shared feature.
[0011] According to the image forgery detection method provided by the present invention, the cross-domain feature extraction of the quantitative particle size distribution feature to obtain the unique feature includes: Inputting the quantized particle size distribution features into a convolutional layer to extract local features; The local features are input into a feature extraction network to generate unique features.
[0012] According to the image forgery detection method provided by the present invention, the method for calculating the unique features includes: Obtaining multiple basis functions in the feature extraction network and the weight corresponding to each basis function; The results of multiplying multiple basis functions with corresponding weights and accumulating them are used as unique features.
[0013] According to the image forgery detection method provided by the present invention, the dynamic fusion of the shared features and the unique features includes: The shared features and the unique features are combined to obtain comprehensive features; Input the comprehensive features into a fully connected layer or a self-attention mechanism, weight the features of each layer in the fully connected layer or the self-attention mechanism using a gated weight, and perform weighted summation of the weighted features of all layers to obtain dynamically fused features; The gating weight is obtained according to the network learning parameters obtained after training the fully connected layer or the self-attention mechanism.
[0014] According to the image forgery detection method provided by the present invention, the method for calculating the gating weight includes: Performing feature fusion on the comprehensive features and the gated weight learning parameters in the fully connected layer or the self-attention mechanism, and accumulating the fusion result with the gated bias item learning parameters; According to the accumulated results, the gating weight is obtained.
[0015] According to the image forgery detection method provided by the present invention, the step of classifying the dynamically fused features and outputting the forgery detection result according to the classification result comprises: The dynamic fusion features are activated by the activation function Make predictions: ,in It is the Sigmoid activation function, which is used to output the forgery probability value and the final prediction result. represents the probability that the image is forged; According to the final prediction results and threshold Classify the output results:
[0016] in, To output the result, A value of 0 indicates that the image is judged to be a real image. A value of 1 indicates that the image is judged to be a forged image; The threshold Set according to different scenarios and different needs, including: When performing forgery detection of legal evidence images, the threshold is set to a first threshold, and the first threshold is used to increase the probability that the output is a forged image; When performing news content image forgery detection, the threshold is set to a second threshold, and the second threshold is used to balance the probability of outputting a forged image and outputting a real image; When performing social media image forgery detection, setting the threshold to a third threshold, wherein the third threshold is used to reduce the probability that the output is a forged image; The first threshold is smaller than the second threshold, and the second threshold is smaller than the third threshold.
[0017] According to the image forgery detection method provided by the present invention, the convolutional neural network is obtained after training, and the method for obtaining the training data set of the convolutional neural network includes: Acquire multiple original images, and preprocess the multiple original images to obtain an initial data set, wherein the preprocessing includes cropping the original images into a uniform size; The images in the initial data set are expanded by randomly rotating, flipping, and adding noise to obtain an expanded data set; The pixel values of the images in the expanded data set are normalized to obtain a training data set.
[0018] The present invention also provides an image forgery detection device, comprising: The first extraction module is used to extract features from the input image to obtain initial image features; A quantization module, used for performing multi-level residual quantization on the initial image features, capturing the quantized particle size distribution features in the input image, and obtaining a quantized particle size distribution feature image; A second extraction module is used to perform domain feature extraction on the quantitative particle size distribution feature image to obtain shared features and unique features, wherein the shared features are features included in at least two domains in the quantitative particle size distribution feature image, and the unique features are features included in each domain in the quantitative particle size distribution feature image; The fusion module is used to dynamically fuse the shared features and the unique features, classify the dynamically fused features, and output a forgery detection result according to the classification result.
[0019] The present invention also provides a server, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the image forgery detection method as described in any one of the above when executing the program.
[0020] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program implements any of the above-mentioned image forgery detection methods when executed by a processor.
[0021] The image forgery detection method, device, server and storage medium provided by the present invention extract features from an input image to obtain initial image features; perform multi-level residual quantization on the initial image features to capture the quantitative particle size distribution features in the input image to obtain a quantitative particle size distribution feature image; perform domain feature extraction on the quantitative particle size distribution feature image to obtain shared features and unique features, wherein the shared features are features contained in at least two domains in the quantitative particle size distribution feature image, and the unique features are features contained in each domain in the quantitative particle size distribution feature image; dynamically fuse the shared features and the unique features, classify the dynamically fused features, and output a forgery detection result according to the classification result. The present invention adopts a design idea of combining hierarchical feature extraction, step-by-step residual quantization and dynamic fusion to improve the robustness and accuracy of the model output in complex scenes, can effectively cope with diverse backgrounds and cross-domain feature distributions in images, understands the relationship between features through feature fusion, does not need to deepen the model network structure, improves the model generalization ability, and provides a more reliable solution for the forgery detection task. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are 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.
[0023] Figure 1 is a flow chart of an image forgery detection method provided by an embodiment of the present invention; Figure 2 is a schematic diagram of a flow chart of a vector codebook generation method provided by an embodiment of the present invention; Figure 3 is a schematic diagram of a progressive residual coding network structure provided by an embodiment of the present invention; Figure 4 is a schematic diagram of a shared feature extraction network structure provided by an embodiment of the present invention; Figure 5 is a functional structure diagram of an image forgery detection device provided by an embodiment of the present invention; Figure 6 It is a functional structure diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] Figure 1 A flowchart of an image forgery detection method provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the image forgery detection method includes: Step 101: extract features from the input image to obtain initial image features; Step 102, performing multi-level residual quantization on the initial image features, capturing the quantized particle size distribution features in the input image, and obtaining a quantized particle size distribution feature image; Step 103, extracting domain features from the quantitative particle size distribution feature image to obtain shared features and unique features, wherein the shared features are features contained in at least two domains in the quantitative particle size distribution feature image, and the unique features are features contained in each domain in the quantitative particle size distribution feature image; In an embodiment of the present invention, the quantitative particle size distribution feature image is divided into multiple spatial domains according to feature distribution and feature semantics, and the shared features obtained after domain feature extraction of the quantitative particle size distribution feature image are the features contained in at least two spatial domains in the quantitative particle size distribution feature image, and the unique features are the features contained in each spatial domain in the quantitative particle size distribution feature image. For example, the quantitative particle size distribution feature image is divided into three spatial domains according to feature distribution and feature semantics, and the features contained in each spatial domain itself are unique features, and the features contained in two or three spatial domains are shared features.
[0026] Step 104: dynamically fuse the shared features and the unique features, classify the dynamically fused features, and output a forgery detection result according to the classification result.
[0027] Traditional image forgery detection methods based on convolutional neural networks have made significant progress in overcoming detection tasks in multi-background and cross-domain scenarios by automatically learning image features. Compared with traditional methods, forgery detection methods based on convolutional neural networks can handle more complex scenarios and forms of forgery. However, when faced with images with multiple backgrounds and multiple distribution domains, the model often requires a deeper network structure, which brings about computational efficiency issues. In addition, when extracting features from different layers in the network structure, the relationship between the features cannot be understood, resulting in insufficient generalization of the model and low model output accuracy when faced with new scenarios.
[0028] The image forgery detection method provided by the embodiment of the present invention obtains initial image features by performing feature extraction on an input image; performs multi-level residual quantization on the initial image features to capture the quantitative particle size distribution features in the input image to obtain a quantitative particle size distribution feature image; performs domain feature extraction on the quantitative particle size distribution feature image to obtain shared features and unique features, wherein the shared features are features contained in at least two domains in the quantitative particle size distribution feature image, and the unique features are features contained in each domain in the quantitative particle size distribution feature image. The embodiment of the present invention adopts a design concept that combines hierarchical feature extraction, step-by-step residual quantization and dynamic fusion to improve the robustness and accuracy of the model output in complex scenes, can effectively cope with diverse backgrounds and cross-domain feature distributions in images, understands the relationship between features through feature fusion, does not need to deepen the model network structure, improves the model generalization ability, and provides a more reliable solution for forgery detection tasks.
[0029] Based on any of the above embodiments, the performing multi-level residual quantization on the initial image features to capture the quantized particle size distribution features in the input image includes: Step 201: input the input image into a convolutional neural network to obtain an initial feature representation, and create a multi-layer residual codebook, wherein the residual codebook includes multiple center vectors; Step 202: Calculate the distance between each eigenvector of the current layer and all the center vectors in the residual codebook, and use each eigenvector as a sample of the center vector closest to it; Step 203: After all samples in each center vector are allocated, the position of the center vector is updated according to the average value of all samples belonging to the same center vector; Step 204: Calculate the residual value between each feature vector and the nearest center vector, and use the residual value as the input of the next layer of iterative calculation until the convergence condition is met, and use the center vector in the residual codebook as the quantized particle size distribution feature of the input image.
[0030] In the embodiment of the present invention, the convergence condition includes: The update amplitude of each center vector in each residual codebook is less than a preset threshold; or the number of iterative calculations reaches a preset maximum number.
[0031] In the embodiment of the present invention, the step-by-step residual coding can keenly capture subtle changes in the image by quantizing the residual through the technology of processing and encoding image features layer by layer, thereby laying a solid foundation for high-precision forgery detection. The specific steps of step-by-step residual coding quantization include: Initial residual setting: Input image , firstly, it is processed by a preliminary convolutional neural network to obtain the initial feature representation The specific expression is:
[0032] in Represents the mapping function of the convolutional neural network. In this initial stage, the features extracted by the network usually cover the basic elements of the image, such as edges, textures and other basic information.
[0033] Step-by-step encoding and residual update: First, we need to design The codebook of the initial layer records the distance between each vector sample and the codebook center vector. The residual codebook records the distance between each vector sample and the codebook vector sample residual. The purpose is to achieve high-precision codebook recording for the original codebook vector that is not accurate enough. For example, the initialization vector codebook , first, determine the size of the vector codebook , which is the number of center vectors in the codebook. Initialization Vector codebook of the layer , where a vector codebook , each vector is a dimensional vector.
[0034] In the embodiment of the present invention, the initialization method may be to randomly select training samples or use a certain initialization algorithm such as the K-means++ method. The present application does not limit the specific initialization method.
[0035] After initialization, samples need to be assigned to the nearest center vector. For each sample (In layer), and calculate its sum with all codebook vectors distance (usually the Euclidean distance).
[0036] According to the formula , the sample Assigned to the nearest center vector ,Right now Assign to sample The value of .
[0037] Once all samples are assigned to the nearest center vector, update each center vector is the mean of the samples belonging to the center vector: ,in are all the vectors assigned to the center A collection of samples, is the number of samples in this set.
[0038] At each layer In the process, the residual is updated in real time, and the update calculation method is: , repeat the above steps and record the residual In the next layer of code The nearest code is found and the residual codebook vector is updated until the change of the center vector is less than a preset threshold or the maximum number of iterations is reached. It is a stable set of center vectors.
[0039] After multiple iterations, the codebook Convergence is achieved, that is, each vector codebook The update amplitude of each center vector of is small enough, or other stopping conditions are met (such as reaching the maximum number of iterations). At this time, the center vector in the codebook is the best partition of the input data feature space.
[0040] like Figure 2 As shown, according to the input feature vector , the nearest vector code can be found in the first layer codebook, and based on the residual between it and the vector code, the vector code closest to the residual can be found in the next layer codebook, and so on. Therefore, the input feature vector The sum of the codebook , in, Indicates each layer The vector in the codebook that is closest to the residual at each level.
[0041] Through such multi-layer iterative calculation, the residual can be fully and finely quantized, so that the extremely subtle feature differences in the image can be accurately captured. The construction method of the residual codebook is the same as that of the initial vector codebook.
[0042] In a specific example, Figure 3 As shown, the number of quantization Set to 8, one codebook in vector quantization The size is set to 64 x 256, that is , the number of layers of the codebook It is related to the precision required for quantification. In this example, it is set to = 6 layers.
[0043] In some embodiments of the present invention, the performing multi-level residual quantization on the initial image features to capture the quantized particle size distribution features in the input image further includes: The sensitivity index is obtained based on the difference between the residual value at a certain position in the current layer and the residual value at the same position in the next layer; In the residual codebook updating process, the sensitivity index is used to distinguish the sensitivity of each layer of residual values when calculating the residual value between each feature vector and the nearest center vector.
[0044] In the embodiment of the present invention, the progressive residual coding is a technique for processing and quantizing features layer by layer, and by gradually reducing and updating the residual, the subtle differences in the image are captured. It has important applications in image forgery detection, and can improve the accuracy of feature extraction and the robustness of detection. Through a multi-stage encoding process, the progressive residual coding can effectively deal with complex backgrounds and forgery forms, thereby improving the detection effect.
[0045] In the embodiment of the present invention, after careful processing of multi-level residual quantization, the quantized residual finally obtained is , which shows extremely high sensitivity to tiny traces of forgery in the image. In order to quantify this sensitivity between each level of residual, the sensitivity index is introduced , the expression is: in Represents a collection of pixels in an image.
[0046] During the quantization process, the sensitivity index is introduced in the residual codebook update step to adjust the quantization weight, that is, , the detection capability of the model is significantly enhanced by introducing sensitivity indicators. And the residual components with higher sensitivity can obtain higher quantization accuracy, thereby improving the accuracy of detection. The residual components with lower sensitivity can moderately reduce the quantization accuracy and reduce the computational and storage overhead. In multi-background and cross-domain scenarios, quantization based on sensitivity indicators can dynamically adapt to the complexity of different regions and improve the robustness of the model.
[0047] Based on any of the above embodiments, the step of performing cross-domain feature extraction on the quantitative particle size distribution feature to obtain a shared feature includes: Step 301: input the quantized particle size distribution feature into a deep neural network, wherein the deep neural network is a multi-layer perceptron, and the multi-layer perceptron includes a plurality of hidden layers, an activation function and an output layer; Step 302: The multiple hidden layers are used to fuse the quantitative particle size distribution features of different levels by connection or weighted summation to generate a comprehensive feature representation; Step 303, the activation function is used to capture the nonlinear relationship between the quantitative particle size distribution features according to the comprehensive feature representation to obtain the final feature representation; Step 304: The output layer is used to compress the final feature representation to between 0 and 1 to obtain a shared feature.
[0048] In the embodiment of the present invention, the shared feature The mathematical expression is:
[0049] in, To quantify the particle size distribution characteristics, is the activation function, is the weight matrix, is the bias term, It is a multi-layer perceptron or convolutional network.
[0050] In the embodiment of the present invention, Figure 4 As shown, the process of extracting shared features is done with the help of nonlinear transformation function In this process, deep neural networks (DNNs) play a key role and are usually used to obtain more complex and abstract features. The mathematical expression is: Here, represents the quantized features, is the activation function (such as ReLU), is the weight matrix, is the bias term. It can be a powerful multi-layer perceptron (MLP) or an efficient convolutional network. Its main function is to capture complex nonlinear relationships in high-dimensional space. In this implementation case, it is a 5-layer MLP network with 3 hidden layers (128, 64, and 32 units respectively), ReLU activation, and finally Sigmoid output.
[0051] Based on any of the above embodiments, the cross-domain feature extraction of the quantitative particle size distribution feature to obtain a unique feature includes: Step 401: input the quantized particle size distribution feature into a convolution layer to extract local features; Step 402: Input the local features into a feature extraction network to generate unique features.
[0052] In the embodiment of the present invention, the unique feature The mathematical expression is:
[0053] in, To quantify the particle size distribution characteristics, represents the feature extraction function, is a parameter set for a specific distribution type. is the weight, is the basis function, and K is the number of basis functions.
[0054] In the embodiment of the present invention, the extraction of unique features is closely dependent on predefined distribution types, such as key factors such as color and texture. Unique features are generated by using convolutional layers or other specific network architectures such as visual geometry group networks and residual networks. The specific mathematical expression is: in represents a unique feature extraction function, are parameters set for specific distribution types. is the weight, is the basis function.
[0055] The embodiments of the present invention create favorable conditions for subsequent in-depth processing and precise analysis by accurately mapping image features into a clear distribution space.
[0056] After successfully completing the residual quantization operation, the next key step is to accurately extract cross-domain features from the quantized features. The core goal of this link is to generate a more comprehensive and rich feature representation to provide solid support for subsequent forgery detection tasks. The cross-domain feature extraction network structure provided by the embodiment of the present invention includes: Input: quantized features , whose dimensions are precisely defined as .
[0057] Shared feature extraction: Deep neural networks (e.g., multilayer perceptrons (MLPs) with 5 hidden layers, 128, 64, and 32 neurons per layer) are used to generate complex and abstract shared features. .
[0058] Unique feature extraction: Accurately generate unique features through efficient convolutional layers (such as 3x3 convolution kernels, stride 1, padding 1) or specific feature extraction networks (such as some layers of VGG16 used in this example) .
[0059] Output: Cross-domain features and , which provides key input for subsequent feature fusion and weight calculation.
[0060] In the embodiment of the present invention, the cross-domain feature extraction strategy aims to fully capture the rich features of the image, covering shared and unique cross-domain information. These carefully extracted features will provide richer and more comprehensive input information for subsequent forgery detection tasks, significantly enhancing the model's ability to accurately identify forgery traces.
[0061] Based on any of the foregoing embodiments, the dynamically fusing the shared features and the unique features includes: The shared features and the unique features are combined to obtain comprehensive features; Input the comprehensive features into a fully connected layer or a self-attention mechanism, weight the features of each layer in the fully connected layer or the self-attention mechanism using a gated weight, and perform weighted summation of the weighted features of all layers to obtain dynamically fused features; The gating weight is obtained according to the network learning parameters obtained after training the fully connected layer or the self-attention mechanism.
[0062] In this embodiment of the present invention, the gating weight The calculation expression is:
[0063] in, For comprehensive characteristics, and is the learning parameter of the gating weight, is the activation function.
[0064] In the embodiment of the present invention, firstly, an advanced feature fusion technology is used to combine the shared features and unique features Fusion is performed to generate comprehensive features. The mathematical expression is: in, represents the feature concatenation operation, and the fused feature dimension is precisely defined as (Shared and unique features have the same dimensions.) Then use the gating mechanism to calculate the weights The comprehensive characteristics Input into a highly flexible fully connected layer or self-attention mechanism, and obtain the gate weight through network learning. The mathematical expression is: Here, and represents the learning parameter of the gating weight, The function cleverly limits the calculation results to the range of [0, 1], thus providing a solid guarantee for the accurate calculation and effective application of weights.
[0065] Make full use of the calculated gating weights , for each layer feature Accurate weighting is performed to generate the final model output. The mathematical expression is: Here, Representative The characteristic function of the layer, The weighted features provide the key output for the final prediction of the model. The weighted sum of all levels of weighted features is used to obtain the final feature vector in, It is for The processing function of layer features.
[0066] In an embodiment of the present invention, the dynamically integrated network structure includes: Input: Fusion features , whose dimensions are precisely defined as .
[0067] Gating calculation network: Use fully connected layers (128 neurons) or self-attention mechanisms (8 heads) to accurately calculate gating weights The output dimension is closely related to the specific number of tasks, i.e. dimension.
[0068] Output: weighted features , providing key basis for the final prediction of the model.
[0069] In the embodiment of the present invention, the application of the gating mechanism cleverly introduces cross-domain information into the model by dynamically adjusting the feature weights, thereby significantly enhancing the robustness and accuracy of the model. The precise calculation of the gating weights can effectively integrate features at different levels, allowing the model to demonstrate excellent adaptability when processing complex and diverse tasks.
[0070] During the training process, optimization algorithms such as the efficient adaptive moment estimation (Adam) algorithm are used. The learning rate is set to 0.001, the exponential decay rate of the first-order moment estimation is 0.9, and the exponential decay rate of the second-order moment estimation is 0.999. The learning of the gating weights is accurately optimized to ensure the optimal performance of the model.
[0071] The embodiment of the present invention is suitable for processing images with different resolutions and different illumination conditions. The dynamic weight mechanism is dynamically adjusted according to the feature distribution in a specific scene.
[0072] Based on any of the above embodiments, outputting the forgery detection result according to the dynamically fused features includes: The dynamic fusion features are activated by the activation function Make predictions: ,in It is the Sigmoid activation function, which is used to output the forgery probability value and the final prediction result. represents the probability that the image is forged; According to the final prediction results and threshold Classify the output results:
[0073] in, To output the result, A value of 0 indicates that the image is judged to be a real image. A value of 1 indicates that the image is judged to be a forged image; In the embodiment of the present invention, a threshold is set To determine the classification results of the model output. Threshold The value is usually between 0 and 1. For example, a common threshold is 0.5. , it is judged as a forged image; otherwise it is judged as a real image. The choice of can be adjusted through cross-validation or on the validation set during the training phase to optimize the performance of the model.
[0074] In the embodiment of the present invention, the threshold Set according to different scenarios and different needs, including: When performing forgery detection of legal evidence images, the threshold is set to a first threshold, and the first threshold is used to increase the probability that the output is a forged image; In courts, digital images are often used as evidence. The authenticity of these images directly affects the outcome of the case. Therefore, it is crucial to ensure that the images have not been tampered with in any way. In this context, it is very important to avoid false negatives (i.e., falsely judging a forged image as real) because this can lead to a miscarriage of justice. Even if this means that some real images may be misjudged as forged (false positives), it is necessary to minimize the number of undetected forgeries. Therefore, the threshold can be set low, such as 0.4. The purpose of this is to increase the sensitivity to potential forged images, and even if some real images are marked as suspicious, they can be confirmed through further forensic analysis.
[0075] When performing news content image forgery detection, the threshold is set to a second threshold, and the second threshold is used to balance the probability of outputting a forged image and outputting a real image; The content published by news organizations must maintain a high degree of authenticity and credibility. If the published pictures or videos are found to be fake, it will not only damage the reputation of the media, but may also cause a crisis of public trust. News content hopes to minimize false positives of real content while ensuring the authenticity of the content. Therefore, it is necessary to find a balance that can effectively identify fake content while minimizing misjudgment of real content. Therefore, the threshold can be set to an intermediate value, such as 0.5. Such a setting is designed to balance sensitivity and specificity, so that it can capture most of the fake content without affecting the normal release of real content too much. If the model performs well, this default value is usually a reasonable choice.
[0076] When performing social media image forgery detection, setting the threshold to a third threshold, wherein the third threshold is used to reduce the probability that the output is a forged image; Users upload a large amount of pictures and video content on social media platforms. The platforms need to automatically detect and remove posts containing fake content to maintain a healthy community environment. Social media platforms need to consider user experience to avoid user dissatisfaction caused by a large number of false positives. At the same time, harmful fake content must be prevented from spreading widely. Therefore, it is necessary to control the proportion of false positives while ensuring high accuracy. Therefore, the threshold can be set higher, such as 0.6. The purpose of this is to reduce false positives and ensure that an image is only marked when the model is very sure that it is a fake. This helps maintain user trust while also effectively removing obvious fake content.
[0077] In image forgery detection, the choice of threshold is crucial to balance false positives and false negatives. Different application scenarios may need to adjust the threshold according to their specific needs. Legal evidence authentication: low threshold (such as 0.4) to ensure as few false negatives as possible. News media content review: moderate threshold (such as 0.5) to balance sensitivity and specificity. Social media platform: high threshold (such as 0.6) to reduce false positives and protect user experience. By adjusting the threshold, the performance of the model can be optimized according to the needs of different application scenarios, so as to better serve the specific goals in practical applications.
[0078] Based on any of the above embodiments, the convolutional neural network is obtained after training, and during the model training process, the L2 norm is used to calculate the loss function. The method for obtaining the training data set of the convolutional neural network includes: Acquire multiple original images, and preprocess the multiple original images to obtain an initial data set, wherein the preprocessing includes cropping the original images into a uniform size; In the embodiment of the present invention, the images are cropped and scaled to a uniform size, such as 256x256 pixels, to ensure that the images input to the model have the same size. At the same time, images with too high resolution are appropriately scaled to reduce the amount of calculation and memory usage.
[0079] The images in the initial data set are expanded by randomly rotating, flipping, and adding noise to obtain an expanded data set; In the embodiment of the present invention, the data set is expanded by performing operations such as random rotation, flipping, and adding noise to increase the diversity of the data, thereby improving the generalization ability of the model. For example, in a specific example of the present invention, the image is horizontally flipped with a probability of 50%, and the image is randomly rotated with a probability of 30% (the rotation angle is between -30 degrees and 30 degrees).
[0080] The pixel values of the images in the expanded data set are normalized to obtain a training data set.
[0081] Before performing image forgery detection tasks, data preprocessing is a crucial step. First, a large number of image datasets need to be collected, including real images and various types of forged images, such as splicing, copy-paste, image enhancement, etc. For the collected images, the following preprocessing operations are performed: In the embodiment of the present invention, the pixel values of the image are normalized to the range of [0, 1] to facilitate the training and convergence of the model. The calculation formula is: ,in is the original pixel value, and are the minimum and maximum pixel values of the image, respectively.
[0082] Embodiments of the present invention also include predicting the confidence of image forgery, while only providing image-level annotations. The image forgery task assumes that only image-level labels are available in the training phase. Given an image, if the image does not contain forgery events, the image is defined as a normal image with label T = 0; otherwise, if the image contains at least one forgery event, the image is marked as forged with label T = 1.
[0083] The image forgery detection method provided by the embodiment of the present invention performs feature extraction on the input image to obtain an initial image feature representation. The extracted image features are input into the residual coding module, and multi-level residual quantization is performed to obtain a hierarchical multi-distribution representation of the quantization granularity. Then, the hierarchical representations of the image in different domains are obtained: the hierarchical representation of the image is further refined by using two representation extraction methods, shared and unique. The processed image features are input into the hierarchical multi-distribution model, and the calculation method and the adjustment method of the dynamic weights are changed to meet the task requirements. Finally, it is judged whether the input image has traces of forgery based on the output results of the model. The problem of the difficulty of forgery detection tasks in multi-background and cross-domain scenarios is overcome, and a more reliable solution is provided for forgery detection tasks.
[0084] The image forgery detection device provided by the present invention is described below. The image forgery detection device described below and the image forgery detection method described above can be referred to each other.
[0085] Figure 5 A functional structural diagram of an image forgery detection device provided by an embodiment of the present invention is shown in FIG. Figure 5 As shown, the image forgery detection device includes: The first extraction module 501 is used to extract features from the input image to obtain initial image features; A quantization module 502 is used to perform multi-level residual quantization on the initial image features, capture the quantized particle size distribution features in the input image, and obtain a quantized particle size distribution feature image; A second extraction module 503 is used to extract domain features from the quantitative particle size distribution feature image to obtain shared features and unique features, wherein the shared features are features included in at least two domains in the quantitative particle size distribution feature image, and the unique features are features included in each domain in the quantitative particle size distribution feature image; The fusion module 504 is used to dynamically fuse the shared features and the unique features, classify the dynamically fused features, and output a forgery detection result according to the classification result.
[0086] The image forgery detection device provided by the present invention obtains initial image features by performing feature extraction on an input image; performs multi-level residual quantization on the initial image features, captures quantitative particle size distribution features in the input image, and obtains a quantitative particle size distribution feature image; performs domain feature extraction on the quantitative particle size distribution feature image to obtain shared features and unique features, wherein the shared features are features contained in at least two domains in the quantitative particle size distribution feature image, and the unique features are features contained in each domain in the quantitative particle size distribution feature image; dynamically fuses the shared features and the unique features, classifies the dynamically fused features, and outputs forgery detection results according to the classification results. The design idea of combining hierarchical feature extraction, step-by-step residual quantization and dynamic fusion is adopted to improve the robustness and accuracy of model output in complex scenes, can effectively cope with diverse backgrounds and cross-domain feature distributions in images, understands the relationship between features through feature fusion, does not need to deepen the model network structure, improves the model generalization ability, and provides a more reliable solution for forgery detection tasks.
[0087] In the embodiment of the present invention, the first extraction module 501 is further used to: input the image , firstly, it is processed by a preliminary convolutional neural network to obtain the initial feature representation The specific expression is:
[0088] in Represents the mapping function of the convolutional neural network. In this initial stage, the features extracted by the network usually cover the basic elements of the image, such as edges, textures and other basic information.
[0089] In the embodiment of the present invention, the quantization module 502 is further used for: The input image is input into a convolutional neural network to obtain an initial feature representation. For each layer of the convolutional neural network, a residual codebook is created, wherein the residual codebook includes multiple center vectors. The distance between each feature vector of the current layer and all center vectors in the residual codebook is calculated, and each feature vector is used as a sample of the center vector closest to it. After all samples in each center vector are distributed, the position of the center vector is updated according to the average value of all samples belonging to the same center vector. The residual value between each feature vector and the nearest center vector is calculated, and the residual value is used as the input of the iterative calculation of the next layer until the convergence condition is met, and the center vector in the residual codebook is used as the quantized particle size distribution feature of the input image.
[0090] In an embodiment of the present invention, the convolutional neural network is obtained after training, and the method for obtaining the training data set of the convolutional neural network includes: Acquire multiple original images, and preprocess the multiple original images to obtain an initial data set, wherein the preprocessing includes cropping the original images into a uniform size; The images in the initial data set are expanded by randomly rotating, flipping, and adding noise to obtain an expanded data set; The pixel values of the images in the expanded data set are normalized to obtain a training data set.
[0091] In the embodiment of the present invention, the step-by-step residual coding can keenly capture subtle changes in the image by quantizing the residual through the technology of processing and encoding image features layer by layer, thereby laying a solid foundation for high-precision forgery detection. The specific steps of step-by-step residual coding quantization include: First you need to design The codebook of the initial layer records the distance between each vector sample and the codebook center vector. The residual codebook records the distance between each vector sample and the codebook vector sample residual. The purpose is to achieve high-precision codebook recording for the original codebook vector that is not accurate enough. For example, the initialization vector codebook , first, determine the size of the vector codebook , which is the number of center vectors in the codebook. Initialization Vector codebook of the layer , where a vector codebook , each vector is a dimensional vector.
[0092] In the embodiment of the present invention, the initialization method may be to randomly select training samples or use a certain initialization algorithm such as the K-means++ method. The present application does not limit the specific initialization method.
[0093] After initialization, samples need to be assigned to the nearest center vector. For each sample (In layer), and calculate its sum with all codebook vectors distance (usually the Euclidean distance).
[0094] According to the formula , the sample Assigned to the nearest center vector ,Right now Assign to sample The value of .
[0095] Once all samples are assigned to the nearest center vector, update each center vector is the mean of the samples belonging to the center vector: ,in are all the vectors assigned to the center A collection of samples, is the number of samples in this set.
[0096] At each layer In the process, the residual is updated in real time, and the update calculation method is: , repeat the above steps and record the residual In the next layer of code The nearest code is found and the residual codebook vector is updated until the change of the center vector is less than a preset threshold or the maximum number of iterations is reached. It is a stable set of center vectors.
[0097] After multiple iterations, the codebook Convergence is achieved, that is, each vector codebook The update amplitude of each center vector of is small enough, or other stopping conditions are met (such as reaching the maximum number of iterations). At this time, the center vector in the codebook is the best partition of the input data feature space.
[0098] In the embodiment of the present invention, the quantization module 502 is further used for: The sensitivity index is obtained based on the difference between the residual value at a certain position in the current layer and the residual value at the same position in the next layer; In the residual codebook updating process, the sensitivity index is used to distinguish the sensitivity of each layer of residual values when calculating the residual value between each feature vector and the nearest center vector.
[0099] In the embodiment of the present invention, the second extraction module 503 is further used for: Inputting the quantized particle size distribution feature into a deep neural network, wherein the deep neural network is a multi-layer perceptron, and the multi-layer perceptron includes multiple hidden layers, an activation function, and an output layer; The multiple hidden layers are used to fuse the quantitative granularity distribution features at different levels by connection or weighted summation to generate a comprehensive feature representation; The activation function is used to capture the nonlinear relationship between the quantitative particle size distribution features according to the comprehensive feature representation to obtain a final feature representation; The output layer is used to compress the final feature representation to between 0 and 1 to obtain shared features.
[0100] In the embodiment of the present invention, the shared feature The mathematical expression is:
[0101] in, To quantify the particle size distribution characteristics, is the activation function, is the weight matrix, is the bias term, It is a multi-layer perceptron or convolutional network.
[0102] In the embodiment of the present invention, the second extraction module 503 is also used to
[0103] Inputting the quantized particle size distribution features into a convolutional layer to extract local features; The local features are input into a feature extraction network to generate unique features.
[0104] In the embodiment of the present invention, the unique feature The mathematical expression is:
[0105] in, To quantify the particle size distribution characteristics, represents the feature extraction function, is a parameter set for a specific distribution type. is the weight, is the basis function, and K is the number of basis functions.
[0106] In the embodiment of the present invention, the fusion module 504 is further used for: The shared features and the unique features are combined to obtain comprehensive features; Input the comprehensive features into a fully connected layer or a self-attention mechanism, weight the features of each layer in the fully connected layer or the self-attention mechanism using a gated weight, and perform weighted summation of the weighted features of all layers to obtain dynamically fused features; The gating weight is obtained according to the network learning parameters obtained after training the fully connected layer or the self-attention mechanism.
[0107] In this embodiment of the present invention, the gating weight The calculation expression is:
[0108] in, For comprehensive characteristics, and is the learning parameter of the gating weight, is the activation function.
[0109] In the embodiment of the present invention, outputting the forgery detection result according to the dynamically fused features includes: The dynamic fusion features are activated by the activation function Make predictions: ,in It is the Sigmoid activation function, which is used to output the forgery probability value and the final prediction result. represents the probability that the image is forged; According to the final prediction results and threshold Classify the output results:
[0110] in, To output the result, A value of 0 indicates that the image is judged to be a real image. A value of 1 indicates that the image is judged to be a forged image; The threshold Set according to different scenarios and different needs, including: When performing forgery detection of legal evidence images, the threshold is set to a first threshold, and the first threshold is used to increase the probability that the output is a forged image; When performing news content image forgery detection, the threshold is set to a second threshold, and the second threshold is used to balance the probability of outputting a forged image and outputting a real image; When performing social media image forgery detection, setting the threshold to a third threshold, wherein the third threshold is used to reduce the probability that the output is a forged image; The first threshold is smaller than the second threshold, and the second threshold is smaller than the third threshold.
[0111] In the embodiment of the present invention, the threshold Set according to different scenarios and different needs, including: When performing forgery detection of legal evidence images, the threshold is set to a first threshold, and the first threshold is used to increase the probability that the output is a forged image; In courts, digital images are often used as evidence. The authenticity of these images directly affects the outcome of the case. Therefore, it is crucial to ensure that the images have not been tampered with in any way. In this context, it is very important to avoid false negatives (i.e., falsely judging a forged image as real) because this can lead to a miscarriage of justice. Even if this means that some real images may be misjudged as forged (false positives), it is necessary to minimize the number of undetected forgeries. Therefore, the threshold can be set low, such as 0.4. The purpose of this is to increase the sensitivity to potential forged images, and even if some real images are marked as suspicious, they can be confirmed through further forensic analysis.
[0112] When performing news content image forgery detection, the threshold is set to a second threshold, and the second threshold is used to balance the probability of outputting a forged image and outputting a real image; The content published by news organizations must maintain a high degree of authenticity and credibility. If the published pictures or videos are found to be fake, it will not only damage the reputation of the media, but may also cause a crisis of public trust. News content hopes to minimize false positives of real content while ensuring the authenticity of the content. Therefore, it is necessary to find a balance that can effectively identify fake content while minimizing misjudgment of real content. Therefore, the threshold can be set to an intermediate value, such as 0.5. Such a setting is designed to balance sensitivity and specificity, so that it can capture most of the fake content without affecting the normal release of real content too much. If the model performs well, this default value is usually a reasonable choice.
[0113] When performing social media image forgery detection, setting the threshold to a third threshold, wherein the third threshold is used to reduce the probability that the output is a forged image; Users upload a large amount of pictures and video content on social media platforms. The platforms need to automatically detect and remove posts containing fake content to maintain a healthy community environment. Social media platforms need to consider user experience to avoid user dissatisfaction caused by a large number of false positives. At the same time, harmful fake content must be prevented from spreading widely. Therefore, it is necessary to control the proportion of false positives while ensuring high accuracy. Therefore, the threshold can be set higher, such as 0.6. The purpose of this is to reduce false positives and ensure that an image is only marked when the model is very sure that it is a fake. This helps maintain user trust while also effectively removing obvious fake content.
[0114] In image forgery detection, the choice of threshold is crucial to balance false positives and false negatives. Different application scenarios may need to adjust the threshold according to their specific needs. Legal evidence authentication: low threshold (such as 0.4) to ensure as few false negatives as possible. News media content review: moderate threshold (such as 0.5) to balance sensitivity and specificity. Social media platform: high threshold (such as 0.6) to reduce false positives and protect user experience. By adjusting the threshold, the performance of the model can be optimized according to the needs of different application scenarios, so as to better serve the specific goals in practical applications.
[0115] Figure 6 An example of a server physical structure diagram is shown below: Figure 6As shown, the server may include: a processor 610, a communication interface 620, an image forgery detection device (memory) 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the image forgery detection device 630 communicate with each other through the communication bus 640. The image forgery detection device 630 includes a computer program, an operating system and acquired data, and the processor 610 may call the logic instructions in the image forgery detection device 630 to execute the image forgery detection method, which includes: extracting features from the input image to obtain initial image features; performing multi-level residual quantization on the initial image features to capture the quantized particle size distribution features in the input image; performing cross-domain feature extraction on the quantized particle size distribution features to obtain shared features and unique features; dynamically fusing the shared features and the unique features, and outputting the forgery detection results according to the dynamically fused features.
[0116] In addition, the logic instructions in the above-mentioned image forgery detection device 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the relevant technology or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only image forgery detection device (ROM, Read-Only Memory), random access image forgery detection device (RAM, RandomAccess Memory), disk or optical disk, etc. Various media that can store program codes.
[0117] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the image forgery detection method provided by the above-mentioned methods, the method comprising: performing feature extraction on the input image to obtain initial image features; performing multi-level residual quantization on the initial image features to capture the quantized particle size distribution features in the input image; performing cross-domain feature extraction on the quantized particle size distribution features to obtain shared features and unique features; dynamically fusing the shared features and the unique features, and outputting forgery detection results based on the dynamically fused features.
[0118] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0119] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting image forgery, It is characterized in that include: Extract features from the input image to obtain initial image features; Performing multi-level residual quantization on the initial image features to capture the quantized particle size distribution features in the input image and obtain a quantized particle size distribution feature image; Performing domain feature extraction on the quantitative particle size distribution feature image to obtain shared features and unique features, wherein the shared features are features included in at least two domains in the quantitative particle size distribution feature image, and the unique features are features included in each domain in the quantitative particle size distribution feature image; The shared features and the unique features are dynamically fused, the dynamically fused features are classified, and a forgery detection result is output according to the classification result.
2. The image forgery detection method according to claim 1, It is characterized in that The performing multi-level residual quantization on the initial image features to capture the quantized particle size distribution features in the input image includes: Inputting the input image into a convolutional neural network to obtain an initial feature representation, and creating a multi-layer residual codebook, wherein the residual codebook includes multiple center vectors; Calculate the distance between each feature vector of the current layer and all the center vectors in the residual codebook, and take each feature vector as a sample of the nearest center vector; After all samples in each center vector are assigned, the position of the center vector is updated according to the average value of all samples belonging to the same center vector; The residual value between each feature vector and the nearest center vector is calculated, and the residual value is used as the input of the next layer of iterative calculation until the convergence condition is met, and the center vector in the residual codebook is used as the quantized granularity distribution feature of the input image.
3. The image forgery detection method according to claim 2, It is characterized in that The convergence conditions include: The update amplitude of each center vector in each residual codebook is less than a preset threshold; or, The number of iterative calculations reaches a preset maximum number.
4. The image forgery detection method according to claim 2, It is characterized in that The performing multi-level residual quantization on the initial image features to capture the quantized particle size distribution features in the input image also includes: The sensitivity index is obtained based on the difference between the residual value at a certain position in the current layer and the residual value at the same position in the next layer; In the residual codebook updating process, the sensitivity index is used to distinguish the sensitivity of each layer of residual values when calculating the residual value between each feature vector and the nearest center vector.
5. The image forgery detection method according to claim 1, It is characterized in that The step of performing cross-domain feature extraction on the quantitative particle size distribution feature to obtain a shared feature includes: Inputting the quantized particle size distribution feature into a deep neural network, wherein the deep neural network is a multi-layer perceptron, and the multi-layer perceptron includes multiple hidden layers, an activation function, and an output layer; The multiple hidden layers are used to fuse the quantitative granularity distribution features at different levels by connection or weighted summation to generate a comprehensive feature representation; The activation function is used to capture the nonlinear relationship between the quantitative particle size distribution features according to the comprehensive feature representation to obtain a final feature representation; The output layer is used to compress the final feature representation to between 0 and 1 to obtain shared features.
6. The image forgery detection method according to claim 5, It is characterized in that The method for calculating the shared features includes: Performing feature fusion on the quantized particle size distribution feature and the weight matrix of the deep neural network, and accumulating the fusion result and the bias term; An activation function is performed on the result of accumulating the fusion result and the bias term to obtain a shared feature.
7. The image forgery detection method according to claim 1, It is characterized in that The cross-domain feature extraction of the quantitative particle size distribution feature to obtain a unique feature includes: Inputting the quantized particle size distribution features into a convolutional layer to extract local features; The local features are input into a feature extraction network to generate unique features.
8. The image forgery detection method according to claim 7, It is characterized in that The calculation method of the unique features includes: Obtaining multiple basis functions in the feature extraction network and the weight corresponding to each basis function; The results of multiplying multiple basis functions with corresponding weights and accumulating them are used as unique features.
9. The image forgery detection method according to claim 1, It is characterized in that The dynamically fusing the shared features and the unique features includes: The shared features and the unique features are combined to obtain comprehensive features; Input the comprehensive features into a fully connected layer or a self-attention mechanism, weight the features of each layer in the fully connected layer or the self-attention mechanism using a gated weight, and perform weighted summation of the weighted features of all layers to obtain dynamically fused features; The gating weight is obtained according to the network learning parameters obtained after training the fully connected layer or the self-attention mechanism.
10. The image forgery detection method according to claim 9, It is characterized in that The method for calculating the gating weight includes: Performing feature fusion on the comprehensive features and the gated weight learning parameters in the fully connected layer or the self-attention mechanism, and accumulating the fusion result with the gated bias item learning parameters; According to the accumulated results, the gating weight is obtained.
11. The image forgery detection method according to claim 10, It is characterized in that The step of classifying the dynamically fused features and outputting a forgery detection result according to the classification result includes: The dynamic fusion features are activated by the activation function Make predictions: ,in It is the Sigmoid activation function, which is used to output the forgery probability value and the final prediction result. represents the probability that the image is forged; According to the final prediction results and threshold Classify the output results: ; in, To output the result, A value of 0 indicates that the image is judged to be a real image. A value of 1 indicates that the image is judged to be a forged image; The threshold Set according to different scenarios and different needs, including: When performing forgery detection of legal evidence images, the threshold is set to a first threshold, and the first threshold is used to increase the probability that the output is a forged image; When performing news content image forgery detection, the threshold is set to a second threshold, and the second threshold is used to balance the probability of outputting a forged image and outputting a real image; When performing social media image forgery detection, setting the threshold to a third threshold, wherein the third threshold is used to reduce the probability that the output is a forged image; The first threshold is smaller than the second threshold, and the second threshold is smaller than the third threshold.
12. The image forgery detection method according to claim 2, It is characterized in that The convolutional neural network is obtained after training, and the method for obtaining the training data set of the convolutional neural network includes: Acquire multiple original images, and preprocess the multiple original images to obtain an initial data set, wherein the preprocessing includes cropping the original images into a uniform size; The images in the initial data set are expanded by randomly rotating, flipping, and adding noise to obtain an expanded data set; The pixel values of the images in the expanded data set are normalized to obtain a training data set.
13. An image forgery detection device, It is characterized in that include: The first extraction module is used to extract features from the input image to obtain initial image features; A quantization module, used for performing multi-level residual quantization on the initial image features, capturing the quantized particle size distribution features in the input image, and obtaining a quantized particle size distribution feature image; A second extraction module is used to perform domain feature extraction on the quantitative particle size distribution feature image to obtain shared features and unique features, wherein the shared features are features included in at least two domains in the quantitative particle size distribution feature image, and the unique features are features included in each domain in the quantitative particle size distribution feature image; The fusion module is used to dynamically fuse the shared features and the unique features, classify the dynamically fused features, and output a forgery detection result according to the classification result.
14. A server comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the image forgery detection method according to any one of claims 1 to 12 is implemented.
15. A non-transitory readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the image forgery detection method according to any one of claims 1 to 12 is implemented.
Citation Information
Patent Citations
Deep forgery detection method and corresponding device
CN115311525A
Forgery detection method based on feature enhancement and spectral analysis
CN115829909A
Face forgery detection system and method based on convolutional neural network
CN116824708A
Generalized deeply-forged image detection method and system based on noise perception
CN118196865A
Cited By
Generalized fake media detection method for real large-flow scene
CN119854218A
A Generalized Forged Media Detection Method for Realistic High-Traffic Scenarios
CN119854218B
Content counterfeiting detection and positioning method and electronic equipment
CN121685527A
