Forensic method based on dual-domain fusion deep learning median filtering
By establishing a dual-stream convolutional neural network model and combining spatial and frequency domain features, the problem of feature information loss in median filtering forensics was solved, achieving higher accuracy and reliability.
Patent Information
- Application Number
- CN202410029975.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-08
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-01-08
AI Technical Summary
Existing median filtering forensic methods rely on manual feature extraction, which is difficult, classifier design and optimization are difficult, and the complementarity of image frequency domain and spatial domain operation features is ignored, resulting in low credibility of forensic results.
A deep learning-based median filtering forensics method based on dual-domain fusion is adopted. A dual-stream convolutional neural network model is established. By combining spatial and frequency domain streams, median filtering artifact features are extracted, and the features are processed through a fully connected layer and classified using a softmax layer.
It improves the accuracy and reliability of median filtering forensics, enhances the robustness and generalization performance of the model, and solves the problem of feature information loss in existing methods.
Smart Images

Figure CN117830784B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital image forensics, specifically to a deep learning median filtering forensics method based on dual-domain fusion. Background Technology
[0002] Digital images, with their ability to intuitively convey information, have become an indispensable information medium, and the widespread adoption of digital image editing technology has gradually permeated all aspects of people's lives. Users can personalize their images using digital image editing software to create visually appealing results. However, image manipulation is prevalent in fashion, news, and social media, threatening the authenticity of digital images.
[0003] Median filtering is a non-linear smoothing technique that sets the gray value of each pixel to the median of the gray values of all pixels within its neighborhood window. This can be used to alter the appearance of a digital image or hide specific information. Median filtering can be used to tamper with, forge, or hide key information in an image, thereby reducing its credibility. Research on median filtering detection techniques can not only identify fake multimedia content but also prevent the spread of malicious information. Traditional median filtering forensic methods rely on manual feature extraction, which is difficult, and classifier design and optimization are challenging, limiting forensic performance. Existing deep learning forensic methods ignore the complementary nature of operational features in the image's frequency and spatial domains, leading to the loss of operational feature information and consequently lower credibility of the forensic results. Summary of the Invention
[0004] To address the issue of low reliability in existing methods for median filtering in image forensics processing, this invention aims to provide a deep learning-based median filtering forensics method based on dual-domain fusion. The specific technical solution adopted is as follows:
[0005] This invention provides a deep learning median filtering forensics method based on dual-domain fusion, which includes the following steps:
[0006] Obtain the original image dataset and the images to be processed. Preprocess each original image in the original image dataset and divide the preprocessed original image dataset into a training dataset and a test dataset.
[0007] A two-stream convolutional neural network forensics model is established, and the forensics algorithm and evaluation index of the two-stream convolutional neural network forensics model are determined; the two-stream convolutional neural network forensics model introduces spatial flow, which consists of four modules;
[0008] The dual-stream convolutional neural network forensic model is trained based on the training dataset to obtain the model parameters of the trained dual-stream convolutional neural network forensic model; the performance of the dual-stream convolutional neural network forensic model is analyzed based on the test dataset; based on the performance analysis results, the model parameters of the trained dual-stream convolutional neural network forensic model are adjusted to optimize the trained dual-stream convolutional neural network forensic model and obtain the target dual-stream convolutional neural network forensic model.
[0009] The image to be processed is input into the target dual-stream convolutional neural network forensics model to obtain the median filtering forensics result.
[0010] Preferably, each original image in the original image dataset undergoes preprocessing, including:
[0011] Each original image in the original image dataset is converted to grayscale and cropped to obtain the preprocessed original image dataset.
[0012] Preferably, the step of dividing the preprocessed original image dataset into a training dataset and a test dataset includes:
[0013] The original images in the preprocessed original image dataset are divided into training and testing datasets in an 8:2 ratio.
[0014] Preferably, the four modules include:
[0015] The first module consists of only one convolutional layer, using 16 groups of 3×3 convolutional kernels to convolve the input image. The convolutionally processed image is then normalized and passed to the ReLU activation function to generate 16 feature maps. The operation process of the first module is as follows:
[0016]
[0017] in, W represents the i-th feature map output by the first module. i Let f(·) represent the weight matrix of the i-th group, F(·) represent the residual mapping, and f(·) represent the activation function.
[0018] The operation process of the second module is as follows:
[0019]
[0020] in, Let x represent the i-th feature map output by the second module, W represent the set of weight matrices of the second module, and x represent the i-th feature map output by the second module. 1 This represents the set of all feature maps output by the first module;
[0021] The operation process of the third module is as follows:
[0022]
[0023] in, Let x represent the i-th feature map output by the third module. 2 This represents the set of all feature maps output by the second module;
[0024] The operation process of the fourth module is as follows:
[0025]
[0026] in, This represents the i-th feature map output by the fourth module, where Avg(·) represents the average pooling layer, G(·) represents the global average pooling layer, and x 3 This represents the set of all feature maps output by the third module.
[0027] Preferably, the method includes establishing a two-stream convolutional neural network forensic model, determining the forensic algorithm and evaluation metrics for the two-stream convolutional neural network forensic model, and further includes:
[0028] The two-dimensional discrete cosine transform (DCT) is used to convert information from the spatial domain of an image to the frequency domain. The specific formula for the two-dimensional DCT is as follows:
[0029]
[0030] Where X(k1,k2) represents the result of the two-dimensional discrete cosine transform, k i Let A represent the coordinates of the i-th dimension, A represent the original image, cos represents the cosine function, π represents pi, N1 represents the length of the first dimension, N2 represents the length of the second dimension, n1 represents the current coordinates of the first dimension, and n2 represents the current coordinates of the second dimension. Denotes the basis functions in the first dimension. Let k1 represent the basis function in the second dimension, k2 represent the coordinates in the first dimension, and k2 represent the coordinates in the second dimension.
[0031] k takes the value k1 or k2; when the value of k is 0, the corresponding basis function value is When the value of k is not 0, the corresponding basis function value is 1.
[0032] Preferably, the step of establishing a two-stream convolutional neural network forensic model and determining the forensic algorithm of the two-stream convolutional neural network forensic model includes:
[0033] The dual-stream convolutional neural network forensics model consists of a spatial stream and a frequency stream. The spatial stream receives the input image and extracts median filtering artifact features through convolutional neural network layers. The frequency stream preprocesses the input image through two-dimensional discrete cosine transform and extracts frequency domain features using convolutional neural network layers. The features of the spatial stream and the frequency stream are processed through fully connected layers to obtain output features, and the output features are concatenated together. The input image is classified through a softmax layer.
[0034] Preferably, accuracy and loss value are used as evaluation metrics.
[0035] Preferably, the dual-stream convolutional neural network forensic model is trained based on the training dataset to obtain the model parameters of the trained dual-stream convolutional neural network forensic model, including:
[0036] (1) Randomly initialize the weights and biases of the dual-stream convolutional neural network forensic model;
[0037] (2) Input the training dataset into the dual-stream convolutional neural network forensic model, and perform calculations through each layer in sequence to obtain the predicted output of the dual-stream convolutional neural network forensic model.
[0038] (3) Use the cross-entropy loss function to calculate the loss between the predicted output and the true label of the two-stream convolutional neural network forensics model;
[0039] (4) Use the backpropagation algorithm on the gradient of each parameter to calculate the loss function;
[0040] (5) Update the weights and biases of the two-stream convolutional neural network forensic model using the stochastic gradient descent algorithm;
[0041] (6) Repeat (1) to (5) until the loss converges or the preset number of training rounds is reached.
[0042] Preferably, the step of adjusting the model parameters of the trained two-stream convolutional neural network forensic model based on performance analysis results, and optimizing the trained two-stream convolutional neural network forensic model, includes:
[0043] If the accuracy of the trained dual-stream convolutional neural network forensic model is lower than the accuracy of the experimental test, the learning rate should be reduced and the dual-stream convolutional neural network forensic model should be retrained; if the accuracy of the trained dual-stream convolutional neural network forensic model is higher than the accuracy of the experimental test, the batch size should be increased and the dual-stream convolutional neural network forensic model should be retrained.
[0044] Preferably, after optimizing the trained two-stream convolutional neural network forensic model, the method further includes:
[0045] Calculate the accuracy and loss value of the trained dual-stream convolutional neural network forensic model, and compare the accuracy of the dual-stream convolutional neural network forensic model with other models.
[0046] The present invention has at least the following beneficial effects:
[0047] This invention first establishes a two-stream convolutional neural network (DNN) model and determines the DNN forensic algorithm and evaluation metrics. A training dataset is used to train the DNN forensic model, yielding its parameters. An experimental scenario consisting of two median filtering operations is designed to verify the model's forensic accuracy. A test dataset is used to verify the generalization performance of the DNN forensic model. Based on the performance analysis results, the parameters of the trained DNN model are adjusted to optimize it, improving the accuracy and reliability of image median filtering forensic results. Attached Figure Description
[0048] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1 A flowchart illustrating a deep learning median filtering forensics method based on dual-domain fusion provided in an embodiment of the present invention;
[0050] Figure 2 The original image after preprocessing;
[0051] Figure 3 This is the result image obtained after median filtering of the preprocessed original image;
[0052] Figure 4 The image shows the result obtained after the preprocessed original image undergoes two-dimensional DCT.
[0053] Figure 5 This is the result of median-filtered images undergoing two-dimensional DCT. Detailed Implementation
[0054] To further illustrate the technical means and effects adopted by the present invention to achieve the intended purpose, the following detailed description of the deep learning median filtering forensics method based on dual-domain fusion proposed in accordance with the present invention is provided in conjunction with the accompanying drawings and preferred embodiments.
[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0056] The following description, in conjunction with the accompanying drawings, details the specific scheme of the deep learning median filtering forensics method based on dual-domain fusion provided by this invention.
[0057] Example of a deep learning-based median filtering forensics method based on dual-domain fusion:
[0058] The specific scenario addressed in this embodiment is: acquiring an image to be processed, establishing a dual-stream convolutional neural network forensics model and training it to obtain a target dual-stream convolutional neural network forensics model, and using the target dual-stream convolutional neural network forensics model to obtain accurate forensics results from the image to be processed.
[0059] This embodiment proposes a deep learning-based median filtering forensics method based on dual-domain fusion, such as... Figure 1 As shown, the deep learning median filtering forensics method based on dual-domain fusion in this embodiment includes the following steps:
[0060] Step S1: Obtain the original image dataset and the images to be processed. Preprocess each original image in the original image dataset and divide the preprocessed original image dataset into a training dataset and a test dataset.
[0061] This embodiment first acquires one image to be analyzed and multiple original images. In this embodiment, 1000 original images are acquired. These original images will be used to train and optimize the dual-stream convolutional neural network forensic model. In specific applications, the number of original images can be adjusted according to the specific situation. It should be noted that both the image to be analyzed and the original images acquired in this embodiment are color images in JPEG or TIFF format. JPEG format is a lossy compression format, and this type of data generally contains camera filters, such as contrast and hue. TIFF format is a lossless compression format; this data is raw data and only contains camera body parameter data other than image information, such as aperture, focal length, and ISO. Grayscale images only contain grayscale values, and the image information is less than that of color images. To facilitate forensic work, the color format needs to be converted to grayscale image format. The resolution of the original image after data format conversion can be as high as 3200×4800. To improve data utilization and accelerate the training process, this embodiment will crop the image data. Therefore, in this embodiment, each original image and the image to be analyzed in the original image dataset is converted to grayscale and cropped, and the images are cropped into blocks of 32×32, 64×64, and 128×128 sizes. All the preprocessed original images constitute the preprocessed original image dataset, and the processed image to be analyzed is denoted as the image to be analyzed. The preprocessed original images are as follows: Figure 2 As shown.
[0062] To facilitate subsequent manipulation of the preprocessed original image dataset and the assignment of corresponding category labels, the original images in the preprocessed original image dataset were divided into training and testing datasets in an 8:2 ratio. The training dataset used one data source, and the testing dataset used another data source, which were used for training and testing the two-stream convolutional neural network forensics model, respectively.
[0063] Step S2: Establish a dual-stream convolutional neural network forensic model and determine the forensic algorithm and evaluation metrics of the dual-stream convolutional neural network forensic model; the dual-stream convolutional neural network forensic model introduces spatial flow, which consists of four modules.
[0064] Median filtering is a commonly used non-linear filtering technique in digital image processing, designed to reduce noise in images. Unlike linear filtering techniques such as average filtering and Gaussian filtering, median filtering does not use a weighted average of pixels; instead, it blurs noise in the image by selecting the median value among the pixel values.
[0065] The specific operation process of median filtering is as follows:
[0066] 1. For each pixel, take a square or rectangular neighborhood window centered on itself;
[0067] 2. Within the neighborhood window, sort the pixel values in ascending order;
[0068] 3. Assign the median value of the sorted pixels to the original pixel to replace its value.
[0069] First, create new folders for both the training and test datasets. Then, within each of these folders, create subfolders corresponding to the respective categories to facilitate storing the processed images later. Process the images using the corresponding operations based on the category labels, and then store the processed images in the corresponding folders.
[0070] This embodiment will establish a dual-stream convolutional neural network forensics model (SRNet). The SRNet network can be divided into 3 segments and 4 categories. From the perspective of functional modules, it can be divided into 3 segments, and from the perspective of network structure, it can be divided into 4 categories. The 4 categories are four types of modules. The 3 segments correspond to functional modules. The first segment is the first two shaded blocks, which are from the first layer to the seventh layer. The main function of this part is to extract the high-frequency noise introduced during the previous steganography embedding. The second segment is the third shaded block, which is from the eighth layer to the eleventh layer. The main function of this segment is to reduce the dimension of the feature map. The third segment is from the 12th layer and all subsequent network layers. It mainly plays the role of a classifier.
[0071] The first module consists of only one convolutional layer, which uses 16 sets of 3×3 convolutional kernels to convolve the input image. The convolutionally processed image is then normalized and passed to the ReLU activation function to generate 16 feature maps. The operation process of the first module is as follows:
[0072]
[0073] in, W represents the i-th feature map output by the first module. i Let f(·) represent the weight matrix of the i-th group, F(·) represent the residual mapping, and f(·) represent the activation function.
[0074] The operation process of the second module is as follows:
[0075]
[0076] in, Let x represent the i-th feature map output by the second module, W represent the set of weight matrices of the second module, and x represent the i-th feature map output by the second module. 1 This represents the set of all feature maps output by the first module.
[0077] The operation process of the third module is as follows:
[0078]
[0079] in, Let x represent the i-th feature map output by the third module. 2 This represents the set of all feature maps output by the second module.
[0080] The operation process of the fourth module is as follows:
[0081]
[0082] in, This represents the i-th feature map output by the fourth module, where Avg(·) represents the average pooling layer, G(·) represents the global average pooling layer, and x 3 This represents the set of all feature maps output by the third module.
[0083] Median filtering works by replacing the pixel value of a corresponding pixel in an image with the median value of adjacent pixels. Median filtering has low-pass filtering characteristics and significantly modifies the high-frequency components of an image. Richer high-frequency information can be obtained in the DCT domain. The result of median filtering on the preprocessed original image is shown in the image below. Figure 3As shown, the result obtained after the preprocessed original image undergoes two-dimensional DCT is as follows. Figure 4 As shown, the result of median filtering followed by two-dimensional DCT is shown in the image below. Figure 5 As shown.
[0084] A formal definition of the two-dimensional discrete cosine transform is provided:
[0085]
[0086] Where X(k1,k2) represents the result of the two-dimensional discrete cosine transform, k i Let A represent the coordinates of the i-th dimension, A represent the original image, cos represents the cosine function, π represents pi, N1 represents the length of the first dimension, N2 represents the length of the second dimension, n1 represents the current coordinates of the first dimension, and n2 represents the current coordinates of the second dimension. Denotes the basis functions in the first dimension. Let k represent the basis function in the second dimension, k1 represent the coordinates in the first dimension, and k2 represent the coordinates in the second dimension. k can take either k1 or k2. When the value of k is 0, the corresponding basis function value is... When the value of k is not 0, the corresponding basis function value is 1; that is...
[0087] The two-stream convolutional neural network (DNN) framework consists of a spatial stream and a frequency stream. The spatial stream receives the input image and extracts median filtering artifact features through convolutional neural network layers. The frequency stream preprocesses the input image using a two-dimensional discrete cosine transform (DCT) and then extracts frequency domain features using convolutional neural network layers. Fully connected layers process the features from both streams and concatenate their output features. Finally, a softmax layer is used to classify the input image. The key advantage of the two-stream DNN is its ability to simultaneously capture both spatial and frequency domain information from an image, thereby improving classification accuracy and robustness.
[0088] Common evaluation metrics for comparing image manipulation chain forensics models include: Accuracy (ACC), Loss Curve (LC), and Fitting. To more fully evaluate the accuracy of the two-stream convolutional neural network model and reduce the error of the image manipulation chain forensics model, this embodiment uses accuracy and loss value as evaluation metrics for prediction accuracy. The formula for calculating ACC is as follows:
[0089]
[0090] Where n is the total number of categories, P N P represents the number of correctly classified items in the Nth category. itThe total number of items in the Nth category. The Acc value ranges from [0, 1]. When the RMSE value is 1, it means that the classification task is completely correct. However, in actual chain evidence collection tasks, this is often not achieved due to different shooting conditions for different data. This embodiment judges the accuracy of the prediction by comparing the size of the Acc value. The Acc value is positively correlated with the accuracy of evidence collection. The larger the Acc value, the smaller the evidence collection error.
[0091] The formula for calculating the loss function (Loss) is as follows:
[0092]
[0093] in, This represents the loss function, where M is the total number of samples; K is the total number of classes corresponding to the current sample, and y j,k This represents the true label of the k-th class for the j-th sample. Let represent the predicted probability of the two-stream convolutional neural network forensics model for the k-th category of the j-th sample, and log is the logarithmic function.
[0094] Step S3: Train the dual-stream convolutional neural network forensic model based on the training dataset to obtain the model parameters of the trained dual-stream convolutional neural network forensic model; analyze the performance of the dual-stream convolutional neural network forensic model based on the test dataset; adjust the model parameters of the trained dual-stream convolutional neural network forensic model based on the performance analysis results; optimize the trained dual-stream convolutional neural network forensic model to obtain the target dual-stream convolutional neural network forensic model.
[0095] Most current forensic methods target only a single domain, obtaining results by directly extracting operational features from the manipulated grayscale image. However, the spatial and frequency domain information of the manipulated image is correlated, making it difficult to improve forensic accuracy and resulting in poor model robustness when extracting operational features from only one domain. Therefore, this embodiment compares the accuracy of forensic methods based on a dual-domain fusion approach.
[0096] Data from both classes in the dataset is randomly and evenly distributed, ensuring sufficient samples for training in each class. This prevents data scarcity in certain classes, which could lead to poor model performance on those classes. Simultaneously, it ensures the model receives adequate training on samples from both classes, thereby improving its generalization ability on unseen data.
[0097] This embodiment will use a two-stream convolutional neural network model as the forensic model. The specific training process of the two-stream convolutional neural network forensic model is as follows:
[0098] (1) Randomly initialize the weights and biases of the dual-stream convolutional neural network forensic model;
[0099] (2) Input the training dataset into the dual-stream convolutional neural network forensic model, and perform calculations through each layer in sequence to obtain the predicted output of the dual-stream convolutional neural network forensic model.
[0100] (3) Use the cross-entropy loss function to calculate the loss between the predicted output and the true label of the two-stream convolutional neural network forensics model;
[0101] (4) Use the backpropagation algorithm on the gradient of each parameter to calculate the loss function;
[0102] (5) Update the weights and biases of the two-stream convolutional neural network forensic model using the stochastic gradient descent algorithm;
[0103] (6) Repeat (1) to (5) until the loss converges or the preset number of training rounds is reached;
[0104] (7) Use the validation dataset to evaluate the performance of the dual-stream convolutional neural network forensic model. Based on the performance of the model, adjust the hyperparameters of the dual-stream convolutional neural network forensic model, such as the learning rate, the number and size of layers, and the regularization parameters.
[0105] The final model is tested on the test set to obtain Acc and Loss values, and the model's performance is compared.
[0106] Select a test dataset as a reserved subset to serve as a robustness test dataset across different data sources. Select other resolution datasets from the same data source as reserved subsets, excluding them from training, to serve as robustness test datasets at different resolutions. Test the final model on the test sets from other data sources, obtain Acc and Loss values, and compare the model's robustness performance.
[0107] When optimizing the trained dual-stream convolutional neural network (DNN) forensics model, if the accuracy of the trained DNN forensics model is lower than the accuracy of the experimental test, it indicates that the model is underfitting. In this case, the learning rate is reduced and the DNN forensics model is retrained to improve its fitting ability. If the accuracy of the trained DNN forensics model is higher than the accuracy of the experimental test, it indicates that the model is overfitting. In this case, the batch size is increased and the DNN forensics model is retrained to improve its generalization ability. Finally, the DNN forensics method proposed in this embodiment is compared with three models with good forensics performance: Constrained Convolutional Neural Networks (MILSnet), Median filtering forensics based on convolutional neural networks (MFR-CNN), and the machine translation framework A Deep Learning Approach in the Discrete Cosine (DCT-CNN), using the same camera source dataset to compare the forensics accuracy of the proposed model. Calculate the Acc and Loss values for each model to evaluate the accuracy of the proposed model compared to other models.
[0108] Using the above method, the trained dual-stream convolutional neural network forensic model can be optimized, and the optimized model is denoted as the target dual-stream convolutional neural network forensic model.
[0109] Step S4: Input the image to be processed into the target dual-stream convolutional neural network forensic model to obtain the median filtering forensic result.
[0110] This embodiment has obtained the target two-stream convolutional neural network, and the next step is to obtain the forensic results based on the target two-stream convolutional neural network.
[0111] Specifically, the image to be processed is input into the target dual-stream convolutional neural network forensic model to obtain the median filtering forensic result.
[0112] This embodiment first establishes a two-stream convolutional neural network (DNN) model and determines the DNN forensic algorithm and evaluation metrics. A training dataset is used to train the DNN forensic model, obtaining its parameters. An experimental scenario consisting of two median filtering operations is designed to verify the model's forensic accuracy. A test dataset is used to verify the generalization performance of the DNN forensic model. Based on the performance analysis results, the parameters of the trained DNN model are adjusted to optimize it, improving the credibility of image median filtering forensic results. This embodiment provides a two-dimensional discrete cosine transform to convert image information from the spatial domain to the frequency domain, combining spatial and frequency features to form a DNN forensic scheme. This scheme is applied to image median forensics, not only improving the accuracy of median forensic results but also addressing robustness issues under JPEG compression conditions.
[0113] It should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A deep learning-based median filtering forensics method based on dual-domain fusion, characterized in that, The method includes the following steps: Obtain the original image dataset and the images to be processed. Preprocess each original image in the original image dataset and divide the preprocessed original image dataset into a training dataset and a test dataset. A two-stream convolutional neural network (CNN) forensics model is established, and the forensics algorithm and evaluation metrics of the CNN forensics model are determined. The CNN forensics model introduces spatial flow, which consists of four modules, including: The first module consists of only one convolutional layer, using 16 groups of 3×3 convolutional kernels to convolve the input image. The convolutionally processed image is then normalized and passed to the ReLU activation function to generate 16 feature maps. The operation process of the first module is as follows: in, This indicates the output of the first module. Each feature map Indicates the first Group weight matrix, Represents residual mapping, Indicates the activation function; The operation process of the second module is as follows: in, This indicates the output of the second module. There are feature maps, and W represents the set of weight matrices for the second module. This represents the set of all feature maps output by the first module; The operation process of the third module is as follows: in, This indicates the output of the third module. Each feature map This represents the set of all feature maps output by the second module; The operation process of the fourth module is as follows: in, This indicates the output of the fourth module. Each feature map Indicates the average pooling layer. This indicates a global average pooling layer. This represents the set of all feature maps output by the third module; The forensic algorithm for determining the dual-stream convolutional neural network forensic model includes: the dual-stream convolutional neural network forensic model consists of a spatial domain stream and a frequency domain stream; the spatial domain stream receives the input image and extracts median filtering artifact features through convolutional neural network layers; the frequency domain stream preprocesses the input image through two-dimensional discrete cosine transform and extracts frequency domain features using convolutional neural network layers; the features of the spatial domain stream and the features of the spatial domain stream are processed through fully connected layers to obtain output features, and the output features are concatenated together; the input image is classified through a softmax layer; The dual-stream convolutional neural network forensic model is trained based on the training dataset to obtain the model parameters of the trained dual-stream convolutional neural network forensic model; the performance of the dual-stream convolutional neural network forensic model is analyzed based on the test dataset; based on the performance analysis results, the model parameters of the trained dual-stream convolutional neural network forensic model are adjusted to optimize the trained dual-stream convolutional neural network forensic model and obtain the target dual-stream convolutional neural network forensic model. The image to be processed is input into the target dual-stream convolutional neural network forensics model to obtain the median filtering forensics result.
2. The deep learning median filtering forensics method based on dual-domain fusion according to claim 1, characterized in that, Preprocessing is performed on each original image in the original image dataset, including: Each original image in the original image dataset is converted to grayscale and cropped to obtain the preprocessed original image dataset.
3. The deep learning median filtering forensics method based on dual-domain fusion according to claim 1, characterized in that, The step of dividing the preprocessed original image dataset into a training dataset and a test dataset includes: The original images in the preprocessed original image dataset are divided into training and testing datasets in an 8:2 ratio.
4. The deep learning median filtering forensics method based on dual-domain fusion according to claim 1, characterized in that, Establish a two-stream convolutional neural network forensic model, determine the forensic algorithm and evaluation metrics for the two-stream convolutional neural network forensic model, and also include: The two-dimensional discrete cosine transform (DCT) is used to convert information from the spatial domain of an image to the frequency domain. The specific formula for the two-dimensional DCT is as follows: in, This represents the result of a two-dimensional discrete cosine transform, where A represents the original image and cos represents the cosine function. Represents pi (π). This indicates the length of the first dimension. This indicates the length of the second dimension. This represents the coordinate of the first dimension. The current second dimension coordinate, Denotes the basis functions in the first dimension. Describes the basis functions in the second dimension. This represents the coordinates of the first dimension. This represents the coordinates of the second dimension.
5. The deep learning median filtering forensics method based on dual-domain fusion according to claim 1, characterized in that, Accuracy and loss value were used as evaluation metrics.
6. The deep learning median filtering forensics method based on dual-domain fusion according to claim 1, characterized in that, The dual-stream convolutional neural network forensics model is trained based on the aforementioned training dataset to obtain the model parameters of the trained dual-stream convolutional neural network forensics model, including: (1) Randomly initialize the weights and biases of the dual-stream convolutional neural network forensic model; (2) Input the training dataset into the dual-stream convolutional neural network forensic model, and perform calculations through each layer in sequence to obtain the predicted output of the dual-stream convolutional neural network forensic model; (3) Use the cross-entropy loss function to calculate the loss between the predicted output and the true label of the two-stream convolutional neural network forensics model; (4) Calculate the loss function by using the backpropagation algorithm on the gradient of each parameter; (5) Update the weights and biases of the two-stream convolutional neural network forensic model using the stochastic gradient descent algorithm; (6) Repeat (1) to (5) until the loss converges or the preset number of training rounds is reached.
7. The deep learning median filtering forensics method based on dual-domain fusion according to claim 1, characterized in that, The optimization of the trained dual-stream convolutional neural network forensics model, based on performance analysis results, involves adjusting the model parameters and performing the following: If the accuracy of the trained dual-stream convolutional neural network forensic model is lower than the accuracy of the experimental test, the learning rate should be reduced and the dual-stream convolutional neural network forensic model should be retrained; if the accuracy of the trained dual-stream convolutional neural network forensic model is higher than the accuracy of the experimental test, the batch size should be increased and the dual-stream convolutional neural network forensic model should be retrained.
8. The deep learning median filtering forensics method based on dual-domain fusion according to claim 1, characterized in that, After optimizing the trained two-stream convolutional neural network forensics model, the following steps are also included: Calculate the accuracy and loss value of the trained dual-stream convolutional neural network forensic model, and compare the accuracy of the dual-stream convolutional neural network forensic model with other models.
