Image authenticity detection method and device, equipment and storage medium
Through image enhancement processing, tensor extraction and high-frequency feature extraction methods, combined with the ResNet50 network, the problems of insufficient detection accuracy and generalization of AI-generated image detection methods for unknown generative models are solved, and high-precision authenticity detection is achieved.
Patent Information
- Application Number
- CN202510937850.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-08
- Publication Date
- 2025-10-17
AI Technical Summary
Existing AI-generated image detection methods have difficulty effectively detecting unknown generated model images, resulting in insufficient detection accuracy and generalization.
Through image enhancement processing, tensor extraction and high-frequency feature extraction, combined with ResNet50 network training, the adjacent pixel difference and correlation feature extraction algorithm is used, combined with discrete wavelet transform to extract high-frequency features in the frequency domain, and a fusion tensor is formed for detection.
It improves the accuracy and generalization ability of AI-generated image detection, can effectively distinguish real images from AI-generated images, and improves the ability to extract artifact features of unknown generation models.
Smart Images

Figure CN120808024A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image authenticity detection, and in particular to an image authenticity detection method, apparatus, device and storage medium. Background Art
[0002] In recent years, the rapid development of generative AI (such as Stable Diffusion, MidJourney, and DALL E) has made AI-generated images, videos, and audio increasingly realistic, even to the point of being indistinguishable from the real thing. This technological advancement has brought tremendous creativity, but it has also raised numerous social, ethical, and security issues. For example, AI-generated images could be used to mislead the public through the creation of fake news; AI could also mimic the style of specific artists, infringing on the rights of the original creators. Therefore, AI-generated image detection has become a critical technical requirement, aiming to distinguish real images from AI-generated ones to maintain information authenticity, safeguard security, and maintain social trust.
[0003] As generative technology continues to advance and generative models emerge in an endless stream, the challenge of AI-generated image detection lies in how to enable the designed model to effectively detect unknown generative model images. In recent years, many methods have been dedicated to addressing this difficulty. Summary of the Invention
[0004] To improve the detection accuracy and generalization of AI-generated image detection methods, the present invention provides an image authenticity detection method, apparatus, device, and storage medium; On the one hand, a method for detecting image authenticity is provided, comprising: Obtain a data set, wherein the data set is an image with known true or false classification labels; perform image enhancement processing on each image in the data set to obtain a plurality of enhanced images; Performing tensor extraction on each enhanced image to obtain M initialization tensors; performing high-frequency feature extraction on each enhanced image to obtain a high-frequency feature tensor; wherein M is a positive integer; fusing the high-frequency feature tensor of each enhanced image with the M initialization tensors to obtain a fused tensor; The dataset is divided into a training set and a test set according to a set ratio; the training set is input into the image detection network to train the network; the test set is input into the trained image detection network to test the network; the network that passes the test is used as the final trained image detection network; Obtain the image to be detected, input the image to be detected into the final trained image detection network, and obtain the true or false detection result of the image to be detected. On the other hand, an image authenticity detection system is provided, comprising: The acquisition module is configured to: acquire a data set, the data set being images with known true or false classification labels; and perform image enhancement processing on each image of the data set to obtain a plurality of enhanced images; The tensor extraction module is configured to: perform tensor extraction on each enhanced image to obtain M initial tensors; perform high-frequency feature extraction on each enhanced image to obtain a high-frequency feature tensor; wherein M is a positive integer; and fuse the high-frequency feature tensor and the M initial tensors of each enhanced image to obtain a fused tensor. The training module is configured to: divide the data set into a training set and a test set according to a set proportion; input the training set into the image detection network to train the network; input the test set into the trained image detection network to test the network; and take the network that passes the test as the final trained image detection network. The output module is configured to: acquire a to-be-detected image; and input the to-be-detected image into the final trained image detection network to obtain a true or false detection result of the to-be-detected image.
[0005] In another aspect, an electronic device is also provided, comprising: a memory for non-transiently storing computer readable instructions; and a processor for running the computer readable instructions, wherein the computer readable instructions, when run by the processor, perform the method of the first aspect.
[0006] In another aspect, a storage medium is also provided, which non-transiently stores computer readable instructions, wherein when the non-transient computer readable instructions are executed by a computer, the method of the first aspect is performed.
[0007] In another aspect, a computer program product is also provided, which comprises a computer program for implementing the method of the first aspect when run on one or more processors.
[0008] The above technical solution has the following advantages or beneficial effects: The method has high detection accuracy, effectively extracts artifact features of different generation models, is suitable for AI generated image detection tasks, and can accurately distinguish real images from false images. BRIEF DESCRIPTION OF DRAWINGS
[0009] The accompanying drawings, which form a part of this description, are included to provide a further understanding of the application and are incorporated in and constitute a part of this application. The embodiments of the application illustrated in the drawings are intended to explain the aspects of the present application and are not intended to limit the present application in any manner.
[0010] Figure 1A diagram of an AI-generated image detection algorithm based on adjacent pixel difference and correlation for Example One; Figure 2(a) is an original image for Example One; Figure 2(b) is a horizontal difference tensor for Example One; Figure 2(c) is a vertical difference tensor for Example One; Figure 2(d) is a diagonal difference tensor for Example One; Figure 2(e) is an anti-diagonal difference tensor for Example One; Figure 2(f) is a horizontal quotient tensor for Example One; Figure 2(g) is a vertical quotient tensor for Example One; Figure 2(h) is a diagonal quotient tensor for Example One; Figure 2(i) is an anti-diagonal quotient tensor for Example One; Figure 3 ResNet50 network structure for Example One. DETAILED DESCRIPTION
[0011] It should be noted that the following detailed description is exemplary in nature and is intended to provide further description of the present application. 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 application belongs.
[0012] Example One The present embodiment provides an image authenticity detection method; As shown in Figure 1 The image authenticity detection method comprises: S101: obtaining a data set, the data set being images with known true or false classification labels; performing image enhancement processing on each image of the data set to obtain a plurality of enhanced images; S102: performing tensor extraction on each enhanced image to obtain M initialization tensors; performing high-frequency feature extraction on each enhanced image to obtain a high-frequency feature tensor; wherein M is a positive integer; and fusing the high-frequency feature tensor and the M initialization tensors of each enhanced image to obtain a fused tensor; S103: dividing the data set into a training set and a test set according to a set proportion; inputting the training set into an image detection network to train the network; inputting the test set into the trained image detection network to test the network; and taking the network that passes the test as the final trained image detection network; S104: obtaining an image to be detected, inputting the image to be detected into the final trained image detection network to obtain a true or false detection result of the image to be detected. Images with known true and false classification labels, where true images refer to natural images taken; false images are images generated by generative models, such as generative adversarial networks and diffusion models.
[0013] Furthermore, S101: performing image enhancement processing on each image in the data set to obtain a plurality of enhanced images, including: S101-1: Perform a shearing operation on the image; S101-2: Perform a random horizontal flip operation on the image after the shearing operation; S101-3: Perform a random rotation operation on the image after the random horizontal flip operation; S101-4: performing a random mask operation on the image after the random rotation operation; S101-5: Perform normalization on the RGB channels of the image after the random mask operation.
[0014] Exemplarily, multiple data enhancement methods are added in the data preprocessing stage, with the original RGB image as input and the enhanced image features of uniform size as input. The specific process is: use random shearing to cut the image to a fixed size; use random horizontal flipping to make the image have a 0.5 probability of being horizontally flipped and a 0.5 probability of keeping it as it is; use random rotation to generate images from multiple angles; use random masking method to partially mask the image to generate image features with local characteristics; normalize the RGB channels of the image to generate more evenly distributed image data.
[0015] For example, the image is sheared. During the training phase, random shearing is used to shear the image into Size, the image is cropped to size using center cropping during validation and testing phases. Size, finally image.
[0016] For example, a random horizontal flip is applied to the obtained image, with a probability of 0.5 that the image is horizontally flipped and a probability of 0.5 that it remains the same. This method can increase data diversity, help the model learn flip invariance, and does not destroy the correlation between pixels.
[0017] For example, random rotation is applied to the obtained image features, and the range of the image rotation angle is , to enhance the model’s robustness to image orientation changes.
[0018] Exemplarily, the obtained image is converted into a tensor.
[0019] Exemplarily, the obtained features are applied with a random mask. First, a mask initialization matrix with the same size as the image is created, 1 representing retaining the value of the current position, and 0 representing shielding the value of the current position. The size of the mask block is set to , the ratio of the mask block to the image ranges from , and the mask probability is 0.5.
[0020] Exemplarily, the RGB channels of the obtained features are normalized to conform to the standard normal distribution with a mean of and a standard deviation of . The normalized data distribution is more uniform, facilitating the optimizer to quickly find the optimal solution.
[0021] The beneficial effects of the above technical solutions are that the multiple data enhancement methods increase the diversity of the input features, reduce the false image in the training set and the artifact difference of the generated image of the unknown generated model, and improve the generalization ability of the model. The RGB channels of the obtained features are normalized to facilitate the ResNet50 model to learn the input features more quickly.
[0022] Further, the S102: performing tensor extraction on each enhanced image to obtain M initialization tensors, the M initialization tensors including: a pixel difference tensor and a pixel correlation tensor; The pixel difference tensor includes: a first, second, third and fourth tensor; The first tensor refers to replacing each pixel value of the input image with the difference value between the current pixel position and the adjacent right pixel of the current pixel. The second tensor refers to replacing each pixel value of the input image with the difference value between the current pixel position and the adjacent lower pixel of the current pixel. The third tensor refers to replacing each pixel value of the input image with the difference value between the current pixel position and the adjacent lower right corner pixel of the current pixel. The fourth tensor refers to replacing each pixel value of the input image with the difference value between the current pixel position and the adjacent lower left corner pixel of the current pixel.
[0023] The pixel correlation tensor includes: a fifth, sixth, seventh and eighth tensor; The fifth tensor refers to replacing each pixel value of the input image with the quotient value between the current pixel position and the adjacent right pixel of the current pixel. The sixth tensor refers to replacing each pixel value of the input image with the quotient value between the current pixel position and the adjacent lower pixel of the current pixel. The seventh tensor refers to replacing each pixel value of the input image with the quotient value between the current pixel position and the adjacent lower right corner pixel of the current pixel. wherein the eighth tensor is a tensor that replaces each pixel value of the input image with the quotient of the current pixel position and the pixel adjacent to the lower left corner of the current pixel.
[0024] Exemplarily, as shown in FIG. 2(a)~2(i), the value at each position of the first tensor is replaced with the difference between the value at the corresponding position of the input image and the value at the adjacent right position, and the value at the last column of the first tensor is the value at the last column of the input image, to obtain the feature map (1) The value at each position of the second tensor is replaced with the difference between the value at the corresponding position of the input image and the value at the adjacent lower position, and the value at the last row of the second tensor is the value at the last row of the input image, to obtain the feature map (2) The value at each position of the third tensor is replaced with the difference between the value at the corresponding position of the input image and the value at the adjacent lower right position, and the value at the last column and the last row of the third tensor is the value at the last column and the last row of the input image, to obtain the feature map (3) The value at each position of the fourth tensor is replaced with the difference between the value at the corresponding position of the input image and the value at the adjacent lower right position, and the value at the first column and the last row of the fourth tensor is the value at the first column and the last row of the input image, to obtain the feature map (4) The pixel correlation tensor is generated: The value at each position of the fifth tensor is replaced with the quotient of the value at the corresponding position of the input image and the value at the adjacent right position, to obtain the feature map (5) The value at each position of the sixth tensor is replaced with the quotient of the value at the corresponding position of the input image and the value at the adjacent lower position, to obtain the feature map (6) The value at each position of the seventh tensor is replaced with the quotient of the value at the corresponding position of the input image and the value at the adjacent lower right position, to obtain the feature map (7) The value at each position of the eighth tensor is replaced with the quotient of the value at the corresponding position of the input image and the value at the adjacent lower left position, to obtain the feature map (8) The beneficial effects of the above technical solutions are: the difference calculation converts the original image into a set of feature maps highlighting the irregularities of local pixel distribution, instead of directly relying on the global content of the image or the pixel values themselves, focusing on the absolute changes between adjacent pixels, capturing the ubiquitous edge micro-abnormalities in fake images, and highlighting the local pixel distribution irregularities in AI-generated images. The quotient feature map provides a complementary perspective to the difference by calculating the ratio of adjacent pixels. Unlike the difference feature map, which focuses on absolute changes, the quotient feature map focuses on relative changes, highlighting subtle image distribution differences and artifacts in generated images. For example, in areas with irregular small pixel value changes, smaller differences may correspond to larger ratios, thereby amplifying the abnormal signals in these areas.
[0025] Further, the S102: extracting high-frequency features of each enhanced image to obtain a high-frequency feature tensor, comprising: using discrete wavelet transform to process each enhanced image to obtain a high-frequency feature tensor.
[0026] Illustratively, the image features are converted into frequency features using discrete wavelet transform to obtain high-frequency components of the first-level wavelet decomposition. The image features are converted into frequency features using discrete wavelet transform, and the wavelet basis is selected as biorthogonal wavelet transform. The diagonal line direction component of the obtained high-frequency component of the first-level decomposition is reshaped to the original input image size to obtain high-frequency features.
[0027] The beneficial effects of the above technical solutions are: since the difference and quotient are extracted in the spatial domain to extract abnormal artifact information, there is a certain limitation. Therefore, the present application uses discrete wavelet transform to extract high-frequency features of the image in the frequency domain, extracts local edge details of the generated image in the frequency domain complementary to the spatial domain, and highlights the pixel distribution irregularities. By combining the spatial and frequency domain methods, more comprehensive abnormal artifact features are provided for the classifier Further, the S102: fusing the high-frequency feature tensor of each enhanced image and M initialized tensors to obtain a fused tensor, comprising: concatenating all tensors according to the channel dimension to obtain a fused tensor.
[0028] The obtained 9 tensors are concatenated according to the channel to obtain a tensor with a size of .
[0029] The beneficial effects of the above technical solutions are: the tensors are concatenated in the channel dimension, avoiding feature attenuation caused by summation or averaging operations, and preserving the original information of each tensor. Through convolution operation, the information of each tensor can be exchanged to fully utilize the information of each tensor.
[0030] Further, the S103: the data set is divided into training set and test set according to the set proportion;The training set is input into the image detection network, and the network is trained, and the loss function used in the training process is: (9) Wherein, The total number of labels is The Sigmoid function is The real label of each sample is Indicates The probability of being predicted correctly.
[0031] The beneficial effects of the above technical scheme are: the BCEWithLogitsLoss loss effectively handles the class imbalance problem, provides a larger gradient signal when predicting errors, and accelerates difficult sample learning.
[0032] Further, the S103: the data set is divided into training set and test set according to the set proportion;The training set is input into the image detection network, and the fusion tensor is taken as the input value of the network, and the label is taken as the output value of the network, and the weight of the network is adjusted.
[0033] Further, the S103: the data set is divided into training set and test set according to the set proportion;The training set is input into the image detection network, and the network is trained, wherein the image detection network comprises: The first convolutional layer, the first normalization layer, the first activation function layer, the first maximum pooling layer, the first bottleneck module, the second bottleneck module, the third bottleneck module, the fourth bottleneck module, the global average pooling layer and the full connection layer are connected in sequence; The first bottleneck module comprises: the first bottleneck unit, the second bottleneck unit and the third bottleneck unit connected in sequence; The second bottleneck module comprises: the fourth bottleneck unit, the fifth bottleneck unit, the sixth bottleneck unit and the seventh bottleneck unit connected in sequence; The third bottleneck module comprises: the eighth bottleneck unit, the ninth bottleneck unit, the tenth bottleneck unit, the eleventh bottleneck unit, the twelfth bottleneck unit and the thirteenth bottleneck unit connected in sequence; The fourth bottleneck module comprises: the fourteenth bottleneck unit, the fifteenth bottleneck unit and the sixteenth bottleneck unit connected in sequence.
[0034] The internal structures of the first bottleneck unit, the second bottleneck unit, the third bottleneck unit, the fourth bottleneck unit, the fifteenth bottleneck unit and the sixteenth bottleneck unit are consistent;The first bottleneck unit comprises: the second convolutional layer, the third convolutional layer and the fourth convolutional layer connected in sequence;The input end of the second convolutional layer is also connected with the output end of the fourth convolutional layer.
[0035] For example, a convolution with a kernel size of 2 and a stride of 2 is designed, and the input tensor of size 4x4x64 is transformed into a tensor of size 2x2x64. The tensor feature of size 4x4x64 is normalized, activated by a ReLU function, and then passed through a max pooling layer to obtain a tensor of size 2x2x64.
[0036] The obtained feature map is input into the first bottleneck module, Figure 3 The ResNet50 network in the above formula is composed of 4 groups of bottleneck modules. After the feature map passes through the first bottleneck module, it is mapped to a feature map of size 1x1x512. After the feature map passes through the second bottleneck module, it is mapped to a feature map of size 1x1x256. After the feature map passes through the third bottleneck module, it is mapped to a feature map of size 1x1x128. After the feature map passes through the fourth bottleneck module, it is mapped to a feature map of size 1x1x64. Finally, through a tensor flattening operation, the input image is converted into a two-dimensional form, and input into a fully connected layer for classification. x
[0037] The beneficial effects of the above technical solutions are: the hierarchical structure (4 stages) of ResNet50 naturally adapts to the multi-source feature of channel splicing: shallow convolution focuses on edge details, and deep convolution analyzes semantic information of the initialized tensor. The jump connection effectively alleviates the gradient dispersion problem caused by splicing the tensor. When fine-tuning on the ImageNet pre-trained model, the convergence speed is much faster than that of ordinary CNN.
[0038] The network is trained using the ProGAN standard dataset in AIGCDetectBenchmark. The training set contains 20 categories, each with 18,000 real images and 18,000 fake images, a total of 720,000 images. The network uses a binary classification supervision strategy during training, with output labels of 0 and 1, where 0 represents a real image and 1 represents a fake image.
[0039] The BCEWithLogitsLoss loss is used as the loss of the network , which is a combination of Sigmoid and binary cross-entropy loss.
[0040] The settings of the model overall training parameters are shown in Table 1. The parameters of the trained network are saved.
[0041] Table 1 Settings of model overall training parameters
[0042] So far, the entire network model of the application is constructed and trained, and the weight file is saved.
[0043] When detecting the image, the complete process shown in the figure is performed, and the final classification result is obtained by using the trained weight parameters. Figure 1
[0044] To prove the effectiveness of the application, the UniversalFakeDetect and GenImage test sets are used for testing to verify the AI generated image detection performance of the application. The UniversalFakeDetect test set contains 8 diffusion model image sets and their variants, each of which contains 2k generated images and real images; the GenImage test set contains 7 diffusion model data sets and 1 GAN model, each of which contains 12k generated images and real images.
[0045] The application is compared with other deep learning-based AI generated image detection algorithms (CNNSpot proposed by Wang et al., FreDetect proposed by Frank et al., Lgrad proposed by Tan et al., NRP, FreqNet, FatFormer proposed by Liu et al., SSP proposed by Chen et al., AIDE proposed by Yan et al., and SAFE proposed by Li et al.).
[0046] Table 2 shows the performance of the application and 10 AI generated detection methods on the UniversalFakeDetect test set. As shown in Table 2, the application has high detection accuracy, reaches the highest accuracy on 7 diffusion models, and the average accuracy is 2.2% higher than the optimal AIDE method.
[0047] Table 3 shows the performance comparison of the application and 10 AI generated detection methods on the GenImage test set. Among them, the application reaches the highest performance on three generated models and the second highest performance on multiple generated models, and the average accuracy is 1.35% higher than the optimal SAFE method.
[0048] Table 2 Performance comparison of the application and 10 AI generated detection methods on the UniversalFakeDetect test set
[0049] Table 3 The values of the application and 10 AI-generated detection methods on the GenImage test set Value comparison
[0050] From The numerical value shows that the AI-generated image detection method based on the difference and correlation of adjacent pixels proposed in the application improves the model's general pseudo-extraction ability for unknown generation models, and realizes the AI-generated image detection function with high generalization.
[0051] The application comprises data enhancement, adjacent pixel difference and correlation feature extraction algorithm and backbone network. The steps are: performing data enhancement on RGB image data. The difference and quotient value of the adjacent pixels of the enhanced image features in the horizontal direction, vertical direction and two diagonal directions are taken respectively, and the original image is converted into a feature map that highlights the local pixel relationship, instead of directly relying on the global content or pixel value of the image itself. First, the difference feature map extracts the global mutation features of the fake image by calculating the difference of the adjacent pixels in four directions; second, the quotient feature map provides a complementary perspective to the difference value by calculating the ratio of the adjacent pixels. Unlike the difference value, which focuses on absolute change, the quotient value reflects relative change, which is scale-invariant to some extent and can capture patterns independent of the overall brightness or contrast of the image; in addition, discrete wavelet transform is introduced to extract high-frequency features, which enable the model to capture subtle details in the frequency domain, complementing the above methods in space and frequency. The features extracted by this method can accurately capture the subtle difference artifacts between real images and fake images, realizing the high generalization of the AI-generated image detection method.
[0052] Example two The embodiment provides an image authenticity detection system; The image authenticity detection system comprises: An acquisition module configured to: acquire a data set, the data set being images with known true or false classification labels; and perform image enhancement processing on each image of the data set to obtain a plurality of enhanced images; A tensor extraction module configured to: perform tensor extraction on each enhanced image to obtain M initialized tensors; and perform high-frequency feature extraction on each enhanced image to obtain a high-frequency feature tensor; wherein M is a positive integer; and fuse the high-frequency feature tensor and the M initialized tensors of each enhanced image to obtain a fused tensor; The training module is configured to: divide the data set into a training set and a test set according to a set proportion; input the training set into the image detection network to train the network; input the test set into the trained image detection network to test the network; and take the network that passes the test as a final trained image detection network. The output module is configured to: obtain a to-be-detected image, input the to-be-detected image into the final trained image detection network, and obtain a true or false detection result of the to-be-detected image. It should be noted that the above acquisition module, tensor extraction module, training module and output module correspond to steps S101 to S104 in Embodiment One, and the above modules have the same examples and application scenarios as the corresponding steps, but are not limited to the content disclosed in Embodiment One. It should be noted that the above modules as part of the system can be executed in a computer system such as a set of computer executable instructions.
[0053] The description of each embodiment in the above embodiments has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0054] The proposed system can be implemented in other ways. For example, the system embodiments described above are only illustrative, for example, the division of the above modules is only a logical function division, and in actual implementation, there can be another division way, for example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.
[0055] Embodiment Three The embodiment also provides an electronic device, including: one or more processors, one or more memories, and one or more computer programs; wherein the processor is connected with the memory, and the one or more computer programs are stored in the memory; when the electronic device is running, the processor executes the one or more computer programs stored in the memory, so that the electronic device executes the method in Embodiment One.
[0056] It should be understood that in the embodiment, the processor can be a central processing unit CPU, and the processor can also be other general-purpose processors, digital signal processors DSPs, application-specific integrated circuits ASICs, ready-to-program gate arrays FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0057] The memory can include read-only memory and random access memory, and provide instructions and data for the processor, and a part of the memory can also include non-volatile random access memory. For example, the memory can also store device type information.
[0058] In the implementation process, each step of the above method can be completed by integrated logic circuit of hardware in the processor or instructions in the form of software.
[0059] The method in the embodiment one can be directly embodied as hardware processor execution completion, or executed by hardware and software module combination in the processor. The software module can be located in the mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, register, etc. The storage medium is located in the memory, and the processor reads the information in the memory, and combines the hardware to complete the steps of the above method. To avoid repetition, it will not be described in detail here.
[0060] Those skilled in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments can be realized in electronic hardware or combination of computer software and electronic hardware. Whether the functions are executed in hardware or software mode depends on the specific application and design constraints of the technical solution. The professional technicians can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0061] Embodiment four The embodiment also provides a computer readable storage medium for storing computer instructions, which are executed by a processor to complete the method described in embodiment one.
[0062] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. An image authenticity detection method, characterized in that: include: Obtain a data set, wherein the data set is an image with known true and false classification labels; Perform image enhancement processing on each image in the data set to obtain several enhanced images; Perform tensor extraction on each enhanced image to obtain M initialization tensors; Extract high-frequency features from each enhanced image to obtain a high-frequency feature tensor; where M is a positive integer; fuse the high-frequency feature tensor of each enhanced image with the M initialization tensors to obtain a fused tensor; The dataset is divided into a training set and a test set according to a set ratio; the training set is input into the image detection network to train the network; the test set is input into the trained image detection network to test the network; the network that passes the test is used as the final trained image detection network; Obtain the image to be detected, input the image to be detected into the final trained image detection network, and obtain the true or false detection result of the image to be detected.
2. The image authenticity detection method according to claim 1, wherein: The image enhancement process is performed on each image in the data set to obtain a plurality of enhanced images, including: Perform a cut operation on the image; Perform random horizontal flipping on the image after the shearing operation; Perform random rotation on the image after random horizontal flipping; Perform random masking on the image after random rotation; Normalize the RGB channels of the image after the random mask operation.
3. The image authenticity detection method according to claim 1, wherein: Performing tensor extraction on each enhanced image to obtain M initialization tensors, wherein the M initialization tensors include: a pixel difference tensor and a pixel correlation tensor; The pixel difference tensor includes: first, second, third and fourth tensors; The first tensor is the value of each pixel in the input image replaced by the difference between the pixel at the current pixel position and the pixel to the right of the current pixel. The second tensor is the value of each pixel in the input image replaced by the difference between the pixel at the current pixel position and the pixel directly below the current pixel. The third tensor replaces each pixel value of the input image with the difference between the pixel at the current pixel position and the pixel at the lower right corner adjacent to the current pixel. Among them, the fourth tensor refers to replacing each pixel value of the input image with the difference between the pixel at the current pixel position and the pixel in the lower left corner adjacent to the current pixel.
4. The image authenticity detection method according to claim 3, wherein: The pixel correlation tensor includes: a fifth, a sixth, a seventh, and an eighth tensor; Among them, the fifth tensor refers to replacing each pixel value of the input image with the quotient of the pixel at the current pixel position and the pixel to the right of the current pixel; The sixth tensor is the value of each pixel in the input image replaced by the quotient of the pixel at the current pixel position and the pixel immediately below the current pixel. Among them, the seventh tensor refers to replacing each pixel value of the input image with the quotient of the pixel at the current pixel position and the pixel adjacent to the lower right corner of the current pixel; Among them, the eighth tensor refers to replacing each pixel value of the input image with the quotient of the pixel at the current pixel position and the pixel in the lower left corner adjacent to the current pixel.
5. The image authenticity detection method according to claim 3, wherein: The value at each position of the first tensor is replaced by the difference between the value of the corresponding position of the input image and the value of the adjacent right position. The value of the last column of the first tensor is the value of the last column of the corresponding input image, and the feature map is obtained. : ; The value at each position of the second tensor is replaced by the difference between the value of the corresponding position in the input image and the value of the adjacent position below. The value of the last row of the second tensor is the value of the last row of the corresponding input image, and the feature map is obtained. : ; The value at each position of the third tensor is replaced by the difference between the corresponding position of the input image and the adjacent lower right corner position value, and the value of the last column and the last row of the third tensor is the value of the last column and the last row of the corresponding input image to obtain the feature map : ; The value at each position of the fourth tensor is replaced by the difference between the corresponding position of the input image and the adjacent lower right corner position. The values of the first column and the last row of the fourth tensor are the values of the first column and the last row of the corresponding input image, and the feature map is obtained. : 。 6. The image authenticity detection method according to claim 4, wherein: Generate a pixel correlation tensor: The value at each position of the fifth tensor is replaced by the quotient of the corresponding position of the input image and the value of the adjacent right position to obtain the feature map : ; The value at each position of the sixth tensor is replaced by the quotient of the corresponding position of the input image and the value of the adjacent position below to obtain the feature map : ; The value at each position of the seventh tensor is replaced by the quotient of the corresponding position of the input image and the value of the adjacent lower right corner position to obtain the feature map : ; The value at each position of the eighth tensor is replaced by the quotient of the corresponding position of the input image and the value of the adjacent lower left corner position to obtain the feature map : 。 7. Image authenticity detection system, characterized by, include: An acquisition module is configured to: acquire a data set, wherein the data set is an image with known true or false classification labels; Perform image enhancement processing on each image in the data set to obtain several enhanced images; The tensor extraction module is configured to: perform tensor extraction on each enhanced image to obtain M initialization tensors; perform high-frequency feature extraction on each enhanced image to obtain a high-frequency feature tensor, where M is a positive integer; and fuse the high-frequency feature tensor of each enhanced image with the M initialization tensors to obtain a fused tensor; The training module is configured to: divide the data set into a training set and a test set according to a set ratio; input the training set into the image detection network to train the network; input the test set into the trained image detection network to test the network; and use the network that passes the test as the final trained image detection network; The output module is configured to: obtain the image to be detected, input the image to be detected into the finally trained image detection network, and obtain the true or false detection result of the image to be detected.
8. An electronic device, comprising: a memory for non-transitory storage of computer-readable instructions; as well as a processor for executing said computer-readable instructions, When the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 6 is executed.
9. A storage medium, characterized in that: Non-transitory storage of computer-readable instructions, wherein when the non-transitory computer-readable instructions are executed by a computer, the method according to any one of claims 1 to 6 is performed.
10. A computer program product, characterized in that The invention comprises a computer program for implementing the method according to any one of claims 1 to 6 when the computer program is run on one or more processors.