0% found this document useful (0 votes)
28 views25 pages

Image Forgeryin

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views25 pages

Image Forgeryin

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

INTERNSHIP REPORT

A Report Submitted in partial fulfillment of the requirements


for the award of the degree of

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]

Under the Supervision of

Mrs. Hemalatha Reddy .M


CTO(Chief Technical Officer), Skilltimate Technologies,
Hyderabad
Duration: 13th May, 2024 to 25th June, 2024

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

SHAIK ABDUL AZZEZ [Reg. No: 22J41A62B8], SHAIK NOUMAN

[Reg. No: 22J41A62B9], S.SRIVARSHA [Reg. No: 22J41A62C1] is work done by

him and submitted during 2024 – 2025 academic year, in partial fulfillment of the

requirements for the award of the degree of BACHELOR OF TECHNOLOGY

in CSE-CS, at SKILLTIMATE TECHNOLOGIES, HYDERABAD.

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

Acknowledgement should be prepared by their wordings showing their gratitude towards

Principal, HOD, guide(s), department, friends, family, etc.,

First I would like to thank Mrs. Hemalatha Reddy .M, CTO, Chief Technical Officer , Place

for giving me the opportunity to do an internship within the organization.

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 am highly indebted to Dr.A.RAMASWAMY REDDY for the facilities provided to


accomplish this internship.

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.

SHAIK ABDUL AZZEZ 22J41A62B8


SHAIK NOUMAN 22J41A62B9
SIRIKONDA SRIVARSHA 22J41A62C1

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

S.No. Contents Page No.

ACKNOWLEDGEMENT vi

ABSTRACT vii

1. About the Organization (Background Information) 1

2. Objective of the Internship 2-3

3 About the Internship Project 4-6

4 Technical Observations and Learnings form Internship Program 7

5 Outcome of the Internship 7-8

6 Conclusion 9

8 Appendices 10-13

ix
1. ABOUT THE ORGANIZATION

Skilltimate Technologies Hyderabad is an IT services company specializing in


software development, data science, and AI-based solutions. Though specific
historical details about the company are limited in public records, Skilltimate
Technologies is known for its focus on providing innovative technology solutions,
training, and internship programs in cutting-edge areas like Big Data, Hadoop, AI,
and machine learning.
The company has carved a niche in offering educational services, including internship
programs aimed at bridging the skill gap in emerging technologies, such as cloud
computing, AI, and data analytics. With a base in Hyderabad, one of India's growing
tech hubs, Skilltimate has contributed to workforce development by offering practical
training in real-world projects for young professionals and students.
Mission:
To empower individuals and organizations by providing cutting-edge technological
solutions and high-quality training in emerging fields like artificial intelligence, data
science, cloud computing, and big data. Skilltimate Technologies aims to bridge the
skills gap by offering comprehensive, hands-on learning experiences that prepare
individuals for real-world challenges in the tech industry.
Vision:
To become a leader in technology-driven solutions and educational services, fostering
innovation and development in both individuals and enterprises. Skilltimate
Technologies envisions creating a future where technology is accessible to all, driving
sustainable growth and positive transformation in businesses and communities.
At Skilltimate Technologies, the work culture emphasizes continuous learning and
innovation, providing employees with the freedom to experiment and explore new
ideas in technology. The management fosters a friendly and supportive environment,
encouraging open communication and transparency at all levels. Employees are
motivated to excel through performance-based rewards and recognition. Training
programs are frequently offered, ensuring staff are up-to-date with the latest industry
trends and tools, promoting continuous skill enhancement. The organization places
high importance on quality in all aspects of work, ensuring clients and internal
projects receive exceptional service. Overall, the culture at Skilltimate Technologies
nurtures growth, creativity, and collaboration, making it a dynamic workplace.

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.

1. Skill Development: Enhance interns' technical skills through exposure to industry-


standard tools, frameworks, and platforms like Hadoop, Python, TensorFlow, and
more.
2. Learning by Doing: Encourage learning through project-based tasks, enabling interns
to apply theoretical knowledge in practical scenarios.
3. Professional Growth: Develop essential workplace skills such as teamwork,
problem-solving, communication, and time management.
4. Industry Insight: Offer insights into the workings of the tech industry, focusing on
emerging trends and market needs.
5. Mentorship: Provide guidance and mentorship from experienced professionals to
help interns grow in their career paths.

Software Tools:

1. Python 3.x: Programming language used to build the application.

• Download: Python Official Website

2. Pandas: Library for data manipulation and analysis.

• Install via pip: pip install pandas

3. Matplotlib: Library for creating static, animated, and interactive visualizations.

• Install via pip: pip install matplotlib

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.

6. CSV/Excel File Software:

• Microsoft Excel, LibreOffice Calc, or Google Sheets for viewing exported financial
data.

Hardware Tools:

1. PC/Laptop:

• Processor: Intel Core i3 or higher (or equivalent AMD processor)


• RAM: Minimum 4GB (8GB or higher recommended)
• Storage: At least 100GB available storage (for saving data files and software)
• Operating System: Windows, macOS, or Linux

2. Display:

• Minimum resolution of 1366x768 for coding and visualizing data in graphs.

3. Input Devices:

• Standard keyboard and mouse for coding and user interface testing.

4. External Storage (optional):

• USB drive or external hard drive for data backups.

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.

5. OUTCOME OF THE INTERNSHIP

a. Skills and Qualifications Gained from the Internship


During my internship on gender and age prediction using CNN, I gained several
practical skills and qualifications:
Deep Learning Implementation: I learned to implement Convolutional Neural
Networks (CNN) for age and gender prediction, applying pre-trained models and fine-
tuning them.
OpenCV Mastery: I developed proficiency in using OpenCV for tasks like face
detection, image processing, and real-time applications.
Data Preprocessing and Optimization: I acquired skills in preprocessing datasets
(resizing, normalization) and optimizing model accuracy by tuning hyperparameters.
Model Integration: I gained experience integrating multiple deep learning models
(for face detection, gender, and age prediction) into a cohesive application.
Real-time Systems: I enhanced my understanding of real-time video analysis and
processing, an essential skill for live prediction systems.
b. Responsibilities Undertaken During the Internship

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:

from tkinter import *


import tkinter
from tkinter import filedialog
import matplotlib.pyplot as plt
from tkinter.filedialog import askopenfilename
import numpy as np
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
import seaborn as sns
import pickle
from sklearn.metrics import precision_score
from sklearn.metrics import recall_score
from sklearn.metrics import f1_score
import os
import cv2
from keras.utils.np_utils import to_categorical
from keras.models import Sequential, Model

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")

global X_train, X_test, y_train, y_test, fine_features


global model
global filename
global X, Y
accuracy = []
precision = []
recall = []
fscore = []
global squeezenet, shufflenet, mobilenet

labels = ['Non Forged','Forged']

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 getMetrics(predict, testY, algorithm):


p = precision_score(testY, predict,average='macro') * 100
r = recall_score(testY, predict,average='macro') * 100
f = f1_score(testY, predict,average='macro') * 100
a = accuracy_score(testY,predict)*100
accuracy.append(a)
precision.append(p)
recall.append(r)
fscore.append(f)
text.insert(END,algorithm+" Precision : "+str(p)+"\n")
text.insert(END,algorithm+" Recall : "+str(r)+"\n")
text.insert(END,algorithm+" FScore : "+str(f)+"\n")
text.insert(END,algorithm+" Accuracy : "+str(a)+"\n\n")

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")

with open('model/shufflenet_model.json', "r") as json_file:


loaded_model_json = json_file.read()
shufflenet = model_from_json(loaded_model_json)
json_file.close()
shufflenet.load_weights("model/shufflenet_weights.h5")
shufflenet._make_predict_function()
print(shufflenet.summary())
predict = shufflenet.predict(X_test)
predict = np.argmax(predict, axis=1)
getMetrics(predict, y_test, "ShuffleNet")

with open('model/mobilenet_model.json', "r") as json_file:


loaded_model_json = json_file.read()
mobilenet = model_from_json(loaded_model_json)
json_file.close()
mobilenet.load_weights("model/mobilenet_weights.h5")

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

• Xiao B, Wei Y, Bi X, Li W, Ma J. Image splicing forgery detection combining coarse to


refined convolutional neural network and adaptive clustering. Information Sciences
2020; 511: 172-191. doi: 10.1016/j.ins.2019.09.038

• 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.

• He Z, Lu W, Sun W, Huang J. Digital image splicing detection based on Markov features


in DCT and DWT domain. Pattern Recognition 2012; 45 (12): 4292-4299.

• 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

You might also like