You are on page 1of 10

A Fish Detection Approach Based on BAT

Algorithm

Abstract. Fish detection and identi cation are important steps towards
monitoring sh behavior. The importance of such monitoring step comes
from the need for better understanding of the sh ecology and issuing
conservative actions for keeping the safety of this vital food resource.
The recent advances in machine learning approaches allow many appli-
cations to easily analyze and detect a number of sh species. The main
competence between these approaches is based on two main detection
parameters: the time and the accuracy measurements. Therefore, this
paper proposes a sh detection approach based on BAT optimization
algorithm (BA). This approach aims to reduce the classi cation time
within the sh detection process. The performance of this system was
evaluated by a number of well-known machine learning classi ers, KNN,
ANN, and SVM. The approach was tested with 151 images to detect the
Nile Tilapia sh species and the results showed that k-NN can achieve
high accuracy 90%, with feature reduction ratio close to 61% along with
a noticeable decrease in the classi cation time.

Keywords: BAT algorithm, SURF, Fish detection, Tilapia Fish, k-NN,


ANN, SVM,

1 Introduction

A great number of sh species over the world su ers from pollution and over-shing
practices. Moreover, the human construction through rivers such as dams that
negatively a ects the number of shes and their diet sources. Monitoring of any
diversity change in the quantities of any sh species is important to ensure the
sustainability of one of the protein sources for the world populations. Usu-ally the
common methods used by marine biologists are human observations,
II

caught and counted using casting nets, or using sonars [1]. Recently, computer
vision [13, 15, 17, 18], relying on the application of machine learning techniques
[2] [3], are used to detect, count, classify and study sh behavior of di erent sh
species.
Several studies have considered the sh detection and species recognition in
water, such as the work in [2] where the authors used an underwater camera to
detect swimming sh in an open sea. The proposed model is based on inter-class
similarities to construct a hierarchical tree classi cation. The trajectory voting is
used as a second phase to eliminate the unknown classes or less con dent
decisions. Although the model can classify 15 species of sh with a hight accuracy
that reached 97.5% using the at Support Vector Machine (SVM) classi er, but the
model may reject new sh species which are not been sampled within the model.
These rejected classes may require further analysis.
Since the shape extraction is important for species recognition, a number
of approaches use it as reference for sh classi cation. Examples include using
the Principal Component Analysis (PCA) to detect sh through the shape
knowl-edge [3]. The Haar-classi er is trained to locating snout and tail of sh in
the underwater image sequences. The detection of both snout and tail points
are used as references for constructing the shape model of the sh. to e ciently
cap-ture the main variations of a training set, the PCA statistical procedure is
used to remove poor contrast boundaries, background clutter and occlusions
caused by overlapping with neighboring sh.
Accurate extraction of the shape is important for sh classi cation. However,
the shape extraction may fail if it relies on outer boundary (edge) detection [4]
as shape cannot be detected correctly if the scene is unclear or contains a
large swarm of sh [5]. One of the solution is to use color information along
with the shape as the work reported in [6]. This work used the neural networks
to detect stationary species in deep sea.
To evaluate which feature extraction technique could be e cient for the clas-si
cation accuracy, a comparison in [7] was conducted between a Scale Invariant
Feature Transform (SIFT), a Speed Up Robust Features (SURF) algorithms. The
evaluation results showed the superiority of the Support Vector Machine (SVM)
over Arti cial Neural Networks (ANN) and k-Nearest Neighbor (k-NN) algorithms
when they applied to the SURF-based and SIFT-based features. The a SVM
classi er using the the linear function achieved at 94.44% using the SURF-based
features and 69.57% using the SIFT-based features.
The rest of this paper is organized as follows: Section (2) gives an
overview about the BAT algorithm and Section (3) presents the proposed
system. The results and the discussion are reported in Section (4). The paper
is concluded in Section (5).

2 The Bat Algorithm: An Overview

The bat bird has a distinguish strategy for tracking its preys and avoiding ob-
stacles. This aying animal uses the echolocation process for navigation and it
III

has the ability to di erentiate between the sending signals and their re ections.
The re ected signals is used for measuring the distance between the bat and
the prey. Yang [8] has studied the bat behavior and proposed a new meta-
heuristic optimization algorithm known as The Bat Algorithm. This algorithm
can be modeled using the following three general rules [9]:

{ The bats use echolocation sensing to measure the distance and they can
easily distinguish between the prey and obstacles.
{ Each bat x minimum frequency, varying wavelength, and loudness through
their random searching for a prey. Based on the proximity of the prey,
each bat can adjust its frequency of their emitted pulses.
{ The variation of loudness should be limited through a constant range of
values

As a meta-heuristic algorithm, the bat optimization generates a number of


new solutions within the search space through adjusting frequency, and
updating velocities till a single solution is ranked among the best found
solutions [10], Al-gorithm 1 shows the general structure of the BA. This meta-
heuristic algorithm has been applied widely in a number of structural
optimization problems such as in [10],[11], and [12].

foreach Input image do

1. Initialize the bat positions Xi and Velocity Vi and de ne the pulse frequency Fi, the
pulse emission rate ri and the loudness Ai per bat.
2. While stopping criteria are not met
a For every bat
i Generate a new solution by calculating the updated frequency, velocity and
position.
ii If rand > ri then
{ Select a solution among the best solutions set and perform a random
local search around it.
iii End If
iv Generate a new random solution
v If rand < Ai and F (Xi) < F (X )
{ Accept the new solution
{ Increase ri and decrease Ai
vi End If
vii Reselect the best solution X
b End For
3. End While

end
Algorithm 1: Bat Algorithm (BAT)
IV

3 The Proposed Approach

The proposed approach can be divided into two main procedures: the training
procedure and the testing procedure. Each of these procedures consists from
a number of phases as illustrated in Figure 1. A description of these phases
are give below.

Fig. 1. The Proposed Detection Approach

In the training procedure, the approach starts by a set of n raw-images that


pass through a pre-processing phase to unify their scale-invariance and to reduce
the noise levels. Then, in order to focus on the intensity information within the
image, the pre-porcessed images were converted from RGB image to gray-scale.
In the feature extraction phase, the SURF algorithm was applied. The algorithm
selects the Hessian matrix based detector to determine the region of interest for
each image I 2 n at the scale as illustrated in equation 1 .
2 3
Ixx(x; ) Ixy(x; )
H=4 5: (1)
Ixy(x; ) Iyy(x; )

where Ixx is the second order Gaussian smoothed image derivatives which
detects signal changes in two orthogonal directions.
The SURF algorithm determines for each feature a 44 sub-window to give
a description for each feature as weighted wavelet coe cients after calculating
the Haar wavelet response in horizontal and vertical directions. As a result,
V

the nal deliverable of the SURF is a 64 dimensional vector(V ) of descrip-tors


for each I image [14]. Finally, the features were labeled according to the
corresponding classes. The following formula models the feature vector:

n
V = fxI ; yI gI =1 (2)
where xi represents the features of interest and y i describes the class label
(Tilapia, or Non-Tilapia Class).
The produced features vector was then given as an input to the optimiza-
tion phase at which the BA was applied to reduce the number of features.
Such process aims to minimize the classi cation time while keep the classi
cation accuracy at high rate. Table 1 shows the values adjust for the BA within
the optimization phase. The output of the optimization phase, i.e. the reduced
fea-ture vector, was then given to a number of machine learning classi ers to
test the classi cation accuracy and to be build the model.

Table 1. The BAT Adjusted Parameters

Parameter Value(s)
No. of Bats 5
Num. of Itterations 100
Loudness (A) 0.5
Pulse rate (r) 0.5
Frequency minimum (Qmin) 0
Frequency maximum (Qmax) 2
Problem Dimension SURF features vector = 64 dimensions
Search Domain [0, 1]

0
In the testing procedure, a set of unlabeled images n was used. This set
went through the same pre-processing and feature extraction phases which
were done in the training procedure. As illustrated in Figure (1), before the
classi cation phase of the testing procedure, the produced features vector was
passed to a logical gate function so this vector is ltered by the reduced vector
obtained in the optimization phase done in the training procedure. This
process will avoid running the BAT algorithm again in the testing procedure.
It is worth noting that, the BAT algorithm used for feature selection was
considered the following points: (1) The solution space here represents all possi-
ble solutions of features and hence the bat positions represent a binary selection
of feature sets, (2) Each feature is considered as an individual dimension with
uniform distribution in range of [0; 1]. To decide if a feature will be selected or not,
its position value will be threshold with a constant threshold ("). (3) The selection
parameter (") is very e ective in the performance of the bat algorithm as it controls
the diversity of the solution obtained at a given iteration. So, in this work we made
adaptive tuning for the selection parameter (") through-out iteration numbers. In
the beginning of the iterations, there was a need for
VI

large diversity, hence a large value of (") was adjusted for more exploration and
discovering through the search space for an optimal solution. At the end of op-
timization approach, the bats should reach near the optimal solution, therefore, a
less diversity is required (intensi cation the search near this solution), so a
minimum value for (") was set. The initial value for the (") was set as half of the
search range, to be inside the search space and it is only an initial value. The
parameter (") is calculated in each iteration using equation (3).

"="0 t "0 ; (3)


N
gen

where "0 is the initial value for ", t is the iteration number, and N gen is the
maximum number of iterations for the BAT optimization.

4 Experimental Results and Discussion

The proposed sh classi cation approach was implemented using the MATLAB
simulation tool. A self-collected database for sh was used. This is because
there is no well-known data set for Nile Tilapia sh. The database was
collected through capturing a number of sh photos with di erent
transformations (scale change, rotation, illumination, image blur, viewpoint
change, and compression). The dataset consists of 96 images of Tilapia sh
and 55 images of Non-Tilapia sh, Figure 2 shows samples of these images.

Fig. 2. Sample images of the Nile Tilapia data set

To evaluate that the aim of our proposed system, achieving high accuracy
rate using the least features optimized by the BAT algorithm, two scenarios
were designed. The rst scenario was to the classi cation rate before and after
applying the BA to the feature extracted by the SURF algorithm. Table 2 sum-
marizes the reduction ratio obtained by running di erent experiments using BA
and without using BA. So, in the second scenarios, we will see if a small set
(op-timal feature set) of these features may be enough to indicate the classi
cation results within shorten time.
The secondly scenario was to test the compatibility of the approach with a
number of classi ers such as the Arti cial Neural Network (ANN), the k-Nearest
Neighbors(k-NN), and the Support Vector Machine that based on the radial basis
function kernel (SVM-rbf). The ratio between the number of correct and false
0
matches among the reference images and the set of n has been used
VII

Table 2. BA Features’ Reduction Ratio classi er

Experiment BA Features’ Reduc-


No. tion Ratio (%)
1 39.0
2 53.0
3 45.3
4 48.4
5 45.3
6 40.6
7 46.8
8 56.2
9 60.9
10 54.6
11 57.8

as an evaluation criteria of the classi cation results. Moreover, the results of


these classi ers were evaluated using two well-known statistical equations
[16]; the recall (equation 4), and the precision (equation 5) along with the
accuracy measurements.

Recall = no: of correctpositives (4)


total no: of positives
no: of correct positives
(5)
P recision =
no: of correct positives + no: of f alse positives
The results of the second scenario are summarized in Tables 3, 4, and 5.
These results reported that the redaction ratio positively a ected the classi -
cation time (taken short time) while at the same time achieving high accuracy,
reaching 100% in some experiments.
Since the BA is one of the stochastic-based global optimization algorithm,
some results may deviated (noisy) based on the quality of the selected
features as it is appear within the outputs of some experiments. Despite this
fact, the BA reduction showed superior classi cation precision, recall, and
accuracy with the k-NN classi er. For example experiment number 9 where
the accuracy increase from 66.6% to 87.5% with a feature reduction ratio near
to 61% along with a decrease in classi cation time reached to 11%. So, it can
be claimed that the reduction of features gained by BA improved the accuracy
rate of most of the experiments conducted by each of the used classi ers. The
reason behind this is that the classi er performance improved as the reduction
phase removed the noisy and duplicate features.
Unlike the results obtained by [7], the k-NN in our proposed system showed its
superiority over the other tested classi ers in terms of accuracy and time
reduction. Its accuracy reached near to 90% in some experiments. Also, one of
the ndings of this paper is that the ANN classi er required a higher classi cation
VIII

Table 3. Results of Tilapia detection based on k-NN classi er

Exp. Precision(%) Recall(%) Accuracy(%) Classi cation Time (Sec)


No. No BA With BA No BA With BA No BA With BA No BA With BA
1 50 88.9 22 88.9 30.7 88.9 1.041248 0.94
2 66.5 80 22 44 33 57 1.127216 0.91
3 75 100 33 44 46 61.5 1.06 0.98
4 75 100 66.5 55.5 70.5 71 1.10 1.12
5 83 100 55.5 44 66.5 61.5 1.11 0.98
6 100 85 55.5 66.5 71 75 1.04 1.40
7 83 85 55.5 66.5 66.5 75 1.03 0.43
8 100 100 22 77.8 36 87.5 3.68 1.06
9 83 100 55.5 77.8 66.5 87.5 1.11 0.99
10 100 100 33 33 50 50 1.41 0.96
11 66.5 100 22 55.5 33 71.4 1.023 0.97

Table 4. Results of Tilapia detection based on ANN classi er

Exp. Precision(%) Recall(%) Accuracy(%) Classi cation Time (Sec)


No. No BA With BA No BA With BA No BA With BA No BA With BA
1 58.3 66.5 77.8 88.9 66.5 76 79.09 103.18
2 54.5 66.5 66.5 88.9 60 76 105.95 72.15
3 57 63.6 88.9 77.8 69.5 70 58.83 82.21
4 53.8 55.5 77.8 55.5 63.6 55.5 88.63 97.26
5 71.4 85.7 55.5 66.5 62.5 75 87.32 78.58
6 71.4 77.8 55.5 77.8 62.5 77.8 78.72 40.77
7 71.4 60 55.5 66.5 62.5 63 97.01 70.36
8 55.5 85.7 55.5 66.5 55.5 75 84.05 134.38
9 63.6 50 77 55.5 70 52.6 87.22 75.34
10 85.7 80 66.5 88.9 75 84 71.76 77.39
11 60 60 66.5 33 63 43 108.64 103.03

Table 5. Results of Tilapia detection based on SVM classi er

Exp. Precision(%) Recall(%) Accuracy(%) Classi cation Time (Sec)


No. No BA With BA No BA With BA No BA With BA No BA With BA
1 66.5 63.6 66.5 77.8 66.5 70 1.29 1.13
2 60 63.6 66.5 77.78 63 70 1.59 1.19
3 66.5 57 88.9 88.9 76 69.5 1.37 1.24
4 77.8 62.5 77.8 55.5 77.8 63 1.43 1.28
5 85.7 66.5 66.5 66.5 75 66.5 1.30 1.37
6 75 87.5 66.5 77.8 70.5 84 1.26 2.51
7 55.5 66.5 55.5 66.5 55.5 66.5 1.29 1.24
8 70 80 77.8 88.9 73.7 82 1.65 1.55
9 100 70 44 77.8 78 73.7 1.69 2.77
10 60 87.5 66.5 77.8 63 84 1.44 1.43
11 85.7 85.7 66.5 66.5 75 75 1.23 1.30
IX

times than the others, this time is usually consumed through the
establishment procedure of the neural network structure. Another important
nding is that both the ANN and SVM reached quickly to a hyperplane decision
for some experiments.

5 Conclusions and Future Directions

The current paper introduced an approach for sh detection and identi cation.
The approach made use of the BAT algorithm to reduce the number of
features extracted using the SURF algorithm. These features were used to
classify the Nile Tilapia species (the used data set). The experimental results
showed when the BAT algorithm has improved the classi cation rate (K-NN,
ANN, and SVM were used) while at the same time classi cation time was
minimized. It was proved that the k-NN is the best one among (ANN, and
SVM) in terms of classi cation time and accuracy. The other classi ers (ANN,
and SVM) may need more modi cations for more enhancements for the
detection accuracy and lowering the classi cation time. Further researches
may provide these required enhancements.

6 Acknowledgment

This paper has been elaborated in the framework of the project New creative teams
in priorities of scienti c research, reg. no. CZ.1.07/2.3.00/30.0055, sup-ported by
Operational Programme Education for Competitiveness and co- nanced by the
European Social Fund and the state budget of the Czech Republic and supported by
the IT4Innovations Centre of Excellence project (CZ.1.05/1.1.00/02.0070), funded by
the European Regional Development Fund and the national budget
of the Czech Republic via the Research and Development for Innovations
Oper-ational Programme.

This work was partially supported by the IPROCOM Marie Curie initial
training network, funded through the People Programme (Marie Curie Actions)
of the European Union’s Seventh Framework Programme FP7/2007-2013/
under REA grant agreement No. 316555. This fund only apply for one author
(Hossam M. Zawbaa).

Also, we wish to acknowledge the e orts of Rehab Adly Shehabeldin who


supports in the data set collection process.

References

1. Wol , Lars M., and Sabah Badri-Hoeher. "Imaging sonar-based sh detection in


shallow waters." In Oceans-St. John’s, IEEE, pp. 1-6., 2014.
X

2. Huang, Phoenix X., Bastiaan J. Boom, and Robert B. Fisher. "Hierarchical classi - cation
with reject option for live sh recognition." Machine Vision and Applications 26, no. 1, pp.
89-102, 2014.
3.Ravanbakhsh, Mehdi, Mark R. Shortis, Faisal Shafait, Ajmal Mian, Euan S. Har-vey, and James
W. Seager. "Automated Fish Detection in Underwater Images Using ShapeBased Level Sets."
The Photogrammetric Record 30, no. 149, pp. 46-62, 2015.
4. Ravanbakhsh, Mehdi, M. Shortis, F. Shafait, Ajmal Mian, Euan Harvey, and J. Sea-ger.
"An application of shape-based level sets to sh detection in underwater images." In
Geospatial Science Research 3 Symposium (GSR 3), Rheinisch-Westfaelische Tech-
nische Hochschule Aachen Lehrstuhl Informatik V, vol. 1307, pp. 1-9, 2014.
5. Shortis, Mark R., Mehdi Ravanbakskh, Faisal Shaifat, Euan S. Harvey, Ajmal Mian,
James W. Seager, Philip F. Culverhouse, Danelle E. Cline, and Duane R. Edgington. "A
review of techniques for the identi cation and measurement of sh in underwater stereo-
video image sequences." In SPIE Optical Metrology, International Society for Optics and
Photonics, pp. 87910G-87910G, 2013.

You might also like