Image detection and classifier model generation method, device and equipment
By extracting color component features in the YCbCr color space of the image and using a classifier model for discrimination, the problem of image primitiveness identification is solved, and effective identification of whether the image is the original lossless compression format is achieved, and in some cases it can also be used to Determine the compression tool and parameters.
Patent Information
- Application Number
- CN201810309030.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-04-09
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2038-04-09
AI Technical Summary
The prior art is difficult to effectively identify the originality and specific modification details of images, especially when the image is compressed and then converted to a lossless format.
By extracting color component features from the image to be detected and discriminated in the YCbCr color space using a classifier model, it is determined whether the image is the original lossless compressed format image or is a compressed image.
An effective method for identifying the originality of images is realized, which can identify whether the image is compressed, and in some embodiments it can also determine the compression tools and parameters, which improves the reliability of image evidence.
Smart Images

Figure CN110363207B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition, and more particularly to an image detection method, device, electronic device and storage device. The present application also relates to a classifier model generation method, device, electronic device and storage device. Background Art
[0002] As a frequently used medium, images are often required to ensure their authenticity and image originality identification is required in many cases. Image originality identification refers to determining whether a lossless compressed image is an original lossless compressed image or a compressed image. For example, some website platforms require image originality identification of images uploaded by users to identify whether the information in the uploaded image is credible; or, when images are used as court evidence, it is required to ensure the reliability of the image evidence, and it is necessary to identify the originality of the image and determine whether the image has been tampered with.
[0003] However, with the rapid development of technology, it is easy to tamper with images through various image editing software. The tampered images cannot be detected by the naked eye, and the resulting moral and legal issues are becoming more and more. If the originality and specific modification details of the image can be identified, it is of great significance for image forensics.
[0004] If an image is compressed and then converted to a lossless format through software, some traces of compression will theoretically remain. With the widespread use of lossless format images, the demand for originality authentication of images is increasing. Summary of the invention
[0005] The present application provides an image detection method to solve the need for originality identification of images.
[0006] The present application provides an image detection method, comprising:
[0007] Extracting at least one color component feature from the image to be detected;
[0008] According to the color component features, a classifier model is used to determine whether the image to be detected is an original lossless compressed format image or a compressed image.
[0009] Optionally, extracting at least one color component feature from the image to be detected includes:
[0010] Convert the image to be detected from RGB color space to YCbCr color space;
[0011] The at least one color component feature is extracted from the YCbCr color space of the image to be detected.
[0012] Optionally, extracting the at least one color component feature from the YCbCr color space of the image to be detected includes:
[0013] The Y color component feature and the Cb color component feature are extracted from the YCbCr color space of the image to be detected, or the Y color component feature and the Cr color component feature are extracted from the YCbCr color space of the image to be detected.
[0014] Optionally, also include:
[0015] splicing the Y color component feature and the Cb color component feature to obtain the spliced image feature, or splicing the Y color component feature and the Cr color component feature to obtain the spliced image feature;
[0016] The method of using a classifier model to determine whether the image to be detected is an original image or a compressed image based on the color component features includes: using a classifier model to determine whether the image to be detected is an original image or a compressed image based on the features of the spliced images.
[0017] Optionally, the extracting the Y color component feature and the Cb color component feature from the YCbCr color space of the image to be detected, or the extracting the Y color component feature and the Cr color component feature from the YCbCr color space of the image to be detected, includes:
[0018] The Spam11 sub-model and the minmax24 sub-model in the spatial domain rich model are used to extract the Y color component features and the Cb color component features from the YCbCr color space of the image to be detected, or the Spam11 sub-model and the minmax24 sub-model in the spatial domain rich model are used to extract the Y color component features and the Cr color component features from the YCbCr color space of the image to be detected.
[0019] Optionally, the classifier model includes: a first classifier for determining whether the image to be detected is an image in an original lossless compression format;
[0020] The step of using a classifier model to determine whether the image to be detected is an original lossless compressed format image or a compressed image according to the color component features includes:
[0021] According to the color component features, using the first classifier to discriminate the image to be detected;
[0022] If all the first classifiers are used to determine that the image is in the original lossless compression format, then determining that the image to be detected is in the original lossless compression format;
[0023] If at least one first classifier is used to determine that the image to be detected is not an original lossless compressed format image, it is determined that the image to be detected is a compressed image.
[0024] Optionally, the method further includes: when it is determined that the category of the image to be detected is a compressed image, determining a compression tool used when compressing the image to be detected.
[0025] Optionally, the classifier model further includes: a second classifier for determining the type of compression tool used for the image to be detected;
[0026] Determining a compression tool to be used when compressing the image to be detected includes:
[0027] According to the color component characteristics, a second classifier is used to perform discrimination and generate a discrimination result;
[0028] Combine the discrimination results of each second classifier to generate a code;
[0029] Calculating the Hamming distance between the code and a code of a preset compression tool;
[0030] The compression tool with the shortest Hamming distance to the encoding is used as the compression tool used when compressing the image to be detected.
[0031] Optionally, the method further includes: determining compression parameters used when compressing the image to be detected.
[0032] Optionally, the classifier model further includes: a third classifier for determining compression parameters adopted by the image to be detected;
[0033] The determining of the compression parameters used when compressing the image to be detected includes: using a third classifier to discriminate the compression parameters of the image to be detected according to the color component characteristics, and determining the compression parameters used when compressing the image to be detected.
[0034] The present application also provides a method for generating a classifier model, the method comprising:
[0035] Determine the images involved in training;
[0036] Extracting at least one color component feature from the image involved in the training;
[0037] A classifier model is trained according to the color component features, and the classifier model is used to detect whether the image to be detected is an original lossless compression format image or a compressed image.
[0038] Optionally, extracting at least one color component feature from the image involved in the training includes:
[0039] Convert the image involved in the training from the RGB color space to the YCbCr color space;
[0040] The at least one color component feature is extracted from the YCbCr color space of the image involved in the training.
[0041] Optionally, extracting the at least one color component feature from the YCbCr color space of the image participating in the training includes:
[0042] The Y color component feature and the Cb color component feature are extracted from the YCbCr color space of the image participating in the training, or the Y color component feature and the Cr color component feature are extracted from the YCbCr color space of the image participating in the training.
[0043] Optionally, also include:
[0044] splicing the Y color component feature and the Cb component feature to obtain the spliced image feature, or splicing the Y color component feature and the Cr component feature to obtain the spliced image feature;
[0045] The training of the classifier model according to the color component features includes: training the classifier model according to the features of the spliced images.
[0046] Optionally, the extracting the Y color component feature and the Cb color component feature from the YCbCr color space of the image participating in the training, or the extracting the Y color component feature and the Cr color component feature from the YCbCr color space of the image participating in the training, includes:
[0047] The Spam11 sub-model and the minmax24 sub-model in the spatial domain rich model are used to extract the Y color component features and the Cb color component features from the YCbCr color space of the image participating in the training, or the Spam11 sub-model and the minmax24 sub-model in the spatial domain rich model are used to extract the Y color component features and the Cr color component features from the YCbCr color space of the image participating in the training.
[0048] Optionally, determining the images to be trained includes:
[0049] Determine a sample set, the sample set comprising a first type of images and a second type of images, the first type of images are original lossless compressed format images, and the second type of images are compressed images;
[0050] The extracting at least one color component feature from the images involved in the training includes: extracting at least one color component feature from the first category of images and the second category of images.
[0051] Optionally, the classifier model includes: a first classifier for determining whether the image to be detected is an image in an original lossless compression format;
[0052] The step of training a classifier model according to the color component features comprises:
[0053] The first classifier is trained according to the color component features.
[0054] Optionally, the classifier model further includes:
[0055] A second classifier for determining the type of compression tool used for the image to be detected;
[0056] The training of the classifier model according to the color component features further comprises:
[0057] The second classifier is trained according to the color component features.
[0058] Optionally, the classifier model further includes:
[0059] a third classifier for determining compression parameters to be used for the image to be tested;
[0060] The training of the classifier model according to the color component features further comprises:
[0061] The third classifier is trained according to the color component features.
[0062] The present application further provides an image detection device, the device comprising:
[0063] A feature extraction unit, used to extract at least one color component feature from the image to be detected;
[0064] The image discrimination unit is used to discriminate whether the image to be detected is an original lossless compressed format image or a compressed image by using a classifier model according to the color component characteristics.
[0065] The present application further provides a device for generating a classifier model, the device comprising:
[0066] An image determination unit, used for determining an image to be involved in training;
[0067] A feature extraction unit, configured to extract at least one color component feature from the image involved in the training;
[0068] The model training unit is used to train a classifier model according to the color component characteristics, and the classifier model is used to detect whether the image to be detected is an original lossless compression format image or a compressed image.
[0069] The present application also provides an electronic device, including:
[0070] Processor; and
[0071] A memory, a program for an image detection method, after the device is powered on and the program of the image detection method is run by the processor, the following steps are performed:
[0072] Extracting at least one color component feature from the image to be detected;
[0073] According to the color component features, a classifier model is used to determine whether the image to be detected is an original lossless compressed format image or a compressed image.
[0074] The present application further provides an electronic device, including:
[0075] Processor; and
[0076] A memory, a program for a method for generating a classifier model, after the device is powered on and the program for the method for generating a classifier model is run by the processor, the following steps are performed:
[0077] Determine the images involved in training;
[0078] Extracting at least one color component feature from the image involved in the training;
[0079] A classifier model is trained according to the color component features, and the classifier model is used to detect whether the image to be detected is an original lossless compression format image or a compressed image.
[0080] The present application further provides a storage device,
[0081] A program for storing an image detection method is stored, and the program is executed by a processor to perform the following steps:
[0082] Extracting at least one color component feature from the image to be detected;
[0083] According to the color component features, a classifier model is used to determine whether the image to be detected is an original lossless compressed format image or a compressed image.
[0084] The present application further provides a storage device,
[0085] A program for storing a method for generating a classifier model is stored, and the program is executed by a processor to perform the following steps:
[0086] Determine the images involved in training;
[0087] Extracting at least one color component feature from the image involved in the training;
[0088] A classifier model is trained according to the color component features, and the classifier model is used to detect whether the image to be detected is an original lossless compression format image or a compressed image.
[0089] Compared with the prior art, this application has the following advantages:
[0090] The image detection method and device provided in the present application use a classifier model to determine whether the image to be detected is an original lossless compressed format image or a compressed image based on the color component features extracted from the image to be detected, thereby meeting the need for originality identification of the image.
[0091] The method and device for generating a classifier model provided in the present application train the classifier model based on the color component features extracted from the images participating in the training, thereby providing a classifier model for originality identification of the images. BRIEF DESCRIPTION OF THE DRAWINGS
[0092] Figure 1 It is a flowchart of an image detection method provided in the first embodiment of the present application.
[0093] Figure 2 This is a color space conversion schematic diagram provided in the first embodiment of the present application.
[0094] Figure 3 It is a schematic diagram of the first classifier and the second classifier provided in the first embodiment of the present application.
[0095] Figure 4 It is a schematic diagram of the third classifier provided in the first embodiment of the present application.
[0096] Figure 5 This is a flowchart of a method for generating a classifier model provided in the second embodiment of the present application.
[0097] Figure 6 It is a schematic diagram of an image detection device provided in the third embodiment of the present application.
[0098] Figure 7 It is a schematic diagram of a device for generating a classifier model provided in the fourth embodiment of the present application.
[0099] Figure 8 It is a schematic diagram of an electronic device provided in the fifth embodiment of the present application.
[0100] Fig. 9 It is a schematic diagram of another electronic device provided in the sixth embodiment of the present application. DETAILED DESCRIPTION
[0101] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0102] The first embodiment of the present application provides an image detection method. Figure 1 , Figure 2 , Figure 3 , Figure 4 , Figure 1 A flowchart of an image detection method provided by the first embodiment of the present application is shown. Figure 2 FIG. 4 shows a schematic diagram of color space conversion provided by the first embodiment of the present application. Figure 3 A schematic diagram of a first classifier and a second classifier provided in the first embodiment of the present application is shown. Figure 4 A schematic diagram of the third classifier provided in the first embodiment of the present application is shown below. Figure 1 , Figure 2 , Figure 3 , Figure 4 Provide detailed explanation.
[0103] like Figure 1 As shown, in step S101, at least one color component feature is extracted from the image to be detected.
[0104] The image to be detected may refer to a lossless compressed format image to be subjected to image originality identification. Image originality identification refers to determining whether the lossless compressed format image is an original lossless compressed format image or a compressed image.
[0105] Lossless compression format refers to the format used to store images when taking pictures with a camera without compressing the image information, that is, the RAW (RAW Image Format) format. Storing images in this format will not cause lossy compression of the image, so the image information will not be lost, but it will occupy more memory than the lossy compression format. For example, images with the suffix CR2 (RAW files generated by Canon cameras, the file suffix is CR2) or ARW (ARW is a file format unique to Sony, which is another form of the RAW file format) are lossless compression format images.
[0106] The color component characteristics may refer to color component characteristics in the YCbCr (YCbCr represents the color space and digital interface of digital television (video), which is an internationally accepted standard) color space, namely, Y color component characteristics, Cb color component characteristics, and Cr color component characteristics, wherein Y represents the brightness component, Cb represents the blue chromaticity component, and Cr represents the red chromaticity component.
[0107] To extract at least one color component feature from the image to be detected, the following method can be adopted:
[0108] Convert the image to be detected from RGB color space to YCbCr color space;
[0109] The at least one color component feature is extracted from the YCbCr color space of the image to be detected.
[0110] During the image compression (e.g., JPEG compression), the three channel color spaces (R (red), G (green), and B (blue)) in the image RGB color space are first converted to the YCbCr color space, and then the Y color component features, Cb color component features, and Cr color component features are downsampled using different downsampling factors. Different compression tools use different downsampling factors for the compression of each color component feature according to the different compression qualities of the selected image when compressing the image. Generally, the Y color component feature sampling factors are different, and the Cb color component features and the Cr color component features use the same sampling factor. The biggest difference between the compression methods of some compression tools is the different sampling factors. Therefore, the image to be detected is first converted from the RGB color space to the YCbCr color space (e.g., Figure 2 As shown), then extract the features of the YCbCr color space, and then use the features of the YCbCr color space to determine the category of the image to be detected, the effect will be significantly improved.
[0111] It should be noted that, since the sampling factors of the Cb color component feature and the Cr color component feature are the same, only one of the color component features can be selected. Therefore, the Y color component feature and the Cb color component feature can be extracted from the YCbCr color space of the image to be detected, or the Y color component feature and the Cr color component feature can be extracted from the YCbCr color space of the image to be detected.
[0112] Furthermore, the Y color component feature and the Cb color component feature can be spliced to obtain the spliced image feature, or the Y color component feature and the Cr color component feature can be spliced to obtain the spliced image feature, which is used as the input of the classifier model to determine whether the image to be detected is an original lossless compression format image or a compressed image.
[0113] When extracting features, there are many image features that can be selected, and the statistical features based on the gray-level co-occurrence matrix have a better effect. Specifically, the Spam11 sub-model and the minmax24 sub-model in the spatial rich model (Spatial Rich Model, SRM) can be used to extract the Y color component features and the Cb color component features from the YCbCr color space of the image to be detected, or the Spam11 sub-model and the minmax24 sub-model in the spatial rich model can be used to extract the Y color component features and the Cr color component features from the YCbCr color space of the image to be detected.
[0114] The features used in SRM are as many as 34671 dimensions. It uses 45 filters, of which some filters are merged to leave 39 filters. When constructing the residual graph, these 39 filters will be quantized with a step size q. Among them, 11 filters use step size q values of {1,2} to generate sub-models, and 28 filters use step size q values of {1,1.5,2} to generate sub-models. There are a total of 106 sub-models, each with 325 or 338-dimensional features. This application tests the classification effect of all sub-models and selects the two sub-models with the best effect, specifically the 338-dimensional s35_spam11_q2 and the 325-dimensional s1_minmax24_q2 sub-templates, with a total of 663-dimensional features. If the two color component features of Y and Cb or the two color component features of Y and Cr are extracted, an image has 663*2=1326-dimensional features after feature splicing.
[0115] like Figure 1 As shown, in step S102, based on the color component features, a classifier model is used to determine whether the image to be detected is an original lossless compressed format image or a compressed image.
[0116] The original lossless compressed format image refers to an image that is taken by a camera or other device and stored in a format without compressing the image information.
[0117] A compressed image refers to an image in a lossless compression format that has been losslessly compressed by a compression tool. A compression tool may refer to compression software, such as Photoshop, ACDsee, etc.
[0118] The classifier model includes: a first classifier for determining whether the image to be detected is an image in the original lossless compression format;
[0119] According to the color component features, using a classifier model to determine whether the image to be detected is an original lossless compressed format image or a compressed image, including:
[0120] According to the color component features, using the first classifier to discriminate the image to be detected;
[0121] If all the first classifiers are used to determine that the image is in the original lossless compression format, then determining that the image to be detected is in the original lossless compression format;
[0122] If at least one first classifier is used to determine that the image to be detected is not an original lossless compressed format image, it is determined that the image to be detected is a compressed image.
[0123] For example, Figure 3 As shown, taking Photoshop, ACDsee, and PhotoMagic as examples, assuming that each software has two categories {1, 2}, the original lossless compression format image is replaced by O, Photoshop, ACDsee, and PhotoMagic are replaced by P, A, and G respectively, and the binary classifiers F(O-P1), F(O-P2), F(O-A1), F(O-A2), F(O-G1), and F(O-G2) are the first classifiers used to determine whether the image to be detected is an original lossless compression format image. During the test, an image to be detected is input, and the image feature F (which can be the image feature after the Y and Cb color component features are spliced) is extracted after the color space conversion is performed first, and the image feature F is input to the above binary classifiers. If all the binary classifiers determine that it is an original lossless compression format image, then the image to be detected is determined to be an original lossless compression format image. If any of the above classifiers determines that the image to be detected is not an original lossless compression format image, then the image to be detected is determined to be a compressed image.
[0124] In the first embodiment of the present application, the binary classifier may adopt a Fisher Linear Discriminant (FLD) ensemble classifier. The FLD ensemble classifier is a binary classifier that can combine multiple binary classifiers to complete a multi-classification task.
[0125] Further, when it is determined that the category of the image to be detected is a compressed image, a compression tool used when compressing the image to be detected may be determined.
[0126] At this time, the classifier model may also include: a second classifier for determining the type of compression tool used for the image to be detected.
[0127] Still using the above example: Figure 3As shown, the binary classifiers F(P1-A1), F(P1-A2), F(P1-G1), F(P1-G2), F(P2-A1), F(P2-A2), F(P2-G1), F(P2-G2), F(A1-G1), F(A1-G2), F(A2-G1), and F(A2-G2) are the second type of classifiers, which can be used to determine which compression tool was used when compressing the image to be detected.
[0128] In a specific implementation, determining the compression tool used when compressing the image to be detected may include the following steps:
[0129] According to the color component characteristics, a second classifier is used to perform discrimination and generate a discrimination result;
[0130] Combine the discrimination results of each second classifier to generate a code;
[0131] Calculating the Hamming distance between the code and a code of a preset compression tool;
[0132] The compression software with the shortest Hamming distance to the encoding is used as the compression tool used when compressing the image to be detected.
[0133] Still using the above example: if it is determined that the image to be tested is a compressed image, it is necessary to identify the compression tool used to compress the image to be tested, input the image feature F into all the second classifiers mentioned above, and each classifier will output a discrimination result, which is "+1" or "-1". These discrimination results are combined to generate a string of codes, and then the Hamming distance (Euclidean distance can also be used) between the code of the image to be tested and the codes of various pre-set software is calculated. Among all the compression tools, the one with the shortest Hamming distance to the above code is the compression tool used to compress the image to be tested.
[0134] As shown in Table 1, it shows the preset Figure 3 The encodings corresponding to various compression software.
[0135] Table 1
[0136] P1-A1 P1-A2 P2-A1 P2-A2 P1-G1 P1-G2 P2-G1 P2-G2 A1-G1 A1-G2 A2-G1 A2-G2 P 1 1 1 1 1 1 1 1 0 0 0 0 A -1 -1 -1 -1 0 0 0 0 1 1 1 1 G 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1
[0137] Refer to Table 1. For example, if software P (Photoshop) is classified as positive in the binary classifiers F(P1-A1), F(P1-A2), F(P1-G1), F(P1-G2), F(P2-A1), F(P2-A2), F(P2-G1), and F(P2-G2), then the code of P in these binary classifiers is 1, and P does not participate in the training of the binary classifiers F(A1-G1), F(A1-G2), F(A2-G1), and F(A2-G2). The binary classifiers corresponding to software P are The binary classifier code is 0; G (Photomagic) is classified as a negative class in the F(P1-G1), F(P1-G2), F(P2-G1), F(P2-G2), F(A1-G1), F(A1-G2), F(A2-G1), and F(A2-G2) classifiers, then the code of G in these binary classifiers P is -1, G does not participate in the training of the F(P1-A1), F(P1-A2), F(P2-A1), and F(P2-A2) binary classifiers, and the binary classifier code corresponding to the software P is 0.
[0138] The following example illustrates the Hamming distance calculation method. Referring to Table 2, if the image to be detected (replaced by T in Table 2) is identified by the second classifier, the generated code is 0111111111000. Each bit is compared with the codes of P, A, and G. If the corresponding bits are the same, the corresponding bits are 0, and if they are different, they are 1. If the software code is 0, no calculation is performed, that is, the distance is directly 0. The code generated after the image to be detected is 011111111000, the code of P is 111111110000, and the distance from P is 100000000000, and the distance added up is 1. The distance from A is 011100000000, which is 3. The distance from G is 000011111000, which is 5. Since the distance from P is the shortest, it is determined that the image to be detected is an image compressed by Photoshop.
[0139] Table 2
[0140]
[0141]
[0142] Furthermore, after determining the compression tool used when compressing the image to be detected, the compression parameters used when compressing the image to be detected may also be determined.
[0143] At this time, the classifier model may also include: a third classifier for determining the compression parameters used for the image to be detected.
[0144] Determining the compression parameters used when compressing the image to be detected includes: using a third classifier to discriminate the compression parameters of the image to be detected according to the color component characteristics, and determining the compression parameters used when compressing the image to be detected.
[0145] like Figure 4 As shown, in Photoshop, it includes parameters 0-12, (f0-f1)-(f0-f12)), (f1-f2)-(f1-f12))... The above two classifiers are the third classifiers.
[0146] Still using the above example, determine that the image to be tested is an image compressed by Photoshop, call the Photoshop compression parameter classifier (i.e., the third classifier in 4), input the image feature F to all the third classifiers, and vote on the final result based on all the binary classification results. If the parameter output is 10, it is determined that the compression parameter used when compressing the image to be tested is 10.
[0147] So far, the implementation method of the image detection method provided by the first embodiment of the present application has been described in detail. The first embodiment of the present application uses a classifier model to distinguish whether the image to be detected is an original lossless compressed format image or a compressed image based on the color component features extracted from the image to be detected, which not only meets the need for originality identification of the image, but also when the classifier model includes a second classifier, it can also determine the compression tool used when compressing the image to be detected, and when the classifier model includes a third classifier, it can further determine the compression parameters used when compressing the image to be detected, thereby meeting multiple needs for image identification.
[0148] The second embodiment of the present application provides a method for generating a classifier model. Figure 5 , Figure 5 A flow chart of a method for generating a classifier model provided in the second embodiment of the present application is shown.
[0149] like Figure 5 As shown, in step S501, images involved in training are determined.
[0150] The images participating in the training refer to images participating in the classifier model training.
[0151] The images involved in the training may be a sample set, which includes a first type of images and a second type of images. The first type of images are images in original lossless compression format, and the second type of images are compressed images.
[0152] The original lossless compressed format image refers to an image that is taken by a camera or other device and stored in a format without compressing the image information.
[0153] A compressed image refers to an image in a lossless compression format that has been losslessly compressed by a compression tool. A compression tool may refer to compression software, such as Photoshop, ACDsee, etc.
[0154] like Figure 5 As shown, in step S502, at least one color component feature is extracted from the image involved in the training.
[0155] The color component characteristics may refer to color component characteristics in the YCbCr (YCbCr represents the color space and digital interface of digital television (video), which is an internationally accepted standard) color space, namely, Y color component characteristics, Cb color component characteristics, and Cr color component characteristics, wherein Y represents the brightness component, Cb represents the blue chromaticity component, and Cr represents the red chromaticity component.
[0156] To extract at least one color component feature from the image involved in the training, the following method can be used:
[0157] Convert the image involved in the training from the RGB color space to the YCbCr color space;
[0158] The at least one color component feature is extracted from the YCbCr color space of the image involved in the training.
[0159] During the image compression process (e.g., JPEG compression), the three channel color spaces (R (red), G (green), and B (blue)) in the image RGB color space are first converted to the YCbCr color space, and then the Y color component features, Cb color component features, and Cr color component features are downsampled using different downsampling factors. Different compression tools use different downsampling factors for the compression of each color component feature according to the different compression quality of the selected image when compressing the image. Generally, the Y color component feature sampling factors are different, and the Cb color component features and the Cr color component features use the same sampling factor. The biggest difference between the compression methods of some compression tools is the different sampling factors. Therefore, the images involved in the training are first converted from the RGB color space to the YCbCr color space (e.g. Figure 2 As shown), then extract the features of the YCbCr color space, and then use the features of the YCbCr color space to train the classifier model, the effect will be significantly improved.
[0160] It should be noted that, since the sampling factors of the Cb color component feature and the Cr color component feature are the same, only one of the color component features can be selected. Therefore, the Y color component feature and the Cb color component feature can be extracted from the YCbCr color space of the image participating in the training, or the Y color component feature and the Cr color component feature can be extracted from the YCbCr color space of the image participating in the training.
[0161] Furthermore, the Y color component feature and the Cb color component feature may be spliced to obtain the spliced image feature, or the Y color component feature and the Cr color component feature may be spliced to obtain the spliced image feature, and then a classifier model may be trained based on the spliced image feature.
[0162] When extracting features, there are many image features that can be selected, and the statistical features based on the gray-level co-occurrence matrix have a better effect. Specifically, the Spam11 sub-model and the minmax24 sub-model in the spatial rich model (Spatial Rich Model, SRM) can be used to extract the Y color component features and the Cb color component features from the YCbCr color space of the image participating in the training, or the Spam11 sub-model and the minmax24 sub-model in the spatial rich model can be used to extract the Y color component features and the Cr color component features from the YCbCr color space of the image participating in the training.
[0163] The features used in SRM are as many as 34671 dimensions. It uses 45 filters, of which some filters are merged to leave 39 filters. When constructing the residual graph, these 39 filters will be quantized with a step size q. Among them, 11 filters use step size q values of {1,2} to generate sub-models, and 28 filters use step size q values of {1,1.5,2} to generate sub-models. There are a total of 106 sub-models, each with 325 or 338-dimensional features. This application tests the classification effect of all sub-models and selects the two sub-models with the best effect, specifically the 338-dimensional s35_spam11_q2 and the 325-dimensional s1_minmax24_q2 sub-templates, with a total of 663-dimensional features. If the two color component features of Y and Cb or the two color component features of Y and Cr are extracted, an image has 663*2=1326-dimensional features after feature splicing.
[0164] like Figure 5 As shown, in step S503, a classifier model is trained according to the color component features, and the classifier model is used to detect whether the image to be detected is an original lossless compression format image or a compressed image.
[0165] The classifier model may include: a first classifier for determining whether the image to be detected is an image in the original lossless compression format; and training the classifier model according to the color component features includes: training the first classifier according to the color component features.
[0166] For example, Figure 3 As shown, taking Photoshop, ACDsee, and PhotoMagic as examples, assuming that each software has two categories {1, 2}, the original lossless compression format image is replaced by O, Photoshop, ACDsee, and PhotoMagic are replaced by P, A, and G respectively, and it is necessary to train F(O-P1), F(O-P2), F(O-A1), F(O-A2), F(O-G1), and F(O-G2) two classifiers, which are the first classifiers used to determine whether the image to be detected is an original lossless compression format image. The first type of image can be converted into color space first, and then the image feature F (which can be the image feature after the two color component features of Y and Cb are spliced) can be extracted, and then the image feature F can be input into the first classifier to train the first classifier.
[0167] Furthermore, the classifier model may also include: a second classifier for determining the type of compression tool used for the image to be detected; and training the classifier model according to the color component characteristics may also include: training the second classifier according to the color component characteristics.
[0168] like Figure 3 As shown, the binary classifiers F(P1-A1), F(P1-A2), F(P1-G1), F(P1-G2), F(P2-A1), F(P2-A2), F(P2-G1), F(P2-G2), F(A1-G1), F(A1-G2), F(A2-G1), and F(A2-G2) are the second type of classifiers, which can be used to determine which compression tool was used when compressing the image to be detected.
[0169] When training the second classifier, the second category of images can be divided into multiple second sub-category images according to the compression tools. For example, taking Photoshop and ACDsee as two software, Photoshop has 13 different compression parameters, and the images compressed by Photoshop can be divided into 13 second sub-category images according to the compression parameters. Since ACDsee has 100 different compression parameters, the 13 compression parameters of ACDsee can be selected according to the principle of similar compression factors, and 13 second sub-category images can be selected according to the compression parameters.
[0170] It should be noted that when training the second classifier, the classifiers can be trained by cross-training two subclasses according to the type of compression software. For example, images compressed by Photoshop can be divided into second subclass images P0-P12 according to the compression parameters, and images compressed by ACDsee can be divided into second subclass images A0-A12 according to the compression parameters. Then, the second subclass images P0-P12 belonging to Photoshop and the second subclass images A0-A12 belonging to ACDsee are cross-trained to train the second classifier. For example, the color component features extracted from the second subclass images P1 and the second subclass images A1 (which can be the image features after the two color component features Y and Cb are spliced) are used to train the second classifier (P1-A1).
[0171] Furthermore, the classifier model may also include: a third classifier for determining compression parameters adopted by the image to be detected; and training the classifier model according to the color component characteristics also includes: training the third classifier according to the color component characteristics.
[0172] like Figure 4 As shown, in Photoshop, the parameters 0-12 are included, (f0-f1)-(f0-f12)), (f1-f2)-(f1-f12))... The above two classifiers are the third classifiers. During training, the classifiers are trained in pairs according to the compression parameters. For example, the third classifier (f1-f2) is trained using the color component features extracted from the second subclass image of P1 and the second subclass image of P2 (it can also be the image features after the two color component features of Y and Cb are spliced).
[0173] So far, the implementation method of the generation method of the classifier model provided by the second embodiment of the present application is described in detail. The second embodiment of the present application extracts at least one color component feature from the image participating in the training, and trains the classifier model according to the color component feature. It not only provides a first classifier for determining whether the image to be detected is an image in the original lossless compression format, but also provides a second classifier for determining the type of compression tool used by the image to be detected. In addition, it also provides a third classifier for determining the compression parameters used by the image to be detected, thereby meeting various needs for image identification.
[0174] Corresponding to the image detection method provided above, the third embodiment of the present application also provides an image detection device.
[0175] like Figure 6 As shown, the image detection device includes: a feature extraction unit 601 and an image discrimination unit 602.
[0176] A feature extraction unit 601 is used to extract at least one color component feature from the image to be detected;
[0177] The image discrimination unit 602 is used to discriminate whether the image to be detected is an original lossless compressed format image or a compressed image by using a classifier model according to the color component features.
[0178] Optionally, the feature extraction unit includes:
[0179] A color space conversion subunit, used for converting the image to be detected from an RGB color space to a YCbCr color space;
[0180] The color component extraction subunit is used to extract the at least one color component feature from the YCbCr color space of the image to be detected.
[0181] Optionally, the color component extraction subunit is specifically used to:
[0182] The Y color component feature and the Cb color component feature are extracted from the YCbCr color space of the image to be detected, or the Y color component feature and the Cr color component feature are extracted from the YCbCr color space of the image to be detected.
[0183] Optionally, the device further comprises:
[0184] A feature splicing unit, used for splicing the Y color component feature and the Cb color component feature to obtain the spliced image feature, or splicing the Y color component feature and the Cr color component feature to obtain the spliced image feature;
[0185] The image discrimination unit is specifically used to: use a classifier model to discriminate whether the image to be detected is an original image or a compressed image according to the features of the spliced images.
[0186] Optionally, the extracting the Y color component feature and the Cb color component feature from the YCbCr color space of the image to be detected, or the extracting the Y color component feature and the Cr color component feature from the YCbCr color space of the image to be detected, includes:
[0187] The Spam11 sub-model and the minmax24 sub-model in the spatial domain rich model are used to extract the Y color component features and the Cb color component features from the YCbCr color space of the image to be detected, or the Spam11 sub-model and the minmax24 sub-model in the spatial domain rich model are used to extract the Y color component features and the Cr color component features from the YCbCr color space of the image to be detected.
[0188] Optionally, the classifier model includes: a first classifier for determining whether the image to be detected is an image in an original lossless compression format;
[0189] The image discrimination unit is specifically used for:
[0190] According to the color component features, using the first classifier to discriminate the image to be detected;
[0191] If all the first classifiers are used to determine that the image is in the original lossless compression format, then determining that the image to be detected is in the original lossless compression format;
[0192] If at least one first classifier is used to determine that the image to be detected is not an original lossless compressed format image, it is determined that the image to be detected is a compressed image.
[0193] Optionally, the device further comprises a compression tool determining unit, which is used to determine a compression tool used to compress the image to be detected when it is determined that the category of the image to be detected is a compressed image.
[0194] Optionally, the classifier model further includes: a second classifier for determining the type of compression tool used for the image to be detected;
[0195] The compression tool determination unit is specifically used to:
[0196] According to the color component characteristics, a second classifier is used to perform discrimination and generate a discrimination result;
[0197] Combine the discrimination results of each second classifier to generate a code;
[0198] Calculating the Hamming distance between the code and a code of a preset compression tool;
[0199] The compression tool with the shortest Hamming distance to the encoding is used as the compression tool used when compressing the image to be detected.
[0200] Optionally, the device further includes: a compression parameter determination unit, configured to determine a compression parameter used when compressing the image to be detected.
[0201] Optionally, the classifier model further includes: a third classifier for determining compression parameters adopted by the image to be detected;
[0202] The compression parameter determination unit is specifically used to: use the third classifier to discriminate the compression parameters of the image to be detected according to the color component characteristics, and determine the compression parameters used when compressing the image to be detected.
[0203] It should be noted that for the detailed description of the image detection device provided in the third embodiment of the present application, reference can be made to the relevant description of the first embodiment of the present application, which will not be repeated here.
[0204] Corresponding to the above-mentioned method for generating a classifier model, the fourth embodiment of the present application also provides a device for generating a classifier model.
[0205] like Figure 7 As shown, the generation device of the classifier model includes: an image determination unit 701, a feature extraction unit 702, and a model training unit 703.
[0206] An image determination unit 701 is used to determine images to be used in training;
[0207] A feature extraction unit 702, configured to extract at least one color component feature from the image involved in the training;
[0208] The model training unit 703 is used to train a classifier model according to the color component features, and the classifier model is used to detect whether the image to be detected is an original lossless compression format image or a compressed image.
[0209] Optionally, it is characterized in that the feature extraction unit includes:
[0210] A color space conversion subunit, used to convert the image involved in the training from the RGB color space to the YCbCr color space;
[0211] The color component extraction subunit is used to extract the at least one color component feature from the YCbCr color space of the image participating in the training.
[0212] Optionally, the color component extraction subunit is specifically used to:
[0213] The Y color component feature and the Cb color component feature are extracted from the YCbCr color space of the image participating in the training, or the Y color component feature and the Cr color component feature are extracted from the YCbCr color space of the image participating in the training.
[0214] Optionally, the device further comprises:
[0215] A feature splicing unit, used for splicing the Y color component feature and the Cb component feature to obtain the spliced image feature, or splicing the Y color component feature and the Cr component feature to obtain the spliced image feature;
[0216] The model training unit is specifically used to train a classifier model according to the features of the spliced images.
[0217] Optionally, the extracting the Y color component feature and the Cb color component feature from the YCbCr color space of the image participating in the training, or the extracting the Y color component feature and the Cr color component feature from the YCbCr color space of the image participating in the training, includes:
[0218] The Spam11 sub-model and the minmax24 sub-model in the spatial domain rich model are used to extract the Y color component features and the Cb color component features from the YCbCr color space of the image participating in the training, or the Spam11 sub-model and the minmax24 sub-model in the spatial domain rich model are used to extract the Y color component features and the Cr color component features from the YCbCr color space of the image participating in the training.
[0219] Optionally, the image determination unit is specifically used to:
[0220] Determine a sample set, the sample set comprising a first type of images and a second type of images, the first type of images are original lossless compressed format images, and the second type of images are compressed images;
[0221] The extracting at least one color component feature from the images involved in the training includes: extracting at least one color component feature from the first category of images and the second category of images.
[0222] Optionally, the classifier model includes: a first classifier for determining whether the image to be detected is an image in an original lossless compression format;
[0223] The model training unit is specifically used for:
[0224] The first classifier is trained according to the color component features.
[0225] Optionally, the classifier model further includes:
[0226] A second classifier for determining the type of compression tool used for the image to be detected;
[0227] The model training unit is further used for:
[0228] The second classifier is trained according to the color component features.
[0229] Optionally, the classifier model further includes:
[0230] a third classifier for determining compression parameters to be used for the image to be tested;
[0231] The model training unit is further used for:
[0232] The third classifier is trained according to the color component features.
[0233] It should be noted that for the detailed description of the image classifier model generation device provided in the fourth embodiment of the present application, reference can be made to the relevant description of the second embodiment of the present application, and will not be repeated here.
[0234] Corresponding to the image detection method provided above, the fifth embodiment of the present application also provides an electronic device.
[0235] like Figure 8 As shown, the electronic equipment includes:
[0236] Processor 801; and
[0237] The memory 802 is used for the program of the image detection method. After the device is powered on and the program of the image detection method is run by the processor, the following steps are performed:
[0238] Extracting at least one color component feature from the image to be detected;
[0239] According to the color component features, a classifier model is used to determine whether the image to be detected is an original lossless compressed format image or a compressed image.
[0240] Optionally, extracting at least one color component feature from the image to be detected includes:
[0241] Convert the image to be detected from RGB color space to YCbCr color space;
[0242] The at least one color component feature is extracted from the YCbCr color space of the image to be detected.
[0243] Optionally, extracting the at least one color component feature from the YCbCr color space of the image to be detected includes:
[0244] The Y color component feature and the Cb color component feature are extracted from the YCbCr color space of the image to be detected, or the Y color component feature and the Cr color component feature are extracted from the YCbCr color space of the image to be detected.
[0245] Optionally, perform the following steps:
[0246] splicing the Y color component feature and the Cb color component feature to obtain the spliced image feature, or splicing the Y color component feature and the Cr color component feature to obtain the spliced image feature;
[0247] The method of using a classifier model to determine whether the image to be detected is an original image or a compressed image based on the color component features includes: using a classifier model to determine whether the image to be detected is an original image or a compressed image based on the features of the spliced images.
[0248] Optionally, the extracting the Y color component feature and the Cb color component feature from the YCbCr color space of the image to be detected, or the extracting the Y color component feature and the Cr color component feature from the YCbCr color space of the image to be detected, includes:
[0249] The Spam11 sub-model and the minmax24 sub-model in the spatial domain rich model are used to extract the Y color component features and the Cb color component features from the YCbCr color space of the image to be detected, or the Spam11 sub-model and the minmax24 sub-model in the spatial domain rich model are used to extract the Y color component features and the Cr color component features from the YCbCr color space of the image to be detected.
[0250] Optionally, the classifier model includes: a first classifier for determining whether the image to be detected is an image in an original lossless compression format;
[0251] The step of using a classifier model to determine whether the image to be detected is an original lossless compressed format image or a compressed image according to the color component features includes:
[0252] According to the color component features, using the first classifier to discriminate the image to be detected;
[0253] If all the first classifiers are used to determine that the image is in the original lossless compression format, then determining that the image to be detected is in the original lossless compression format;
[0254] If at least one first classifier is used to determine that the image to be detected is not an original lossless compressed format image, it is determined that the image to be detected is a compressed image.
[0255] Optionally, the following step is further performed: when it is determined that the category of the image to be detected is a compressed image, determining a compression tool used when compressing the image to be detected.
[0256] Optionally, the classifier model further includes: a second classifier for determining the type of compression tool used for the image to be detected;
[0257] Determining a compression tool to be used when compressing the image to be detected includes:
[0258] According to the color component characteristics, a second classifier is used to perform discrimination and generate a discrimination result;
[0259] Combine the discrimination results of each second classifier to generate a code;
[0260] Calculating the Hamming distance between the code and a code of a preset compression tool;
[0261] The compression tool with the shortest Hamming distance to the encoding is used as the compression tool used when compressing the image to be detected.
[0262] Optionally, the following step is also performed: determining compression parameters used when compressing the image to be detected.
[0263] Optionally, the classifier model further includes: a third classifier for determining compression parameters adopted by the image to be detected;
[0264] The determining of the compression parameters used when compressing the image to be detected includes: using a third classifier to discriminate the compression parameters of the image to be detected according to the color component characteristics, and determining the compression parameters used when compressing the image to be detected.
[0265] Corresponding to the above-mentioned method for generating a classifier model, the sixth embodiment of the present application further provides an electronic device.
[0266] like Fig. 9 As shown, the electronic equipment includes:
[0267] Processor 901; and
[0268] The memory 902 is used for a program of a method for generating a classifier model. After the device is powered on and the program of the method for generating a classifier model is run by the processor, the following steps are performed:
[0269] Determine the images involved in training;
[0270] Extracting at least one color component feature from the image involved in the training;
[0271] A classifier model is trained according to the color component features, and the classifier model is used to detect whether the image to be detected is an original lossless compression format image or a compressed image.
[0272] Optionally, extracting at least one color component feature from the image involved in the training includes:
[0273] Convert the image involved in the training from the RGB color space to the YCbCr color space;
[0274] The at least one color component feature is extracted from the YCbCr color space of the image involved in the training.
[0275] Optionally, extracting the at least one color component feature from the YCbCr color space of the image participating in the training includes:
[0276] The Y color component feature and the Cb color component feature are extracted from the YCbCr color space of the image participating in the training, or the Y color component feature and the Cr color component feature are extracted from the YCbCr color space of the image participating in the training.
[0277] Optionally, perform the following steps:
[0278] splicing the Y color component feature and the Cb component feature to obtain the spliced image feature, or splicing the Y color component feature and the Cr component feature to obtain the spliced image feature;
[0279] The training of the classifier model according to the color component features includes: training the classifier model according to the features of the spliced images.
[0280] Optionally, the extracting the Y color component feature and the Cb color component feature from the YCbCr color space of the image participating in the training, or the extracting the Y color component feature and the Cr color component feature from the YCbCr color space of the image participating in the training, includes:
[0281] The Spam11 sub-model and the minmax24 sub-model in the spatial domain rich model are used to extract the Y color component features and the Cb color component features from the YCbCr color space of the image participating in the training, or the Spam11 sub-model and the minmax24 sub-model in the spatial domain rich model are used to extract the Y color component features and the Cr color component features from the YCbCr color space of the image participating in the training.
[0282] Optionally, determining the images to be trained includes:
[0283] Determine a sample set, the sample set comprising a first type of images and a second type of images, the first type of images are original lossless compressed format images, and the second type of images are compressed images;
[0284] The extracting at least one color component feature from the images involved in the training includes: extracting at least one color component feature from the first category of images and the second category of images.
[0285] Optionally, the classifier model includes: a first classifier for determining whether the image to be detected is an image in an original lossless compression format;
[0286] The step of training a classifier model according to the color component features comprises:
[0287] The first classifier is trained according to the color component features.
[0288] Optionally, the classifier model further includes:
[0289] A second classifier for determining the type of compression tool used for the image to be detected;
[0290] The training of the classifier model according to the color component features further comprises:
[0291] The second classifier is trained according to the color component features.
[0292] Optionally, the classifier model further includes:
[0293] a third classifier for determining compression parameters to be used for the image to be tested;
[0294] The training of the classifier model according to the color component features further comprises:
[0295] The third classifier is trained according to the color component features.
[0296] A seventh embodiment of the present application provides a storage device,
[0297] A program for storing an image detection method is stored, and the program is executed by a processor to perform the following steps:
[0298] Extracting at least one color component feature from the image to be detected;
[0299] According to the color component features, a classifier model is used to determine whether the image to be detected is an original lossless compressed format image or a compressed image.
[0300] An eighth embodiment of the present application provides another storage device,
[0301] A program for storing a method for generating a classifier model is stored, and the program is executed by a processor to perform the following steps:
[0302] Determine the images involved in training;
[0303] Extracting at least one color component feature from the image involved in the training;
[0304] A classifier model is trained according to the color component features, and the classifier model is used to detect whether the image to be detected is an original lossless compression format image or a compressed image.
[0305] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
[0306] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0307] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0308] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0309] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
Claims
1. An image detection method, characterized in that: include: Extracting at least one color component feature from the image to be detected, comprising: converting the image to be detected from an RGB color space to a YCbCr color space; extracting a Y color component feature and a Cb color component feature from the YCbCr color space of the image to be detected, or extracting a Y color component feature and a Cr color component feature from the YCbCr color space of the image to be detected; According to the color component features, a classifier model is used to determine whether the image to be detected is an original lossless compressed format image or a compressed image; the classifier model includes: a first classifier for determining whether the image to be detected is an original lossless compressed format image; The method of using a classifier model to judge whether the image to be detected is an original lossless compressed format image or a compressed image according to the color component features comprises: using the first classifier to judge the image to be detected according to the color component features; if all the first classifiers judge the image to be an original lossless compressed format image, then determining that the image to be detected is an original lossless compressed format image; if at least one of the first classifiers judges that the image to be detected is not an original lossless compressed format image, then determining that the image to be detected is a compressed image; The method further comprises: when it is determined that the category of the image to be detected is a compressed image, determining a compression tool used when compressing the image to be detected; The classifier model further includes: a second classifier for determining the type of compression tool used for the image to be detected; Determining a compression tool to be used when compressing the image to be detected includes: According to the color component characteristics, a second classifier is used to perform discrimination and generate a discrimination result; Combine the discrimination results of each second classifier to generate a code; Calculating the Hamming distance between the code and a code of a preset compression tool; The compression tool with the shortest Hamming distance to the encoding is used as the compression tool used when compressing the image to be detected.
2. The method according to claim 1, characterized in that Also includes: splicing the Y color component feature and the Cb color component feature to obtain a spliced image feature, or splicing the Y color component feature and the Cr color component feature to obtain a spliced image feature; The method of using a classifier model to determine whether the image to be detected is an original image or a compressed image based on the color component features includes: using a classifier model to determine whether the image to be detected is an original image or a compressed image based on the features of the spliced images.
3. The method according to claim 1, characterized in that The step of extracting the Y color component feature and the Cb color component feature from the YCbCr color space of the image to be detected, or extracting the Y color component feature and the Cr color component feature from the YCbCr color space of the image to be detected, comprises: The Spam11 sub-model and the minmax24 sub-model in the spatial domain rich model are used to extract the Y color component features and the Cb color component features from the YCbCr color space of the image to be detected, or the Spam11 sub-model and the minmax24 sub-model in the spatial domain rich model are used to extract the Y color component features and the Cr color component features from the YCbCr color space of the image to be detected.
4. The method according to claim 1, characterized in that: Also includes: Determine the compression parameters used when compressing the image to be detected.
5. The method according to claim 4, characterized in that The classifier model further includes: a third classifier for determining compression parameters adopted by the image to be detected; The determining of the compression parameters used when compressing the image to be detected includes: using a third classifier to discriminate the compression parameters of the image to be detected according to the color component characteristics, and determining the compression parameters used when compressing the image to be detected.
6. A method for generating a classifier model, characterized in that: The classifier model includes the first classifier and the second classifier in the image detection method of claim 1; wherein the first classifier is used to determine whether the image to be detected is an original lossless compressed format image, and the second classifier is used to determine the type of compression tool used by the image to be detected, and the generation method includes: Determine the images involved in training; Extracting at least one color component feature from the image participating in the training, including: converting the image participating in the training from an RGB color space to a YCbCr color space; extracting a Y color component feature and a Cb color component feature from the YCbCr color space of the image participating in the training, or extracting a Y color component feature and a Cr color component feature from the YCbCr color space of the image participating in the training; According to the color component features, the first classifier is trained; the first classifier includes a plurality of binary classifiers respectively trained corresponding to different compression software; The method also includes: training the second classifier according to the color component features.
7. The method according to claim 6, characterized in that Also includes: splicing the Y color component feature and the Cb color component feature to obtain a spliced image feature, or splicing the Y color component feature and the Cr color component feature to obtain a spliced image feature; The training of the classifier model according to the color component features includes: training the classifier model according to the features of the spliced images.
8. The method according to claim 6, characterized in that The step of extracting the Y color component feature and the Cb color component feature from the YCbCr color space of the image participating in the training, or extracting the Y color component feature and the Cr color component feature from the YCbCr color space of the image participating in the training, comprises: The Spam11 sub-model and the minmax24 sub-model in the spatial domain rich model are used to extract the Y color component features and the Cb color component features from the YCbCr color space of the image participating in the training, or the Spam11 sub-model and the minmax24 sub-model in the spatial domain rich model are used to extract the Y color component features and the Cr color component features from the YCbCr color space of the image participating in the training.
9. The method according to claim 6, characterized in that The step of determining the images involved in the training comprises: Determine a sample set, the sample set comprising a first type of images and a second type of images, the first type of images are original lossless compressed format images, and the second type of images are compressed images; The extracting at least one color component feature from the images involved in the training includes: extracting at least one color component feature from the first category of images and the second category of images.
10. The method according to claim 6, characterized in that The classifier model also includes: a third classifier for determining compression parameters to be used for the image to be tested; The training of the classifier model according to the color component features further comprises: The third classifier is trained according to the color component features.
11. An image detection device, characterized in that: include: A feature extraction unit, used to extract at least one color component feature from the image to be detected, including: converting the image to be detected from an RGB color space to a YCbCr color space; extracting a Y color component feature and a Cb color component feature from the YCbCr color space of the image to be detected, or extracting a Y color component feature and a Cr color component feature from the YCbCr color space of the image to be detected; An image discrimination unit, used to discriminate whether the image to be detected is an original lossless compressed format image or a compressed image by using a classifier model according to the color component features; The classifier model includes a first classifier for determining whether the image to be detected is an image in the original lossless compression format, wherein the first classifier includes a plurality of binary classifiers respectively trained corresponding to different compression software; The device further comprises: a compression tool determining unit, configured to determine a compression tool used when compressing the image to be detected when determining that the category of the image to be detected is a compressed image; The classifier model further includes: a second classifier for determining the type of compression tool used for the image to be detected; Determining a compression tool to be used when compressing the image to be detected includes: According to the color component characteristics, a second classifier is used to perform discrimination and generate a discrimination result; Combine the discrimination results of each second classifier to generate a code; Calculating the Hamming distance between the code and a code of a preset compression tool; The compression tool with the shortest Hamming distance to the encoding is used as the compression tool used when compressing the image to be detected.
12. A device for generating a classifier model, characterized in that: The classifier model includes the first classifier and the second classifier in the image detection device of claim 11; wherein the first classifier is used to determine whether the image to be detected is an original lossless compressed format image, and the second classifier is used to determine the type of compression tool used by the image to be detected, and the generating device includes: An image determination unit, used for determining images involved in training; A feature extraction unit, used to extract at least one color component feature from the image participating in the training, including: converting the image participating in the training from an RGB color space to a YCbCr color space; extracting a Y color component feature and a Cb color component feature from the YCbCr color space of the image participating in the training, or extracting a Y color component feature and a Cr color component feature from the YCbCr color space of the image participating in the training; A model training unit, used for training the first classifier according to the color component characteristics; the first classifier includes a plurality of binary classifiers respectively trained corresponding to different compression software; The method also includes: training the second classifier according to the color component features.
13. An electronic device, characterized in that: include: processor; as well as The memory is used to store a program of the image detection method. After the device is powered on and the program of the image detection method is run by the processor, the following steps are performed: Extracting at least one color component feature from the image to be detected, comprising: converting the image to be detected from an RGB color space to a YCbCr color space; extracting a Y color component feature and a Cb color component feature from the YCbCr color space of the image to be detected, or extracting a Y color component feature and a Cr color component feature from the YCbCr color space of the image to be detected; According to the color component features, a classifier model is used to determine whether the image to be detected is an original lossless compressed format image or a compressed image; The classifier model includes: a first classifier for determining whether the image to be detected is an image in the original lossless compression format; The step of using a classifier model to determine whether the image to be detected is an original lossless compressed format image or a compressed image according to the color component features includes: According to the color component features, using the first classifier to discriminate the image to be detected; If all the first classifiers are used to determine that the image is in the original lossless compression format, then determining that the image to be detected is in the original lossless compression format; If at least one first classifier is used to determine that the image to be detected is not an image in the original lossless compression format, then determining that the image to be detected is a compressed image; When it is determined that the category of the image to be detected is a compressed image, determining a compression tool to be used when compressing the image to be detected; The classifier model further includes: a second classifier for determining the type of compression tool used for the image to be detected; Determining a compression tool to be used when compressing the image to be detected includes: According to the color component characteristics, a second classifier is used to perform discrimination and generate a discrimination result; Combine the discrimination results of each second classifier to generate a code; Calculating the Hamming distance between the code and a code of a preset compression tool; The compression tool with the shortest Hamming distance to the encoding is used as the compression tool used when compressing the image to be detected.
14. An electronic device, characterized in that: include: processor; as well as A memory for storing a program of the method for generating a classifier model as claimed in claim 6, wherein after the device is powered on and the program of the method for generating a classifier model is run by the processor, the following steps are performed: Determine the images involved in training; Extracting at least one color component feature from the image participating in the training, including: converting the image participating in the training from an RGB color space to a YCbCr color space; extracting a Y color component feature and a Cb color component feature from the YCbCr color space of the image participating in the training, or extracting a Y color component feature and a Cr color component feature from the YCbCr color space of the image participating in the training; According to the color component features, the first classifier is trained; the first classifier includes a plurality of binary classifiers respectively trained corresponding to different compression software; The method also includes: training the second classifier according to the color component features.
15. A storage device, characterized in that: A program for storing an image detection method is stored, and the program is executed by a processor to perform the following steps: Extracting at least one color component feature from the image to be detected, comprising: converting the image to be detected from an RGB color space to a YCbCr color space; extracting a Y color component feature and a Cb color component feature from the YCbCr color space of the image to be detected, or extracting a Y color component feature and a Cr color component feature from the YCbCr color space of the image to be detected; According to the color component features, a classifier model is used to determine whether the image to be detected is an original lossless compressed format image or a compressed image; the classifier model includes: a first classifier for determining whether the image to be detected is an original lossless compressed format image; The step of using a classifier model to determine whether the image to be detected is an original lossless compressed format image or a compressed image according to the color component features includes: According to the color component features, using the first classifier to discriminate the image to be detected; If all the first classifiers are used to determine that the image is in the original lossless compression format, then determining that the image to be detected is in the original lossless compression format; If at least one first classifier is used to determine that the image to be detected is not an image in the original lossless compression format, then determining that the image to be detected is a compressed image; When it is determined that the category of the image to be detected is a compressed image, determining a compression tool to be used when compressing the image to be detected; The classifier model further includes: a second classifier for determining the type of compression tool used for the image to be detected; Determining a compression tool to be used when compressing the image to be detected includes: According to the color component characteristics, a second classifier is used to perform discrimination and generate a discrimination result; Combine the discrimination results of each second classifier to generate a code; Calculating the Hamming distance between the code and a code of a preset compression tool; The compression tool with the shortest Hamming distance to the encoding is used as the compression tool used when compressing the image to be detected.
16. A storage device, characterized in that: A program for storing the method for generating a classifier model according to claim 6 is stored, and the program is executed by a processor to perform the following steps: Determine the images involved in training; Extracting at least one color component feature from the image participating in the training, including: converting the image participating in the training from an RGB color space to a YCbCr color space; extracting a Y color component feature and a Cb color component feature from the YCbCr color space of the image participating in the training, or extracting a Y color component feature and a Cr color component feature from the YCbCr color space of the image participating in the training; According to the color component features, the first classifier is trained; the first classifier includes a plurality of binary classifiers respectively trained corresponding to different compression software; The method also includes: training the second classifier according to the color component features.
Citation Information
Patent Citations
Method for testing compression history of BMP image based on loss amount of image information
CN101674389A
Method for detecting tampering with color digital image based on chroma of image
CN102959588A
Tampering detection method and system for compressed image quantization table
CN104661037A