A tampered region positioning method based on a deep learning model
By conducting two rounds of training on the deep learning model and using interference images and loss functions to update parameters, the accuracy of the tampered area positioning model was improved, and the problem of inaccurate positioning caused by insufficient training samples was solved.
Patent Information
- Application Number
- CN202111152313.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-29
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2041-09-29
AI Technical Summary
The existing deep learning-based tampering area localization model has poor positioning effect due to insufficient training samples and is unable to accurately locate the tampered area in the tampered image.
A two-round training method is used to train the positioning model. Each training sample undergoes two rounds of training, including the first round of training and the second round of training. The model parameters are updated by interfering images and loss functions to improve the positioning accuracy of the model.
The training effect of the tampered area localization model is improved, enabling it to more accurately locate the tampered area in the tampered image, solving the problem of inaccurate positioning caused by insufficient training samples.
Smart Images

Figure CN113962940B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a method for locating tampered areas based on a deep learning model. Background Art
[0002] Recently, a large number of deep learning methods have been developed to locate tampered areas in manipulated images, such as RGB-N, SPAN, Mantra-Net, and H-LSTM. These deep learning-based algorithms require large amounts of data. However, because the tampered areas in manipulated images are pixel-level and difficult to label, only a small number of high-quality training samples are available. Localization models trained based on these limited training samples have poor positioning performance and are unable to accurately locate tampered areas in manipulated images.
[0003] Therefore, the existing technology still needs to be improved and developed. Summary of the Invention
[0004] The technical problem to be solved by the present invention is that, in response to the above-mentioned defects of the prior art, a method for locating a tampered area based on a deep learning model is provided, aiming to solve the problem that the positioning model trained based on limited training samples in the prior art has poor positioning effect and such a positioning model cannot accurately locate the tampered area in the tampered image.
[0005] The technical solutions adopted by the present invention to solve the problem are as follows:
[0006] In a first aspect, an embodiment of the present invention provides a method for locating a tampered area based on a deep learning model, wherein the method includes:
[0007] Obtaining the tampered image to be processed;
[0008] Inputting the tampered image to be processed into a positioning model to obtain a predicted segmentation map, wherein the positioning model is a pre-trained model, and the training process of the positioning model includes: obtaining a plurality of training samples, and iteratively training the original positioning model according to the plurality of training samples, wherein each training sample corresponds to two rounds of training;
[0009] According to the predicted segmentation map, a tampered area in the tampered image to be processed is determined.
[0010] In one embodiment, each of the training samples includes a tampered image and a standard segmentation map corresponding to the tampered image, and the first round of the two rounds of training includes:
[0011] Inputting the tampered image into the original positioning model to obtain a first training segmentation map;
[0012] Determining first error data corresponding to the original positioning model according to the first training segmentation map and the standard segmentation map;
[0013] The model parameters of the original positioning model are updated according to the first error data.
[0014] In one embodiment, determining first error data corresponding to the original positioning model based on the first training segmentation map and the standard segmentation map includes:
[0015] Inputting the first training segmentation map and the standard segmentation map into the loss function of the original positioning model;
[0016] Comparing the first training segmentation map and the standard segmentation map using the loss function to obtain a first loss function value;
[0017] The first loss function value is used as the first error data.
[0018] In one embodiment, the second round of training in the two rounds of training includes:
[0019] Interfering with the tampered image to obtain an interfered image;
[0020] Inputting the interference image into the positioning model obtained after the first round of training to obtain a second training segmentation map;
[0021] Determining second error data corresponding to the positioning model obtained after the first round of training according to the second training segmentation map and the standard segmentation map;
[0022] The model parameters of the positioning model obtained after the first round of training are updated according to the second error data.
[0023] In one embodiment, interfering with the tampered image to obtain an interfered image includes:
[0024] Obtaining model parameters of the positioning model obtained after the first round of training;
[0025] The tampered image is modified according to the model parameters of the positioning model obtained after the first round of training to obtain the interference image.
[0026] In one embodiment, the modifying the tampered image according to the model parameters of the positioning model obtained after the first round of training to obtain the interference image includes:
[0027] Performing a gradient attack on the tampered image according to the model parameters of the positioning model obtained after the first round of training to obtain an adversarial image;
[0028] The adversarial image is used as the interference image.
[0029] In one embodiment, determining, based on the second training segmentation map and the standard segmentation map, second error data corresponding to the positioning model obtained after the first round of training includes:
[0030] Inputting the second training segmentation map and the standard segmentation map into the loss function;
[0031] Comparing the second training segmentation map and the standard segmentation map using the loss function to obtain a second loss function value;
[0032] The second loss function value is used as the second error data.
[0033] In a second aspect, an embodiment of the present invention further provides a tampering area positioning device based on a deep learning model, wherein the device includes:
[0034] An acquisition module, used for acquiring the tampered image to be processed;
[0035] A prediction module is configured to input the tampered image to be processed into a positioning model to obtain a predicted segmentation map, wherein the positioning model is a pre-trained model, and the training process of the positioning model includes: obtaining a plurality of training samples, and iteratively training the original positioning model based on the plurality of training samples, wherein each training sample corresponds to two rounds of training;
[0036] A determination module is used to determine the tampered area in the tampered image to be processed according to the predicted segmentation map.
[0037] In a third aspect, an embodiment of the present invention further provides a terminal, wherein the terminal includes a memory and one or more processors; the memory stores one or more programs; the program includes instructions for executing any of the above-mentioned tampering area positioning methods based on deep learning models; and the processor is used to execute the program.
[0038] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a plurality of instructions are stored, wherein the instructions are suitable for being loaded and executed by a processor to implement any of the steps of the above-mentioned tampering area positioning method based on the deep learning model.
[0039] Beneficial effects of the present invention: The embodiment of the present invention obtains a tampered image to be processed; inputs the tampered image to be processed into a positioning model to obtain a predicted segmentation map, wherein the positioning model is a pre-trained model, and the training process of the positioning model includes: obtaining a number of training samples, iteratively training the original positioning model according to the training samples, wherein each training sample corresponds to two rounds of training; and determining the tampered area in the tampered image to be processed according to the predicted segmentation map. The present invention trains the positioning model twice for each training sample, thereby alleviating the defect of insufficient training samples, improving the training effect of the model, and enabling the trained positioning model to more accurately locate the tampered area in the tampered image, thereby solving the problem in the prior art that the positioning model trained with a small number of training samples cannot accurately locate the tampered area in the tampered image. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0041] Figure 1 This is a flow chart of a tampering area positioning method based on a deep learning model provided in an embodiment of the present invention.
[0042] Figure 2 This is a reference diagram for two rounds of training provided by an embodiment of the present invention.
[0043] Figure 3 This is a diagram showing the prediction effect of the positioning model provided by an embodiment of the present invention.
[0044] Figure 4 This is a diagram of the internal modules of a tampering area positioning device implemented based on a deep learning model provided in an embodiment of the present invention.
[0045] Figure 5 This is a principle block diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of the present invention more clear and distinct, 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 only used to explain the present invention and are not intended to limit the present invention.
[0047] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the various components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indications will also change accordingly.
[0048] With the rapid development and use of multimedia acquisition devices, we are entering an era of multimedia information explosion. Almost everyone has the ability to create and transmit large quantities of digital images. Simultaneously, the ease of use of image editing software such as Photoshop, Meitu Xiuxiu, and BeautyCam has made image modification increasingly easy, allowing ordinary people to easily process and modify images. Furthermore, with technological advancements, forged images are becoming increasingly difficult to detect, and can even be indistinguishable from the real thing. In today's society, the so-called "seeing is believing" is becoming increasingly unreliable. When people are presented with an image, they often initially doubt its authenticity. In daily life, people often modify images for aesthetic or entertainment purposes, which does not have any negative consequences. However, in some cases, the dissemination of maliciously tampered images can affect people's judgment of objective facts and sometimes even have a negative impact on society and the country. Therefore, localizing tampered areas in tampered images has attracted considerable research attention. Recently, a number of deep learning methods have been developed to locate tampered areas in tampered images, such as RGB-N, SPAN, Mantra-Net, and H-LSTM. Deep learning-based algorithms are in urgent need of large amounts of data. However, currently, because the tampered areas in tampered images are pixel-level and difficult to label, there are only a small number of high-quality training samples. Localization models trained based on these limited training samples have poor positioning performance and cannot accurately locate the tampered areas in tampered images.
[0049] In response to the above-mentioned shortcomings of the prior art, the present invention provides a method for locating a tampered area based on a deep learning model. The method comprises: obtaining a tampered image to be processed; inputting the tampered image to be processed into a positioning model to obtain a predicted segmentation map, wherein the positioning model is a pre-trained model, and the training process of the positioning model includes: obtaining a number of training samples, iteratively training the original positioning model based on the training samples, wherein each training sample corresponds to two rounds of training; and determining the tampered area in the tampered image to be processed based on the predicted segmentation map. The present invention trains the positioning model twice for each training sample, thereby alleviating the defect of insufficient training samples, improving the training effect of the model, and enabling the trained positioning model to more accurately locate the tampered area in the tampered image. This solves the problem in the prior art that the positioning model trained with a small number of training samples cannot accurately locate the tampered area in the tampered image.
[0050] like Figure 1 As shown, the method includes the following steps:
[0051] Step S100: Obtain the tampered image to be processed.
[0052] Specifically, in practical applications, this embodiment requires first obtaining images in which the tampered areas need to be located. These images are referred to as the tampered images to be processed. It is understood that these images have been pre-tampered and are not authentic images. For example, the tampered images to be processed may have been cut, copied, moved, or deleted. Because the tampered images to be processed have been artificially modified, they pose a security risk to digital images. Therefore, it is necessary to determine the tampered areas in the tampered images to be processed.
[0053] like Figure 1 As shown, the method further includes the following steps:
[0054] Step S200: input the tampered image to be processed into a positioning model to obtain a predicted segmentation map, wherein the positioning model is a pre-trained model, and the training process of the positioning model includes: obtaining a number of training samples, and iteratively training the original positioning model according to the number of training samples, wherein each training sample corresponds to two rounds of training.
[0055] Specifically, in order to determine which areas in the tampered image to be processed have been modified, this embodiment needs to input the tampered image to be processed into a pre-trained positioning model. Since the positioning model has been pre-trained with a certain number of training samples, it can be used to perform the positioning task of the tampered area in the tampered image in actual applications, thereby outputting a predicted segmentation map corresponding to the tampered image to be processed. The predicted segmentation map divides the original tampered image to be processed into several areas and indicates which areas are tampered areas. Since the tampered areas of the tampered image are pixel-level and difficult to mark, there are only a small number of high-quality training samples. In order to increase the training samples and improve the training effect of the model, for each training sample, this embodiment will perform two rounds of training on the original positioning model based on the training sample.
[0056] In one implementation, each of the training samples includes a tampered image and a standard segmentation map corresponding to the tampered image, and the first round of the two rounds of training includes:
[0057] Step S201: input the tampered image into the original positioning model to obtain a first training segmentation map;
[0058] Step S202: determining first error data corresponding to the original positioning model according to the first training segmentation map and the standard segmentation map;
[0059] Step S203: Update the model parameters of the original positioning model according to the first error data.
[0060] In short, each training sample includes a tampered image and its corresponding standard segmentation map. This embodiment will first perform a first round of training on the original positioning model based on the tampered image and the standard segmentation map. It can be understood that the original positioning model is an untrained positioning model. After its training is completed, a trained positioning model is obtained. The standard segmentation map is equivalent to the true label corresponding to the tampered image, which is used to reflect the correct segmentation result corresponding to the tampered image. Specifically, the tampered image is input into the original positioning model. Since the original positioning model has not been trained, the first training segmentation map it outputs usually contains a large error, that is, the first error data used to reflect the difference between the first training segmentation map and the correct segmentation standard segmentation map is large, and the purpose of training is to continuously converge the first error data. Therefore, it is necessary to backpropagate the model parameters of the original positioning model based on the first error data to update the model parameters.
[0061] In one implementation, step S202 specifically includes the following steps:
[0062] Step S2021: inputting the first training segmentation map and the standard segmentation map into the loss function of the original positioning model;
[0063] Step S2022: Compare the first training segmentation map and the standard segmentation map using the loss function to obtain the first loss function value;
[0064] Step S2023: Use the first loss function value as the first error data.
[0065] Specifically, in order to determine the first error data, this embodiment needs to compare the first training segmentation map with the standard segmentation map. Figure 1 The loss function corresponding to the original positioning model is input. The loss function can automatically calculate the degree of difference between the two input segmentation maps, thereby outputting a first loss function value. Since the first loss function value can reflect the difference between the first training segmentation map and the standard segmentation map, this embodiment uses the first loss function value as the first error data to update the model parameters.
[0066] In one implementation, the second round of training in the two rounds of training includes:
[0067] Step S204: disturbing the tampered image to obtain a disturbed image;
[0068] Step S205: input the interference image into the positioning model obtained after the first round of training to obtain a second training segmentation map;
[0069] Step S206: determining second error data corresponding to the positioning model obtained after the first round of training based on the second training segmentation map and the standard segmentation map;
[0070] Step S207: Update the model parameters of the positioning model obtained after the first round of training according to the second error data.
[0071] In short, since the number of training samples in this embodiment is limited, in order to make full use of these training samples, this embodiment needs to use each training sample to perform model training twice (such as Figure 2 As shown). The second round of training process is to train the positioning model obtained after the first round of training based on the interference image corresponding to the tampered image in each training sample and the standard segmentation image corresponding to the tampered image. Specifically, the interference image is input into the positioning model obtained after the first round of training to obtain a second training segmentation map. Since the number of training rounds may be limited, the gap between the second training segmentation map obtained at this time and the standard segmentation image is still large, that is, the second error data used to reflect the gap between the second training segmentation map and the standard segmentation image is large. Therefore, it is necessary to update the model parameters of the positioning model obtained after the first round of training again according to the second error data to improve the prediction effect of the positioning model.
[0072] In one implementation, step S204 specifically includes:
[0073] Step S2041: Obtain model parameters of the positioning model obtained after the first round of training;
[0074] Step S2042: Modify the tampered image according to the model parameters of the positioning model obtained after the first round of training to obtain the interference image.
[0075] In order to induce the positioning model after the first round of training to make incorrect predictions, this embodiment first needs to determine the model parameters of the positioning model obtained after the first round of training, and then modify the tampered images in the training samples based on these model parameters, and add a certain amount of noise to the tampered images to generate interference images. Specifically, although the tampered images and the interference images cannot be distinguished by the naked eye, there is a qualitative difference between the two for deep networks such as positioning models. Since deep networks are fragile, interference images can cause the positioning model to misposition and thus reduce the accuracy. This embodiment generates interference images by interfering with the tampered images, and then uses the interference images for model training. This method of dynamically generating new training images can give full play to the role of supervised learning of each training image.
[0076] For example, the modification method can be to perform a single-pixel attack on the tampered image in the training sample, or to gradually push the images within the classification boundary in the tampered image to outside the boundary, thereby generating an interference image.
[0077] In one implementation, step S2042 specifically includes the following steps:
[0078] Step S20421: Perform a gradient attack on the tampered image based on the model parameters of the positioning model obtained after the first round of training to obtain an adversarial image;
[0079] Step S20422: Use the adversarial image as the interference image.
[0080] Specifically, this embodiment uses the currently popular gradient attack method to attack the tampered image to obtain an adversarial sample corresponding to the tampered image, and inputs the adversarial sample as an interference image into the positioning model obtained in the first round of training to interfere with the prediction of the positioning model. In one implementation, the gradient attack can specifically use the fast gradient signature attack, i.e., FGSM. Since this embodiment uses adversarial samples to train the positioning model in the second round of training, the positioning model obtained after training can also have higher performance and stronger ability to resist image attacks, and can resist attacks of secondary image tampering.
[0081] In one implementation, step S206 specifically includes the following steps:
[0082] Step S2061: inputting the second training segmentation map and the standard segmentation map into the loss function;
[0083] Step S2062: Compare the second training segmentation map and the standard segmentation map using the loss function to obtain a second loss function value;
[0084] Step S2063: Use the second loss function value as the second error data.
[0085] Specifically, in order to determine the second error data, this embodiment needs to compare the second training segmentation map with the standard segmentation map. Figure 1 The loss function is inputted, and the loss function can automatically calculate the degree of difference between the two input segmentation maps, thereby outputting a second loss function value. Since the second loss function value can reflect the difference between the second training segmentation map and the standard segmentation map, this embodiment uses the second loss function value as the first error data to update the model parameters again.
[0086] like Figure 1Said method further comprises the following steps:
[0087] Step S300: Determine a tampered region in the tampered image to be processed according to the predicted segmentation map.
[0088] Specifically, if Figure 3 As shown, the predicted segmentation map output by the positioning model can be a mask map, in which the marks corresponding to the tampered area and the untampered area are different. The tampered area is marked white, and the untampered area is marked black. Therefore, based on the predicted segmentation map, it is possible to clearly determine which areas of the tampered image in the input positioning model have been tampered with.
[0089] In one implementation, the positioning model is a convolutional neural network, and the structure of the positioning model includes: a first network module and a second network module connected to the first network module.
[0090] Specifically, in the actual application stage, the tampered image to be processed is used as input data of the first network module, and the second network module outputs the predicted segmentation map corresponding to the tampered image to be processed.
[0091] In one implementation, the first network module includes: a first channel-by-channel high-pass convolution layer, a first downsampling convolution layer, a first distillation convolution layer, and a first upsampling convolution layer.
[0092] Specifically, in the actual application phase, the tampered image to be processed is input into the first channel-by-channel high-pass convolution layer to obtain first noise feature data. This first noise feature data is then input into the first downsampling convolution layer to obtain first feature data. The first feature data is then input into the first distillation convolution layer to obtain second feature data. Finally, the second feature data is input into the first upsampling convolution layer to obtain a feature map and an initial prediction map.
[0093] In one implementation, the second network module includes a second channel-by-channel high-pass convolution layer, a second downsampling convolution layer, a second distillation convolution layer, a tampering attention layer, and a second upsampling convolution layer.
[0094] Specifically, in the actual application stage, the feature map is input into the second channel-by-channel high-pass convolution layer to obtain the second noise feature data. Then, the second noise feature data is input into the second downsampling convolution layer to obtain the third feature data. Thereafter, the third feature data is input into the second distillation convolution layer to obtain the fourth feature data. Finally, the fourth feature data is input into the second upsampling convolution layer to obtain the predicted segmentation map. The predicted segmentation map is the segmentation map corresponding to the tampered image finally output by the positioning model. In addition, during the training stage of the positioning model, the initial segmentation map output by the first network module and the predicted segmentation map output by the second network module can be compared with the standard segmentation map respectively to obtain two error values, and the two error values are superimposed to calculate the loss function value of the positioning model.
[0095] In one implementation, the first channel-by-channel high-pass convolution layer and the second channel-by-channel high-pass convolution layer have the same structure and both use multiple high-pass filters, for example, three high-pass filters. Specifically, the multiple high-pass filters extract noise features based on the input tampered image to be processed to obtain multiple noise features, which are then concatenated to obtain the first noise feature / the second noise feature.
[0096] In one implementation, the first downsampling convolutional layer and the second downsampling convolutional layer have the same structure and both use VGG-style convolutional modules. Specifically, the first downsampling convolutional layer and the second downsampling convolutional layer each include several cascaded convolutional layers, and the last convolutional layer is followed by a maximum pooling layer to complete the downsampling operation. For example, the first downsampling convolutional layer and the second downsampling convolutional layer can each include three cascaded convolutional layers, and the third convolutional layer is followed by a maximum pooling layer.
[0097] In one implementation, the first and second distilled convolutional layers have the same structure, each comprising several convolutional layers. Each of the convolutional layers corresponds to a different dilation rate, and the dilation rates of the convolutional layers increase layer by layer. For example, the first and second distilled convolutional layers may each comprise four convolutional layers, with the four convolutional layers having dilation rates of 2, 4, 8, and 16, respectively. The different dilation rates allow the second network module to expand its receptive field.
[0098] In one implementation, the first upsampling convolution layer and the second upsampling convolution layer have the same structure, both including cascaded upsampling layers and convolution layers, so as to achieve the purpose of restoring the resolution of the image.
[0099] In one implementation, the tampering attention layer includes parallel spatial and channel attention modules, which are used to make the second network module focus on the inconsistency between the high-frequency areas of the tampered area and the high-frequency areas of the non-tampered area. Specifically, in the spatial dimension, the tampering attention layer uses matrix reshaping, matrix transposition, matrix multiplication, and matrix addition operations to obtain the spatial attention matrix; in the channel dimension, it uses matrix reshaping, matrix transposition, matrix multiplication, and matrix addition operations to obtain the channel attention matrix. Finally, the spatial attention matrix and the channel attention matrix are combined together through matrix fusion to generate the tampering attention matrix.
[0100] In order to demonstrate the technical effect of the present invention, the inventors conducted the following experiments:
[0101] The inventors trained and tested the system on the NIST2016, Columbia, COVERAGE, CASIA, and DEFACTO datasets. In comparing the experimental results, they used F1-score and pixel-AUC as test metrics. For both, higher metrics represent better performance.
[0102] DEFACTO was first used to demonstrate the effectiveness of the method proposed in the present invention. The inventors used 90% of the data as a training set and 10% of the test data as a test set to conduct a melting experiment, as shown in Table 1:
[0103] Table 1. Algorithm module test results
[0104] Model AUC F1 Coarse-to-fine Forgery Attention Model 0.992 0.904 Coarse-to-fine Forgery Attention Model+SAT 0.996 0.920
[0105] In the module experiment results, the Coarse-to-fine Forgery Attention Model is the network model adopted by this paper, and the Coarse-to-fine Forgery Attention Model+SAT is the training method using self-adversarial training. As shown in Table 1, self-adversarial training further improves model performance, demonstrating that the proposed method effectively improves model performance.
[0106] In this example, we used a model pre-trained on DEFACTO to fine-tune the NIST2016, Columbia, COVERAGE, and CASIA datasets and tested them on their respective datasets. We compared the results with some classic and powerful tamper localization algorithms (ELA, NOI1, CFA1) and deep learning-based algorithms (H-LSTM, RGB-N, Mantra-Net, SPAN). The results are shown in Table 2:
[0107] Table 2. Comparison with other advanced methods
[0108]
[0109] The localization model of the present invention is implemented in the TensorFlow toolbox. The network hyperparameters are set as follows: learning rate: 0.0002, power: 0.75, gamma coefficient: 0.0001, momentum: 0.9, batch size: 16.
[0110] In summary, it can be seen from Table 1 that self-adversarial training also further improves the performance of the model, which proves that the self-adversarial training method proposed in the present invention effectively improves the performance of the model. As can be seen from Table 2, the self-adversarial training method used in the present invention is stronger than the current advanced methods in the four data sets. Among them, the performance of the present invention surpasses the latest method SPAN with a maximum AUC of 0.48 and a maximum F1 performance of nearly 0.3. The present invention takes advantage of the organic combination of domain knowledge to obtain a higher recognition rate than the general deep learning model. And the application of self-adversarial training technology achieves better performance with limited training samples.
[0111] Based on the above embodiments, the present invention also provides a tampering area positioning device based on a deep learning model, such as Figure 4 As shown, the device includes:
[0112] Acquisition module 01, used to acquire the tampered image to be processed;
[0113] Prediction module 02 is used to input the tampered image to be processed into a positioning model to obtain a predicted segmentation map, wherein the positioning model is a pre-trained model, and the training process of the positioning model includes: obtaining a plurality of training samples, and iteratively training the original positioning model according to the plurality of training samples, wherein each training sample corresponds to two rounds of training;
[0114] The determination module 03 is configured to determine the tampered area in the tampered image to be processed according to the predicted segmentation map.
[0115] Based on the above embodiment, the present invention further provides a terminal, whose principle block diagram can be shown as follows: Figure 5 As shown. The terminal includes a processor, a memory, a network interface, and a display screen connected via a system bus. The processor of the terminal is used to provide computing and control capabilities. The memory of the terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the terminal is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a tampering area positioning method based on a deep learning model is implemented. The display screen of the terminal can be a liquid crystal display or an electronic ink display.
[0116] Those skilled in the art can understand that, Figure 5 The principle block diagram shown in the above-mentioned embodiments is only a block diagram of part of the structure related to the application scheme, and does not constitute a limitation on the terminal to which the application scheme is applied. The specific terminal can include more or less components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0117] In an implementation manner, the memory of the terminal stores one or more programs, and is configured to execute the one or more programs by one or more processors, and the one or more programs contain instructions for implementing the tampered region positioning method based on the deep learning model.
[0118] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. Any reference to memory, storage, database or other medium used in each embodiment of the application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0119] In summary, the tampering region positioning method based on a deep learning model is disclosed, the method comprises the following steps: obtaining a tampering image to be processed; inputting the tampering image to be processed into a positioning model to obtain a prediction segmentation map, wherein the positioning model is a pre-trained model, the training process of the positioning model comprises: obtaining a plurality of training samples, and iteratively training an original positioning model according to the plurality of training samples, wherein each training sample corresponds to two rounds of training; and determining a tampering region in the tampering image to be processed according to the prediction segmentation map. The positioning model is trained for two rounds by each training sample, which alleviates the defect of insufficient training data, improves the training effect of the model, and enables the trained positioning model to more accurately locate the tampering region in the tampering image, thereby solving the problem that the positioning model trained by a small amount of training data in the prior art cannot accurately locate the tampering region in the tampering image.
[0120] It should be understood that the application is not limited to the above examples, and can be improved or changed according to the above description for those of ordinary skill in the art, and all these improvements and changes shall belong to the protection scope of the appended claims of the application.
Claims
1. A tampering area positioning method based on a deep learning model, characterized in that: The method comprises: Obtaining the tampered image to be processed; Inputting the tampered image to be processed into a positioning model to obtain a predicted segmentation map, wherein the positioning model is a pre-trained model, and the training process of the positioning model includes: obtaining a plurality of training samples, and iteratively training the original positioning model according to the plurality of training samples, wherein each training sample corresponds to two rounds of training; Determining a tampered region in the tampered image to be processed according to the predicted segmentation map; Each of the training samples includes a tampered image and a standard segmentation map corresponding to the tampered image. The first round of the two rounds of training includes: Inputting the tampered image into the original positioning model to obtain a first training segmentation map; Determining first error data corresponding to the original positioning model according to the first training segmentation map and the standard segmentation map; updating model parameters of the original positioning model according to the first error data; The second of the two training rounds includes: Obtaining model parameters of the positioning model obtained after the first round of training; Performing a gradient attack on the tampered image according to the model parameters of the positioning model obtained after the first round of training to obtain an adversarial image; and using the adversarial image as an interference image; Inputting the interference image into the positioning model obtained after the first round of training to obtain a second training segmentation map; Determining second error data corresponding to the positioning model obtained after the first round of training according to the second training segmentation map and the standard segmentation map; The model parameters of the positioning model obtained after the first round of training are updated according to the second error data.
2. The method for locating tampered areas based on a deep learning model according to claim 1, characterized in that: The determining, according to the first training segmentation map and the standard segmentation map, first error data corresponding to the original positioning model includes: Inputting the first training segmentation map and the standard segmentation map into the loss function of the original positioning model; Comparing the first training segmentation map and the standard segmentation map using the loss function to obtain a first loss function value; The first loss function value is used as the first error data.
3. The method for locating tampered areas based on a deep learning model according to claim 1, characterized in that: The determining, based on the second training segmentation map and the standard segmentation map, second error data corresponding to the positioning model obtained after the first round of training includes: Inputting the second training segmentation map and the standard segmentation map into a loss function; Comparing the second training segmentation map and the standard segmentation map using the loss function to obtain a second loss function value; The second loss function value is used as the second error data.
4. A tampering area positioning device based on a deep learning model, characterized in that: The device comprises: An acquisition module, used for acquiring the tampered image to be processed; A prediction module is configured to input the tampered image to be processed into a positioning model to obtain a predicted segmentation map, wherein the positioning model is a pre-trained model, and the training process of the positioning model includes: obtaining a plurality of training samples, and iteratively training the original positioning model based on the plurality of training samples, wherein each training sample corresponds to two rounds of training; a determination module, configured to determine a tampered region in the tampered image to be processed according to the predicted segmentation map; Each of the training samples includes a tampered image and a standard segmentation map corresponding to the tampered image. The first round of the two rounds of training includes: Inputting the tampered image into the original positioning model to obtain a first training segmentation map; Determining first error data corresponding to the original positioning model according to the first training segmentation map and the standard segmentation map; updating model parameters of the original positioning model according to the first error data; The second of the two training rounds includes: Obtaining model parameters of the positioning model obtained after the first round of training; Performing a gradient attack on the tampered image according to the model parameters of the positioning model obtained after the first round of training to obtain an adversarial image; and using the adversarial image as an interference image; Inputting the interference image into the positioning model obtained after the first round of training to obtain a second training segmentation map; Determining second error data corresponding to the positioning model obtained after the first round of training according to the second training segmentation map and the standard segmentation map; The model parameters of the positioning model obtained after the first round of training are updated according to the second error data.
5. A terminal, characterized in that: The terminal includes a memory and one or more processors; the memory stores one or more programs; the program includes instructions for executing the tampering area positioning method based on the deep learning model as described in any one of claims 1-3; the processor is used to execute the program.
6. A computer-readable storage medium having a plurality of instructions stored thereon, characterized in that: The instructions are suitable for being loaded and executed by a processor to implement the steps of the tampering area positioning method based on a deep learning model as described in any one of claims 1-3 above.
Citation Information
Patent Citations
Image tampering detection method based on Mask R-CNN
CN111340784A