Professional Documents
Culture Documents
1, August 2014
Abstract—The purpose of this paper is to introduce Artificial The animation program was also written using MATLAB
Neural Network (ANN) based system identification for a programming language and OpenGL is adopted for the
nonlinear dynamics structure of fish school for trajectory animation display. As shown in Figure (1), the fish trunk
tracking problem. A discrete time dynamic model has been and fish fins are designed simultaneously. The former
derived, and the neural network (NN) training data has been consists of seven parts: the nose, the neck plane, the first
collected experimentally using a Simulink model within joint plane (J1), the second joint plane (J2), the third joint
MATLAB program designed for this purpose. This work also plane (J3), the forth joint plane (J4) and the tail. Each part is
seeks to design a user friendly program to automatically defined by a group of six traverse points (A, B, C, D, E, F)
monitor and track the trajectory of the live fish in an aquarium
which are used to compute the control points of bezier-
using two webcams to produce a three dimensions (3D) view of
the acquired trajectory. MATLAB program was used to
spline in the OpenGL render processing. These points are
develop a graphical user interface (GUI) which allows the arranged into two groups: (ABCD) and (AFED), to build the
monitoring user to input experiment specifications such as right-half and the left-half fish body respectively [1]. The
desired tracking time, tracking region and video source (real values of these traverse points are proportional to the real
time directly from webcams vs. cached from the pre-saved robotic fish. It is convenient to change the size of the robotic
files) in addition displaying the acquired videos from two fish model by changing the traverse point's positions by the
webcams, position of the tracked fish (trajectory), and fish slide bars at the right top corner of the MATLAB graphic
velocity. A predictive control approach based on NN is user interface (GUI) menu. In each joint plane, an axis
proposed to provide the control signal(s) that could be used to through points A and D acts as the axis of a virtual servo
control the robotic fish to achieve trajectory tracking task in motor which represents the servo motor in the real robotic
an attempt to design and build autonomous robotic fishes in fish. The model could animate fish-like movement when the
future that are able to reactive to the environment and virtual servo motors turn by each axis in a special way. The
navigate toward the desired location underwater. robotic fish fins include dorsal fin, left pectoral fin and right
pectoral fin. They are designed for future balance control
Keywords—Trajectory; Tracking; Fish Identification; Artificial and up-down motion control.
Neural Networks; Simulink & MATLAB.
III. NEURAL NETWORK BASED DYNAMIC MODEL
I. INTRODUCTION
A major proportion of any control project is spent trying
In nature, fish has astonishing swimming ability after to form an adequate model of the plant [2]. This is where it
thousands years evolution. It is well known that the tuna is claimed that neural network have a great advantage over
swims with high speed and high efficiency, the pike classical techniques because they can be trained with
accelerates in a flash and the eel could swim skilfully into a observed data from the real plant (or an existing model of
narrow hole. Such astonishing swimming ability inspires us the plant), to reproduce the characteristics of the plant, as a
to improve the performance of aquatic man-made robotic black box model. The neural networks are used as nonlinear,
systems, namely Robotic Fish. Instead of the conventional multi-variable function approximation tools.
rotary propeller used in ship or underwater vehicles, the
undulation movement provides the main energy of a robotic The 'training' involves the optimization of the weights in
fish. The observation on a real fish shows that this kind of the network until the knowledge distributed among them is
propulsion is more noiseless, effective, and manoeuvrable sufficient to provide a black-box model of the plant. There
than the propeller-based propulsion [1]. are different methods of adjusting the weights (learning
algorithms), and different neural architectures. For the
II. MODELLING A ROBOTIC FISH purposes of this paper we will use the neural networks for
The fish model was built by using MATLAB in a 3D function approximation. As shown in figure (2), we have
graph as shown in figure (1). some unknown function that we wish to approximate. We
want to adjust the parameters of the network so that it will
produce the same response as the unknown function, if the
same input is applied to both systems [3].
Recent results show that neural-network techniques seem
to be very effective to identify a wide class of complex
nonlinear systems when we have no complete model
information, or even when we consider the controlled plant
as a black box. A possible way to describe a system is in the
Fig. 1. MATLAB 3D robotic fish model. form of the following discrete equation (u is input, y is
output).
DOI: 10.5176/2251-3140_3.1.50
© 2014 GSTF
42
GSTF Journal of BioSciences (JBio) Vol.3 No.1, August 2014
© 2014 GSTF
43
GSTF Journal of BioSciences (JBio) Vol.3 No.1, August 2014
Fig. 5. Results of black and white filtering for two webcams using Simulink
model.
The fish was highlighted in a black and white video Fig. 7. The results of fish blob analysis and centroid function and then fish
stream with the above filtering scheme. To single out the school tracking.
fish with color background, more filtering was required.
This signal was complimented, taking a binary image and The superimposed yellow centroids shown in figure (7)
inverting the value of the pixels. White pixels were turned would track the fish individuals during motion and gives the
black, and black pixels were turned white. This image was exact (x, y and z) coordinates for the 3D trajectory tracking
multiplied by a constant to prevent over saturation of a of each individual. These coordinates are then stored in a
contrasty image. The next several operations were the matrices for using in neural network training.
results of plug-and-play experimentation that again
emphasized the fish. A series of logical operators were VI. GUI PROGRAM DESIGN
applied to the image, XNOR, NAND, and OR functions. Simulink’s video and image processing toolbox gives
These logical operators were used in series and parallel with users an array of functions to modify video feeds. Other
each other, resulting in an image that would function with functions outside of the video and image processing toolbox
the latter parts of the Simulink functions. The Simulink were also applied to the video feed. However, the command
model for this color filtering scheme is shown in figure (6). line of MATLAB held a wider array of functions to
implement on the video feed. Similar models achieving
similar tasks have been created in the command line. As a
work in continual progress, in order to track objects the
designed program using MATLAB’s commands line
performed a series of functions. Users were initially poised
with a Graphical User Interface (GUI) that enables them to
select the required experiment requirements within three
display menus, named (Tracking, Data Graphing, and
Fig. 6. Color filtering subsystem. configuration), see figure (8). Within the Tracking menu we
can choose the region of interest to record within the fish
After the filtering created a video emphasizing our target tank, the video source, sampling rate, and the tracking time.
fish, the model took this video feed and determined the And within the Data Graphing menu we can draw the 3-
locations of the fish. Singling out the fish was the task of a dimensional travel paths for selected objects which
function called “blob analysis” shown within the Simulink generated for analysis of travel path characteristics and fish
model in figure (4). This function took the image and looked behavior. The graph of velocity and acceleration of the
for pixels in a similar region with similar values. These tracked objects also could be chosen for drawing. In the
“blobs” of pixels were further defined with a user inputted configuration menu, the parameters such as tracked fish
value of maximum and minimum blob sizes. For our size, camera calibration, background dilation, secondary
program, the minimum blob size was approximately the dilation could be configured in order to take a video feed
viewable pixel area of a fish swimming directly to or away from a webcam for the region of interest in the fish tank and
from the camera. The maximum blob size was the generate travel path data and also to isolate the desired
approximate pixel area of a fish seen from its side at a near objects to track. Figure (9) shows the fish school trajectory
distance to camera. With these parameters set, the centroid tracking drawing for a fish tank containing four species.
function selected reasonable objects (blobs) from the video Each fish was given a unique color for its trajectory path for
feed and assigned central coordinates (centroids) to these identification purposes.
objects. These centroid values are the position of the fish.
Figure (7) shows the results of fish blob analysis and
centroid function.
© 2014 GSTF
44
GSTF Journal of BioSciences (JBio) Vol.3 No.1, August 2014
© 2014 GSTF
45
GSTF Journal of BioSciences (JBio) Vol.3 No.1, August 2014
This network can be trained offline in batch mode, using The training proceeds according to the selected training
data collected from the operation of the plant. algorithm (trainlm in this case). This is a straightforward
application of batch training. After the training is complete,
IX. PREDICTIVE CONTROL the response of the resulting plant model is displayed, as
The model predictive control method is based on the shown in figure (14). This figure also shows plots for
receding horizon technique [6]. The neural network model difference or error between plant output and neural network
predicts the plant response over a specified time horizon. model output and neural network plant model output (one
The predictions are used by a numerical optimization step ahead prediction).
program to determine the control signal that minimizes the
following performance criterion over the specified horizon.
© 2014 GSTF
46
GSTF Journal of BioSciences (JBio) Vol.3 No.1, August 2014
get good videos suitable for image processing. The image Basrah. His research interests are in biomimetics and control of multiple
swimming robots.
processing algorithm is very sensitive to the environment of
the aquarium under monitoring and the illumination of the Abduladhem A. Ali received his M.Sc. and Ph.D.
aquarium, in addition to that the fish body colour adds degrees from the Department of Electrical
another problem in tracking algorithm therefore we use a Engineering, University of Basrah, Iraq, in 1983 and
1996. He worked as Assistant Lecturer, Lecturer, and
white background to overcome this problem. White Assistant Professor in the same Department from
background, permit mostly automatic detection of 1984, 1987, and 1991, respectively, and then as
individuals in images, and the videos are acquired indoor Assistant Professor and Professor in the Department
without disturbing nature behavior like wind, waves, etc. of Computer Engineering from 1997 and 2004,
respectively. He has worked as a consultant to many
pieces Images reflection from aquarium surfaces was also industrial firms to design industrial control systems. He has published more
treated to enhance the accuracy of the acquired data. than 70 papers, has one patent, and has supervised many M.Sc. and Ph.D.
From these results, many information from the fish school dissertations. He holds the Editor chair for the Iraqi Journal for Electrical
videos can be extracted, such as position, speed, and and Electronic Engineering and is a member of the editorial board for many
acceleration in addition to the main goal of this paper which journals. He was Chairman of the first IEEE International conference on
Energy, Power and Control (EPC-IQ01). His fields of interest are robotics,
is the path trajectory tracking which is useful for several industrial control and intelligent systems. He was the Director of Avicenna
applications. The parameters extracted from the available E-learning center at the University of Basrah, Iraq.
schools were used to train multi-layered feed-forward
artificial neural networks. Various applied networks easily
generated associations between school descriptors and
species identity. Three-dimensional travel paths for selected
objects were generated for analysis of travel path
characteristics and fish behavior. Velocity and acceleration
data was an optional requirement. System identification of a
fish school system was performed using the training data
collected by the MATLAB tracking program. The
experiments requirements were setup through the GUI of the
MATLAB program. Finally the NN system model of a fish
school was used for constructing the predictive controller.
The controller was then used in the future to control the
servo motors of the robotic fish(s) to track the trajectory of
the live fish(s), which is the goal of our next paper.
REFERENCES
[1] J. Liu and H. Hu, “Building a 3d simulator for autonomous navigation
of robotic fishes,” In Proceedings of IEEE/RSJ International
Conference on Intelligent Robots and Systems. Sendai, Japan, pp. 613–
618, October 2004.
[2] M. Smith, D. Neumerkel and S. Hofer, “Neural networks for modelling
and control of a non-linear dynamic system,” In IEEE International
Symposium on Intelligent Control. Glasgow, Scotland, pp. 404-409,
August 1992.
[3] Hagan, M. T., H. B. Demuth and O. De Jesús, “An introduction to the
use of neural networks in control systems,” International Journal of
Robust and Nonlinear Control, vol. 12, Issue 11, pp 959–
985, September 2002.
[4 ] L. A. Chin, R. Lucio, K. Newman and S. Peugh, “Automated Zebrafish
Tracking,” University of Arizona, 2011.
[5] I. J. Leontaritis, S. A. Billings, “Input-Output Parametric Models for
non-linear systems,” Int. Journal of Control, vol. 41, No. 2, pp 329-
344, 1985.
[6] H. Demuth and M. Beale, “Neural network toolbox user's guide,”
version 4, July 2002.
© 2014 GSTF
47