Random Search Optimisation
Random Search Optimisation
Bsc. CS&SE
Random search is family of numeric optimization method that do not required the
gradient of the problem to be optimized and random search can hence be used on
function that are not continuous and differentiable. It is nearly impossible to predict the
optimal parameter while building a model at least in the first few attempt. That is why
always go by playing with the hyperparameter to optimize them. In the past we have
trained our neural network by backpropagation which is practically impossible with the
large dataset because the weight is corrected and updated with the generalized delta rule
to minimize the prediction error through each iteration. The weight correction
methodology comprises of backpropagation the error form output layer to the hidden
layer those finding the optimal set of weight. In this process of backpropagation which
take a lot of time to find a correct set of weight to give the high accuracy and less error. It
is also impossible to update each time weight manually in each iteration while the dataset
is very big so that in this experiment, we used random search optimization which is also
the methods of Hyperparameter Tuning. Hyperparameter tuning refer to shaping of the
model architecture from the available space. In the simple word it is nothing but
searching for the right hyperparameter to find the high accuracy and precision. Random
search is a technique where random combination of the hyper parameter is used to find
the best solution for the built model. It is similar to grid grid search and yet it has proven
to yield better result comparatively. Since the selection of the parameter is completely
random. Since no intelligence is used to sample these combinations. As random value is
selected at each instance. It is highly likely that whole of action space has been reached
because of the random which take a lot of time to cover very aspect of combination
during grid search. So all the hyperparameter taken are not equally importance those
hyperparameter which gives global minimize with high accuracy and precision with less
error are to be considered.
Simulated Annealing.
Call_im.m:
This is first script that university provided to us. In this script of all 1500 images are kept
in one folder and path is set to the MATLAB and also in the script where path is also
needed. Those 1500 images are then resizing into 32*32 pixels to make standard of all
images and help easy to recognize those images. Along with the images are converted in
to double and recorded as noc and npic in workspace of MATLAB. After that all images
are set in row and column format of 1:1 ratio as in workspace of MATLAB and finally
im.mat file is created in this script.
Call_fold_data.m:
In this script the given data from the first script are place in the variable called D1. The
data are run in 5 folds cross-validation and output variable D1 is visible in a MATLAB
workspace. The variable X1, T1, X2 AND T2 are used which are matrix of training
dataset, validation set and target vector of the images in the validation set. Principal
component analysis is also used in this script. For loop is used to iterated all over the
column.
Call_pw_annealing_main.m:
This is the third script that university provided. In this script the given data are store in
the variable as mention in the above script. The main aim of annealing function is to
optimize the pairwise annealing. In workspace D1 are the image dataset created by
function that contain 1500 images. Variable like number binary classifier(nobc), number
of classifier(noc), binary classifier(nbc) and number of fold(nf) are used in this script.
3. Experiments
University Bedfordshire already the given the script written in MATLAB so we
have only to run those script and analyses those part. So, there are almost five
members in our group we have to run the script and written the report individual,
but the accuracy of the highest member should be mention there so we run the
script three times in each fold. To give the highest accuracy I mainly focus on the
neural network I trained my network three times with the different parameter.
Mainly neural network is trained consider on five different factors i.e. number of
principle component, number of hidden layer and VR ration. In the first fold I run my
experiment with default value with three times and write the value which is maximum
accuracy and then I changed the ensemble size and hidden neuron by keeping constant
the PCA and min PCA. Similarly I do my experiment with three fold also.
i. Fold 1(Default value and Default Setting)
In every fold of the experiment I have run three times. In this fold first experiment I trained
neural network three times with default value and changing the value also and I found that
highest accuracy is 82.2% when the number of pc is 80, min pc is 20, e size is 4 and hidden
neuron is 3 and average value is 82.27%
In the second fold I also run the experiment three times with the default value and changing the
value also. In this fold I change the value of esize and hidden neuron. In the default value the
accuracy is 81.5%. in the same fold when I changed the value of ensemble size from 3 to 2 and
hidden neuron from 1 to 2 then accuracy become 82.5%. in this experiment the average accuracy
is 82.5%
Iii-Fold 3
In the third fold I also run the experiment three times with the default value and changing the
value also. In this fold I change the value of esize and hidden neuron. In the default value the
accuracy is 82.2%. in the same fold when I changed the value of ensemble size from 3 to 2 and
hidden neuron from 1 to 2 then accuracy become 80.2%. in this experiment the average accuracy
is 82.4%.
iv-Fold 4(By Increasing the Hidden layer)
No of pc Min pc E size No hn Av Accuracy
80 20 3 1 2 84.2%
80 20 2 2 2 84.5%
80 20 4 3 2 85.2%
In the fourth fold I also run the experiment three times with the default value and changing the
value also. In this fold I change the value of esize and hidden neuron. In the default value the
accuracy is 84.2%. in the same fold when I changed the value of ensemble size from 3 to 2 and
hidden neuron from 1 to 2 then accuracy become 82.5%. in this experiment the average accuracy
is 85.2%
4. Conclusion
In this assignment we can understand the concept of artificial intelligent and neural
network and related another topic. It is also necessary to understand every topic and
script provided by university. To obtained high accuracy it is also necessary to
understand deep concept of hill climbing, ada-boost, and annealing. Every group member
run their experiment individually and obtained their own result. So to obtained high
accuracy I have run my experiments with default value three times and then I changed
different parameter. The highest accuracy in my group is 96% and my highest accuracy is
85.2% with changed of values. From all these experiments I found that as the hidden
layer increases accuracy also increases.
References
Anon., 2019. facial recognition. [Online]
Available at: https://findbiometrics.com/solutions/facial-recognition/
[Accessed 18 Feburary 2019].
Grady, D., 1993. The Vision Thing: Mainly in the Brain. [Online]
Available at: http://discovermagazine.com/1993/jun/thevisionthingma227
[Accessed 17 2 2019].
Hassaballah, M. & Aly, S., 2014. The Institution of Engineering and Technology. Face recognition:
challenges, achievementsand future directions, 9(4), pp. 614-628.