Final Report3
Final Report3
On
CURRENCY RECOGNITION SYSTEM
Of
PROJECT
KCA451
MCA -II YEAR /III Semester
Submitted by
I hereby declare that the project work entitled “Currency Recognition System”
submitted to the MCA Department, PSIT Kanpur. It is a record of an original work
done by me under the guidance of Dr. Gyanendra Kumar Gupta, Professor, MCA,
and this project work is submitted in the partial fulfilment of the requirements for
the award of the degree of Master of Computer Application. The results embodied
in this project have not been submitted to any other University or Institute for the
award of any degree or diploma.
We would like to acknowledge all whose guidance and encouragement that has made
us to do what is done so far, we avail the opportunity to express our deep sense of
gratitude and sincere thanks to our college. We express our sincere gratitude to Dr.
Rahul Deo Shukla, Head of Department, MCA, PSIT, Kanpur for providing us the
facilities.
We take this opportunity to express our heartfelt sincere thanks to Faculty of MCA,
whose encouragement and best wishes provided impetus for this project. Our sincere
gratitude to our Supervisor, Dr. Gyanendra Kumar Gupta, Professor, Department
Of Computer Application, for this valuable suggestion and giving us permission to
commence this project in the first instance, to do the necessary research work and to
use the organizational data.
Last but not the least we also thank to our parents for being supportive in all our
activities and carrier without whom it wouldn’t be possible for us to reach successful
completion of this project.
With gratitude ,
Bhoomika Awasthi
2301640140062
MCA-2A
ABSTRACT
I. Chapter:-1
• Introduction 8
➢ Problem Definition 9
➢ Purpose 10
➢ Hardware and software specification 12
➢ Problem Statement 14
➢ Proposed Solution 15
➢ Scope 16
II. Chapter:-2
• Project analysis 18
➢ Study of Existing system 19
➢ Gap In Study 21
➢ Feasibility study 23
➢ Tools used to gather information 26
III. Chapter:-3
• Project Design
➢ Software requirement specification 29
➢ Software functional specification 31
➢ Data flow diagram 33
➢ E-R diagram 36
➢ UML diagrams 39
IV. Chapter:-4
• System implementation 45
V. Chapter:-5
➢ Testing 56
➢ System input and output screenshot 58
➢ Limitations and Scope of project 66
VI. Conclusion 70
VII. References 71
Chapter:-1
INTRODUCTION
8
PROBLEM DEFINITION
Security and Authentication: The system must not only recognize the
currency but also identify counterfeit notes by detecting hidden security
features such as watermarks, holograms, and microprinting.
Real-time Processing: The recognition system must process and classify the
currency in real time or near real-time to be applicable in practical
applications such as ATMs, cash handling machines, and point-of-sale
systems
9
PURPOSE
The Currency Recognition System is designed to transform the way Indian currency is
identified and utilized by offering a seamless, efficient, and intelligent solution. This
project focuses on addressing key challenges in currency handling, authentication, and
education using the power of deep learning.
Key objectives of the project include:
• Enhancing Accuracy: Providing a reliable solution to accurately identify Indian
currency denominations in real time, minimizing human error.
• Streamlining Transactions: Simplifying cash handling in banking, retail, and other
financial operations by automating the recognition process.
• Educating and Empowering Users: Demonstrating the practical applications of AI
and deep learning, making it a valuable tool for educational and training purposes.
• Delivering Real-Time Insights: Offering instant recognition and detailed
information about currency notes for improved user experience.
With its emphasis on innovation and real-world utility, the Currency Recognition System
aspires to:
• Serve as an efficient tool across various sectors such as banking, retail, and
education.
• Demonstrate the potential of artificial intelligence in solving everyday challenges.
• Promote accessibility and user-friendliness to ensure widespread adoption and
impact.
This project is a testament to the transformative power of technology, bridging the gap
between artificial intelligence and practical problem-solving to create a smarter, more
efficient future.
10
Social Interaction:
Games offer an escape from the stresses and challenges of everyday life,
allowing players to unwind, relax, and immerse themselves in virtual worlds of
their choosing. Whether exploring a vast open world, solving puzzles, or
engaging in casual game play, games provide a form of entertainment that can
be both stimulating and therapeutic.
Commercial Success:
11
HARDWARE AND SOFTWARE SPECIFICATION:
➢ Hardware Specifications:
12
➢ Software Specifications:
13
PROBLEM STATEMENT
The accurate identification and handling of currency notes remain a challenge in various
sectors such as banking, retail, and education. Manual processes are prone to errors, time-
consuming, and inefficient, especially when handling large volumes of cash or unfamiliar
denominations. Moreover, individuals with visual impairments or limited exposure to
currency details face significant barriers in identifying and using currency effectively.
Key Challenges:
• Accuracy and Efficiency:
Traditional methods of currency recognition rely heavily on manual inspection,
leading to potential errors and delays in operations such as cash handling and
transactions.
• Accessibility:
People with visual impairments or limited literacy may struggle to identify currency
denominations, making financial independence and inclusion difficult.
• Counterfeit Detection:
With counterfeit currency circulation on the rise, existing tools often lack the
precision or affordability required to effectively authenticate notes.
• Real-Time Recognition:
A reliable solution for real-time currency recognition using widely available
devices, like laptop cameras, is currently lacking in the market.
The Currency Recognition System aims to address these challenges by leveraging deep
learning to create a robust and accessible tool for real-time Indian currency recognition.
By providing accurate, efficient, and user-friendly functionality, this project seeks to
streamline cash handling processes, promote financial inclusivity, and ensure counterfeit
detection.
14
PROPOSED SOLUTION
To address the challenges outlined in the problem statement, the Currency Recognition
System aims to provide an accurate, efficient, and user-friendly tool for identifying Indian
currency in real time. The solution leverages deep learning technologies to ensure
reliability, accessibility, and scalability for diverse applications.
1. Model Optimization:
o Develop and train robust deep learning models using frameworks like
PyTorch and TensorFlow for accurate currency recognition.
o Continuously improve model performance by incorporating larger datasets
and fine-tuning algorithms.
2. Image Preprocessing:
o Implement advanced image preprocessing techniques (e.g., noise reduction,
color correction) to ensure consistent results across different lighting
conditions and angles.
3. Real-Time Processing:
o Use optimized computer vision libraries like OpenCV to enable seamless
real-time recognition through laptop cameras or external devices.
4. Error Mitigation:
o Regularly test and validate the system to minimize false positives and
negatives, ensuring high reliability in diverse environments.
1. User-Friendly Interface:
o Design an intuitive graphical user interface (GUI) that provides clear
instructions and visual/audio feedback for easy navigation and use.\
2. Voice Assistance:
o Integrate voice-based outputs to announce recognized currency
denominations, catering to users with visual impairments.
3. Language Support:
o Provide multilingual support to increase accessibility for users across
different regions of India.
15
Counterfeit Detection and Security:
1. Authentication Features:
o Incorporate counterfeit detection capabilities by training models to identify
specific security features (e.g., watermarks, micro-text, and color patterns) on
genuine currency notes.
2. Continuous Updates:
o Regularly update the system to adapt to new currency designs and security
enhancements introduced by regulatory authorities.
1. Cross-Platform Compatibility:
o Ensure the system works seamlessly across different operating systems
(Windows, macOS, Linux) to cater to a broader audience.
2. Edge Computing:
o Optimize the system for lightweight deployment on edge devices, enabling
offline recognition without reliance on high-end hardware.
3. Integration Possibilities:
o Develop APIs to integrate the system with cash handling machines, point-of-
sale (POS) systems, or educational tools for wider applicability.
16
PROJECT SCOPE
17
Integration and Deployment
• Develop a cross-platform application compatible with major operating systems
(Windows, macOS, Linux).
• Optimize the system for real-time deployment on standard laptops using built-in or
external cameras.
• Enable future scalability by designing APIs for integration with other systems like
ATMs or point-of-sale machines.
18
Chapter :-02
19
PROJECT ANALYSIS
Objectives
1. Currency Recognition: Develop a system capable of identifying Indian currency
denominations with high accuracy.
2. Counterfeit Detection: Integrate features to authenticate currency notes and detect
counterfeit ones.
3. Accessibility: Provide inclusive functionality, such as audio announcements and a
user-friendly interface, to cater to diverse users, including visually impaired
individuals.
4. Real-Time Performance: Enable real-time currency recognition using a standard
laptop camera or similar devices.
5. Scalability: Design the system for scalability, allowing future integration with other
applications like ATMs or point-of-sale systems.
Design
1. Client-Side Application:
o Develop a Python-based application with an intuitive graphical user interface
(GUI).
o Use frameworks such as PyTorch and TensorFlow for machine learning tasks.
2. Image Processing:
o Integrate OpenCV for real-time image capture and preprocessing to enhance
recognition accuracy.
3. Model Training:
o Train deep learning models using a diverse dataset of Indian currency images
for robust performance.
o Incorporate counterfeit detection by recognizing unique security features on
notes.
4. System Architecture:
o Build the application to work locally on laptops without reliance on high-end
hardware or internet connectivity.
o Ensure modularity for easy future enhancements
20
Features and Functionality
1. Recognition Mechanism:
o The system captures currency images via a camera and identifies
denominations in real time.
2. Accessibility Features:
o Audio output for recognized denominations to assist visually impaired users.
o Multilingual support for wider accessibility.
3. Counterfeit Detection:
o Verify security features like watermarks and patterns to authenticate genuine
currency.
4. User Feedback and Logs:
o Maintain a log of recognized currencies and provide users with actionable
feedback.
Potential Challenges
1. Dataset Diversity:
o Acquiring a comprehensive dataset covering different denominations,
orientations, lighting conditions, and wear levels of notes.
2. Model Accuracy:
o Balancing recognition accuracy and processing speed to ensure real-time
performance.
3. Counterfeit Variability:
o Training the system to detect counterfeits that may vary in quality and
replication techniques.
4. Hardware Limitations:
o Optimizing the system to run efficiently on standard laptops without requiring
high-end hardware.
5. User Experience:
o Designing an interface that is both simple for non-technical users and robust
enough for professional applications.
21
➢ Study of existing system:
Studying existing systems for currency recognition involves analyzing the tools,
frameworks, models, methodologies, and technologies used in similar applications. This
helps identify best practices and challenges and determine the most suitable approach for
your project. Below are the key aspects to consider:
Hardware Requirements
Currency recognition systems must operate efficiently on accessible hardware. Studying
existing systems involves analyzing:
• Hardware-accelerated processing (using GPUs or TPUs) for training models.
• Deployment on devices with limited computational power, such as laptops or
mobile devices, while maintaining performance.
22
Accessibility Features
Accessibility is a key feature of modern recognition systems. Existing systems offer:
• Text-to-Speech (TTS): Used for vocalizing currency denominations, particularly
for visually impaired users.
• Multilingual Support: Providing outputs in various languages to cater to diverse
users.
Studying these features involves exploring APIs and libraries like gTTS or Microsoft
Azure TTS for integrating speech functionalities.
Development Methodologies
Adopting a systematic development approach ensures efficient project execution.
Commonly used methodologies include:
• Agile: For iterative development, frequent testing, and continuous feedback.
• Scrum: Organizing tasks into sprints for focused development and timely delivery.
• Waterfall: A linear approach for projects with clearly defined requirements.
Studying these methodologies involves selecting the one best suited to the project’s goals,
timeline, and resource availability.
23
➢ Gap in existing system:
Identifying the gaps in existing currency recognition systems highlights areas where
your project can innovate and provide enhanced functionality. Below are key gaps in
current systems:
1. Accessibility for Diverse Users
• Existing Gap:
o Most currency recognition solutions lack comprehensive accessibility
features, such as support for visually impaired users, multilingual
interfaces, or simple voice feedback.
• Proposed Improvement:
o Include text-to-speech in regional languages and customizable
interfaces to cater to users with varying needs.
2. Real-Time Recognition Efficiency
• Existing Gap:
o Current systems often struggle with real-time processing on standard
hardware, leading to delays or inaccuracies.
• Proposed Improvement:
o Optimize deep learning models for real-time performance using
lightweight architectures compatible with low-power devices.
3. Dataset Diversity
• Existing Gap:
o Many systems rely on limited datasets, resulting in poor recognition
accuracy under varying conditions like lighting, angles, and wear-
and-tear on currency notes.
• Proposed Improvement:
o Create a diverse dataset of Indian currency that includes notes in
different conditions (crumpled, soiled) and under varied lighting
scenarios.
4. Counterfeit Detection
• Existing Gap:
o Few systems incorporate robust counterfeit detection capabilities,
limiting their effectiveness for financial institutions or high-security
applications.
• Proposed Improvement:
o Integrate counterfeit detection features based on fine-grained patterns
and holographic elements using advanced image processing
techniques.
5. Scalability and Adaptability
• Existing Gap:
o Existing solutions often lack scalability, making it difficult to
integrate support for new currency designs or denominations.
• Proposed Improvement:
o Develop modular algorithms that can be easily retrained or updated
to recognize new currency features without significant
24
redevelopment.
6. Cross-Platform Compatibility
• Existing Gap:
o Many systems are limited to specific devices or platforms, reducing
their utility for a wide range of users.
• Proposed Improvement:
o Ensure compatibility with multiple platforms, such as desktop,
mobile, and cloud-based solutions, for maximum reach and
flexibility.
7. Cost of Implementation
• Existing Gap:
o High costs of existing hardware-based solutions make them
inaccessible to smaller businesses or individual users.
• Proposed Improvement:
o Utilize software-only solutions leveraging existing hardware (e.g.,
laptop webcams) to reduce costs and make the system widely
accessible.
8. Lack of Multilingual Support
• Existing Gap:
o Existing systems rarely offer multilingual support, alienating non-
English-speaking users.
• Proposed Improvement:
o Incorporate support for multiple Indian languages in both textual and
audio outputs.
9. Data Privacy and Security
• Existing Gap:
o Systems often overlook data privacy concerns, especially for
connected solutions that store or process user data remotely.
• Proposed Improvement:
o Ensure compliance with data privacy regulations like GDPR and
implement secure, on-device processing to minimize data risks.
10. User Training and Ease of Use
• Existing Gap:
o Current systems require technical knowledge or training to operate
effectively, limiting usability for non-tech-savvy individuals.
• Proposed Improvement:
o Develop an intuitive user interface with guided tutorials and easy-to-
understand instructions.
25
➢ Feasibility study:
A feasibility study evaluates the technical, financial, and operational aspects of the
Currency Recognition System to ensure its viability and success. Below are the key
components:
Market Analysis
• Objective: Assess the demand and potential user base for the system.
o Target Users: Banks, retailers, visually impaired individuals, and educational
institutions.
o Competitive Landscape: Evaluate existing currency recognition solutions
and identify gaps, such as limited real-time capabilities and lack of support
for Indian currency.
o Market Demand: Analyze trends indicating the increasing need for
digitization and automation in financial transactions.
o Distribution Channels: Consider software platforms like app stores, direct
licensing, or bundling with hardware.
Concept Evaluation
• Objective: Validate the project's uniqueness and practical appeal.
o Innovation: Emphasize real-time recognition, counterfeit detection, and
multilingual support for Indian currency.
o Feasibility: Assess the implementation of machine learning models using
PyTorch and TensorFlow to achieve accurate recognition and lightweight
processing.
o User Appeal: Include accessibility features like audio feedback and simple
user interfaces to enhance usability.
Technical Assessment
• Objective: Evaluate technical requirements and challenges.
o Development Tools: Use Python, PyTorch, and TensorFlow for machine
learning; OpenCV for image processing.
o Hardware: Ensure compatibility with standard laptop webcams and low-end
computing systems.
o Challenges: Address issues like varying lighting conditions, note wear-and-
tear, and real-time performance optimization.
o Scalability: Design modular systems to accommodate new denominations or
currency changes.
26
Resource Planning
• Objective: Estimate resources and develop a detailed plan.
o Human Resources: Require expertise in Python, machine learning, and
software development.
o Timeframe: Plan for 3–6 months, including dataset preparation, model
training, and testing.
o Budget: Include costs for development, testing, and potential third-party tools
or APIs.
o Partnerships: Consider collaborations with financial institutions or visually
impaired organizations for user feedback.
27
• Objective: Ensure smooth execution and project management.
o Team Expertise: Leverage team skills in machine learning, UI/UX design,
and software testing.
o Development Workflow: Use Agile methodologies for iterative development
and quick feedback cycles.
o Collaboration Tools: Utilize GitHub for version control and Trello for task
management.
28
29
➢ TOOLS USED TO GATHER INFORMATION
Online Research
• Objective: Collect information on similar projects, machine learning techniques,
and deep learning models.
o Resources: Use search engines, forums, and dedicated websites such as
Kaggle (for datasets), Stack Overflow (for technical queries), and GitHub (for
open-source projects).
o Communities: Engage with developer communities like TensorFlow Forums
and PyTorch Discussion Boards to gain insights and solutions for specific
challenges.
Development Tools
• Objective: Build and implement the system's features.
o Frameworks and Libraries:
▪ TensorFlow: For training and deploying machine learning models.
▪ PyTorch: For fine-tuning pre-trained models and building custom
models.
▪ OpenCV: For real-time image capture and processing.
o IDE/Editor: Use Google Colab for running experiments and Python IDEs
like PyCharm for local development.
o Version Control: Git and GitHub for managing code and collaboration.
Dataset Sources
• Objective: Gather high-quality data for model training and testing.
o Resources:
▪ Kaggle datasets featuring Indian currency images.
▪ Custom data collection using laptop cameras for real-world samples.
▪ Tools like LabelImg for annotating datasets.
31
32
33
34
Chapter:- 03
35
PROJECT DESIGN
1. Introduction
1.1 Purpose
The system helps identify Indian currency notes in real-time
using a laptop camera. It aims to assist users in quickly
detecting denominations.
1.2 Scope
The system uses machine learning to recognize Indian
currency. It is useful for visually impaired individuals,
businesses, and educational purposes.
1.3 Definitions, Acronyms, and Abbreviations
ML: Machine Learning
OCR: Optical Character Recognition
1.4References
No references were used during the design of this SRS.
1.5 Overview
2. Overall Description
2.1 Product Perspective
The system integrates with a laptop camera, processes
images, and uses pre-trained ML models for real-time
36
recognition.
2.2 Product Functions
Captures live images of currency notes.
Recognizes denomination and displays results.
Alerts users if the note is counterfeit.
2.3 User Characteristics
3. Specific Requirements
3.1 Functional Requirements
Capture Image: Use the laptop camera to capture images.
Process Image: Recognize the denomination using pre-
trained ML models.
Display Result: Show the denomination on the screen.
3.2 Non-Functional Requirements
Performance: Response time under 2 seconds.
Usability: Simple UI for all users.
37
Security: No storage of sensitive data.
3.3 External Interface Requirements
User Interface: A window displaying the live camera feed
and results.
Hardware Interface: Laptop camera with minimum 720p
resolution.
4. Design Constraints
The system must run on Python 3.7+ and TensorFlow 2.x.
Works best on systems with GPU for faster processing.
5.2 Portability
Should work on both Windows and Linux operating systems.
5.3 Maintainability
Regular updates for adding new currency notes or improving
detection accuracy.
38
➢ Software Functional Specification:
Introduction
This document defines the functional requirements of the Currency Recognition System.
It provides a detailed description of the system’s features, interactions, and expected
behavior to ensure clarity in development and implementation.
Scope
• Objective: To develop a real-time currency recognition system that identifies Indian
currency using a laptop camera and provides detailed information about the
denomination and features.
• Target Audience: Individuals with visual impairments, banking professionals, and
educational institutions.
• Platforms: Windows or Linux operating systems, compatible with standard laptop
configurations.
• Major Features:
o Real-time currency detection and recognition.
o Support for multiple denominations of Indian currency.
o User-friendly interface for visual and audio feedback.
o Ability to provide information about currency features, such as security marks
and dimensions.
Overall Description
System Concept
The system uses machine learning (ML) and computer vision (CV) techniques to identify
Indian currency in real-time. It leverages TensorFlow or PyTorch for ML model
deployment and OpenCV for image processing.
System Flow
1. Launch: Start the application via a desktop shortcut or command line.
2. Camera Activation: Automatically activates the laptop’s camera to capture live
video feed.
3. Currency Recognition:
o Detect currency in the camera frame.
o Classify the denomination using the trained ML model.
4. Feedback:
o Display the recognized denomination on the screen.
o Provide optional audio feedback for visually impaired users.
39
5. Additional Information:
o Display security features or fun facts about the detected currency.
6. Exit: Close the application.
User Roles
• End Users: Individuals using the system for currency recognition.
• Administrators/Developers: Responsible for system updates, model training, and
performance tuning.
Functional Requirements
Input Methods
• Laptop camera for live video input.
• Mouse or keyboard for user interactions.
Core Functionalities
1. Currency Detection:
o Identify the presence of Indian currency in the camera feed.
o Locate and crop the detected currency for analysis.
2. Denomination Classification:
o Use a pre-trained deep learning model to classify the denomination (e.g., ₹10,
₹20, ₹50, etc.).
3. Information Display:
o Show recognized denomination on the UI.
o Provide optional audio feedback for better accessibility.
4. Error Handling:
o Notify users if no currency is detected or if recognition fails.
o Provide tips for proper camera alignment.
Use Cases
• Scenario 1: A user holds a ₹100 note in front of the camera.
o Expected Outcome: The system detects and classifies the note as ₹100 and
provides information via text and audio.
• Scenario 2: A non-Indian currency or invalid input (e.g., a plain piece of paper) is
presented.
o Expected Outcome: The system notifies the user of an invalid input.
Functional Dependencies
• Dependency on:
o Laptop camera hardware.
o Trained ML model and dataset.
o OpenCV for image processing.
o TensorFlow or PyTorch for model inference.
40
Assumptions and Constraints
• Assumptions:
o The system is used in a well-lit environment for accurate recognition.
o Users have basic familiarity with operating the system.
• Constraints:
o Limited to Indian currency recognition.
o Requires a laptop with a minimum of 4GB RAM and a functional camera.
o Real-time performance is subject to hardware capabilities.
References
• TensorFlow and PyTorch official documentation for model deployment.
• OpenCV documentation for image processing techniques.
• Kaggle dataset for Indian currency images.
41
DFD (Data Flow Diagram)
A Data Flow Diagram (DFD) is a graphical representation of the flow of
data within a system. Creating a Data Flow Diagram (DFD) for currency
recognition involves visualizing the flow of data within the development
process. It shows how data moves through different processes and data
stores. Here's a simplified DFD for recognizing currency :
Level 0 DFD:
Entities:
1. User: Provides the input (Indian currency image) to the system.
2. System (Run Recognition): The core process that performs currency recognition.
3. Data Store: Holds trained model data and additional information about the
currency.
DFD Description
• Input:
o The user inputs an image of the currency through the laptop camera or other
input devices.
• Processing:
o The system processes the image using a trained deep learning model
(PyTorch/TensorFlow) to identify the denomination.
o The system retrieves relevant information about the currency (e.g., value,
security features) from the data store.
• Output:
o The system provides the recognized denomination and additional details
about the currency to the user.
42
Level 1 DFD:
The Level 1 DFD provides further decomposition of the system, breaking the main
process into distinct subprocesses while illustrating how inputs, processing, and
outputs interact. It shows more specific workflows and connections within the
system.
Inputs
1. Currency Image Input: Images captured by the laptop camera.
2. Pre-Trained Model: Deep learning model loaded for recognition tasks.
3. User Request: User actions like viewing results or accessing information.
Processes
1. Image Acquisition: Capture images of currency through the laptop camera.
2. Pre-Processing: Enhance images (e.g., resizing, filtering) for recognition.
3. Currency Recognition: Detect and classify the denomination using the pre-trained
deep learning model.
4. Information Retrieval: Provide additional details about the recognized currency.
5. Result Display: Present identified currency and supplementary information to the
user.
Outputs
1. Recognized Currency: Denomination identified by the system.
2. Additional Details: Facts or data about the recognized currency (e.g., security
features, historical info).
3. Logs: Data stored for debugging, reporting, or analytics.
43
44
E-R Diagram:
46
47
UML DIAGRAM
48
49
USE CASE DIAGRAM:
50
FLOW CHART
51
BLOCK DIAGRAM
52
Chapter:- 04
53
System Implementation:
import os
import shutil
import random
================================================================
=============
# 1. Data Preprocessing: Organizing Dataset into Train, Val, and Test Folders
================================================================
=============
# Define paths
dataset_dir =
r"C:\Users\dwive\Desktop\python_project\.ipynb_checkpoints\currency_model.h5\Train"
output_dir =
r"C:\Users\dwive\Desktop\python_project\.ipynb_checkpoints\currency_model.h5\Test"
classes = os.listdir(dataset_dir)
54
for split in ['train', 'val', 'test']:
train_ratio = 0.7
val_ratio = 0.15
test_ratio = 0.15
images = os.listdir(class_dir)
random.shuffle(images)
if i < train_count:
split = 'train'
split = 'val'
else:
55
split = 'test'
================================================================
=============
================================================================
=============
import tensorflow as tf
# Paths
# Image dimensions
img_height = 128
img_width = 128
batch_size = 32
rescale=1.0/255,
rotation_range=30,
width_shift_range=0.2,
height_shift_range=0.2,
shear_range=0.2,
zoom_range=0.2,
horizontal_flip=True,
fill_mode='nearest'
val_datagen = ImageDataGenerator(rescale=1.0/255)
# Data generators for loading and augmenting images from the directories
train_generator = train_datagen.flow_from_directory(
train_dir,
target_size=(img_height, img_width),
batch_size=batch_size,
class_mode='categorical'
val_generator = val_datagen.flow_from_directory(
val_dir,
target_size=(img_height, img_width),
57
batch_size=batch_size,
class_mode='categorical'
model = models.Sequential([
layers.MaxPooling2D((2, 2)),
layers.MaxPooling2D((2, 2)),
layers.MaxPooling2D((2, 2)),
layers.Flatten(),
layers.Dense(128, activation='relu'),
layers.Dropout(0.5),
layers.Dense(len(classes), activation='softmax')
])
history = model.fit(
train_generator,
epochs=25,
58
validation_data=val_generator
model.save('currency_123.h5')
================================================================
59
=============
================================================================
=============
import numpy as np
model = load_model('currency_123.h5')
def predict_single_image(image_path):
prediction = model.predict(image_array)
60
# Test the function with a sample image
test_image_path =
"C:/Users/dwive/Desktop/python_project/currency_model.h5/Train/2Hundrednote/6a9d41
7e-9303-4e78-9f28-5c8c23bf54f3.jpg"
================================================================
=============
================================================================
=============
import os
model = load_model('currency_123.h5')
61
# Data generator for the test set (no augmentation, just rescaling)
test_datagen = ImageDataGenerator(rescale=1.0/255)
test_generator = test_datagen.flow_from_directory(
test_dir,
target_size=(img_height, img_width),
batch_size=batch_size,
class_mode='categorical',
================================================================
=============
================================================================
=============
62
import numpy as np
import os
model = load_model('currency_123.h5')
test_datagen = ImageDataGenerator(rescale=1.0/255)
test_generator = test_datagen.flow_from_directory(
test_dir,
target_size=(img_height, img_width),
batch_size=batch_size,
class_mode='categorical',
y_true = test_generator.classes
63
y_pred_probs = model.predict(test_generator) # Predicted probabilities
# Class labels
class_labels = list(test_generator.class_indices.keys())
cm = confusion_matrix(y_true, y_pred)
disp.plot(cmap=plt.cm.Blues, xticks_rotation=45)
plt.title("Confusion Matrix")
plt.show()
64
Chapter:- 05
65
TESTING
Testing in currency recognition is a critical process to ensure the quality,
functionality, and overall player experience of recognition. There are several
types of testing involved in this process:
1. Functionality Testing:
• Purpose: Ensure that all components of your currency recognition system work as
expected.
• What to Test:
o Verify that the model accurately recognizes various Indian currency notes.
o Test the user interface (if applicable) for proper functioning (e.g., uploading an
image, displaying predictions).
o Ensure that the system provides feedback, such as showing the predicted class
and confidence.
2. Compatibility Testing:
• Purpose: Test if the system works across different environments and devices.
• What to Test:
o Ensure the application works on different platforms, such as Windows, macOS,
or Linux.
o If you are using a camera for real-time recognition, verify compatibility with
different camera models.
3. Performance Testing:
• Purpose: Test how the system performs under various conditions, ensuring smooth
operation.
• What to Test:
o Measure the time it takes for the system to recognize the currency note and
output the prediction.
o Test the frame rate if you are using real-time camera input
4. Stress Testing:
• Purpose: Evaluate how the system performs under high usage or extreme conditions.
• What to Test:
o Test the system with a large batch of images (e.g., 100+ images in a row) to see
how it handles the load.
o Try feeding images with low resolution or corrupted files to see how the
system reacts.
5. Localization Testing:
• Purpose: Test if the system works with different language settings or regional
formats.
• What to Test:
66
o Ensure that your currency recognition system is robust for different types of
input images (i.e., images with various lighting or orientations) typical for
Indian currency.
o Test if the model works with images of currency from different regions (if your
dataset includes different series of notes).
6. Usability Testing:
• Purpose: Ensure that users can interact with the system effectively and without
confusion.
• What to Test:
o Test the user interface (UI), if applicable, to ensure it’s intuitive and easy to use
for non-technical users.
o Get feedback on how easy it is to use the system for currency recognition, such
as how quickly a user can get a result.
7. Regression Testing:
• Purpose: Ensure that new changes to the system don’t introduce new bugs.
• What to Test:
o After modifying the model or adding features (e.g., real-time recognition),
ensure that the core functionality of predicting currency types is still working.
o Retest any previously fixed bugs to confirm they don't resurface.
8. Security Testing:
• Purpose: Ensure that the system is secure and resistant to external threats.
• What to Test:
o If the system interacts with a database or online API (for example, storing user
data), check for data protection and ensure sensitive data is encrypted.
o Test for vulnerabilities that could allow attackers to manipulate input images or
exploit the system.
9. Compliance Testing:
• Purpose: Ensure the system complies with any industry standards or legal
requirements.
• What to Test:
o Ensure the system does not inadvertently violate any copyright or trademark
laws when processing currency images.
o If applicable, make sure the system adheres to data protection regulations (e.g.,
GDPR) if any user data is involved.
10. Beta Testing:
• Purpose: Gather feedback from real users before the official launch.
• What to Test:
o Release a pre-launch version of the currency recognition system to a small
group of users.
o Collect feedback on its accuracy, speed, and overall user experience to identify
any remaining bugs or improvements.
67
SYSTEM INPUT AND OUTPUT
SCREENSHOT
INPUT 1 :-
OUTPUT 1:-
68
INPUT 2:-
OUTPUT 2:-
69
INPUT 3:-
OUTPUT 3:-
70
INPUT 4:-
OUTPUT 4:-
71
72
73
74
75
76
LIMITATION AND SCOPE OF
PROJECT
Limitation:
Budget Constraints:
Limited financial resources can restrict the scope of the game, affecting the
quality of graphics, audio, gameplay features, and marketing efforts.
Developers must carefully allocate funds to prioritize essential aspects of
the project.
Time Constraints:
Technical Limitations:
77
Team Size and Expertise:
The size and expertise of the development team impact the project's
capabilities and efficiency. Smaller teams may struggle to tackle ambitious
projects or implement advanced features, while larger teams may face
coordination challenges and communication overhead.
Scope Creep:
Scope creep occurs when the project scope expands beyond its original
boundaries, leading to increased development time, costs, and complexity.
Managing scope creep is essential to prevent project delays and maintain
focus on core objectives.
Platform Limitations:
Market Competition:
Resource Constraints:
78
FUTURE SCOPE
The Currency Recognition System project has significant potential for future
development and enhancement. As the field of deep learning and computer vision
continues to evolve, several advancements can be integrated into this system to improve its
functionality and expand its applications. Here are some key areas of future growth and
opportunity:
4. Multi-Currency Support
The system could be expanded to support recognition of multiple currencies, enabling its
use in global financial markets and retail environments. By training the model with
datasets from various countries, it could detect and classify foreign currencies in addition
to Indian currency.
79
6. Integration with Financial Systems
The Currency Recognition System could be integrated with digital payment platforms or
banking applications, enabling automatic currency verification and transaction validation.
This could improve the efficiency of cash transactions and reduce human error.
7. Cross-Platform Compatibility
Developing the system to be cross-platform compatible would allow it to function
seamlessly on different devices such as PCs, mobile phones, and embedded systems,
enhancing its usability across various industries and platforms.
These future enhancements could elevate the Currency Recognition System from a simple
tool to a robust, multifunctional application with broad usage in various sectors, including
banking, security, retail, and international finance.
4o mini
80
CONCLUSION
81
REFERENCES
82