Fish Detection Using Deep Learning

,


Introduction
e ocean is full of mystery and the underwater exploration has always been an exciting topic. Nowadays, robotics has been widely adopted into our daily lives. e AUV is one type of robot, which is gaining more and more attention [1,2]. It must be equipped with a sophisticate onboard computer, Inertial Measurement Unit (IMU), and other sensors to be able to support a preprogrammed navigation system [1]. Authors have experience on design and function of an AUV [3,4] for competitions. e AUV, as shown in Figure 1, is featured with an i7-based industrial motherboard plus an ARM microcontroller. Detail hardware layout and mechanical balancing scheme are introduced in [3,4]. It passed the qualification and became one of the eleven finalists at the 2017 IEEE Singapore AUV Challenge [5]. is competition was hosted in a swimming pool of clear water. e tasks did not need a high-resolution camera, so the major processor was not chosen to be of high performance. A er this the AUV retired from the competition, authors realized it was time to revise the system to conquer real life tasks. As of now, most of the robot control platforms were shi ing to Systems-On-Chip (SOC) [6,7]. To move forward and add more functionalities to the AUV, one goal is to switch from a clear swimming pool environment to a real ocean water condition. erefore, the hardware has to be upgraded to high resolution digital camera along with a powerful onboard computer, such as NVIDIA JETSON AGX XAVIER development board. So, before upgrading the whole system with integrated vision, research on an off-line simulation of the computer vision module was conducted. Fishes of many kinds were chosen to be the objects to build up the training and testing data set. Ocean water conditions vary from place to place. In the Gulf of Mexico where the authors reside, the water is not as clear as in the east or west coast of the United States. us, how to identify fish from the blurred sea water is most challenging in this research. One of the solutions is to adopt ultrasonic technology [8,9]. To some extent, it was proved to be effective for the fish industry where a rough quantity of fish is sufficient enough. However, because of low resolution, it is difficult to differentiate objects in a complex environment that has mixed fishes, turtles, etc. e goal of this research is to investigate the object detection scheme under real sea water through an AUV build-in digital camera. Researchers have successfully adopted the digital camera as a tool for capturing images from the ocean to improve underwater robot vision [10], but the vehicle was remotely operated (ROV) instead of an AUV.

Literature Review
e main contribution of this research is to introduce deep learning methodology to accomplish fish identification in blurry ocean water. As a result, the approach improved computer vision into an AUV system through an applicable neural network.

Computer Vision.
Computer vision uses computers with imaging sensors to imitate human visual functions that extract features from obtained data set, analyse and classify them to assist in decision making. It usually involves many fields of knowledge such as high-level computer programming, image processing, artificial intelligence (AI), and so on. For example, manufacture industry uses it to check the defection or improve the quality from large quantities of products [11,12]. ere are mature applications on face detection and emotion observation at the airport and other security checking points [13][14][15]. Medical doctors' use certain diagnose so ware to assist in identifying tumours and other abnormal tissues from medical imaging [16]. e agricultural industry adopts the computer vision to decision making system for predicting the yield from the field [17]. Google is designing its own self-driving car with a visual range of about 328 feet and the car can recognize traffic signs and avoid pedestrians [18]. Many state-of-the-art examples indicate that computer vision is changing our daily lives. To improve the performance, besides traditional image processing skills, deep learning algorithms which imitate our brain are widely adopted.

Deep Learning.
e concepts of deep learning with neural network has arisen decades ago. It was originally developed by researcher LeCun et al. in 1998 [19]. He designed a fivelayer classifier named LeNet5 using a Convolutional Neural Network (CNN). Due to dramatic improvement in computing power and the explosion of big data, deep learning is able to make tremendous achievements in the past several years. Deep learning is based on big data collected in a certain field. Learning resources from massive data are extremely important. Deep means that a neural network has lots of layers for imitating our brain. With the advent of high-performance GPU, ASIC accelerators, cloud storage, and powerful computing facility, it is now possible to collect, manage, and analyse big data sets. Because only with data sets large enough, can overfitting problems be solved in deep learning. And the enhanced computing power can accelerate the speed of timeconsuming training process.
Deep leaning based approaches are increasingly applied in many fields, and have significant advantage over traditional algorithms in computer vision and object detection. e performance of many robotics systems has been improved by incorporating deep learning. Take Google's AlphaGo as an example, it studied human's learning behavior and in return compete with the famous Go player [20].
To be able to foster deep learning in computer vision, enough examples from images collected beforehand is critical. ImageNet is a good example [21]. One contribution of this research includes developing a database of fish in ocean water to support training and testing. Nevertheless, a learning algorithm is important as well. Traditional computer vision and image processing approaches suffered from the accuracy of feature extraction, while deep learning method can be utilized to improve the technique through neural network.

Neural Network.
Over the past few years, neural networks in deep learning were getting increasingly popular. In 2012, researcher Krizhevsky et al. adopted CNN to accomplish images classification in the ImageNet Large Scale Visual Recognition Challenge [22,23], and the test accuracy was significantly higher than traditional algorithms. Due to this achievement, the interest in deep learning with neural network has been raised [24]. In 2014, Ross et al. proposed an algorithm called Fast R-CNN which aims to convert object identification into a regression problem [25]. e mean average precision was improved by almost 30% compared to the previous best result 53.3% on ImageNet Large Scale Visual Recognition Challenge in 2012. e amount of calculation was massive because features from different sizes of thousands of proposals in each image would be extracted. Since Faster R-CNN reduced the computational burden dramatically, it has been widely adopted recently in computer vision which involves target detection, image classification, and object identification. YOLO proposed in Facebook is also a milestone for corresponding research [26,27].

Materials and Methods
In this paper, a CNN model with image segmentation is introduced for fish detection from in blurry ocean water. Specific data set was developed to support this research. e data augmentation transformation scheme was adopted to obtain more learning resources because the original images in the particular environment are not sufficient for training purpose. To solve the overfitting problem, the dropout algorithm is applied. Because our goal is to incorporate this system into an AUV which requires real-time applications, some trade-offs were discussed to reduce processing time. In this section, detail system design with optimization approaches is addressed.

CNN Architecture.
A CNN model usually consists of many layers, such as an input layer, convolutional layers with nonlinear units, and fully connected layers [28,29]. An example of CNN is demonstrated in Figure 2. e first layer is the input layer which receives image information as learning resources from the outside world. e following layers are convolutional layers, which are responsible for extracting features from images. Convolution operation is one of the common mathematical operations. e convolution formula of two discrete functions is shown in Equation (1): e data set consists of 256 levels of RGB color images. e 3 × 3 matrix, W0 below, is called a kernel or a filter. In practice, convolutional operations are performed on R, G, and B channels respectively, and then the results are summed up to obtain each element in the feature map as shown in Figure 2.
In order to extract the features of an object more accurately, a lot of filters are used in each convolutional layer. For example, to extract features, such as edges, texture, etc., corresponding filters are available as shown in Figure 3.
When performing the convolutional operation, the size of the feature map is under consideration. ere are three main factors that influence its size: depth, stride, and padding. Figure 4 illustrates the feature map where depth is 3, stride is 1, and with zero padding.
For a complex neural network, usually there are two types of connections between two adjacent layers. ey are the fully connected layer and locally connected neural layer respectively as illustrated in Figure 5. For a fully connected neural net, all pixels in the input layer are connected with each neuron in the hidden layer as shown in Figure 5(a). It is common that the last two layers in a CNN are fully connected layers. ey are the so max and output layer, respectively. Because a huge number of parameters will increase the amount of computation and delay the processing. For a locally connected neural network, only a portion of pixels in the input layer are connected with the following neuron in the hidden layer as shown Filter W0 Applied Computational Intelligence and So Computing 4 truth images are obtained from operate LabelImg so ware manually. Each image is divided into a grid of 7 × 7 cells. Each cell will predict the two bounding boxes location information and class information made up of a 1 × 1 × 30 vector. is vector consists of object centre coordinates (푋, 푌), the width , and height ℎ of the bounding box confidence scores, and predicted probabilities of fish, as shown in Figure 8.
To predict the target location of an image, the target is displayed in a bounding box. ere are always errors between the ground truth and the predictions. Loss function was developed to measure errors consisting of three parts: coordinate error, (Intersection over union) IoU error, and class error. Equation (2) gives the mathematics form of the loss function.
Here, IoU is used to measure position accuracy as shown in Figure 9.
Each grid cell in an image will predict bounding boxes that encloses an object to predict the object localization and class. In addition, there is a confidence with each bounding box. Confidence score has nothing to do with the class of object. It just depicts how certain it is that the predicted box actually encloses the real object.
where Pr(object) represents the probability of the object of interest. If there is an object in the grid cell, the Pr(object) is 1; otherwise, it is 0.
Usually, loss function is in the form of the sum of squared errors as shown below [33]. It consists of three parts which are localization errors, confidence errors, and probabilities errors.
where , are the ground truth coordinates of objects center; w , ℎ are the width and height of the ground truth bounding box; ̂ , ̂ are the predicted coordinates of the objects center; ŵ , ĥ are the width and height of predicted bounding box.
Above Figure 10 shows one set of output with confidence values from different classes.
in Figure 5(b). is type of connection will reduce the number of connections and speed up the system. e Convolutional layer in CNN uses local connections as shown in Figure 6. For example, the value-8 in the feature map is only connected with a 3 × 3 matrix [0, 0, 0; 0, 1, 1; 0, 1, 2] from input image and has nothing to do with the remaining parts of the input image pixels. e parameters for fully or local connectivity for all the layers in this CNN are listed in Table 1.
e system can be visualized with simplification in Figure 7.

System Validation Using ImageNET
Dataset. Before applying this system into the ocean fish data set developed in this research, authors downloaded images from the wellknown ImageNet ILSVRC [21] to do a system validation testing through object classification. ere are 500 images with 20 classes ranging from fish, coral, sea turtle, frog, ship, etc. Here all the RGB images are rescaled to 448 × 448. Ground problem. Images were collected in real underwater environment from the Gulf of Mexico and are going to be used to attract object features. However, the number of original images collected from a particular environment is not large enough to train the system. erefore, data augmentation transformation was performed geometrically, which changed the pixels location while the images features remained unchanged as shown in Figure 12. Four types of data augmentation transformation were adopted, which doubled the number of original images to make the training dataset sufficient.

Dropout Algorithm.
One of the common problems in deep learning is overfitting, which refers to the fact that the testing

Ground Truth Preparation for Real Ocean Environment.
A er testing the CNN system with perfect images without noise. Next step is to build our own dataset of fish in the ocean. Because it is difficult to obtain images from other kinds of objects such as the sea turtle, coral and so on. is part of the research, fish is the only object to be detected. For the collection of 410 images, many of them have multiple fish in one image, so the detection is challenging. e same method was chosen to create ground truth image. And all the parameters introduced before remain the same, only the class information is made up of a 1 × 1 × 18 vector instead of 1 × 1 × 30 because of reduce in the classes. Figure 11 illustrates one labelled image example. It is obvious that this data set is totally different from the ideal images from ImageNET.

Data Augmentation
Since deep learning is based on large training dataset for the system to learn and build up the identification knowledge, enough data has to be provided as learning resources to extract object features [34]. e lacking of data would bring overfitting   dropout removes a hidden fixed relationship between nodes, anti-interference ability can be improved and overfitting problem can be solved to some extent. L1 and L2 regularization are accuracy is much lower than the training accuracy. In this case, a model with high performance feature is built using real world training data. If it turns out to have overfitting issue, the robustness of the model is worth consideration. Apart from the lacking of learning data, which will also cause overfitting problem, the huge amount of parameters in a neural network would lead to the overfitting issue. erefore, the dropout algorithm [35] was introduced into the system to simplify the model, which is depicted in Figure 5. Dropout means that we remove some nodes temporarily from the network according to the probability setting in the process of learning. In practice, some features can be extracted only when some hidden relationships exist, which decreased the robustness of the deep learning model. On the other hand,   Turtle: con dence 0.638 Coral: con dence 0.59 Le sh: con dence 0.51 Right sh: con dence 0.43 Fish: con dence 0.37 F 10: Object classification results from ImageNET data set. Applied Computational Intelligence and So Computing 8 denote the object location, while w and ℎ refer to the width and height of the bounding box. In order to have more weight in the first two terms, was assigned to be the largest number, which had a value of 5. us, the weight of localization error got enhanced. In terms of IoU error computation, when the object center falls in this cell, the weight of IoU error should be increased in order to predict location accurately. e value of is set to be 0.5 to refine the IoU error. For the same error value, the effect of large object error on the detection should be less than the effect of small object error on the detection. is is because the same bias accounts for the proportion of large objects is much smaller than the proportion of the same deviation to small objects. erefore, it is supposed to increase the contribution to loss due to bigger object IoU error. Square roots of width and height were chosen to replace their original forms. For same bias value, the square root error from the big box is smaller than the small one. achieved by modifying the cost function, while dropout is implemented by modifying the neural network itself, which is a technique used when training the network. In each iteration of the training process, authors randomly drop some of the neurons, and set the probability of eliminating nodes in the neural network for each layer of the network. For example, the value is set to 0.5, as shown in Figure 13 on the le . e neurons are discarded, then the connections from the node are removed, and finally a network with fewer nodes and smaller scales is obtained. e network structure during this training will be simplified to the one shown in Figure 13 on the right. (4) and (5), [26]. ree coefficients were placed before the error terms in proportion to its contribution to the loss. As shown in Equation (5), the first two terms are related to coordinate the identified object with and to e last term is the L2 regularization term, which is the sum of the squares of all the parameters w, divided by the sample size of the training set. is the coefficient of the regular term, which weighs the proportion of the regular term and the other terms.

Refine Loss Function. YOLO improved loss function from Equations
ere is also a coefficient 1/2, 1/2 is o en seen, mainly for the In this paper, authors refined the loss function to fit for multiple fish application. e proposed loss function is regularized to reduce the small dataset and overfitting problem, L2 regularization is to add a regularization function a er the cost function which is listed in the Equations (6) and (7). GPU with 4G memory. e experiment is carried out by the three criterions aforementioned, the performance, training loss, and testing loss are compared respectively.

Experimental Results from Data
Augmentation. e number of images is doubled by taking data augmentation transformation approach, which means this methodology could assist the machine to learn the feature more accurately. We used the test dataset to evaluate our model. It turns out that with data augmentation, the machine can identify the objects of interest convenience of the results of the latter, the latter will produce a 2, multiplied by 1/2 just rounded up. e principle and procedure of how L2 reduce overfitting is in the reference [31].

Results and Discussion
e experiment implementations are based on the publicly available Tensorflow toolbox and Python language programming. e hardware platform is built on a GeForce GTX 745 from this network. In this wary, a simplified deep neural network is obtained. Figure 17 shows the average confidence for each sample image is greatly improved; the effectiveness of identification by dropout approach is highly enhanced. e training loss of dropout is illustrated in Figure 18. As we can see, the final training loss is 0.28 with dropout, and 0.35 without. e dropout algorithm can help reduce the training loss. In this specific application, when dropout is 0.85, the training loss is smallest all the time (Figure 18).
A er conducted dropout approach, we can see from Figure 19, the difference between training loss and test loss decreased from 0.03 to 0.004. ere is only a slight difference between training loss and test loss with dropout. e overfitting problem got resolved to a great extent. erefore, the model we built is applicable.

Experimental Results from Loss Function Om Algorithm
Performance. Authors used the CNN model with image more accurately than the result without data augmentation, the experiment result is clearly shown in Figure 14.
From Figure 14, it is clear that the fish in the image is identified accurately; the average confidence is 0.568, 0.65, and 0.59 respectively for the three sample images.
From Figure 15, it is observed that the final training loss of the proposed neural network model using original data is 0.35 while the final training loss using data augmentation is 0.46. is clearly demonstrates that the data augmentation transformation is much helpful to reduce the training loss. Figure 16 illustrates the training loss with the increase on the number of iterations. e iteration times are set from 0 to 600. e difference between training loss and test loss is decreased from 1.6 to 0.46 and 0.35 respectively. e overfitting problem was solved to a great extent.

Conflicts of Interest
e authors declare that they have no conflicts of interest regarding the publication of this paper. segmentation and back-propagated the gradient of refined loss function and update the parameters in the network. With the refinement of loss function, the prediction get more accurate as clearly shown in Figure 20.
As shown in Figure 21, when the iteration times are 575, it converges. e final training loss is 0.18. However, with sumsquared loss function, the convergent point is 0.27 when the iteration times are 650.

Discussions.
With the design and the choices of optimization, a deep learning based fish detection module was designed and simulated. With the improved accuracy and reduced processing time, it is very promising to adopt the proposed method to an AUV for implementation. e Tensorflow toolbox and Python programming interface are compatible with current advanced microcontroller platforms.

Conclusion
In this paper, authors built a neural network model to accomplish fish detection. To support the training process with enough dataset, the data augmentation approach was conducted. Dropout algorithm was selected to solve the overfitting problem. Moreover, loss function was refined to update the parameters inside the network. By these approaches, both the training time and the training loss were reduced dramatically. To summarize the contribution of this article: (1) Establish the data set to include real blur ocean water condition; (2) Revise loss function and other parameters in CNN to explore an applicable solution for fish detection; (3) e system is targeted at an embedded system for AUV design with all possible optimizations.
Data Availability e program and image data used to support the findings of this study are available from the corresponding author upon request.