0% found this document useful (0 votes)
53 views39 pages

Fake Currency Detection

Report on fake currency detection
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)
53 views39 pages

Fake Currency Detection

Report on fake currency detection
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/ 39

INDIAN FAKE CURRENCY DETECTION USING IMAGE

PROCESSING AND MACHINE LEARNING

A report on Project Phase – I submitted


in partial fulfilment of the requirements for the award of the degree of
Bachelor of Technology
in
Computer Science and Engineering
by
Sai Charan Deep Bandu
Registration No.: 2020105252

Kakileti Murari
Registration No.: 2020105244

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


NATIONAL INSTITUTE OF TECHNOLOGY NAGALAND
Chumukedima, Dimapur -797103
DECEMBER 2023
i

INDIAN FAKE CURRENCY DETECTION USING IMAGE


PROCESSING AND MACHINE LEARNING

A report on Project Phase – I submitted


in partial fulfilment of the requirements for the award of the degree of
Bachelor of Technology
in
Computer Science and Engineering
by
Sai Charan Deep Bandu
Registration No.: 2020105252

Kakileti Murari
Registration No.: 2020105244

Under Supervision of
Dr. Nagaraju Baydeti

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


NATIONAL INSTITUTE OF TECHNOLOGY NAGALAND
Chumukedima, Dimapur -797103
DECEMBER 2023
ii

राष्ट्रीय प्रौद्योगिकी संस्थान नािालैंड

NATIONAL INSTITUTE OF TECHNOLOGY NAGALAND


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Chumukedima, Dimapur – 797103, Nagaland

BONAFIDE CERTIFICATE

Certified that this Project titled “INDIAN FAKE CURRENCY DETECTION USING
IMAGE PROCESSING AND MACHINE LEARNING” is the bonafide work of SAI
CHARAN DEEP BANDU (2020105252) & KAKILETI MURARI (2020105243) who
carried out the work under my supervision. Certified further, that to the best of my
knowledge the work reported herein does not form part of any other project or dissertation
on the basis of which a degree or award was conferred on an earlier occasion on this or
any other student.

Dr. ARAMBAM NEELIMA Dr. NAGARAJU BAYDETI


Project Coordinator Project Supervisor
Assistant Professor Assistant Professor
Department of Computer Department of Computer
Science and Engineering Science and Engineering
NIT Nagaland NIT Nagaland

Dr. LITHUNGO MURRY Dr. H. Rohen Singh


Head of Department External Examiner
Assistant Professor Assistant Professor
Department of Computer Department of IT
Science and Engineering School of Engineering and
NIT Nagaland Technology, Nagaland
University
iii

ABSTRACT

Due to the advancement in color printing and scanning technology, the rate of
counterfeit notes production and distribution is massively increasing. Therefore new
problem arises which is faced by almost all the countries. It affects the economy of the
country, since it affects the security of the real economy. Counterfeit currencies are used
to fuel illegal motives, usually involving terrorist activities. According to the various
research, developing countries like India have been impacted by this very negatively.

Even after the steps taken in 2016 to remove the counterfeits, by executing the
demonetization of 500 and 1000-rupees bank notes in India the counterfeits of the new
notes have begun circulating. The primary objective is to detect and reduce circulation of
these counterfeits notes. The secondary objective is to use all the security features of each
denomination provided by Reserve Bank of India for detecting fake notes. This project
gives the complete methodology of fake note detector machine, by leverage cutting-edge
technologies, such as computer vision and machine learning, the aim of this project is
thereby creating a system that can swiftly and accurately distinguish genuine banknotes
from counterfeit ones.

The results of the Convolutional Neural Network model showcase its proficiency in
extracting and interpreting distinctive features within the input data. Each feature model
plays a crucial role in contributing to the model's overall performance, reflecting the
network's ability to discern intricate patterns and representations within image.Our
advanced fake currency detection system stands out by utilizing individual security
features within the input image for precise prediction, distinguishing itself from other
systems that rely on the entire currency note image for analysis.
iv

ACKNOWLEDGEMENT

We wish to place on record our deep sense of gratitude to our honorific Guide
Dr. Nagaraju Baydeti, Assistant Professor, National Institute of Technology for his
supervision, valuable guidance and moral support leading to the successful completion of
the work. Without his continuous encouragement and involvement, this project would not
have been a reality.

We would like to extent my sincere thanks to Dr. Arambam Neelima for their
valuable suggestions. We wish to thank Dr. Lithungo Murry, Department of Computer
Science and Engineering, NIT Nagaland for continuous support. We would also like to
thank all our friends who have developed us to gain a sense of dutifulness, perfection and
sincerity in the effort.

We wish to dedicate this work to our parents, friends and teachers, for they
are the pillars of support giving us confidence in whatever we do. We would like to thank
Shyam Sunder Jannu Soloman, PhD Scholar who has motivated us to work harder and
do our best. Last but not least, we would like to owe our sincere and incessant gratitude to
the almighty God for the immense blessing on us.

Sai Charan Deep Bandu

&

Kakileti Murari
v

TABLE OF CONTENTS

CHAPTER NO. TITLE PAGE NO.

ABSTRACT

LIST OF FIGURES

LIST OF ABBREVIATIONS

1. INTRODUCTION
1.1 GENERAL
1.2 STATE OF ART
1.3 OBJECTIVES
1.4 ORGANIZATION OF THE REPORT

2. DATA COLLECTION AND EXPLORATORY ANALYSIS


2.1 APPROACH AND METHODOLOGY
2.2 DATASET
2.3 EXPLORATORY DATA ANALYSIS
2.4 DATA CLEANING

3. IMAGE PROCESSING
3.1 INTRODUCTION
3.2 NOISE REDUCTION AND OBJECT SEGMENTATION
3.2.1 CLOSING OPERATION
3.2.2 GRABCUT ALGORITHM
3.3 EDGE DETECTION
3.4 CONTOUR DETECTION
3.5 PERSPECTIVE TRANSFORMATION
3.6 FEATURES EXTRACTION USING ROI COORDINATES
vi

4. PROPOSED MODEL
4.1 INTRODUCTION
4.2 CONVOLUTIONAL NEURAL NETWORK
4.2.1 MAX POOLING

5. RESULTS AND DISCUSSIONS


5.1 INTRODUCTION
5.2 PERFORMANCE METRICS
5.3 CONCLUSION

6. CONCLUSION
6.1 INTRODUCTION
6.2 HIGHLIGHTS OF THE WORK
6.3 FUTURE WORK
vii

LIST OF FIGURES

FIGURE NO. TITLE PAGE NO.

1.1 Number of Counterfeit bank notes detected in last 2


5 years.

2.2 Distribution of Real and Fake Images 6

2.2 Hierarchical Representation of Features Dataset 7

2.3 Visual Representation of Real and Fake notes 8


after EDA

3.1 Matrix Representation of Image 10

3.1 Workflow of Image Processing 10

3.2.1 7*7 kernel structure filled with ones 12

3.3 Input Image from dataset 13

3.3 Image after Noise Reduction 13

3.3 Image after Object Segmentation 13

3.3 Image after Edge Detection 13

3.4 Image after Draw Contours 14

3.4 Image after Contours Approximation 14

3.5 Represents Homography Transformation 15

3.5 Image after Perspective Transformation 15

3.6 Dimensions of Note Images 16

3.6 Selected regions of Image 16

3.6 Extracted Security Features of an Input Image 16


viii

4.1 Workflow of Proposed Model 17

4.2 Network Architecture of CNN model 19

4.2 Max Pooling of 2*2 Matrix 20

4.2 Combining values from each model to generate 21


final result

5.2 Confusion Matrix 22

5.2 Accuracy Formula 23

5.2 Accuracy of Feature 1 23

5.2 Prediction of Feature 1 23

5.2 Accuracy of Feature 2 23

5.2 Prediction of Feature 2 23

5.2 Accuracy of Feature 3 24

5.2 Prediction of Feature 3 24

5.2 Accuracy of Feature 4 24

5.2 Prediction of Feature 4 24

5.2 Accuracy of Feature 5 25

5.2 Prediction of Feature 5 25

5.2 Accuracy of Feature 6 25

5.2 Prediction of Feature 6 25


ix

LIST OF ABBREVIATIONS

EDA - Exploratory Data Analysis

CNN - Convolutional Neural Network

TP - True Positive

TN - True Negative

FP - False Positive

FN - False Negative
1

CHAPTER 1

INTRODUCTION

1.1. GENERAL

The burning question all over the world is a counterfeit currency. In the last fiscal
on the account of frauds the banks have lost Rs.16,789 crores. According to the Reserve
Bank of India. The amount that has been lost on account of frauds in the year 2016-17
was Rs. 16,789 crores which was as per the fraud monitoring report submitted by various
banks and different financial institutions. The distribution of Fake currency even
contributes to the growth of terrorism and it acts as life to terrorism.

A significant emphasis is being placed on feature-based counterfeit detection systems


in recognition of these difficulties. This strategy entails aggressively investigating and
creating techniques that depend on unique qualities of banknotes as opposed to their
chemical or physical properties. In this we examine the technique of extracting the
distinctive characteristics of banknotes by image processing. The objective is to
demonstrate the viability of a more approachable and efficient software-assisted
counterfeit currency detection system in the face of developing counterfeiting tactic.

The fake currency Detector machine is the solution for this rising problem which can
be used by a common man. Since this kind of detecting machines are available only in
banks and are not affordable by common man. The usage of counterfeit detection
tools/software are available to stop counterfeiting. They are also efficient in terms of cost,
reliability and accuracy. Taking into consideration of overall scenarios, the common man
needs a solution to find out whether the currency is fake or not so that the value of
currency is not lost.

The following bar graph visually depicts the number of detected counterfeit notes
over the last five years
2

Fig 1. Number of Counterfeit bank notes detected in last 5 years.

1.2. STATE OF THE ART

Given a recent evaluation of the most recent Indian currency denominations, it is


critical to verify the legitimacy of the recently issued banknotes. The Indian Rupee, which
comes in denominations of 10, 20, 50, 200, 500, and 2000 rupees, is the money in
question. In light of the paucity of study on counterfeit money now available, a number
of academics have put forth a variety of approaches to authenticate fake banknotes. A
synopsis of the most important conclusions from these sources is provided below.

A method for identifying real notes from fake was presented by Sharan and Kaur [1].
Using this method, three unique features are extracted from an image: the latent image,
the RBI logo, and the denomination numeral with the Rupee sign. The mean intensity of
the RGB channels in the image is measured. This approach has a notably high degree of
accuracy.

In order to identify currency traits, V. Saxena et al. [2] presented a Principal


Component Analysis (PCA)-based approach that was specifically tailored for the Rs.
2000 Indian currency note. PCA is used to identify patterns in data and show where there
are similarities and differences. The methodology and outcomes are explained through
the use of graphical representations.
3

Neeraja et al. [3] proposed a novel approach for currency note duplicate detection that
makes use of the Dual Tree Complex Wavelet Transform (DTCWT). The system
categorizes bogus elements of the note by combining scores from many fake detection
modules. Using the K-NN technique, the method makes use of two images: the original
image of the paper money and a test image for verification.

Paper currency features were extracted by D. Kumar et al. [4] using ORB and a Brute-
Force matcher technique to accurately detect banknote denominations on both the obverse
and reverse sides. Tested on a range of Indian currency denominations, the combination
of ORB and BF matchers in OpenCV produced a detection accuracy of up to 95.0%.

Fake notes were categorized by A. Kulkarni et al. [5] using an image processing
system. The best approach for feature extraction and matching was found by comparing
several image processing methods in Matlab software (SIFT, ORB, FAST, BRISK,
SURF, BRISK, and KAZE).

In order to improve monetary transparency, Anjana. P. and Apoorva. P. [6] suggested


a super resolution technique that uses MATLAB to convert low-resolution images into
high-resolution ones. This makes it simpler to identify different denominations of
currency.

In their study, Naveen Kumar et al. [7] concentrated on the physical characteristics
of Indian cash, displaying safety elements through image processing techniques. To
differentiate between real and fake notes, the system incorporates safety measures such
the security thread, RBI emblem, and distinctive evidence imprint.

Local Binary Patterns (LBP), Principal Component Analysis (PCA), and the
Euclidean distance algorithm are combined in a method proposed by Kalpna Gautam [8].
This entails using MATLAB to extract features from MAT files and compare them with
input paper money.

An effective image processing authentication model for Indian currency was


proposed by Rencita Maria Colaco et al [9]. utilizing security features such as the Ashoka
Pillar, the portrait of Mahatma Gandhi, the Security thread, the Identification mark, the
Guarantee clause, and the Denomination in Devanagari Script.

The use of image processing techniques for the authentication of Indian paper
currency was discussed by Rubina Mirza et al. [10]. Using edge-based segmentation and
the Sobel operator, the methodology extracts three features: the identity mark, security
thread, and watermark.
4

The entire procedure is effective and suitable for Indian denominations of 100, 500,
and 1000, providing a straightforward and manageable resolution to problems related to
counterfeiting.

1.3. OBJECTIVES

⚫ To leverage cutting-edge technologies, such as computer vision and machine


learning, thereby creating a system that can swiftly and accurately distinguish genuine
banknotes from counterfeit ones.

⚫ To effectively use all security features which are provided by the government of
India, thus enabling the system to reliably distinguish between counterfeit and
genuine currency notes.

1.4. ORGANIZATION OF THE REPORT

The paper is organized as follows:

Chapter 1 gives a brief introduction to the project

Chapter 2 shows data collection and exploratory data analysis

Chapter 3 gives brief introduction to Image Processing

Chapter 4 shows proposed model

Chapter 5 shows the results and discussion

Chapter 6 gives the future work and concludes


5

CHAPTER 2

DATA COLLECTION AND EXPLORATORY DATA


ANALYSIS

2.1. APPROACH AND METHODOLOGY

Jupyter notebooks basically provide an interactive computational environment for


developing Python based Data Science applications. They are formerly known as
ipython notebooks. The following are some of the features of Jupyter notebooks that
makes it one of the best components of Python ML ecosystem −
⚫ Jupyter notebooks can illustrate the analysis process step by step by
arranging the stuff like code, images, text, output etc. in a step-by-step
manner.
⚫ It helps a programmer to document the thought process while developing
the analysis process.
⚫ One can also capture the result as part of the notebook.
⚫ With the help of jupyter notebooks, we can share our work with a peer also.
The steps performed in the jupyter notebook related to this project are-

1. Cleaning the Images Dataset.


2. Preprocessing of Images.
3. Store and Visualize features as shown in figure 3.
4. Start the jupyter notebook by creating an appropriate file name.
5. Load from each feature dataset file and train respective CNN model for
each feature.
6. Calculating accuracy scores.

7. Evaluation of the Model.


8. Save the model, load it and test the model.
6

2.2. DATASET

The dataset used for this project work is benchmark dataset sourced from a conference
paper [9], data is available at Kaggle.com. It comprises of a comprehensive collection of
4000 high-resolution images, with distribution of 3000 genuine and 1000 counterfeit
banknotes of all denominations. The quality and diverse nature of these images make it
ideal for testing and evaluating algorithms in the realm of image processing, particularly
in the context of trained models to distinguish between authentic and manipulated one.
The link of the dataset is mentioned below-

⚫ https://www.kaggle.com/datasets/vishalmane109/indian-currency-note-
images-dataset-2020

Fig 2. Distribution of Real and Fake notes in dataset

After performing image processing techniques, the extracted security features of the
banknotes will be stored in dedicated databases, with each distinct feature being stored in
its own separate database as shown in figure 3.
7

Fig 3. Hierarchical Representation of Features Dataset

2.3 EXPLORATORY DATA ANALYSIS (EDA)

Exploratory Data Analysis (EDA) is a pivotal phase in understanding and preparing


datasets for machine learning tasks, especially when dealing with class-imbalanced data.
One significant challenge is the identification of class imbalances, where one class may
significantly outnumber the other. EDA techniques help in visualizing and quantifying
these imbalances by using techniques like Resampling methods, oversampling the
minority class or undersampling the majority class, can be applied to mitigate class
imbalances. This ensures that machine learning models are not biased towards the
majority class, ultimately leading to more robust and equitable predictions.

EDA encompasses dimensionality reduction techniques like Principal Component


Analysis (PCA) to address the complexity of high-dimensional data, which is often
prevalent in image datasets. By reducing the dimensionality of the data while retaining
essential information, PCA aids in visualizing the separability of classes and identifying
key features for classification.
8

Fig 4. Visual Representation of Real and Fake notes after EDA.

2.4. DATA CLEANING

Dealing with image-based datasets presents a myriad of data cleaning challenges,


each demanding careful consideration to ensure the integrity and quality of the dataset.
One common issue revolves around variations in image brightness, where some images
may be excessively bright or excessively dull. Addressing these variations is crucial to
maintain consistency and prevent skewed model training. Corrupted files pose another
challenge, requiring thorough examination and potential removal to prevent distortions in
the dataset. The presence of different file types and incompatible formats further
complicates matters, necessitating standardization to a uniform format for seamless
integration into analytical pipelines. Tackling these data cleaning issues not only
enhances the overall quality of the dataset but also ensures a solid foundation for
subsequent machine learning tasks, facilitating more accurate and reliable results in
image-based analyses.
9

CHAPTER 3

IMAGE PROCESSING

3.1. INTRODUCTION

Image processing using computer vision (CV) stands at the forefront of pioneering
technologies, offering a transformative approach to understanding, analyzing, and
interpreting images. In recent years, the convergence of advanced algorithms,
computational power, and sophisticated hardware has propelled image processing
through CV into a realm of unprecedented possibilities. This multidisciplinary field
merges computer science, mathematics, and domain-specific knowledge to develop
algorithms and techniques that enable computers to comprehend and extract meaningful
information from images. From medical diagnostics to autonomous vehicles, surveillance
systems to augmented reality, the applications of image processing through CV are vast
and diverse. This introduction marks the entry into a realm where pixels transform into
insights, and patterns in visual data unveil solutions to complex problems. As we delve
into the world of image processing using CV, we embark on a journey where innovation
meets visualization, and the power of computers extends to the nuanced understanding of
the visual world around us.

An image is defined as a two-dimensional function, F(x, y), where x and y are spatial
coordinates, and the amplitude of F at any pair of coordinates (x,y) is called
the intensity of that image at that point.

Types of an image

BINARY IMAGE– The binary image as its name suggests, contain only two pixel
elements i.e, 0 & 1, where 0 refers to black and 1 refers to white.

8 bit COLOR FORMAT– It has 256 different shades of colors in it and commonly
known as Grayscale Image. In this format, 0 stands for Black, and 255 stands for white,
and 127 stands for gray.
10

16 bit COLOR FORMAT– It has 65,536 different colors in it.It is also known as High
Color Format. A 16 bit format is actually divided into three further formats which are
Red, Green and Blue.We will be dealing RGB images in this project.

Images are represented in rows and columns as shown in the following syntax

Fig 5. Matrix Representation of Image

The work flow of feature extraction is shown in figure 5, which encompasses a series
of image processing steps aimed at transforming an input image into a structured
representation that captures essential information for further analysis and pattern
recognition.

Fig 6. Workflow of Image Processing


11

3.2. NOISE REDUCTION AND OBJECT SEGMENTATION

Noise reduction is a fundamental technique used to enhance the quality of an image


by reducing or eliminating unwanted and random variations in pixel values, which are
often referred to as "noise."

Object segmentation is a technique in image processing that involves separating and


isolating objects or regions of interest within an image based on their shapes, sizes, and
spatial relationships. Both Noise reduction and Object segmentation techniques are
performed using morphology operations.

Morphology in image processing is a mathematical framework and a collection of


techniques used to analyze and manipulate the shape and structure of objects within
images.These operations are based on principles derived from mathematical morphology
a theory developed for the analysis of spatial structures.

3.2.1. Closing Operation

Closing morphology technique is useful for closing small gaps within objects in the
image. This operation can help in connecting broken lines caused by noise.

Closing morphology techniques involves dilation followed by erosion.

Dilation is used to expand or dilate shapes in an image, which can help in closing
small gaps and smoothing the image. In dilation, the central pixel of the structuring
element is set by performing logical XOR (for binary images) of the values of the pixels
.

Erosion is used to reduce noise by shrinking or eroding the shapes within an image.
the central pixel in the element is set by performing dual of dilation for the values of the
pixels .

A●B=(A ⊕ B) ⊖B (1)

The Syntax used for performing closing operation:

cv2.morphologyEx(image, cv2.MORPH_CLOSE, kernel)

The kernel used in closing operation is 7*7 matrix in which all elements are filled with
ones.
12

1 1 1 1 1 1 1

1 1 1 1 1 1 1

1 1 1 1 1 1 1

1 1 1 1 1 1 1

1 1 1 1 1 1 1

1 1 1 1 1 1 1

1 1 1 1 1 1 1

Fig 7. 7*7 kernel structure filled with ones.

3.3.2. Grabcut Algorithm

It is used to extract the main object in the image from the background by
roughly specifying the area around the object.

The Syntax used for performing Grabcut Algorithm:

cv2.grabCut(img,mask,rect, bg_mdl, fg_mdl,iterationCount[, mode])

3.3. EDGE DETECTION

Edge detection is a fundamental technique in image processing that aims to identify


boundaries within an image. Detecting edges is crucial for various computer vision tasks,
such as object recognition, image segmentation, etc. The Canny edge detection algorithm
is a popular method for detecting edges in images. Canny edge detection is used to
identify edges of objects within the image. It is a multi-stage process that involves five
key steps:

Gradient Calculation: Detects edge intensity and direction by calculating the


gradient of image using edge detection operators like sobel.
13

Non-maximum Supression: Involves suppressing thin edges.

Fig 8.(a). Input Image from dataset Fig 8.(b). Image after Noise
Reduction

Fig 8.(c). Image after Object Fig 8.(d). Image after Edge
Segmentation Detection
14

Double Thresholding: Used to classify the remaining edge pixels into strong
and weak edge candidates

Edge Tracking by hysteresis: Used to transform weak edge pixels to strong edge
pixels.

3.4. CONTOUR DECTION

Contour is curve that joins all the points lying on the boundary of the object

findContours() - Helps in extracting the contours from the image.

Syntax: cv2.findContours(img,RETR_mode,APRX_met)

drawContours() - is used to draw the detected contours on an image.

Syntax: cv2.drawContours(img,contours,index)

Contour Approximation- Used to approximate the shape of a contour using Douglas-


Peucker algorithm

Syntax: cv2.approxPolyDP(curve,epsilon,closed)

Fig 9.(a). Image after Draw Contours Fig 9.(b). Image after Contours
Approximation
15

3.5. PERSPECTIVE TRANSFORMATION

Perspective Transformation adjusts the original image as it is captured from


different viewpoint using homography matrix.

Homography matrix is calculated as shown below in figure 9,

 x  h11 h12 h13   x


H  y  = h 21 h 22 h 23 *  y 
 1   h31 h 23 h33  1 
Fig 10. Represents Homography Transformation.

perspectiveTransform() - cv2.getPerspectiveTransform(corners,dest_corners)-this line


of code calculates a transformation matrix (homography) that describes how to map the
corners of the detected quadrilateral defined by corners to a new set of corners.

warpPerspective() - cv2.warpPerspective(img,homography,Width,Height)-This line


uses the homography matrix to apply a perspective transformation to the original image.

Fig 11. Image after Perspective Transformation


16

3.6. FEATURE EXTRACTION USING ROI COORDINATES

Involves extracting specific information from an image based on defined regions of


interest.

Image will be resized into desired pixel length using resize function

Syntax:cv2.resize(img,(height,width))

Fig 12. Dimensions of Note Images

EVENT_MOUSEMOVE() - By setting up an event mouse callback method, we can


select a region within the image and it will generate the coordinates((x1,y1),(x2,y2)) of
the chosen region. Sub images are generated using image[y1:y2, x1:x2] by slicing through
generated co-ordinates. 0Once the security features are extracted they are stored as shown
in fig 12(a).

Fig 13.(a). Extracted Security Fig 13.(b). Selected regions of Image


Features of an Input Image
17

CHAPTER 4

PROPOSED MODEL

4.1. INTRODUCTION

For the Economic growth of a nation the currency is playing a pivotal role. So, to
overcome counterfeit currency in our country. In this chapter we have proposed a model
to take the currency note as an input and to perform image processing and machine
learning tasks on the currency note to determine whether the currency note is real or fake.

Fig 14. Workflow of Proposed Model

After storing all the extracted security features from each input image in their respective
feature datasets, as illustrated in figure 3, an individual CNN model is trained for each
feature. Subsequently, fusion of a boolean-valued vector comprising the values from all
feature models, is evaluated to calculate the result of the overall model.
18

4.2. Convolutional Neural Network

The objective of this CNN model is to classify images into two categories i.e, real or
fake, leveraging convolutional layers for feature extraction and dense layers for
classification. The network architecture includes convolutional layers with increasing
filter sizes, max-pooling layers for spatial down-sampling, and dense layers for final
classification.

The CNN model consists of three sets of convolutional layers followed by max-pooling
each layer.
model=tf.keras.models.Sequential([tf.keras.layers.Conv2D(16,(3,3),activation='relu',input_shape=(107, 435,3)),

tf.keras.layers.MaxPool2D(2,2),

tf.keras.layers.Conv2D(32,(3,3),activation='relu'),

tf.keras.layers.MaxPool2D(2,2),

tf.keras.layers.Conv2D(64,(3,3),activation='relu'),

tf.keras.layers.MaxPool2D(2,2),

tf.keras.layers.Flatten(),

tf.keras.layers.Dense(512,activation='relu'),

tf.keras.layers.Dense(1,activation='sigmoid')

])

The convolutional layers utilize 3x3 filters, progressively increasing from 16 to 32 and
64 filters. Max-pooling layers with a 2x2 pool size follow each convolutional layer to
down-sample spatial dimensions. A Flatten layer transforms the 3D tensor output into a
1D tensor, which is then fed into two Dense layers. The first Dense layer has 512 units
with a ReLU activation function, and the final layer with 1 unit uses a sigmoid activation
for binary classification.

The required Conv2D parameters are activation function, height and width of input
image, number of filters that the convolutional layer will learn.

Layers early in the network architecture learn fewer convolutional filters while layers
deeper in the network will learn more filters.Conv2D layers in between will learn more
filters than the early Conv2D layers but fewer filters than the layers closer to the output.
19

Fig 15. Network Architecture of CNN Model


20

4.2.1. Max Pooling

The process of pooling that chooses the maximum element from the area of the
feature map that the filter covers is called max pooling. As a result, the output after max-
pooling layer would be a feature map containing the most prominent features of the
previous feature map.

Fig 16. Max Pooling of 2*2 Matrix

The output of a CNN model typically consists of predictions or classifications for the
given input. In the context of binary classification tasks, where the goal is to categorize
input data into one of two classes, the CNN model will produce an output that can be
interpreted as either true or false, corresponding to the predicted class for the given input.
This binary nature of the output reflects the model's decision on the presence accurate
features, ultimately resulting in a categorical assignment of the input data.

Following the output of the Convolutional Neural Network (CNN) model, a post-
processing step involves type casting the predicted values. In this context, the model's
output, which signifies true or false based on the binary classification task, will be
explicitly converted to numerical values. Specifically, the conversion will be to type cast
true to 1 and false to 0. This transformation facilitates a convenient representation of the
model's predictions in a numeric format, allowing for straightforward interpretation and
compatibility with various analytical or computational procedures that may require
numerical input.
21

Feature 1 Feature 2 Feature 3 Feature N-2 Feature N-1 Feature N

........
1 0 1 1 0 1

Fig 17. Combining values from each model to generate final result

The dot product will be computed by multiplying corresponding values from each
model as shown in figure 16 . This process involves taking the individual predicted scores
generated by each model and performing dot product to predict a final value. The dot
product operation ensures that the influence of each model's prediction is considered in
the overall outcome.
22

CHAPTER 5

RESULTS AND DISCUSSIONS

5.1. INTRODUCTION

In this section, we delve into the interpretation and discussion of the results obtained,
on implementing Convolutional Neural Network (CNN) model. The results encapsulate
the model's ability to learn intricate patterns and make predictions on images with a focus
on accuracy. The architecture of a CNN, with its convolutional layers, flattened layers,
and dense layers, is designed to capture minute details from images. CNN uses small
squares of input data and slides them over the entire image to learn local patterns. CNN
allows the network to learn hierarchical representations, capturing simple features in the
early layers and complex structures in deeper layers.

5.2. PERFORMANCE METRICS

A confusion matrix is a matrix that summarizes the performance of a machine


learning model on a set of test data. It is often used to measure the performance of
classification models, which aim to predict a categorical label for each input instance.
The matrix displays the number of true positives (TP), true negatives (TN), false positives
(FP), and false negatives (FN) produced by the model on the test data.

Fig 17. Confusion Matrix


23

Accuracy is used to measure the performance of the model. It is the ratio of Total correct
instances to the total instances.
Accuracy can be calculated by

Fig 18. Accuracy Formula

FEATURE 1

Fig 19.(a). Accuracy of Feature 1 Fig 19.(b). Prediction of Feature 1

FEATURE 2

Fig 20.(a). Accuracy of Feature 2 Fig 20.(b). Prediction of Feature


24

FEATURE 3

Fig 21.(a). Accuracy of Feature 3 Fig 21.(b). Prediction of Feature 3

FEATURE 4

Fig 22.(a). Accuracy of Feature 3 Fig 22.(b). Prediction of Feature 3


25

FEATURE 5

Fig 22.(a). Accuracy of Feature 3 Fig 22.(b). Prediction of Feature 3

FEATURE 6

Fig 23.(a). Accuracy of Feature 3 Fig 23.(b). Prediction of Feature 3

5.3. CONCLUSION

The output of a CNN model typically consists of predictions or classifications for the
given input. In the context of binary classification tasks, where the goal is to categorize
input data into one of two classes, the CNN model will produce an output that can be
interpreted as either true or false, corresponding to the predicted class for the given input.
This binary nature of the output reflects the model's decision on the presence accurate
features, ultimately resulting in a categorical assignment of the input data.
26

CHAPTER 6

CONCLUSION

6.1. INTRODUCTION

This paper presents a robust and innovative approach to counterfeit currency


detection through the integration of computer vision techniques and Convolutional Neural
Networks (CNNs). The study begins by outlining the architecture and methodology of
Image processing techniques followed by Machine learning model affirming its reliability
in distinguishing between authentic and counterfeit currencies. The proposed system
exhibits promising results, demonstrating its potential for real-world applications across
a spectrum of environments, from financial institutions to retail establishments and to
cater the needs of common people.

6.2. HIGHLIGHTS OF THE WORK DONE

The journey begins with the raw input image, where the first steps involve noise
reduction and object segmentation. Robust preprocessing techniques are employed to
enhance image quality, ensuring clarity in subsequent stages. The processed image
undergoes edge detection, a critical step in identifying boundaries and prominent features.
Contour detection further refines this process, by outlining distinct shapes within the
image. Perspective transformation corrects distortions in the image, ensuring accurate
spatial relationships. This is particularly beneficial for images with skewed perspectives
or angles. Regions of interest are extracted with precision, focusing on the areas
containing essential information. This step involves isolating key elements from the
image, laying the foundation for subsequent feature extraction. The extracted ROIs serve
as the basis for feature dataset creation. Essential characteristics and patterns within the
regions are meticulously documented, forming a rich dataset essential for training the
Convolutional Neural Network (CNN). Leveraging the curated feature dataset, a CNN
model is trained to recognize and understand intricate patterns. The model undergoes
27

iterative training, learning to discern the nuances within the features and enhancing its
predictive capabilities.

The trained CNN model is put to the test using a new image. This step assesses the
model's generalization and its ability to accurately classify and interpret features within
unseen data. The final result is derived from the trained model's predictions on the test
image.

6.3. FUTURE WORK

⚫ To train on various machine learning models for one denomination and after
analyzing the results, will subsequently train the model for other denominations.

⚫ Endeavor to extend our capabilities to include counterfeit currencies from other


nation
28

REFERENCES

1. V. Sharan and A. Kaur, “Detection of Counterfeit Indian Currency Note using Image
Processing”, International Journal of Engineering and Advanced Technology, Vol. 9,
no. 1, pp. 2440-2447, 2019.

2. V. Saxena and Snehlata, “An Efficient Technique for Detection of Fake Currency”,
International Journal of Recent Technology and Engineering, Vol. 8, no. 3, pp. 1298-
1305, 2019.

3. Y. Neeraja, B. Divija and M. Nithish Kumar, “Fake currency Detection using K-NN
Technique”, International Journal of Research in Engineering, IT and Social Science,
Vol. 9, no. 1, pp. 201-205, 2019.

4. D. Kumar and S. Chauhan, “Indian Fake Currency Detection Using Computer


Vision”, International Research Journal of Engineering and Technology, Vol. 7, no.
5, pp. 2870-2874, 2020.

5. A. Kulkarni, P. Kedar, A. Pupala and P. Shingane, “Original vs Counterfeit Indian


Currency Detection”, ITM Web of Conferences, Vol. 32, p. 03047, 2020.

6. Anjana. P and Apoorva. P, “A Novel Approach for Identification of Indian Currency


using Super Resolution Method”, International Journal of Innovative Technology and
Exploring Engineering, Vol. 8, no.8, pp.1417-1422,2019.

7. T. Naveen Kumar, T. Subhash, S. Saajid Rehman, N. Hari Babu, P. Sai and D. Regan,
“Fake Currency Recognition System for Indian Notes Using Image Processing
Techniques”, Journal of Emerging Technologies and Innovative Research, Vol. 6, no.
4, pp. 30-35, 2019.

8. K. Gautam, “Indian Currency Detection using Image Recognition Technique”, In


Proceedings of the International Conference on Computer Science, Engineering and
Applications (ICCSEA), 2020.

9. Aman Bhatia, Vansh Kedia, Anshul Shroff, Mayand Kumar, Bickey Kumar Shah,
Aryan, “Fake Currency Detection with Machine Learning Algorithm and Image
29

Processing”, In Proceedings of the Fifth International Conference on Intelligent


Computing and Control System (ICICCS), 2021.

10. Kiran Kamble, Anuthi Bhansali, Pranali Satalgaonkar, Shruthi Alagundgi,


“Counterfeit Currency Detection using Deep Convolutional Neural Network”, In
Proceedings of the IEEE Pune section International Conference (PuneCon), Dec 18-
20, 2019.

You might also like