Image detection method and device, readable medium and electronic equipment

CN115294662BActive Publication Date: 2026-08-21BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210940334.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-05
Publication Date
2026-08-21
Estimated Expiration
2042-08-05

AI Technical Summary

Technical Problem

而相关技术中的图像真伪检测技术存在检测正确率低的问题

Benefits of technology

[0016]根据本公开实施例的第三方面,提供一种计算机可读介质,其上存储有计算机程序,所述计算机程序被处理装置执行时实现本公开第一方面所述方法的步骤。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115294662B_ABST
    Figure CN115294662B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an image detection method, device, readable medium and electronic equipment. The method comprises: acquiring a target image to be detected, performing residual extraction processing on the target image to obtain a to-be-determined image; inputting the to-be-determined image into a pre-trained first detection model to obtain a first authenticity detection result corresponding to the target image; inputting the target image into a pre-trained second detection model to obtain a second authenticity detection result corresponding to the target image; and determining a target authenticity detection result corresponding to the target image according to the first authenticity detection result and the second authenticity detection result. In this way, the original target image and the to-be-determined image after residual extraction processing are detected for authenticity by two detection models respectively, and finally the authenticity detection results of the two methods are fused to obtain the target authenticity detection result, so that the accuracy of image authenticity detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image processing technology, and more specifically, to an image detection method, apparatus, readable medium, and electronic device. Background Technology

[0002] With the advancement of computer technology, deepfake face synthesis techniques have emerged in large numbers, leading to a surge of forged images and videos, particularly those created using deepfake faces, flooding the internet and attracting widespread public attention. Therefore, face forgery detection technology is crucial, and this field has become an important research direction in digital image forensics in recent years. Especially in recent years, with the technological updates and iterations of face forgery techniques, the realism, resolution, and ability to resist forgery detection of synthesized forged faces have significantly improved. However, related image authentication techniques still suffer from low accuracy. Summary of the Invention

[0003] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0004] According to a first aspect of the present disclosure, an image detection method is provided, the method comprising:

[0005] Acquire the target image to be detected;

[0006] The target image is subjected to residual extraction processing to obtain the image to be determined;

[0007] The image to be determined is input into a pre-trained first detection model to obtain the first true / false detection result corresponding to the target image;

[0008] The target image is input into a pre-trained second detection model to obtain a second true / false detection result corresponding to the target image;

[0009] Based on the first authenticity detection result and the second authenticity detection result, the authenticity detection result of the target image is determined.

[0010] According to a second aspect of the present disclosure, an image detection apparatus is provided, the apparatus comprising:

[0011] The image acquisition module is used to acquire the target image to be detected;

[0012] The residual extraction module is used to perform residual extraction processing on the target image to obtain the image to be determined;

[0013] The first detection module is used to input the image to be determined into a pre-trained first detection model to obtain the first true / false detection result corresponding to the target image;

[0014] The second detection module is used to input the target image into a pre-trained second detection model to obtain a second true / false detection result corresponding to the target image;

[0015] The target detection module is used to determine the target authenticity detection result corresponding to the target image based on the first authenticity detection result and the second authenticity detection result.

[0016] According to a third aspect of the present disclosure, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect of the present disclosure.

[0017] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising:

[0018] A storage device on which computer programs are stored;

[0019] A processing device for executing the computer program in the storage device to implement the steps of the method described in the first aspect of this disclosure.

[0020] The above technical solution involves acquiring a target image to be detected, performing residual extraction on the target image to obtain a pending image, inputting the pending image into a pre-trained first detection model to obtain a first authenticity detection result for the target image, inputting the target image into a pre-trained second detection model to obtain a second authenticity detection result for the target image, and determining the target authenticity detection result based on the first and second authenticity detection results. In this way, by using two detection models to perform authenticity detection on the original target image and the pending image after residual extraction, respectively, and finally fusing the authenticity detection results from the two methods to obtain the target authenticity detection result, the accuracy of image authenticity detection can be improved.

[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0022] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings:

[0023] Figure 1This is a flowchart illustrating an image detection method according to an exemplary embodiment.

[0024] Figure 2 It is based on Figure 1 The illustrated embodiment shows a flowchart of step S102.

[0025] Figure 3 This is a schematic diagram illustrating a method for obtaining a target image by performing residual extraction processing according to an exemplary embodiment.

[0026] Figure 4 This is a flowchart illustrating a model training method according to an exemplary embodiment.

[0027] Figure 5 This is a flowchart illustrating a method for obtaining a first training sample set according to an exemplary embodiment.

[0028] Figure 6 This is a schematic diagram illustrating a method for acquiring region-enhanced sample images according to an exemplary embodiment.

[0029] Figure 7 This is a flowchart illustrating another model training method according to an exemplary embodiment.

[0030] Figure 8 This is a block diagram illustrating an image detection apparatus according to an exemplary embodiment.

[0031] Figure 9 This is a block diagram illustrating another image detection apparatus according to an exemplary embodiment.

[0032] Figure 10 This is a block diagram illustrating another image detection apparatus according to an exemplary embodiment.

[0033] Figure 11 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation

[0034] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0035] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0036] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0037] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0038] It should be noted that the terms "one" and "multiple" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that they should be understood as "one or more" unless explicitly stated in the context. In the description of this disclosure, unless otherwise stated, "multiple" means two or more, and other quantifiers are similar; "at least one of the following," "one or more," or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, one or more of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple; "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural.

[0039] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0040] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0041] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.

[0042] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0043] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0044] Meanwhile, it is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0045] It should be noted that all actions involving the acquisition of signals, information, or data in this disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the location is situated, and with authorization from the owner of the relevant device.

[0046] First, the application scenarios of this disclosure will be explained. This disclosure can be applied to image detection scenarios, especially image authenticity detection scenarios, such as face authenticity detection.

[0047] With the continuous advancements in face spoofing technology, the realism, resolution, and anti-spoofing capabilities of synthesized fake faces have significantly improved. However, most face authentication techniques in these technologies only possess a certain ability to identify learned face spoofing methods, and their ability to handle complex post-processing, image or video compression issues in real-world applications is very limited. Furthermore, the accuracy of these methods drops significantly when faced with unknown, novel face spoofing techniques.

[0048] To address the aforementioned issues, this disclosure provides an image detection method, apparatus, readable medium, and electronic device. The method employs two detection models to perform authenticity detection on the original target image and the image to be determined after residual extraction processing, respectively. Finally, the authenticity detection results from the two methods are fused to obtain the target authenticity detection result, thereby improving the accuracy of image authenticity detection.

[0049] The present disclosure will now be described in conjunction with specific embodiments.

[0050] Figure 1 This is an image detection method illustrated according to an exemplary embodiment, which can be applied to electronic devices. These electronic devices may include terminal devices such as smartphones, smart wearable devices, smart speakers, smart tablets, PDAs (Personal Digital Assistants), CPEs (Customer Premise Equipment), personal computers, in-vehicle terminals, etc.; the electronic device may also include a server, such as a local server or a cloud server. Figure 1 As shown, the method may include:

[0051] S101. Obtain the target image to be detected.

[0052] In this step, the target image can be acquired in real time, a pre-stored target image can be obtained, or the target image sent by other devices can be received. This disclosure does not limit the method of acquiring the target image. The target image can be a picture or a video, and this disclosure does not limit the type of target image.

[0053] S102. Perform residual extraction processing on the target image to obtain the image to be determined.

[0054] The residual extraction process can be used to obtain the pixel differences between adjacent pixels of the target image, and then obtain the image to be determined based on the pixel differences.

[0055] In this way, the absolute pixel information of the target image can be weakened through this residual extraction process, and more attention can be paid to the relative residual features between adjacent pixels of the target image, highlighting the noise patterns and texture information of the target image, so as to more accurately detect and identify the authenticity of the image.

[0056] S103. Input the image to be determined into the pre-trained first detection model to obtain the first true / false detection result corresponding to the target image.

[0057] S104. Input the target image into the pre-trained second detection model to obtain the second true / false detection result corresponding to the target image.

[0058] It should be noted that the first detection model can be trained using images after residual extraction as training samples, so that the first detection model can detect the given image more accurately. Similarly, the second detection model can be trained using the original image without residual extraction as training samples.

[0059] S105. Based on the first and second authenticity detection results, determine the authenticity detection result of the target image.

[0060] For example, the first and second authenticity detection results can be fused to obtain the target authenticity detection result. The fusion method can include averaging, voting, etc., and this disclosure does not limit it.

[0061] In some embodiments, the target image can be any image, and the target authenticity detection result is used to characterize whether the target image has been tampered with. If the target image has been tampered with, the target authenticity detection result is "fake"; otherwise, the target authenticity detection result is "real".

[0062] In other embodiments, the target image may be an image including a face, and the result of the target authenticity detection is used to characterize whether the face has been tampered with.

[0063] In other embodiments, the target image may be an image including the target object, and the target authenticity detection result is used to characterize whether the target object has been tampered with.

[0064] Using the above method, the target image to be detected is acquired, and residual extraction processing is performed on the target image to obtain a pending image. The pending image is then input into a pre-trained first detection model to obtain a first true / false detection result corresponding to the target image. The target image is then input into a pre-trained second detection model to obtain a second true / false detection result corresponding to the target image. Based on the first and second true / false detection results, the target true / false detection result corresponding to the target image is determined. In this way, by using two detection models to perform true / false detection on the original target image and the pending image after residual extraction processing, respectively, and finally fusing the true / false detection results from the two methods to obtain the target true / false detection result, the accuracy of image true / false detection can be improved.

[0065] In some embodiments, the first detection model and the second detection model are both binary classification models. For example, the first authenticity detection result corresponding to the target image may include two categories: "real" and "fake". Similarly, the second authenticity detection result corresponding to the target image may also include two categories: "real" and "fake".

[0066] Thus, step S105 above can directly fuse the first and second authenticity detection results to obtain the target authenticity detection result corresponding to the target image.

[0067] In other embodiments, one or both of the first and second detection models described above can be three-class classification models. For example, the first authenticity detection result corresponding to the target image can include three categories: "real", "fake" and "enhanced"; the second authenticity detection result corresponding to the target image can also include three categories: "real", "fake" and "enhanced".

[0068] Thus, after fusing the first and second authenticity detection results in step S105 above, a three-classification result can also be obtained. The "fake" and "enhancement" in the fused three-classification result are both equivalent to "fake", thereby obtaining the final two-classification result. This two-classification result is used as the authenticity detection result of the target image.

[0069] Figure 2 It is based on Figure 1 The illustrated embodiment shows a flowchart of step S102. Figure 2 As shown, step S102 above may include the following sub-steps:

[0070] S1021. Perform grayscale processing on the target image to obtain the first grayscale image.

[0071] For example, when the target image is a color image, grayscale processing can be performed to remove the color information of the image, resulting in a first grayscale image. This grayscale processing can include any one of the following methods: component method, maximum value method, average value method, and weighted average method. Specifically: the component method uses the brightness of the three components (RBG) in the color image as the grayscale values ​​of the three grayscale images; any grayscale image can be selected according to application needs. The maximum value method uses the maximum value of the three brightness components in the color image as the grayscale value of the grayscale image. The average value method averages the brightness of the three components in the color image to obtain a grayscale value. The weighted average method weights the three components with different weights based on importance and other indicators; for example, the weight of R can be set to 0.299, the weight of G to 0.578, and the weight of B to 0.114.

[0072] In some embodiments, the grayscale value of each pixel in the first grayscale image can be between 0 and 255.

[0073] S1022. Perform horizontal convolution residual calculation on the first grayscale image to obtain the horizontal residual image.

[0074] For example, the horizontal residual image can be calculated using a convolution operation with the [-1,1] operator in the horizontal direction.

[0075] S1023. Perform vertical convolution residual calculation on the first grayscale image to obtain the vertical residual image.

[0076] For example, the vertical residual image can be calculated using a convolution operation with the [-1,1] operator in the vertical direction.

[0077] S1024. Obtain the image to be determined based on the horizontal residual image and the vertical residual image.

[0078] In some embodiments, the horizontal residual image and the vertical residual image can be superimposed to obtain a superimposed residual image; this superimposed residual image is used as the aforementioned image to be determined.

[0079] In other embodiments, the horizontal residual image and the vertical residual image can be superimposed to obtain a superimposed residual image; and the superimposed residual image can be normalized to obtain the aforementioned undetermined image.

[0080] It should be noted that the above normalization process can process the data according to a preset algorithm, limiting the processed data to a certain preset range. Through normalization, the statistical distribution of the samples can be summarized and unified. Normalization between 0 and 1 represents a statistical probability distribution, while normalization within a certain interval represents a statistical coordinate distribution. In some embodiments, the superimposed residual image can be normalized to a pixel value range of 0-255 to ensure a uniform distribution.

[0081] In this way, the color information of the target image can be weakened through this residual extraction process, and more attention can be paid to the residual features of the target image, highlighting the noise patterns and texture information of the target image, so as to more accurately detect and identify the authenticity of the image.

[0082] Figure 3 This is a schematic diagram illustrating a method for obtaining a desired image by performing residual extraction processing on a target image according to an exemplary embodiment. For example... Figure 3 As shown, firstly, the target image (e.g., a color image) is converted to grayscale, becoming a first grayscale image. Then, the first grayscale image is subjected to convolution operations with horizontal [-1, 1] operators and vertical [-1, 1] operators respectively to extract noise information, resulting in horizontal and vertical residual images. The two residual images are then superimposed to obtain a superimposed residual image. Finally, the superimposed residual image is normalized to obtain the undetermined image. This undetermined image is input into the backbone network, which can assist in extracting some high-frequency information from the target image, highlighting image noise, and ignoring some color and scene information to aid in feature extraction.

[0083] Figure 4 This is a flowchart illustrating a model training method according to an exemplary embodiment, which can be used to train the aforementioned first detection model. This model training method can be executed by the aforementioned electronic device or by other electronic devices. Figure 4 As shown, the training method includes:

[0084] S401. Obtain the first training sample set.

[0085] The first training sample set includes real sample images and fake sample images. These can be obtained from existing databases or manually retrieved from the internet.

[0086] S402. Perform residual extraction processing on the first training sample set to obtain the second training sample set.

[0087] The second training sample set includes real residual images after residual extraction of real sample images, and fake residual images after residual extraction of fake sample images.

[0088] S403. Train the first neural network model based on the second training sample set, and use the trained first neural network model as the first detection model.

[0089] In this way, the images after residual extraction are used as training samples during the training of the first neural network model, so that the first detection model obtained after training can detect the given image more accurately.

[0090] In another embodiment of this disclosure, the second neural network model can also be trained based on the first training sample set, and the trained second neural network model can be used as the second detection model.

[0091] In this way, sample images without residual extraction were used as training samples during the training of the second neural network model, so that the trained detection model can more accurately detect the original target image.

[0092] In some embodiments, real and fake sample images can be manually collected and labeled, and these labeled real and fake sample images can be used as a first training sample set. Thus, the first training sample set can include both real and fake sample images, and the second training sample set after residual extraction can also include both real and fake sample images. Therefore, the first neural network model can also be a binary classification model (that is, classifying the target image into "real" and "fake" categories). Training the first neural network model with the real and fake sample images from the second training sample set yields a first detection model that is also a binary classification model. Similarly, the second neural network model can also be a binary classification model. Training the second neural network model with the real and fake sample images from the first training sample set yields a second detection model that is also a binary classification model.

[0093] In other embodiments, the first training sample set may include three types of sample images, for example, real sample images, fake sample images, and region-enhanced sample images. The region-enhanced sample images may include images obtained by data-enhancing real sample images according to a target mask, or images obtained by data-enhancing fake sample images according to a target mask. Similarly, the second training sample set also includes region-enhanced residual images obtained by residual extraction from the region-enhanced sample images.

[0094] Thus, training the first neural network model using the second training sample set and using the trained first neural network model as the first detection model can include the following methods:

[0095] Using the labels corresponding to the real residual image, the fake residual image, and the region-enhanced residual image as constraints, the first neural network model is trained in a supervised manner according to the first objective loss function, and the trained first neural network model is used as the first detection model.

[0096] In this embodiment, the first neural network model can also be a three-class classification model (that is, classifying the target image into three categories: "real", "fake", and "enhanced"). By training the first neural network model with real and fake sample images from the second training sample set, a first detection model that is also a three-class classification model can be obtained.

[0097] In some embodiments, the first objective loss function described above may include a cross-entropy loss function. For example, during the training phase, the corresponding labels of the real residual image, the fake residual image, and the region-enhanced residual image can be used as supervision, and backpropagation can be performed using the cross-entropy loss function to update the model parameters.

[0098] It should be noted that the specific methods of supervised training can be found in relevant technologies, and will not be elaborated upon here.

[0099] Furthermore, the labels corresponding to real sample images, fake sample images, and region-enhanced sample images can be used as constraints to conduct supervised training on the second neural network model according to the second objective loss function, and the trained second neural network model can be used as the second detection model.

[0100] Similarly, the second objective loss function mentioned above can also include the cross-entropy loss function, and the second neural network model mentioned above can also be a three-class classification model. By training the second neural network model with real and fake sample images from the first training sample set, a second detection model that is also a three-class classification model can be obtained.

[0101] In this way, a first and second detection model for three-class classification can be trained, further improving the reliability of true and false detection.

[0102] Figure 5 This is a flowchart illustrating a method for obtaining a first training sample set according to an exemplary embodiment. Figure 5 As shown, the method may include:

[0103] S501. Obtain the third training sample set.

[0104] The third training sample set may include real sample images and fake sample images. For example, it may include real sample images and fake sample images collected manually.

[0105] S502. Perform data augmentation processing on the real sample image based on the target mask to obtain the region-enhanced sample image.

[0106] The target mask can be used to determine the first region to be augmented. For example, the target mask can be a pre-set mask. Alternatively, the target mask can be a randomly generated region mask.

[0107] In some embodiments, data augmentation processing can also be performed on the forged sample image based on the target mask to obtain a region-enhanced sample image.

[0108] In other embodiments, data augmentation processing can be performed on both real and fake sample images based on the target mask to obtain more region-enhanced sample images.

[0109] S503. Determine the first training sample set based on real sample images, fake sample images, and region-enhanced sample images.

[0110] The data augmentation process may include one or more of the following target processing types: image compression, Gaussian blur, Gaussian noise, sharpening, color jitter, and elastic transformation.

[0111] In some embodiments, the target weight corresponding to each target processing type can be determined first; then, based on the target mask and the target weight, the real sample image can be subjected to data augmentation processing of at least one target processing type to obtain a region-enhanced sample image. The target weight can be randomly determined. This target weight can also be referred to as the trigger probability.

[0112] In other embodiments, the random parameters and trigger probabilities corresponding to each target processing type can be determined first, and the real sample image can be subjected to data augmentation processing of at least one target processing type according to the random parameters and trigger probabilities to obtain an overall enhanced image; the target region can also be determined according to the target mask; and then the region enhanced sample image can be obtained according to the real sample image, the target region and the overall enhanced image.

[0113] Figure 6 This is a schematic diagram illustrating a method for acquiring region-enhanced sample images according to an exemplary embodiment. Figure 6 As shown, the method may include:

[0114] S11. A global mask is preset. The target mask M is obtained by randomly transforming the global mask. The mask image is obtained based on the target image and the second mask (1-M).

[0115] In order to accelerate the generation speed, a global mask is pre-set in this embodiment. At the same time, in order to ensure the complexity and diversity of the mask, the global mask is randomly transformed. The random transformation includes random dilation, erosion and elastic transformation, which can make the target mask have richer shapes and sizes.

[0116] S12. Determine the random parameters and trigger probability corresponding to each target processing type, and perform one or more target processing types of data augmentation processing on the real sample image according to the random parameters and trigger probability to obtain the overall augmented image.

[0117] The target processing type includes one or more of the following: image compression, Gaussian blur, Gaussian noise, sharpening, color jitter, and elastic transformation.

[0118] It should be noted that the above steps S11 and S12 can be executed sequentially or in parallel in any order, and this disclosure does not limit this.

[0119] S13. Overlay the mask image and the overall enhanced image to obtain the region enhanced image.

[0120] This allows for the generation of enhanced images of regions where the facial noise pattern differs from the background noise pattern.

[0121] In other embodiments of this disclosure, the target mask can be a ring mask, and the data augmentation processing includes motion blur processing; thus, the method of performing data augmentation processing on the real sample image based on the target mask to obtain a region-enhanced sample image can include:

[0122] First, the target edge region of the real sample image is determined based on the ring mask.

[0123] For example, the target edge region can be the edge of the region corresponding to the ring mask; the target edge region can also be the edge region of a face.

[0124] Secondly, motion blur processing is applied to the target edge region to obtain the semi-transparent artifacts corresponding to the target edge region.

[0125] Finally, region-enhanced sample images are obtained based on real sample images and semi-transparent artifacts.

[0126] It should be noted that the inventors discovered that semi-transparent artifacts appear in the edge areas of some forged face images. This phenomenon occurs in certain deep forgery generation networks, where the generation process of face edge areas encounters obstacles in distinguishing between the face and the background, inevitably exposing forgery traces. To assist the model in learning similar forgery traces and expanding the forgery sample dataset, this embodiment can use a ring mask in the target edge area and utilize dynamic blurring to simulate the generation of similar artifacts, thereby assisting model training and improving the accuracy of the trained model in distinguishing between real and fake images.

[0127] Figure 7 This is a flowchart illustrating another model training method according to an exemplary embodiment. Figure 7 As shown, the method may include:

[0128] S701. Obtain the third training sample set.

[0129] The third training sample set may include real sample images and fake sample images. For example, it may include real sample images and fake sample images collected manually.

[0130] S702. Perform data augmentation processing on the real sample image based on the target mask to obtain the region-enhanced sample image.

[0131] S703. Determine the first training sample set based on real sample images, fake sample images, and region-enhanced sample images.

[0132] S704. Perform residual extraction processing on the first training sample set to obtain the second training sample set, and train the first neural network model based on the second training sample set, and use the trained first neural network model as the first detection model.

[0133] S705. Train the second neural network model based on the first training sample set mentioned above, and use the trained second neural network model as the second detection model.

[0134] It should be noted that the specific implementation of the above steps can be found in the detailed description in the foregoing embodiments of this disclosure, and will not be repeated here.

[0135] In this way, by enhancing and expanding the third training sample set, a first training sample set is obtained. After residual extraction processing of the first training sample set, a second training sample set is obtained. Then, a first detection model is trained based on the second training sample set. A second detection model is trained based on the first training sample set. Authenticity detection is performed using the two detection models respectively. Finally, the authenticity detection results of the two methods are fused to obtain the target authenticity detection result, thereby improving the accuracy of image authenticity detection.

[0136] Figure 8 This is a block diagram illustrating an image detection apparatus 800 according to an exemplary embodiment, such as... Figure 8 As shown, the device 800 may include:

[0137] Image acquisition module 801 is used to acquire the target image to be detected;

[0138] The residual extraction module 802 is used to perform residual extraction processing on the target image to obtain the image to be determined;

[0139] The first detection module 803 is used to input the image to be determined into a pre-trained first detection model to obtain the first true / false detection result corresponding to the target image;

[0140] The second detection module 804 is used to input the target image into a pre-trained second detection model to obtain a second true / false detection result corresponding to the target image;

[0141] The target detection module 805 is used to determine the target authenticity detection result corresponding to the target image based on the first authenticity detection result and the second authenticity detection result.

[0142] In some embodiments, the residual extraction module 802 is used to perform grayscale processing on the target image to obtain a first grayscale image; perform horizontal convolution residual calculation on the first grayscale image to obtain a horizontal residual image; perform vertical convolution residual calculation on the first grayscale image to obtain a vertical residual image; and obtain the image to be determined based on the horizontal residual image and the vertical residual image.

[0143] In some embodiments, the residual extraction module 802 is used to superimpose the horizontal residual image and the vertical residual image to obtain a superimposed residual image; and to normalize the superimposed residual image to obtain the image to be determined.

[0144] Figure 9 This is a block diagram of another image detection apparatus according to an exemplary embodiment, such as Figure 9 As shown, the device 800 may further include:

[0145] A first training module 901 is used to acquire a first training sample set, wherein the first training sample set includes real sample images and fake sample images; perform residual extraction processing on the first training sample set to obtain a second training sample set; the second training sample set includes real residual images after residual extraction of the real sample images and fake residual images after residual extraction of the fake sample images; train a first neural network model according to the second training sample set, and use the trained first neural network model as the first detection model.

[0146] In some embodiments, the first training module 901 is configured to acquire a third training sample set; the third training sample set includes the real sample image and the fake sample image; perform data augmentation processing on the real sample image according to the target mask to obtain a region-enhanced sample image; and determine the first training sample set according to the real sample image, the fake sample image and the region-enhanced sample image.

[0147] In some embodiments, the target mask is a randomly generated region mask.

[0148] In some embodiments, the target mask is a ring mask, and the data augmentation process includes motion blur processing; the first training module 901 is used to determine the target edge region of the real sample image according to the ring mask; perform motion blur processing on the target edge region to obtain a semi-transparent artifact corresponding to the target edge region; and obtain the region augmentation sample image according to the real sample image and the semi-transparent artifact.

[0149] In some embodiments, the data augmentation process includes one or more of the following target processing types: image compression, Gaussian blur, Gaussian noise, sharpening, color jitter, and elastic transformation.

[0150] In some embodiments, the first training module 901 is configured to determine the target weight corresponding to each target processing type; and to perform data augmentation processing of at least one of the target processing types on the real sample image according to the target mask and the target weight to obtain the region-enhanced sample image.

[0151] In some embodiments, the second training sample set further includes a region-enhanced residual image after residual extraction of the region-enhanced sample image; the first training module 901 is used to perform supervised training on the first neural network model according to the first objective loss function, using the labels corresponding to the real residual image, the fake residual image and the region-enhanced residual image as constraints, and using the trained first neural network model as the first detection model.

[0152] Figure 10 This is a block diagram illustrating another image detection apparatus according to an exemplary embodiment, such as... Figure 10 As shown, the device 800 may further include:

[0153] The second training module 902 is used to train the second neural network model based on the first training sample set, and use the trained second neural network model as the second detection model.

[0154] In some embodiments, the second training module 902 is used to perform supervised training on the second neural network model according to the second objective loss function, using the labels corresponding to the real sample image, the fake sample image and the region-enhanced sample image as constraints, and using the trained second neural network model as the second detection model.

[0155] In some embodiments, the target image is an image including a human face, and the target authenticity detection result is used to characterize whether the human face has been tampered with.

[0156] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0157] The following is for reference. Figure 11 This document illustrates a structural diagram of an electronic device 2000 (e.g., a terminal device or a server) suitable for implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. The server in the embodiments of the present disclosure may include, but is not limited to, local servers, cloud servers, single servers, and distributed servers. Figure 11 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0158] like Figure 11As shown, electronic device 2000 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 2001, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 2002 or a program loaded from storage device 2008 into random access memory (RAM) 2003. RAM 2003 also stores various programs and data required for the operation of electronic device 2000. Processing device 2001, ROM 2002, and RAM 2003 are interconnected via bus 2004. Input / output (I / O) interface 2005 is also connected to bus 2004.

[0159] Typically, the following devices can be connected to the input / output interface 2005: input devices 2006 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 2007 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 2008 including, for example, magnetic tapes, hard disks, etc.; and communication devices 2009. Communication device 2009 allows electronic device 2000 to communicate wirelessly or wiredly with other devices to exchange data. Although... Figure 11 An electronic device 2000 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0160] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 2009, or installed from storage device 2008, or installed from ROM 2002. When the computer program is executed by processing device 2001, it performs the functions defined in the methods of embodiments of this disclosure.

[0161] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0162] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0163] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0164] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: acquire a target image to be detected; perform residual extraction processing on the target image to obtain a pending image; input the pending image into a pre-trained first detection model to obtain a first authenticity detection result corresponding to the target image; input the target image into a pre-trained second detection model to obtain a second authenticity detection result corresponding to the target image; and determine a target authenticity detection result corresponding to the target image based on the first authenticity detection result and the second authenticity detection result.

[0165] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0166] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0167] The modules described in the embodiments of this disclosure can be implemented in software or in hardware. The names of the modules are not necessarily limiting in certain circumstances; for example, an image acquisition module can also be described as "a module for acquiring an image of a target to be detected."

[0168] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0169] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0170] According to one or more embodiments of this disclosure, an image detection method is shown, the method comprising:

[0171] Acquire the target image to be detected;

[0172] The target image is subjected to residual extraction processing to obtain the image to be determined;

[0173] The image to be determined is input into a pre-trained first detection model to obtain the first true / false detection result corresponding to the target image;

[0174] The target image is input into a pre-trained second detection model to obtain a second true / false detection result corresponding to the target image;

[0175] Based on the first authenticity detection result and the second authenticity detection result, the authenticity detection result of the target image is determined.

[0176] According to one or more embodiments of this disclosure, the residual extraction processing of the target image to obtain the image to be determined includes:

[0177] The target image is converted to grayscale to obtain a first grayscale image;

[0178] Horizontal convolution residual calculation is performed on the first grayscale image to obtain a horizontal residual image;

[0179] The vertical convolution residual is calculated on the first grayscale image to obtain the vertical residual image;

[0180] The image to be determined is obtained based on the horizontal residual image and the vertical residual image.

[0181] According to one or more embodiments of this disclosure, obtaining the image to be determined based on the horizontal residual image and the vertical residual image includes:

[0182] The horizontal residual image and the vertical residual image are superimposed to obtain the superimposed residual image;

[0183] The superimposed residual image is normalized to obtain the image to be determined.

[0184] According to one or more embodiments of this disclosure, the first detection model is trained in the following manner:

[0185] Obtain a first training sample set; wherein the first training sample set includes real sample images and fake sample images;

[0186] The first training sample set is subjected to residual extraction processing to obtain a second training sample set; the second training sample set includes real residual images after residual extraction of the real sample images, and fake residual images after residual extraction of the fake sample images.

[0187] The first neural network model is trained based on the second training sample set, and the trained first neural network model is used as the first detection model.

[0188] According to one or more embodiments of this disclosure, obtaining the first training sample set includes:

[0189] Obtain a third training sample set; the third training sample set includes the real sample images and the fake sample images;

[0190] The real sample image is augmented according to the target mask to obtain a region-enhanced sample image;

[0191] The first training sample set is determined based on the real sample image, the fake sample image, and the region-enhanced sample image.

[0192] According to one or more embodiments of this disclosure, the target mask is a randomly generated region mask.

[0193] According to one or more embodiments of this disclosure, the target mask is a ring mask, and the data augmentation processing includes motion blur processing; the step of performing data augmentation processing on the real sample image based on the target mask to obtain a region-enhanced sample image includes:

[0194] The target edge region of the real sample image is determined based on the ring mask;

[0195] Motion blurring is applied to the target edge region to obtain a semi-transparent artifact corresponding to the target edge region;

[0196] The region enhancement sample image is obtained based on the real sample image and the semi-transparent artifact.

[0197] According to one or more embodiments of this disclosure, the data augmentation process includes one or more of the following target processing types: image compression, Gaussian blur, Gaussian noise, sharpening, color jitter, and elastic transformation.

[0198] According to one or more embodiments of this disclosure, the step of performing data augmentation processing on the real sample image based on the target mask to obtain a region-enhanced sample image includes:

[0199] Determine the target weight corresponding to each of the target processing types;

[0200] The real sample image is subjected to at least one of the target processing types of data augmentation processing based on the target mask and the target weight to obtain the region-enhanced sample image.

[0201] According to one or more embodiments of this disclosure, the second training sample set further includes a region-enhanced residual image after residual extraction of the region-enhanced sample image; the step of training the first neural network model based on the second training sample set and using the trained first neural network model as the first detection model includes:

[0202] Using the labels corresponding to the real residual image, the fake residual image, and the region-enhanced residual image as constraints, the first neural network model is trained in a supervised manner according to the first objective loss function, and the trained first neural network model is used as the first detection model.

[0203] According to one or more embodiments of this disclosure, the second detection model is trained in the following manner:

[0204] The second neural network model is trained based on the first training sample set, and the trained second neural network model is used as the second detection model.

[0205] According to one or more embodiments of this disclosure, training the second neural network model based on the first training sample set and using the trained second neural network model as the second detection model includes:

[0206] Using the labels corresponding to the real sample image, the fake sample image, and the region-enhanced sample image as constraints, the second neural network model is trained in a supervised manner according to the second objective loss function, and the trained second neural network model is used as the second detection model.

[0207] According to one or more embodiments of this disclosure, the target image is an image including a human face, and the target authenticity detection result is used to characterize whether the human face has been tampered with.

[0208] According to one or more embodiments of this disclosure, an image detection apparatus is shown, the apparatus comprising:

[0209] The image acquisition module is used to acquire the target image to be detected;

[0210] The residual extraction module is used to perform residual extraction processing on the target image to obtain the image to be determined;

[0211] The first detection module is used to input the image to be determined into a pre-trained first detection model to obtain the first true / false detection result corresponding to the target image;

[0212] The second detection module is used to input the target image into a pre-trained second detection model to obtain a second true / false detection result corresponding to the target image;

[0213] The target detection module is used to determine the target authenticity detection result corresponding to the target image based on the first authenticity detection result and the second authenticity detection result.

[0214] According to one or more embodiments of this disclosure, the residual extraction module is used to perform grayscale processing on the target image to obtain a first grayscale image; perform horizontal convolution residual calculation on the first grayscale image to obtain a horizontal residual image; perform vertical convolution residual calculation on the first grayscale image to obtain a vertical residual image; and obtain the image to be determined based on the horizontal residual image and the vertical residual image.

[0215] According to one or more embodiments of this disclosure, the residual extraction module is used to superimpose the horizontal residual image and the vertical residual image to obtain a superimposed residual image; and to normalize the superimposed residual image to obtain the image to be determined.

[0216] According to one or more embodiments of this disclosure, the apparatus further includes:

[0217] A first training module is used to acquire a first training sample set, wherein the first training sample set includes real sample images and fake sample images; perform residual extraction processing on the first training sample set to obtain a second training sample set; the second training sample set includes real residual images after residual extraction of the real sample images and fake residual images after residual extraction of the fake sample images; train a first neural network model according to the second training sample set, and use the trained first neural network model as the first detection model.

[0218] According to one or more embodiments of this disclosure, the first training module is configured to acquire a third training sample set; the third training sample set includes the real sample image and the fake sample image; perform data augmentation processing on the real sample image according to the target mask to obtain a region-enhanced sample image; and determine the first training sample set based on the real sample image, the fake sample image and the region-enhanced sample image.

[0219] According to one or more embodiments of this disclosure, the target mask is a randomly generated region mask.

[0220] According to one or more embodiments of this disclosure, the target mask is a ring mask, and the data augmentation process includes motion blur processing; the first training module is configured to determine the target edge region of the real sample image based on the ring mask; perform motion blur processing on the target edge region to obtain a semi-transparent artifact corresponding to the target edge region; and obtain the region-enhanced sample image based on the real sample image and the semi-transparent artifact.

[0221] According to one or more embodiments of this disclosure, the data augmentation process includes one or more of the following target processing types: image compression, Gaussian blur, Gaussian noise, sharpening, color jitter, and elastic transformation.

[0222] According to one or more embodiments of this disclosure, the first training module is configured to determine the target weight corresponding to each target processing type; and to perform data augmentation processing of at least one of the target processing types on the real sample image according to the target mask and the target weight to obtain the region-enhanced sample image.

[0223] According to one or more embodiments of this disclosure, the second training sample set further includes a region-enhanced residual image after residual extraction of the region-enhanced sample image; the first training module is used to perform supervised training on the first neural network model according to a first objective loss function, using the labels corresponding to the real residual image, the fake residual image and the region-enhanced residual image as constraints, and using the trained first neural network model as the first detection model.

[0224] According to one or more embodiments of this disclosure, the apparatus further includes:

[0225] The second training module is used to train the second neural network model based on the first training sample set, and to use the trained second neural network model as the second detection model.

[0226] According to one or more embodiments of this disclosure, the second training module is used to perform supervised training on the second neural network model based on the labels corresponding to the real sample image, the fake sample image and the region-enhanced sample image, respectively, as constraints, and to use the trained second neural network model as the second detection model.

[0227] According to one or more embodiments of this disclosure, the target image is an image including a human face, and the target authenticity detection result is used to characterize whether the human face has been tampered with.

[0228] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0229] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0230] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative forms of implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which the various modules perform their operations has been described in detail in the embodiments relating to the method, and will not be elaborated upon here.

Claims

1. An image detection method, characterized in that, The method includes: Acquire the target image to be detected; The target image is subjected to residual extraction processing to obtain a pending image, including: grayscale processing of the target image to obtain a first grayscale image; horizontal convolution residual calculation of the first grayscale image to obtain a horizontal residual image; vertical convolution residual calculation of the first grayscale image to obtain a vertical residual image; and obtaining the pending image based on the horizontal residual image and the vertical residual image. The image to be determined is input into a pre-trained first detection model to obtain the first true / false detection result corresponding to the target image; The target image is input into a pre-trained second detection model to obtain a second authenticity detection result corresponding to the target image. The first detection model and the second detection model are three-class classification models. The first authenticity detection result and the second authenticity detection result include three categories: real, fake, and enhanced. Based on the first authenticity detection result and the second authenticity detection result, the authenticity detection result of the target image is determined, wherein the enhanced category in the three-classification result obtained by fusing the first authenticity detection result and the second authenticity detection result is equivalent to the counterfeit category, and the two-classification authenticity detection result of the target is obtained. The first detection model was trained in the following way: Obtain a first training sample set; wherein the first training sample set includes real sample images, fake sample images, and region enhancement sample images, and the region enhancement sample images include images obtained by performing data enhancement processing on the real sample images according to the target mask; The first training sample set is subjected to residual extraction processing to obtain a second training sample set; the second training sample set includes real residual images after residual extraction of the real sample images, and fake residual images after residual extraction of the fake sample images. The first neural network model is trained based on the second training sample set, and the trained first neural network model is used as the first detection model.

2. The method according to claim 1, characterized in that, The step of obtaining the image to be determined based on the horizontal residual image and the vertical residual image includes: The horizontal residual image and the vertical residual image are superimposed to obtain the superimposed residual image; The superimposed residual image is normalized to obtain the image to be determined.

3. The method according to claim 1, characterized in that, The process of obtaining the first training sample set includes: Obtain a third training sample set; the third training sample set includes the real sample images and the fake sample images; The real sample image is augmented according to the target mask to obtain a region-enhanced sample image; The first training sample set is determined based on the real sample image, the fake sample image, and the region-enhanced sample image.

4. The method according to claim 3, characterized in that, The target mask is a randomly generated region mask.

5. The method according to claim 3, characterized in that, The target mask is a ring mask, and the data augmentation processing includes motion blur processing; the step of performing data augmentation processing on the real sample image based on the target mask to obtain a region-enhanced sample image includes: The target edge region of the real sample image is determined based on the ring mask; Motion blurring is applied to the target edge region to obtain a semi-transparent artifact corresponding to the target edge region; The region enhancement sample image is obtained based on the real sample image and the semi-transparent artifact.

6. The method according to claim 3, characterized in that, The data augmentation process includes one or more of the following target processing types: image compression, Gaussian blur, Gaussian noise, sharpening, color jitter, and elastic transformation.

7. The method according to claim 6, characterized in that, The step of performing data augmentation processing on the real sample image based on the target mask to obtain the region-enhanced sample image includes: Determine the target weight corresponding to each of the target processing types; The real sample image is subjected to at least one of the target processing types of data augmentation processing based on the target mask and the target weight to obtain the region-enhanced sample image.

8. The method according to claim 3, characterized in that, The second training sample set also includes a region-enhanced residual image after residual extraction of the region-enhanced sample image; the step of training the first neural network model based on the second training sample set and using the trained first neural network model as the first detection model includes: Using the labels corresponding to the real residual image, the fake residual image, and the region-enhanced residual image as constraints, the first neural network model is trained in a supervised manner according to the first objective loss function, and the trained first neural network model is used as the first detection model.

9. The method according to claim 3, characterized in that, The second detection model was trained in the following way: The second neural network model is trained based on the first training sample set, and the trained second neural network model is used as the second detection model.

10. The method according to claim 3, characterized in that, The step of training the second neural network model based on the first training sample set and using the trained second neural network model as the second detection model includes: Using the labels corresponding to the real sample image, the fake sample image, and the region-enhanced sample image as constraints, the second neural network model is trained in a supervised manner according to the second objective loss function, and the trained second neural network model is used as the second detection model.

11. The method according to any one of claims 1 to 10, characterized in that, The target image is an image including a human face, and the target authenticity detection result is used to characterize whether the human face has been tampered with.

12. An image detection device, characterized in that, The device includes: The image acquisition module is used to acquire the target image to be detected; The residual extraction module is used to perform residual extraction processing on the target image to obtain a pending image, including: performing grayscale processing on the target image to obtain a first grayscale image; performing horizontal convolution residual calculation on the first grayscale image to obtain a horizontal residual image; performing vertical convolution residual calculation on the first grayscale image to obtain a vertical residual image; and obtaining the pending image based on the horizontal residual image and the vertical residual image. The first detection module is used to input the image to be determined into a pre-trained first detection model to obtain the first true / false detection result corresponding to the target image; The second detection module is used to input the target image into a pre-trained second detection model to obtain a second authenticity detection result corresponding to the target image. The first detection model and the second detection model are three-class classification models. The first authenticity detection result and the second authenticity detection result include three categories: real, fake, and enhanced. The target detection module is used to determine the target authenticity detection result corresponding to the target image based on the first authenticity detection result and the second authenticity detection result, wherein the enhanced category in the three-classification result obtained by fusing the first authenticity detection result and the second authenticity detection result is equivalent to the fake category, and the target authenticity detection result is obtained by binary classification. The first detection model was trained in the following way: Obtain a first training sample set; wherein the first training sample set includes real sample images, fake sample images, and region enhancement sample images, and the region enhancement sample images include images obtained by performing data enhancement processing on the real sample images according to the target mask; The first training sample set is subjected to residual extraction processing to obtain a second training sample set; the second training sample set includes real residual images after residual extraction of the real sample images, and fake residual images after residual extraction of the fake sample images. The first neural network model is trained based on the second training sample set, and the trained first neural network model is used as the first detection model.

13. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processing device, it implements the steps of the method according to any one of claims 1 to 11.

14. An electronic device, characterized in that, include: A storage device on which computer programs are stored; A processing apparatus for executing the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Face detection method, and training method and device of face detection model

    CN111461089A

  • Image forgery detection method and device and computer storage medium

    CN114444566A