Copy Move Forgery Detection using DWT and SIFT Features Mohammad Farukh Hashmi', Aaditya R. Hambarde2, Avinash G. Keskar3 1,2,3 Department of Electronics Engineering, Visvesvaraya National Institute of Technology, Nagpur, India '
[email protected], 2adihambarde
[email protected], 3
[email protected]
Abstract-
Powerful image editing tools like Adobe Photoshop
etc. are very common these days. However due to such tools
tampering of images has become
very easy. Such tampering
with digital images is known as image forgery. The most common type of digital image forgery is known as copy-move forgery wherein a part of image is cut/copied and pasted in another area of the same image. The aim behind this type of forgery may be to hide some particularly important details in the image. A method has been proposed to detect copy-move forgery in images. We have developed an algorithm of image-tamper detection based on the Discrete Wavelet Transform i.e. DWT. DWT is used for dimension reduction, which in turn increases the accuracy of results. First DWT is applied on a given image to decompose it into four parts LL, LH, HL, and HH. Since LL part contains most of the information, SIFT is applied on LL part only to extract the key features and find descriptor vector of these key features and then find similarities between various descriptor vectors to conclude that the given image is forged. This method allows us to detect whether image forgery has occurred or not and also localizes the forgery i.e. it tells us visually where the
used to alter the content of an image [14]. Usually the forger forges the image with an intention of hiding some object by covering it with an image segment that is copied from the same image. For instance if there is a single flower in a rose plant image, forger copy pastes the same rose to different branches to enhance the beauty of the image. A popular example of copy- move forgery is shown in figure 1. In the original image, there were just 3 missiles. This image was manipulated to show 4 missiles by copying and pasting one of the missiles in the same image. Since the image-patch comes from the same image, the colour-palette and noise components are mostly similar to the original image. A common assumption while formulating any algorithm is that the forged pari is a connected component rather than an amalgamation of individual paris or pixels. Requirements of a good detection algorithm are: 1.
copy-move forgery has occurred.
2. Keywords- Tampering, Digital image forgery, DWT, SIFT, Key points.
I.
INTRODUCTION
Since the invention of photography, images have been retouched and manipulated. In the last decade large amount of digital image data was manipulated in papers, tabloids, fashion magazines, court room videos etc. Detection of image forgery is a challenging task due to various methods of tampering the image and a large number of distinct image capturing devices available. Most of the forgery detection techniques are categorized into two major categories: active and passive. Active methods, also known as non-blind/intrusive methods, require some information to be embedded in the original image when. Due to this pre-requisite, active methods have limited scope. Some of the examples of these methods are watermarking and use of digital signature of the camera. Passive methods, also known as non-intrusive/blind methods, don't require any information to be embedded in the digital image. A digital image can be forged by applying various transformations like that of rotation, scaling, resizing, addition of noise, blurring, compressing etc. Copy-Move forgery is a distinct type of image forgery. The ease and effectiveness of copy-move forgery makes it the most common forgery that is
978-1-4799-3516-1113/$31.00 ©2013 IEEE
188
The algorithm must detect an approximate match between small image patches. It must not be computationally complex and must detect a forged image correctly as forged and an authentic image correctly as authentic (i.e. it should have high values of sensitivity and specificity).
Fig. I Example of Copy-Move Forgery
II.
RELATED WORK
The distinctive feature of copy-move forgery is that the copied patch and the pasted patch are the same. Hence one method of forgery detection is exhaustive search [15]. However this method is not feasible due to its computational complexity. However the correlation introduced between the copied and pasted area is the basis of most detection algorithms. We here
discuss only passive detection algorithms [12]. Fridrich et al. [5] introduced a block matching method based on Discrete Cosine Transform (DCT). In this method, the image was divided into overlapping blocks and quantized DCT coefficients of image blocks were used as features. Lexicographical sorting was then performed and copied regions were outputted, based on the similarity of features. Major advantage of using DCT is that most of the energy is concentrated in a few DCT coefficients. Popescu et al. [4] proposed a similar method as that of Fridrich's. This method utilized Principal Component Analysis (PCA) for dimension reduction. Number of features generated is half of that of Fridrich's. Drawback of this method is that it fails when the copied region is re-sampled through rotation or scaling. Li et al. [6] devised a sorted neighborhood method based on Discrete Wavelet Transform (DWT) and application of Singular Value Decomposition (SVD). Though the overall process speeds up due to reduction in dimension by DWT, this method is very computationally complex since calculation of SVD takes a lot of time. Hao-Chiang Hsu et al. [lO] proposed copy-move forgery detection by detecting the similarity using feature extraction by Gabor filter. Leida Li et al. [8] devised a method for copy-move forgery detection using Local Binary Patterns. M.Qiao et al. [9] used curvelet statistics for detection of copy-move forgery after dividing the image into several overlapping blocks. Local visual features like SURF, SIFT, GLOH are robust to several geometrical transformations like rotation, occlusions, clutter and scaling. Hence they are being extensively used for image forgery detection. Hwei-Jen Lin et al. [11] proposed fast copy move forgery detection using block based algorithm with radix sort for improving computational efficiency. But this algorithm is only suitable for resisting JPEG compression and Gaussian noise attacks. Amerini et al. [7], deals with detecting copy-move forgery using a SIFT based method. III.
vector into different frequency components. 'h' and 'g' denote low-pass and high-pass respectively. Output of low-pass filter (after factor 2 down-sampling) is the approximation coefficients and the output of high-pass filter (after factor 2 down-sampling) is the detail coefficients or wavelet coefficients. It is the output of the low-pass filter which is used for the next level of transform.
LL
HL
HH
SIFT Features
Extract Key features
Match repeating features
PROPOSED METHOD
What can be concluded from the above discussion is that primary advantage in using DWT is reduction in dimension(iess number of features) and the primary advantage in using SIFT is its robustness. The proposed method combines the two to give an optimal solution. The method can detect an image as forged even if the copied part is rotated or scaled and then pasted. First the test image is converted into grayscale format if it is in RGB format. DWT is applied on the image (up to level 1). The image gets divided in to 4 sub bands- LL, HH, LH and HL. We apply SIFT to the LL part only. We now perform a searching to search for occurrence of same features at different locations in the image. Image blocks that return similar SIFT features from all four images are marked as forged regions. The process block diagram is shown in figure 2.
A. Discrete Wavelet Transform (DWT) DWT is a linear transform that operates on vector whose length is an integer multiple of 2 while separating the data
Mark that region as forged
Fig.2 Block Diagram of the proposed method
The process of one dimensional DWT is shown in figure 3. Outputs of the 2 filters (after the down-sampling) are given by (1) and (2).
+00 h[n - 2 p]a. [n] a. [p] = I J J+ 1 n=-oo ] J+ 1 [p =
d.
(1)
+00
n - 2p]a. [n] I g[ J n=-oo
(2)
2-D DWT is similar to I-D DWT. DWT is performed first for all the image rows and then the image columns.
20J 3 J 3th International Conference on Intelligent Systems Design and Applications (ISDA)
189
space-scale function. The scale space is defined by (3).1 (x,y) Approximation coefficients
is the input image and
L(x,y,O") x [nl
=
G(x,y,
0"
G(x,y, )
*
0"
) is the Gaussian function.
l(x,y)
(3)
Detail coefficients
Key-points in the image are found by the Difference of Gaussian (DoG) technique. DoG is given by (4).
Fig.3 Process of 1-0 OWT
D(x,y, ROWS
0"
)
=
L(x,y, kO") - L(x,y,
0"
)
(4)
COLUMNS
IMAG E
LL
This function is compared with its eight neighbors on the same scale and with nine neighbors up one scale and down one scale. It is a point of extrema if it is minimum or maximum among all these values [18].
LH
2) HL
HH
Fig.4 OWT for an image
The 2-D DWT process is shown in figure 4.Wavelet decomposition up to 1 level is shown in figure 4. The image is reduced in to 4 sub-images at each level which are labeled as LL, HL, LH, and HH. Most of the data is concentrated in the LL sub-image and it is considered as the approximation of the image. It represents the coarse level coefficients of the original image. It is the LL sub-image which is decomposed in to four sub-images at the next level. Size of the image is reduced at every level by the DWT transform. This means a lesser data to compute since reduction in the size of the image at each level
Key-point Localization
This stage eliminates those key-points which have poor contrast. This is done by applying the Laplacian operator on the points found in the previous stage. If the value of this function lies below a certain threshold then this value is excluded. This eliminates points of low contrast. There is a large principle curvature across the edge but a small curvature in a perpendicular direction in DoG function [2, 18]. The 2 x 2 Hessian matrix at the location is calculated and the ratio of the largest to smallest Eigen vector obtained is calculated. If the difference be less than this ratio, that particular key-point is eliminated.
3)
Assignment of orientation
is achieved. For example, a square image of size 2n X 2n is
In this step every key-point is assigned an orientation based on the local image properties. The steps are as follows: I. Calculate the Gaussian smoothed image L by the scale function described above. 11. Calculate the magnitude gradient m and the orientation 8 as in (5) and (6).
reduced to a size of 22 X 2 2 at the next level. Haar DWT was used in the proposed method [3].
m(x,y) �(L(x+I,y)-L(x _1,y))2 +(L(x,y+I)-L(x,y _1))2
n
B.
n
=
Scale Invariant Feature Transform (SIFT)
In any image there are a lot of points of interest which can be extracted to provide feature description of the image. The SIFT algorithm can be used to locate a particular object in an image which contains many different objects. SIFT algorithm provides a set of features which do not get modified even by scaling or rotation. Another distinct advantage is that the SIFT is very resilient to noise in the image. A four stage filtering approach is used in the SIFT algorithm [1].
1)
Space Scale Extrema Detection
8(x, y) iii.
=
tan
_I(L(X, y+I)-L(x, y-I)) L(x+l,y)-L(x-I,y)
(6)
An orientation histogram is formed from gradient orientations of sample points. Peaks in histogram are located and using these peaks and any other peaks 0.8 times those of the highest peak are used to create an orientation.
It is possible that a key-point may be assigned multiple orientations.
In this step points which can be identified from different views are located. The most efficient way is by using a Gaussian
190
(5)
2013 13th International Conference on Intelligent Systems Design and Applications (ISDA)
4) Key-point Descriptor Key-point descriptors are also created by using the local gradient data used above. The gradient information is rotated so as to align it with the orientation of the key point and then weighted by a Gaussian function of variance 1.5*key-point scale [13]. This is used to create a set of histograms over a square whose center is the key point. Usually a set of 16 histograms each with 8 elements is used by the key point descriptors. This results in the feature vectors having 128 elements. These feature vectors are then used to identify possible objects in the digital image. IV.
ability of the algorithm to detect a forged image correctly as forged. Specificity relates to the ability of the algorithm to identify an authentic image correctly as authentic. Hence a high value of sensitivity and specificity imply better performance of the system. .. .
sensltlVlty =
ifi
TP
TN
.
specl lClty = ---TN P TP+TN - - - -- -+FP+TP+FN
100 images were tested in MATLAB using the proposed method. 50 of the images were forged and 50 were original. The algorithm was tested and verified using the database of MICC-F220 [7]. Figure 5 describes various steps in the proposed algorithm.
P F R
=
FNR
=
(10)
1- sensitivity (FNR: False Negative Rate)
(11)
RESULTS OF THE PROPOSED METHOD
Number of authentic ima�es
Number of forged ima�es
TP
TN
FP
FN
50
50
46
48
2
4
5(b)
D; .
,
5(d)
Fig. 5(a) Original image, 5(b) Forged image, 5(c) DWT of the test image, 5(d) Matching of similar features
For the image shown in figure 5, 325 key-points were found and a total of 22 matching features were detected. The time required for computation was 2.893 seconds. It was found that smaller the size of the test image and the copied part, lesser were the number of features found. Time required for computation of different test images was found to be different and the average time centered around 2s. Here we define a few terms: TP (True Positive): Forged image identified as forged FP (False Positive): Authentic image identifies as forged TN (True Negative): Authentic image identified as authentic FN (False Negative): Forged image identified as authentic
(9)
1- specificity (FPR: False Positive Rate)
TABLE I.
5(c )
(8)
+F
- -accuracy = TN
RESULTS AND DISCUSSIONS
5(a)
(7)
TP+FN
PERFORMANCE OF THE PROPOSED METHOD
TABLE II.
Sensitivity (%)
Specificity (%)
Accuracy (%)
FPR(%)
FNR(%)
92
96
94
4
8
(7) to (11) give the definitions of performance parameters and the following tables present the results obtained and values of the system performance parameters. Robustness of the algorithm was checked by testing images where the copied part was rotated or scaled or both and then pasted. Images tested with various attacks and the results obtained are demonstrated in figure 6. Table III gives the key-points, matches detected and time required for computation with different types of attacks.
TABLE TIT.
Type of attack Without rotation or scaling Scaling Rotation Rotation and scaling
DIFFERENT ATTACKS ON THE [MAGE
Number of Keypoints found
Number of matches detected
Computation time(s)
366
28
0. 7 7
381
19
0.88
370
20
1.04
380
22
0.84
Performance of any system can be measured in terms of sensitivity, specificity and accuracy. Sensitivity relates to the
20J 3 J 3th International Conference on Intelligent Systems Design and Applications (ISDA)
191
method proposed by Popescu-2004[4] managed an accuracy of around 90% for a tampered block size of 128x128 in an image of size 512x512 and JPEG quality factor of 85.Li2009[ 17] was able to manage an accuracy of 47.21%. However this low value of accuracy was compensated by high values of sensitivity and specificity. The proposed method achieved an accuracy of 94% over 100 images. It has to be noted that the proposed method is for detection of copy-paste forgery only.
Fig.6a Without Rotation or Scaling
100 90 80 70 60 50 • Accuracy
40 30 20 10 Fig.6b Scaling attack
o Zhang
A
:/..'
.
Li
Proposed
Fig.7 Comparison with existing methods
'. ·1"'. -
�·t: :: t" ,," .'
Popescu
&:
.
��
V.
'
.,_-.2
.
:-
. ,. ,
. �-
Fig.6c Rotation attack
Fig.6d Rotation and scaling attack
CONCLUSION
Different methods of image forgery were studied. Previous algorithms for copy-paste forgery detection were reviewed. The proposed method uses both DWT and SIFT. DWT reduces the image data and further process only relevant information (low frequency information). Robustness was introduced by SIFT. Hence the proposed algorithm detects image forgery even if the copied part is rotated/scaled and then pasted. Overall accuracy was found to be 94% with a database of 100 images (50 authentic and 50 forged images). The proposed method gave reasonable values of sensitivity and specificity. Robustness of the algorithm was checked with the MICC-F220 database. Robustness of the proposed algorithm was checked by testing tampered images where the copied part is rotated or scaled and then pasted. The proposed method was compared with the existing methods and gave higher accuracy than the existing methods. Less time was required for computation and hence it can be deduced that the computational complexity was reduced. In further course of work, we would like to compare the performance parameters of the proposed method with the existing method. ACKNOWLEDGEMENTS
Further a comparative study is presented in figure 7. Some key algorithms and their draw-backs have been discussed in the previous sections. Accuracy of various methods and the proposed method was compared. Zhang-2008[16] achieved an accuracy of 77.32% with the tampered region size 64x64. The
192
We thank Dr. R.B.Deshmukh, the coordinator of TEQIP-II and Dr. Narendra S. Chaudhari, Director, VNIT, Nagpur for providing us with the needed administrative and financial support.
20J 3 J 3th International Conference on Intelligent Systems Design and Applications (ISDA)
REFERENCES
[I]
Lowe,
David
G.,
"Distinctive image features from scale-invariant
keypoints", International journal of computer vision, vol. 60, no. 2, pp. 91-110, 2004. [2]
Lowe,
David
G.,
"Distinctive image features from scale-invariant
keypoints", International journal of computer vision, vol. 60, no. 2, pp. 91-110, 2004. [3]
Haar,
Alfred.
"Zur
theorie
der
orthogonalen
funktionensysteme."
Mathematische Annalen vol. 69, no. 3, pp. 331-371, 1910. [4]
Popescu, A1in c., and Hany Farid, "Exposing digital forgeries by detecting duplicated image regions", Department of Computer Science, Dartmouth College, Technical Report. TR2004-515, August 2004.
[5]
Fridrich, A. Jessica, B. David Soukal, and A. Jan Lukas, "Detection of copy-move
forgery
in digital
images",
In
Proceedings
of
Digital
Forensic Research Workshop. , Cleveland, OH, USA, pp. 55-61, August 2003. [6]
Li,
Guohui,
Qiong
Wu,
Dan
Tu,
and
Shaojie
Sun.
"A
sorted
neighbourhood approach for detecting duplicated regions in image forgeries
based
on
DWT
and
SVD",
In
Proceedings
of
IEEE
International Conference on Multimedia and Expo., pp.1750-1753,2007. [7]
Amerini, Irene, Lamberto Balian, Roberto Caldelli, Alberto Del Bimbo, and Giuseppe Serra. "A sift-based forensic method for copy-move attack detection and transformation recovery", IEEE Transactions on Information Forensics and Security, vol. 6, no. 3 ,pp. 1099-1110, 2011.
[8]
Li, Leida, Shushang Li, Hancheng Zhu, Shu-Chuan Chu, Roddick, and
John F.
Jeng-Shyang Pan. "An Efficient Scheme for Detecting
Copy-move Forged Images by Local Binary Patterns.",
Journal of
Information Hiding and Multimedia Signal Processing, vol. 4, no. I,pp. 15-56, January 2013. [9]
Qiao, Mengyu, Andrew Sung, Qingzhong Liu, and Bernardete Ribeiro. "A novel approach for detection of copy-move forgery." In proceedings of Fifth International Conference on Advanced Engineering Computing and Applications in Sciences (ADVCOMP 2011), pp. 44-47, 2011.
[10] Hsu, Hao-Chiang, and Min-Shi Wang. "Detection of copy-move forgery image using Gabor descriptor." In proceedings of IEEE International Conference on Anti-Counterfeiting, Security and Identification (ASlD2012), pp. 1-4, 2012. [II] Lin, Hwei- Jen, Chun-Wei Wang, and Yang-Ta Kao. "Fast copy-move forgery detection." WSEAS Transactions on Signal Processing, vol. 5, no. 5, pp. 188-197, 2009. [12] Bayram, Sevinc, Husrev Taha Sencar, and Nasir Memon. "A survey of copy-move forgery detection techniques." In Proc. of IEEE Western New York Image Processing Workshop, pp. 538-542. 2008. [13] Gilani, S. Asif M. "Object Recognition by Modified Scale Invariant Feature Transform." In Proc. of Third IEEE International Workshop on Semantic Media Adaptation and Personalization (SMAP-2008), pp. 3339, 2008. [14]
Jing, Li, and Chao Shao. "Image Copy-Move Forgery Detecting Based on Local Invariant Feature." Journal of Multimedia vol. 7, no. I, pp.9097, 2012.
[15] Yadav, Preeti, and Yogesh Rathore. "Detection of Copy-Move Forgery of Images Using Discrete Wavelet Transform." International Journal on Computer Science and Engineering, vol. 4, no. 4, pp.365-370, April 2012. [16]
Zhang,
Jing, Zhanlei Feng, and Yuting Suo "A new approach for
detecting copy-move forgery in digital images." In Proc. of J J th
iEEE Singapore international Conference on Communication Systems (iCCS 2008), pp. 362 - 366, 19-21 Nov2008.
[17] Li, Weihai, Yuan Yuan, and Nenghai Yu. "Passive detection of doctored JPEG image via block artifact grid extraction." Signal Processing, vol. 89, no. 9, pp. 1821-1829, September 2009. [18] Badrinath, G. S., and Phalguni Gupta. "Palmprint verification using sift features." In Proc. of IEEE First Workshops on Image Processing Theory, Tools and Applications (lPT A2008), pp. 1-8, 2008.
20J 3 J 3th International Conference on Intelligent Systems Design and Applications (ISDA)
193