Print

发布时间: 2022-01-16
摘要点击次数:
全文下载次数:
DOI: 10.11834/jig.210438
2022 | Volume 27 | Number 1




    篡改检测与内容恢复    




  <<上一篇 




  下一篇>> 





检测小篡改区域的U型网络
expand article info 刘丽颖, 王金鑫, 曹少丽, 赵丽, 张笑钦
温州大学, 温州 325035

摘要

目的 图像篡改区域检测是图像取证领域的一个挑战性任务,其目的是找出图像的篡改区域。传统方法仅针对某种特定的篡改方式进行设计,难以检测其他篡改方式的图像。基于卷积神经网络的方法能够自适应地提取特征,同时检测包含多种篡改方式的图像。但是其中多数方法都选择增强图像的噪声特征,这种机制无法较好处理篡改区域与原图像来源相同、噪声相似的情况。多数方法还忽略了篡改区域过小而产生的样本不平衡问题,导致检测效果不佳。方法 提出了一个基于区域损失的用于检测小篡改区域的U型网络,该网络构建了一个异常区域特征增强机制,放大与图像背景差异较大的异常区域的特征。此外,还利用区域损失增强对篡改区域框内像素的判别能力,可以解决因篡改区域过小而产生的样本不平衡问题。结果 消融实验说明了异常区域特征增强机制和区域损失机制的有效性;对JPEG压缩和高斯模糊的对抗性测试证明了模型的鲁棒性;在CASIA2.0(CASI-A image tampering detection evaluation database)、NIST2016(NIST nimble 2016 datasets)、COLUMBIA(Columbia uncompressed image splicing detection evaluation dataset)和COVERAGE(a novel database forcopy-move forgery detection)数据集上与最新方法进行比较时,本文方法取得了最优性能,其F1 score分别为0.979 5、0.982 2、0.995 3和0.987 0。结论 本文的异常区域特征增强机制和区域损失机制能有效提高模型性能,同时缓解篡改区域过小导致的样本不平衡问题,大量实验也表明了本文提出的小篡改区域检测方法的优越性。

关键词

图像取证; 小篡改区域检测; 特征增强; 区域损失; 卷积神经网络(CNNs); U型网络(U-Net)

U-Net for detecting small forgery region
expand article info Liu Liying, Wang Jinxin, Cao Shaoli, Zhao Li, Zhang Xiaoqin
Wenzhou University, Wenzhou 325035, China
Supported by: National Natural Science Foundation of China(61922064, U2033210, 62101387);Natural Science Foundation of Zhejiang Province, China(LR17F030001, LQ19F020005)

Abstract

Objective Detecting the image forgery region is a challenging task on the aspect of image forensics. The statistical features and physical characteristics of the image itself methods have been focused on in the traditional detection and localization field. Traditional methods are designed only for a specific forgery, making them difficult to detect images containing diverse forgery approaches. Convolutional neural networks (CNNs) are proposed to various image tasks recently due to extracting adaptive features. Most of these methods have enhanced the noise features of an image. It cannot be qualified that the noise of the forgery region is similar to the original image. In addition, most of CNNs-based forgery region detection methods ignore the imbalanced sample constrained by the small forgery region. It affects the further improvement of detection performance. So, more qualified image features enhancement and problem solving have been focused on due to the small forgery region. Method A region loss based U-Net for small image forgery region detection is demonstrated. First, the most forgery regions differ from the image background has been investigated. Image anomaly regions could be called where differ from the image background. Splicing the difference tensor between local and dominant image features to the image to enhance the features extracted from these image anomaly regions. This feature augmentation mechanism only needs to be computed once when given an image as input, which significantly reduces training time compared to other state-of-the-art methods. Simutanesouly, a U-Net structure model is illustrated. A modified VGG-16 architecture is used to be the down-sampling part. Several de-convolution layers and convolution layers are utilized to be the up-sampling part. Aiming at retaining the location information of an image, maxpool layers is removed from the down-sampling network. To extract hierarchical features with diverse scales, the stride of last convolution layer in each down-sampling block is set as 2. The upsampling process requires fusing the multi-scale features extracted from the down-sampling process to avoid the loss of image spatial information. To address the final question caused by small forgery regions, a novel region loss has been demonstrated. The illustrated region loss mechanism requires segmenting the learning process of the network into two stages. In the first stage, the targeted binary cross entropy loss(BCELoss) of overall image as a loss function for network training. A relative rough model has been obtained. In the training process of second stage, a multiple candidate region boxes have been generated based on the location information from the model learned in first stage. The option of candidate region box should satisfy two conditions: 1) The candidate region box should contain all forgery regions; 2) The ratio of forgery region and non-forgery region is approximate to 1 ∶1. The oriented candidate region box is called forgery region box. Next, the BCELoss of the image is calculated in the forgery region box and as the second loss for the learning of second stage. Hence, the judging capability about whether pixels are forged in region box is able to be remarkable improved. Result It has the priority of the illustrated forgery region detection methods on four standard image forgery datasets, including traditional DWT method and three CNNs-based methods including manipulation tracing network(ManTra-Net), U-Net, and the ringed residual U-Net(RRU-Net). The four standard image forgery datasets are CASI-A image tampering detection evaluation database(CASIA2.0), Columbia uncompressed image splicing detection evaluation dataset(COLUMBIA), a novel database forcopy-move forgery detection(COVERAGE) and NIST nimble 2016 datasets(NIST 2016), respectively. The CASIA2.0 dataset images are small, complex and more challenging. F1 score is used as the benchmark for model evaluation. Moreover, F1 score is improved most on the CASIA2.0 dataset, which is asymptotical 2.17% higher than the second method. To test the robustness of our approach, the F1 score is evaluated as well. U-Net and RRU-Net on images is interfered by JPEG compression and Gaussian blur. The comparison results demonstrate that the method has its optimal robustness. To verify the effectiveness of the proposed feature augmentation mechanism and region loss mechanism in this work, we also perform abundant ablation experiments. Anomaly region feature augmentation modeling has its advantage and models region loss models can achieve its more qualified results. Conclusion A region loss based U-Net architecture is illustrated in order to detect forgery region in images effectively and accurately. It mainly resolves the issue of feature augmentation and small forgery regions. The difference amongst local and dominant features has been sorted out to enhance the features from image anomaly regions. An illustrated region loss enhanced the learning of features in the forgery region caused by imbalanced sample issue. Ablation study has shown that feature augmentation and region loss mechanisms improve the proposed model calculation effectively. In addition, the JPEG compression and Gaussian blur tests also demonstrate the robustness. An effective forgery region detection method is implemented and facilitated.

Key words

image forensics; small forgery region detection; feature augmentation; region loss; convolutional neural networks(CNNs); U-Net

0 引言

数字图像由于其传播快和存储成本低的特点,被广泛应用到人们的学习和生活中。然而,随着Photoshop等图像编辑软件的不断发展,用户可以轻易地对图像进行修改,并且这些修改痕迹难以察觉,导致无法判断图像的真实性。更重要的是,图像经常被用来作为判断事件真相的依据。如果图像篡改技术被不法之人利用,会引发严重的社会问题。常用的图像篡改技术主要是复制移动(copy-move)和拼接(splicing),图像的复制移动指的是将真实图像的某一部分复制粘贴到原图像上;图像拼接是指真实图像的某一部分复制粘贴到另一幅图像上。并且,为了掩盖图像篡改的痕迹,使图像看起来更为真实,通常会在篡改之后再对图像进行压缩和高斯模糊等处理降低图像的清晰度。

为了区分真实图像和篡改之后的图像,诞生了图像取证这个领域,图像篡改区域检测与定位是图像取证领域的一个具有挑战性的任务。目前,对图像篡改区域的检测与定位技术主要分为两种:1)基于特征提取的传统篡改检测与定位;2)基于卷积神经网络的篡改检测与定位。

传统方法将注意力主要集中在图像本身的统计信息和物理特征上。对于进行过复制移动篡改操作的图像,篡改区域的特征会和其他某个区域的特征高度相似。基于这个特性,可以应用基于图像块特征匹配的方法来检测复制移动区域,主要方法有:穷举搜索(Fridrich等,2003)、主成分分析法(Popescu和Farid,2004)、像素匹配法(Luo等,2006)、离散小波变换和奇异值分解(Li等,2007)、相位相关法(Wang和Farid,2007)。由于基于块特征匹配的方法计算缓慢,Amerini等人(2013)以及Ardizzone等人(2015)提出了基于特征点的篡改检测方法来提高计算效率与检测效果。对于进行拼接篡改操作的图像,由于其篡改区域是来自于另一幅图像,所以篡改区域与其他区域之间会存在特征差异,这种差异性体现在各个方面。据此学者们分别从不同方面来进行拼接篡改操作的检测。例如:光照不一致性(Johnson和Farid,2007Liu等,2011李叶舟等,2011)、噪声估计(Chen等,2008Pan等,2011卢燕飞等,2012)和设备属性(Gou等,2007)。由于很多伪造者为了使得图像看起来更为真实,会利用中值滤波等操作模糊拼接区域边界来掩盖篡改痕迹,Bahrami等人(2015)通过提取中值滤波的特征来检测篡改区域。传统方法促进了图像取证领域的发展,但是其缺点也很明显,一个方法只能针对一种篡改技术进行检测,在不清楚篡改方式的情况下,检测效果较差。

卷积神经网络在计算机视觉任务上取得了巨大的成功(Zhang等,2021a, b),其能自适应提取特征的特点使得学者将其应用到图像篡改检测上来。Rao和Ni(2016)首次将卷积神经网络用于数字图像的篡改检测,但是该方法只能用于判断图像是否经过篡改,不能定位篡改区域。Zhang等人(2016)提出了基于图像块的篡改检测方法,其只能大致定位图像的篡改区域。

不同类型的相机所拍摄图像的噪声是不一致的。所以为了提高模型的定位精确度,Bondi等人(2017)通过卷积神经网络提取噪声不一致特征来检测图像的篡改区域。Cozzolino等人(2017)Zhou等人(2018)选择利用空间丰富模型(spatial rich model, SRM)(Fridrich和Kodovsky,2012)增强噪声特征。上述方法在一定程度上提升了检测效果,但它们也存在明显的缺点。对于复制移动篡改方式产生的图像,其篡改区域的噪声特征和其他区域的噪声特征相似,这会导致只增强噪声特征的方法效果有限。为了应对这样的情况,RRU-Net(the ringed residual U-Net)(Bi等,2019)利用残差回馈机制自动选择要增强的特征,其对于不同的篡改方式都有较好的检测效果。但该方法在提取特征时,网络的每一层都需计算两遍,需要花费较多的时间。除上述的问题外,大多数图像篡改检测方法的注意力主要集中在如何利用网络更好地提取篡改特征,而忽略篡改区域太小产生的样本不平衡问题,影响了检测效果的进一步提升。网络模型经过训练之后可以判断各个像素点是否经过篡改,是一个像素水平的二分类问题。若将篡改区域的像素点当作正样本,将其他区域的像素点当作负样本,很明显,对于篡改区域小的图像,样本比例是不平衡的。

本文根据上述问题提出了一个基于区域损失的小篡改区域检测U型网络。具体贡献如下:

1) 提出异常区域特征增强机制,将与图像背景差异较大的区域定为异常区域,并对其进行特征增强。

2) 提出区域损失,增强模型对篡改区域框内像素的判别能力,解决篡改区域过小产生的样本不平衡问题,进一步提升模型性能。

3) 本文方法在CASIA2.0(CASI-A image tampering detection evaluation database)(Dong等,2013)、NIST2016(NIST nimble 2016 datasets)(Guan等,2016)、COVERAG(a novel database forcopy-move forgery detection)(Wen等,2016)和COLUMBIA(Columbia uncompressed image splicing detection evaluation dataset)(Hsu和Chang,2006)这4个图像篡改标准数据集上取得了更优的性能。

1 本文方法

本文提出了一个基于区域损失的小篡改区域检测U型网络,首先构建了一个异常区域特征增强机制,将与图像背景差异较大的区域定为异常区域,对其进行特征增强,然后利用U型网络进行特征的提取与融合。为了解决篡改区域过小的问题,本文提出了区域损失,利用候选区域生成机制找到图像的篡改区域框,计算篡改区域框内图像的损失来增强模型对篡改区域框内像素的判别能力。

1.1 异常区域特征增强

对于大多数的篡改图像,篡改区域通常与图像背景之间存在差异,可将与图像背景相差较大的区域定为异常区域。借鉴ManTra-Net(manipulation tracing network)(Wu等人,2019)中使用的局部异常检测网络。首先对输入图像进行计算,然后将得到的差值张量与升维后的图像进行拼接,增强输入图像异常区域的特征。利用这种方法,只需在图像输入时计算一次,比RRU-Net中使用的残差回馈机制能节省更多的训练时间。本文用像素点的值表示这个像素的局部特征,像素点周围区域内的平均值表示该像素点的显著特征。

显著特征由区域内像素的平均值计算为

$ \mu = \sum\limits_{i = 1}^{{H_{\rm{r}}}} {\sum\limits_{j = 1}^{{W_{\rm{r}}}} {\frac{{F\left[ {i, j} \right]}}{{{H_{\rm{r}}}{W_{\rm{r}}}}}} } $ (1)

式中,$\mu $表示像素的平均值,${F\left[ {i, j} \right]}$表示位置为($i, j$)的像素值,${{H_{\rm{r}}}}$${{W_{\rm{r}}}}$分别表示区域的高和宽。

计算局部特征与显著特征之间的差值张量$\mathit{\boldsymbol{D}}$,即

$ D\left[ {i, j} \right] = F\left[ {i, j} \right] - \mu $ (2)

标准差$\sigma $计算为

$ \sigma = \sqrt {\sum\limits_{i = 1}^{{H_{\rm{r}}}} {\sum\limits_{j = 1}^{{W_{\rm{r}}}} {\frac{{F{{\left[ {i, j} \right]}^2}}}{{{H_{\rm{r}}}{W_{\rm{r}}}}} - {\mu ^2}} } } $ (3)

差值标准化计算为

$ V\left[ {i, j} \right] = \frac{{D\left[ {i, j} \right]}}{\sigma } $ (4)

为了更加准确地找出异常区域,本文使用了不同的区域范围计算显著特征。首先是以整幅图像作为一个区域,将所有像素的平均值作为显著特征,然后还分别利用了11×11、7×7和3×3的平均池化来找这3个区域的的显著特征,差值张量计算的具体过程如图 1所示。

图 1 差值张量计算图
Fig. 1 Differential tensor calculation

ManTra-Net将该方法应用于局部异常特征检测,将与显著特征差异较大的局部特征定为异常区域,然后对其进行异常检测分析。但是,ManTra-Net存在两个问题:1)局部异常特征检测之前的篡改特征提取网络会造成图像空间信息的丢失;2)其局部异常检测网络无法从潜在异常特征中准确判别真正的异常特征。本文方法直接对输入图像进行局部异常检测之后与图像进行拼接,可在保留完整的图像空间信息的同时对潜在的异常区域进行特征增强,增强网络对这些区域的学习,得到更加精确的检测结果。

1.2 网络结构

本文的网络结构借鉴了U-Net(Ronneberger等人,2015)的网络结构。U-Net由下采样的压缩路径和上采样的扩展路径组成,关键点在于对称的U形结构可以在扩展路径进行上采样时融合压缩路径中的特征,避免上采样过程中图像空间信息的丢失。本文的网络同样由下采样网络和上采样网络组成,下采样网络提取图像特征,上采样网络恢复图像空间信息,如图 2的网络结构所示。图中$k$为卷积核大小,$s$为步长,$p$为输入特征图四周补零的情况,$d$为空洞卷几率,$o$_$p$为输出特征图四周补零的情况。

图 2 网络结构图
Fig. 2 Network structure

在ManTra-Net的研究中,对比了几种主流的骨干网络,发现VGG(Visual Geometry Group) 网络更适用于篡改区域特征的提取,所以本文下采样网络选择VGG-16。本文的任务是找出图像的篡改区域,将其分割出来,需要在图像进行下采样的时候保留图像中物体的位置信息,故对下采样的VGG-16做了如下改动:1)去掉最后的3个FC(fully connected)层;2)删掉VGG-16的最大池化层;3)每个下采样块最后一个卷积层的步长设置为2。

最大池化层会改变图像中物体的位置信息,如图 3所示,图 3(a)是下采样时保留最大池化层之后得到的候选区域框生成的图像,很明显图像下采样之后物体的位置信息发生了变化,得到的篡改区域中心位置并不是真正的篡改区域中心位置;图 3(b)是去掉了最大池化层之后得到的候选区域框生成图,可以看出,图像中物体的位置信息被保留了下来。

图 3 候选区域框生成图
((a)with the maxpool layer;(b)without the maxpool layer)
Fig. 3 Generating of candidate region boxes

下采样网络中有5个下采样块,分辨率缩小为原图像的1/32,故上采样网络中同样需要5个上采样块。每一个上采样块都是由1个反卷积层加1个卷积层组成。反卷积层将特征图的分辨率扩大两倍,卷积层进行特征提取。上采样路径中传递的特征信息需要与对称的下采样路径传递的特征信息相融合,以避免上采样过程中信息的缺失。最后再用一个1×1的卷积层进行降维,将其通道数变为1,得到检测结果图。

1.3 区域损失

本文方法的关键点在于利用区域损失来解决样本比例不平衡的问题。首先应用候选区域框生成机制生成候选区域框,接着从中选出篡改区域框,生成过程如图 4所示。然后计算该篡改区域框内图像的BCELoss(binary cross entropy loss),将其作为第2阶段训练的辅助损失。其能解决样本比例不平衡的原因在于将篡改区域框内的BCELoss作为辅助损失,相当于增强了篡改区域框内部图像特征的学习,一定程度上平衡了样本比例。

图 4 篡改区域框的生成图
Fig. 4 Process of forgery region box selection

1.3.1 篡改区域中心点的确定

对图像进行下采样之后,利用Sigmoid激活函数将特征图上的值变为0~1,然后设定阈值为0.5,小于0.5的值变为0,大于等于0.5的变为1。由于图像下采样之后图像的分辨率较小,所以利用了一个3×3,参数全为1的卷积核对该特征图进行卷积,找出卷积之后特征图上值最大的点就是篡改区域的中心点。

找出特征图的中心点之后,将其中心点位置映射到输出图像中,即

$ \begin{array}{l} {\alpha _{{\rm{ic}}}} = n \times {\alpha _{{\rm{fc}}}} + \frac{n}{2}\\ {\beta _{{\rm{ic}}}} = n \times {\beta _{{\rm{fc}}}} + \frac{n}{2} \end{array} $ (5)

式中,$\left({{\alpha _{{\rm{ic}}}}, {\beta _{{\rm{ic}}}}} \right)$表示图像中心点的位置,$\left({{\alpha _{{\rm{fc}}}}, {\beta _{{\rm{fc}}}}} \right)$表示下采样之后特征图的中心位置,$n$表示下采样之后分辨率缩小的倍数,本文中设置$n$为32,具体过程如图 2的右下部分所示。

1.3.2 候选区域框的生成

候选区域框的生成首先要确定基础框的大小,然后求出候选区域框的高和宽,即

$ \begin{array}{l} h = \xi \times \kappa \times \sqrt \gamma \\ w = \xi \times \kappa \times \frac{1}{{\sqrt \gamma }} \end{array} $ (6)

式中,$h$$w$分别表示候选区域框的高和宽,$\xi $是基础框的大小,$\kappa $表示基础框扩张的尺度,$\gamma $表示宽和高的比例,$\xi $$\kappa $$ \gamma $都是根据需求来自行设定。

然后求出候选区域框的左上角和右下角位置,即

$ \begin{array}{l} {\alpha _l} = {\rm{max}}\left({{\alpha _{{\rm{ic}}}} - \left\lfloor {\frac{h}{2}} \right\rfloor, 0} \right)\\ {\beta _l} = {\rm{max}}\left({{\beta _{{\rm{ic}}}} - \left\lfloor {\frac{w}{2}} \right\rfloor, 0} \right)\\ {\alpha _r} = {\rm{min}}\left({{\alpha _{{\rm{ic}}}} + \left\lfloor {\frac{h}{2}} \right\rfloor, {H_{{\rm{img}}}}} \right)\\ {\beta _r} = {\rm{min}}\left({{\beta _{{\rm{ic}}}} + \left\lfloor {\frac{\beta }{2}} \right\rfloor, {W_{{\rm{img}}}}} \right) \end{array} $ (7)

式中,$\left({{\alpha _{\rm{l}}}, {\beta _{\rm{l}}}} \right)$$\left({{\alpha _{\rm{r}}}, {\beta _{\rm{r}}}} \right)$分别表示候选区域框左上角和右下角的位置,${{H_{{\rm{img}}}}}$${{W_{{\rm{img}}}}}$分别表示图像的高和宽。

1.3.3 篡改区域框的确定

区域损失机制需要从候选区域框中找到样本比例最为平衡的候选区域框作为篡改区域框。所以被选取的候选区域框要满足两个条件:1)候选区域框要包含所有的篡改区域;2)候选区域框内篡改区域与非篡改区域的样本比例接近于1 ∶ 1。如图 3所示,红色框就是被确定的篡改区域框。然后计算其区域内图像的BCELoss作为第2阶段的辅助损失,解决样本不平衡的问题。

1.3.4 损失函数

在网络的训练中,所使用的损失函数都是BCELoss。BCELoss是由交叉熵变形得到的,更适用于二分类的问题,数学表达形式为

$ L = - \frac{1}{{H \times W}}\sum\limits_{i = 1}^{H \times W} {\left[ {{t_i}{\rm{log}}{o_i} + \left({1 - {t_i}} \right){\rm{log}}\left({1 - {o_i}} \right)} \right]} $ (8)

式中,${t_{\rm{i}}}$表示第$i$个像素点的目标值,${o_{\rm{i}}}$表示第$i$个像素点的预测值,$H$$W$分别表示高和宽。

本文训练第1阶段的损失函数是整幅图像BCELoss,第2阶段训练的损失函数${L_{\rm{s}}}$计算为

$ {L_{\rm{s}}} = \left({1 - \varepsilon } \right) \times {L_{{\rm{img}}}} + \varepsilon \times {L_{{\rm{box}}}} $ (9)

式中,${L_{{\rm{img}}}}$表示整幅图像的BCELoss,${{\rm{box}}}$表示选定的篡改区域框内的BCELoss,$\varepsilon$设置为0.05。

2 实验结果与比较分析

2.1 实验设计

2.1.1 参数设计

实验中,第1个阶段训练的epoch为400,第2个阶段训练的epoch为200。学习率应用了CyclicLR的衰减策略:周期的上升部分中,训练迭代的次数设置为8;第1阶段训练的初始学习率设置为0.001,学习率上限设置为0.05;第2阶段的训练的初始学习率设置为0.000 1,学习率上限设置为0.001。本文实验均在Tesla V-100 GPU设备上进行,python版本为3.6,pytorch版本1.4.0。

第2阶段求中心位置时,基础框宽和高的比例设置了3个值分别为0.25、1和4,基础框的扩张尺度有6个值分别为2、4、8、16、32和64,故每幅图像可生成18个候选区域框。然后根据不同的数据集中图像的大小设置不同的基础框的大小。在CASIA2.0和COVERAGE数据集上训练时,基础框的大小设置为8;在NIST2016和COLUMBIA数据集上训练时,基础框的大小设置为16。确保得到的候选区域框中存在能包含整幅图像的候选区域框。

2.1.2 评估指标

本文主要利用平衡F分数(F1 score)作为评价指标,计算为

$ \begin{array}{l} p = \frac{{\begin{array}{*{20}{l}} {TP} \end{array}}}{{\begin{array}{*{20}{l}} {TP + FP} \end{array}}}\\ \begin{array}{*{20}{l}} {r = } \end{array}\frac{{TP}}{{TP + FN}}\\ {F_1} = \frac{{2 \times p \times r}}{{p + r}} \end{array} $ (10)

式中,$TP$表示预测为正,实际是正的样本数量,$FP$表示预测为正,但实际是负的样本数量,$FN$表示预测为负,但实际是正的样本数量。$p$表示精确率,$r$表示召回率,$F_1$表示$\rm{F1}$ score。

2.2 数据集

2.2.1 数据集介绍

在CASIA2.0、NIST2016、COVERAG和COLUMBIA这4个数据集上训练测试了本文方法,并与其他方法进行比较。

CASIA2.0数据集提供了复制移动和拼接两种篡改方式的图像。该数据集里面图像的篡改区域小而复杂,这让其更具挑战性。NIST2016数据集包含了复制移动、拼接和移除3种篡改操作所得到的篡改图像,该数据的篡改区域较小。COLUMBIA和COVERAGE数据集也提供了复制移动和拼接两种篡改方式的图像,但是两者的图像数量都比较少,COLUMBIA数据集上的图像篡改区域大而简单。以上4个数据集都提供了篡改图像的真实标注。

2.2.2 数据增强

分别从各个数据集选取了不同数量的图像进行训练和测试。首先设置每个数据集中80 % 的图像为训练集,20 % 为测试集,并调整了图像的大小。为了提高本文方法在高斯模糊和JPEG压缩这两种后处理方法上的鲁棒性,每个数据集都额外复制了一份进行JPEG压缩和高斯模糊等处理,其每幅图像有50 % 的概率进行压缩,压缩质量因子在0到100之间随机选择;有50 % 的概率进行高斯模糊处理,在1、3、5、7和9这几个数字中随机抽取作为高斯核大小。然后,还对COLUMBIA和COVERAGE这两个较小的数据集的图像进行旋转和镜像翻转操作进一步扩充数据集。旋转角度分别为10°、45°、90°、135°和180°,翻转操作包含上下翻转和左右翻转,这样CASIA2.0和NIST2016数据集大小变为原来的2倍,COLUMBIA和COVERAGE数据集大小变为原来的16倍。具体情况如表 1所示,AUG表示数据增强之后的数据集效果。

表 1 数据集图像处理表
Table 1 Image processing tables for datasets

下载CSV
CASIA2.0 NIST2016 COLUMBIA COVERAGE
原训练集/幅 3 984 852 576 80
训练集(AUG)/幅 7 968 1 703 4 608 1 280
原测试集/幅 996 212 114 20
测试集(AUG)/幅 1 992 425 1 152 320
图像大小/像素 384×256 768×512 768×512 384×384
注:加粗字体表示数据集增强之后的的图像数量。

2.3 实验结果与比较

2.3.1 与其他方法的比较

为了检测本文方法的性能,选取了一种基于传统的特征提取的检测方法DWT(discrete wavelet transformation)(Mahdian和Saic,2009)和3种基于卷积神经网络的检测方法RRU-Net、U-Net和ManTra-Net与本文方法进行比较。

检测结果如表 2所示,分析表 2的数据,可知本文方法在4个数据集上测试的F1值均高于其他方法,说明本文方法的性能优于其他方法。其中,在CASIA2.0数据集上的F1值比排名第2的U-Net高了2.17 %。原因在于CASIA2.0数据集中图像的篡改区域小而复杂,样本比例失衡严重。其他基于卷积神经网络的篡改检测方法忽略了该问题,导致其在CASIA2.0数据集上表现较差,同时说明了本文区域损失机制的有效性。

表 2 5种算法在不同数据集上的F1值结果
Table 2 F1 score of five algorithms on different datasets

下载CSV
算法 CASIA2.0 NIST2016 COLUMBIA COVERAGE
DWT 0.414 3 0.386 5 0.354 2 0.312 7
ManTra-Net 0.562 7 0.687 1 0.877 4 0.560 2
U-Net 0.957 8 0.944 8 0.972 3 0.978 2
RRU 0.918 8 0.979 5 0.989 7 0.963 6
本文 0.979 5 0.982 2 0.996 0 0.983 6
注:加粗字体表示每列最优值。

为了更加清楚地看到模型的检测效果,本文从CASIA2.0数据集中选取了多幅图像进行效果检测并对测得的图像篡改区域进行了放大处理。从图 5可以看出DWT完全检测不出篡改区域,ManTra-Net的检测效果较差。原因在于DWT只针对单一的篡改方式进行设计,难以在包含多种篡改方式的数据集上达到较好的效果。ManTra-Net的异常检测网络的深度不够,无法从潜在异常特征中准确判别真正的异常特征。U-Net和RRU-Net的检测效果较好,但有些较细微的地方检测效果不是很好。本文方法的检测效果最佳,异常区域特征增强机制和区域损失机制使其能精确地分割出篡改区域。

图 5 CASIA2.0检测结果
Fig. 5 Detection results on CASIA2.0
((a)test images; (b)DWT; (c)ManTra-Net; (d)U-Net; (e)RRU-Net; (f)ours; (g)ground truth)

2.3.2 鲁棒性检测

在对图像进行篡改之后,为了掩盖篡改痕迹,通常会用JPEG压缩和高斯模糊等操作降低图像的清晰度。为了对模型进行鲁棒性测试,分别从CASIA2.0和NIST2016数据集中随机抽取了20 % 的图像,然后对抽取出来的图像进行JPEG压缩和高斯模糊处理;为了验证本文方法的优越性,选取了U-Net和RRU-Net这两个性能较好的模型与本文方法进行比较。

分别用20、40、60、80和100这5种不同的质量因子对图像进行JPEG压缩处理。质量因子越小图像越模糊。分别用1、3、5、7、9这5种不同尺寸的高斯核对图像进行高斯模糊处理,高斯核尺寸越大图像越模糊。

鲁棒性测试结果如图 6所示。对于JPEG压缩处理,3个模型的F1值都随着质量因子的降低而有不同程度的下降。在CASIA2.0上,RRU-Net的稳定性差。在NIST2016数据集上,U-Net的效果较差。对于高斯模糊处理,3个模型的F1值随着高斯核的增大而减少。同样,在CASIA2.0上,RRU-Net的检测效果不佳。在NIST2016数据集上,U-Net的结果较差。在应对JPEG压缩和高斯模糊这两种攻击时,本文模型的F1值一直维持在一个较高的水平,在两个数据集上的平均F1值最高,鲁棒性最佳。

图 6 鲁棒性测试图
Fig. 6 Robustness test
((a)F1 value of jpeg compression on the CASIA2.0;(b)F1 value of jpeg compression on the NIST 2016; (c)F1 average value of jpeg compression on the CASIA2.0 and NIST 2016; (d)F1 value of gaussian blur on the CASIA2.0; (e)F1 value of gaussian blur on the NIST 2016; (f)F1 value of gaussian compression on the CASIA2.0 and NIST 2016)

2.3.3 消融实验

本文方法较其他方法的优势在于对图像的异常区域进行特征增强并且提出区域损失解决篡改区域较小的问题。为了验证这两个机制的有效性,本文通过设置消融实验对比不同模型的F1值,定量验证结果如表 3所示。

表 3 消融实验结果
Table 3 F1 score of ablation study

下载CSV
CASIA2.0 NIST2016 COLUMBIA COVERAGE
第1阶段(无区域损失) 无图像处理 0.956 1 0.967 8 0.992 9 0.973 3
图像异常区域特征增强 0.962 6 0.975 3 0.992 9 0.976 8
第2阶段(区域损失) 无图像处理 0.977 3 0.974 9 0.995 7 0.981 5
图像异常区域特征增强 0.979 5 0.982 2 0.996 0 0.983 6
注:加粗字体表示每种情况的最优值。

分析表 3中的数据可以看出,具有异常区域特征增强机制的方法在4个数据集上的$ \rm{F1}$值均有提升。对于篡改区域过小的问题,使用区域损失的模型在4个数据集上的F1值均有提升;此外,在篡改区域占比最小的CASIA2.0数据集上F1值提升最多,这进一步说明了区域损失能够较好地解决篡改区域过小产生的样本不平衡问题,且篡改区域占比越少,性能提升越明显。

3 结论

本文提出了基于区域损失的U型篡改区域检测网络。该方法主要解决现有的基于卷积神经网络的方法在特征增强和篡改区域过小上的问题。本文方法利用局部特征与显著特征的差值张量与升维后的图像拼接作为网络的输入,来增强图像异常区域的特征;同时利用区域损失机制增强对篡改区域框内特征的学习,一定程度上缓解了正负样本比例不平衡的问题。由实验结果可以看出,本文方法的网络性能明显高于其他方法;对JPEG压缩和高斯模糊这两种常见的掩盖篡改痕迹的方法,展现出了更强的鲁棒性;本文方法中的图像异常区域特征增强机制和区域损失机制能有效提高模型的性能。

本文利用区域损失来解决篡改区域过小的问题。这个方法有效的原因有两个: 1)在第1阶段训练之后得到的模型精确度较高,能够在第2阶段训练时定位到篡改区域;2)图像的篡改区域都是集中的,可以找到正负样本比例较为平衡的篡改区域框。目前出现的图像篡改数据集中的图像数量较少,缺少像ImageNet那样图像数量庞大的数据集,这导致大多数模型的泛化能力都不强。需要大的图像篡改数据集构建泛化能力更强的网络模型。本文只选取一个篡改区域框对于篡改区域小而分散的图像篡改数据集的提升效果有限。未来工作中,将继续研究如何构建泛化能力更强的网络模型和解决篡改区域分散的问题。

参考文献

  • Amerini I, Ballan L, Caldelli R, Bimbo A, Tongo L, Serra G. 2013. Copy-move forgery detection and localization by means of robust clustering with J-Linkage. Signal Processing: Image Communication, 28(6): 659-669 [DOI:10.1016/j.image.2013.03.006]
  • Ardizzone E, Bruno A, Mazzola G. 2015. Copy-move forgery detection by matching triangles of keypoints. IEEE Transactions on Information Forensics and Security, 10(10): 2084-2094 [DOI:10.1109/TIFS.2015.2445742]
  • Bahrami K, Kot A C, Li L D, Li H L. 2015. Blurred image splicing localization by exposing blur type inconsistency. IEEE Transactions on Information Forensics and Security, 10(5): 999-1009 [DOI:10.1109/TIFS.2015.2394231]
  • Bi X L, Wei Y, Xiao B and Li W S. 2019. RRU-Net: the ringed residual U-Net for image splicing forgery detection//Proceedings of 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops. Long Beach, USA: IEEE: 30-39 [DOI: 10.1109/CVPRW.2019.00010]
  • Bondi L, Lameri S, Güera D, Bestagini P, Delp E J and Stefano T. 2017. Tampering detection and localization through clustering of camera-based CNN features//Proceedings of 2017 IEEE Conference on Computer Vision and Pattern Recognition Workshops. Honolulu, USA: IEEE: 1855-1864 [DOI: 10.1109/CVPRW.2017.232]
  • Chen M, Fridrich J, Goljan M, Lukas J. 2008. Determining image origin and integrity using sensor noise. IEEE Transactions on Information Forensics and Security, 3(1): 74-90 [DOI:10.1109/TIFS.2007.916285]
  • Cozzolino D, Poggi G and Verdoliva L. 2017. Recasting residual-based local descriptors as convolutional neural networks: an application to image forgery detection//Proceedings of the 5th ACM Workshop. Philadelphia, USA: ACM: 159-164 [DOI: 10.1145/3082031.3083247]
  • Dong J, Wang W and Tan T N. 2013. CASIA image tampering detection evaluation database//Proceedings of 2013 IEEE China Summit and International Conference on Signal and Information Processing. Beijing, China: IEEE: 422-426 [DOI: 10.1109/ChinaSIP.2013.6625374]
  • Fridrich J, Kodovsky J. 2012. Rich models for steganalysis of digital images. IEEE Transactions on Information Forensics and Security, 7(3): 868-882 [DOI:10.1109/TIFS.2012.2190402]
  • Fridrich A J, Soukalm B D and Lukáš A J. 2003. Detection of copy-move forgery in digital images//Proceedings of Digital Forensic Research Workshop. Cleveland, USA: [s. n. ]: 19-23
  • Gou H M, Swaminathan A and Wu M. 2007. Noise features for image tampering detection and steganalysis//Proceedings of 2007 IEEE International Conference on Image Processing. San Antonio, USA: IEEE: VI-97-VI-100 [DOI: 10.1109/ICIP.2007.4379530]
  • Guan H Y, Lee Y Y, Yates A, Delgado A, Zhou D, Joy D and Pereira A. 2016. NIST nimble 2016 datasets[DB/OL]. [2021-5-20]. https://www.nist.gov/itl/iad/mig/open-media-forensics-challenge
  • Hsu Y F and Chang S F. 2006. Detecting image splicing using geometry invariants and camera characteristics consistency//Proceedings of 2006 IEEE International Conference on Multimedia and Expo. Toronto, Canada: IEEE: 549-552 [DOI: 10.1109/ICME.2006.262447]
  • Johnson M K, Farid H. 2007. Exposing digital forgeries in complex lighting environments. IEEE Transactions on Information Forensics and Security, 2(3): 450-461 [DOI:10.1109/TIFS.2007.90384]
  • Li G H, Wu Q, Tu D and Sun S J. 2007. A sorted neighborhood approach for detecting duplicated regions in image forgeries based on DWT and SVD//Proceedings of 2007 IEEE International Conference on Multimedia and Expo. Beijing, China: IEEE: 1750-1753 [DOI: 10.1109/ICME.2007.4285009]
  • Liu Q G, Cao X C, Deng C, Guo X J. 2011. Identifying image composites through shadow matte consistency. IEEE Transactions on Information Forensics and Security, 6(3): 1111-1122 [DOI:10.1109/TIFS.2011.2139209]
  • Li Y Z, Hu J, Niu S Z, Meng X Z, Zhu Y L. 2011. Blind digital image forensics based on the light direction inconsistent. Journal of Beijing University of Posts and Telecommunications, 28(03): 26-30 (李叶舟, 胡静, 牛少彰, 孟宪哲, 朱艳玲. 2011. 基于图像背景噪声特性的篡改检测. 信号处理, 28(09): 1299-1307)
  • Luo W Q, Huang J W and Qiu G P. 2006. Robust detection of region-duplication forgery in digital image//Proceedings of the 18th International Conference on Pattern Recognition. Hong Kong, China: IEEE: 746-749 [DOI: 10.1109/ICPR.2006.1003]
  • Lu Y F, Ju Y L, Yu Y. 2012. Tamper detection based on the image background noise characteristics. Journal of Signal Processing, 28(09): 1299-1307 (卢燕飞, 鞠娅莉, 于跃. 2012. 基于图像背景噪声特性的篡改检测. 信号处理, 28(09): 1299-1307) [DOI:10.3969/j.issn.1003-0530.2012.09.013]
  • Mahdian B, Saic S. 2009. Using noise inconsistencies for blind image forensics. Image and Vision Computing, 27(10): 1497-1503 [DOI:10.1016/j.imavis.2009.02.001]
  • Pan X Y, Zhang X and Lyu S W. 2011. Exposing image forgery with blind noise estimation//Proceedings of the 13th ACM Multimedia Workshop on Multimedia and Security. New York, USA: ACM: 15-20 [DOI: 10.1145/2037252.2037256]
  • Popescu A C and Farid H. 2004. Exposing Digital Forgeries by Detecting Duplicated Image Regions. Technical Report TR2004-515. Dartmouth College
  • Rao Y and Ni J Q. 2016. A deep learning approach to detection of splicing and copy-move forgeries in images//Proceedings of IEEE International Workshop on Information Forensics and Security. Abu Dhabi, United Arab Emirates: IEEE: 1-6 [DOI: 10.1109/WIFS.2016.7823911]
  • Ronneberger O, Fischer P and Brox T. 2015. U-Net: convolutional networks for biomedical image segmentation//Proceedings of the 18th International Conference on Medical Image Computing and Computer-Assisted Intervention. Munich, Germany: Springer: 234-241 [DOI: 10.1007/978-3-319-24574-4_28]
  • Wang W H and Farid H. 2007. Exposing digital forgeries in video by detecting duplication//Proceedings of the 9th Workshop on Multimedia and Security. Dallas Texas, USA: ACM: 35-42 [DOI: 10.1145/1288869.1288876]
  • Wen B H, Zhu Y, Subramanian R, Ng T T, Shen X J and Winkler S. 2016. COVERAGE — A novel database for copy-move forgery detection//Proceedings of 2016 IEEE International Conference on Image Processing. Phoenix, USA: IEEE: 161-165 [DOI: 10.1109/ICIP.2016.7532339]
  • Wu Y, AbdAlmageed W and Natarajan P. 2019. ManTra-Net: manipulation tracing network for detection and localization of image forgeries with anomalous features//Proceedings of 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Long Beach, USA: IEEE: 9535-9544 [DOI: 10.1109/CVPR.2019.00977]
  • Zhang X Q, Wang J X, Wang T, Jiang R H. 2021b. Hierarchical Feature Fusion with Mixed Convolution Attention for Single Image Dehazing. IEEE Transactions on Circuits and Systems for Video Technology, 99: 1-1 [DOI:10.1109/TCSVT.2021.3067062]
  • Zhang X Q, Wang T, Jiang R H, Zhao Li, Xu Y W. 2021a. Multi-Attention Convolutional Neural Network for Video Deblurring. IEEE Transactions on Circuits and Systems for Video Technology, 99: 1-1 [DOI:10.1109/TCSVT.2021.3093928]
  • Zhang Y, Goh J, Win L L and Thing V. 2016. Image region forgery detection: a deep learning approach//Proceedings of the Singapore Cyber-Security Conference. Amsterdam: IOS Press: 1-11 [DOI: 10.3233/978-1-61499-617-0-1]
  • Zhou P, Han X T, Morariu V I and Davis L S. 2018. Learning rich features for image manipulation detection//Proceedings of 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Salt Lake City, USA: IEEE: 1053-1061 [DOI: 10.1109/CVPR.2018.00116]