Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

Advanced Security EVM

Project Report

PHY1999 - Introduction to Innovative Projects

By

Divya Saini 18BIT0049


Harshil Jetani 18BIT0114
Yash Gupta 18BIT0205
Nikhil Bhardwaj 18BIT0308
Akshu Gautam 18BIT0396
Ch Manogna Teja 17MIS0459

June 2020

Page 1 of 12
Individual Contribution

Coding: Harshil Jetani(18BIT0114), Akshu Gautam(18BIT0396)

Testing: Divya Saini(18BIT0049) , Yash Gupta(18BIT0205)

PPT : Nikhil Bhardwaj(18BIT0308)

Documentation :Ch Manogna Teja(17MIS0459)

Page 2 of 12
Introduction
This project we are trying to automate the EVMs(Electronic Voting Machine) so that
malpractices can be prevented during Election in voting centres. Also it uses auto ID
verification which can reduce wastage of paper which are used to mark if voter has voted
from that voting centre. Also duplicate votes can be prevented even if there is no security at
the voting centre.
It will reduce the human resource requirement at the voting centres which can be used in
doing some other productive work. Once the EVM is setup, there will be no paper or ink
required for marking if the person has voted, if person is at right voting centre or any other
such issues.
The only required thing will be a camera to recognise face and mobile phone with their
registered phone number.
This can also help in reducing arguments between political parties regarding malpractices in
election. So instead of wasting time in such useless argument they can utilise their valuable
time in some productive work. This can also reduce time in vote counting as it gives result
immediately as soon as the voting is completed.

Abstract
Our project is Advanced Security EVM, which will help in reducing resource requirement,
save time, money, paper, ink etc. In our project, we have used Machine Learning Concept
for face recognition using opencv library in Python.
Firstly the face is recognised and identified from the saved faces. If the face matches any of
the saved faces, it will display his/her name and generate OTP on his/her registered phone
number. The voter has to enter the received OTP in the machine. If the OTP entered is

Page 3 of 12
correct, the voter will be given chance to vote. Once the voter has voted, his/her vote is
updated and if the person tries to vote again the machine will show “Not Eligible to Vote”.
Once the Voting is done, machine will display the result.
In our case we have used Webcam for face recognition and generated OTP online using
Fast2sms online messaging platform.

Motivation

In the recent news the hot topic that we see is malpractice of EVM machines due to which
there is lot of arguments between political parties which challenges the authenticity of
results of EVM machines.

To solve this argument we have proposed this idea of having EVM machines with two level
security i.e. face detection and OTP generation.

We hope that our idea can solve this problem!!!

Page 4 of 12
How The Voting Process go on

1- Face Recognition
2- Mobile OTP verification

Face Recognition

A webcam is a video camera that feeds or streams its image in real time to or through a
computer to a computer network. When "captured" by the computer, the video stream may
be saved, viewed or sent on to other networks via systems such as the internet. Face
recognition will help to identify a person is eligible to vote at that particular voting center or
not.

Page 5 of 12
Mobile OTP Verification

OTP Verification plugin verifies Mobile Number of users by sending verification code
(OTP) during registration. It removes the possibility of a user registering with fake Voting Id
/ Mobile Number. This plugin checks the existence of the Mobile Number and the ability of
a user to access that Mobile Number.

The full project is prototype that works on PC itself. It can also be implemented into
hardware using same prototype.

Advantages of Advanced Security EVM


1. Cost effective
2. This system allows only authenticated voting than the existing equipment as the person
is identified based on his Face Recognition which is unique to each individual.
3. Low power consumption
4. It is economical
5. Less manpower required
6. Time conscious, less time required for voting & counting
7. Avoids invalid voting as it prevents unregistered voters from voting.

Disadvantages of Advanced Security EVM

1. Before voting the user has to enroll first.


2. Sending OTP me sometime cause combine character error.

Page 6 of 12
Applications of Advanced Security EVM

1. This project can be used as a voting machine to prevent rigging, during the elections in
the polling booths.
2. Fast track voting which could be used in small scale elections, like resident welfare
association,“Panchayat” level election and other society level elections, where results
can be instantaneous.
3. It could also be used to conduct opinion polls during annual shareholders meeting.

Page 7 of 12
Code
Project.py

import functions

count={“A”:0,"B":0,"C":0,"D":0,"NOTA":0}

contact={"Harshil":"9999999999",
"Akshu":"8888888888",
"Nikhil":"7777777777",
"Yash":"9999999990",
"Teja":"8888888889",
"Divya":"7777777778"
}

while True:
c=int(input("\n\n\nPress\n1 - Cast Vote\n2 - exit\nEnter your choice: "))
if (c==2):
break
name=functions.rec_face()
print("\n\n\nname:",name)
if name=="Unknown":
print("Not Eligible to vote at this center")
else:
otp=int(functions.generate_otp(name,contact))
if (name in contact):
contact.pop(name)
OTP=int(input("\n\n\nEnter the OTP: "))
while True:
if (otp==0):
print("Already Voted")
break
elif (otp==OTP):
print("You are eligible To vote here")
print("\n\n\nPress\nA - For A\nB - For B\nC - For C\nD - For
D\nAny other key for NOTA")
ch=input("Enter your choice: ")
if (ch=="A" or ch=="a"):
count["A"]+=1
elif (ch=="B" or ch=="b"):
count["B"]+=1
elif (ch=="C" or ch=="c"):
count["C"]+=1
elif (ch=="D" or ch=="d"):
count["D"]+=1
else:
count["NOTA"]+=1
print("Vote Successfully Casted")
break;
else:
print("Wrong OTP")
print("press 1 to pass and not give the vote else press 2")
if (int(input("Enter your choice: "))==1):
break
OTP=int(input("Enter OTP: "))

print("Results: ",count)

Page 8 of 12
functions.py

import face_recognition
import cv2
import numpy as np
import requests
import math
import random

def rec_face():
video_capture = cv2.VideoCapture(0)

# Loading pictures
harshil = face_recognition.load_image_file("img1.jpg")
harshil_face_encoding = face_recognition.face_encodings(harshil)[0]

akshu = face_recognition.load_image_file("img2.jpg")
akshu_face_encoding = face_recognition.face_encodings(akshu)[0]

nikhil = face_recognition.load_image_file("img3.jpg")
nikhil_face_encoding = face_recognition.face_encodings(nikhil)[0]

yash = face_recognition.load_image_file("img4.jpg")
yash_face_encoding = face_recognition.face_encodings(yash)[0]

teja = face_recognition.load_image_file("img5.jpg")
teja_face_encoding = face_recognition.face_encodings(teja)[0]

divya = face_recognition.load_image_file("img6.jpg")
divya_face_encoding = face_recognition.face_encodings(divya)[0]

# Create arrays of known face encodings and their names


known_face_encodings = [
harshil_face_encoding,
akshu_face_encoding,
nikhil_face_encoding,
yash_face_encoding,
teja_face_encoding,
divya_face_encoding
]
known_face_names = [
"Harshil",
"Akshu",
"Nikhil",
"Yash",
"Teja",
"Divya"
]

# Initialize some variables


face_locations = []
face_encodings = []
face_names = []
process_this_frame = True

while True:
# Grab a single frame of video
ret, frame = video_capture.read()

# Resize frame of video to 1/4 size for faster face recognition


processing
Page 9 of 12
small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25)

# Convert the image from BGR color (which OpenCV uses) to RGB color
(which face_recognition uses)
rgb_small_frame = small_frame[:, :, ::-1]

# Only process every other frame of video to save time

if process_this_frame:
# Find all the faces and face encodings in the current frame of
video
face_locations = face_recognition.face_locations(rgb_small_frame)
face_encodings = face_recognition.face_encodings(rgb_small_frame,
face_locations)

face_names = []
for face_encoding in face_encodings:
# See if the face is a match for the known face(s)
matches = face_recognition.compare_faces(known_face_encodings,
face_encoding)
name = "Unknown"

face_distances =
face_recognition.face_distance(known_face_encodings, face_encoding)
best_match_index = np.argmin(face_distances)
if matches[best_match_index]:
name = known_face_names[best_match_index]

face_names.append(name)

process_this_frame = not process_this_frame

# Display the results


for (top, right, bottom, left), name in zip(face_locations, face_names):
# Scale back up face locations since the frame we detected in was
scaled to 1/4 size
top *= 4
right *= 4
bottom *= 4
left *= 4

# Draw a box around the face


cv2.rectangle(frame, (left, top), (right, bottom), (0, 0, 255), 2)

# Display the resulting image


cv2.imshow('Video', frame)

# Hit 'q' on the keyboard to quit!


if cv2.waitKey(1) & 0xFF == ord('q'):
break
######
# Release handle to the webcam
video_capture.release()
cv2.destroyAllWindows()
return face_names[0]

#####---------Generate OTP---------#####
def generate_otp(name,contact):

if (name in contact):
digits = "0123456789"
OTP = ""
Page 10 of 12
for i in range(6) :
OTP += digits[math.floor(random.random() * 10)]

url = "https://www.fast2sms.com/dev/bulk"
message="Your OTP is: "+OTP+"\nPLEASE ENTER CORRECT OTP FOR CASTING
VOTE"
payload =
"sender_id=FSTSMS&message="+message+"&language=english&route=p&numbers="+contact
[name]+""

#key for generating otp online

key="vBgoS4kPmD1IAKGR5Jje9zc7F3ezpYZTbls2QyaiCHNHGt6fUOChJGmK4P8TMR5VxQ3YgwBs7nL
tkZSa"
headers = {
'authorization': key,
'Content-Type': "application/x-www-form-urlencoded",
'Cache-Control': "no-cache",
}
response = requests.request("POST", url, data=payload, headers=headers)
#print(OTP)# for checking correct OTP
return OTP
else:
return "0"

Output process


Page 11 of 12
In the above screenshot is the OTP entered was correct, it would display “Vote casted
Successfully” and display result on exit same as in above screenshot.

SUMMARY

We have successfully implemented the Advanced EVM machine by adding two step
verification.
1) Face Recognition replaces the traditional method of photo verification through printed
paper, thus reducing paper wastage as well as man reliability.

2) OTP controlled EVM stops malpractices. Same person will not be able to vote more than
once.

3)This ensures safe and secure voting environment excluding any possibility of malpractice.

Note:- Here the mobile numbers and id for generating OTP entered are dummy mobile
numbers and dummy ID. Please do generate authorisation key from any online messaging
platform and add before implementing the code.

Page 12 of 12
IIP Project

Advanced
Security EVM
By:-

Akshu Gautam 18BIT0396

Nikhil Bhardwaj 18BIT0308

Harshil Jetani 18BIT0114

Ch Manogna Teja 17MIS0459

Divya Saini 18BIT0049

Yash Gupta 18BIT0205


About Advanced Security EVM?

– This project we are trying to automate the EVMs(Electronic Voting Machine) so that
malpractices can be prevented during Election in voting centres. Also it uses auto ID
verification which can reduce wastage of paper which are used to mark if voter has
voted from that voting centre. Also duplicate votes can be prevented even if there is
no security at the voting centre.
– It will reduce the human resource requirement at the voting centres which can be
used in doing some other productive work. Once the EVM is setup, there will be no
paper or ink required for marking if the person has voted, if person is at right voting
centre or any other such issues.
– The only required thing will be a camera to recognise face and mobile phone with
their registered phone number.
Why Advanced Security EVM?

– Bogus (fake) voting is still major drawbacks in the Election. In AADHAR CARD the Government
has all the data Base for us including finger print and Face detection. OTP generation devices
and Web Camera are used in the Electronics Voting Machine for voter verification. We have
designed a Smart Voting Machine where there is no need for the user to carry his ID which
contains his required details. The person at the polling booth needs only to capture the face
identity in web camera and then otp at the counter of the polling booth, thus allowing the
acquisition of an on-spot Fingerprint and OTP generation from the voter which serves as an
identification. This data is passed on to the controlling unit for the verification. The controller
fetches the data from the reader and compares this data with the already existing data stored
during the registration of the voters. If the data matches with the pre-stored information of
the registered Face and OTP, the person is allowed to cast his vote. If not, a warning message
is displayed on LCD and warns through the voice by this way, the person is barred from polling
his vote. The vote casting mechanism is carried out manually using the keyboard. LCD is used
to display the related messages, warnings and ensuing results.
From Where This Idea Came??

– In the recent news the hot topic that we see is malpractice of EVM machines due to which there is
lot of arguments between political parties which challenges the authenticity of results of EVM
machines.
– To solve this argument we have proposed this idea of having EVM machines with two level security
i.e. face detection and OTP generation.
– We hope that our idea can solve this problem!!!
Face recognition

– A webcam is a video camera that feeds or streams its image in real time to or
through a computer to a computer network. When "captured" by the computer,
the video stream may be saved, viewed or sent on to other networks via
systems such as the internet. Face recognition will help to identify a person is
eligible to vote at that particular voting center or not.
Mobile OTP Verification

– OTP Verification plugin verifies Mobile Number of users by sending verification


code (OTP) during registration. It removes the possibility of a user registering
with fake Voting Id / Mobile Number. This plugin checks the existence of the
Mobile Number and the ability of a user to access that Mobile Number.
Methodology Used :

This is implemented using software and hardware using different tools :

1) Software :
a) Python
b) Anaconda
c) OpenCV
b) Face Recognition

2) Hardware
– a) Mobile Phone (for OTP)
– b)Web camera(for Face Recognition)
How The Voting Process go on

– 1- Face Recognition
– 2- Mobile OTP verification
– 3- Voting Process
Advantages of Advanced Security
EVM
– Cost effective
– This system allows only authenticated voting than the existing equipment as the
person is identified based on his Face Recognition and then OTP generation on
their registered mobile numbers which is unique to each individual.
– Low power consumption
– It is economical
– Less manpower required
– Time conscious, less time required for voting & counting
– Avoids invalid voting as it prevents unregistered voters from voting.
Disadvantages of Advanced Security
EVM

– Before voting the user has to enroll first


– Sending OTP sometimes causes Combine character error.
Implementation:
RESULT ANALYSIS:

– We have successfully implemented the Advanced EVM machine by adding two


step verification.
– Face Recognition replaces the traditional method of photo verification through
printed paper, thus reducing paper wastage as well as man reliability.
– OTP controlled EVM stops malpractices. Same person will not be able to vote
more than once.
– This ensures safe and secure voting environment excluding any possibility of
malpractice.
Applications of Advanced Security
EVM :
– This project can be used as a voting machine to prevent rigging, during the
elections in the polling booths.
– Fast track voting which could be used in small scale elections, like resident
welfare association,“Panchayat” level election and other society level elections,
where results can be instantaneous.
– It could also be used to conduct opinion polls during annual shareholders
meeting.
CONCLUSION OF OUR PROJECT:

– The project “SMART VOTING MACHINE based on face recognition” and OTP
generation, was mainly intended to develop face recognition and OTP based
advanced Electronic Voting Machine (EVM) which helps in free and fair way of
conducting elections which are basis for democratic country like India.

You might also like