Professional Documents
Culture Documents
Project Report On Online Voting System U
Project Report On Online Voting System U
On
ONLINE VOTING SYSTEM USING FACE RECOGNITON
BACHELOR OF TECHNOLOGY
in
INFORMATION TECHNOLOGY
by
B.ARUN
(10803009)
V.K.GOUTHAMAN (10803021)
A.NAFEES RAJA
(10803040)
BONAFIDE CERTIFICATE
RECOGNITION
is
the
bonafide
work
of
INTERNAL EXAMINER
DATE:-
INTERNAL GUIDE
EXTERNAL EXAMINER
ABSTRACT
ACKNOWLEDGEMENT
Project is a test of not only technical skills but also team work and
performance
under
various
constraints.
Our heartfelt thanks to our project coordinator , Ms.Panbu M.E who gave
us valuable inputs and advice.
We will be ever grateful to our guide Ms. Deepa chandra, B.E., Lecturer
without whose guidance, this project would not have become successful.
Finally, we would like to thank our parents and mentors for the support
that they have been giving us.
ii
TABLE OF CONTENTS
CHAPTER NO.
1.
TITLE
PAGE NO.
ABSTRACT
iii
ACKNOWLEDGEMENT
TABLE OF CONTENT
vi
LIST OF FIGURES
viii
LIST OF ABBREVATIONS
viii
2.
FACE RECOGNITION
11
3.
23
iii
4.
DEVELOPMENT ENVIRONMENT
26
5.
TESTING
27
5.1. INTRODUCTION
5.2. IMPORTANT OF TESTING
5.3. TESTING DEFINITION
5.3.1. UNIT TESTING
5.3.2. INTEGERATION TESTING
5.3.3. SYSTEM TESTING
5.3.4. ACCEPTANCE TESTING
6.
CONCLUSION
31
7.
FUTURE ENHANCEMENT
32
8.
BIBLIOGRAPHY
33
9.
34
10.
45
iv
LIST OF FIGURES
10
12
14
15
16
17
18
19
LIST OF ABBREVATIONS
ABBREVIATION
NAME
ASP
MATLAB
Matrix laboratory
PCA
IIS
HTTP
vi
CHAPTER - 1
tools
for
ASP
have
been
minimal.
Most
ASP
programmers
resort to embedding temporary Response. Write statements in their code to trace the
progress of its execution.
No real state management:
Session state is only maintained if the client browser supports cookies. Session
state information can only be held by using the ASP Session object. And you have to
implement additional code if you, for example, want to identify a user.
Update files only when server is down:
If your Web application makes use of components, copying new files to your
application should only be done when the Web server is stopped. Otherwise it is like
pulling the rug from under your application's feet, because the components may be in use
(and locked) and must be registered.
Obscure Configuration Settings:
The configuration information for an ASP web application (such as session state
and server timeouts) is stored in the IIS metabase. Because the metabase is stored in a
proprietary format, it can only be modified on the server machine with utilities such as
the Internet Service Manager. With limited support for programmatically manipulating or
extracting these settings, it is often an arduous task to port an ASP application from one
server to another.
1.2 ASP.NET:
ASP.NET was developed in direct response to the problems that developers had
with classic ASP. Since ASP is in such wide use, however, Microsoft ensured that ASP
scripts execute without modification on a machine with the .NET Framework (the ASP
engine, ASP.DLL, is not modified when installing the .NET Framework). Thus, IIS can
house both ASP and ASP.NET scripts on the same machine.
Advantages of ASP.NET:
Separation of Code from HTML:
To make a clean sweep, with ASP.NET you have the ability to completely
separate layout and business logic. This makes it much easier for teams of programmers
and designers to collaborate efficiently. This makes it much easier for teams of
programmers and designers to collaborate efficiently.
Web Applications are built using Web Forms. ASP.NET comes with built-in Web
Forms controls, which are responsible for generating the user interface. They
mirror typical HTML widgets like text boxes or buttons. If these controls do not
fit your needs, you are free to create your own user controls.
.NET Framework provides a rich set of class libraries. These include base classes,
like networking and input/output classes, a data class library for data access, and classes
for use by programming tools, such as debugging services. All of them are brought
together by the Services Framework, which sits on top of the common language runtime.
ASP.NET comes with built-in Web Forms controls, which are responsible for
generating the user interface. They mirror typical HTML widgets like text boxes or
buttons. If these controls do not fit your needs, you are free to create your own user
controls. Web Services brings you a model to bind different applications over the
Internet. This model is based on existing infrastructure and applications and is therefore
standard-based, simple, and adaptable. Web Services are software solutions delivered via
Internet to any device. Today, that means Web browsers on computers, for the most part,
but the device-agnostic design of .NET will eliminate this limitation.
One of the obvious themes of .NET is unification and interoperability between
various programming languages. In order to achieve this; certain rules must be laid and
all the languages must follow these rules. In other words we can not have languages
running around creating their own extensions and their own fancy new data types. CLS is
the collection of the rules and constraints that every language (that seeks to achieve .NET
compatibility) must follow.
The CLR and the .NET Frameworks in general, however, are designed in such a
way that code written in one language can be seamlessly be used by another language.
Hence ASP.NET can be programmed in any of the .NET compatible language whether it
is VB.NET, C#, Managed C++ or JScript.NET.
functionality.
Just specify elements as you did with HTML elements, but add a tag prefix, which
is an alias for the fully qualified namespace of the control. Again you must include the
runat=server attribute. If you want to get programmatic access to the control, just add an
Id attribute.
You can include properties for each server control to characterize its behavior.
For example, you can set the maximum length of a Textbox. Those properties might have
sub properties; you know this principle from HTML. Now you have the ability to specify,
for example, the size and type of the font you use (font-size and font-type).
The last attribute is dedicated to event binding. This can be used to bind the
control to a specific event. If you implement your own method MyClick, this method will
be executed when the corresponding button is clicked if you use the server control event
binding shown in the slide.
Data Binding Expression:
You can create bindings between server controls and data sources. The data
binding expression is enclosed by the character sequences <%# and %>. The databinding model provided by ASP.NET is hierarchical. That means you can create bindings
between server control properties and superior data sources.
The application was developed using the visual studio integrated development
environment. The application is first linked with the IIS server present in the host
system. The login form consists of two textboxes and a button. The first and second
textbox is used to enter the username and password respectively. The get and set
properties of these text boxes have to be modified accordingly. Then the coding for
connecting with the database is written inside the button Onclick ( ) module. The
connection with the database is established by using the sqlconnection class. The query to
the database is sent using the sqldataadapter class. Then authentication of the user is
verified by comparing the values entered in the textboxes with those in the database. If
the user name and password are valid the page is redirected to another page where the
user is prompted to send the picture of his face by using the web camera. The database
also has the information about the constituency of the particular person and the names of
the candidates contesting in it. The details of the candidates are displayed as radio buttons
in the voting page.
10
CHAPTER - 2
2. FACE RECOGNITION
2.1 The Problem of Face Recognition:
Face recognition is a very interesting quandary. Ideally a face detection system
should be able to take a new face and return a name identifying that person.
Mathematically, what possible approach would be robust and fairly computationally
economical? If we have a database of people, every face has special features that define
that person. Greg may have a wider forehead, while Jeff has a scar on his right eyebrow
from a rugby match as a young tuck. One technique may be to go through every person in
the database and characterize it by these small features. Another possible approach would
be to take the face image as a whole identity.
Statistically, faces can also be very similar. Walking through a crowd without
glasses, blurry vision can often result in misidentifying someone, thus yielding an
awkward encounter. The statistical similarities between faces gives way to an
identification approach that uses the full face. Using standard image sizes and the same
initial conditions, a system can be built that looks at the statistical relationship of
individual pixels. One person may have a greater distance between his or her eyes then
another, so two regions of pixels will be correlated to one another differently for image
sets of these two people.
From a signal processing perspective the face recognition problem essentially
boils down to the identification of an individual based on an array of pixel intensities.
Using only these input values and whatever information can be gleaned from other
images of known individuals the face recognition problem seeks to assign a name to an
unknown set of pixel intensities.
11
12
13
14
Next we need to calculate the average face in face space. Here M is the number of
faces
eigenvalue associated with the corresponding eigenvector. If the eigenface with small
eigenvalues are neglected, then an image can be a linear combination of reduced no of
these eigenfaces. For example, if there are M images in the training set, we would get M
eigenfaces. Out of these, only M eigenfaces are selected such that they are associated
with the largest eigenvalues. These would span the M-dimensional subspace face space
out of all the possible images (image space).
When the face image to be recognized (known or unknown), is projected on this
face space (figure 1), we get the weights associated with the eigenfaces, that linearly
approximate the face or can be used to reconstruct the face. Now these weights are
compared with the weights of the known face images so that it can be recognized as a
known face in used in the training set. In simpler words, the Euclidean distance between
the image projection and known projections is calculated; the face image is then
classified as one of the faces with minimum Euclidean distance.
16
used commonly in both face recognition and image compression.* PCA is applicable to
face recognition because face images usually are very similar to each other (relative to
images of non-faces) and clearly share the same general pattern and structure.PCA tells
us that since we have only M images, we have only M non-trivial eigenvectors. We can
solve for these eigenvectors by taking the eigenvectors of a new M x M matrix:It turns
out that only M-k eigenfaces are actually needed to produce a complete basis for the face
space, where k is the number of unique individuals in the set of known faces.
In the end, one can get a decent reconstruction of the image using only a few
eigenfaces (M), where M usually ranges anywhere from .1M to .2M. These correspond
to the vectors with the highest eigenvalues and represent the most variance within face
space.
These eigenfaces provide a small yet powerful basis for face space. Using only a
weighted sum of these eigenfaces, it is possible to reconstruct each face in the dataset.
Yet the main application of eigenfaces, face recognition.
17
18
19
Given that the initial objective is a face recognition system, eigenfaces happen to
be a fairly easy, computationally economical, and successful method to determine if a
given face is a known person, a new face, or not a face at all. A set of eigenface vectors
can be thought of as linearly independent basis set for the face space. Each vector lives in
its own dimension, and a set of M eigenfaces will yield an M dimensional space.
It should also be noted that the eigenfaces represent the principal components of
the face set. These principal components are very useful in simplifying the recognition
process of a set of data. To make it simpler, suppose we had a set of vectors that
represented a persons weight and height. Projecting a given person onto these vectors
would then yield that persons corresponding weight and height components. Given a
database of weight and height components, it would then be quite easy to find the closest
matches between the tested person and the set of people in the database. A similar
process is used for face recognition with eigenfaces. First take all the mean subtracted
images in the database and project them onto the face space. This is essentially the dot
product of each face image with one of the eigenfaces. Combining vectors as matrices,
one can get a weight matrix (M*N, N is total number of images in the database)
An incoming image can similarly be projected onto the face space. This will yield
a vector in M dimensional space. M again is the number of used eigenfaces. Logically,
faces of the same person will map fairly closely to one another in this face space.
Recognition is simply a problem of finding the closest database image, or mathematically
finding the minimum Euclidean distance between a test point and a database point.
Due to overall similarities in face structure, face pixels follow an overall face
distribution. A combination of this distribution and principal component analysis allows
for a dimensional reduction, where only the first several eigenfaces represent the majority
information in the system. The computational complexity becomes extremely reduced,
making most computer programs happy. In our system, two techniques were used for
image recognition.
20
does not exist a meaningful advantage to using more eigenfaces than first provide the
desired level of accuracy. Furthermore, measurements of accuracy with various vertical
and horizontal occlusions and two-dimensional boxcar blurs also demonstrate that excess
eigenfaces provide no benefit in sub-optimal conditions. In this way it becomes evident
that if higher success rates are to be assured in most reasonable conditions then
refinements to the eigenface concept must be made. Anecdotal experimentation with
acquired image sets indicates that profile size, complexion, ambient lighting and facial
angle play significant parts in the recognition of a particular image. Further research
could be conducted into the viability of using eigenfaces and weightings taken for
varying angles and lighting situations in order to allow for greater variability in both
input images and detection opportunities. Clearly the eigenface offers much promise for
the field of facial image recognition but not before some technical refinement.
22
CHAPTER - 3
2.
3.
4.
23
b. Create a new project by clicking the New Project button in the toolbar.
The New Deployment Project dialog box opens. Select the product you are
using in the left pane. Select the type of output desired in the right pane.
c. Specify the following settings for your project. Click the Settings button in
the toolbar to open the Settings dialog box.
Setting
Value
Component
face
name
Class name
facerec
Project directory
Show verbose
Selected
output
d. Add the facerec.m file to the project. Locate your work directory and
navigate to the face directory, which contains the M-file for the facerec
function.
e. Build the component by clicking the Build button
in the Deployment
Tool toolbar.
The build process begins, and a log of the build appears in the Output pane
of the Deployment Tool dialog box. The generated component files are placed in
two newly created directories, src and distrib, in the face directory. A copy of the
build log is placed in the src directory.
24
25
CHAPTER - 4
4. DEVELOPMENT ENVIRONMENT
4.1 Hardware Environment
The minimum configuration required to run this project are:
1. Main processor
: Pentium III
2. RAM
: 256 MB
3. Hard Disk
: 20 GB
4. Key Board
5. Mouse
: 3 buttons
: Matlab
: ASP.NET
: SQL Server
Operating System
: Windows
26
CHAPTER - 5
5. TESTING
5.1
Introduction
Information Processing has undergone major improvements in the past two decades
in both hardware and software. Hardware has decreased in size and price, while providing
more and faster processing power. Software has become easier to use, while providing
increased capabilities. There is an abundance of products available to assist both end-users
and software developers in their work. Software testing, however, has not progressed
significantly. It is still largely a manual process conducted as an art rather than a
methodology. It is almost an accepted practice to release software that contains defects.
Software that is not thoroughly tested is released for production. This is true for
both off-the-shelf software products and custom applications. Software vendor and inhouse systems developers release an initial system and then deliver fixes to the code. They
continue delivering fixes until they create a new system and stop supporting the old one.
The user is then forced to convert to the new system, which again will require fixes.
In-house systems developers generally do not provide any better level of support.
They require the users to submit Incident Reports specifying the system defects. The
Incident Reports are then assigned a priority and the defects are fixed as time and budgets
permit.
complete systems testing promptly to meet the deadline. Nevertheless, systems testing are
important.
27
Unit Testing
Systems Testing
Acceptance Testing
28
5.3.2Integration Testing
The second level of testing includes integration testing. Here different dependent
modules are assembled and tested for any bugs that may surface due to the integration of
modules. Thus, the administrator module and various visa immigration modules are
tested here.
1.
Quality/standards compliance
2.
Business requirements
3.
Performance capabilities
4.
Operational capabilities
Below are defined a few test cases which have been implemented for the various
screens. The outputs have been registered and the required changes have been
incorporated.
30
CHAPTER 6
6. CONCLUSION
At present our government is spending more than 125 crores for conducting a Lok
Sabha election. This money is spent on issues such as security, electoral ballots etc. The
average percentage of voting is a less than 60% .Moreover voting fraud can be easily done in
the present system. Also the percentage of literates coming to vote is very less. But with our
system the money spent on election can be reduced to less than 10 crores.
Also there is no chance of voter frauds and the money spent on security can be
drastically decreased. Persons who have an internet connection at home with a web camera
can vote without taking the strain to come to voting booths.
31
CHAPTER 7
7. FUTURE ENHANCEMENT
The same system can be extended to perform the function of counting the number of
votes casted and announcing the results immediately. We can include an administrator mode
in which the user details can be updated dynamically through the application only. In near
future we can even implement the system in mobile phones. The user can access the website
through mobile phone and cast the vote.
32
CHAPTER - 8
8. BIBLIOGRAPHY
Books referred:
1. Matthew A. Turk and Alex P. Pentland. Eigenfaces for recognisation. Journal of
cognitive nerosciences, Volume 3, Number 1, Nov 27, 2002.
2. Dimitri PISSARENKO. Eigenface-based facial recognition. Dec1, 2202.
3. Matthew A. Turk and Alex P. Pentland. Face recognition using eigenfaces. Proc.
CVPR , pp 586-591. IEEE, June 1991.
4. ASP.NET Bible by Mridula Parihar , Essam Ahmed , Jim Chandler , Bill Hatfield , Rick
Lassan , Peter MacIntyre , Dave Wanta
5. ASP.NET: The Complete Reference by Matthew MacDonald
33
CHAPTER 9
StrPass = TxtPass.Text
BValid = False
ConVM = New MySqlConnection("server=localhost; user id=arun; password=project;
database=voting; pooling=false")
//pass the query
StrSQL = "SELECT * FROM ov WHERE id_no='" & StrUser & "' AND pin_no='" &
StrPass & "'"
CmdCoInfo = New MySqlCommand(StrSQL, ConVM)
ConVM.Open()
DrCoInfo = CmdCoInfo.ExecuteReader() //execute the query
//validate the username and password
While DrCoInfo.Read()
If DrCoInfo("id_no") <> "" And DrCoInfo("pin_no") <> "" Then
BValid = True
Else
End If
End While
ConVM.Close()
35
Id="TxtPass"
width="150"
runat="server"/></td>
</tr>
36
TextMode="Password"
<tr>
<td><br></td>
</tr>
<tr>
<td> </td>
<td width="10"> </td>
<td><asp:Button Id="cmdLogin" OnClick="login_Click" Text="Login" runat="server"
/></td>
</tr>
</table>
<br>
<br>
<div id="ErrorMessage" runat="server" />
</form>
</body>
</html>
</body>
</html>
Second.aspx:
<%@ Page Language="VB" debug="true" %>
<%@ Reference Page="sample1.aspx" %>
<%@ Import Namespace = "System.Data" %>
<%@ Import Namespace = "MySql.Data.MySqlClient" %>
<script language="VB" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
37
38
MySQLDataGrid.DataSource = myDataSet
MySQLDataGrid.DataBind()
End Sub
sub Page_Load1(Sender As Object, E As EventArgs)
Server.Transfer("one.aspx")
End Sub
</script>
<html>
<head>
<title>Simple MySQL Database Query</title>
</head>
<body>
<form runat="server">
<asp:DataGrid id="MySQLDataGrid" runat="server" />
<br>
<asp:DataGrid id="MySQLDataGrid1" runat="server" />
<br>
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem Value="rb1">karunanidhi</asp:ListItem>
<asp:ListItem Value="rb2">jayalalitha</asp:ListItem>
<asp:ListItem Value="rb3">vijayakanth</asp:ListItem>
<asp:ListItem Value="rb4">vaiko</asp:ListItem>
</asp:RadioButtonList>
<asp:Button ID="Button1" runat="server" on_click="Page_Load1" Text="submit" />
39
</form>
</body>
</html>
Error.aspx
<%@ language=VB %>
<form action="a1.aspx" >
your datas are incorrect
</form>
Final.aspx
<%@ language=VB %>
<form action="a1.aspx" >
You have successfully cast your vote
</form>
40
Matlab coding:
if exist('img')
ingresso=double(img(:));
if (exist('face_database.dat')==2)
load('face_database.dat','-mat');
% face_number is equal to "M" of Turk's paper
% i.e. the number of faces present in the database.
% These image are grouped into classes. Every class (or set) should include
% a number of images for each person, with some variations in expression
matrice=zeros(size(data{1,1},1),face_number);
for ii=1:face_number
matrice(:,ii)=double(data{ii,1});
end
somma=sum(matrice,2);
media=somma/face_number;
for ii=1:face_number
matrice(:,ii)=matrice(:,ii)-media;
end
matrice=matrice/sqrt(face_number);
% up to now matrix "matrice" is matrix "A" of Turk's paper
elle=matrice'*matrice;
% matrix "elle" is matrix "L" of Turk's paper
% eigenvalues and eigenvectors of the "reduced" matrix A'*A
[V,D] = eig(elle);
% the following multiplication is performed to obtain the
% eigenvectors of the original matrix A*A' (see Turk's paper)
% See also Karhunen-Loeve algorithm, for face recognition
if det(D)~=0
Vtrue=matrice*V*(abs(D))^-0.5;
41
else
Vtrue=matrice*V;
end
%Vtrue=matrice*V;
Dtrue=diag(D);
% the eigenvalues are sorted by order and only M' of them
% are taken. We impose M' equal to the number of classes
% (max_class-1)
[Dtrue,ordine]=sort(Dtrue);
Dtrue=flipud(Dtrue);
ordine=flipud(ordine);
Vtrue(:,1:face_number)=Vtrue(:,ordine);
Vtrue=Vtrue(:,1:max_class-1);
Dtrue=Dtrue(1:max_class-1);
% we calculate the eigenface components of
% the normalized input (mean-adjusted). I.e. the input
% image is projected into "face-space"
pesi=Vtrue'*(ingresso-media);
pesi_database
= zeros(max_class-1,max_class-1);
pesi_database_mediati = zeros(max_class-1,max_class-1);
numero_elementi_classe=zeros(max_class-1,1);
for ii=1:face_number
ingresso_database=double(data{ii,1});
classe_database=data{ii,2};
pesi_correnti=Vtrue'*(ingresso_database-media);
42
pesi_database(:,classe_database)=pesi_database(:,classe_database)+pesi_correnti;
numero_elementi_classe(classe_database)=numero_elementi_classe(classe_database)+1;
end
for ii=1:(max_class-1)
pesi_database_mediati(:,ii)=pesi_database(:,ii)/numero_elementi_classe(ii);
end
% pesi_database_mediati is a matrix with the averaged eigenface components
of the images
% present in database. Each class has its averaged eigenface.
% We want to find the nearest (in norm) vector to the input
% eigenface components.
distanze_pesi=zeros(max_class-1,1);
for ii=1:(max_class-1)
% distanze_pesi(ii)=norm(pesi-pesi_database_mediati(:,ii));
distanze_pesi(ii) = sum((abs(pesi-pesi_database_mediati(:,ii))));
end
[minimo_pesi,posizione_minimo_pesi]=min(distanze_pesi);
% now we are evaluating the distance of the mean-normalized
% input face from the "space-face" in order to detrmine if
% the input image is a face or not.
proiezione=zeros(size(data{1,1},1),1);
for ii=1:(max_class-1)
proiezione=proiezione+pesi(ii)*Vtrue(:,ii);
end
distanza_spazio_facce=norm((ingresso-media)-proiezione);
43
messaggio1='See Matlab Command Window to see matching result. The program has
just calculated the minimal distance from classes and the distance from Face Space. ';
messaggio2='You now should fix the two threshold-values to determine if this mathing is
correct. If both distances are below the threshold values it means that the input ';
messaggio3='face was correctly matched with a known face. If the distance from Face
Space is below the threshold value but the minimal distance from classes is above the
other threshold value, ';
messaggio4=' it means that the input image is an unknown face. See the cited article for
more informations.';
msgbox(strcat(messaggio1,messaggio2,messaggio3,messaggio4),'Matching
result','help');
disp('The nearest class is number ');
disp(posizione_minimo_pesi);
disp('with a distance equal to ');
disp(minimo_pesi);
disp('The distance from Face Space is ');
disp(distanza_spazio_facce);
else
warndlg('No image processing is possible. Database is empty.',' Warning ')
end
else
warndlg('Input image must be selected.',' Warning ')
end
end
44
CHAPTER - 10
45
46
47
48
49
50
51