A forged face identification method based on color gradient texture representation
By extracting the image gradient domain in the HSV color space and using a local direction number mask for feature extraction, combined with a support vector machine for identification, the problem of difficult to identify GAN generation of fake images in the existing technology is solved, and the forged face images is realized Effectively identify and have strong robustness against perturbing attacks.
Patent Information
- Application Number
- CN202210498013.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-07
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2042-05-07
AI Technical Summary
Current fake image identification technology is difficult to identify the authenticity of fake images generated by GANs through features visible to the naked eye. It is necessary to dig deeper clues in the image to identify the authenticity of the image.
Using a fake face identification method based on color gradient texture representation, the gradient domains of H, S, and V color channels are extracted and divided into small pieces by converting the color image to the HSV color space, and local direction number (LDN) is used. The mask is used for feature extraction and encoding, and finally the feature value is input to the support vector machine for identification.
This method utilizes the differences between the real and false images in the HSV color space and domain pixels, provides richer physical feature indicators, is robust to multiple perturbation attacks, and can effectively identify fake face images.
Smart Images

Figure CN114841969B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of face identification methods, and in particular relates to a forged face identification method based on color gradient texture representation. Background Art
[0002] Generative Adversarial Networks (GAN) is a new type of image synthesis method. Many of these technologies have been applied to various image synthesis and generation fields. GAN mainly consists of a generator and a discriminator. The generator is used to generate images, and the discriminator is used to distinguish the generated images. GAN uses the game between the generator and the discriminator until the discriminator can no longer distinguish the images generated by the generator, and finally obtains a model that can synthesize images.
[0003] GAN's powerful image synthesis and editing capabilities have brought new value, but the potential risks of synthetic images cannot be ignored. The current forgery identification technology is still in the development stage, and the technology of GAN to generate forged images is also developing and evolving rapidly. The initial forged images can be distinguished by visible features such as abnormal artifacts and strange contours on the image, but with the continuous evolution of GAN, the challenges faced by current detection algorithms are increasing. It is currently difficult to identify the authenticity of images through features visible to the naked eye. It is necessary to dig deeper clues in the image to identify the authenticity of the image. Summary of the invention
[0004] In order to solve the above problems, the present invention provides a forged face identification method based on color gradient texture representation based on the correlation between pixels of the generated forged image and the difference between the true and false images in the HSV color channel.
[0005] To achieve the above purpose, the present invention provides the following technical solutions:
[0006] A forged face identification method based on color gradient texture representation, the steps are:
[0007] Step 1: Convert the color image from RGB color space to HSV color space.
[0008] For an input color image, adjust its size to 256×256 pixels, and use the MATLAB built-in function rgb2hsv to operate on the input image. The resulting image is an HSV color space image, and the three color channels of the image are represented by H, S, and V respectively.
[0009] Step 2: Extract the gradient domain for each color channel of the HSV color space image.
[0010] The gradient domain is extracted for the H, S, and V color channels, and the color channels are operated through the imgradientxy function provided by Matlab. The results are the image gradient domains in the horizontal and vertical directions respectively.
[0011] Step 3: Divide the gradient domain image into N small blocks of equal size.
[0012] The gradient domain image is divided into blocks. For the horizontal and vertical gradient domain images of each color component, the image with a size of 256×256 pixels is divided into 16 blocks with a size of 64×64 pixels.
[0013] Step 4: Extract local direction number features from each block and merge them to obtain the final feature value.
[0014] The process of extracting local direction number features is:
[0015] 1) The LDN mask used in the present invention is composed of a Gaussian mask, and the Gaussian mask formula is:
[0016]
[0017] The LDN mask formula is:
[0018] M σ (x, y) = G′ σ (x+k,y)*G σ (x, y)
[0019] Rotate M by 45°, and finally obtain eight masks M0~M7 in eight directions;
[0020] 2) Perform convolution operation on each mask and the block image: II i =I*M i , for each pixel and its area, take the maximum response position value in the positive and negative directions, the formula is:
[0021] i x,y =arg i max{Π i (x, y)|0≤i≤7};j x,y =arg j max{Π j (x, y)|0≤i≤7};
[0022] Encode the maximum response position value in the positive and negative directions of the current pixel, and the formula is:
[0023] LDN(x,y)=8i x,y +j x,y ;
[0024] All pixels are LDN encoded, and an LDN encoding histogram is constructed to encode the LDN features. LDN feature values are extracted from all image blocks and connected to construct the final LDN feature value.
[0025] Step 5: Input the final eigenvalues into the support vector machine for identification.
[0026] Specifically, 30,000 real images and 30,000 forged images are used as training sets, and the feature values of the training set images are extracted according to the aforementioned steps. The support vector machine is trained based on these features. The trained support vector machine model identifies the feature values extracted from the images to be detected, and finally obtains the identification results.
[0027] The beneficial effects of the present invention are:
[0028] (1) The present invention provides a method for identifying forged faces based on color gradient texture representation, which specifically utilizes the differences between genuine and fake images in HSV color space and domain pixels, enriching and developing the physical feature indicators of the forged image identification method.
[0029] (2) The present invention is highly robust against various perturbation attacks such as compression, blurring, resizing, and adding noise. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is the feature extraction flow chart proposed by the present invention.
[0031] Figure 2 It is the RGB color space image input in the specific implementation.
[0032] Figure 3 In a specific implementation, it is the converted HSV color space image.
[0033] Figure 4a In the specific implementation, it is a horizontal gradient map in the V color space. Figure 4b It is the vertical gradient map in the V color space in a specific implementation.
[0034] Figure 5 It is the block setting of the gradient map in the specific implementation.
[0035] Figure 6 It is a distribution diagram of the LDN mask function in a specific implementation.
[0036] Figure 7a is a block of the gradient map in the specific implementation, Figure 7b It is the LDN feature map obtained by block calculation in the specific implementation. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the invention to clearly and completely describe the technical solutions in the embodiments of the invention. Obviously, the described embodiments are only part of the embodiments of the invention, not all of them. Based on the embodiments in the invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the invention.
[0038] Step 1: Convert the color image from RGB color space to HSV color space.
[0039] For an input color image, adjust its size to 256×256 pixels, and use the MATLAB built-in function rgb2hsv to operate on the input image. The resulting image is an HSV color space image, and the three color channels of the image are represented by H, S, and V respectively.
[0040] Step 2: Extract the gradient domain for each color channel of the HSV color space image.
[0041] The gradient domain is extracted for the H, S, and V color channels, and the color channels are operated through the imgradientxy function provided by Matlab. The results are the image gradient domains in the horizontal and vertical directions respectively.
[0042] Step 3: Divide the gradient domain image into N small blocks of equal size.
[0043] The gradient domain image is divided into blocks. For the horizontal and vertical gradient domain images of each color component, the image with a size of 256×256 pixels is divided into 16 blocks with a size of 64×64 pixels.
[0044] Step 4: Extract local direction number features from each block and merge them to obtain the final feature value.
[0045] The process of extracting local direction number features is:
[0046] 1) The LDN mask used in the present invention is composed of a Gaussian mask, and the Gaussian mask formula is:
[0047]
[0048] The LDN mask formula is:
[0049] M σ (x, y) = G′ σ (x+k,y)*G σ (x, y)
[0050] Rotate M by 45°, and finally obtain eight masks M0~M7 in eight directions;
[0051] 2) Perform convolution operation on each mask and the block image: II i =I*M i , for each pixel and its area, take the maximum response position value in the positive and negative directions, the formula is:
[0052] i x,y =arg i max{Π i (x, y)|0≤i≤7};j x,y =arg j max{Π j (x, y)|0≤i≤7};
[0053] Encode the maximum response position value in the positive and negative directions of the current pixel, and the formula is:
[0054] LDN(x,y)=8i x,y +j x,y ;
[0055] All pixels are LDN encoded, and an LDN encoding histogram is constructed to encode the LDN features. LDN feature values are extracted from all image blocks and connected to construct the final LDN feature value.
[0056] Step 5: Input the final eigenvalues into the support vector machine for identification.
[0057] Specifically, 30,000 real images and 30,000 forged images are used as training sets, and the feature values of the training set images are extracted according to the aforementioned steps. The support vector machine is trained based on these features. The trained support vector machine model identifies the feature values extracted from the images to be detected, and finally obtains the identification results.
[0058] Embodiment 1:
[0059] Step 1: Convert the color image from RGB color space to HSV color space; resize the input image to 256×256 pixels and perform color space conversion using the MATLAB function rgb2hsv. Figure 2 is the original color image, Figure 3 The image is in HSV color space.
[0060] Step 2: Extract the gradient domain for each color channel of the HSV color space image; use the MATLAB built-in function imgradientxy to extract the gradient domain for the H, S, and V color channels, and the results are the image gradient domains in the horizontal and vertical directions. Figure 4 shows the image gradient domains in the horizontal and vertical directions of the V color channel.
[0061] Step 3: Divide the gradient domain image into N small blocks of equal size; taking the image gradient domain in the vertical direction of the V color space as an example, divide the image into 16 small blocks of equal size. Figure 5 shown.
[0062] Step 4: Extract local direction number features from each block and merge them to obtain the final feature value; first, construct the mask according to the LDN mask formula, and the mask is visualized as Figure 6 . The mask is rotated by 45°, and finally eight masks are obtained in eight directions. Each mask is convolved with the block image, and the maximum response position value of each pixel in the positive and negative directions is encoded. The encoded result is the LDN feature map. The calculated LDN feature map is compared with the original image as shown in Figure 7. The LDN coding histogram is constructed with this LDN feature map, and the LDN coding histograms calculated from all image blocks are connected to construct the final LDN feature value.
[0063] Step 5: Input the final feature value into the support vector machine for identification. The support vector machine is trained based on the feature values of 30,000 pairs of true and false images. The trained support vector machine can identify forged faces.
Claims
1. A method for identifying fake faces based on color gradient texture representation, characterized in that: The steps are: Step 1: Convert the color image from RGB color space to HSV color space; Step 2: Extract the gradient domain for each color channel of the HSV color space image; Step 3: Divide the gradient domain image into N small blocks of equal size; Step 4: Extract local direction number features from each block and merge them to obtain the final feature value; The process of extracting local direction number features is: 1) The LDN mask used is composed of a Gaussian mask, and the Gaussian mask formula is The LDN mask formula is: M σ (x,y)=G′ σ (x+k,y)*G σ (x,y) Rotate M by 45°, and finally obtain eight masks M0~M7 in eight directions; 2) Perform convolution operation on each mask and the block image: II i =I*M i , for each pixel and its area, take the maximum response position value in the positive and negative directions, the formula is: I x,y =arg i max{Π i (x,y)|0≤i≤7}:j x,y =arg j max{Π j (x,y)|0≤j≤7}; Encode the maximum response position value in the positive and negative directions of the current pixel, and the formula is: LDN(x,y)=8i x,y +j x,y ; Perform LDN encoding on all pixels, construct an LDN encoding histogram, use it as the LDN feature for encoding, extract LDN feature values from all image blocks and connect them to construct the final LDN feature value; Step 5: Input the final eigenvalues into the support vector machine for identification.
2. A method for identifying fake faces based on color gradient texture representation according to claim 1, characterized in that: In the step 1, specifically: for an input color image, adjust the size to 256×256 pixels, operate the input image through the matlab built-in function rgb2hsv, and the resulting image is an HSV color space image, and the three color channels of the image are represented by H, S, and V respectively.
3. The method for identifying fake faces based on color gradient texture representation according to claim 1, characterized in that: In the step 2, specifically: extract the gradient domain of the H, S, and V color channels, and operate the color channels through the imgradientxy function provided by Matlab, and the obtained results are the image gradient domains in the horizontal and vertical directions respectively.
4. The method for identifying fake faces based on color gradient texture representation according to claim 1, characterized in that: In the step 3, specifically: the gradient domain image is divided into blocks, and for the horizontal and vertical gradient domain images of each color component, the image with a size of 256×256 pixels is divided into 16 blocks with a size of 64×64 pixels.
5. The method for identifying fake faces based on color gradient texture representation according to claim 1, characterized in that: In the step 5, specifically: 30,000 real images and 30,000 forged images are used as training sets, the image feature values of the training set are extracted according to the above steps, and the support vector machine is trained based on them. The trained support vector machine model identifies the feature values extracted from the image to be detected, and finally obtains the identification result.