CN113807281A - Image detection model generation method, detection method, terminal and storage medium - Google Patents

Image detection model generation method, detection method, terminal and storage medium Download PDF

Info

Publication number
CN113807281A
CN113807281A CN202111116265.4A CN202111116265A CN113807281A CN 113807281 A CN113807281 A CN 113807281A CN 202111116265 A CN202111116265 A CN 202111116265A CN 113807281 A CN113807281 A CN 113807281A
Authority
CN
China
Prior art keywords
image detection
training
detection module
false
trained
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111116265.4A
Other languages
Chinese (zh)
Other versions
CN113807281B (en
Inventor
殷慧
李庆亮
魏志丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Institute of Information Technology
Original Assignee
Shenzhen Institute of Information Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Institute of Information Technology filed Critical Shenzhen Institute of Information Technology
Priority to CN202111116265.4A priority Critical patent/CN113807281B/en
Publication of CN113807281A publication Critical patent/CN113807281A/en
Application granted granted Critical
Publication of CN113807281B publication Critical patent/CN113807281B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a generation method, a detection method, a terminal and a storage medium of an image detection model, comprising the following steps: acquiring a first training image set; respectively inputting a plurality of first training images in a first training image set into a trained AI false image detection module and a trained AE false image detection module, outputting a first feature vector through the second last layer of the trained AI false image detection module, and outputting a second feature vector through the second last layer of the trained AE false image detection module; and training a preset classification module according to the first feature vector, the second feature vector and the first real classification label to obtain an image detection model. The image detection model generated by the invention not only can identify the false image processed by the AI algorithm, but also can identify the false image processed by the AE algorithm, thereby solving the problem that the existing method for determining whether the image is a forged image by detecting AI fingerprint information is invalid.

Description

Image detection model generation method, detection method, terminal and storage medium
Technical Field
The present invention relates to the field of image detection technologies, and in particular, to a generation method, a detection method, a terminal, and a storage medium for an image detection model.
Background
The application field of an Artificial Intelligence (AI) algorithm is continuously expanded, and false images forged by the AI algorithm are very vivid and are difficult to distinguish by human eyes. In order to identify the AI-forged false image, researchers have proposed a Deep Learning (Deep Learning) algorithm for detecting the AI-forged false image, which determines whether an image is artificially intelligently forged by detecting whether AI fingerprint information is embedded in a face image.
However, the AI fingerprint information in the AI-forged false image can be removed by an Automatic Encoder (AE) algorithm, so that the method for determining whether the image is a forged image by detecting the AI fingerprint information is not feasible.
Thus, there is still a need for improvement and development of the prior art.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a generation method, a detection method, a terminal and a storage medium of an image detection model, aiming at solving the problem that the method for determining whether an image is a counterfeit image by detecting AI fingerprint information is ineffective because AI fingerprint information in an existing AI counterfeit image can be removed by an automatic encoder algorithm.
The technical scheme adopted by the invention for solving the problems is as follows:
in a first aspect, an embodiment of the present invention provides a method for generating an image detection model, where the method includes:
acquiring a first training image set; the first training image set comprises a plurality of first training images and first real classification labels corresponding to the first training images, and the first training images comprise real images, false images processed by an AI algorithm and false images processed by an AE algorithm;
inputting a plurality of first training images in the first training image set into a trained AI false image detection module and a trained AE false image detection module respectively, outputting a first feature vector through the second last layer of the trained AI false image detection module, and outputting a second feature vector through the second last layer of the trained AE false image detection module;
and training a preset classification module according to the first feature vector, the second feature vector and the first real classification label to obtain an image detection model.
The generation method of the image detection model comprises the following steps that the AE false image detection module is an XceptionNet network trained by an ImageNet data set, and the training process of the AE false image detection module specifically comprises the following steps:
acquiring a second training image set; the second training image set comprises a plurality of second training images and second real classification labels corresponding to the plurality of second training images, and the plurality of second training images comprise real images and false images processed by an AE algorithm;
training the last layer of the AE false image detection module according to the second training image set and the second real classification label to obtain a pre-trained AE false image detection module;
and training all layers of the pre-trained AE false image detection module according to the second training image set and the second real classification label to obtain the trained AE false image detection module.
The method for generating the image detection model comprises the following steps of training the last layer of the AE false image detection module according to the second training image set and the second real classification label to obtain a pre-trained AE false image detection module, wherein the steps of:
inputting a plurality of second training images in the second training image set into the AE false image detection module, and outputting first prediction classification labels corresponding to the plurality of second training images through the AE false image detection module;
determining a first loss value corresponding to the AE false image detection module according to the first prediction classification label and the second real classification label;
and when the first loss value is not less than a preset first threshold value, correcting the coefficient of the last layer of the AE false image detection module, and continuously executing the step of outputting the first prediction classification labels corresponding to the plurality of second training images through the AE false image detection module until the first loss value is less than the preset first threshold value, so as to obtain the pre-trained AE false image detection module.
The generation method of the image detection model comprises the following steps of training all layers of the pre-trained AE false image detection module according to the second training image set and the second real classification label to obtain a trained AE false image detection module, wherein the steps of:
inputting a plurality of second training images in the second training image set into the pre-trained AE false image detection module, and outputting second prediction classification labels corresponding to the plurality of second training images through the pre-trained AE false image detection module;
determining a second loss value corresponding to the pre-trained AE false image detection module according to the second prediction classification label and the second real classification label;
and when the second loss value is not less than a preset second threshold value, modifying coefficients of all layers of the pre-trained AE false image detection module, and continuously executing the step of outputting second prediction classification labels corresponding to the plurality of second training images through the pre-trained AE false image detection module until the second loss value is less than the preset second threshold value, so as to obtain the trained AE false image detection module.
The image detection model generation method includes that the AI false image detection module is an XceptionNet model trained by an ImageNet data set, and the training process of the AI false image detection module specifically includes:
acquiring a third training image set; the third training image set comprises a plurality of third training images and third real classification labels corresponding to the third training images, and the third training images comprise real images and false images processed by an AI algorithm;
training the last layer of the AI false image detection module according to the third training image set and the third real classification label to obtain a pre-trained AI false image detection module;
and training all layers of the pre-trained AI false image detection module according to the third training image set and the third real classification label to obtain a trained AI false image detection module.
The method for generating the image detection model, wherein the step of training a preset classification module according to the first feature vector, the second feature vector and the first real classification label to obtain the image detection model comprises:
generating a third feature vector according to the first feature vector and the second feature vector;
and training a preset classification module according to the third feature vector and the first real classification label to obtain an image detection model.
The method for generating the image detection model, wherein the step of training a preset classification module according to the third feature vector and the first real classification label to obtain the image detection model comprises:
inputting the third feature vector into a preset classification module, and outputting third prediction classification labels corresponding to the plurality of first training images through the classification module;
determining a third loss value corresponding to the classification module according to the third prediction classification label and the first real classification label;
and when the third loss value is not less than a preset third threshold, modifying coefficients of all layers of the classification module, and continuing to execute the step of outputting third prediction classification labels corresponding to the plurality of first training images through the classification module until the third loss value is less than the preset third threshold, so as to obtain an image detection model.
In a second aspect, an embodiment of the present invention further provides an image detection method, where an image detection model generated by the image detection model generation method includes:
acquiring an image to be detected;
inputting the image to be detected into the image detection model, and outputting the category information corresponding to the image to be detected through the image detection model; the category information comprises a real image, a false image processed by an AI algorithm and a false image processed by an AE algorithm.
In a third aspect, an embodiment of the present invention provides an intelligent terminal, including a memory, and one or more programs, where the one or more programs are stored in the memory, and configured to be executed by one or more processors, where the one or more programs include steps for executing the method for generating an image detection model according to any one of the above items, or the steps of the image detection method.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where instructions, when executed by a processor of an electronic device, enable the electronic device to perform the steps of the image detection model generation method or the steps of the image detection method as described in any one of the above.
The invention has the beneficial effects that: the embodiment of the invention firstly obtains a first training image set, then respectively inputs a plurality of first training images in the first training image set into a trained AI false image detection module and a trained AE false image detection module, outputs a first feature vector through the second-to-last layer of the trained AI false image detection module, outputs a second feature vector through the second-to-last layer of the trained AE false image detection module, and finally trains a preset classification module according to the first feature vector, the second feature vector and the first real classification label to obtain an image detection model, so that the preset classification module is trained according to the first feature vector output by the trained AI false image detection module, the second feature vector output by the trained AE false image detection module and the first real classification label, the generated image detection model can identify the false image processed by the AI algorithm and can also identify the false image processed by the AE algorithm, and the problem that the conventional method for determining whether the image is a forged image by detecting AI fingerprint information is invalid is solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of a typical structure of a conventional automatic encoder;
FIG. 2 is a schematic flow chart of a method for generating an image detection model according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a prior XceptionNet network;
FIG. 4 is a flowchart illustrating an image detection method according to an embodiment of the present invention;
FIG. 5 is a functional block diagram of an image detection method provided by an embodiment of the present invention;
fig. 6 is a schematic block diagram of an internal structure of an intelligent terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It should be noted that, if directional indications (such as up, down, left, right, front, and back … …) are involved in the embodiment of the present invention, the directional indications are only used to explain the relative positional relationship between the components, the movement situation, and the like in a specific posture (as shown in the drawing), and if the specific posture is changed, the directional indications are changed accordingly.
False images forged by Artificial Intelligence (AI) algorithms such as StyleGAN, StyleGAN2, ProGAN and the like are very vivid and are difficult to distinguish by human eyes, which provides a challenge to information security of the whole society. In order to identify the false image of the AI forgery, researchers have proposed Deep Learning (Deep Learning) algorithms for detecting the false image of the AI forgery, and the design idea of these algorithms is to learn the AI fingerprint information in the false image of the AI forgery by the Deep Learning algorithm, so as to determine whether the image is artificially and intelligently forged by detecting whether the AI fingerprint information is embedded in the image.
An Auto Encoder (AE) is a neural network that uses a back-propagation algorithm to make the magnitude of an output value equal to the magnitude of an input value by first compressing the input into a latent spatial representation and then reconstructing this representation into an output. A typical structure of an Automatic Encoder (AE) is shown in fig. 1, and includes an Encoder (Encoder) including 4 Convolutional Network layers and a Decoder (Decoder) including 4 Convolutional Network layers, in each of which a Convolutional Network (CONV), a ReLU Network (ReLU), and a Pooling Network are included. After an image is input to the auto encoder, the output terminal of the first layer is 112x112x32 matrix, the output terminal of the second layer is 56x56x64 matrix, the output terminal of the third layer is 28x28x128 matrix, the output terminal of the fourth layer is 28x28x8 matrix, the output terminal of the fifth layer is 28x28x128 matrix, the output terminal of the sixth layer is 56x56x64 matrix, the output terminal of the seventh layer is 112x112x32 matrix, and the output terminal of the eighth layer outputs an image having the same size as the original image. The existing AE algorithm can remove the AI fingerprint information in the AI-forged false image, thereby making a method of determining whether the image is a forged image by detecting the AI fingerprint information unfeasible.
In order to solve the problems in the prior art, the present embodiment provides a method for generating an image detection model, which can identify not only a false image processed by an AI algorithm, but also a false image processed by an AE algorithm, thereby solving the problem that the existing method for determining whether an image is a counterfeit image by detecting AI fingerprint information is ineffective. When the method is specifically implemented, a first training image set is obtained firstly; wherein the first training image set comprises a plurality of first training images and first real classification labels corresponding to the plurality of first training images, the plurality of first training images comprise real images, false images processed by AI algorithm and false images processed by AE algorithm, then the plurality of first training images in the first training image set are respectively input into a trained AI false image detection module and a trained AE false image detection module, a first feature vector is output through a second-to-last layer of the trained AI false image detection module, a second feature vector is output through the second-to-last layer of the trained AE false image detection module, and finally a preset classification module is trained according to the first feature vector, the second feature vector and the first real classification labels to obtain an image detection model, therefore, the preset classification module is trained according to the first feature vector output by the trained AI false image detection module, the second feature vector output by the trained AE false image detection module and the first real classification label, so that the generated image detection model can identify false images processed by an AI algorithm and can also identify false images processed by an AE algorithm, and the problem that the conventional method for determining whether the images are forged images by detecting AI fingerprint information is invalid is solved.
Exemplary method
The embodiment provides a method for generating an image detection model, which can be applied to an intelligent terminal. As shown in fig. 2 in particular, it comprises:
s100, acquiring a first training image set; the first training image set comprises a plurality of first training images and first real classification labels corresponding to the first training images, and the first training images comprise real images, false images processed by an AI algorithm and false images processed by an AE algorithm.
Specifically, the first training image set is a set of a plurality of first training images acquired by using an existing device with a photographing function, the plurality of first training images include real images, false images processed by an AI algorithm, and false images processed by an AE algorithm, and the first real classification label is real category information corresponding to each first training image, for example, when a certain first training image is a real image, the first real classification label corresponding to the first training image is a real image; a certain first training image is a false image processed by an AE algorithm, and a first real classification label corresponding to the first training image is the false image processed by the AE algorithm. In the embodiment, when the false image detection model is generated, a training image set is firstly obtained, so that the image detection model is generated through the training image set in the subsequent step, and the generated image detection model can identify not only the false image processed by an AI algorithm, but also the false image processed by an AE algorithm.
Step S200, inputting a plurality of first training images in the first training image set into a trained AI false image detection module and a trained AE false image detection module respectively, outputting a first feature vector through the second last layer of the trained AI false image detection module, and outputting a second feature vector through the second last layer of the trained AE false image detection module.
The first characteristic vector is used for distinguishing a real image from a false image processed by an AI algorithm, and the trained AI false image detection module can effectively extract the first characteristic vector; the second feature vector is used for distinguishing a real image from a false image processed by an AE algorithm, and the trained AE false image detection module can effectively extract the second feature vector. In order to generate the image detection model, in this embodiment, the AI false image detection module and the AE false image detection module are trained in advance to obtain the trained AI false image detection module and the trained AE false image detection module, and then the classification module is trained by using the trained AI false image detection module and the trained AE false image detection module. The classification module can be a deep learning network with a very small volume, such as AlexNet or VGG, or a machine learning algorithm, such as an SVM algorithm or an AdaBoost algorithm.
When the classification module is trained, specifically, a plurality of first training images in an acquired first training image set are respectively input into a trained AI false image detection module and a trained AE false image detection module, a first feature vector is output through the second last layer of the trained AI false image detection module, and a second feature vector is output through the second last layer of the trained AE false image detection module, so that the classification module is trained in the subsequent step according to the first feature vector and the second feature vector.
In a specific embodiment, the AE false image detection module is an XceptionNet network trained by ImageNet dataset, and the training process of the AE false image detection module includes:
s210, acquiring a second training image set; the second training image set comprises a plurality of second training images and second real classification labels corresponding to the plurality of second training images, and the plurality of second training images comprise real images and false images processed by an AE algorithm;
step S220, training the last layer of the AE false image detection module according to the second training image set and the second real classification label to obtain a pre-trained AE false image detection module;
and step S230, training all layers of the pre-trained AE false image detection module according to the second training image set and the second real classification label to obtain a trained AE false image detection module.
Specifically, the XceptionNet network is an existing network, and has a structure as shown in fig. 3, the XceptionNet network includes an input layer, an intermediate layer, and an output layer, all the Convolution layers (convergence layers) and separable Convolution layers (separable convergence layers) in the network are followed by batch normalization (batch normalization) processing, and all the separable Convolution layers have no depth extension. In order to accelerate the training process of the AE false image detection module, the AE false image detection module in this embodiment adopts an XceptionNet network trained by an ImageNet data set, and trains the AE false image detection module by a transfer learning method, so that the training time is short, the speed is high, and the AE false image detection module can be applied to mobile equipment, such as mobile phones and other equipment with limited storage space.
When the AE false image detection module is trained, firstly, the coefficient from the first layer to the second last layer of the AE false image detection module is kept unchanged, the last layer of the AE false image detection module is trained according to the second training image set and the second real classification label to obtain a pre-trained AE false image detection module, and then all layers of the pre-trained AE false image detection module are trained according to the second training image set and the second real classification label to obtain the trained AE false image detection module.
In an embodiment, step S220 specifically includes:
step S221, inputting a plurality of second training images in the second training image set into the AE false image detection module, and outputting first prediction classification labels corresponding to the plurality of second training images through the AE false image detection module;
step S222, determining a first loss value corresponding to the AE false image detection module according to the first prediction classification label and the second real classification label;
and step S223, when the first loss value is not less than a preset first threshold value, correcting the coefficient of the last layer of the AE false image detection module, and continuing to execute the step of outputting the first prediction classification labels corresponding to the plurality of second training images through the AE false image detection module until the first loss value is less than the preset first threshold value, so as to obtain the pre-trained AE false image detection module.
In order to measure the training condition of the last layer of the AE false image detection module, in this embodiment, a first threshold is preset, when a second training image set and a second real classification label are used to train the last layer of the AE false image detection module, first, a plurality of second training images in the second training image set are input into the AE false image detection module, and the AE false image detection module is a classification module used for distinguishing real images from false images processed by an AE algorithm and outputting first prediction classification labels corresponding to the plurality of second training images. And then determining a first loss value corresponding to the AE false image detection module according to the first prediction classification label and the second real classification label. Generally, the smaller the first loss value is, the better the performance of the AE false image detection module is, and after the first loss value is obtained, whether the first loss value is smaller than a preset first threshold value is judged; if so, indicating that the training condition of the last layer of the AE false image detection module meets a preset condition; if not, the training condition of the last layer of the AE false image detection module is not met with the preset condition, the coefficient of the last layer of the AE false image detection module is corrected according to a preset parameter learning rate, and the step of outputting the first prediction classification labels corresponding to the plurality of second training images through the AE false image detection module is continuously executed until the first loss value is smaller than a preset first threshold value.
In a specific embodiment, step S230 specifically includes:
step S231, inputting a plurality of second training images in the second training image set into the pre-trained AE false image detection module, and outputting second prediction classification labels corresponding to the plurality of second training images through the pre-trained AE false image detection module;
step S232, determining a second loss value corresponding to the pre-trained AE false image detection module according to the second prediction classification label and the second real classification label;
and step S233, when the second loss value is not less than a preset second threshold, modifying coefficients of all layers of the pre-trained AE false image detection module, and continuing to execute the step of outputting second prediction classification labels corresponding to the plurality of second training images through the pre-trained AE false image detection module until the second loss value is less than the preset second threshold, so as to obtain the trained AE false image detection module.
In order to further improve the performance of the AE false image detection module, after the pre-trained AE false image detection module is obtained, all layers of the pre-trained AE false image detection module are further trained according to the second training image set and the second real classification label. In order to measure the training conditions of all layers of the pre-trained AE false image detection module, in this embodiment, a second threshold is preset, when a second training image set and a second real classification label are used to train all layers of the pre-trained AE false image detection module, first, a plurality of second training images in the second training image set are input into the pre-trained AE false image detection module, and second prediction classification labels corresponding to the plurality of second training images are output through the pre-trained AE false image detection module. And then determining a second loss value corresponding to the pre-trained AE false image detection module according to the second prediction classification label and the second real classification label. Generally, the smaller the second loss value is, the better the performance of the AE false image detection module is, and after the second loss value is obtained, whether the second loss value is smaller than a preset second threshold value is judged; if yes, indicating that the training conditions of all layers of the pre-trained AE false image detection module meet the preset condition; if not, the training conditions of all layers of the pre-trained AE false image detection module are not met with preset conditions, the coefficients of all layers of the pre-trained AE false image detection module are corrected according to a preset parameter learning rate, and the step of outputting second prediction classification labels corresponding to the plurality of second training images through the pre-trained AE false image detection module is continuously executed until the second loss value is smaller than a preset second threshold value.
In a specific embodiment, the AI false image detection module is an XceptionNet model trained by ImageNet dataset, and the training process of the AI false image detection module includes:
step M210, acquiring a third training image set; the third training image set comprises a plurality of third training images and third real classification labels corresponding to the third training images, and the third training images comprise real images and false images processed by an AI algorithm;
step M220, training the last layer of the AI false image detection module according to the third training image set and the third real classification label to obtain a pre-trained AI false image detection module;
step M230, training all layers of the pre-trained AI false image detection module according to the third training image set and the third real classification label to obtain a trained AI false image detection module.
Specifically, similar to the AE false image detection module, the AI false image detection module is also an XceptionNet model trained with the ImageNet dataset. The AI false image detection module and the AE false image detection module are trained in the same process, first acquiring a third training image set, wherein the third training image set comprises a plurality of third training images and third real classification labels corresponding to the plurality of third training images, the number of third training images includes real images and false images processed by an AI algorithm, and finally, training all layers of the pre-trained AI false image detection module according to the second training image set and the third real classification label to obtain the trained AI false image detection module.
Step S300, training a preset classification module according to the first feature vector, the second feature vector and the first real classification label to obtain an image detection model.
After the first feature vector and the second feature vector are obtained, a preset classification module is trained according to the first feature vector, the second feature vector and the first real classification label until the training condition of the classification module meets a preset condition, so that a false image detection model is obtained.
In one embodiment, step S300 specifically includes:
step S310, generating a third feature vector according to the first feature vector and the second feature vector;
step S320, training a preset classification module according to the third feature vector and the first real classification label to obtain an image detection model.
The third feature vector is a feature vector formed by connecting the first feature vector and the second feature vector in series, and the size of the third feature vector is the sum of the sizes of the first feature vector and the second feature vector, for example, if the first feature vector and the second feature vector are both 2048-dimensional feature vectors, the third feature vector is 4096-dimensional feature vector. When the model parameters of the classification module are corrected according to the first feature vector and the second feature vector, the first feature vector and the second feature vector are connected in series to generate a third feature vector, and then the classification module is trained according to the third feature vector and the first real classification label until the training condition of the classification module meets a preset condition, so that an image detection model is obtained.
Generating a third feature vector according to different types of preset classification modules, and then preprocessing the third feature vector, for example, when the classification module is AlexNet or VGG, converting the third feature vector into a matrix form through a reshape function, and then training the classification module according to the third feature vector and the first real classification label; when the classification module is an SVM or AdaBoost, the third feature vector can be directly applied to the training of the classification module without being preprocessed.
In an embodiment, step S320 specifically includes:
step S321, inputting the third feature vector into a preset classification module, and outputting third prediction classification labels corresponding to the plurality of first training images through the classification module;
step S322, determining a third loss value corresponding to the classification module according to the third prediction classification label and the first real classification label;
step S323, when the third loss value is not less than a preset third threshold, modifying coefficients of all layers of the classification module, and continuing to perform the step of outputting, by the classification module, third predicted classification labels corresponding to the plurality of first training images until the third loss value is less than the preset third threshold, so as to obtain an image detection model.
Specifically, in order to measure the training condition of the classification module, a third threshold is preset in this embodiment, after a third feature vector is obtained, the third feature vector is input into a preset classification module, third predictive classification labels corresponding to the plurality of first training images are output through the classification module, and then a third loss value corresponding to the classification module is determined according to the third predictive classification labels and the first real classification labels. Generally, the smaller the third loss value is, the better the performance of the classification module is, and after the third loss value is obtained, whether the third loss value is smaller than a preset third threshold value is further judged; if so, indicating that the training condition of the classification module meets the preset condition; if not, the training condition of the classification module is indicated to not meet the preset condition, the model parameters of the classification module are updated according to the preset parameter learning rate, and the step of outputting third prediction classification labels corresponding to the plurality of first training images through the classification module is continuously executed until the third loss value is smaller than a preset third threshold value.
The present invention also provides an image detection method, which is applied to the image detection model generated by the image detection model generation method described above, as shown in fig. 4, and includes:
r100, acquiring an image to be detected;
r200, inputting the image to be detected into the image detection model, and outputting the category information corresponding to the image to be detected through the image detection model; the category information comprises a real image, a false image processed by an AI algorithm and a false image processed by an AE algorithm.
Specifically, as shown in fig. 5, when it is required to determine whether an image is a false image, the image is input into an image detection model as an image to be detected, the image to be detected passes through an AI false image detection module and an AE false image detection module of the image detection model respectively to obtain a fourth feature vector and a fifth feature vector corresponding to the image to be detected, the fourth feature vector and the fifth feature vector are connected in series to generate a sixth feature vector, the sixth feature vector passes through a classification module of the image detection model and outputs category information corresponding to the image to be detected, wherein the category information includes a real image, a false image processed by an AI algorithm, and a false image processed by an AE algorithm, and whether the image to be detected is a false image can be determined according to the category information corresponding to the image to be detected.
Exemplary device
Based on the above embodiment, the present invention further provides an intelligent terminal, and a schematic block diagram thereof may be as shown in fig. 6. The intelligent terminal comprises a processor, a memory, a network interface, a display screen and a temperature sensor which are connected through a system bus. Wherein, the processor of the intelligent terminal is used for providing calculation and control capability. The memory of the intelligent terminal comprises a nonvolatile 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 an operating system and computer programs in the non-volatile storage medium. The network interface of the intelligent terminal is used for being connected and communicated with an external terminal through a network. The computer program is executed by a processor to implement a method of generating an image detection model and a method of image detection. The display screen of the intelligent terminal can be a liquid crystal display screen or an electronic ink display screen, and the temperature sensor of the intelligent terminal is arranged inside the intelligent terminal in advance and used for detecting the operating temperature of internal equipment.
It will be understood by those skilled in the art that the block diagram shown in fig. 6 is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation to the intelligent terminal to which the solution of the present invention is applied, and a specific intelligent terminal may include more or less components than those shown in the figure, or combine some components, or have a different arrangement of components.
In one embodiment, an intelligent terminal is provided that includes a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for:
acquiring a first training image set; the first training image set comprises a plurality of first training images and first real classification labels corresponding to the first training images, and the first training images comprise real images, false images processed by an AI algorithm and false images processed by an AE algorithm;
inputting a plurality of first training images in the first training image set into a trained AI false image detection module and a trained AE false image detection module respectively, outputting a first feature vector through the second last layer of the trained AI false image detection module, and outputting a second feature vector through the second last layer of the trained AE false image detection module;
and training a preset classification module according to the first feature vector, the second feature vector and the first real classification label to obtain an image detection model.
In one embodiment, the processor executing the one or more programs further includes instructions for:
acquiring an image to be detected;
inputting the image to be detected into the image detection model, and outputting the category information corresponding to the image to be detected through the image detection model; the category information comprises a real image, a false image processed by an AI algorithm and a false image processed by an AE algorithm.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, databases, or other media used in embodiments provided herein may 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. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
In summary, the present invention discloses a method for generating an image detection model, a method for detecting an image detection model, a terminal and a storage medium, including: acquiring a first training image set; the first training image set comprises a plurality of first training images and first real classification labels corresponding to the first training images, and the first training images comprise real images, false images processed by an AI algorithm and false images processed by an AE algorithm; inputting a plurality of first training images in the first training image set into a trained AI false image detection module and a trained AE false image detection module respectively, outputting a first feature vector through the second last layer of the trained AI false image detection module, and outputting a second feature vector through the second last layer of the trained AE false image detection module; and training a preset classification module according to the first feature vector, the second feature vector and the first real classification label to obtain an image detection model. The method and the device train the preset classification module according to the first characteristic vector output by the trained AI false image detection module, the second characteristic vector output by the trained AE false image detection module and the first real classification label, so that the generated image detection model can identify false images processed by an AI algorithm and can also identify false images processed by an AE algorithm, and the problem that the conventional method for determining whether the images are forged images by detecting AI fingerprint information is invalid is solved.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

Claims (10)

1. A method for generating an image detection model, comprising:
acquiring a first training image set; the first training image set comprises a plurality of first training images and first real classification labels corresponding to the first training images, and the first training images comprise real images, false images processed by an AI algorithm and false images processed by an AE algorithm;
inputting a plurality of first training images in the first training image set into a trained AI false image detection module and a trained AE false image detection module respectively, outputting a first feature vector through the second last layer of the trained AI false image detection module, and outputting a second feature vector through the second last layer of the trained AE false image detection module;
and training a preset classification module according to the first feature vector, the second feature vector and the first real classification label to obtain an image detection model.
2. The method for generating an image detection model according to claim 1, wherein the AE false image detection module is an XceptionNet network trained by an ImageNet dataset, and the training process of the AE false image detection module specifically includes:
acquiring a second training image set; the second training image set comprises a plurality of second training images and second real classification labels corresponding to the plurality of second training images, and the plurality of second training images comprise real images and false images processed by an AE algorithm;
training the last layer of the AE false image detection module according to the second training image set and the second real classification label to obtain a pre-trained AE false image detection module;
and training all layers of the pre-trained AE false image detection module according to the second training image set and the second real classification label to obtain the trained AE false image detection module.
3. The method for generating an image detection model according to claim 2, wherein the step of training the last layer of the AE false image detection module according to the second training image set and the second real classification label to obtain a pre-trained AE false image detection module comprises:
inputting a plurality of second training images in the second training image set into the AE false image detection module, and outputting first prediction classification labels corresponding to the plurality of second training images through the AE false image detection module;
determining a first loss value corresponding to the AE false image detection module according to the first prediction classification label and the second real classification label;
and when the first loss value is not less than a preset first threshold value, correcting the coefficient of the last layer of the AE false image detection module, and continuously executing the step of outputting the first prediction classification labels corresponding to the plurality of second training images through the AE false image detection module until the first loss value is less than the preset first threshold value, so as to obtain the pre-trained AE false image detection module.
4. The method for generating an image detection model according to claim 2, wherein the step of training all layers of the pre-trained AE false image detection module according to the second training image set and the second real classification label to obtain a trained AE false image detection module comprises:
inputting a plurality of second training images in the second training image set into the pre-trained AE false image detection module, and outputting second prediction classification labels corresponding to the plurality of second training images through the pre-trained AE false image detection module;
determining a second loss value corresponding to the pre-trained AE false image detection module according to the second prediction classification label and the second real classification label;
and when the second loss value is not less than a preset second threshold value, modifying coefficients of all layers of the pre-trained AE false image detection module, and continuously executing the step of outputting second prediction classification labels corresponding to the plurality of second training images through the pre-trained AE false image detection module until the second loss value is less than the preset second threshold value, so as to obtain the trained AE false image detection module.
5. The method for generating an image detection model according to claim 1, wherein the AI false image detection module is an XceptionNet model trained by an ImageNet dataset, and the training process of the AI false image detection module specifically includes:
acquiring a third training image set; the third training image set comprises a plurality of third training images and third real classification labels corresponding to the third training images, and the third training images comprise real images and false images processed by an AI algorithm;
training the last layer of the AI false image detection module according to the third training image set and the third real classification label to obtain a pre-trained AI false image detection module;
and training all layers of the pre-trained AI false image detection module according to the third training image set and the third real classification label to obtain a trained AI false image detection module.
6. The method of claim 1, wherein the step of training a preset classification module according to the first feature vector, the second feature vector and the first real classification label to obtain an image detection model comprises:
generating a third feature vector according to the first feature vector and the second feature vector;
and training a preset classification module according to the third feature vector and the first real classification label to obtain an image detection model.
7. The method of claim 6, wherein the step of training a preset classification module according to the third feature vector and the first real classification label to obtain an image detection model comprises:
inputting the third feature vector into a preset classification module, and outputting third prediction classification labels corresponding to the plurality of first training images through the classification module;
determining a third loss value corresponding to the classification module according to the third prediction classification label and the first real classification label;
and when the third loss value is not less than a preset third threshold, modifying coefficients of all layers of the classification module, and continuing to execute the step of outputting third prediction classification labels corresponding to the plurality of first training images through the classification module until the third loss value is less than the preset third threshold, so as to obtain an image detection model.
8. An image detection method applied to an image detection model generated by the image detection model generation method according to any one of claims 1 to 7, comprising:
acquiring an image to be detected;
inputting the image to be detected into the image detection model, and outputting the category information corresponding to the image to be detected through the image detection model; the category information comprises a real image, a false image processed by an AI algorithm and a false image processed by an AE algorithm.
9. An intelligent terminal comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory, and configured to be executed by the one or more processors comprises steps for performing the method for generating an image detection model according to any one of claims 1 to 7, or the method for detecting an image according to claim 8.
10. A computer readable storage medium, wherein instructions, when executed by a processor of an electronic device, enable the electronic device to perform the steps of the method for generating an image detection model according to any one of claims 1 to 7, or the steps of the method for image detection according to claim 8.
CN202111116265.4A 2021-09-23 2021-09-23 Image detection model generation method, detection method, terminal and storage medium Active CN113807281B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111116265.4A CN113807281B (en) 2021-09-23 2021-09-23 Image detection model generation method, detection method, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111116265.4A CN113807281B (en) 2021-09-23 2021-09-23 Image detection model generation method, detection method, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN113807281A true CN113807281A (en) 2021-12-17
CN113807281B CN113807281B (en) 2024-03-29

Family

ID=78896426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111116265.4A Active CN113807281B (en) 2021-09-23 2021-09-23 Image detection model generation method, detection method, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN113807281B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739555A (en) * 2009-12-01 2010-06-16 北京中星微电子有限公司 Method and system for detecting false face, and method and system for training false face model
US20190236614A1 (en) * 2018-01-29 2019-08-01 Accenture Global Solutions Limited Artificial intelligence counterfeit detection
CN110349136A (en) * 2019-06-28 2019-10-18 厦门大学 A kind of tampered image detection method based on deep learning
US20200167772A1 (en) * 2018-11-24 2020-05-28 Walmart Apollo, Llc System and method for detecting signature forgeries
CN111639718A (en) * 2020-06-05 2020-09-08 中国银行股份有限公司 Classifier application method and device
CN111709408A (en) * 2020-08-18 2020-09-25 腾讯科技(深圳)有限公司 Image authenticity detection method and device
WO2020228515A1 (en) * 2019-05-10 2020-11-19 北京京东尚科信息技术有限公司 Fake face recognition method, apparatus and computer-readable storage medium
CN112116592A (en) * 2020-11-19 2020-12-22 北京瑞莱智慧科技有限公司 Image detection method, training method, device and medium of image detection model
CN112289299A (en) * 2020-10-21 2021-01-29 北京大米科技有限公司 Training method and device of speech synthesis model, storage medium and electronic equipment
US10990852B1 (en) * 2019-10-23 2021-04-27 Samsung Sds Co., Ltd Method and apparatus for training model for object classification and detection
WO2021138855A1 (en) * 2020-01-08 2021-07-15 深圳市欢太科技有限公司 Model training method, video processing method and apparatus, storage medium and electronic device
CN113269149A (en) * 2021-06-24 2021-08-17 中国平安人寿保险股份有限公司 Living body face image detection method and device, computer equipment and storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739555A (en) * 2009-12-01 2010-06-16 北京中星微电子有限公司 Method and system for detecting false face, and method and system for training false face model
US20190236614A1 (en) * 2018-01-29 2019-08-01 Accenture Global Solutions Limited Artificial intelligence counterfeit detection
US20200167772A1 (en) * 2018-11-24 2020-05-28 Walmart Apollo, Llc System and method for detecting signature forgeries
WO2020228515A1 (en) * 2019-05-10 2020-11-19 北京京东尚科信息技术有限公司 Fake face recognition method, apparatus and computer-readable storage medium
CN110349136A (en) * 2019-06-28 2019-10-18 厦门大学 A kind of tampered image detection method based on deep learning
US10990852B1 (en) * 2019-10-23 2021-04-27 Samsung Sds Co., Ltd Method and apparatus for training model for object classification and detection
WO2021138855A1 (en) * 2020-01-08 2021-07-15 深圳市欢太科技有限公司 Model training method, video processing method and apparatus, storage medium and electronic device
CN111639718A (en) * 2020-06-05 2020-09-08 中国银行股份有限公司 Classifier application method and device
CN111709408A (en) * 2020-08-18 2020-09-25 腾讯科技(深圳)有限公司 Image authenticity detection method and device
CN112289299A (en) * 2020-10-21 2021-01-29 北京大米科技有限公司 Training method and device of speech synthesis model, storage medium and electronic equipment
CN112116592A (en) * 2020-11-19 2020-12-22 北京瑞莱智慧科技有限公司 Image detection method, training method, device and medium of image detection model
CN113269149A (en) * 2021-06-24 2021-08-17 中国平安人寿保险股份有限公司 Living body face image detection method and device, computer equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ANDREAS ROSSLER: "FaceForensics++: Learning to Detect Manipulated Facial Images", 《ARXIV》, pages 1 - 14 *
曹玉红: "智能人脸伪造与检测综述", 《工程研究-跨学科视野中的工程》, pages 538 - 555 *
李旭嵘: "一种基于双流网络的Deepfakes检测技术", 《信息安全学报》, pages 84 - 91 *

Also Published As

Publication number Publication date
CN113807281B (en) 2024-03-29

Similar Documents

Publication Publication Date Title
CN110136103B (en) Medical image interpretation method, device, computer equipment and storage medium
US11854248B2 (en) Image classification method, apparatus and training method, apparatus thereof, device and medium
CN110909595A (en) Facial motion recognition model training method and facial motion recognition method
CN110309692B (en) Face recognition method, device and system, and model training method and device
CN112446379B (en) Self-adaptive intelligent processing method for dynamic large scene
CN114332994A (en) Method for training age prediction model, age detection method and related device
CN113486175B (en) Text classification method, text classification device, computer device, and storage medium
CN113837942A (en) Super-resolution image generation method, device, equipment and storage medium based on SRGAN
CN113421276A (en) Image processing method, device and storage medium
CN111860582B (en) Image classification model construction method and device, computer equipment and storage medium
CN112749737A (en) Image classification method and device, electronic equipment and storage medium
CN111985340A (en) Face recognition method and device based on neural network model and computer equipment
CN112016592B (en) Domain adaptive semantic segmentation method and device based on cross domain category perception
CN112949500A (en) Improved YOLOv3 lane line detection method based on spatial feature coding
CN117475150A (en) Efficient semantic segmentation method based on SAC-UNet
CN113807281A (en) Image detection model generation method, detection method, terminal and storage medium
CN116994049A (en) Full-automatic flat knitting machine and method thereof
CN116834244A (en) Image monitoring alarm system and method for injection mold
CN110826563A (en) Finger vein segmentation method and device based on neural network and probability map model
CN116091596A (en) Multi-person 2D human body posture estimation method and device from bottom to top
CN112699809B (en) Vaccinia category identification method, device, computer equipment and storage medium
CN114511023A (en) Classification model training method and classification method
CN113128380A (en) Recognition method and device for fish posture, electronic equipment and storage medium
CN115565051B (en) Lightweight face attribute recognition model training method, recognition method and device
CN114266923A (en) Multi-label classification model construction method for waste bottles and waste bottle classification method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant