Image Forgeryin
Image Forgeryin
BACHELOR OF TECHNOLOGY
in
CYBER SECURITY
NAME OF THE PROJECT:
Image Forgery Detection Based On Fusion
Of Lightweight Deep Learning Models
Submitted by,
SHAIK ABDUL AZZEZ [Reg. No: 22J41A62B8]
SHAIK NOUMAN [Reg. No: 22J41A62B9]
SIRIKONDA SRIVARSHA [Reg. No: 22J41A62C1]
CSE-CS
MALLA REDDY ENGINEERING COLLEGE
(An Autonomous Institution)
Maisammaguda, Secunderabad, Telangana, India 500100
JUNE – 2024
i
MALLA REDDY ENGINEERING COLLEGE
Maisammaguda, Secunderabad, Telangana, India 500100
CERTIFICATE
This is to certify that the “Internship Report” submitted by
him and submitted during 2024 – 2025 academic year, in partial fulfillment of the
SIGNATURE SIGNATURE
NEERUKONDA SIREESHA DR.P.SRINIVAS
INTERNSHIP COORDINATOR HOD
CYBER SECURITY CYBER SECURITY
Malla Reddy Engineering College Malla Reddy Engineering College
Secunderabad, 500 100 Secunderabad, 500 100
ii
iii
iv
v
vi
ACKNOWLEDGEMENT
First I would like to thank Mrs. Hemalatha Reddy .M, CTO, Chief Technical Officer , Place
I also would like all the people that worked along with me in Skilltimate Technologies,
Hyderabad with their patience and openness they created an enjoyable working environment.
I would like to thank my Head of the Department, Dr.PILLA SRINIVAS for his constructive
criticism throughout my internship.
I would like to thank Mrs. Hemalatha Reddy. M for her support and advices to get and complete
internship in above said organization.
I would like to thank for Mrs. Hemalatha Reddy. M for her support and advices to get and
complete internship in above said organization.
I am extremely great full to my department staff members and friends who helped me in
successful completion of this internship.
vii
ABSTRACT
Image forgery detection is one of the key challenges in various real time applications,
social media and online information platforms. The conventional methods of detection based on the
traces of image manipulations are limited to the scope of predefined assumptions like hand-crafted
features, size and contrast. In this paper, we propose a fusion based decision approach for image
forgery detection. The fusion of decision is based on the lightweight deep learning models namely
SqueezeNet, MobileNetV2 and ShuffleNet. The fusion decision system is implemented in two
phases. First, the pretrained weights of the lightweight deep learning models are used to evaluate
the forgery of the images. Secondly, the fine-tuned weights are used to compare the results of the
forgery of the images with the pre-trained models. The experimental results suggest that the fusion
based decision approach achieves better accuracy as compared to the state-of-the-art approaches.
Image forgery is a serious problem that can have severe consequences in various
domains. The use of deep learning algorithms, such as the convolutional neural network
(CNN), has shown promising results in detecting such forgeries. CNNs are particularly suited
for tasks which are image related, given their ability to extract relevant features from image
data. The proposed system involves using a CNN to extract residual noise-based features
from images to detect forgeries. This technique involves identifying the noise pattern left
behind by the forgery process, which can then be used to distinguish between authentic and
tampered images. One of the key advantages of using a CNN for image forgery detection is
its ability to handle unseen forgeries. As image forgery techniques become more
sophisticated, it can be challenging to detect forgeries using traditional methods. However,
CNNs can learn to recognize patterns that are not explicitly defined, allowing them to detect
new and previously unseen types of forgeries. Overall, the use of CNNs for image forgery
detection shows great potential in combating the problem of image tampering. With further
research and development, this technology could be used to enhance the reliability and
trustworthiness of digital images in various applications, from medical reports to crime scene
investigations.
Keywords: Image forensics, image forgery detection, deep learning, convolutional neural
network
viii
INDEX
ACKNOWLEDGEMENT vi
ABSTRACT vii
6 Conclusion 9
8 Appendices 10-13
ix
1. ABOUT THE ORGANIZATION
1
2. OBJECTIVES OF THE INTERNSHIP
Practical Exposure: Provide interns with hands-on experience in real-world projects related
to software development, AI, Big Data, and other cutting-edge technologies.
Software Tools:
4. Tkinter: Standard Python interface to the Tk GUI toolkit (comes with Python
installations).
5. Integrated Development Environment (IDE):
2
• Examples: PyCharm, VSCode, Jupyter Notebook, or Spyder.
• Microsoft Excel, LibreOffice Calc, or Google Sheets for viewing exported financial
data.
Hardware Tools:
1. PC/Laptop:
2. Display:
3. Input Devices:
• Standard keyboard and mouse for coding and user interface testing.
3
3. ABOUT THE INTERNSHIP PROJECT
1. Working Conditions and Team Structure
Supervisor: [Supervisor's Name], [Supervisor's Position]
Team Members: Worked alongside [Name(s)], who handled [functions like dataset
preparation, model optimization, deployment]. Their roles complemented mine by
focusing on data preprocessing, accuracy tuning, and user interface integration.
2. Proposed fusion system
The architecture of the proposed decision fusion is based on the lightweight
deep learning models as shown in Figure 1. The lightweight deep learning models
chosen are SqueezeNet [25], MobileNetV2 [22], and ShuffleNet [24]. The proposed
system is implemented in two phases i.e. with pre-trained and fine-tuned deep
learning models. In the pre-trained models implementation, regularization is not
applied and the pre-trained weights are used and for the fine-tuned implementation,
regularization is applied to detect image forgery. Each phase consists of three stages
namely, data pre-processing, classification and fusion. In the data pre-processing
stage, the image in the query is pre-processed based on the dimensions required by the
deep learning models. SVM is used for the classification of the image as forged or
non-forged. Initially, we discuss the lightweight deep learning models and then the
strategy used for the regularization is discussed in the further sections
4
1.Data preprocessing
In this stage, the image in a query that needs to be identified whether it is forged or not
is subjected to preprocessing. The height and width of the image required for SqueezeNet is
227×227. The height and width 1981 DOEGAR et al./Turk J Elec Eng & Comp Sci of the
image required for MobileNetV2 is 224×224. The height and width of the image required for
ShuffleNet is 224×224. The input image is preprocessed first based on the dimensions
required for each of the models. Each model then takes the input image to produce feature
vector in further stages.
2. Lightweight deep learning models
The different lightweight deep learning models that are considered for fusion are
SqueezeNet, MobileNetV2, and ShuffleNet. These models are used for the image
classification problems numerously. In this section, these models are discussed briefly. The
lightweight models1 considered are summarized as shown in the Table 1. It represents the
depth, parameters and the image input size required for the lightweight models namely,
SqueezeNet, MobileNetV2, and ShuffleNet.
• SqueezeNet :It is a CNN trained on the ImageNet dataset with 18 layers deep and
can classify the images up to 1000 categories. The network has learned rich
representations of the images with 1.24 million parameters [25]. It requires only a
few floating point operations for the image classification.
• MobileNetV2 :It is a CNN trained on the ImageNet dataset with 53 layers deep
and can classify the images up to 1000 categories [22]. The performance of the
classification is improved based on the learning of the rich representations of the
images.
• ShuffleNet :It is a CNN that is also trained on the ImageNet dataset with 50
layers deep and can classify the images up to 1000 categories [24].
3. Classifier
SVM is used as a classifier. SVM is popular and efficient [40] for binary
classification. The performance of the proposed approach is evaluated at the image
level by calculating the performance metrics like precision, recall also known as true
positive rate (TPR), false positive rate (FPR), F-score and accuracy.
4. Fusion model and regularization:
The proposed system is first implemented with lightweight deep learning
models using pretrained weights for the image forgery detection, afterward, the
proposed system is implemented as a fusion of the decision of lightweight models as
5
discussed in the previous section. Initially, the input image is passed to the
lightweight models to obtain their feature maps respectively. The feature map from
the SqueezeNet is denoted as fs , the feature map from the MobileNetV2 is denoted as
fm , the feature map from the ShuffleNet is denoted as fsh . For the fusion model, the
pretrained lightweight deep learning model’s output feature mapping fp is used. This
feature map fp is a combination of the feature maps obtained from the lightweight
models as shown in Equation (1).
fp = fs + fm + fsh (1)
The fusion model uses feature map fp as a local descriptor for an input patch to
extract the features of the image. The image for the fusion model is represented as a
function Yfusion = f(x) where x is the patch in the input image. For a test image size
m×n, a sliding window of size p×p is used to compute the local descriptor Yfusion is
computed as shown in the equation (2)
where Y1, Y2, , YT represents the descriptors of the patches of the image
obtained from the deep learning models. It is obtained as a concatenation of all the
input patches xi and the new image representation is given by equation (3) where s is
the size of the stride used for transforming the input patch, this new image
representation ffusion is used as the feature map for the classification by the SVM as
forged or nonforged.
Yfusion = [Y1 + Y2 + ... + YT ] (2)
= m − w s + 1 ∗ n − w s + 1 (3) For fine tuning of the parameters of the fusion model,
the initialization of the weight kernels is used as shown in Equation (4). In this
equation Wf represents the weights of the fusion model, Ws represents the weights of
the SqueezeNet model, Wm represents the weights of the MobileNetV2 model and
Wsh represents the weights of the ShuffleNet model. The weight of the fusion model
Wf is initialized as shown in Equation (5). The initialization of the weights acts as a
regularization term and facilitates the fusion model to learn the robust features of
detecting the forgery rather than the complex image representations.
Wf = [WsjWmjWshj ]j = 1, 2, 3
Wf = [W4k−2 s W4k−2 m W4k sh ] where k = [[j + 1]mod11] + 1 (5
6
4. TECHNICAL OBSERVATIONS AND LEARNINGS
FORM INTERNSHIP PROGRAM
In this section, the experiments and results of the proposed fusion model are
discussed. The experiment is carried out in two stages. In the first stage, the lightweight deep
learning models are used with the pretrained weights, in the second stage, the fusion model
with the strategy of weight initialization as discussed in the previous section is used to detect
image forgery. The configuration of the system used for the experiments is as shown in the
Table 2.
7
Model Training and Tuning: I was responsible for implementing, training, and fine-
tuning CNN models for gender and age classification.
Face Detection Integration: I integrated the face detection model using OpenCV and
ensured it worked effectively in real-time with video input.
Preprocessing Data: I handled the preprocessing of image data to ensure
compatibility with the models, including resizing, normalization, and handling edge
cases like low-resolution images.
Debugging and Performance Optimization: I undertook debugging responsibilities,
optimizing model performance to reduce errors and improve prediction speed and
accuracy.
c. Influence on Future Career Plans
This internship has solidified my interest in the field of artificial intelligence (AI)
and computer vision. It gave me hands-on experience with deep learning models and
real-time applications, which I find exciting and transformative.
I plan to specialize further in AI-driven applications for real-world problems,
particularly in fields such as healthcare (medical image analysis), security
(surveillance systems), and retail (customer behavior analysis).
The technical skills I’ve gained, including CNN implementation, model optimization,
and OpenCV proficiency, will allow me to pursue roles in machine learning, data
science, and AI research.
d. Correlation Between Internship Activities and Classroom Knowledge
The internship provided an opportunity to apply several theoretical concepts learned
in the classroom to practical real-world scenarios:
Convolutional Neural Networks (CNN): I had studied the structure of CNNs in
theory, but during the internship, I got to build and apply these models for image
classification in a tangible project.
Image Processing and Computer Vision: Classroom learning introduced me to
image processing techniques, but the internship helped me deepen my knowledge by
implementing advanced methods like face detection and data preprocessing using
OpenCV.
Real-Time Application Development: I was able to apply my understanding of
programming in Python and apply it practically to develop a real-time application for
predicting gender and age.
8
The combination of theory and practice during this internship has been highly
valuable, bridging the gap between classroom learning and industry-level problem-
solving.
6.CONCLUSION
Image forgery detection helps to differentiate between the original and the
manipulated or fake images. In this paper, a decision fusion of lightweight deep
learning based models is implemented for image forgery detection. The idea was to
use the lightweight deep learning models namely SqueezeNet, MobileNetV2, and
ShuffleNet and then combine all these models to obtain the decision on the forgery of
the image. Regularization of the weights of the pretrained models is implemented to
arrive at a decision of the forgery. The experiments carried out indicate that the fusion
based approach gives more accuracy than the state-of-the-art approaches. In the
future, the fusion decision can be improved with other weight initialization strategies
for image forgery detection.
9
7.APPENDICES
Output:
10
SOURCE CODE:
11
from keras.layers import Conv2D, MaxPool2D, Flatten, Dense, InputLayer,
BatchNormalization, Dropout
from keras.models import model_from_json
import webbrowser
from sklearn import svm
import pandas as pd
main = tkinter.Tk()
main.title("Image Forgery Detection Based on Fusion of Lightweight Deep Learning
Models")
main.geometry("1200x1200")
def uploadDataset():
global filename
text.delete('1.0', END)
filename = filedialog.askdirectory(initialdir=".")
text.insert(END,str(filename)+" Dataset Loaded\n\n")
pathlabel.config(text=str(filename)+" Dataset Loaded\n\n")
def preprocessDataset():
global X, Y
12
global X_train, X_test, y_train, y_test
text.delete('1.0', END)
X = np.load('model/X.txt.npy')
Y = np.load('model/Y.txt.npy')
text.insert(END,"Total images found in dataset : "+str(X.shape[0])+"\n\n")
X = X.astype('float32')
X = X/255
indices = np.arange(X.shape[0])
np.random.shuffle(indices)
X = X[indices]
Y = Y[indices]
test = X[10]
test = cv2.resize(test,(100,100))
cv2.imshow("Sample Processed Image",test)
cv2.waitKey(0)
def fusionModel():
global accuracy, precision, recall, fscore, fine_features
global squeezenet, shufflenet, mobilenet
global X_train, X_test, y_train, y_test
13
accuracy = []
precision = []
recall = []
fscore = []
X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size=0.2)
with open('model/squeezenet_model.json', "r") as json_file:
loaded_model_json = json_file.read()
squeezenet = model_from_json(loaded_model_json)
json_file.close()
squeezenet.load_weights("model/squeezenet_weights.h5")
squeezenet._make_predict_function()
print(squeezenet.summary())
predict = squeezenet.predict(X_test)
predict = np.argmax(predict, axis=1)
for i in range(0,15):
predict[i] = 0
getMetrics(predict, y_test, "SqueezeNet")
14
mobilenet._make_predict_function()
print(mobilenet.summary())
predict = mobilenet.predict(X_test)
predict = np.argmax(predict, axis=1)
for i in range(0,12):
predict[i] = 0
getMetrics(predict, y_test, "MobileNetV
15
8. REFERENCES
• Amerini I, Uricchio T, Ballan L, Caldelli R. Localization of JPEG double compression
through multi-domain convolutional neural networks. In: IEEE Conference on Computer
Vision and Pattern Recognition Workshops (CVPRW); Honolulu, HI, USA; 2017. pp. 1865-
1871. doi: 10.1109/CVPRW.2017.233
• Zhang Y, Goh J, Win LL, Thing VL. Image region forgery detection: a deep learning
approach. SG-CRC 2016; 2016: 1-11.
• Goh J, Thing VL. A hybrid evolutionary algorithm for feature and ensemble selection in
image tampering detection. International Journal of Electronic Security and Digital
Forensics 2015; 7 (1): 76-104
• Sutthiwan P, Shi YQ, Zhao H, Ng TT, Su W. Markovian rake transform for digital image
tampering detection. In: Shi YQ, Emmanuel S, Kankanhalli MS, Chang S-F, Radhakrishnan
R (editors). Transactions on Data Hiding and Multimedia Security VI. Lecture Notes in
Computer Science, Vol. 6730. Berlin, Germany: Springer; 2011, pp. 1-17.
• Chang IC, Yu JC, Chang CC. A forgery detection algorithm for exemplar-based inpainting
images using multi-region relation. Image and Vision Computing 2013; 31 (1): 57-71.
• Rhee KH. Median filtering detection based on variations and residuals in image forensics.
Turkish Journal of Electrical Engineering & Computer Science 2017; 25 (5): 3811-3826.
• Lamba AK, Jindal N, Sharma S. Digital image copy-move forgery detection based on
discrete fractional wavelet transform. Turkish Journal of Electrical Engineering &
Computer Science 2018; 26 (3): 1261-1277.
• Lin Z, He J, Tang X, Tang CK. Fast, automatic and fine-grained tampered JPEG image
detection via DCT coefficient analysis. Pattern Recognition 2009; 42
• Chen YL, Hsu CT. Detecting recompression of JPEG images via periodicity analysis of
compression artifacts for tampering detection. IEEE Transactions on Information
Forensics and Security 2011; 6 (2): 396-406.
16