Feature extraction creates new features
from functions of original features, whereas feature selection returns a subset
of the features. The goal of the subset selection process is to obtain a subset
of features that allows better rates of correct identification than with the
entire set of features. Feature subset selection is an optimization problem,
since the aim is to obtain any subsets that minimize the particular measure. An
optimization problem can be solved through stochastic algorithms. In this
study, for better accuracy, hybrid firefly algorithm is proposed for feature selection
A. Firefly algorithm
Firefly is an insect that mostly
produces short and rhythmic flashes that produced by a process of
bioluminescence. The function of the flashing light is to attract partners
(communication) or attract potential prey and as a protective warning toward
the predator. Thus, this intensity of light is the factor of the other fireflies
to move toward the other firefly.
The light intensity is varied at the
distance from the eyes of the beholder. It is safe to say that the light
intensity is decreased as the distance increase. The light intensity also the
influence of the air absorbs by the surroundings, thus the intensity becomes
less appealing as the distance increase.
B. Firefly Rules
Hybrid Firefly algorithm is based on
idealizing the flashing characteristic of fireflies 13-17. The idealized
three rules are:
attracted toward each other regardless of gender.
The attractiveness is
proportional to the brightness, and they both decrease as their distance
increases. Thus for any two flashing fireflies, the less bright one will move
towards the brighter one. If there is no brighter one than a particular
firefly, it will move randomly.
The brightness of a
firefly is determined by the landscape of the objective function. For a
maximization problem, the brightness is proportional to the objective
C. Structure of firefly algorithm
In firefly algorithm, there are two
important variables; the light intensity and attractiveness. A firefly is
attracted towards the other firefly having brighter flash than itself. The
attractiveness is depended with the light intensity.
In the simplest case, for maximization
problems, the brightness I of a firefly at a particular location x can be
chosen as: I (r) ? f (x). However, the
attractiveness ? is relative; it should be seen in the eyes of the beholder or
judged by the other fireflies. In the simplest form, the light intensity I(r)
varies with the distance r monotonically and exponentially (Equation-4).
Sometimes, we may need a function which
decreases monotonically at a slower rate. In this case, we can use the
approximation as follows (Equation-5):
attractiveness is proportional to the light intensity seen by adjacent
fireflies (6), we can now define the variation of attractiveness ? with the
distance r by
where ?0 is the
attractiveness at r = 0. It is worth pointing out that the exponent ?(r*r) can
be replaced by other functions such as ?rm when m > 0.
The distance r between any two
fireflies i and j at xi and xj , respectively, is the
Cartesian distance defined by (Equation-7):
rij = ||xi – xj
|| = .
The movement of a firefly i attracted
to another more attractive (brighter) firefly j is determined by
xit+1 = xit
+?0 e-? ( r(i,j)* r(i,j) ) (xjt
-xit) +?t ?it .
where the second term is due to the
attraction, the third term is randomization with ?t being the
randomization parameter, and ?it is a vector of random
numbers drawn from a Gaussian distribution or uniform distribution at time t.
If ?0 = 0, it becomes a simple random walk. On the other hand, if ?=
0, it reduces to a variant of particle swarm optimization. Furthermore, the
randomization ?it can easily be extended to other
distributions. The hybrid Firefly Algorithm is described as follows:
D. The standard Firefly Algorithm
Objective Function, which is to be
maximized, f(x), x = (x1, x2,…, xd)T
Generate initial population of
fireflies xi ( i = 1, 2,…, m)
Light intensity Ii at xi
is determined by f(xi)
xmax,j, and go to step 6.
Step 6: Calculate the objective function value for vector Ui.
Step 7: Choose better of the two (function value at target and trial point)
using equation (3) for next generation. Step
8: Check whether convergence criterion is met if yes then stop; otherwise
go to step 3.
F. Hybrid Firefly Algorithm(HDFA):
Both the firefly algorithm and Differential Evolution algorithms
have their own advantages and they both work well for a wide range of
optimization problems. The following algorithm describes the HDFA algorithm,
which combines the advantages of Firefly and Diffuse Evolution algorithms.
Algorithm 3 Pseudo-code for the HDFA algorithm
the whole group into two groups: G1 and G2
the populationsG1 and G2
the fitness value of each particle
Do in parallel
Perform FA operation on G1
Perform DE operation on G2 End Do in
Update the global best in the whole
Mix the two groups and regroup them randomly
into new groups: G1 and G2
Evaluate the fitness value of each particle
a terminate-condition is met
Experiments were carried out with the
key stroke data collected from 25 users, with 10 valid samples from each user,
in a span of one month. Duration, latency and digraph timing were measured for
each sample and their mean, median and standard deviation were stored in the
reference file. A system using Visual Basic was created, to organize these
measurements. The system registered each typing entry and stored the
corresponding data in samples’ file. Table 1 shows the measured keystroke
feature values of duration timing of user-1 for the password “welcome” and the
corresponding each key value obtained in milliseconds. The computations as
shown in Table.1 serve as the initial reference signature or template for feature
string. Extracted features are optimized using HDFA. Firefly was implemented
using the algorithm as explained in section 3.
It was observed, from Figure 2, that the convergence
rate of PSO was 58 ms and took 425 generations to reach an optimal solution and
GA took 68 ms and 440 generations to converge and produced only near optimal
solution. ABC was very competitive, performed relatively well and showed lower
computational overhead than PSO and GA and also fewer parameters to set. However,
HDFA has proved to be most efficient algorithm in this case, with convergence
rate as 40 ms and 360 generations to reach the optimum solution; which is in
fact 41 % and 18 % less respectively as compared to those of maximum values
taken by other algorithms.