Voting System
Voting System
The security and accuracy of voting systems are crucial for ensuring free and fair elections.
Traditional voting methods, both paper-based and electronic, are often prone to issues such as
voter fraud, impersonation, and tampering. This project proposes a biometric-based voting
machine leveraging image processing techniques to address these challenges. The system uses
biometric traits, such as fingerprints or facial recognition, for voter authentication. Image
processing methods, including preprocessing, feature extraction, and pattern matching, are
employed to ensure accurate and reliable identification.
The system is implemented using MATLAB, incorporating a user-friendly interface for voters
to cast their votes securely. Once authenticated, the voter can select their preferred candidate,
and the vote is securely stored in an encrypted database, ensuring data integrity. The proposed
system enhances voting efficiency, reduces the risk of fraud, and ensures a transparent election
process. With the growing importance of security and trust in democratic systems, this project
demonstrates how advanced biometric and image processing technologies can revolutionize
voting systems.
vii
TABLE OF CONTENTS
PAGE NO:
Approval Sheet ii
Candidate Declaration iii
Certificate Iv
Acknowledgement v
Declaration vi
Abstract vii
CHAPTER-1 INTODUCTION:
1.1 Overview Of The Project 1
1.2 Objectives 1
1.3 Importance Of Biometric In Voting 1
1.4 Key Features 2
CHAPTER-2 LITERATURE SURVEY
2.1 Existing Voting Systems 4
2.2 Role Of Image Processing In Security 4
2.3 Biometric Techniques and Applications 5
2.4 Research and Studies On Biometric Voting Systems 5
2.5 Gaps Identified In Existing Systems 6
2.6 Motivation 6
CHAPTER-3 INTRODUCTION TO IMAGE PROCESSING
3.1 Image 8
3.2 Purpose Of Image Processing 10
3.3 Block Daigram Of Image Processing 10
3.4 Approach 11
CHAPTER-4 FLOW CHART
4.1 Flow Chart 12
CHAPTER-5 SOFTWARE IMPLEMENTATION
5.1 Matlab 14
5.2 Algorithms 16
CHAPTER-6 CODE IMPLEMENTATION
6.1 MATLAB code 17
CHAPTER-7 RESULTS
viii
7.1 Results 27
CHAPTER-8 CONCLUSION AND FUTURE SCOPE
8.1 Conclusion 29
8.2 Future Scope 30
ix
LIST OF FIGURES
Serial Name Source Page Number
Number
1 Fig 3.1: : Images and OpenAlr 8
corresponding pixels
2 Fig 3.2: Flow Chart of Getty Images 10
Digital Image Processing
3 Fig :4.1 flow chart Research 12
x
CHAPTER 1
INTRODUCTION
1.1 Overview of the Project
Voting is a fundamental process in any democratic system, ensuring that citizens can express their
preferences in governance. Over the years, voting methods have evolved from paper-based systems
to electronic voting machines, and now, towards advanced biometric systems. However, traditional
voting systems often face challenges such as voter fraud, impersonation, ballot tampering, and
logistical inefficiencies. These issues compromise the integrity of elections and erode public trust
in the electoral process.
To address these challenges, this project proposes a voting machine based on image processing
techniques. The system integrates biometric authentication, leveraging the unique physical traits
of voters, such as fingerprints or facial features, for secure and accurate voter verification. Image
processing plays a pivotal role in this system, as it enables the capture, analysis, and matching of
biometric data to ensure reliable voter identification.
This project focuses on implementing a prototype of the biometric voting system using MATLAB.
The proposed system ensures transparency, security, and efficiency in the voting process, making
it a robust alternative to traditional systems.
1.2 Objectives
The main objectives of this project are:
1. To design a secure and efficient voting system using biometric authentication.
2. To employ image processing techniques for real-time voter verification.
3. To eliminate common voting malpractices such as multiple voting and impersonation.
4. To develop a user-friendly interface that simplifies the voting process for voters and
administrators.
5. To ensure the confidentiality and integrity of votes through secure data storage and encryption.
These objectives aim to create a secure and transparent system that upholds the principles of
democracy and electoral integrity.
1
are difficult to forge or bypass, making them highly effective in preventing voter fraud.
Image processing techniques further augment the reliability of biometric systems by enabling the
accurate capture, enhancement, and matching of biometric data. Common biometric modalities
used in voting systems include:
1. Fingerprint Recognition: Analyses ridge patterns unique to each individual.
2. Facial Recognition: Maps facial features such as the distance between eyes, nose, and mouth.
3. Iris Scanning: Examines the intricate patterns in the iris of the eye.
Countries like India, Ghana, and Estonia have implemented biometric-based voting systems to
address electoral challenges. These systems have shown significant improvements in voter
authentication accuracy, reduced fraud, and increased public trust.
This introduction provides a detailed background on the project, highlights its objectives, and
emphasizes the importance of biometrics in enhancing the security and efficiency of voting
systems.
1.4 Key Features
1.Biometric Authentication
o The system uses unique biometric traits such as fingerprints or facial features for voter
identification.
o Prevents impersonation and ensures that only registered voters can participate in the
election.
3. User-Friendly Interface
o A simple and intuitive graphical user interface (GUI) allows voters to interact with the
system seamlessly.
o Guides voters through the process of authentication and vote casting with minimal technical
knowledge required.
4. Real-Time Verification
o Processes biometric data in real-time, enabling quick and efficient voter authentication.
o Reduces wait times during elections and improves overall voting experience.
2
o Ensures the confidentiality and integrity of the votes, preventing tampering or unauthorized
access.
6. Fraud Prevention
o Eliminates common electoral malpractices such as multiple voting, fake registrations, and
proxy voting.
o Ensures that each voter can cast only one vote.
7. Scalability
o The system can be scaled to accommodate large voter populations, making it suitable for
local, national, or global elections.
9.Audit Trail
o Maintains a secure log of voter authentication and vote casting for transparency and
accountability.
o Helps in post-election audits to verify the integrity of the election process.
10. Cost-Effective
o Reduces the need for extensive manpower and physical resources associated with
traditional voting systems.
o Offers a long-term solution with minimal maintenance costs.
These key features make the proposed voting machine a secure, efficient, and reliable solution for
modern electoral challenges.
3
CHAPTER 2
Literature Survey
The literature survey highlights existing research and systems in the domain of voting
technologies, focusing on image processing and biometric authentication for secure and efficient
voting.
4. Pattern Matching
o Comparing extracted features with stored templates to verify the voter's identity.
4
These techniques ensure that the system is robust against variations in image quality,
lighting conditions, and user errors.
By addressing these gaps, this project aims to create a cost-effective, scalable, and secure
biometric voting system using image processing techniques.
This literature review provides a foundation for understanding the limitations of existing systems
and the potential of biometric-based solutions.
2.6 Motivation
The motivation for developing a voting machine using image processing stems from the increasing
need for secure, accurate, and efficient voting systems in modern democracies. Elections are the
cornerstone of any democratic process, and the integrity of voting systems directly impacts public
trust and governance. However, traditional and even many electronic voting systems continue to
face significant challenges such as voter fraud, impersonation, and electoral manipulation. These
issues undermine the credibility of election results, potentially leading to political instability and
loss of public confidence in the democratic process.
In many countries, the vulnerability of traditional voting methods to fraud, such as ballot stuffing,
multiple voting, and identity theft, remains a pressing issue. Image processing and biometric
systems provide a more secure way to authenticate voters, ensuring that each individual can cast
only one vote, thus eliminating the risk of impersonation or fraudulent voting.
With the rise of digital technologies, electronic voting systems have been adopted by various
nations. However, these systems are not immune to security breaches, including hacking and data
tampering. Biometric authentication offers a way to mitigate these threats, making it significantly
harder for unauthorized individuals to manipulate the election process. The integration of image
processing enhances the robustness of these biometric systems by ensuring accurate and reliable
voter identification.
Traditional voting methods are often slow and cumbersome, with manual counting and the
potential for human error. This can lead to delays in the announcement of results, which can create
6
confusion and discontent among voters. By incorporating image processing into biometric systems,
voting machines can ensure faster and more accurate verification of voters, leading to quicker
results and a more efficient election process.
4.Technological Advancements
With advances in image processing algorithms, machine learning, and artificial intelligence, it has
become increasingly feasible to implement robust, high-accuracy biometric authentication systems
for voting. The ability to analyze fingerprints or facial features with high precision allows for the
development of cost-effective and scalable biometric systems. As a result, such technology can be
applied to large-scale elections, enhancing both security and efficiency.
Several countries, such as India with its Aadhaar system, and Estonia with its e-voting system,
have begun integrating biometric authentication into their electoral processes. These examples
demonstrate the growing acceptance of biometric systems for voting and highlight the potential for
widespread adoption. This project aims to contribute to this global trend by developing a voting
machine that combines image processing with biometric authentication to ensure a fair and
transparent voting process.
A secure, efficient, and transparent voting system fosters trust among voters, which is essential
for a functioning democracy. Biometric-based voting machines, powered by image processing, can
increase transparency by providing accurate voter verification and an audit trail that ensures
accountability at every step of the voting process. This transparency helps build voter confidence,
reducing the likelihood of election-related disputes.
By addressing these critical issues, this project seeks to create a reliable, secure, and efficient
voting machine that leverages image processing techniques for biometric authentication.
Ultimately, the goal is to contribute to the development of a next-generation voting system that
upholds the principles of democracy, security, and trust.
This section outlines the driving forces behind the project, emphasizing the importance of
improving security, efficiency, and transparency in the electoral process.
7
CHAPTER 3
INTRODUCTION TO IMAGE
PROCESSING
3.1 IMAGE
Digital Image is composed of a finite number of elements, each of which elements have a
particular value at a particular location. These elements are referred to as picture elements,
image elements, and pixels. A Pixel is most widely used to denote the elements of a Digital
Image.
8
Image Processing
Image processing is a method to convert an image into digital form and perform some
operations on it, in order to get an enhanced image or to extract some useful information from
it. It is a type of signal dispensation in which input is image, like video frame or photograph
and output may be image or characteristics associated with that image. Usually, Image
Processing system includes treating images as two- dimensional signals while applying already
set signal processing methods to them. It is among rapidly growing technologies today, with its
applications in various aspects of a business. Image Processing forms core research area within
engineering and computer science disciplines too.
Image compression, which reduces the memory requirements by removing the redundancy
present in the image, that is, the image information which is not perceptible to the human
eye.
Image pre-processing which consists of improving the visual quality of the image by
reducing noise, pixel calibration and standardization, enhancing the edge detection, and
making the image analysis step more reliable based on objective and well-established
criteria. The term image pre-processing, in general, is referred to all manipulations on an
image, each of which produces a new imag
9
3.2Purpose of Image processing
10
o Image Enhancement to Image Restoration: Describes refining the enhanced image
further, correcting flaws and restoring its quality.
o Image Compression: Indicates reducing the file size of images while maintaining
their quality, facilitating easier storage and sharing.
Image processing is faster and cost effective, Noise free. Image sharpening and
restoration – To create a better image.
11
CHAPTER 4
FLOW CHART
4.1 Flow Chart
12
Flow chat description:
This flowchart illustrates the process of verifying and casting a vote in an election system. Here’s
the step-by-step explanation:
1. Start :
- The process begins at the starting point.
2. Capture User Data :
- The system collects the necessary information from the user, such as identification details (e.g.,
voter ID or personal data).
3. Verify Voter:
- The system checks the validity of the user’s information against the voter database to confirm
if the person is an authorized voter.
- This step ensures that only eligible voters proceed to the next stage.
4. Decision Point (Already Voted):
- If the system detects that the voter has already cast their vote, it loops back, preventing duplicate
voting.
- If the voter hasn’t voted yet, the process moves forward.
5. Cast Your Vote:
- The voter is allowed to cast their vote once verification is successful.
6. Vote Successfully Cast:
- The system confirms that the vote has been successfully recorded.
7. End:
- The process concludes, ensuring the vote is securely and accurately registered.
This flowchart represents a typical voting system emphasizing voter authentication and
prevention of multiple votes.
13
CHAPTER 5
SOFTWARE IMPLEMENTATION
5.1 MATLAB:
Interactive environment: The MATLAB environment allows users to interact with their data
and algorithms in an intuitive way, making it easy to test and debug code.
Visualization tools: MATLAB provides powerful tools for data visualization, including 2D and
3D plotting, and animations.
Toolboxes and add-ons: MATLAB offers a variety of toolboxes and add-ons for specific
domains such as signal processing, control systems, and image processing.
Integrations: MATLAB can integrate with other programming languages, such as C, C++, and
Java, allowing users to combine the best of both worlds. In conclusion, MATLAB is a versatile
tool for numerical computing and data analysis that can be applied to a wide range of
applications. Whether you are working in academia or industry MATLAB offers a
comprehensive and user-friendly environment for developing and testing your algorithms.
Uses of MATLAB:
• Developing algorithms
• Creating interfaces for the user that is the GUI- Graphical User Interface and
other applications that is the API – Application Programming Interface .
14
Commands used in MATLAB:
6. xlabel and ylabel - add labels to the x-axis and y-axis, respectively
15. sort - sort the elements of a vector or matrix in ascending or descending order
15
5.2 ALGORITHMS
Voter Verification and Voting Process
2. Voter Verification:
o Allow the user to load a test image for verification (e.g., using a webcam or selecting
a file).
o Convert the test image to grayscale and resize it to a fixed size (e.g., 100x100).
o Use Principal Component Analysis (PCA) to compare the test image with registered
face images.
o If a match is found, verify the voter and proceed to the voting pad.
o If no match is found, notify the user that the voter was not recognized.
3. Voting Pad:
o If the voter is verified, show the voting interface.
o Display a list of candidates along with their images.
o Allow the user to select a candidate from the displayed options.
o Enable the user to cast their vote by selecting the candidate and pressing a "Cast
Vote" button.
o If the user has already voted, display a message saying "You have already voted" and
disable further voting.
Workflow
1. Load Registered Faces:
o Check if the folder path for registered faces exists or prompt the user to select it.
-
16
2. Voter Image Selection:
o Ask the user to load a test image for verification.
3. Face Recognition:
o Use PCA to compare the test image with registered faces and determine if there is
a match.
4. Voting Interface:
o If the voter is verified, display the voting interface with candidate images and
selection options.
5. Cast Vote:
o If a candidate is selected, store the vote status and mark the voter as having voted.
This algorithm encapsulates the full process of voter verification, voting, and status
management using face recognition and an interactive voting pad interface.
17
CHAPTER 6
CODE IMPLEMENTATION
6.1 MATLAB Code:
18
testProjection = coeff' * double(testVector);
% Compute distances
distances = sum((testProjection - coeff' * faceVectors).^2, 1);
disp('Distances to registered faces:');
disp(distances);
% Set a threshold for recognition
distanceThreshold = 150; % Adjust this value based on your testing
% Find the closest match
[minDistance, recognizedIndex] = min(distances);
% Check against the threshold
if minDistance > distanceThreshold
recognizedIndex = 0; % No close match
else
disp(['Recognized Index: ', num2str(recognizedIndex), ' with Distance: ',
num2str(minDistance)]);
end
end
function faceImages = load_registered_faces()
% Check if the folder path for registered faces exists
if exist('faces_folder_path.txt', 'file')
% Read folder path from file
fid = fopen('faces_folder_path.txt', 'r');
facesFolder = fgetl(fid);
fclose(fid);
else
% Ask user to select the folder if not found
facesFolder = uigetdir('', 'Select the folder containing registered faces');
if facesFolder ~= 0
% Save the selected folder path for future use
fid = fopen('faces_folder_path.txt', 'w');
fprintf(fid, '%s', facesFolder);
fclose(fid);
else
facesFolder = ''; % Return empty if no folder is selected
disp('No folder selected. Exiting...');
return;
end
end
% Initialize a 3D array to store face images (height x width x numImages)
faceImages = []
% Get a list of all image files in the folder (only .jpg files in this case)
imageFiles = dir(fullfile(facesFolder, '.jpg')); % Change to '.png' or '*.bmp' if needed
if isempty(imageFiles)
disp('No image files found in the folder.');
return;
end
% Get the size of the first image to initialize faceImages matrix
firstImage = imread(fullfile(facesFolder, imageFiles(1).name));
grayFirstImage = rgb2gray(firstImage);
resizedFirstImage = imresize(grayFirstImage, [100, 100]);
19
% Resize for consistency
[height, width] = size(resizedFirstImage);
% Get the dimensions of the resized image
% Initialize the faceImages matrix to store all face images
faceImages = zeros(height, width, length(imageFiles)); % 3D matrix to store each face as
a slice
% Process each registered face image
for i = 1:length(imageFiles)
% Read the image
img = imread(fullfile(facesFolder, imageFiles(i).name));
% Convert the image to grayscale (necessary for face recognition)
grayImage = rgb2gray(img)
% Resize the image to a standard size (e.g., 100x100 pixels)
grayImage = imresize(grayImage, [100, 100]); % Resize for consistency
% Store the preprocessed image in the 3D matrix (each image is a slice)
faceImages(:,:,i) = grayImage;
end
20
resultText.String = 'You have already voted!';
return; % Exit if the voter has already voted
end
if isempty(faceImages)
resultText.String = 'No registered faces found.';
return;
end
% Function to get the faces folder path from the file (or ask for input if not present)
function facesFolder = getFacesFolder()
if exist('faces_folder_path.txt', 'file')
% Read folder path from file
fid = fopen('faces_folder_path.txt', 'r');
facesFolder = fgetl(fid);
fclose(fid);
21
else
% Ask user to select the folder if not found
facesFolder = uigetdir('', 'Select the folder containing registered faces');
if facesFolder ~= 0
% Save the selected folder path for future use
fid = fopen('faces_folder_path.txt', 'w');
fprintf(fid, '%s', facesFolder);
fclose(fid);
else
facesFolder = ''; % Return empty if no folder is selected
end
end
end
% Function to load registered faces from the saved folder path
function faceImages = load_registered_faces(facesFolder)
% Initialize a 3D array to store face images (height x width x numImages)
faceImages = [];
% Get a list of all image files in the folder (only .jpg files in this case)
imageFiles = dir(fullfile(facesFolder, '.jpg')); % Change to '.png' or '*.bmp' if needed
if isempty(imageFiles)
disp('No image files found in the folder.');
return;
end
% Get the size of the first image to initialize faceImages matrix
firstImage = imread(fullfile(facesFolder, imageFiles(1).name));
grayFirstImage = rgb2gray(firstImage);
resizedFirstImage = imresize(grayFirstImage, [100, 100]); % Resize for consistency
[height, width] = size(resizedFirstImage); % Get the dimensions of the resized image
% Initialize the faceImages matrix to store all face images
faceImages = zeros(height, width, length(imageFiles)); % 3D matrix to store each face as
a slice
% Process each registered face image
for i = 1:length(imageFiles)
% Read the image
img = imread(fullfile(facesFolder, imageFiles(i).name));
% Convert the image to grayscale (necessary for face recognition)
grayImage = rgb2gray(img);
% Resize the image to a standard size (e.g., 100x100 pixels)
grayImage = imresize(grayImage, [100, 100]); % Resize for consistency
% Store the preprocessed image in the 3D matrix (each image is a slice)
faceImages(:,:,i) = grayImage;
end
end
% Function to check if the voter has voted
function status = hasVoted()
statusFile = 'voted_status.txt';
if exist(statusFile, 'file')
status = readStatusFromFile(statusFile);
else
status = false; % If file doesn't exist, voter has not voted
22
end
end
23
subplot(3, 2, (i - 1) * 2 + 1); % Position for the image
imshow(img);
title(candidates{i});
24
function markAsVoted()
% Write the "voted" status to a file
statusFile = 'voted_status.txt';
writeStatusToFile(statusFile, true); % Set status to true (voted)
end
function resetVotingStatus()
% Reset the "voted" status to false (or delete status file)
statusFile = 'voted_status.txt';
writeStatusToFile(statusFile, false) ; % Set status to false (not voted)
end
25
function status = readStatusFromFile(fileName)
% Read the status from the file
fileID = fopen(fileName, 'r');
status = fscanf(fileID, '%d');
fclose(fileID);
end
function refresh_interface()
% Create a separate figure for the refresh interface
hFig = figure('Name', 'Refresh Voting Status', 'Position', [100, 100, 400, 200]);
26
CHAPTER 7
RESULTS
7.1 Results
Fig 7.1
Fig 7.2
27
Fig 7.3
28
CHAPTER 8
SCOPE
8.1 CONCLUSION:
This facial recognition-based voting system is a secure and efficient method for verifying
voter identity and ensuring the integrity of the voting process. The key features of the system
are as follows:
1. Facial Recognition for Voter Authentication: The system uses facial recognition to verify
the identity of the voter before allowing them to cast their vote. This ensures that only
registered voters can vote, reducing the risk of identity fraud.
2. Prevention of Multiple Voting: By tracking the voting status of each user (using a text file
to record whether the voter has voted), the system prevents voters from casting multiple
votes, thus maintaining the fairness of the election process.
3. User-Friendly Interface: The system provides an intuitive graphical user interface (GUI)
for the voter to interact with. It allows for easy selection of candidates and ensures a smooth
voting experience.
4. Modular Design: The code is modular, with distinct functions for face recognition,
managing voter status, and interacting with the GUI. This makes it easier to modify or extend
the system for additional features, such as adding more candidates or integrating with a
database for larger-scale applications.
5. Scalability and Security: While the current implementation is suitable for small-scale usage
with a limited number of registered voters, the system can be extended to accommodate
larger voter databases. Enhanced security measures, like encryption of voter data, could
further strengthen the system against potential security breaches.
29
8.2 FUTURE SCOPE:
The facial recognition-based voting system can be further enhanced and scaled up for broader
adoption. Here are some potential areas for future development:
30