CN114359144A - Image detection method and method for obtaining image detection model - Google Patents

Image detection method and method for obtaining image detection model Download PDF

Info

Publication number
CN114359144A
CN114359144A CN202111456215.0A CN202111456215A CN114359144A CN 114359144 A CN114359144 A CN 114359144A CN 202111456215 A CN202111456215 A CN 202111456215A CN 114359144 A CN114359144 A CN 114359144A
Authority
CN
China
Prior art keywords
image
transmission environment
image detection
noise
detection model
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.)
Pending
Application number
CN202111456215.0A
Other languages
Chinese (zh)
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.)
Alibaba China Co Ltd
Original Assignee
Alibaba China Co Ltd
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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202111456215.0A priority Critical patent/CN114359144A/en
Publication of CN114359144A publication Critical patent/CN114359144A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The application discloses an image detection method, which is characterized by comprising the following steps: obtaining an image to be detected; inputting the image to be detected into an image detection model, and outputting detection results of a real area and a forged area in the image to be detected; the image detection model is obtained by training a training sample added with transmission environment noise. By adopting the method, the problem of counterfeit detection of the counterfeit image transmitted in the transmission environment is solved.

Description

Image detection method and method for obtaining image detection model
Technical Field
The application relates to the technical field of computers, in particular to an image detection method and an image detection device, and also relates to an image detection model obtaining method and an image detection model obtaining device, and also relates to two electronic devices and two storage devices.
Background
The increasing popularity of image editing tools (Photoshop, american drawings, etc.) makes it easier to modify images at a digital level. However, modified images (i.e., counterfeit images) continue to pose threats to many areas, such as removing original watermarks, producing counterfeit news, acting as fictitious objects, and the like. Meanwhile, the explosion of online social networks on the internet makes them a major channel for information dissemination. Naturally, the popularity of online social networks also facilitates the dissemination of counterfeit images, making it easier to report fake news or release rumors on the internet.
Therefore, the detection and localization of counterfeit images become extremely important, and can be widely applied to filtering false news, avoiding malicious insurance claims, verifying the authenticity of documents, and the like. Currently, researchers have proposed many detection parties to discriminate a tampered image to ensure information security. Some of these are intended to detect certain forms of tampering such as splicing, copy-and-paste, and repair, others are used to identify more complex or fused varieties of counterfeiting.
However, image forgery detection on online social networks is rarely studied for two reasons. First, almost all online social networks process uploaded images in a lossy manner, which may completely erase the forged traces left by the original tampering operation, thereby invalidating existing forensic algorithms. Second, the lossy operations employed by online social networks are often uncertain and not within the control of the user, making it difficult for forensic algorithms to accurately simulate.
Therefore, it is an urgent problem to detect forgery of a forged image transmitted through a transmission environment.
Disclosure of Invention
The application provides an image detection method and an image detection device, which are used for solving the problem of carrying out counterfeiting detection on a counterfeit image transmitted through a transmission environment.
The application provides an image detection method, which comprises the following steps:
obtaining an image to be detected;
inputting the image to be detected into an image detection model, and outputting detection results of a real area and a forged area in the image to be detected; the image detection model is obtained by training a training sample added with transmission environment noise.
As an embodiment, comprising:
the training samples of the image detection model are added with counternoise.
The application also provides an obtaining method of the image detection model, which comprises the following steps:
adding a forged image into an original image to obtain an initial sample;
adding transmission environment noise of a preset transmission environment into the initial sample to obtain a processed sample added with the transmission environment noise;
and taking the processed sample as a training sample, providing the training sample for an image detection model to be trained, and training the image detection model to identify a real area and a forged area.
As an embodiment, after the transmission environment noise of the preset transmission environment is added to the initial sample, the counternoise is further added, and a processed sample added with the transmission environment noise and the counternoise is obtained.
As an embodiment, adding transmission environment noise of a preset transmission environment to the initial sample to obtain a processed sample added with the transmission environment noise, includes:
providing the image serving as the initial sample to a preset transmission environment, and after the image is transmitted in the preset transmission environment, taking the transmitted image as the processed sample added with the transmission environment noise; alternatively, the first and second electrodes may be,
and constructing a transmission environment simulation model simulating a preset transmission environment, adding simulated transmission environment noise tau into the image serving as the initial sample, and taking the processed image as the processed sample added with the transmission environment noise.
As an embodiment, the method for obtaining the transmission environment simulation model includes the following steps:
providing the original image to a preset transmission environment, and obtaining an actually transmitted image transmitted through the preset transmission environment;
the original image provided for the preset transmission environment is used as a sample, provided for a transmission environment simulation model to be trained, and a transmission environment prediction image is generated according to the output of the transmission environment simulation model to be trained;
comparing the actually transmitted image with the transmission environment predicted image to generate an adjustment measurement index;
and adjusting the transmission environment simulation model to be trained according to the adjustment measurement index until a preset adjustment target is reached.
As one embodiment, the adjustment metric includes a loss function.
As an implementation mode, the transmission environment simulation model to be trained adopts a neural network model, and a differentiable JPEG compression convolutional layer is embedded in the neural network model
Figure BDA0003386733190000021
As an embodiment, the counternoise is obtained by:
giving an input image x, obtaining a prediction result of a transmission environment simulation model on the image, and processing to obtain initial prediction noise tauo
According to the given input image x, the labeled forged region value y and the forged region value initially output by the image detection model to be trained
Figure BDA0003386733190000031
Preliminary prediction of noise τoAnd constructing the counternoise xi.
As an embodiment, for the tth given input image x, the direction of the countering noise ξ is set as the average gradient of the first t-1 image samples.
The present application also provides an image detection apparatus, including:
the image acquisition unit to be detected is used for acquiring an image to be detected;
the image detection unit is used for inputting the image to be detected into an image detection model and outputting detection results of a real area and a forged area in the image to be detected; the image detection model is obtained by training a training sample added with transmission environment noise.
The present application further provides an electronic device, comprising:
a processor; and
a memory for storing a program of an image detection method, the apparatus performing the following steps after being powered on and running the program of the image detection method by the processor:
obtaining an image to be detected;
inputting the image to be detected into an image detection model, and outputting detection results of a real area and a forged area in the image to be detected; the image detection model is obtained by training a training sample added with transmission environment noise.
The present application also provides a storage device storing a program of an image detection method, the program being executed by a processor to perform the steps of:
obtaining an image to be detected;
inputting the image to be detected into an image detection model, and outputting detection results of a real area and a forged area in the image to be detected; the image detection model is obtained by training a training sample added with transmission environment noise.
The present application further provides an obtaining apparatus of an image detection model, including:
an initial sample obtaining unit, configured to add a counterfeit image to an original image to obtain an initial sample;
a processed sample obtaining unit, configured to add transmission environment noise of a preset transmission environment to the initial sample, and obtain a processed sample to which the transmission environment noise is added;
and the image detection model training unit is used for providing the processed sample as a training sample for the image detection model to be trained and carrying out training for identifying a real area and a forged area.
The present application further provides an electronic device, the electronic device including:
a processor; and
a memory for storing a program of an obtaining method of an image detection model, the apparatus performing the following steps after being powered on and running the program of the obtaining method of the image detection model by the processor:
adding a forged image into an original image to obtain an initial sample;
adding transmission environment noise of a preset transmission environment into the initial sample to obtain a processed sample added with the transmission environment noise;
and taking the processed sample as a training sample, providing the training sample for an image detection model to be trained, and training the image detection model to identify a real area and a forged area.
The present application also provides a storage device storing a program of an image detection model obtaining method, the program being executed by a processor and performing the steps of:
adding a forged image into an original image to obtain an initial sample;
adding transmission environment noise of a preset transmission environment into the initial sample to obtain a processed sample added with the transmission environment noise;
and taking the processed sample as a training sample, providing the training sample for an image detection model to be trained, and training the image detection model to identify a real area and a forged area.
Compared with the prior art, the method has the following advantages:
the application provides an image detection method, which comprises the following steps: obtaining an image to be detected; inputting the image to be detected into an image detection model, and outputting the detection results of a real area and a forged area in the image to be detected; the image detection model is obtained by training a training sample added with transmission environment noise. According to the image detection method, the transmission environment noise is added into the training sample during training of the image detection model, so that the image detection model can well detect the real area and the forged area in the image to be detected after transmission in the transmission environment, and the accuracy of forged image detection is improved.
In the preferable scheme, the training sample of the image detection model is added with the counternoise, and the image detection model has stronger anti-noise capability due to the introduction of the counternoise during training, so that the accuracy of fake image detection is further improved.
Drawings
Fig. 1A is a schematic diagram of an embodiment of a scenario provided in the present application.
Fig. 1 is a flowchart of an image detection method according to a first embodiment of the present application.
Fig. 2 is a schematic diagram of an image detection method according to an embodiment of the present application.
Fig. 3 is a flowchart of an obtaining method of an image detection model according to a second embodiment of the present application.
Fig. 4 is a flowchart for obtaining a transmission environment simulation model according to a second embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein, but rather construed as limited to the embodiments set forth herein.
In order to make the technical solutions of the present application better understood, the detailed description of the embodiments of the present application will be given first.
The image detection method provided by the first embodiment of the application can be applied to a scene where a client interacts with a server, as shown in fig. 1A, when a forged region of an image to be detected transmitted through a transmission environment needs to be identified, generally, the client establishes a connection with the server first, after the connection, the client sends the image to be detected to the server, after the server receives the image to be detected, the server inputs the image to be detected into an image detection model, and outputs detection results of a real region and the forged region in the image to be detected; the image detection model is obtained by training a training sample added with transmission environment noise, then the detection results of the real area and the forged area in the image to be detected are provided for the client, and the client receives the detection results of the real area and the forged area in the image to be detected.
The first embodiment of the present application provides an image detection method. The following description will be made with reference to fig. 1 and 2.
And step S101, obtaining an image to be detected.
The image to be detected refers to an image added with transmission environment noise. Wherein the transmission environment may include application software of an online social network, and the like. When a user uploads or downloads an image through application software of an online social network, transmission environment noise is introduced in the transmission process of the image by the application software of the online social network. The image to be detected may be an image which is processed manually before being transmitted, for example, an original image, the image containing the forged region is obtained after being edited by an image editing tool Photoshop, and the image containing the forged region is transmitted by application software of an online social network to generate the image to be detected.
Step S102, inputting the image to be detected into an image detection model, and outputting the detection results of a real area and a forged area in the image to be detected; the image detection model is obtained by training a training sample added with transmission environment noise.
The real area refers to an area which is not processed in the image to be detected.
The forged area refers to an area which is processed in the image to be detected. For example, if the original image is a piece of grass, and a car image is inserted into the image through the Photoshop image editing tool, the inserted car image is a forged area.
When the image detection model is trained, and transmission environment noise under a specific transmission environment is added, the trained image detection model can only detect the image to be detected after being transmitted through the specific transmission environment, in order to enable the image detection model to have generalization, the image transmitted through other transmission environments can be detected, and anti-noise can be added into a training sample of the image detection model. In one embodiment, the training samples of the image detection model further include anti-noise.
For example, the detector shown in FIG. 2 is an image detection model employing a detector that incorporates transmission environment noiseTraining a training sample to obtain a forged input image as an image to be detected, and inputting the forged input image into a detector fθAnd obtaining the detection results of the real area and the forged area in the image to be detected.
In the image detection method provided by the first embodiment of the application, because the image detection model adds the transmission environment noise in the training sample during training, the image detection model can well detect the real area and the forged area in the image to be detected after transmission in the transmission environment, and the accuracy of forged image detection is improved; further, in a preferred scheme, anti-noise is added into a training sample of the image detection model, so that the image detection model has generalization.
A second embodiment of the present application provides a method for obtaining an image detection model, which is described below with reference to fig. 3 and 4.
In step S301, a forged image is added to the original image to obtain an initial sample.
In step S302, transmission environment noise of a preset transmission environment is added to the initial sample, and a processed sample to which the transmission environment noise is added is obtained.
The preset transmission environment may be application software of a certain online social network, may also be a transmission environment for uploading during image printing, and may also be other transmission environments.
The method for adding the transmission environmental noise of the preset transmission environment into the initial sample to obtain the processed sample added with the transmission environmental noise comprises the following steps:
providing the image serving as the initial sample to a preset transmission environment, and after the image is transmitted in the preset transmission environment, taking the transmitted image as the processed sample added with the transmission environment noise; alternatively, the first and second electrodes may be,
and constructing a transmission environment simulation model simulating a preset transmission environment, adding simulated transmission environment noise tau into the image serving as the initial sample, and taking the processed image as the processed sample added with the transmission environment noise.
The transmission environment noise of the preset transmission environment is added into the initial sample, when the processed sample added with the transmission environment noise is obtained, the image serving as the initial sample can be provided for the preset transmission environment, and the processed sample added with the transmission environment noise is generated after transmission of the transmission environment. However, this method is inefficient when the number of samples is large. In order to improve the efficiency of generating the processed sample, the second embodiment of the present application may further employ a transmission environment simulation model that simulates a preset transmission environment to simulate the transmission environment noise, and add the simulated transmission environment noise to the image of the initial sample to generate the processed sample to which the transmission environment noise is added.
In step S303, the processed sample is provided as a training sample to the image detection model to be trained, and training for identifying a real area and a counterfeit area is performed thereon.
As an embodiment, after the transmission environment noise of the preset transmission environment is added to the initial sample, counternoise may be further added, so as to obtain a processed sample added with the transmission environment noise and the counternoise.
When a transmission environment simulation model simulating a preset transmission environment is used to generate a processed sample added with transmission environment noise, the second embodiment of the present application further includes the following steps: and obtaining the transmission environment simulation model.
Specifically, the method for obtaining the transmission environment simulation model may include the following steps:
providing the original image to a preset transmission environment to obtain an actually transmitted image transmitted by the preset transmission environment;
using the image transmitted by the transmission environment as a sample, providing the sample to a transmission environment simulation model to be trained, and processing and generating a transmission environment prediction image according to the output of the transmission environment simulation model to be trained;
comparing the actually transmitted image with the transmission environment predicted image to generate an adjustment measurement index;
and adjusting the transmission environment simulation network to be trained according to the adjustment measurement index until a preset adjustment target is reached.
Please refer to fig. 4, which is a flowchart illustrating a transmission environment simulation model according to a second embodiment of the present application, and the method specifically includes steps S401 to S404.
Step S401, providing the original image to a preset transmission environment, and obtaining an actually transmitted image transmitted in the preset transmission environment.
Fig. 2-1 is a schematic diagram of a method for obtaining a transmission environment simulation model. The original image x is obtained from the database D1, and the original image x is provided to a preset transmission environment, and the actual transmitted image transmission x transmitted through the preset transmission environment is obtained.
Step S402, the original image provided for the preset transmission environment is used as a sample, provided for the transmission environment simulation model to be trained, and a transmission environment prediction image is generated according to the output of the transmission environment simulation model to be trained.
The transmission environment simulation model to be trained adopts a neural network model.
The output of the transmission environment simulation model may be the transmission environment noise itself obtained by simulation.
As shown at 2-1 in fig. 2, prediction x is the generated transmission environment prediction image.
Step S403, comparing the actually transmitted image with the transmission environment predicted image, and generating an adjustment measurement index.
The adjustment measure index is used for measuring the distance between the transmission environment noise obtained by simulation and the real transmission noise. The adjustment metrics include: a loss function.
And S404, adjusting the transmission environment simulation model to be trained according to the adjustment measurement index until a preset adjustment target is reached.
The preset adjustment target includes: an adjustment target with an objective function as a measure, an adjustment target with a regression loss function as a measure, and the like.
The counternoise may be obtained by:
giving an input image x, obtaining a prediction result of a transmission environment simulation model on the image, and processing to obtain initial prediction noise tauo
According to the given input image x, the labeled forged region value y and the forged region value initially output by the image detection model to be trained
Figure BDA0003386733190000081
Preliminary prediction of noise τoAnd constructing the counternoise xi.
Obtaining preliminary prediction noise τ is described belowoThe process of (1).
Let the transmission environment simulation model be gφWhere φ is a trainable cluster of parameters in the transmission environment simulation model, the generic objective function may be expressed as:
Figure BDA0003386733190000082
here, a regression loss function based on a two-norm can be selected:
Figure BDA0003386733190000083
because of the invisibility and the tiny nature of the noise of the transmission environment, in order to ensure that the transmission environment simulation model can accurately carry out regression prediction on the transmission environment simulation model, the residual error learning technology can be adopted in the application, the image after prediction transmission is converted into the prediction residual error, so that the transmission environment simulation model can better depict the tiny fluctuation, namely:
Figure BDA0003386733190000084
since JPEG compression is commonly used in the flow of online social networks, in order to ensure that the regression predicted noise also has a similar compressed noise distribution, a differentiable JPEG compression convolutional layer can be embedded in the neural network model
Figure BDA0003386733190000085
The neural network can be more fit with a real propagation process, and the predicted residual error can be ensured to have a compression noise property. Considering that the neural network module needs to have differentiability, the quantization operation in the JPEG compression process is subjected to differentiable approximation. I.e. the quantization operation is replaced by the following derivable expression:
Figure BDA0003386733190000091
other processes related to JPEG may be fitted through the network. Through the above processing, the simulated preliminary prediction noise τ can be finally obtainedo
Figure BDA0003386733190000092
The following describes the preliminary prediction of noise tau according to a given input image x, a labeled forged region value y, and a forged region value y ^ preliminarily output by the image detection model to be trainedoAnd constructing the process of resisting the noise xi.
From the perspective of an image detection model, noise can be decomposed into two types that affect the detection effect and do not affect the detection effect. Because the noise which does not influence the detection effect does not reduce the performance of the image detection model, the model is not required to be modeled; and for the noise which influences the detection effect, the application proposes to adopt the learnable counternoise for modeling. Among them, the countermeasure noise is a countermeasure sample emerging in recent years, and aims to influence the judgment of the deep neural network by using a tiny disturbance.
Specifically, for an image detection model, an input image x, a labeled forged region value y, a forged region value y ^ preliminarily output by the image detection model to be trained, and a preliminary prediction noise tauoThe counternoise ξ that affects the detection effect can be designed as:
Figure BDA0003386733190000093
wherein
Figure BDA0003386733190000094
In order to be a function of sign,
Figure BDA0003386733190000095
representing a calculated cross entropy loss function
Figure BDA0003386733190000096
Of a gradient of
Figure BDA0003386733190000097
Then it is:
Figure BDA0003386733190000098
the above-defined counternoise starts from the image detection model itself, and can greatly improve the robustness and generalization of the model.
However, the counternoise currently defined is dependent on the particular input sample and thus lacks the ability to generalize to unknown samples. In order to fully improve the generalization capability of the model, the application proposes to adjust the direction of the countering noise to the global gradient direction, and adopt the idea of random fitting to randomly generate the noise subset from the known samples. Specifically, for the tth given input image x, the competing noise ξ is set as the average gradient of the first t-1 image samples:
Figure BDA0003386733190000101
where the countering noise ξ is initialized at 0.
Although the above equation can be used to describe the average gradient of the input samples, it can only reflect the distribution of the known samples (i.e., training data), but it is difficult to reflect the distribution of the unknown samples. Thus, the present application proposes to further model it using a parametrical model. To use the appropriate model, 1000 random noises were first subjected to T-SNE (T-distributed stored noise labeling, a machine learning algorithm for dimension reduction) visualization analysis. The visualization result shows that the sampling noise point focuses on a certain central point and gradually spreads outwards. So the application may model anti-noise using a gaussian model pair:
Figure BDA0003386733190000102
where u is the mean of the gaussian model defined as:
Figure BDA0003386733190000103
σ is the experimentally determined gaussian model variance, and e is the hyper-parameter used to adjust the noise strength. Therefore, the parameter-containing model can be used in actual training, and a Monte Carlo sampling method is combined to efficiently and conveniently sample the noise xi.
Through modeling of preliminary prediction noise and counternoise, the optimization target of the application can be obtained:
Figure BDA0003386733190000104
the output is the finally obtained image detection model which can be used for the counterfeit detection in the actual situation. Specific algorithm flow details are as follows:
Figure BDA0003386733190000111
the algorithm needs to input: training data sets D1 and D2; training iterations N1 and N2; learning rate l in trainingφAnd lθ
And (3) final output of the algorithm: trained detector fθ
Thus, the notebook is alignedThe second embodiment of the present application proposes to use a deep neural network, residual learning, a micro JPEG module, and the like in combination to perform analog depiction of the transmission environment noise introduced by the deep neural network. The analog noise is introduced into a training framework, so that the image detection model has excellent robustness. Meanwhile, the modeling mode of robust noise is innovatively provided based on the anti-noise, the random gradient method, the Gaussian model and the like, so that the performance of the image detection model can be greatly improved. In summary, the present application bases on the preliminary prediction of the noise τoAnd the anti-noise xi is reasonably modeled, so that the satisfactory robustness for resisting the transmission of the online social network and the accurate forgery detection effect are realized.
For a clearer understanding of the present application, a unitary framework designed according to a first and second embodiment of the present application is described below in conjunction with fig. 2.
The present application proposes a counterfeit detection framework with high robustness, as shown in fig. 2, which mainly includes four stages: 1) OSN simulation network gφThe training of (2) corresponds to (1); 2) modeling of transmission environment noise tau, corresponding to 2-2; 3) modeling unknown noise xi, which corresponds to 2-3; and 4) a detector fθThe training of (2) corresponds to (2-4). After the four stages, a trained detector f can be obtainedθFor actual counterfeit detection, corresponding to 2-5.
Corresponding to the image detection method provided in the first embodiment of the present application, a third embodiment of the present application provides an image detection apparatus.
The image detection apparatus includes:
the image acquisition unit to be detected is used for acquiring an image to be detected;
the image detection unit is used for inputting the image to be detected into an image detection model and outputting detection results of a real area and a forged area in the image to be detected; the image detection model is obtained by training a training sample added with transmission environment noise.
As an embodiment, comprising: the training samples of the image detection model are added with counternoise.
It should be noted that, for the detailed description of the image detection apparatus provided in the third embodiment of the present application, reference may be made to the related description of the first embodiment of the present application, and details are not repeated here.
Corresponding to the image detection method provided by the first embodiment of the present application, a fourth embodiment of the present application provides an electronic device, including:
a processor; and
a memory for storing a program of an image detection method, the apparatus performing the following steps after being powered on and running the program of the image detection method by the processor:
obtaining an image to be detected;
inputting the image to be detected into an image detection model, and outputting detection results of a real area and a forged area in the image to be detected; the image detection model is obtained by training a training sample added with transmission environment noise.
It should be noted that, for the detailed description of the electronic device provided in the fourth embodiment of the present application, reference may be made to the related description of the first embodiment of the present application, and details are not repeated here.
In accordance with an image detection method provided in the first embodiment of the present application, a fifth embodiment of the present application provides a storage device storing a program of the image detection method, the program being executed by a processor to perform the steps of:
obtaining an image to be detected;
inputting the image to be detected into an image detection model, and outputting detection results of a real area and a forged area in the image to be detected; the image detection model is obtained by training a training sample added with transmission environment noise.
It should be noted that, for the detailed description of the storage device provided in the fifth embodiment of the present application, reference may be made to the description of the first embodiment of the present application, and details are not described here again.
A sixth embodiment of the present application provides an apparatus for obtaining an image detection model, which corresponds to the method for obtaining an image detection model provided in the second embodiment of the present application.
The device for obtaining the image detection model comprises:
an initial sample obtaining unit, configured to add a counterfeit image to an original image to obtain an initial sample;
a processed sample obtaining unit, configured to add transmission environment noise of a preset transmission environment to the initial sample, and obtain a processed sample to which the transmission environment noise is added;
and the image detection model training unit is used for providing the processed sample as a training sample for the image detection model to be trained and carrying out training for identifying a real area and a forged area.
As an embodiment, the obtaining apparatus of the image detection model further includes: and the anti-noise adding unit is used for adding the transmission environment noise of the preset transmission environment into the initial sample and then further adding the anti-noise to obtain the processed samples added with the transmission environment noise and the anti-noise.
As an embodiment, the processed sample obtaining unit is specifically configured to:
providing the image serving as the initial sample to a preset transmission environment, and after the image is transmitted in the preset transmission environment, taking the transmitted image as the processed sample added with the transmission environment noise; alternatively, the first and second electrodes may be,
and constructing a transmission environment simulation model simulating a preset transmission environment, adding simulated transmission environment noise tau into the image serving as the initial sample, and taking the processed image as the processed sample added with the transmission environment noise.
As an embodiment, the obtaining apparatus of the image detection model further includes: a transmission environment simulation model obtaining unit configured to:
providing the original image to a preset transmission environment, and obtaining an actually transmitted image transmitted through the preset transmission environment;
using the image transmitted by the transmission environment as a sample, providing the sample to a transmission environment simulation model to be trained, and processing and generating a transmission environment prediction image according to the output of the transmission environment simulation model to be trained;
comparing the actually transmitted image with the transmission environment predicted image to generate an adjustment measurement index;
and adjusting the transmission environment simulation model to be trained according to the adjustment measurement index until a preset adjustment target is reached.
As one embodiment, the adjustment metric includes a loss function.
As an implementation mode, the transmission environment simulation model to be trained adopts a neural network model, and a differentiable JPEG compression convolutional layer is embedded in the neural network model
Figure BDA0003386733190000141
As an embodiment, the obtaining apparatus of the image detection model further includes: a counter noise obtaining unit for:
giving an input image x, obtaining a prediction result of a transmission environment simulation model on the image, and processing to obtain initial prediction noise tauo
According to the given input image x, the labeled forged region value y and the forged region value initially output by the image detection model to be trained
Figure BDA0003386733190000142
Preliminary prediction of noise τoAnd constructing the counternoise xi.
As an embodiment, the countering noise obtaining unit is specifically configured to: for the tth given input image x, the countering noise ξ is set as the average gradient of the first t-1 image samples.
It should be noted that, for the detailed description of the apparatus provided in the sixth embodiment of the present application, reference may be made to the related description of the second embodiment of the present application, and details are not described here again.
A seventh embodiment of the present application provides an electronic device corresponding to the method for obtaining an image detection model provided in the second embodiment of the present application.
The electronic device includes:
a processor; and
a memory for storing a program of an obtaining method of an image detection model, the apparatus performing the following steps after being powered on and running the program of the obtaining method of the image detection model by the processor:
adding a forged image into an original image to obtain an initial sample;
adding transmission environment noise of a preset transmission environment into the initial sample to obtain a processed sample added with the transmission environment noise;
and taking the processed sample as a training sample, providing the training sample for an image detection model to be trained, and training the image detection model to identify a real area and a forged area.
As an embodiment, after the transmission environment noise of the preset transmission environment is added to the initial sample, the counternoise is further added, and a processed sample added with the transmission environment noise and the counternoise is obtained.
As an embodiment, adding transmission environment noise of a preset transmission environment to the initial sample to obtain a processed sample added with the transmission environment noise, includes:
providing the image serving as the initial sample to a preset transmission environment, and after the image is transmitted in the preset transmission environment, taking the transmitted image as the processed sample added with the transmission environment noise; alternatively, the first and second electrodes may be,
and constructing a transmission environment simulation model simulating a preset transmission environment, adding simulated transmission environment noise tau into the image serving as the initial sample, and taking the processed image as the processed sample added with the transmission environment noise.
As an embodiment, the method for obtaining the transmission environment simulation model includes the following steps:
providing the original image to a preset transmission environment, and obtaining an actually transmitted image transmitted through the preset transmission environment;
using the image transmitted by the transmission environment as a sample, providing the sample to a transmission environment simulation model to be trained, and processing and generating a transmission environment prediction image according to the output of the transmission environment simulation model to be trained;
comparing the actually transmitted image with the transmission environment predicted image to generate an adjustment measurement index;
and adjusting the transmission environment simulation model to be trained according to the adjustment measurement index until a preset adjustment target is reached.
As one embodiment, the adjustment metric includes a loss function.
As an implementation mode, the transmission environment simulation model to be trained adopts a neural network model, and a differentiable JPEG compression convolutional layer is embedded in the neural network model
Figure BDA0003386733190000152
As an embodiment, the counternoise is obtained by:
giving an input image x, obtaining a prediction result of a transmission environment simulation model on the image, and processing to obtain initial prediction noise tauo
According to the given input image x, the labeled forged region value y and the forged region value initially output by the image detection model to be trained
Figure BDA0003386733190000151
Preliminary prediction of noise τoAnd constructing the counternoise xi.
As an embodiment, for the tth given input image x, the countering noise ξ is set as the average gradient of the top t-1 image samples.
It should be noted that, for the detailed description of the electronic device provided in the seventh embodiment of the present application, reference may be made to the related description of the second embodiment of the present application, and details are not described here again.
In correspondence with the method for obtaining an image detection model provided in the second embodiment of the present application, an eighth embodiment of the present application provides a storage device storing a program of the method for obtaining an image detection model, the program being executed by a processor to perform the steps of:
adding a forged image into an original image to obtain an initial sample;
adding transmission environment noise of a preset transmission environment into the initial sample to obtain a processed sample added with the transmission environment noise;
and taking the processed sample as a training sample, providing the training sample for an image detection model to be trained, and training the image detection model to identify a real area and a forged area.
It should be noted that, for the detailed description of the storage device provided in the eighth embodiment of the present application, reference may be made to the related description of the second embodiment of the present application, and details are not described here again.
Although the present application has been described with reference to the preferred embodiments, it is not intended to limit the present application, and any person skilled in the art can make variations and modifications without departing from the spirit and scope of the present application, therefore, the scope of the present application should be limited by the scope of the claims.
In a typical configuration, a computing device includes one or more processors (CPUs), a memory mapped input/output interface, a network interface, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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 disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium 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 computer readable media (transient media), such as modulated data signals and carrier waves.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

Claims (16)

1. An image detection method, comprising:
obtaining an image to be detected;
inputting the image to be detected into an image detection model, and outputting detection results of a real area and a forged area in the image to be detected; the image detection model is obtained by training a training sample added with transmission environment noise.
2. The image detection method according to claim 1, comprising:
the training samples of the image detection model are added with counternoise.
3. An image detection model obtaining method is characterized by comprising the following steps:
adding a forged image into an original image to obtain an initial sample;
adding transmission environment noise of a preset transmission environment into the initial sample to obtain a processed sample added with the transmission environment noise;
and providing the processed sample serving as a training sample for an image detection model to be trained, and training the image detection model to identify a real area and a forged area.
4. The method for obtaining the image detection model according to claim 3, wherein after the transmission environment noise of the preset transmission environment is added to the initial sample, the counternoise is further added to obtain the processed sample added with the transmission environment noise and the counternoise.
5. The method for obtaining the image detection model according to claim 4, wherein the step of adding the transmission environmental noise of the preset transmission environment to the initial sample to obtain the processed sample added with the transmission environmental noise comprises:
providing the image serving as the initial sample to a preset transmission environment, and after the image is transmitted in the preset transmission environment, taking the transmitted image as the processed sample added with the transmission environment noise; alternatively, the first and second electrodes may be,
and constructing a transmission environment simulation model simulating a preset transmission environment, adding simulated transmission environment noise tau into the image serving as the initial sample, and taking the processed image as the processed sample added with the transmission environment noise.
6. The method for obtaining an image inspection model according to claim 5, wherein the method for obtaining the transmission environment simulation model comprises the following steps:
providing the original image to a preset transmission environment, and obtaining an actually transmitted image transmitted through the preset transmission environment;
the original image provided for the preset transmission environment is used as a sample, provided for a transmission environment simulation model to be trained, and a transmission environment prediction image is generated according to the output of the transmission environment simulation model to be trained;
comparing the actually transmitted image with the transmission environment predicted image to generate an adjustment measurement index;
and adjusting the transmission environment simulation model to be trained according to the adjustment measurement index until a preset adjustment target is reached.
7. The method of claim 6, wherein the adjustment metric comprises a loss function.
8. The method for obtaining an image inspection model according to claim 7, wherein the simulation model of the transmission environment to be trained adopts a neural network model, and a differentiable JPEG compressed convolution layer is embedded in the neural network model
Figure FDA0003386733180000021
9. The method for obtaining an image detection model according to claim 6, wherein the counternoise is obtained by:
giving an input image x, obtaining a prediction result of a transmission environment simulation model on the image, and processing to obtain a preliminary prediction noise tauo
According to the given input image x, the labeled forged region value y and the forged region value preliminarily output by the image detection model to be trained
Figure FDA0003386733180000022
Preliminary prediction of noise τoAnd constructing the counternoise xi.
10. The method of claim 9, wherein the direction of the countering noise ξ is set as the average gradient of the first t-1 image samples for the given input image x.
11. An image detection apparatus, characterized by comprising:
the image acquisition unit to be detected is used for acquiring an image to be detected;
the image detection unit is used for inputting the image to be detected into an image detection model and outputting detection results of a real area and a forged area in the image to be detected; the image detection model is obtained by training a training sample added with transmission environment noise.
12. An electronic device, comprising:
a processor; and
a memory for storing a program of an image detection method, the apparatus performing the following steps after being powered on and running the program of the image detection method by the processor:
obtaining an image to be detected;
inputting the image to be detected into an image detection model, and outputting detection results of a real area and a forged area in the image to be detected; the image detection model is obtained by training a training sample added with transmission environment noise.
13. A storage device storing a program of an image detection method, the program being executed by a processor to perform the steps of:
obtaining an image to be detected;
inputting the image to be detected into an image detection model, and outputting detection results of a real area and a forged area in the image to be detected; the image detection model is obtained by training a training sample added with transmission environment noise.
14. An apparatus for obtaining an image detection model, comprising:
an initial sample obtaining unit, configured to add a counterfeit image to an original image to obtain an initial sample;
a processed sample obtaining unit, configured to add transmission environment noise of a preset transmission environment to the initial sample, and obtain a processed sample to which the transmission environment noise is added;
and the image detection model training unit is used for providing the processed sample as a training sample for the image detection model to be trained and carrying out training for identifying a real area and a forged area.
15. An electronic device, the electronic device comprising:
a processor; and
a memory for storing a program of an obtaining method of an image detection model, the apparatus performing the following steps after being powered on and running the program of the obtaining method of the image detection model by the processor:
adding a forged image into an original image to obtain an initial sample;
adding transmission environment noise of a preset transmission environment into the initial sample to obtain a processed sample added with the transmission environment noise;
and providing the processed sample serving as a training sample for an image detection model to be trained, and training the image detection model to identify a real area and a forged area.
16. A storage device characterized by storing a program of an obtaining method of an image detection model, the program being executed by a processor and executing the steps of:
adding a forged image into an original image to obtain an initial sample;
adding transmission environment noise of a preset transmission environment into the initial sample to obtain a processed sample added with the transmission environment noise;
and providing the processed sample serving as a training sample for an image detection model to be trained, and training the image detection model to identify a real area and a forged area.
CN202111456215.0A 2021-12-01 2021-12-01 Image detection method and method for obtaining image detection model Pending CN114359144A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111456215.0A CN114359144A (en) 2021-12-01 2021-12-01 Image detection method and method for obtaining image detection model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111456215.0A CN114359144A (en) 2021-12-01 2021-12-01 Image detection method and method for obtaining image detection model

Publications (1)

Publication Number Publication Date
CN114359144A true CN114359144A (en) 2022-04-15

Family

ID=81096853

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111456215.0A Pending CN114359144A (en) 2021-12-01 2021-12-01 Image detection method and method for obtaining image detection model

Country Status (1)

Country Link
CN (1) CN114359144A (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0635893A (en) * 1992-07-16 1994-02-10 Babcock Hitachi Kk Plant simulator
US20190004920A1 (en) * 2017-06-30 2019-01-03 Intel Corporation Technologies for processor simulation modeling with machine learning
CN109918538A (en) * 2019-01-25 2019-06-21 清华大学 Video information processing method and device, storage medium and calculating equipment
CN109961444A (en) * 2019-03-01 2019-07-02 腾讯科技(深圳)有限公司 Image processing method, device and electronic equipment
CN110728629A (en) * 2019-09-03 2020-01-24 天津大学 Image set enhancement method for resisting attack
CN110766153A (en) * 2018-07-27 2020-02-07 Tcl集团股份有限公司 Neural network model training method and device and terminal equipment
CN110824450A (en) * 2019-10-15 2020-02-21 中国人民解放军国防科技大学 Radar target HRRP robust identification method in noise environment
CN111062931A (en) * 2019-12-20 2020-04-24 河北工业大学 Detection method of spliced and tampered image
CN111798435A (en) * 2020-07-08 2020-10-20 国网山东省电力公司东营供电公司 Image processing method, and method and system for monitoring invasion of engineering vehicle into power transmission line
CN111899251A (en) * 2020-08-06 2020-11-06 中国科学院深圳先进技术研究院 Copy-move type forged image detection method for distinguishing forged source and target area
CN112465764A (en) * 2020-11-24 2021-03-09 泰康保险集团股份有限公司 Image tampering detection method and device
US20210158143A1 (en) * 2019-11-25 2021-05-27 International Business Machines Corporation Modeling environment noise for training neural networks
CN113168176A (en) * 2018-10-17 2021-07-23 柯尼亚塔有限公司 System and method for generating realistic simulation data for training automated driving
CN113449622A (en) * 2021-06-20 2021-09-28 石河子大学 Image classification, identification and detection method for cotton plants and weeds

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0635893A (en) * 1992-07-16 1994-02-10 Babcock Hitachi Kk Plant simulator
US20190004920A1 (en) * 2017-06-30 2019-01-03 Intel Corporation Technologies for processor simulation modeling with machine learning
CN110766153A (en) * 2018-07-27 2020-02-07 Tcl集团股份有限公司 Neural network model training method and device and terminal equipment
CN113168176A (en) * 2018-10-17 2021-07-23 柯尼亚塔有限公司 System and method for generating realistic simulation data for training automated driving
CN109918538A (en) * 2019-01-25 2019-06-21 清华大学 Video information processing method and device, storage medium and calculating equipment
CN109961444A (en) * 2019-03-01 2019-07-02 腾讯科技(深圳)有限公司 Image processing method, device and electronic equipment
CN110728629A (en) * 2019-09-03 2020-01-24 天津大学 Image set enhancement method for resisting attack
CN110824450A (en) * 2019-10-15 2020-02-21 中国人民解放军国防科技大学 Radar target HRRP robust identification method in noise environment
US20210158143A1 (en) * 2019-11-25 2021-05-27 International Business Machines Corporation Modeling environment noise for training neural networks
CN111062931A (en) * 2019-12-20 2020-04-24 河北工业大学 Detection method of spliced and tampered image
CN111798435A (en) * 2020-07-08 2020-10-20 国网山东省电力公司东营供电公司 Image processing method, and method and system for monitoring invasion of engineering vehicle into power transmission line
CN111899251A (en) * 2020-08-06 2020-11-06 中国科学院深圳先进技术研究院 Copy-move type forged image detection method for distinguishing forged source and target area
CN112465764A (en) * 2020-11-24 2021-03-09 泰康保险集团股份有限公司 Image tampering detection method and device
CN113449622A (en) * 2021-06-20 2021-09-28 石河子大学 Image classification, identification and detection method for cotton plants and weeds

Similar Documents

Publication Publication Date Title
Rieck et al. Persistent homology for the evaluation of dimensionality reduction schemes
Li et al. GAN-based spatial image steganography with cross feedback mechanism
Qureshi et al. Bibliography of digital image anti‐forensics and anti‐anti‐forensics techniques
CN112487365B (en) Information steganography method and information detection method and device
Gupta et al. Passive image forensics using universal techniques: a review
CN113257259A (en) Secure audio watermarking based on neural networks
Ouyang et al. A semi-fragile watermarking tamper localization method based on QDFT and multi-view fusion
CN112418345B (en) Method and device for quickly identifying small targets with fine granularity
CN116822623B (en) Method, device, equipment and storage medium for generating countermeasures network joint training
CN111753729B (en) False face detection method and device, electronic equipment and storage medium
Agarwal et al. Median filtering forensics based on optimum thresholding for low-resolution compressed images
CN114359144A (en) Image detection method and method for obtaining image detection model
CN107203958A (en) A kind of hidden image analysis method based on multiple features combining
CN114241411B (en) Counting model processing method and device based on target detection and computer equipment
Chuchra et al. A deep learning approach for splicing detection in digital audios
Battiato et al. Computational data analysis for first quantization estimation on JPEG double compressed images
CN112346126B (en) Method, device, equipment and readable storage medium for identifying low-order faults
Shelke et al. Multiple forgery detection in digital video with VGG-16-based deep neural network and KPCA
CN114819059A (en) Countermeasure sample generation method, target model training method and device
Yuan et al. Benchmarking the reliability of post-training quantization: a particular focus on worst-case performance
Kubal et al. Image Manipulation Detection Using Error Level Analysis and Deep Learning
CN112734016A (en) Training method of neural network for detecting smoothness of surface of steel bar
Meng et al. Traceable and authenticable image tagging for fake news detection
Thabit A novel blind tamper detection and localization scheme for multiple faces in digital images
Hassani et al. Efficiently mitigating face-swap-attacks: compressed-PRNU verification with sub-zones

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