Global Contrast Enhancement Based Image Forensics Using Statistical Features

The evolution of modern cameras, mobile phones equipped with sophisticated image editing software has revolutionized digital imaging. In the process of image editing, contrast enhancement is a very common technique to hide visual traces of tampering. In our work, we have employed statistical distribution of block variance and AC DCT coefficients of an image to detect global contrast enhancement in an image. The variation in statistical parameters of block variance and AC DCT coefficients distribution for different degrees of contrast enhancement are used as features to detect contrast enhancement. An SVM classifier with 10− fold cross-validation is employed. An overall accuracy greater than 99 % in detection with false rate less than 2 % has been achieved. The proposed method is novel and it can be applied to uncompressed, previously JPEG compressed and post enhancement JPEG compressed images with high accuracy. The proposed method does not employ oft-repeated image histogrambased approach.


Introduction
The advent of cellular phones with high resolution and sophisticated cameras has ushered revolution in our lives.Additionally, digital devices are loaded with lots of media editing and enhancement softwares which enable common man to play with both image sources as well as information.This has led to the development of Digital Image Forensics (DIF), an area of research which targets certifying the veracity of images.
One of the key areas of the DIF is detection of forgery in the image is commonly known as tampering detection.Passive methods of DIF involve uncovering digital tampering in the absence of any watermark or signature inserted by the camera at the time of capturing [1], [2], [3], [4] and [5].Digital forgeries alter underlying statistics of an image.To create a visually imperceptible modification, it is required to match lighting conditions, re-size, rotate, or stretch portions of the images, re-save the final image (typically with lossy compression such as JPEG), etc.These manipulations result in introduction of specific correlations in the statistics of images, which on detection can serve as a sign of digital tampering at detector.For matching or manipulating lighting conditions, application of global or local contrast enhancement is a very common and essential step to hide visual traces.
In literature, the work is mainly focused on detecting specific types of enhancement, viz., detection of gamma correction [6] and [7] and median filtering [8].In addition, these methods work on the assumption that the type of enhancement is known.Stamm et.al. [9] employed histograms for the detection of global and local contrast enhancement.In their approach, introduction of the peak and valley due to contrast enhancement is used as statistical signature to detect forgery.The major drawback of this method is calculation of energy (parameter used to differentiate between the enhanced and unenhanced) which requires manual selection of cut-off frequency for separating low and high frequency regions to filter out saturated images.This method also fails on JPEG compressed images.An improved method was proposed by Xufeng et al. which eliminates the requirement of manual selection of the cut-off frequency [10].A method for both JPEG compressed as well as uncompressed images based on the gap between the bins of histogram is proposed by Cao et.al. [11].
In our work, we have exploited the statistical features of block variance, and block AC Discrete Cosine Transform (DCT) coefficients of an image, for the purpose of contrast enhancement detection.Block variance is a variance of 8 × 8 non-overlapping blocks of an image.It is known that the block variance of an image follows the exponential family of distributions [12].An application of a contrast enhancement operation, the parameters of statistical distribution exhibit variation that can be used as a feature set to detect contrast enhancement.We have employed a two-parameter Gamma distribution from exponential family [13] of distributions to characterize the block variance of both unenhanced and contrast enhanced images.For statistical modeling of AC DCT coefficients a composite distribution, Gaussian-Gamma is employed [14].An SVM classifier [15] with Gaussian Radial Basis Function (RBF) is applied to classify between unenhanced and enhanced images.For both JPEG compressed as well as uncompressed images, the detection accuracy of the proposed method is high.The accuracy in detection of globally contrast enhanced images is more than 99 % with false alarm less than 2 % with few exceptions.
The organization of the paper is as follows.The application of statistical distribution parameters as features to detect contrast enhancement is explained in Sec. 2.
The system model with assumptions and the detection results with the method to detect global contrast enhancement is described in Sec. 3. The work is concluded in Sec. 4.

Statistical Modeling of Block Variance and AC DCT Coefficients
The Laplacian distribution [16], [17] and [18], Generalized Gamma and Generalized Gaussian distribution [19] are generally employed to empirically model AC DCT coefficients of natural images.Lam et al. [12] have analytically proved that composite statistical distributions should be employed to model AC DCT coefficients.

Previous Work: Model of Block Variance and AC DCT Coefficients of Original Image
The statistical distribution of block variance of a natural image plays an important role in deciding the composite distribution for modeling of AC DCT coefficients.The distributions considered for block variance in literature are exponential, half-Gaussian, Gamma and many more distributions [12], [14], [20] and [21].
In our work, we have experimentally chosen the twoparameter Gamma distribution over other distributions.The pdf for Gamma distributed block variance (σ 2 ) is given by: where α, β and p(σ 2 ) is a scale parameter, shape parameter and pdf of block variance, respectively.The composite pdf of AC DCT coefficients, p(I u,v ) of natural images is given by: where I u,v is 8 × 8 block 2D-DCT of an image, u = 0, 1, ...7, v = 0, 1, ...7, represent DCT domain.The p(I u,v /σ 2 ), is zero mean Gaussian distribution [12] defined as: Using Eq. ( 1), Eq. ( 2) and Eq. ( 3), the obtained p(I u,v ) for Gamma distributed block variance is: where K v (x) modified Bessel function of the third kind.

Modeling Block Variance and AC DCT Coefficients of Contrast Enhanced Images
The application of contrast enhancement to an image results in expansive or contractive mapping of pixel values in spatial domain which causes a change in scale parameter of statistical distribution of block variance.Additionally, change in scale parameter of AC DCT coefficients is also observed.The power-law transformation which is widely used enhancement operation, is defined as: where i x,y and i e x,y , ∀ x = 0, 1...7, y = 0, 1...7, represent original and its enhanced version in spatial domain and γ is power factor.By converting a non -linear model into linear one by taking natural log, ln, Eq. ( 5) can be written as: By employing property of variance [22], variance of 8 × 8 block of power law transformed images, lσ 2 e can be defined as: where lσ 2 and lσ 2 e are block variance of ln of original and enhanced image.Using Eq. ( 7) and linear transformation of p(lσ 2 ), p(lσ 2 e ) becomes: where lα e , lβ e and p(lσ 2 e ) is a scale parameter, shape parameter and pdf of block variance of ln of i e x,y , respectively.
The 8 × 8 block DCT of contrast enhanced image is given by: where lI represents DCT of ln(i) and C = c • I 0,0 .I 0,0 is a 8 × 8 matrix which has only one non-zero value and its first element equals to 8. lI e u,v can be defined as a linear combination of lI u,v and I 0,0 .
Applying linear transformation on Eq. ( 3), p(lI e u,v /lσ 2 e ) can be written as: By variable transformation and substituting Eq. ( 10) and Eq. ( 8) in Eq. ( 2), pdf of DCT coefficients of contrast enhanced image for originally Gamma distributed block variance becomes: where, K lβe−1/2 (x) modified Bessel function of the third kind with order lβ e − 1/2.It is worth to mention that the scale parameters (lα, lα e ) and shape parameters (lβ, lβ e ) for p(lI u,v ) and p(lI e u,v ) are computed using Nelder-Mead simplex algorithm for numerical Maximum Likelihood (ML) estimation.In our work, we have utilized three AC DCT coefficients at locations (u = 0, v = 1), (u = 1, v = 0), and (u = 2, v = 0), for original and enhanced images.

3.
Global Contrast Enhancement Based Forensics

System Model
Digital images are converted into grayscale for analysis and detection of global contrast enhancement.For preparation of enhanced images, contrast enhancement is applied in RGB domain only and then the detection method is applied to a database containing both original and enhanced images.The block variance of ln of a digital image is computed and fitted to Gamma distribution using ML estimation approach.The computed scale and shape parameters are included in the feature set.Also, the image is transformed from spatial domain into the frequency domain by using the 2D 8 × 8 Block DCT method.The distribution of three AC DCT coefficients is fitted to composite Gaussian-Gamma distribution.The computed scale and shape parameters of Gaussian-Gamma distribution are included in the features.Further, the mean, variance, skewness, kurtosis, entropy and energy of fitted distributions of block variance and AC DCT coefficients are computed and included in the feature set.To capture the additional information from the data of block variance and AC DCT coefficients due to contrast enhancement operation, the mean, variance, skewness and kurtosis of block variance and AC DCT coefficients are further added to the feature set.The feature set is applied to Support Vector Machine (SVM) classifier.Two databases UCID [23] and CASIA [24] are used for this purpose.The system model for detection of contrast enhancement is given in Fig. 1.

Detection Algorithm and Experimental Results
In the previous section, we have discussed the formation of the feature set which results in 48 dimensions.The optimization of the feature selection is done experimentally.The shape parameter for Gamma and Composite distribution was found independent of contrast enhancement operation and therefore, removed from the training set of SVM, resulting in 44 dimension features.The results of detection are expressed in terms of True Positive Rate (TPR) and False Positive Rate (FPR).The MATLAB 2016b is used as a simulation software.The SVM classification with kernel 'RBF' using 10 − f old cross-validation is employed for contrast enhancement detection.Our algorithm to detect contrast enhancement is as follows: 1. Convert test image from RGB into grayscale.
where I t is a test image.
2. Compute variance of block of 8 × 8 of ln of image and obtain its pdf.
3. Estimate parameters for test image, lα t by fitting Gamma distribution on pdf of p(lσ 2 t ).

Estimate parameters, lα t by fitting composite
Gaussian-Gamma distribution on pdf of p(lI t ), lI t is 8 × 8 block DCT of ln of test image.mixed with contrast enhanced images and images obtained after composite operation of contrast enhancement followed by JPEG compression with Q = 50, 70, 90 and 100 for each γ value.For CASIA database (Fig. 3(b)), the original JPEG images are also mixed with contrast enhanced images and images obtained after composite operation of contrast enhancement followed by JPEG compression with Q = 50, 70, 90 and 100 for each γ value.
In Fig. 4, the ROC curves are obtained for the images (UCID, CASIA, UCID mixed with CASIA) contrast enhanced using power law transformation with γ = 0.5 to 2 and S-Mapping and thereafter saved in two formats: uncompressed (TIFF) format and JPEG format with different Qs (Q = 50, 70, 90 and 100).
It may be noted that Area Under the Curve (AUC) for Fig. 2, Fig. 3 and Fig. 4 is greater than 98 %.
Our proposed method achieved overall detection results as T P R = 99.2 % when F P R = 2 %.For UCID database, T P R = 99.3 % when F P R = 2 % and for CASIA database, T P R = 99.2 % when F P R = 2 %.All these results are comparable to the methods of Stamm et.al [9] and Cao et.al [11] for uncompressed images as observed in ROC curves for UCID.However, Stamm's method [9] is limited to uncompressed images whereas our proposed method (Tab. 1) achieved 99 % accuracy for originally JPEG compressed images as shown in ROC curves for CASIA database.The method proposed by Cao et.al [11] becomes random guess when tested on JPEG compressed images that