AI Assignment
AI Assignment
Submitted by:
Gaurav Deol
1916977
Unit code: CIS006-2
Assignment 1: Design of machine learning solution for biometric
recognition task.
Unit coordinator: Dr. Vitaly Schetinin
ID: 1916977
E-mail: [email protected]
Table of contents:
1.0 Introduction ………………………………………………………………………. 4
1.0 Introduction
The word AI may also refer to any computer that exhibits human-like characteristics like
learning and problem-solving (Frankenfield, 2021). It's becoming bigger and attracting almost
everyone.
Biometric recognition (also known as biometrics) is the process of automatically recognizing
people based on their biological and behavioral characteristics. Fingerprint, profile, iris, palm
print, retina, hand geometry, expression, signature, and gait are examples of biometric traits
(Jain, 2008). Biometric recognition system provides two functionalities:
1. Verification ("Is this the person who he/she claims to be?")
2. Identification ("Is this person in the database?")
Among all the fields, face recognition system also plays a significant role in today's world. Face
detection is a computer technology being used in a variety of applications that identifies human
faces in digital images. Face detection also refers to the psychological process by which humans
locate and attend to faces in a visual scene (Wikipidea, 2020). It's typically purposed to
authenticate users for verifications. It works by pinpointing and measuring facial features of
person.
There's no need of remembering the password or carry any ID. Face detection and recognition
are two different things and people often get confused in these two. Face recognition is a
broader form of face detection. Face detection only detects human face but face recognition
confirms identity as well.
Fig.1 Facial Recognition
https://percentotech.com/how-your-business-can-benefit-from-facial-recognition-technology/
It's used in various sectors like access control, security, image database investigation, general
identity verification and surveillance.
Input Output
In the script of classify_yale, sklearn and Multi-Layer Perceptron Classifier are used. Various
parameters are present in sklearn MLPClassifier, that are explained below and I have also
mentioned the parameters that I used:
1. activation function: {'identity','logistic','tanh','relu'}
It's an equation to depict the output of a neural network. It's attached to each neuron and says
whether the neuron should be activated or not, on the basis of neuron's input for model's
prediction (missing link, 2021). I used tanh, the hyperbolic tan function.
Basically, the solver is for the weight optimizing process. I used 'sgd' as a solver. It's also called
Stochastic Gradient Descent. It's a simple but an efficient way to fit linear classifiers.
4. early_stopping:bool, default=False
When the validation score does not improve, early stopping is used to end the training. It's
effective if solver 'sgd' is used.
5. fit(X_train_pca,y)
Fit is a feature that changes the weight based on the input data values. It sets the weight for a
higher level of accuracy.
In summary, I extracted the zipped file and uploaded in Google drive. At first, I mounted images
in drive and converted it into vector form and then I split into testing and training sets by
applying PCA, activation function and other elements. I then imported sklearn model to
upgrade our design and gain more accuracy. Finally, I changed the number of hidden neurons
and principal components to achieve our goal of highest accuracy.
3.0 Experiments
I basically trained the machine by altering the parameters like number of hidden neurons
(noofhn) and number of principal components (noofpc) wherever required in order to achieve
our goal of maximum accuracy and minimum loss rate. I trained the machine for five times
varying the variables taken about five times. Below are the experiments in detail.
3.1 Experiment 1
At first, I put the value of hidden neurons as 200 and number of principal components as 200
and left the test size as 0.2. All these values were default values given by university already. The
screenshot and result is shown below:
Fig No. 3 Experiment 1
Table 1:
In the very first experiment, I got 0.98 i.e. 98% as highest accuracy and 0.92 i.e. 92% as lowest
accuracy. The average accuracy was 95%. The number of iterations is higher than 100.
3.2 Experiment 2
In second experiment I put number of hidden neurons and principal components both as 300. I
didn't change the test size. The screenshot and table is shown below:
Fig. 4 Experiment 2
Table 2:
In the second experiment, I got 0.99 i.e. 99% as highest accuracy and 0.94 i.e. 94% as lowest
accuracy. The average accuracy was 96%.
3.3 Experiment 3
In third experiment I put number of hidden neurons and principal components both as 400. I
didn't change the test size. The screenshot and table is shown below:
Fig. 5 Experiment 3
Table 3:
In the third experiment, I got 0.99 i.e. 99% as highest accuracy and 0.95 i.e. 95% as lowest
accuracy. The average accuracy was 96.4%.
3.4 Experiment 4
In the fourth experiment I put number of hidden neurons and principal components both as 350. I
didn't change the test size. The screenshot and table is shown below:
Fig. 6 Experiment 4
Table 4:
3.5 Experiment 5
In the last experiment I put number of hidden neurons and principal components both as 250. I
didn't change the test size. The screenshot and table is shown below:
Fig. 7 Experiment 5
Table 5:
In the last experiment, I got 0.99 i.e. 99% as highest accuracy and 0.94 i.e. 94% as lowest
accuracy. The average accuracy was 97.4%.
We didn’t take random state so, we got different accuracies though we took same noofhn and
noofc.
Basically, it's a resampling process to evaluate machine learning on a fixed data. Whenever we
take value for k, like we took k=10, then we say it as 10-fold cross validation.
It's popular and simple to understand and it gives less biased outcome.
The general process is as following:
3. Take the group as test data and take remaining as train set
Importantly, each finding in the data sample is assigned to a distinct category and remains
there throughout the process. This implies that each sample has the chance to be used in the
hold out set once and to train the model k times (Brownlee, 2018).
Basically, in my view, k fold is an effective tool to prevent over-fitting. Over- fitting is a case
where many features are given to machine and the machine gets confused so, k fold helps the
machine to get more accuracy.
n_splits=5
Fig. 9: Accuracy
4.0 Conclusion
I learnt a great platform, Google co-lab. I took random parameter, I found that when the
accuracy value is increased, the loss rate is decreased. I took hidden neurons and principal
components both as equal in each experiment and didn't vary them and found that it's effective
in getting best accuracy which is our ultimate goal. If we take different values, then we might
have to introduce K-Fold cross validation. My highest accuracy was 0.99 which I got about 5
times. I didn't change the test size since I didn't need it because the precision was already as
expected. I got many errors but my friends and tutors highly encouraged me and helped me.
This assignment totally helped me and boosted me up with huge interest in AI and face
detection, especially. I assure that I will make a real-time face detection system through various
tutorials and with the help of my tutor. I'm totally pushed ahead by this assignment.
5.0 References
6.0 Appendix