Record MSC
Record MSC
Introduction
1.1 Purpose
The Face Biometric-based ATM User Authentication System project aims to enhance
the security and convenience of ATM transactions by implementing advanced facial recognition
technology. By uniquely identifying users based on their facial features, the system improves
authentication accuracy, mitigates the risk of fraud, and provides a user-friendly alternative to
traditional methods. This project strives to streamline the ATM experience, reduce reliance on
physical cards and PINs, and contribute to a more efficient and secure future in banking
transactions.
1.2 Scope
The scope of the Face Biometric-based ATM User Authentication System project
encompasses the development and implementation of a secure and user-friendly ATM
authentication system. This includes the integration of facial recognition technology to enhance
security, reduce fraud, and improve the overall efficiency of user transactions. The project aims
to redefine the traditional ATM experience by providing a cutting-edge, biometric-based
authentication method that ensures reliable identification, convenience, and adaptability to
future advancements in technology.
1.3 Objectives
The objectives of the Face Biometric-based ATM User Authentication System project
are to implement a secure and user-friendly authentication method by leveraging facial
recognition technology. This includes enhancing the overall security of ATM transactions
through unique biometric identifiers, improving the efficiency of user access with quick and
reliable facial authentication, and ensuring a seamless and modernized banking experience. The
project aims to reduce the risk of unauthorized access, enhance user convenience by
eliminating the need for traditional authentication methods, and contribute to the evolution of
secure and innovative practices in the financial sector.
2. System Overview
In the Face Biometric-based ATM User Authentication System project, the front-end is
developed using Tkinter, a Python library for creating graphical user interfaces. Tkinter
facilitates the creation of an intuitive and user-friendly interface for users interacting with the
ATM system. Through Tkinter's capabilities, the project ensures a seamless integration of facial
recognition and password authentication, providing a visually appealing and responsive
platform for users to navigate through the authentication and banking processes.
The back-end of the Face Biometric-based ATM User Authentication System project is
implemented using Python and CSV. Python serves as the core programming language, handling
the logic for facial recognition, multi-level security, and user authentication. The use of CSV
(Comma-Separated Values) files facilitates the secure storage of user data, such as facial
features and encrypted passwords, ensuring efficient data management. This back-end
architecture enables seamless integration of biometric technology and contributes to the
project's overall goal of providing a secure, efficient, and user-friendly ATM authentication
system.
2.3 Working Procedure
Certainly, here is a step-by-step working procedure for the Face Biometric-based ATM
User Authentication System:
1. User Enrollment:
- Users initiate the process by enrolling in the system during account creation.
- The system captures and stores facial biometric data, creating a reference template for
future authentication.
2. System Initialization:
- The ATM system is initialized and prompts users for authentication upon login.
3. Facial Recognition:
- Users approach the ATM camera, and the facial recognition module captures real-time facial
features.
- The system compares the captured features with the stored biometric template from the
enrollment phase.
4. Authentication Check:
- Successful facial recognition triggers the second authentication layer, requiring users to
input their account password.
5. Multi-level Verification:
- The system performs a multi-level verification, ensuring both facial recognition and correct
password entry for access.
6. Access Granted/Denied:
- If both facial recognition and password authentication are successful, access to the user's
account is granted.
- In case of failure in either step, access is denied, and users are prompted to reattempt
authentication.
7. Secure Transactions:
- Once authenticated, users can perform various ATM transactions securely, such as
withdrawals, deposits, or balance inquiries.
8. Session Termination:
- The system terminates the user session after a period of inactivity or upon completion of
transactions to maintain security.
This step-by-step procedure ensures a robust and secure user authentication process,
combining the strengths of facial recognition technology and password authentication for an
efficient and reliable Face Biometric-based ATM User Authentication System.
3. System Architecture
The system components of the Face Biometric-based ATM User Authentication System
are as follows:
- The front-end GUI serves as the user interface, providing a visually intuitive platform for
users to interact with the ATM system.
- It encompasses elements such as registration forms, login screens, and feedback displays
to guide users through the authentication process.
- Back-end Logic:
- The back-end logic handles the core functionality of the system, orchestrating
communication between the front-end and various modules.
- It manages user authentication, data processing, and integration with the facial recognition
module, ensuring a cohesive and secure operation.
- The facial recognition module employs sophisticated algorithms to capture, analyze, and
verify facial features for user identification.
- It plays a crucial role in enhancing security by comparing real-time facial data with stored
templates, facilitating accurate and efficient authentication.
- CSV data storage is employed to securely store user information, including facial templates
and associated account details.
- This component ensures an organized and accessible repository for user data, employing
CSV files for simplicity and ease of integration.
These components work collaboratively to create a seamless and secure Face Biometric-
based ATM User Authentication System. The front-end GUI provides an interactive interface,
the back-end logic orchestrates system processes, the facial recognition module ensures
precise user identification, and CSV data storage maintains organized and secure user
information.
## 4. Installation Guide
- Tkinter Library:
Tkinter is a standard GUI (Graphical User Interface) library in Python. It provides tools to
create interactive and visually appealing interfaces for desktop applications. In this project,
Tkinter is utilized to design and implement the front-end of the ATM system, enabling users to
interact with the application seamlessly.
- Required Dependencies:
Various dependencies are necessary to support the functionalities of the project. These
may include Python libraries such as NumPy, Pandas (for data handling), and other relevant
packages specific to the project's requirements. Proper installation and management of these
dependencies ensure the smooth execution of the Facial Biometric-based ATM User
Authentication System.
4. Security Features
- Biometric Multimodality:
- Transaction Notifications:
Implement real-time transaction notifications to users via SMS or mobile app alerts,
enhancing transparency and security.
- Contactless Transactions:
Develop user profiles that allow customization of ATM preferences and settings for
a more tailored and user-centric experience.
Explore the use of deep learning techniques to improve facial recognition accuracy
and adaptability to various environmental conditions.
- Blockchain Integration:
Investigate the integration of blockchain technology for enhanced data security and
transparency in transaction records.
- Cloud-Based Storage:
These future enhancements aim to not only refine the existing features of the Face
Biometric-based ATM User Authentication System but also introduce advanced technologies
and capabilities to stay ahead of evolving security standards and user expectations.
6. user interface
7. Conclusion
import numpy as np
import argparse
import imutils
import pickle
import cv2
import os
import time
import sqlite3
import pandas as pd
import tkinter as tk
import pandas as pd
ARIAL = ("arial",10,"bold")
class BankUi:
def __init__(self,root):
self.root = root
self.header.pack(fill=X)
self.frame = Frame(self.root,bg="#00688B",width=900,height=500)
root.geometry("800x500")
self.button1.place(x=175,y=230,width=500,height=70)
self.countter = 2
self.frame.pack()
def begin_page(self):
self.frame.destroy()
self.frame = Frame(self.root,bg="#00688B",width=900,height=500)
root.geometry("800x500")
self.enroll = Button(self.frame,
text="Enroll",bg="#0A1172",fg="white",font=ARIAL,command=self.enroll_user)
self.frame.pack()
def withdraw_money_page(self):
self.frame.destroy()
self.frame = Frame(self.root,bg="#00688B",width=900,height=500)
self.label1 =Label(self.frame,text="Note:",bg="#00688B",fg="white",font=ARIAL)
self.label5 =Label(self.frame,text="4.If your face is not reconized after 5 seconds, you will
automatically be given 2 trial more.",bg="#00688B",fg="white",font=ARIAL)
self.label6 =Label(self.frame,text="5.If your face is not recognized after three trials, you
wont be allowed to withdraw",bg="#00688B",fg="white",font=ARIAL)
self.label7 =Label(self.frame,text="6.To Begin, Click The 'Verify Face Id' Button
Below",bg="#00688B",fg="white",font=ARIAL)
self.q = Button(self.frame,text="Quit",bg="#0A1172",fg="white",font=ARIAL,command =
self.root.destroy)
self.b = Button(self.frame,text="Back",bg="#0A1172",fg="white",font=ARIAL,command =
self.begin_page)
self.label1.place(x=20,y=100,width=800,height=20)
self.label2.place(x=70,y=130,width=800,height=20)
self.label3.place(x=30,y=160,width=800,height=20)
self.label4.place(x=40,y=190,width=800,height=20)
self.label5.place(x=40,y=220,width=800,height=20)
self.label6.place(x=100,y=250,width=800,height=20)
self.label7.place(x=70,y=280,width=800,height=20)
self.button.place(x=60,y=320,width=750,height=40)
self.q.place(x=530,y=380,width=140,height=40)
self.b.place(x=250,y=380,width=140,height=40)
self.frame.pack()
data = pd.read_csv('bank_details.csv')
def enroll_user(self):
self.frame.destroy()
self.frame = Frame(self.root,bg="#00688B",width=900,height=500)
self.uentry = Entry(self.frame,bg="honeydew",highlightcolor="#50A8B0",
highlightthickness=2,
highlightbackground="white")
self.pentry = Entry(self.frame,bg="honeydew",show="*",highlightcolor="#50A8B0",
highlightthickness=2,
highlightbackground="white")
self.button1 =
Button(self.frame,text="Next",bg="#0A1172",fg="white",font=ARIAL,command =
self.enroll_and_move_to_next_screen)
self.q = Button(self.frame,text="Quit",bg="#0A1172",fg="white",font=ARIAL,command =
self.root.destroy)
self.b = Button(self.frame,text="Back",bg="#0A1172",fg="white",font=ARIAL,command =
self.begin_page)
self.userlabel.place(x=125,y=100,width=120,height=20)
self.uentry.place(x=153,y=130,width=200,height=20)
self.plabel.place(x=125,y=160,width=120,height=20)
self.pentry.place(x=153,y=190,width=200,height=20)
self.button1.place(x=155,y=230,width=180,height=40)
#self.button2.place(x=355,y=230,width=350,height=30)
self.q.place(x=480,y=360,width=120,height=40)
self.b.place(x=280,y=360,width=120,height=40)
self.frame.pack()
def enroll_and_move_to_next_screen(self):
name = self.uentry.get()
password = self.pentry.get()
self.enroll_user()
self.enroll_user()
self.enroll_user()
elif len(password) < 8:
self.enroll_user()
else:
self.write_to_csv()
self.video_capture_page()
def password_verification(self):
self.frame.destroy()
self.frame = Frame(self.root,bg="#00688B",width=900,height=500)
print(self.real_user)
self.givenpentry = Entry(self.frame,bg="honeydew",show="*",highlightcolor="#50A8B0",
highlightthickness=1,
highlightbackground="white")
self.button1 =
Button(self.frame,text="Verify",bg="#0A1172",fg="white",font=ARIAL,command=self.verify_us
er)
self.q = Button(self.frame,text="Quit",bg="#0A1172",fg="white",font=ARIAL,command =
self.root.destroy)
self.b = Button(self.frame,text="Back",bg="#0A1172",fg="white",font=ARIAL,command =
self.begin_page)
self.plabel.place(x=125,y=160,width=300,height=20)
self.givenpentry.place(x=153,y=190,width=200,height=20)
self.button1.place(x=155,y=230,width=180,height=30)
self.q.place(x=480,y=360,width=120,height=35)
self.b.place(x=280,y=360,width=120,height=35)
self.frame.pack()
def verify_user(self):
data = pd.read_csv('bank_details.csv')
self.gottenpassword = data[data.loc[:,'unique_id'] ==
self.real_user].loc[:,'password'].values[0]
#print(str(self.givenpentry.get()))
print(str(self.gottenpassword))
if str(self.givenpentry.get()) == str(self.gottenpassword):
self.final_page()
else:
self.begin_page()
def final_page(self):
self.frame.destroy()
self.frame = Frame(self.root,bg="#00688B",width=900,height=500)
self.detail =
Button(self.frame,text="Transfer",bg="#0A1172",fg="white",font=ARIAL,command =
self.user_account_transfer)
self.detail.place(x=0,y=0,width=200,height=50)
self.frame.pack()
def user_account_transfer(self):
self.frame.destroy()
self.frame = Frame(self.root,bg="#00688B",width=900,height=500)
self.detail =
Button(self.frame,text="Transfer",bg="#0A1172",fg="white",font=ARIAL,command =
self.user_account_transfer)
self.detail.place(x=0,y=0,width=200,height=50)
self.frame.pack()
self.label11 = Label(self.frame, text="Please enter the reciepient's account
number",bg="#00688B",fg="white",font=ARIAL)
self.button1 =
Button(self.frame,text="Transfer",bg="#0A1172",fg="white",font=ARIAL,command=self.user_ac
count_transfer_transc)
self.entry11 = Entry(self.frame,bg="honeydew",highlightcolor="#50A8B0",
highlightthickness=2,
highlightbackground="white")
self.entry21 = Entry(self.frame,bg="honeydew",highlightcolor="#50A8B0",
highlightthickness=2,
highlightbackground="white")
self.label11.place(x=200,y=130,width=300,height=20)
self.entry11.place(x=200,y=160,width=300,height=20)
self.label21.place(x=185,y=190,width=300,height=20)
self.entry21.place(x=200,y=210,width=300,height=20)
self.button1.place(x=200,y=250,width=180,height=30)
def user_account_transfer_transc(self):
data = pd.read_csv('bank_details.csv')
else:
data = pd.read_csv('bank_details.csv')
update_data = data.set_index('account_number')
update_data.loc[int(self.entry11.get()),'account_balance'] += int(self.entry21.get())
update_data.loc[data[data.loc[:,'unique_id'] ==
self.real_user].loc[:,'account_number'].values[0],'account_balance'] -= int(self.entry21.get())
update_data['account_number'] = update_data.index
update_data = update_data.reindex(labels =
['unique_id','account_number','name','bank', 'password','account_balance'], axis = 1)
update_data.to_csv('bank_details.csv',index = None)
def user_balance(self):
self.frame.destroy()
self.frame = Frame(self.root,bg="#00688B",width=900,height=500)
self.detail =
Button(self.frame,text="Transfer",bg="#0A1172",fg="white",font=ARIAL,command =
self.user_account_transfer)
self.detail.place(x=0,y=0,width=200,height=50)
self.frame.pack()
data = pd.read_csv('bank_details.csv')
self.label = Label(self.frame, text= 'Current Account Balance: ' + '$ ' + str(text),font=ARIAL)
def user_deposit_money(self):
self.frame.destroy()
self.frame = Frame(self.root,bg="#00688B",width=900,height=500)
self.detail =
Button(self.frame,text="Transfer",bg="#0A1172",fg="white",font=ARIAL,command =
self.user_account_transfer)
self.detail.place(x=0,y=0,width=200,height=50)
self.frame.pack()
self.money_box = Entry(self.frame,bg="honeydew",highlightcolor="#50A8B0",
highlightthickness=2,
highlightbackground="white")
self.submitButton =
Button(self.frame,text="Deposit",bg="#0A1172",fg="white",font=ARIAL)
self.money_box.place(x=200,y=100,width=200,height=20)
self.submitButton.place(x=445,y=100,width=55,height=20)
self.submitButton.bind("<Button-1>",self.user_deposit_trans)
def user_deposit_trans(self,flag):
data = pd.read_csv('bank_details.csv')
data = pd.read_csv('bank_details.csv')
update_data = data.set_index('unique_id')
update_data.loc[self.real_user,'account_balance'] += int(self.money_box.get())
update_data.reset_index(inplace=True)
update_data.columns = ['unique_id','account_number','name','bank',
'password','account_balance']
update_data.to_csv('bank_details.csv',index = None)
def user_withdrawl_money(self):
highlightthickness=2,
highlightbackground="white")
self.submitButton =
Button(self.frame,text="Withdraw",bg="#0A1172",fg="white",font=ARIAL)
self.money_box.place(x=200,y=100,width=200,height=20)
self.submitButton.place(x=435,y=100,width=70,height=20)
self.submitButton.bind("<Button-1>",self.user_withdrawl_trans)
def user_withdrawl_trans(self,flag):
data = pd.read_csv('bank_details.csv')
update_data = data.set_index('unique_id')
update_data.loc[self.real_user,'account_balance'] -= int(self.money_box.get())
update_data.reset_index(inplace=True)
update_data.columns = ['unique_id','account_number','name','bank',
'password','account_balance']
update_data.to_csv('bank_details.csv',index = None)
else:
messagebox._show("Withdrwal Info!", "Insufficient Funds")
def write_to_csv(self):
import csv
account_balance = "0"
name = self.uentry.get()
password = self.pentry.get()
writer = csv.writer(f)
self.frame.destroy()
self.frame = Frame(self.root,bg="#00688B",width=900,height=500)
self.label1 =Label(self.frame,text="Note:",bg="#00688B",fg="white",font=ARIAL)
self.label4 =Label(self.frame,text="3.To capture each image click the space bar on your
keyboard when the camera turn on:",bg="#00688B",fg="white",font=ARIAL)
self.label5 =Label(self.frame,text="4. Please wait till you are notified that your capture was
successful before leaving the page",bg="#00688B",fg="white",font=ARIAL)
data = pd.read_csv('bank_details.csv')
self.label6 =Label(self.frame,text="5.To begin, click the 'Capture' button below and click
the space bar to capture a new image",bg="#00688B",fg="white",font=ARIAL)
self.button =
Button(self.frame,text="Capture",bg="#0A1172",fg="white",font=ARIAL,command=self.capture
user)
#self.q = Button(self.frame,text="Quit",bg="#50A8B0",fg="white",font=ARIAL,command =
self.root.destroy)
#self.b = Button(self.frame,text="Back",bg="#50A8B0",fg="white",font=ARIAL,command =
self.enroll_user)
self.label1.place(x=100,y=100,width=600,height=20)
self.label2.place(x=100,y=130,width=600,height=20)
self.label3.place(x=100,y=160,width=600,height=20)
self.label4.place(x=100,y=190,width=600,height=20)
self.label5.place(x=100,y=220,width=600,height=20)
self.label6.place(x=100,y=250,width=600,height=20)
self.button.place(x=100,y=290,width=650,height=40)
#self.q.place(x=480,y=360,width=120,height=20)
#self.b.place(x=280,y=360,width=120,height=20)
self.frame.pack()
def captureuser(self):
data = pd.read_csv('bank_details.csv')
name = data.loc[:,'unique_id'].values[-1]
cam = cv2.VideoCapture(0)
cv2.namedWindow("capture")
img_counter = 0
dirname = f'dataset/{name}'
os.makedirs(dirname)
while True:
cv2.imshow("capture", frame)
if img_counter == 5:
cv2.destroyWindow("capture")
break
if not ret:
break
k = cv2.waitKey(1)
if k%256 == 27:
# ESC pressed
break
# SPACE pressed
path = f'dataset/{name}'
img_name = "{}.jpg".format(img_counter)
cv2.imwrite(os.path.join(path, img_name), frame)
cv2.imwrite(img_name, frame)
print("{} written!".format(img_name))
img_counter += 1
cam.release()
cv2.destroyAllWindows()
self.get_embeddings()
self.train_model()
self.begin_page()
def get_embeddings(self):
#summary:
ap = argparse.ArgumentParser()
#args = vars(ap.parse_args())
current_directory = os.getcwd()
detector = cv2.dnn.readNetFromCaffe(r'face_detection_model/deploy.prototxt.txt',
r'face_detection_model/res10_300x300_ssd_iter_140000.caffemodel')
embedder = cv2.dnn.readNetFromTorch('nn4.small2.v1.t7')
# grab the paths to the input images in our dataset
imagePaths = list(paths.list_images('dataset'))
knownEmbeddings = []
knownNames = []
total = 0
len(imagePaths)))
name = imagePath.split(os.path.sep)[-2]
# dimensions
image = cv2.imread(imagePath)
imageBlob = cv2.dnn.blobFromImage(
detector.setInput(imageBlob)
detections = detector.forward()
if len(detections) > 0:
# we're making the assumption that each image has only ONE
i = np.argmax(detections[0, 0, :, 2])
confidence = detections[0, 0, i, 2]
# weak detections)
# the face
continue
# construct a blob for the face ROI, then pass the blob
embedder.setInput(faceBlob)
vec = embedder.forward()
knownNames.append(name)
knownEmbeddings.append(vec.flatten())
total += 1
f = open('output/embeddings.pickle', "wb")
f.write(pickle.dumps(data))
f.close()
def train_model(self):
#summary
le = LabelEncoder()
labels = le.fit_transform(data["names"])
# train the model used to accept the 128-d embeddings of the face and
recognizer.fit(data["embeddings"], labels)
f = open('output/recognizer.pickle', "wb")
f.write(pickle.dumps(recognizer))
f.close()
f = open('output/le.pickle', "wb")
f.write(pickle.dumps(le))
f.close()
def video_check(self):
current_directory = os.getcwd()
detector = cv2.dnn.readNetFromCaffe('face_detection_model//deploy.prototxt.txt',
'face_detection_model//res10_300x300_ssd_iter_140000.caffemodel')
#summary
embedder= cv2.dnn.readNetFromTorch('C:\\Users\\YOKESH
V\\Desktop\\new\\nn4.small2.v1.t7')
# load the actual face recognition model along with the label encoder
le = pickle.loads(open('output/le.pickle', "rb").read())
# initialize the video stream, then allow the camera sensor to warm up
vs = VideoStream(src=0).start()
time.sleep(2.0)
timeout = time.time() + 5
# start the FPS throughput estimator
fps = FPS().start()
real_user_list = []
while True:
cv2.destroyWindow("Frame")
break;
frame = vs.read()
# dimensions
(h, w) = frame.shape[:2]
# construct a blob from the image
imageBlob = cv2.dnn.blobFromImage(
detector.setInput(imageBlob)
detections = detector.forward()
# the prediction
confidence = detections[0, 0, i, 2]
# the face
continue
# construct a blob for the face ROI, then pass the blob
embedder.setInput(faceBlob)
vec = embedder.forward()
preds = recognizer.predict_proba(vec)[0]
j = np.argmax(preds)
proba = preds[j]
name = le.classes_[j]
# # associated probability
# (0, 0, 255), 2)
#Decision boundary
print("Fraud detected")
real_user_list.append(name)
else:
#cv2.destroyWindow("Frame")
real_user_list.append(name)
break;
cv2.imshow("Frame", frame)
if key == ord("q"):
break
fps.stop()
# do a bit of cleanup
cv2.destroyAllWindows()
vs.stop()
print(real_user_list)
try:
Counter(real_user_list).most_common(1)[0][0] == 'unknown'
except IndexError:
if self.countter != 0:
self.countter = self.countter - 1
self.video_check()
else:
self.begin_page()
self.countter = 2
else:
if Counter(real_user_list).most_common(1)[0][0] == 'unknown':
if self.countter != 0:
self.countter = self.countter - 1
self.video_check()
else:
messagebox._show("Verification Info!", "Face Id match failed! You cannot withdraw
at this time, try again later")
self.begin_page()
self.countter = 2
else:
self.real_user = int(Counter(real_user_list).most_common(1)[0][0])
self.password_verification()
root = Tk()
root.geometry("800x500")
root.configure(bg="#00688B")
# root.tk.call("wm",'iconphoto',root._w,icon)
obj = BankUi(root)
root.mainloop()