You are on page 1of 7

2016 8th International Congress on Ultra Modern Telecommunications and Control Systems and Workshops (ICUMT)

Perceptual Image Hashing Using SVD Based Noise


Resistant Local Binary Pattern
Syed Qasim Abbas Nataša Živić
Fawad Ahmed Obaid Ur-Rehman
Department of Electrical Engineering Department of Electrical Engineering
HITEC University, Taxila & Computer Science
Email: {qasim.abbas, fawad}@hitecuni.edu.pk University of Siegen
Hoelderlinstrasse 3, 57076 Siegen, Germany
Email: {natasa.zivic, obaid.ur-rehman}@uni-siegen.de

Abstract—Image hashing has become a major research area measures such as normalized Hamming distance, Euclidean
due to rapid growth of image alteration techniques that can distance, correlation coefficient, etc. [3]–[5]. The tamper de-
tamper digital images. The major concern of all image hashing tection capability means that perceptually different images
schemes is the selection of robust features. Local Binary Pattern
(LBP) is a technique that selects robust features for different must be separately distinguished and a minor manipulation
image applications. This paper presents a perceptual image in an image must change the corresponding hash values
hashing scheme by the utilization of Noise Resistant Local Binary significantly.
Pattern (NRLBP), a modified form of the LBP. The features One of the challenging tasks in a PIH scheme is the
of NRLBP are extracted from non-overlapping blocks of a selection of suitable features that are used in hash formation.
gray scale image. The NRLBP is combined with Singular Value
Decomposition (SVD) to provide good robustness characteristics The properties of the selected features have a significant
against a number of non-malicious distortions. Another major impact on the robustness and tamper detection capability of a
advantage of the proposed scheme is to detect localized tampered hashing scheme. Monga et al. [4] have used the non-negative
regions. Experimental results exhibit that the proposed scheme matrix factorization (NMF) vectors to calculate the hash of
has the capability to detect tampering as small as 3% of the image an image. The utilization of NMF provides good robustness
size and at the same time offers good robustness properties.
characteristics but may not be able to detect minute level of
Index Terms—Robust hash, perceptual image hashing, local tampering due to robustness of NMF vectors. Venkatesan et al.
binary pattern, singular value decomposition [6] have proposed an image hashing scheme using the wavelet
transform. This scheme is resilient to a number of content
I. I NTRODUCTION preserving manipulations, for example, JPEG compression,
With speedy development of image modification techniques, filtering, rotation, scaling and cropping. It is not clear whether
it has now become easy to tamper digital images. To counter small tampering within an image can be detected using this
this problem, Perceptual Image Hashing (PIH) techniques technique. Zhao et al. [7] uses global and local features to
can be used to validate image integrity. Conventionally, data generate the hash of an image. Zernike moments are used
integrity is provided by cryptographic hashing schemes. Cryp- as global features, while position and texture information of
tographic hashing schemes are however not appropriate for im- an image’s salient regions are used as local features. This
age integrity. The reason of non-compliance of cryptographic scheme can be used to detect localized forgery, including
hash functions with image integrity is its sensitivity to a single colour modification, however, the accuracy of tamper detection
bit change in the input data. This implies that two data streams greatly depends on the algorithm used for saliency detection.
with a single bit difference will produce a hash value with a The results reported in [7] reveals that this scheme requires
large Hamming distance. Images normally suffer from content further enhancement to detect minute level of tampering.
preserving manipulations and hence traditional cryptographic Recently, Davarzani et al. [5], [8] have proposed PIH
hash functions, such as SHA-1 [1], will not generate identical schemes using SVD based Center Symmetric Local Binary
hash values for similar visual images [2]. Pattern (CSLBP). The CSLBP is a modified form of the LBP
Feature extraction is the fundamental step in hash generation which was originally proposed by Ojala et al. [9] for texture
and selection of suitable features is a challenging task. The classification. The problem with CSLBP features is its weak
performance of any PIH scheme heavily depends upon the trade-off between robustness and tamper detection. For this
selected features; the more robust the features are, the more reason, it is not possible to detect small tampering in an image
efficient the hashing scheme would be. The performance of using CSLBP. Davarzani et al. [5], [8] notified in their work
a PIH scheme is evaluated under two distinct criterion, i.e., that the minimum tampered area must be 10% of the original
robustness and tamper detection capability. Robustness means image to successfully detect tampering. This, therefore limits
that perceptually similar images must have comparable hash the application of the schemes proposed in [5], [8] to detect
values. The comparison of hash values is performed by using tampering in an image area less than 10%. Chen et al. [10]

978-1-4673-8818-4/16/$31.00 ©2016 IEEE 401 ISSN: 2157-023X


of size 3 × 3 pixels. The pixel under consideration, Ic is
subtracted from each neighbouring pixel, Ip one by one in a
clock-wise order. Every subtracted value is thresholded using
Eq. 1 to get a binary number anp . The value of n is 8 because
the window size is 3 × 3, the parameter d is equal to Ic − Ip .
In [11], the value of the threshold, t is taken as 2 and 10. Let
the 8-bit NRLBP code (RN RLBP ) starting from the MSB is
represented as RN RLBP = { a87 , a86 , a85 , a84 , a83 , a82 , a81 , a80 }.

⎨ 1 if d ≥ t;
anp = X if |d| < t; (1)

0 if d ≤ −t.

The second condition  X  in Eq. 1 represents an uncertain


bit. The uncertain bit is later judged after computing all other
neighbouring bits. The value assigned to an uncertain bit will
either be 1 or 0, and is in such a way as to form a uniform
code pattern. A code pattern is said to be a uniform pattern
if uniformity measure of that pattern is less than ’3’ [12].
The uniformity measure is defined as the number of binary
bit transitions available in a pattern in a circular order. For
example, the binary pattern ‘11111111’ is uniform because it
has no binary bit transitions and has a uniformity measure of
0. While the pattern ‘11001100’ has 4 binary transitions and
the uniformity measure is 4, and is thus categorized as a non-
Fig. 1. The 58 uniform code patterns [12]. uniform pattern. There are 58 unique uniform LBP patterns
as shown in Fig. 1 [12]. A white circle in Fig. 1 represents 1
and a black circle represents 0. For example, the first (top left
have used block truncation coding and CSLBP to generate corner) pattern in Fig. 1 represents the binary code ‘11111111’
image hash. The results presented in [10] reveals that this and the last pattern represents the binary code ‘00000000’. It
scheme does not have high robustness. Further, the tamper is important to note that all the 58 patterns shown in Fig. 1
detection capability has not been demonstrated. have a maximum of only 2-bit transitions in a circular order.
In this paper, the NRLBP technique is used to generate the As we move from the first pattern to the last pattern column-
hash of an image. The proposed hashing scheme is capable wise, the number of zeros are increased. In a particular row,
of detecting minute level tampering and at the same time the position of zeros changes, but the number of zeros remains
is robust to a number of content preserving manipulations. the same.
Though the NRLBP technique was proposed by Ren et al. The NRLBP histogram has 59 number of bins, where 58
for face recognition [11], its use in image hashing is very bins corresponds to uniform codes and the 59th bin is for the
effective as reported in this paper. The next section presents non-uniform code. The NRLBP algorithm generates binary bit
an overview of the NRLBP scheme. This is followed by the patterns that consists of either 1, 0, or an uncertain state X.
proposed algorithm. Section IV presents experimental results The uncertain bits are corrected to either 1 or 0 depending
and Section V concludes this paper. upon the overall 8-bit pattern. The NRLBP algorithm tries
to correct uncertain bits of RN RLBP in such a way as to
II. OVERVIEW OF NRLBP form a uniform 8-bit pattern. In a scenario, where a code
The NRLBP technique is very impressive in preserving the contains uncertain bits, the NRLBP algorithm will try to
local structure of an image in the presence of noise. The low generate all possible uniform codes. Consequently, all those
texture region available in an image contains pixel values that histogram bins corresponding to the generated uniform codes
1
are close to each other. A small noise added to these pixels will be incremented by number of unif orm codes generated .
changes their numerical values. The NRLBP has very good Let q be the total number of uncertain bits in RN RLBP code
performance in noisy environment by introducing the concept and z be the total number of uniform codes generated from
of uncertain bits [11]. A bit is termed as an uncertain bit if the an 8-bit RN RLBP code that contains uncertain bit(s) ’X’.
algorithm itself is not sure whether the bit is either ‘0’ or ‘1’. For example, the code 111XX000 has two uncertain bits
The algorithm assigns a special character ‘X’ for all such bits (q = 2) hence the uniform codes that are generated from it
and a correction algorithm is applied subsequently to judge the will be three (z = 3), 11111000, 11110000 and 11100000.
originality of such uncertain bits. For each pixel in an image, The increment in histogram bins corresponding to these three
an NRLBP code is obtained by considering a neighbourhood generated uniform codes will be 1/z (where z = 3). In

402
TABLE I
NRLBP H ISTOGRAM G ENERATION .

Algorithm 1
for All the pixels in an image
do
1. Compute 8-bit binary code (RN RLBP ) using Eq. 1.
2. Scan the RN RLBP code to calculate total number of
uncertain bits (q) in it.
3. Generate histogram
if q = 0 and the RN RLBP code is uniform;
Increment the corresponding uniform bin by 1.
else if q = 0 and the RN RLBP code is non-uniform; Fig. 2. SVD-NRLBP based Proposed Hashing Scheme.
Increment the 59th bin by 1.
else if q = 0
Compute the total number of the uniform codes (z) overlapping blocks of size 32× 32 pixels. The main advantage
that may be generated from the RN RLBP code. of using block-based approach is to localize tampered regions.
if z = 0 A Wiener filter is then applied to smooth each image block.
Increment the 59th bin by 1. The 32 × 32 blocks are further divided into 16 × 16 non-
else overlapping sub-blocks. The SVD transformation is applied to
Increment all uniform bins corresponding to the each sub-block to obtain the SVD decomposition given by Eq.
generated uniform codes by 1/z. 2.
(n) (n) (n)
end if SBm = Um Sm [Vm(n) ]T , (2)
end if
end for where, 1 ≤ m ≤ N , 1 ≤ n ≤ 4, N represents the total number
of image blocks of size 32 × 32 pixels, m is the image block
number under consideration and n represents a sub-block of
size 16 × 16 pixels within an image block m. Since each sub-
(n)
another case, when the RN RLBP code has some uncertain block SBm is of size 16 × 16 pixels, hence the size of U ,
bits in it, but it is not possible to generate even a single S and V is also 16 × 16. The matrices U and V contain
uniform code from it, then only the non-uniform bin (i.e. the orthonormal vectors, therefore, U U T = I, V V T = I. The
59th bin) is incremented by 1. For example, the RN RLBP matrix S is a diagonal matrix which contains singular values
code 11X0X100 cannot generate a uniform code, hence it is in the descending order of the corresponding sub-block. Let
(n) (n) (n) (n)
regarded as a non-uniform code and consequently the 59th umi and vmi be the ith column vectors of the Um and Vm
(n)
bin would be incremented by 1. The algorithm to generate matrices, respectively. The first column vector of the Um and
(n)
NRLBP code is given in Table I. To calculate an NRLBP code, Vm matrices of each sub-block are concatenated to form a
each pixel’s gray level is compared in a clockwise order with 16 × 8 SVD transformed block, Γm , given by Eq. 3.
it’s surrounding neighbours and the corresponding histogram (1) (2) (3) (4) (1) (2) (3) (4)
entries are increased. Γm = [um 1
, um 1
, um 1
, um 1
, vm 1
, vm 1
, vm 1
, vm 1
], (3)
Instead of directly applying NRLBP in the spatial domain, where superscripts of um and vm represents the sub-block
we apply NRLBP algorithm to the orthonormal vectors which (n)
number and can take the values 1, 2, 3 or 4. The matrices Um
are obtained by taking the SVD of the gray scale image under (n)
and Vm each has dimensions of 16×16 and at the same time
consideration. This increases the robustness of the hashing have orthonormal vectors. Only the first orthonormal vector of
scheme as demonstrated in [5]. The SVD decomposes a matrix dimension 16 × 1 corresponding to the highest singular value
into three different matrices termed as U , V and S. The diag- (n) (n)
is selected from each Um and Vm separately. Since the first
onal matrix S contains the singular values, while the matrices (n) (n)
column vector of each Um and Vm matrix corresponds to
U and V contain orthonormal vectors. In this paper, we show (n)
the highest singular value in Sm , hence the SVD transformed
that the fusion of SVD and NRLBP provide stable features that block would be less sensitive to non-malicious distortions [5].
are robust against content preserving manipulations and still As an example, the formation of the 16th SVD transformed
have the capability to distinguish minute malicious tampering block (m = 16) is illustrated in Fig. 3. The size of the SVD
in an image. transformed block (Γm ) is substantially reduced as compared
to the size of the original image block by utilizing the SVD
III. P ROPOSED A LGORITHM
decomposition. This dimensionality reduction approach further
The block diagram of the proposed scheme is shown in Fig. provides a robust structure of the block under consideration
2. An arbitrary input image is first converted into a gray scale and thus enhances the overall robustness of the proposed
image of size 256 × 256 pixels. It is then divided into non- hashing algorithm.

403
TABLE II
M INIMUM CORRELATION COEFFICIENT VALUE OF A BLOCK OUT OF ALL
THE 64 BLOCKS FOR THE C AMERAMAN IMAGE AND THE BABOON IMAGE
AFTER NON - MALICIOUS OPERATIONS .

Non-malicious Distortions Correlation


Coefficient
Cameraman Baboon
image image
JPEG Compression 0.8175 0.8558
at 10%
Gaussian Noise 0.8144 0.9390
Fig. 3. Example of an SVD transformed block showing the transformation m = 0, v = 0.0005
(n)
of the 16th image block. SBm represents 16 × 16 pixels sub-block.
Speckle Noise 0.8586 0.9182
Nv = 0.006
The NRLBP algorithm given in Table I is applied to the
Gaussian blurring 0.8365 0.8718
SVD transformed blocks. It has been observed after a lot
Fs = 11 × 11,
of experimentation with numerous images that the threshold
σ = 0.9
t should be selected as 0.01 for the NRLBP scheme. The
selection of a suitable threshold is very important because it Motion blurring 0.8188 0.8687
affects the robustness and tamper detection capability of the L = 4, θ = 0
proposed algorithm. If the value of t is increased, the number Gamma Correction 0.8302 0.8080
of uniform codes (z) generated by a single RN RLBP increases γ = 1.5
as well and hence the overall contribution of the individual
RN RLBP code is spread over large number of histogram bins. Scaling by 30% 0.7294 0.7213
This ultimately reduces the tamper detection capability of the
proposed scheme. Similarly, if the value of t is decreased, then
the RN RLBP code has less number of uncertain bits in it and
hence less number of uniform codes will be generated from
the RN RLBP code. Consequently, the selection of smaller two image blocks decreases. A suitable value of correlation
values of t reduces noise resistivity of the NRLBP scheme. coefficient needs to be identified between ‘0’ and ‘1’ to
By taking t = 0.01, maximum robustness and minute level differentiate malicious tampered image blocks from the non-
tamper detection capability is achieved. malicious image blocks. Let the value of r to distinguish
between malicious tampering and non-malicious distortions be
IV. E XPERIMENTAL R ESULTS represented by the threshold, tr . To successfully authenticate
A good PIH scheme needs to be robust against non- an input image, it is necessary that the value of r for each
malicious content preserving distortions and at the same time block is greater than tr .
should have the capability to detect any minute level of mali-
cious tampering. The non-malicious distortions may include, A. Tamper Detection
for example, lossy JPEG compression, additive noise, blurring, To demonstrate the tamper detection capability of the pro-
luminance changes, scaling, etc. In this paper, the normalized posed scheme, the Cameraman and Baboon images were taken
correlation coefficient has been used to differentiate between as a test case. These images are shown in Fig. 4a and Fig.
hash values obtained from two images [5]. The normalized 4d, respectively. In case of the Cameraman image, a minute
correlation coefficient, r is defined as: tampering in the lens of the camera was made as shown in
    
(Huv − μ )(Huv − μ ) Fig. 4b. In case of the Baboon image, the left eye ball was
u v
r =    , (4) tampered as shown in Fig. 4e. It is important to note that
(Huv
− μ ) 2  × 
(Huv − μ )2  both of these tampering accounts for approximately 3% of the
u v u v total image area. Both of these tampering were successfully
 detected as shown in Fig. 4c and Fig. 4f respectively. The value
where H is the hash vector of the original image block,
   of r for malicious tampering in case of the Cameraman image
μ is the mean value of H , H is the hash vector of the
  was 0.5237 and in case of the Baboon image was 0.5346.
query image block and μ is the mean value of H . It is
important to note that the size of hash vector is 1 × 59 for
B. Robustness
an arbitrary image block of size 32 × 32. Normally, the value
of r for two perceptually similar image block is close to 1, To demonstrate the robustness of the proposed algorithm,
and its value decreases as the perceptual similarity between the hash of an original image was compared with the hash of

404
(a) Cameraman Image. (b) Tampering is shown inside (c) Localized Tamper Detec-
the circle, Max. tampered area tion.
is approx. 3% of image.

(d) Baboon Image. (e) Tampering is shown inside (f) Localized Tamper Detection.
the circle, Max. tampered area
is approx. 3% of image.
Fig. 4. (a), (d) Original Image. (b), (e) Malicious tampered manipulations. (c), (f) Localized tamper detection.

the distorted version of the same image. The Cameraman im- value of r for all non-malicious content preserving distortions
age and the Baboon image were subjected to a number of con- is more than tr , indicating the robustness of the proposed
tent preserving distortions. These distortions are preservative scheme. Any value of r less than tr would indicate tampering.
Gaussian noise of mean (m) = 0 and variance (v) = 0.0005, D. ROC Curves
additive speckle noise of variance (Nv ) = 0.006, Gaussian
blurring of window size Fs = 11 × 11 and standard deviation To further evaluate the performance of the proposed scheme,
σ = 0.9, motion blurring with linear motion of camera by its ROC analysis is now presented. The term ROC stands for
L = 4 pixels and an angle of θ = 0o , gamma correction with Receiver Operating Characteristic and is a measure between
the value of γ = 1.5, image scaling by 30% to the original the false positive probability PF P and the false negative
image size and JPEG compression of 10%. The minimum probability PF N , while the threshold is varied. These two
value of r for a block out of all the 64 blocks for the probabilities are defined by Eqs 5 and 6, respectively [13].
Cameraman and Baboon images after applying non-malicious NAT
content preserving distortions are given in Table II. This result PF P = , (5)
NT
suggests that the value of tr should be less than 0.7213 to
NTA
positively authenticate these two images for the non-malicious PF N = . (6)
distortions under consideration. NA
In Eq. 5, NAT represents the total number of tampered image
C. Threshold Selection blocks detected as authentic, while N T represents the total
The minimum value of r for Cameraman and Baboon number of tampered image blocks. Similarly, in Eq. 6, NTA
images in case of non-malicious content preserving manipu- represents the total number of authentic image blocks detected
lations is 0.7213 while the value of r for malicious tampering as tampered and N A represents the total number of authentic
for both these images is 0.5237. It is quite evident that an image blocks.
impressive gap exists between malicious tampering and non- To calculate the false positive probability, the hash of each
malicious content preserving distortions. Hence, the selection of 32 × 32 block of the Cameraman image was compared with
of the threshold tr to separate the malicious tampering and the hash of the corresponding block located at the same spatial
non-malicious distortions is trivial. The value of tr can be position of the Baboon image. Since all the corresponding
set between 0.7213 and 0.5237. After doing experiments on blocks of both these images are visually dissimilar, ideally
a number of different images, it is concluded that the value there should be no false acceptance. The number of blocks
of tr = 0.65 is effective to discriminate malicious tampering that were positively authenticated by changing tr were noted
and non-malicious distortions. It is clear from Table II that the and the false positive probability was calculated using Eq.

405
(a) JPEG Compression. (b) Gaussian Blurring. (c) Gamma Correction.

(d) Gaussian Noise. (e) Motion Blurring. (f) Image Scaling.


Fig. 5. The receiver operating curves for the proposed SVD-NRLBP hashing scheme (a) JPEG compression (b) Gaussian Blurring (c) Gamma Correction
(d) Gaussian Noise (e) Motion Blurring (f) Image Scaling.

5. To estimate the false negative probability, several distorted were observed to be quite robust against a number of content
versions of the Cameraman image were generated by applying preserving distortions as reported in this paper. The ROC
JPEG compression, Gaussian blurring, Gamma correction, analysis presented in Section IV reveals that a low false
Gaussian Noise, motion blurring and image scaling. The positive probability can be achieved for a low false negative
amount of distortion is same as shown in Table II. The hash of probability. As a future work, we aim to carry out the reported
each block of the original Cameraman image was compared experiments on a large data set with different malicious and
to the corresponding hash at the same spatial location of the non-malicious distortions to further gauge the effectiveness of
distorted image. The value of tr was changed and the number the proposed scheme. In addition, we would also work to make
of blocks not being authenticated were counted. The false the NRLBP-SVD feature key dependent. This would make the
negative probability was calculated using Eq. 6. The result of proposed hashing scheme both robust and secure.
ROC analysis is shown in Figure 5. The x-axis and the y-axis
represent the false positive probability and the false negative R EFERENCES
probability, respectively. It is promising to note that for low [1] S. William, “Cryptography and network security: principles and prac-
false positive probability, low false negative probability is tice,” Prentice-Hall, Inc, pp. 23–50, 1999.
achieved. For example, in case of JPEG compression, Gaussian [2] M. Wu, Y. Mao, and A. Swaminathan, “A signal processing and
randomization perspective of robust and secure image hashing,” in
blurring, Gamma correction and motion blurring, the values of Statistical Signal Processing, 2007. SSP’07. IEEE/SP 14th Workshop
PF P and PF N is approximately equal to 0.01. The values of on, pp. 166–170, IEEE, 2007.
PF P and PF N are a bit higher in case of Gaussian noise and [3] A. Swaminathan, Y. Mao, and M. Wu, “Robust and secure image
hashing,” Information Forensics and Security, IEEE Transactions on,
image scaling. vol. 1, no. 2, pp. 215–230, 2006.
[4] V. Monga and M. K. Mihçak, “Robust and secure image hashing via
V. C ONCLUSION AND F UTURE W ORK non-negative matrix factorizations.,” IEEE Transactions on Information
Forensics and Security, vol. 2, no. 3-1, pp. 376–390, 2007.
In this paper, an image hashing scheme is proposed that [5] R. Davarzani, S. Mozaffari, and K. Yaghmaie, “Perceptual image hash-
offers good robustness and at the same time is capable enough ing using center-symmetric local binary patterns,” Multimedia Tools and
to detect minute level of tampering. The fusion of NRLBP and Applications, pp. 1–29, 2015.
[6] R. Venkatesan, S.-M. Koon, M. H. Jakubowski, and P. Moulin, “Robust
SVD enabled to provide image features that are different for image hashing,” in Image Processing, 2000. Proceedings. 2000 Interna-
visually different images. On the other hand, these features tional Conference on, vol. 3, pp. 664–666, IEEE, 2000.

406
[7] Y. Zhao, S. Wang, X. Zhang, and H. Yao, “Robust hashing for image
authentication using zernike moments and local features,” Information
Forensics and Security, IEEE Transactions on, vol. 8, no. 1, pp. 55–63,
2013.
[8] R. Davarzani, S. Mozaffari, and K. Yaghmaie, “Image authentication
using lbp-based perceptual image hashing,” Journal of AI and Data
Mining, vol. 3, no. 1, pp. 21–30, 2015.
[9] T. Ojala, M. Pietikäinen, and D. Harwood, “A comparative study of
texture measures with classification based on featured distributions,”
Pattern recognition, vol. 29, no. 1, pp. 51–59, 1996.
[10] X. Chen, C. Qin, and P. Ji, “Perceptual image hashing using block
truncation coding and local binary pattern,” in 2015 Asia-Pacific Signal
and Information Processing Association Annual Summit and Conference
(APSIPA), pp. 856–859, IEEE, 2015.
[11] J. Ren, X. Jiang, and J. Yuan, “Noise-resistant local binary pattern with
an embedded error-correction mechanism,” Image Processing, IEEE
Transactions on, vol. 22, no. 10, pp. 4049–4060, 2013.
[12] M. Pietikäinen, A. Hadid, G. Zhao, and T. Ahonen, “Local binary
patterns for still images,” in Computer Vision Using Local Binary
Patterns, pp. 13–47, Springer, 2011.
[13] F. Ahmed, M. Y. Siyal, and V. U. Abbas, “A secure and robust hash-
based scheme for image authentication,” Signal Processing, vol. 90,
no. 5, pp. 1456–1470, 2010.

407

You might also like