Image tampering detection method and device, computer equipment and medium

By performing error analysis on the video data uploaded by users and computing the first direction gradient histogram feature, combined with the binary classification model, the problem of low accuracy and efficiency of image tampering detection is solved, and more efficient detection results are achieved.

CN119625506APending Publication Date: 2025-03-14PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411677189.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

Currently, the accuracy and recognition efficiency of image tampering detection in bank credit business are not high.

Method used

By obtaining the video data uploaded by the user, an error analysis is performed to obtain an error analysis feature map, the first direction gradient histogram feature corresponding to the feature map is calculated, and input it into the binary classification model to output the detection result.

Benefits of technology

The accuracy and recognition efficiency of image tamper detection are improved. The algorithms of binary classification models and first-direction gradient histogram features are highly computationally efficient, can effectively process large-scale data, and have good interpretability and generalization capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119625506A_ABST
    Figure CN119625506A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image detection and financial science and technology, and discloses an image tampering detection method and device, computer equipment and a storage medium. Therefore, the detection result determined through the first direction gradient histogram feature is more accurate. The algorithm of the binary classification model and the first direction gradient histogram features is high in calculation efficiency and does not need complex calculation, so that the algorithm has advantages and is relatively low in complexity when processing large-scale data. The dichotomy model can be trained only through small-scale data during training, practical application is easier, accuracy and robustness are high, meanwhile, the overfitting problem can be effectively avoided, and good generalization ability is achieved. In addition, the binary classification model and the first direction gradient histogram feature algorithm have better interpretability, and the structure and the mode in the image can be clearly represented.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image detection and financial technology, and in particular to an image tampering detection method, device, computer equipment and medium. Background Art

[0002] In bank credit business, users are usually required to upload videos, and the bank will detect whether the user is compliant and whether there is fraud based on the video. However, the inventor found that the accuracy and recognition efficiency of the current detection results are not high. Therefore, how to improve the accuracy and recognition efficiency of the detection results has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention

[0003] The present invention provides an image tampering detection method, device, computer equipment and medium to solve the technical problem of low accuracy of detection results and low recognition efficiency of image tampering.

[0004] In a first aspect, a method for detecting image tampering is provided, comprising:

[0005] Get the video data uploaded by the user;

[0006] Performing error analysis on a preset image in the video data to obtain an error analysis feature graph;

[0007] Calculating a first directional gradient histogram feature corresponding to the error analysis feature map;

[0008] The first directional gradient histogram feature is input into a preset model to output a detection result, and the preset model is a binary classification model.

[0009] In a second aspect, an image tampering detection device is provided, comprising:

[0010] A first acquisition unit, used to acquire video data uploaded by a user;

[0011] An error analysis unit, used to perform error analysis on a preset image in the video data to obtain an error analysis feature map;

[0012] A first directional gradient histogram feature calculation unit is used to calculate a first directional gradient histogram feature corresponding to the error analysis feature map; an output unit is used to input the first directional gradient histogram feature into a preset model to output a detection result, and the preset model is a binary classification model.

[0013] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the image tampering detection method when executing the computer program.

[0014] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the image tampering detection method are implemented.

[0015] In the scheme implemented by the above-mentioned image tampering detection method, device, computer equipment and storage medium, the video data uploaded by the user can be obtained; the preset image in the video data is subjected to error analysis to obtain an error analysis feature map; the first directional gradient histogram feature corresponding to the error analysis feature map is calculated; the first directional gradient histogram feature is input into the preset model to output the detection result, and the preset model is a binary classification model. In the present invention, the first directional gradient histogram feature corresponding to the error analysis feature map can accurately characterize the structure in the image, so that the detection result determined by the first directional gradient histogram feature is more accurate. The algorithm of the binary classification model and the first directional gradient histogram feature has high computational efficiency and does not require complex calculations. Therefore, it has advantages and relatively low complexity when processing large-scale data. The binary classification model only requires small-scale data to complete the training during training, is easier to apply in practice, has high accuracy and robustness, can effectively avoid overfitting problems, and has good generalization ability. In addition, the algorithm of the binary classification model and the first directional gradient histogram feature has better interpretability and can clearly characterize the structure and pattern in the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0017] Figure 1 is a schematic diagram of an application environment of an image tampering detection method according to an embodiment of the present invention;

[0018] Figure 2 is a flow chart of an image tampering detection method according to an embodiment of the present invention;

[0019] Figure 3 is another flow chart of an image tampering detection method in one embodiment of the present invention;

[0020] Figure 4 is another flow chart of an image tampering detection method in one embodiment of the present invention;

[0021] Figure 5is a structural schematic diagram of an image tampering detection device in one embodiment of the present invention;

[0022] Figure 6 is a schematic diagram of a structure of a computer device in one embodiment of the present invention;

[0023] Figure 7 It is another structural schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0025] In bank credit business, users are usually required to upload videos, and the bank will detect whether the user is compliant and whether there is fraud based on the video. However, the inventor found that the accuracy and recognition efficiency of the current detection results are not high. Therefore, how to improve the accuracy and recognition efficiency of the detection results has become a technical problem that needs to be solved urgently by those skilled in the art.

[0026] Specifically, the inventors have found that the image tampering detection algorithms in the related art are divided into perception-based and data-based methods. The perception-based method mainly realizes tampering detection by analyzing the perceptual features of the image, while the data-based method mainly realizes tampering detection by analyzing the image data. The following are the main perception-based and data-based algorithms and their shortcomings:

[0027] Perception-based algorithms include DCT-based (discrete cosine transform) and Wavelet-based (wavelet transform). Among them, the DCT-based algorithm is one of the earliest perception algorithms. It detects whether there is tampering in the image by filtering the high-frequency components of the image. However, the algorithm has weak detection capabilities for small-sized tampered areas and high-noise images. The Wavelet-based algorithm can perform multi-resolution analysis and processing on images and detect tampered features at different scales. However, the algorithm has weak detection capabilities for complex tampering, and the size and shape of the tampered area will have a greater impact on its detection results. Data-based algorithms include Deep-learning-based (based on deep learning). Deep-learning-based algorithms use deep learning networks, such as convolutional neural networks (CNN) and recurrent neural networks (RNN), to extract features in images and realize image tampering detection. Due to the excellent feature extraction and expression capabilities of deep learning, this algorithm has achieved good results in image tampering detection. However, this algorithm requires a lot of data and computing resources, and the network structure and parameters need to be adjusted to adapt to different scenarios. Deep learning algorithms are not friendly to small datasets.

[0028] The image tampering detection method provided by the embodiment of the present invention can be applied in the following aspects: Figure 1 In an application environment, the client communicates with the server through a network. The server can obtain the video data uploaded by the user through the client; perform error analysis on the preset image in the video data to obtain an error analysis feature map; calculate the first directional gradient histogram feature corresponding to the error analysis feature map; input the first directional gradient histogram feature into the preset model to output the detection result, and the preset model is a binary classification model. In the present invention, the first directional gradient histogram feature corresponding to the error analysis feature map can accurately characterize the structure in the image, so that the detection result determined by the first directional gradient histogram feature is more accurate. The algorithm of the binary classification model and the first directional gradient histogram feature has high computational efficiency and does not require complex calculations. Therefore, it has advantages and relatively low complexity when processing large-scale data. The binary classification model only requires small-scale data to complete the training during training, is easier to apply in practice, has high accuracy and robustness, can effectively avoid overfitting problems, and has good generalization ability. In addition, the algorithm of the binary classification model and the first directional gradient histogram feature has better interpretability and can clearly characterize the structure and pattern in the image.

[0029] The client may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server may be implemented by an independent server or a server cluster consisting of multiple servers. The present invention is described in detail below through specific embodiments.

[0030] See also Figure 2 As shown, Figure 2 A flowchart of an image tampering detection method provided by an embodiment of the present invention includes the following steps S100-S400.

[0031] S100: Obtain video data uploaded by a user.

[0032] In Ping An Bank's credit business, users are required to upload videos. The bank uses the video data to detect whether the user is compliant and whether there is fraud or other behaviors. The video data includes multiple frames of images. If there is fraud or other behaviors, the credit application may be rejected, or the bank may take other measures.

[0033] S200: performing error analysis on a preset image in the video data to obtain an error analysis feature graph.

[0034] In some embodiments, the preset image is each frame of the video data. In this embodiment, error analysis can be performed on each frame of the video data to obtain a corresponding error analysis feature map.

[0035] In other embodiments, in order to reduce the use of computing resources, the process of determining the preset image includes: screening out target images from the images of the video data, and using the target images as preset images, wherein the number of the target images is less than the total number of images in the video data. In this embodiment, images in the video data can be randomly checked, and error analysis can be performed on the randomly checked images to obtain corresponding error analysis feature maps.

[0036] In some other embodiments, the process of determining the preset image includes: grouping two adjacent images in the video data as an image group; the images in each of the image groups are different. In this embodiment, if the number of images in the video data is an even number, the number of images in each image group is two; if the number of images in the video data is an odd number, the number of images in the last image group is one. Exemplarily, the video data includes image A, image B, image C, image D, image E, image F, and image G. After grouping, four image groups can be obtained, the first image group includes image A and image B, the second image group includes image C and image D, the third image group includes image E and image F, and the fourth image group includes G.

[0037] Calculate the difference value for the images in the image group. In the embodiment of the present application, the step of calculating the difference value for the images in the image group may be to make a difference of the average pixel values ​​of the images in the image group, and use the difference value as the difference value. If the image group includes only one image, the difference value is the average pixel value of the image. Of course, other feature value differences other than the average pixel value may also be calculated as the difference value.

[0038] If the difference value is greater than the preset difference value, all images in the image group are determined as preset images. In this embodiment, if the difference value is greater than the preset difference value, it means that the two images have changed greatly, and subsequent tampering detection needs to be performed on both images with large changes.

[0039] If the difference value is not greater than the preset difference value, one image in the image group is determined as the preset image. In this embodiment, if the difference value is not greater than the preset difference value, it means that the two images have not changed much, and at this time, only one image needs to be tampered with, that is, only one of the two images is retained. In this way, compared with performing error analysis on all images in the video data, using the difference value to determine some images in all images in the video data, and performing error analysis on some images, it is possible to reduce computing resources.

[0040] In this embodiment, the error analysis is ELA error analysis. ELA (Error Level Analysis) is a technology used for image authentication. It determines whether the image has been digitally modified by detecting the compression level of different areas in the image.

[0041] If the image has been tampered with, the error analysis feature map will show the following special performance: First, the difference in error levels: For JPEG images, if the processing of a part of the image is significantly different from the error level of other parts, this may indicate that the part has been modified. Because JPEG images use a lossy compression system, each re-encoding (re-saving) will increase the quality loss of the image. If the image is not modified, all 8x8 compression blocks should have similar potential errors. When the modified area is re-saved, it will introduce more compression errors than other parts, which will appear as brighter areas in the ELA feature map; Second, changes in high-frequency areas: High-frequency areas in the image (such as edges, textures, etc.) usually have higher ELA values ​​than the rest of the image. If the tampering involves modifications to these high-frequency areas (such as adding, deleting, or changing edges, textures, etc.), the ELA values ​​of these areas will change, which may appear as brighter or darker colors. Third, rainbow effect: In some cases, such as when saving JPEG images using drawing tools such as Photoshop, an obvious rainbow pattern surface may be introduced. These surfaces have almost uniform colors, but they will show obvious color separation phenomena (such as blue, purple, or red) in the ELA feature map, which is called the rainbow effect. The presence of the rainbow effect may indicate that the image has been processed by specific editing software. The difference between the tampered image and the untampered image can be identified using the error analysis feature map.

[0042] In some embodiments, the step of performing error analysis on a preset image in the video data to obtain an error analysis feature map comprises:

[0043] The preset image is compressed into a first temporary image according to a preset quality parameter. Exemplarily, the preset quality parameter (quality parameter) is 90, and the first temporary image obtained after compression is an image in JPEG format with a quality parameter of 90.

[0044] If the preset image is successfully compressed into a first temporary image, a first absolute difference image is determined according to the preset image and the first temporary image. Specifically, the first absolute difference image is obtained by subtracting the pixel value of the pixel point in the first temporary image from the pixel value of the pixel point in the preset image. In addition, after the first absolute difference image is determined, the first temporary image may be deleted to release storage resources.

[0045] The first absolute difference image is normalized to obtain a first grayscale image.

[0046] In this embodiment, the normalization adopts the max-min method. The Max-Min method, also known as Min-Max normalization or maximum-minimum normalization, is a linear normalization technique that scales data to the interval [0,1]. In the embodiment of the present application, the first absolute difference image is normalized to obtain the first grayscale image.

[0047] The first grayscale image is multiplied by a preset scaling factor to obtain an error analysis feature map.

[0048] In this embodiment, the preset model is subsequently used to output the detection result, and the detection result includes tampering and non-tampering, and the preset scale factor is determined. In order to make the detection result output by the preset model more accurate, the first grayscale image is adjusted by the preset scale factor, so that the accuracy of the output detection result is always at a high level. The determination of the preset scale factor is introduced in detail later, that is, the preset scale factor is determined by using the verification sample.

[0049] If the preset image is not successfully compressed into the first temporary image, the preset quality parameter is reduced; and the preset image is compressed into the second temporary image according to the reduced preset quality parameter. In this embodiment, the preset quality parameter can be reduced to 10, and then the preset image is compressed into the second temporary image with the first preset quality parameter of 10.

[0050] In order to avoid problems in compressing the preset image into a first temporary image with higher quality parameters, which may affect the subsequent judgment of whether the preset image has been tampered with, in an embodiment of the present application, when the preset image is not successfully compressed into the first temporary image, the preset quality parameters are lowered and the preset image is compressed into a second temporary image with lower quality parameters, so that subsequent steps can continue to be executed.

[0051] If the preset image is successfully compressed into a second temporary image, a second absolute difference image is determined based on the preset image and the second temporary image; the second absolute difference image is normalized to obtain a second grayscale image; the second grayscale image is multiplied by a preset scale factor for adjustment to obtain an error analysis feature map.

[0052] In this embodiment, the process of determining the second absolute difference image by using the preset image and the second temporary image is the same as the process of determining the first absolute difference image by using the preset image and the first temporary image mentioned above. The process of normalizing the second absolute difference image to obtain the second grayscale image is the same as the process of normalizing the first absolute difference image to obtain the first grayscale image mentioned above. The process of multiplying the second grayscale image by the preset scale factor to adjust to obtain the error analysis feature map is the same as the process of multiplying the first grayscale image by the preset scale factor to adjust to obtain the error analysis feature map mentioned above, and will not be repeated here.

[0053] In addition, after the second absolute difference image is obtained, the second temporary image may be deleted to release storage resources.

[0054] If the preset image is not successfully compressed into the second temporary image, a prompt error message is sent.

[0055] In this embodiment, if the preset image cannot be compressed into a second temporary image with a lower quality parameter, an error message is sent to enable the engineer to detect the reason for the unsuccessful compression and make corrections later. The error message may include the image path of the compression error.

[0056] S300, calculating a first directional gradient histogram feature corresponding to the error analysis feature map.

[0057] In the embodiment of the present application, the first directional gradient histogram feature, namely the HOG (Histogram of OrientedGradient) feature, is an important feature description method in the field of computer vision. The basic principle of the directional gradient histogram feature is to calculate the gradient information of the local area of ​​the image and perform histogram statistics of the gradient information to form a feature vector. This feature description method can effectively capture the local structural features of the image, especially the shape and edge information.

[0058] In the embodiment of the present application, if the image has been tampered with, the error analysis feature map will have special performance, which has been described in detail above. Based on the error analysis feature map with special performance, the corresponding directional gradient histogram feature is calculated to further characterize the structure of the image.

[0059] In some embodiments, Figure 3 Another flowchart of the image tampering detection method provided by the embodiment of the present invention is as follows: The step of calculating the first directional gradient histogram feature corresponding to the error analysis feature map includes S301-S302.

[0060] S301, adjusting the error analysis feature map to an image of a preset size to obtain an adjusted image.

[0061] Exemplarily, the preset size is a resolution of 512*512. In this embodiment, the error analysis feature map can be adjusted to an image of a preset size by an interpolation algorithm, and specifically, a neighbor interpolation method or a bilinear interpolation method can be used.

[0062] Neighbor interpolation is a method of filling the pixels of a new image by copying the nearest pixel values. This method is simple and fast, but it usually produces a blocky effect when enlarging an image, and the image quality is poor. Neighbor interpolation can be used for both image enlargement and image reduction. The bilinear interpolation method considers the pixel values ​​of the four neighboring points around the pixel and calculates the weighted average of these values ​​to obtain the value of the new pixel. This method can produce smoother results than neighbor interpolation when enlarging an image, and is also suitable for image reduction.

[0063] S302: Calculate a second histogram of oriented gradients feature of the adjusted image, and determine the second histogram of oriented gradients feature as the first histogram of oriented gradients feature.

[0064] In some embodiments, Figure 4 This is another flowchart of the image tampering detection method provided by an embodiment of the present invention. The step of calculating the second directional gradient histogram feature of the adjusted image includes S3021-S3023.

[0065] S3021. Select parameters of a histogram of oriented gradients descriptor according to a preset descriptor type.

[0066] Exemplarily, the preset descriptor type is default, and the parameters of the directional gradient histogram descriptor corresponding to the preset descriptor type include window size (winSize=(256,64)), window stride (winStride=(64,64)), block size (blockSize=(64,64)), block stride (blockStride=(64,64)), cell size (cellSize=(32,32)) and the number of directional histograms (nbins=4).

[0067] S3022: Create a histogram of oriented gradients object according to the parameters of the histogram of oriented gradients descriptor.

[0068] S3023: Calculate the second histogram of oriented gradients feature by using the histogram of oriented gradients object.

[0069] Exemplarily, a directional gradient histogram object can be created using cv2.HOGDescriptor, and the directional gradient histogram features are calculated for the adjusted image. In some embodiments, the directional gradient histogram features of the adjusted image are reshaped into a one-dimensional vector. The process of reshaping into a one-dimensional vector can be completed by a Reshape operation.

[0070] The calculation process of the oriented gradient histogram feature is divided into multiple steps, including image segmentation, gradient calculation and gradient histogram statistics, etc., and has good rotation and scale invariance.

[0071] S400: Input the first directional gradient histogram feature into a preset model to output a detection result, wherein the preset model is a binary classification model.

[0072] The method in the embodiment of the present application can use a preset model to automatically detect whether there is a tampered area in the image of the video data, that is, to determine the detection result. The error analysis feature map will have a very obvious difference when the image is tampered with and not tampered with. On this basis, the first directional gradient histogram feature corresponding to the error analysis feature is calculated to more accurately characterize the structure in the image, so that the detection result determined by the first directional gradient histogram feature is more accurate. The algorithm of the binary classification model and the first directional gradient histogram feature is high in computational efficiency and does not require complex calculations. Therefore, it has advantages in processing large-scale data and has relatively low complexity. In addition, the algorithm of the binary classification model and the first directional gradient histogram feature has better interpretability and can clearly characterize the structure and pattern in the image.

[0073] In some embodiments, before using the preset model to output the detection result, it is necessary to obtain the preset model through training. The method includes: obtaining a training sample, the training sample includes a first preset directional gradient histogram feature determined by a preset training image and a first preset detection result corresponding to the first preset directional gradient histogram feature; using the training sample to train a basic model to obtain a preset model, the basic model is an SVM classifier.

[0074] In this embodiment, the process of determining the preset directional gradient histogram feature through the preset training image is the same as the process of processing the preset image in the video data to obtain the first directional gradient histogram feature described above.

[0075] The SVM classifier is a binary classifier. The basic model is trained using training samples to obtain a preset model for automatically detecting whether an image has been tampered with. The binary classification model only requires a small amount of data to complete the training, is easier to apply in practice, has higher accuracy and robustness, can effectively avoid overfitting problems, and has good generalization ability.

[0076] In this embodiment, after determining the preset model, the performance of the preset model is verified using a verification sample, and the proportional factor to be adjusted is adjusted until the performance of the preset model meets the standard. The proportional factor to be adjusted used when the performance meets the standard is determined to be the preset proportional factor.

[0077] The verification sample includes a second preset directional gradient histogram feature determined by a preset verification image and a second preset detection result corresponding to the second preset directional gradient histogram feature. The process of determining the second preset directional gradient histogram feature by a preset verification image is the same as the process described above of processing a preset image in the video data to obtain the first directional gradient histogram feature.

[0078] In some embodiments, the process of determining the second preset directional gradient histogram feature through a preset verification image includes: performing error analysis on the preset verification image to obtain a target error analysis feature map; calculating the second preset directional gradient histogram feature corresponding to the target error analysis feature map. Wherein, the step of performing error analysis on the preset verification image to obtain the target error analysis feature map includes: compressing the preset verification image into a third temporary image according to a preset quality parameter; if the preset verification image is successfully compressed into the third temporary image, determining a third absolute difference image according to the preset verification image and the third temporary image; normalizing the third absolute difference image to obtain a third grayscale image; and adjusting the third grayscale image by multiplying the third grayscale image by the scale factor to be adjusted to obtain the target error analysis feature map.

[0079] In some embodiments, the method further includes: using the verification sample to verify the preset model and determine the accuracy of the preset model. Determine whether the accuracy is lower than the preset accuracy. When the accuracy is lower than the preset accuracy, adjust the scale factor to be adjusted; use the adjusted scale factor to be adjusted to update the verification sample; use the updated verification sample to determine the accuracy of the preset model, and re-execute the step of determining whether the accuracy is lower than the preset accuracy until the accuracy is not lower than the preset accuracy, and determine that the current scale factor to be adjusted is the preset scale factor.

[0080] In this embodiment, the verification sample is updated using the adjusted scale factor to be adjusted, that is, when adjusting the third grayscale image, a scale factor to be adjusted different from the scale factor to be adjusted previously used is used, thereby achieving an update of the verification sample.

[0081] In the embodiment of the present application, the image in the video data is tampered with and if the detection result is tampered with, the bank can be notified to handle it. If the detection result is not tampered with, the remaining steps in the credit business can be completed.

[0082] It can be seen that in the above scheme, the first directional gradient histogram feature corresponding to the error analysis feature map can accurately characterize the structure in the image, so that the detection result determined by the first directional gradient histogram feature is more accurate. The algorithm of the binary classification model and the first directional gradient histogram feature has high computational efficiency and does not require complex calculations. Therefore, it has advantages in processing large-scale data and has relatively low complexity. The binary classification model only requires small-scale data to complete the training during training, which is easier to apply in practice, has high accuracy and robustness, can effectively avoid overfitting problems, and has good generalization ability. In addition, the binary classification model and the algorithm of the first directional gradient histogram feature have better interpretability and can clearly characterize the structure and pattern in the image. However, deep learning algorithms are usually black box models, and their internal mechanisms are not easy to understand.

[0083] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0084] In one embodiment, an image tampering detection device is provided, and the image tampering detection device corresponds one-to-one to the image tampering detection method in the above embodiment. Figure 5 As shown, the image tampering detection device includes:

[0085] A first acquisition unit 501 is used to acquire video data uploaded by a user;

[0086] The error analysis unit 502 is used to perform error analysis on a preset image in the video data to obtain an error analysis feature map;

[0087] A first directional gradient histogram feature calculation unit 503, used to calculate a first directional gradient histogram feature corresponding to the error analysis feature map;

[0088] The output unit 504 is used to input the first directional gradient histogram feature into a preset model to output a detection result, and the preset model is a binary classification model.

[0089] In one embodiment, the error analysis unit includes:

[0090] A first compression unit, configured to compress the preset image into a first temporary image according to a preset quality parameter;

[0091] The first determination unit is used to determine a first absolute difference image according to the preset image and the first temporary image if the preset image is successfully compressed into a first temporary image; normalize the first absolute difference image to obtain a first grayscale image; and multiply the first grayscale image by a preset scale factor to obtain an error analysis feature map.

[0092] In one embodiment, the device further comprises:

[0093] a reducing unit, configured to reduce a preset quality parameter if the preset image is not successfully compressed into the first temporary image;

[0094] A second compression unit, configured to compress the preset image into a second temporary image according to the reduced preset quality parameter;

[0095] The second determination unit is used to determine a second absolute difference image according to the preset image and the second temporary image if the preset image is successfully compressed into a second temporary image; normalize the second absolute difference image to obtain a second grayscale image; and multiply the second grayscale image by a preset scale factor to adjust it to obtain the error analysis feature map.

[0096] In one embodiment, the device further comprises:

[0097] The sending unit is used to send a prompt error message if the preset image is not successfully compressed into the second temporary image.

[0098] In one embodiment, the computing unit comprises:

[0099] An adjustment unit, used for adjusting the error analysis characteristic image to an image of a preset size to obtain an adjusted image;

[0100] The second directional gradient histogram feature calculation unit is used to calculate the second directional gradient histogram feature of the adjusted image, and determine the second directional gradient histogram feature as the first directional gradient histogram feature.

[0101] In one embodiment, the second directional gradient histogram feature calculation unit includes:

[0102] A selection unit, used for selecting parameters of a histogram of oriented gradients descriptor according to a preset descriptor type;

[0103] A creation unit, used for creating a histogram of oriented gradients object according to the parameters of the histogram of oriented gradients descriptor;

[0104] The second histogram of oriented gradients feature is calculated using the histogram of oriented gradients object.

[0105] In one embodiment, the device further comprises:

[0106] A second acquisition unit, configured to acquire a training sample, wherein the training sample includes a first preset directional gradient histogram feature determined by a preset training image and a first detection result corresponding to the first preset directional gradient histogram feature;

[0107] The training unit is used to train a basic model using the training samples to obtain a preset model, wherein the basic model is a SVM classifier.

[0108] The present invention provides an image tampering detection device, which can accurately characterize the structure in the image by using the first directional gradient histogram feature corresponding to the error analysis feature map, so that the detection result determined by the first directional gradient histogram feature is more accurate. The binary classification model and the algorithm of the first directional gradient histogram feature have high computational efficiency and do not require complex calculations. Therefore, they have advantages in processing large-scale data and are relatively low in complexity. The binary classification model only requires small-scale data to complete the training during training, is easier to apply in practice, has high accuracy and robustness, can effectively avoid overfitting problems, and has good generalization ability. In addition, the binary classification model and the algorithm of the first directional gradient histogram feature have better interpretability and can clearly characterize the structure and pattern in the image. However, deep learning algorithms are usually black box models, and their internal mechanisms are not easy to understand.

[0109] For the specific definition of the image tampering detection device, please refer to the definition of the image tampering detection method above, which will not be repeated here. Each module in the above-mentioned image tampering detection device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0110] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, it realizes the functions or steps on the server side of an image tampering detection method.

[0111] In one embodiment, a computer device is provided. The computer device may be a client, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server through a network connection. When the computer program is executed by the processor, it realizes the functions or steps of the client side of an image tampering detection method.

[0112] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0113] Get the video data uploaded by the user;

[0114] Performing error analysis on a preset image in the video data to obtain an error analysis feature graph;

[0115] Calculating a first directional gradient histogram feature corresponding to the error analysis feature map;

[0116] The first directional gradient histogram feature is input into a preset model to output a detection result, and the preset model is a binary classification model.

[0117] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0118] Get the video data uploaded by the user;

[0119] Performing error analysis on a preset image in the video data to obtain an error analysis feature graph;

[0120] Calculating a first directional gradient histogram feature corresponding to the error analysis feature map;

[0121] The first directional gradient histogram feature is input into a preset model to output a detection result, and the preset model is a binary classification model.

[0122] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant descriptions on the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.

[0123] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0124] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0125] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A method for detecting image tampering, characterized in that: include: Get the video data uploaded by the user; Performing error analysis on a preset image in the video data to obtain an error analysis feature graph; Calculating a first directional gradient histogram feature corresponding to the error analysis feature map; The first directional gradient histogram feature is input into a preset model to output a detection result, and the preset model is a binary classification model.

2. The method according to claim 1, characterized in that The step of performing error analysis on a preset image in the video data to obtain an error analysis feature graph comprises: compressing the preset image into a first temporary image according to a preset quality parameter; If the preset image is successfully compressed into a first temporary image, a first absolute difference image is determined based on the preset image and the first temporary image; the first absolute difference image is normalized to obtain a first grayscale image; and the first grayscale image is multiplied by a preset scale factor for adjustment to obtain the error analysis feature map.

3. The method according to claim 2, characterized in that Also includes: If the preset image is not successfully compressed into the first temporary image, reducing a preset quality parameter; compressing the preset image into a second temporary image according to the reduced preset quality parameter; If the preset image is successfully compressed into a second temporary image, determining a second absolute difference image according to the preset image and the second temporary image; The second absolute difference image is normalized to obtain a second grayscale image; the second grayscale image is multiplied by the preset scale factor to adjust the image to obtain the error analysis feature map.

4. The method according to claim 3, characterized in that Also includes: If the preset image is not successfully compressed into the second temporary image, a prompt error message is sent.

5. The method according to claim 1, characterized in that The step of calculating the first directional gradient histogram feature corresponding to the error analysis feature map comprises: Adjusting the error analysis feature map to an image of a preset size to obtain an adjusted image; A second histogram of directional gradients feature of the adjusted image is calculated, and the second histogram of directional gradients feature is determined as the first histogram of directional gradients feature.

6. The method according to claim 5, characterized in that The step of calculating the second directional gradient histogram feature of the adjusted image comprises: According to the preset descriptor type, select the parameters of the histogram of oriented gradients descriptor; Creating a histogram of oriented gradients object according to the parameters of the histogram of oriented gradients descriptor; The second histogram of oriented gradients feature is calculated using the histogram of oriented gradients object.

7. The method according to claim 1, characterized in that Also includes: Acquire a training sample, wherein the training sample includes a first preset directional gradient histogram feature determined by a preset training image and a first detection result corresponding to the first preset directional gradient histogram feature; The training samples are used to train a basic model to obtain a preset model, wherein the basic model is a SVM classifier.

8. An image tampering detection device, characterized in that: include: A first acquisition unit, used to acquire video data uploaded by a user; An error analysis unit, used to perform error analysis on a preset image in the video data to obtain an error analysis feature map; A first directional gradient histogram feature calculation unit, used to calculate a first directional gradient histogram feature corresponding to the error analysis feature map; An output unit is used to input the first directional gradient histogram feature into a preset model to output a detection result, and the preset model is a binary classification model.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the image tampering detection method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the image tampering detection method according to any one of claims 1 to 7 are implemented.