0% found this document useful (0 votes)
130 views67 pages

Recolored Image Detection Via A Deep Discriminative Model: P.Yugandhar Sharma 1304-21-862-024

The document describes a system for detecting recolored images using a deep discriminative model. It proposes using a CNN-based network that takes the original image along with two derived inputs, difference image and illumination image, to determine if an image is recolored or not. The network consists of three feature extraction blocks and a fusion module. It is trained on a synthesized dataset of recolored and original images. Experimental results show the proposed network is well-generalized and robust at detecting recolored images generated by various methods.

Uploaded by

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

Recolored Image Detection Via A Deep Discriminative Model: P.Yugandhar Sharma 1304-21-862-024

The document describes a system for detecting recolored images using a deep discriminative model. It proposes using a CNN-based network that takes the original image along with two derived inputs, difference image and illumination image, to determine if an image is recolored or not. The network consists of three feature extraction blocks and a fusion module. It is trained on a synthesized dataset of recolored and original images. Experimental results show the proposed network is well-generalized and robust at detecting recolored images generated by various methods.

Uploaded by

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

RECOLORED IMAGE

DETECTION VIA A DEEP


DISCRIMINATIVE MODEL
P.YUGANDHAR SHARMA
1304-21-862-024
ANALYSIS

1.INTRODUCTION

Image re-coloring is a technique that can transfer image color or theme and result in an imperceptible change in human eyes.

Although image re-coloring is one of the most important image manipulation techniques, there is no special method designed

for detecting this kind of forgery. In this paper, we propose a trainable end-to-end system for distinguishing re-colored images

from natural images. The proposed network takes the original image and two derived inputs based on illumination consistency

and inter-channel correlation of the original input into consideration and outputs the probability that it is recolored. Our

algorithm adopts a CNN-based deep architecture, which consists of three feature extraction blocks and a feature fusion module.

To train the deep neural network, we synthesize a dataset comprised of re-colored images and corresponding ground truth using

different re-coloring methods. Extensive experimental results on the recolored images generated by various methods show that

our proposed network is well generalized and much robust


EXISTING SYSTEM
Existing forgery detection methods adopt some description techniques to combine the information attained
by evidence estimators. However, every description technique has its own limitations and drawbacks.
Recently, CNNs have shown an explosive popularity in image classification and other computer vision tasks.
Traditional neural networks employ the original image in RGB channels as the input since it contains
information about the picture such as color and structural features.

Disadvantages:

• Accuracy is low

• Low efficiency
Proposed System

We use three feature extractors and a feature fusion module to learn forgery-relevant features. We adopt
the original image as one of the input branches like traditional neural networks. Additionally, we derive
DI(Difference image) and Illumination Image (IM) as two pieces of evidence of image recolored
detection based on the observations that images may not maintain the inter-channel correlation or
illuminant consistency after the recoloring process. These two pieces of evidence are employed as two
additional input branches together with the original image.

Advantages:

• Converting recolor efficiently.

• Accuracy is high
Scope of the project

“The scope of recolored image detection via a deep discriminative model is quite broad and can be
applied to various domains and scenarios.Detecting recolored images using a deep discriminative
model involves training a neural network to distinguish between original and altered images based
on color changes. The model learns to capture patterns indicative of recoloring, enabling it to
classify new images as either original or recolored.By using advanced deep learning techniques,
such as convolutional neural networks (CNNs), it's possible to train models to recognize recolored
images. Such technology could have applications in detecting image manipulation and ensuring the
authenticity of visual content, which can be valuable in various fields, including forensics, media
verification, and digital image authentication.
SOFTEWARE REQUIREMENTS

 For developing the application, the following are the Software Requirements:

 Python

 Django

 Mysql

 Wampserver
HARDWARE REQUIREMENTS

 For developing the application the following are the Hardware Requirements:

 Operating Systems: Windows 7, Windows XP, Windows 8

 Processor: Pentium IV or higher

 RAM: 256 MB

 Space on Hard Disk: minimum 512MB


Modules

1. Upload Image: This module allows the user to upload an image that needs to be analyzed for recoloring. The image can be
in various formats such as JPEG, PNG, or GIF. Once the image is uploaded, it serves as input for the subsequent modules.
2. Color Transfer: The Color Transfer module is responsible for transferring the color scheme from the uploaded image to a
reference image or a predefined color palette. This process involves extracting the color distribution from the source image
and applying it to the target image. Color transfer techniques ensure that the recolored image maintains a similar color
appearance to the original image.
3. Image State: After the color transfer, the Image State module analyzes the resulting recolored image. It leverages a deep
discriminative model, which is a machine learning model trained to classify images based on their characteristics. The
module uses the trained model to assess the state of the recolored image and determine if any modifications or
manipulations have been applied.
4. Show Image: The Show Image module is responsible for displaying the recolored image and its corresponding state or
classification. It presents the output to the user, allowing them to observe the changes made during the color transfer and the
analysis performed by the deep discriminative model. The module may include additional visualizations or overlays to
highlight specific regions or features of interest.
Functional requirements

Data Collection: Collect appropriate picture data containing both indoor and outdoor pictures which contain the objects of all the types and preferentially
containing various colors.
Recoloring Algorithm: Use an appropriate recoloring algorithm for creating a dataset for training the model.
Data Pre-processing:
• Importing the dataset.
• Categorizing the training images into Recolored (0) Original (1)
• Optimize images such that all are of same size.
Exploratory Data Analysis: It involves extraction of necessary features important for training the model.
Training and Evaluating Model:
• The model must be trained using any efficient algorithm and API so that results are accurate and train the model for number of iterations to maintain
accuracy.
• The model has to be evaluated continuously for each iteration and training has to be continued until the results are consistent and saving the results.
Testing the Model: The model has to be applied to a new data set for testing the accuracy
Feasibility Study:

The feasibility of the project is analyzed in this phase and business proposal is put forth with a very general plan for the project
and some cost estimates. During system analysis the feasibility study of the proposed system is to be carried out. This is to ensure
that the proposed system is not a burden to the company. For feasibility analysis, some understanding of the major requirements
for the system is essential.

Three key considerations involved in the feasibility analysis are

• Economic Feasibility

• Technical Feasibility

• Social Feasibility
Economic Feasibility:

This study is carried out to check the economic impact that the system will have on the
organization. The amount of fund that the company can pour into the research and
development of the system is limited. The expenditures must be justified. Thus the developed
system as well within the budget and this was achieved because most of the technologies used
are freely available. Only the customized products had to be purchased.
Technical Feasibility:

This study is carried out to check the technical feasibility, that is, the technical requirements of the system. Any system
developed must not have a high demand on the available technical resources. This will lead to high demands on the available
technical resources. This will lead to high demands being placed on the client. The developed system must have a modest
requirement, as only minimal or null changes are required for implementing this system.

Social Feasibility:

The aspect of study is to check the level of acceptance of the system by the user. This includes the process of training the user
to use the system efficiently. The user must not feel threatened by the system, instead must accept it as a necessity. The level of
acceptance by the users solely depends on the methods that are employed to educate the user about the system and to make him
familiar with it. His level of confidence must be raised so that he is also able to make some constructive criticism, which is
welcomed, as he is the final user of the system.
Design:
Architecture
DATA FLOW DIAGRAM

 The DFD is also called as bubble chart. It is a simple graphical


formalism that can be used to represent a system in terms of
input data to the system, various processing carried out on this
data, and the output data is generated by this system.
 The data flow diagram (DFD) is one of the most important
modeling tools. It is used to model the system components.
These components are the system process, the data used by the
process, an external entity that interacts with the system and the
information flows in the system.
 DFD shows how the information moves through the system and
how it is modified by a series of transformations. It is a
graphical technique that depicts information flow and the
transformations that are applied as data moves from input to
output.
Class Diagram :

In software engineering, a class diagram in the Unified Modeling Language (UML) is a type of static structure diagram that
describes the structure of a system by showing the system's classes, their attributes, operations (or methods), and the
relationships among the classes. It explains which class contains information.
USECASE DIAGRAM:

A usecase diagram in the Unified Modeling Language (UML) is a type of


uploadImage
behavioral diagram defined by and created from a Use-case analysis. Its
purpose is to present a graphical overview of the functionality provided by a
system in terms of actors, their goals (represented as use cases), and any colorTransfer
user
dependencies between those use cases. The main purpose of a use case diagram
is to show what system functions are performed for which actor. Roles of the
imageState
actors in the system can be depicted.

showImage
SEQUENCE DIAGRAM :-

User Application
A sequence diagram in Unified Modeling
uploadImage
Language (UML) is a kind of interaction diagram
that shows how processes operate with one another colorTransfer
and in what order. It is a construct of a Message
imageState
Sequence Chart. Sequence diagrams are sometimes
called event diagrams, event scenarios, and timing
showImage
diagrams.
Activity Diagram :

Activity diagrams are graphical representations


of workflows of stepwise activities and actions
with support for choice, iteration and
concurrency. In the Unified Modeling Language,
activity diagrams can be used to describe the
business and operational step-by-step workflows
of components in a system. An activity diagram
shows the overall flow of control.
5. SYSTEM IMPLEMENTATION
5.1 Organization Impact
It encompasses various aspects related to how the adoption and operation of such a system influence the organization's operations, security posture, resources, culture, and
stakeholders. Understanding and managing the organization impact is crucial for effective deployment and successful integration.
5.2 User Manager Assessment
Evaluation of the development process on accordance with such yardsticks as overall development time and effort conformance to budgets and standards and other project
management criteria, includes assessment of development and tools.
Unfortunately, system evaluation does not always receive the annotation it merits were properly managed. However, it provides a great deal of information that can improve the
effectiveness of subsequent application.
Implementation:
Implementation is the stage where the theoretical design is turned in to working system. The most crucial stage is achieving a new successful system and in giving confidence
on the new system for the users that it will work efficiently and effectively.
The system can be implemented only after through testing is done and if it found to work according to the specification. It involves careful planning, investigation of the
current system and its constraints on implementation, design of methods to achieve the changeover and an evaluation of change over methods a part from planning. Two major
tasks of preparing the implementation are education and training of the users and testing of the system.
Implementation is the process of having systems personnel check out and put new equipment in to use, train users, install the new application, and construct any files of
data needed to it.
5.3 CODING

#!/usr/bin/env python

# coding: utf-8

# As we were not having dataset of all colored and recolored images, we created our own dataset of colored and recolored
images

# In[1]:

import numpy as np

import cv2

# ## Transfer Color

# Input a *source* and *target* image. The color space of *source* image is transferred to the color space of *target*
image.
# In[2]:

def color_transfer(source, target):

# convert color space from BGR to L*a*b color space

# note - OpenCV expects a 32bit float rather than 64bit

source = cv2.cvtColor(source, cv2.COLOR_BGR2LAB).astype("float32")

target = cv2.cvtColor(target, cv2.COLOR_BGR2LAB).astype("float32")

# compute color stats for both images

(lMeanSrc, lStdSrc, aMeanSrc, aStdSrc, bMeanSrc, bStdSrc) = image_stats(source)

(lMeanTar, lStdTar, aMeanTar, aStdTar, bMeanTar, bStdTar) = image_stats(target)

# split the color space

(l, a, b) = cv2.split(target)
# substarct the means from target image

l -= lMeanTar

a -= aMeanTar

b -= bMeanTar

# scale by the standard deviation

l = (lStdTar/lStdSrc)*l

a = (aStdTar/aStdSrc)*a

b = (bStdTar/bStdSrc)*b

# add the source mean

l += lMeanSrc

a += aMeanSrc
b += bMeanSrc
# clipping the pixels between 0 and 255
l = np.clip(l, 0, 255)
a = np.clip(a, 0, 255)
b = np.clip(b, 0, 255)
# merge the channels
transfer = cv2.merge([l, a, b])
# converting back to BGR
transfer = cv2.cvtColor(transfer.astype("uint8"), cv2.COLOR_LAB2BGR)
return transfer
# ## Calculating Image Statistics
# The mean and standard deviation of the L, a, b channels of both source and target images.
# In[3]:

def image_stats(image):

# compute mean and standard deviation of each channel

(l, a, b) = cv2.split(image)

(lMean, lStd) = (l.mean(), l.std())

(aMean, aStd) = (a.mean(), a.std())

(bMean, bStd) = (b.mean(), b.std())

return (lMean, lStd, aMean, aStd, bMean, bStd)

# ## Display Images

# In[5]:

def show_image(title, image, width=720):


r = width/float(image.shape[1])
dim = (width, int(image.shape[0]*r))
resized = cv2.resize(image, dim, interpolation=cv2.INTER_AREA)
cv2.imshow(title, resized)
### Calling all Functions
# In[ ]:
source = cv2.imread("Image_Dataset/source/source1.jpg")
target = cv2.imread("Image_Dataset/target/target1.jpg")
# transfer of color
transfer = color_transfer(source, target)
# display of image
show_image("Source", source)
show_image("Target", target)

show_image("Transfer", transfer)

cv2.waitKey(0)

# In[7]:

from os import listdir

from os.path import isfile, join

import numpy

import cv2

mypath1='Image_Dataset/source/'

mypath2='Image_Dataset/target/'

onlyfiles1 = [ f for f in listdir(mypath1) if isfile(join(mypath1,f)) ]


onlyfiles2 = [ f for f in listdir(mypath2) if isfile(join(mypath2,f)) ]

print(len(onlyfiles1))

print(len(onlyfiles2))

images1 = numpy.empty(len(onlyfiles1), dtype=object)

images2 = numpy.empty(len(onlyfiles2), dtype=object)

for n in range(0, len(onlyfiles1)):

images1[n] = cv2.imread( join(mypath1,onlyfiles1[n]) )

images1[n] = cv2.cvtColor(images1[n], cv2.COLOR_BGR2RGB)

images1[n]=cv2.resize(images1[n],(500,500))

images2[n] = cv2.imread( join(mypath2,onlyfiles2[n]) )

images2[n] = cv2.cvtColor(images2[n], cv2.COLOR_BGR2RGB)


images2[n]=cv2.resize(images2[n],(500,500))

# transfer of color

transfer = color_transfer(images1[n], images2[n])

# display of image

show_image("Source", images1[n])

show_image("Target",images2[n] )

show_image("Transfer", transfer)

cv2.waitKey(0)

from os import listdir

from os.path import isfile, join

import numpy
import cv2

import os

# In[6]:

mypath1='Image_Dataset/source/'

mypath2='Image_Dataset/target/'

onlyfiles1 = [ f for f in listdir(mypath1) if isfile(join(mypath1,f)) ]

onlyfiles2 = [ f for f in listdir(mypath2) if isfile(join(mypath2,f)) ]

print(len(onlyfiles1))

print(len(onlyfiles2))

images1 = numpy.empty(len(onlyfiles1), dtype=object)


images2 = numpy.empty(len(onlyfiles2), dtype=object)

for n in range(0, len(onlyfiles1)):

images1[n] = cv2.imread( join(mypath1,onlyfiles1[n]) )

mages1[n] = cv2.cvtColor(images1[n], cv2.COLOR_BGR2RGB)

images1[n]=cv2.resize(images1[n],(500,500))

images2[n] = cv2.imread( join(mypath2,onlyfiles2[n]) )

images2[n] = cv2.cvtColor(images2[n], cv2.COLOR_BGR2RGB)

images2[n]=cv2.resize(images2[n],(500,500))

# transfer of color

transfer = color_transfer(images1[n], images2[n])

#write images in a folder


path = 'Image_Dataset/transfer'

path1='Image_Dataset/original'

cv2.imwrite(os.path.join(path , 'recolor.{}.jpg'.format(n)),transfer)##for labeling the recolor images images

cv2.imwrite(os.path.join(path1 , 'original_color.{}.jpg'.format(n)),images2[n])#for labeling the original images

# display of image

#show_image("Source", images1[n])

#show_image("Target",images2[n] )

#show_image("Transfer", transfer)

cv2.waitKey(0)

# In[7]:

# Identification of recolor images


# In[8]:
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from keras.preprocessing.image import ImageDataGenerator, load_img
from keras.utils import to_categorical
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
import random
# In[9]:
FAST_RUN = False
IMAGE_WIDTH=128
IMAGE_HEIGHT=128

IMAGE_SIZE=(IMAGE_WIDTH, IMAGE_HEIGHT)
IMAGE_CHANNELS=3 # RGB color
# ## Prepare Traning Data
# In[10]:
import os
filenames = os.listdir("Image_Dataset/training_set")
categories = []
for filename in filenames:
category = filename.split('.')[0]
if category == 'original_color':
categories.append(1)
else:
categories.append(0)
df = pd.DataFrame({ 'filename': filenames, 'category': categories})
# In[11]:
df.head()

# In[12]:
df.tail()
# In[13]:
df['category']=df['category'].astype(str)
# In[14]:
df.dtypes
# In[15]:
#see sample image
sample = random.choice(filenames)
image = load_img("Image_Dataset/training_set/"+sample)
plt.imshow(image)
# In[16]:
# see total in counts
df['category'].value_counts().plot.bar()
# In[17]:
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D, Dropout, Flatten, Dense, Activation, BatchNormalization
model = Sequential()
model.add(Conv2D(64, (3, 3), activation='relu', input_shape=(IMAGE_WIDTH, IMAGE_HEIGHT, IMAGE_CHANNELS)))
model.add(BatchNormalization())
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.25))
model.add(Conv2D(64, (3, 3), activation='relu'))
model.add(BatchNormalization())
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.25))
model.add(Conv2D(64, (3, 3), activation='relu'))
model.add(BatchNormalization())
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.25))

model.add(Flatten())

model.add(Dense(64, activation='relu'))

model.add(BatchNormalization())

model.add(Dropout(0.5))

model.add(Dense(1, activation='sigmoid'))

model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])

model.summary()

# ## callback

# In[18]:

from keras.callbacks import EarlyStopping, ReduceLROnPlateau

# ## Early Stop

# To prevent over fitting we will stop the learning after 10 epochs and val_loss value not decreased

# In[19]:

earlystop = EarlyStopping(patience=10)
# ## Learning Rate Reduction
# We will reduce the learning rate when then accuracy not increase for 2 steps
# In[20]:
learning_rate_reduction = ReduceLROnPlateau(monitor='val_acc',
patience=2,
verbose=1,
factor=0.5,
min_lr=0.00001)
# In[21]:
callbacks = [earlystop, learning_rate_reduction]
# ## prepared train and test dataset
# In[22]:
train_df, validate_df = train_test_split(df, test_size=0.20, random_state=42)
train_df = train_df.reset_index(drop=True)
validate_df = validate_df.reset_index(drop=True)
# In[23]:

total_train = train_df.shape[0]

total_validate = validate_df.shape[0]

batch_size=4

# In[24]:

print(train_df.shape)

print(validate_df.shape)

# In[25]:

train_df['category'].value_counts().plot.bar()

# ## Traning Generator
# In[26]:
train_datagen = ImageDataGenerator(

rotation_range=15,

rescale=1./255,

shear_range=0.1,

zoom_range=0.2,

horizontal_flip=True,

width_shift_range=0.1,

height_shift_range=0.1

# In[27]:

train_generator = train_datagen.flow_from_dataframe(

train_df,

"Image_Dataset/training_set",

x_col='filename',
y_col='category',
target_size=IMAGE_SIZE,
class_mode='binary',
batch_size=batch_size
)
# ## Validation Generator
# In[28]:
validation_datagen = ImageDataGenerator(rescale=1./255)
validation_generator = validation_datagen.flow_from_dataframe(
validate_df,
"Image_Dataset/training_set",
x_col='filename',
y_col='category',
target_size=IMAGE_SIZE,
class_mode='binary',
batch_size=batch_size
)

# ## Fit Model

# In[29]:

epochs=3 if FAST_RUN else 50

history = model.fit_generator(

train_generator,

epochs=epochs,

validation_data=validation_generator,

validation_steps=total_validate//batch_size,

steps_per_epoch=total_train//batch_size,
callbacks=callbacks
)
# In[30]:
model.save_weights("model.h5")
# ## Virtualize Training
# In[31]:
fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(12, 12))
ax1.plot(history.history['loss'], color='b', label="Training loss")
ax1.plot(history.history['val_loss'], color='r', label="validation loss")
ax1.set_xticks(np.arange(1, epochs, 1))
ax1.set_yticks(np.arange(0, 1, 0.1))
ax2.plot(history.history['accuracy'], color='b', label="Training accuracy")
ax2.plot(history.history['val_accuracy'], color='r',label="Validation accuracy")
ax2.set_xticks(np.arange(1, epochs, 1))
legend = plt.legend(loc='best', shadow=True)
plt.tight_layout()

plt.show()

# ## Prepare Testing Data

# In[32]:

test_filenames = os.listdir("Image_Dataset/testing_set")

test_df = pd.DataFrame({

'filename': test_filenames

})

nb_samples = test_df.shape[0]

# ## Create Testing Generator

# In[33]:

test_gen = ImageDataGenerator(rescale=1./255)

test_generator = test_gen.flow_from_dataframe(

test_df,

"Image_Dataset/testing_set",
x_col='filename',

y_col=None,

class_mode=None,

target_size=IMAGE_SIZE,

batch_size=batch_size,

shuffle=False

# ## Predict

# In[34]:

predict = model.predict_generator(test_generator, steps=np.ceil(nb_samples/batch_size))

# As predicted of binary classification result return probability that image likely to be a original. So we will have threshold 0.5 which
mean if predicted value more than 50% it is a original and under 50% will be a recolor.

# In[35]:
threshold = 0.5

test_df['probability'] = predict

test_df['category'] = np.where(test_df['probability'] > threshold, 1,0)

# In[36]:

# visualize the result

test_df['category'].value_counts().plot.bar()

# ## See predicted result with images

# In[37]:

sample_test = test_df.head(8)

sample_test.head()

plt.figure(figsize=(12, 24))

for index, row in sample_test.iterrows():

filename = row['filename']
category = row['category']
probability = row['probability']
img = load_img("Image_Dataset/testing_set/"+filename, target_size=IMAGE_SIZE)
plt.subplot(6, 3, index+1)
plt.imshow(img)
plt.xlabel(filename + '(' + "{}".format(category) + ')' '(' + "{}".format(round(probability, 2)) + ')')
plt.tight_layout()
plt.show()
# In[38]:
#submission
submission_df = test_df.copy()
submission_df['id'] = submission_df['filename'].str.split('.').str[0]
submission_df['label'] = submission_df['category']
submission_df.drop(['filename', 'category'], axis=1, inplace=True)
submission_df.to_csv('submission.csv', index=False)
# In[ ]:
# training size=46
# testing size=8
# we achieved acc: 0.6944
# val_acc: 0.6667
# testing accuracy: out of 8 unknown images 6 are correctly classified and 2 missclassified see following results.
# probability id label
# 0.64807886 original_color 1
# 0.007113604 original_color 0
# 0.013637688 original_color 0
# 0.71749115 original_color 1
# 0.39750034 recolor 0
# 0.01088892 recolor 0
# 0.2330829 recolor 0
# 0.03004521 recolor 0
SCREENSHOTS

To run project double click on ‘run.bat’ then application will display lots of images so you close all those images and
then CNN start training and after training will get below screen
Then will get below submission.csv file as output
Image Comparison
Orginal Image
Modified Image
Difference Image
Thresh
Result
Test
6.SYSTEM TESTING

 6.1. Software Testing

The purpose of testing is to discover errors. Testing is the process of trying to discover every conceivable fault or weakness in a

work product. It provides a way to check the functionality of components, sub assemblies, assemblies and/or a finished product It is

the process of exercising software with the intent of ensuring that the Software system meets its requirements and user expectations

and does not fail in an unacceptable manner. There are various types of test. Each test type addresses a specific testing requirement.

6.2 Testing Approaches

Testing can be done in two ways

 Bottom up approach

 Top down approach


6.SYSTEM TESTING

6.3 Testing Methods


• 1.Black box or functional testing
• 2.White box testing or structural testing
• Black Box Testing
• This method is used when knowledge of the specified function that a product has been designed to
perform is known. The concept of black box is used to represent a system whose inside workings are not
available to inspection. In a black box the test item is a ”Black”, since its logic is unknown, all that is known is
what goes in and what comes out, or the input and output.
• Black box testing attempts to find errors in the following categories:
• a. Incorrect or missing functions
• b. Interface errors
• c. Errors in data structure
• d. Performance errors
• e. Initialization and termination errors
6.SYSTEM TESTING

• As shown in the following figure of Black box testing, we are not thinking of the internal
workings, just we think about
• What is the output to our system?
• What is the output for given input to our system?

The Black box is an imaginary box that hides its internal workings
• White box testing is concerned with testing the implementation of the program. The intent
of structural is not to exercise all the inputs or outputs but to exercise the different
programming and data structure used in the program. Thus structural testing aims to
achieve test cases that will force the desire coverage of different structures. Two types of
path testing are statement testing coverage and branch testing coverage.

The white box testing strategy, the internal workings


4.2 TESTING TYPES

Different levels of testing are used in the testing process, each level of testing aims to test
different aspects of the system. The basic levels are:
• Unit testing
• Integration testing
• Functionality testing
• System testing
• User Acceptance testing
UNIT TESTING

TEST Test case Testing Type Steps to Expected Actual Result

CASE ID Description Execute Result Result

UT01 Check for the user to upload Unit testing Provide a sample image file The image should be successfully uploaded Confirm if the function indeed uploads Pass
an valid image and processed by the system. the image as expected.

UT02 Checking for Transferring Unit testing Provide a source image and a The color from the source image is Verify if the color transfer operation is Pass
Color from Source to Target target image successfully transferred to the target image, performed correctly.
and the resulting image is displayed.

UT03 Checking the determination of Unit testing Provide an image to the "Image The image state correctly determines Confirm if the function accurately Pass
image state State" module whether the image is in the original color or identifies the image state.
recolored.

UT04 Checking the image display Unit testing Provide an image to the "Show The show Image should display the provided Verify if the image is displayed as Pass
functionality. Image” image on the screen expected.
module
TEST Test case Testing Steps to Expected Actual Result
Type
CASE ID Description Execute Result Result
IT01 Check that when an Integration Upload a source image and The color of the source Record the actual Pass
image is uploaded and testing upload a target image and image should be result of the upload
the color transfer is Verify that the color transfer transferred to the target process and the actual
performed, the color process takes place without image, and the result state of images after
transfer function errors. should be displayed color transfer.
correctly processes the without errors
uploaded image
IT02 Ensure that the image Integration Upload a source image and The image should be Record the the actual Pass
state is correctly testing target image, Perform color correctly classified as state of images after
determined based on transfer and Verify that the either original or color transfer and
the color transfer image state (original or recolored, and it should be actual result of image
process, and the image recolored) is correctly displayed accordingly display.
is displayed determined and Display the
accordingly. image based on its state.
TEST Test case Testing Type Steps to Expected Actual Result

CASE ID Description Execute Result Result


FT01 Verify that the system Functionality User selects a source image The system successfully uploads The source and target Pass
allows users to upload a Testing file and target image file the source image and target image images are
source image and target successfully loaded.
image.

FT02 Transfer color from a Functionality Provide a source image and a The system should successfully Verify that the color Pass
source image to a target Testing target image and transfer the color from the source has been transferred
image. Trigger the color transfer image to the target image and the correctly and the result
process resulting image should reflect the matches expectations.
color transfer

FT03 Verify the accuracy of the Functionality A set of known recolored The system achieves a high Result is displayed pass
recolored image detection Testing images accuracy rate in detecting recolored
images, with results close to the
training accuracy.
TEST Test case Testing Type Steps to Expected Actual Result

CASE ID Description Execute Result Result


ST01 Check to Transfer colors from a source SYSTEM Select a source image and target image : The colors are successfully transferred from the The resulting image is displayed Pass
image to a target image. TESTING and click the "Transfer Color" button. source to the target image

ST02 Check that the system can display SYSTEM Upload multiple images (original or The system should display all uploaded images The original or recolored images Pass
multiple images simultaneously. TESTING recolored) and simultaneously, allowing users to compare them are displayed
View all uploaded images within the
system

UAT01 Evaluate the accuracy of the trained USER Check the accuracy graph the model correctly identifies recolored images as It displays and record graph Pass
model using test images ACCEPTANCE either original or recolored and record the accuracy
TESTING accuracy.

UAT02 A set of new test images


Provide new test images to the trained USER verify that it correctly predicts whether the Result is displayed Pass
model and verify the generated ACCEPTANCE images are original or recolored and format of the
submission file (CSV) containing TESTING file is correct and if it can be submitted for
predictions evaluation.
5.CONCLUSION

In this work, we present a novel deep learning approach for re colored image detection. Both the inter-
channel correlation and the illumination consistency are employed to help the feature extraction. We
elaborate the design principle of our RecDeNet and systematically validate the rationality by running a
number of experiments. Furthermore, two recolored datasets with different sources are created and the
high performance of our RecDeNet demonstrates the effectiveness of the model. We hope our simple yet
effective RecDeNet will serve as a solid baseline and help future research in re colored images detection.
Our future work will focus on designing a more effective network architecture and searching for some
high-level cues for better distinguishing
6.FUTURE ENHANCEMENT

The training set is comprised of images recolored using one algorithm, hence results of the
network may not be very accurate for all recolored images. So, in future the training dataset
will have to be enhanced by using images formed using different algorithms. The dependent
variables in the training of the system can be increased to improve accuracy. An application
can be built using this network to dynamically upload a picture and know genuineness of
image. This network can be attuned to hardware devices so to check a scanned image

You might also like